From e9944e3c23f8a2d807c059cc83943ac2aae87dc0 Mon Sep 17 00:00:00 2001 From: web3cdn Date: Fri, 8 Sep 2023 13:13:02 +0300 Subject: [PATCH 1/3] Crescent Cosmos Subql Starter --- Crescent/crescent-starter/LICENSE | 21 + Crescent/crescent-starter/README.md | 89 + Crescent/crescent-starter/docker-compose.yml | 66 + .../docker/load-extensions.sh | 5 + .../crescent-starter/docker/pg-Dockerfile | 12 + Crescent/crescent-starter/package.json | 37 + Crescent/crescent-starter/project.yaml | 58 + .../proto/cosmos/gov/v1beta1/gov.proto | 200 ++ .../proto/cosmos/gov/v1beta1/tx.proto | 99 + .../proto/cosmos/slashing/v1beta1/gogo.proto | 144 ++ .../proto/cosmos/slashing/v1beta1/msg.proto | 22 + .../proto/cosmos/slashing/v1beta1/query.proto | 64 + .../cosmos/slashing/v1beta1/slashing.proto | 45 + .../proto/cosmos/slashing/v1beta1/tx.proto | 30 + .../proto/gogoproto/gogo.proto | 144 ++ Crescent/crescent-starter/schema.graphql | 32 + Crescent/crescent-starter/src/index.ts | 2 + .../src/mappings/mappingHandlers.ts | 65 + .../src/test/mappingHandlers.test.ts | 12 + .../src/types/CosmosMessageTypes.ts | 17 + Crescent/crescent-starter/src/types/index.ts | 7 + .../src/types/models/Message.ts | 101 + .../src/types/models/TransferEvent.ts | 101 + .../src/types/models/index.ts | 8 + .../types/proto-interfaces/confio/proofs.ts | 753 ++++++ .../cosmos/app/v1alpha1/config.ts | 102 + .../cosmos/app/v1alpha1/module.ts | 206 ++ .../cosmos/auth/v1beta1/auth.ts | 101 + .../cosmos/auth/v1beta1/genesis.ts | 29 + .../cosmos/authz/v1beta1/authz.ts | 134 + .../cosmos/authz/v1beta1/event.ts | 64 + .../cosmos/authz/v1beta1/genesis.ts | 21 + .../cosmos/authz/v1beta1/tx.ts | 165 ++ .../cosmos/bank/v1beta1/authz.ts | 36 + .../cosmos/bank/v1beta1/bank.ts | 296 +++ .../cosmos/bank/v1beta1/genesis.ts | 81 + .../cosmos/bank/v1beta1/tx.ts | 79 + .../cosmos/base/abci/v1beta1/abci.ts | 472 ++++ .../cosmos/base/kv/v1beta1/kv.ts | 43 + .../cosmos/base/query/v1beta1/pagination.ts | 172 ++ .../base/reflection/v1beta1/reflection.ts | 96 + .../base/reflection/v2alpha1/reflection.ts | 700 ++++++ .../cosmos/base/snapshots/v1beta1/snapshot.ts | 229 ++ .../cosmos/base/store/v1beta1/commit_info.ts | 97 + .../cosmos/base/store/v1beta1/listening.ts | 51 + .../cosmos/base/v1beta1/coin.ts | 116 + .../types/proto-interfaces/cosmos/bundle.ts | 298 +++ .../cosmos/capability/v1beta1/capability.ts | 91 + .../cosmos/capability/v1beta1/genesis.ts | 62 + .../cosmos/crisis/v1beta1/genesis.ts | 29 + .../cosmos/crisis/v1beta1/tx.ts | 40 + .../cosmos/crypto/ed25519/keys.ts | 67 + .../cosmos/crypto/hd/v1/hd.ts | 48 + .../cosmos/crypto/keyring/v1/record.ts | 129 + .../cosmos/crypto/multisig/keys.ts | 36 + .../crypto/multisig/v1beta1/multisig.ts | 70 + .../cosmos/crypto/secp256k1/keys.ts | 58 + .../cosmos/crypto/secp256r1/keys.ts | 50 + .../distribution/v1beta1/distribution.ts | 425 ++++ .../cosmos/distribution/v1beta1/genesis.ts | 309 +++ .../cosmos/distribution/v1beta1/tx.ts | 194 ++ .../cosmos/evidence/v1beta1/evidence.ts | 39 + .../cosmos/evidence/v1beta1/genesis.ts | 23 + .../cosmos/evidence/v1beta1/tx.ts | 55 + .../cosmos/feegrant/v1beta1/feegrant.ts | 177 ++ .../cosmos/feegrant/v1beta1/genesis.ts | 21 + .../cosmos/feegrant/v1beta1/tx.ts | 97 + .../cosmos/genutil/v1beta1/genesis.ts | 22 + .../proto-interfaces/cosmos/gov/v1/genesis.ts | 54 + .../proto-interfaces/cosmos/gov/v1/gov.ts | 423 ++++ .../proto-interfaces/cosmos/gov/v1/tx.ts | 240 ++ .../cosmos/gov/v1beta1/genesis.ts | 54 + .../cosmos/gov/v1beta1/gov.ts | 465 ++++ .../proto-interfaces/cosmos/gov/v1beta1/tx.ts | 203 ++ .../cosmos/group/v1/events.ts | 210 ++ .../cosmos/group/v1/genesis.ts | 77 + .../proto-interfaces/cosmos/group/v1/tx.ts | 778 ++++++ .../proto-interfaces/cosmos/group/v1/types.ts | 753 ++++++ .../cosmos/mint/v1beta1/genesis.ts | 28 + .../cosmos/mint/v1beta1/mint.ts | 75 + .../proto-interfaces/cosmos/msg/v1/msg.ts | 1 + .../cosmos/nft/v1beta1/event.ts | 81 + .../cosmos/nft/v1beta1/genesis.ts | 53 + .../cosmos/nft/v1beta1/nft.ts | 95 + .../proto-interfaces/cosmos/nft/v1beta1/tx.ts | 51 + .../proto-interfaces/cosmos/orm/v1/orm.ts | 227 ++ .../cosmos/orm/v1alpha1/schema.ts | 170 ++ .../cosmos/params/v1beta1/params.ts | 61 + .../cosmos/slashing/v1beta1/genesis.ts | 136 + .../cosmos/slashing/v1beta1/msg.ts | 1 + .../cosmos/slashing/v1beta1/slashing.ts | 108 + .../cosmos/slashing/v1beta1/tx.ts | 34 + .../cosmos/staking/v1beta1/authz.ts | 135 + .../cosmos/staking/v1beta1/genesis.ts | 96 + .../cosmos/staking/v1beta1/staking.ts | 823 ++++++ .../cosmos/staking/v1beta1/tx.ts | 272 ++ .../cosmos/tx/signing/v1beta1/signing.ts | 244 ++ .../cosmos/tx/v1beta1/service.ts | 485 ++++ .../proto-interfaces/cosmos/tx/v1beta1/tx.ts | 758 ++++++ .../cosmos/upgrade/v1beta1/tx.ts | 126 + .../cosmos/upgrade/v1beta1/upgrade.ts | 218 ++ .../cosmos/vesting/v1beta1/tx.ts | 168 ++ .../cosmos/vesting/v1beta1/vesting.ts | 204 ++ .../proto-interfaces/cosmos_proto/bundle.ts | 4 + .../proto-interfaces/cosmos_proto/cosmos.ts | 174 ++ .../types/proto-interfaces/cosmwasm/bundle.ts | 18 + .../cosmwasm/wasm/v1/authz.ts | 315 +++ .../cosmwasm/wasm/v1/genesis.ts | 114 + .../proto-interfaces/cosmwasm/wasm/v1/ibc.ts | 76 + .../cosmwasm/wasm/v1/proposal.ts | 706 ++++++ .../proto-interfaces/cosmwasm/wasm/v1/tx.ts | 461 ++++ .../cosmwasm/wasm/v1/types.ts | 377 +++ .../google/api/annotations.ts | 1 + .../types/proto-interfaces/google/api/http.ts | 1025 ++++++++ .../types/proto-interfaces/google/bundle.ts | 20 + .../proto-interfaces/google/protobuf/any.ts | 325 +++ .../google/protobuf/descriptor.ts | 2197 +++++++++++++++++ .../google/protobuf/duration.ts | 211 ++ .../proto-interfaces/google/protobuf/empty.ts | 44 + .../google/protobuf/timestamp.ts | 281 +++ .../src/types/proto-interfaces/helpers.ts | 242 ++ .../ibc/applications/transfer/v1/genesis.ts | 27 + .../ibc/applications/transfer/v1/transfer.ts | 96 + .../ibc/applications/transfer/v1/tx.ts | 93 + .../ibc/applications/transfer/v2/packet.ts | 49 + .../src/types/proto-interfaces/ibc/bundle.ts | 86 + .../ibc/core/channel/v1/channel.ts | 430 ++++ .../ibc/core/channel/v1/genesis.ts | 80 + .../ibc/core/channel/v1/tx.ts | 543 ++++ .../ibc/core/client/v1/client.ts | 305 +++ .../ibc/core/client/v1/genesis.ts | 115 + .../proto-interfaces/ibc/core/client/v1/tx.ts | 248 ++ .../ibc/core/commitment/v1/commitment.ts | 132 + .../ibc/core/connection/v1/connection.ts | 349 +++ .../ibc/core/connection/v1/genesis.ts | 33 + .../ibc/core/connection/v1/tx.ts | 309 +++ .../ibc/core/types/v1/genesis.ts | 41 + .../lightclients/localhost/v1/localhost.ts | 37 + .../solomachine/v1/solomachine.ts | 647 +++++ .../solomachine/v2/solomachine.ts | 647 +++++ .../lightclients/tendermint/v1/tendermint.ts | 289 +++ .../types/proto-interfaces/ics23/bundle.ts | 4 + .../src/types/proto-interfaces/index.ts | 13 + .../proto-interfaces/tendermint/abci/types.ts | 1385 +++++++++++ .../proto-interfaces/tendermint/bundle.ts | 38 + .../tendermint/crypto/keys.ts | 23 + .../tendermint/crypto/proof.ts | 132 + .../tendermint/libs/bits/types.ts | 21 + .../proto-interfaces/tendermint/p2p/types.ts | 131 + .../tendermint/types/block.ts | 28 + .../tendermint/types/evidence.ts | 104 + .../tendermint/types/params.ts | 240 ++ .../tendermint/types/types.ts | 509 ++++ .../tendermint/types/validator.ts | 71 + .../tendermint/version/types.ts | 71 + Crescent/crescent-starter/tsconfig.json | 19 + 156 files changed, 29607 insertions(+) create mode 100644 Crescent/crescent-starter/LICENSE create mode 100644 Crescent/crescent-starter/README.md create mode 100644 Crescent/crescent-starter/docker-compose.yml create mode 100644 Crescent/crescent-starter/docker/load-extensions.sh create mode 100644 Crescent/crescent-starter/docker/pg-Dockerfile create mode 100644 Crescent/crescent-starter/package.json create mode 100644 Crescent/crescent-starter/project.yaml create mode 100644 Crescent/crescent-starter/proto/cosmos/gov/v1beta1/gov.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/gov/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/gogo.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/msg.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/slashing.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/gogoproto/gogo.proto create mode 100644 Crescent/crescent-starter/schema.graphql create mode 100644 Crescent/crescent-starter/src/index.ts create mode 100644 Crescent/crescent-starter/src/mappings/mappingHandlers.ts create mode 100644 Crescent/crescent-starter/src/test/mappingHandlers.test.ts create mode 100644 Crescent/crescent-starter/src/types/CosmosMessageTypes.ts create mode 100644 Crescent/crescent-starter/src/types/index.ts create mode 100644 Crescent/crescent-starter/src/types/models/Message.ts create mode 100644 Crescent/crescent-starter/src/types/models/TransferEvent.ts create mode 100644 Crescent/crescent-starter/src/types/models/index.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/confio/proofs.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/config.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/module.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/auth.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/authz.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/event.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/authz.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/bank.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/abci/v1beta1/abci.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/kv/v1beta1/kv.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/query/v1beta1/pagination.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v1beta1/reflection.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v2alpha1/reflection.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/snapshots/v1beta1/snapshot.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/commit_info.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/listening.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/v1beta1/coin.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/capability.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/ed25519/keys.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/hd/v1/hd.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/keyring/v1/record.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/keys.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/v1beta1/multisig.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256k1/keys.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256r1/keys.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/distribution.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/evidence.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/feegrant.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/genutil/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/gov.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/gov.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/events.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/mint.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/msg/v1/msg.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/event.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/nft.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1/orm.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1alpha1/schema.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/params/v1beta1/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/msg.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/slashing.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/authz.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/staking.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/signing/v1beta1/signing.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/service.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/upgrade.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/vesting.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/cosmos.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/authz.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/ibc.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/api/annotations.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/api/http.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/any.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/descriptor.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/duration.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/empty.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/timestamp.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/helpers.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/transfer.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v2/packet.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/channel.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/client.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/commitment/v1/commitment.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/connection.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/types/v1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/localhost/v1/localhost.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v1/solomachine.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v2/solomachine.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/tendermint/v1/tendermint.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/ics23/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/index.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/abci/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/keys.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/proof.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/libs/bits/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/p2p/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/block.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/evidence.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/types.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/validator.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/version/types.ts create mode 100644 Crescent/crescent-starter/tsconfig.json diff --git a/Crescent/crescent-starter/LICENSE b/Crescent/crescent-starter/LICENSE new file mode 100644 index 000000000..3c806ae55 --- /dev/null +++ b/Crescent/crescent-starter/LICENSE @@ -0,0 +1,21 @@ +MIT LICENSE + +Copyright 2020-2021 OnFinality Limited authors & contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Crescent/crescent-starter/README.md b/Crescent/crescent-starter/README.md new file mode 100644 index 000000000..bc1d790f5 --- /dev/null +++ b/Crescent/crescent-starter/README.md @@ -0,0 +1,89 @@ +# SubQuery - Example Project for Crescent + +[SubQuery](https://subquery.network) is a fast, flexible, and reliable open-source data indexer that provides you with custom APIs for your web3 project across all of our supported networks. To learn about how to get started with SubQuery, [visit our docs](https://academy.subquery.network). + +**This SubQuery project indexes all transfer evetns and messages on Crescent** + +## Start + +First, install SubQuery CLI globally on your terminal by using NPM `npm install -g @subql/cli` + +You can either clone this GitHub repo, or use the `subql` CLI to bootstrap a clean project in the network of your choosing by running `subql init` and following the prompts. + +Don't forget to install dependencies with `npm install` or `yarn install`! + +## Editing your SubQuery project + +Although this is a working example SubQuery project, you can edit the SubQuery project by changing the following files: + +- The project manifest in `project.yaml` defines the key project configuration and mapping handler filters +- The GraphQL Schema (`schema.graphql`) defines the shape of the resulting data that you are using SubQuery to index +- The Mapping functions in `src/mappings/` directory are typescript functions that handle transformation logic + +SubQuery supports various layer-1 blockchain networks and provides [dedicated quick start guides](https://academy.subquery.network/quickstart/quickstart.html) as well as [detailed technical documentation](https://academy.subquery.network/build/introduction.html) for each of them. + +## Run your project + +_If you get stuck, find out how to get help below._ + +The simplest way to run your project is by running `yarn dev` or `npm run-script dev`. This does all of the following: + +1. `yarn codegen` - Generates types from the GraphQL schema definition and contract ABIs and saves them in the `/src/types` directory. This must be done after each change to the `schema.graphql` file or the contract ABIs +2. `yarn build` - Builds and packages the SubQuery project into the `/dist` directory +3. `docker-compose pull && docker-compose up` - Runs a Docker container with an indexer, PostgeSQL DB, and a query service. This requires [Docker to be installed](https://docs.docker.com/engine/install) and running locally. The configuration for this container is set from your `docker-compose.yml` + +You can observe the three services start, and once all are running (it may take a few minutes on your first start), please open your browser and head to [http://localhost:3000](http://localhost:3000) - you should see a GraphQL playground showing with the schemas ready to query. [Read the docs for more information](https://academy.subquery.network/run_publish/run.html) or [explore the possible service configuration for running SubQuery](https://academy.subquery.network/run_publish/references.html). + +## Query your project + +For this project, you can try to query with the following GraphQL code to get a taste of how it works. + +```graphql +{ + query { + transferEvents(first: 5) { + nodes { + id + blockHeight + txHash + recipient + sender + amount + } + } + messages(first: 5) { + nodes { + id + blockHeight + txHash + from + to + amount + } + } + } +} +``` + +You can explore the different possible queries and entities to help you with GraphQL using the documentation draw on the right. + +## Publish your project + +SubQuery is open-source, meaning you have the freedom to run it in the following three ways: + +- Locally on your own computer (or a cloud provider of your choosing), [view the instructions on how to run SubQuery Locally](https://academy.subquery.network/run_publish/run.html) +- By publishing it to our enterprise-level [Managed Service](https://managedservice.subquery.network), where we'll host your SubQuery project in production ready services for mission critical data with zero-downtime blue/green deployments. We even have a generous free tier. [Find out how](https://academy.subquery.network/run_publish/publish.html) +- [Coming Soon] By publishing it to the decentralised [SubQuery Network](https://subquery.network/network), the most open, performant, reliable, and scalable data service for dApp developers. The SubQuery Network indexes and services data to the global community in an incentivised and verifiable way + +## What Next? + +Take a look at some of our advanced features to take your project to the next level! + +- [**Multi-chain indexing support**](https://academy.subquery.network/build/multi-chain.html) - SubQuery allows you to index data from across different layer-1 networks into the same database, this allows you to query a single endpoint to get data for all supported networks. +- [**Dynamic Data Sources**](https://academy.subquery.network/build/dynamicdatasources.html) - When you want to index factory contracts, for example on a DEX or generative NFT project. +- [**Project Optimisation Advice**](https://academy.subquery.network/build/optimisation.html) - Some common tips on how to tweak your project to maximise performance. +- [**GraphQL Subscriptions**](https://academy.subquery.network/run_publish/subscription.html) - Build more reactive front end applications that subscribe to changes in your SubQuery project. + +## Need Help? + +The fastest way to get support is by [searching our documentation](https://academy.subquery.network), or by [joining our discord](https://discord.com/invite/subquery) and messaging us in the `#technical-support` channel. diff --git a/Crescent/crescent-starter/docker-compose.yml b/Crescent/crescent-starter/docker-compose.yml new file mode 100644 index 000000000..6fe9b54e2 --- /dev/null +++ b/Crescent/crescent-starter/docker-compose.yml @@ -0,0 +1,66 @@ +version: "3" + +services: + postgres: + build: + context: . + dockerfile: ./docker/pg-Dockerfile + ports: + - 5432:5432 + volumes: + - .data/postgres:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + + subquery-node: + image: onfinality/subql-node-cosmos:latest + depends_on: + "postgres": + condition: service_healthy + restart: always + environment: + DB_USER: postgres + DB_PASS: postgres + DB_DATABASE: postgres + DB_HOST: postgres + DB_PORT: 5432 + volumes: + - ./:/app + command: + - ${SUB_COMMAND} # set SUB_COMMAND env variable to "test" to run tests + - -f=/app + - --db-schema=app + - --workers=4 + - --batch-size=30 + - --unfinalized-blocks=true + healthcheck: + test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"] + interval: 3s + timeout: 5s + retries: 10 + + graphql-engine: + image: onfinality/subql-query:latest + ports: + - 3000:3000 + depends_on: + "postgres": + condition: service_healthy + "subquery-node": + condition: service_healthy + restart: always + environment: + DB_USER: postgres + DB_PASS: postgres + DB_DATABASE: postgres + DB_HOST: postgres + DB_PORT: 5432 + command: + - --name=app + - --playground + - --indexer=http://subquery-node:3000 diff --git a/Crescent/crescent-starter/docker/load-extensions.sh b/Crescent/crescent-starter/docker/load-extensions.sh new file mode 100644 index 000000000..6d33f8638 --- /dev/null +++ b/Crescent/crescent-starter/docker/load-extensions.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <- + This project can be use as a starting point for developing your Cosmos (%NETWORK_NAME%) based SubQuery project +repository: "https://github.com/subquery/cosmos-subql-starter" +schema: + file: ./schema.graphql +network: + chainId: crescent-1 + # This endpoint must be a public non-pruned archive node + # We recommend providing more than one endpoint for improved reliability, performance, and uptime + # Public nodes may be rate limited, which can affect indexing speed + # When developing your project we suggest getting a private API key + endpoint: ["https://mainnet.crescent.network:26657"] + # Optionally provide the HTTP endpoint of a full chain dictionary to speed up processing + dictionary: "https://api.subquery.network/sq/subquery/crescent-dictionary" + chainTypes: + cosmos.slashing.v1beta1: + file: ./proto/cosmos/slashing/v1beta1/tx.proto + messages: + - MsgUnjail + cosmos.gov.v1beta1: + file: ./proto/cosmos/gov/v1beta1/tx.proto + messages: + - MsgVoteWeighted + cosmos.gov.v1beta1.gov: + file: ./proto/cosmos/gov/v1beta1/gov.proto + messages: + - WeightedVoteOption +dataSources: + - kind: cosmos/Runtime + startBlock: 8407334 + mapping: + file: ./dist/index.js + handlers: + # Using block handlers slows your project down as they can be executed with each and every block. Only use if you need to + # - handler: handleBlock + # kind: cosmos/BlockHandler + # Using transaction handlers without filters slows your project down as they can be executed with each and every block + # - handler: handleTransaction + - handler: handleEvent + kind: cosmos/EventHandler + filter: + type: transfer + messageFilter: + type: /cosmos.bank.v1beta1.MsgSend + - handler: handleMessage + kind: cosmos/MessageHandler + filter: + type: /cosmos.bank.v1beta1.MsgSend diff --git a/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/gov.proto b/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 000000000..a2df1bd1b --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,200 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// 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 { + VoteOption option = 1; + string weight = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"weight\"" + ]; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +message TextProposal { + option (cosmos_proto.implements_interface) = "Content"; + + option (gogoproto.equal) = true; + + string title = 1; + 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; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string depositor = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"total_deposit\"" + ]; + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + PROPOSAL_STATUS_UNSPECIFIED = 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; + + string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string no_with_veto = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"no_with_veto\"" + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + // 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]; + // Since: cosmos-sdk 0.43 + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; +} + +// 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.moretags) = "yaml:\"min_deposit\"", + (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", + (gogoproto.moretags) = "yaml:\"max_deposit_period\"" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "voting_period,omitempty", + (gogoproto.moretags) = "yaml:\"voting_period\"" + ]; +} + +// 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 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (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 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty", + (gogoproto.moretags) = "yaml:\"veto_threshold\"" + ]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/tx.proto b/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 000000000..eb08f3c68 --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,99 @@ +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"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// Msg defines the bank Msg service. +service Msg { + // 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 (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"initial_deposit\"" + ]; + string proposer = 3; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + VoteOption option = 3; +} + +// 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 (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; +} + +// 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 (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string depositor = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/gogo.proto b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/gogo.proto new file mode 100644 index 000000000..8947d90aa --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/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; + +} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/msg.proto b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/msg.proto new file mode 100644 index 000000000..89bdf3129 --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/msg.proto @@ -0,0 +1,22 @@ +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.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; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/query.proto b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/query.proto new file mode 100644 index 000000000..bd1ee0c30 --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/query.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the parameters of slashing module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; + } + + // SigningInfo queries the signing info of given cons address + rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; + } + + // SigningInfos queries signing info of all validators + rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +// method +message QuerySigningInfoRequest { + // cons_address is the address to query signing info of + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +// method +message QuerySigningInfoResponse { + // val_signing_info is the signing info of requested val cons address + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC +// method +message QuerySigningInfosRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC +// method +message QuerySigningInfosResponse { + // info is the signing info of all validators + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/slashing.proto b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/slashing.proto new file mode 100644 index 000000000..081dc5abe --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/slashing.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Height at which validator was first a candidate OR was unjailed + int64 start_height = 2; + // Index which is incremented each time the validator was a bonded + // in a block and may have signed a precommit or not. This in conjunction with the + // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + int64 index_offset = 3; + // Timestamp until which the validator is jailed due to liveness downtime. + google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // Whether or not a validator has been tombstoned (killed out of validator set). It is set + // once the validator commits an equivocation or for any other configured misbehiavor. + bool tombstoned = 5; + // A counter kept to avoid unnecessary array reads. + // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + int64 missed_blocks_counter = 6; +} + +// Params represents the parameters used for by the slashing module. +message Params { + int64 signed_blocks_window = 1; + bytes min_signed_per_window = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes slash_fraction_downtime = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/tx.proto b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/tx.proto new file mode 100644 index 000000000..12595a67a --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/slashing/v1beta1/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the slashing Msg service. +service Msg { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); +} + +// MsgUnjail defines the Msg/Unjail request type +message MsgUnjail { + option (cosmos.msg.v1.signer) = "validator_addr"; + + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "address"]; +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} \ No newline at end of file diff --git a/Crescent/crescent-starter/proto/gogoproto/gogo.proto b/Crescent/crescent-starter/proto/gogoproto/gogo.proto new file mode 100644 index 000000000..5d831543d --- /dev/null +++ b/Crescent/crescent-starter/proto/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 = "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/Crescent/crescent-starter/schema.graphql b/Crescent/crescent-starter/schema.graphql new file mode 100644 index 000000000..344498bf3 --- /dev/null +++ b/Crescent/crescent-starter/schema.graphql @@ -0,0 +1,32 @@ +# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by +# Add the `@index` or `@index(unique: true)` annotation after any non-key field +# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field + +# type Block @entity { +# id: ID! # The block hash +# height: BigInt! +# } + +# type Transaction @entity { +# id: ID! +# blockHeight: BigInt! +# timestamp: String! +# } + +type TransferEvent @entity { + id: ID! + blockHeight: BigInt! + txHash: String! + recipient: String! + sender: String! + amount: String! +} + +type Message @entity { + id: ID! + blockHeight: BigInt! + txHash: String! + from: String! + to: String! + amount: String! +} diff --git a/Crescent/crescent-starter/src/index.ts b/Crescent/crescent-starter/src/index.ts new file mode 100644 index 000000000..55d8e9cd4 --- /dev/null +++ b/Crescent/crescent-starter/src/index.ts @@ -0,0 +1,2 @@ +//Exports all handler functions +export * from './mappings/mappingHandlers' diff --git a/Crescent/crescent-starter/src/mappings/mappingHandlers.ts b/Crescent/crescent-starter/src/mappings/mappingHandlers.ts new file mode 100644 index 000000000..650a74f06 --- /dev/null +++ b/Crescent/crescent-starter/src/mappings/mappingHandlers.ts @@ -0,0 +1,65 @@ +import { TransferEvent, Message } from "../types"; +import { + CosmosEvent, + CosmosBlock, + CosmosMessage, + CosmosTransaction, +} from "@subql/types-cosmos"; + +/* +export async function handleBlock(block: CosmosBlock): Promise { + // If you want to index each block in Cosmos (CosmosHub), you could do that here +} +*/ + +/* +export async function handleTransaction(tx: CosmosTransaction): Promise { + // If you want to index each transaction in Cosmos (CosmosHub), you could do that here + const transactionRecord = Transaction.create({ + id: tx.hash, + blockHeight: BigInt(tx.block.block.header.height), + timestamp: tx.block.block.header.time, + }); + await transactionRecord.save(); +} +*/ + +export async function handleMessage(msg: CosmosMessage): Promise { + const messageRecord = Message.create({ + id: `${msg.tx.hash}-${msg.idx}`, + blockHeight: BigInt(msg.block.block.header.height), + txHash: msg.tx.hash, + from: msg.msg.decodedMsg.fromAddress, + to: msg.msg.decodedMsg.toAddress, + amount: JSON.stringify(msg.msg.decodedMsg.amount), + }); + await messageRecord.save(); +} + +export async function handleEvent(event: CosmosEvent): Promise { + const eventRecord = TransferEvent.create({ + id: `${event.tx.hash}-${event.msg.idx}-${event.idx}`, + blockHeight: BigInt(event.block.block.header.height), + txHash: event.tx.hash, + recipient: '', + amount: '', + sender: '' + + }); + for (const attr of event.event.attributes) { + switch (attr.key) { + case "recipient": + eventRecord.recipient = attr.value; + break; + case "amount": + eventRecord.amount = attr.value; + break; + case "sender": + eventRecord.sender = attr.value; + break; + default: + break; + } + } + await eventRecord.save(); +} diff --git a/Crescent/crescent-starter/src/test/mappingHandlers.test.ts b/Crescent/crescent-starter/src/test/mappingHandlers.test.ts new file mode 100644 index 000000000..fc12d09ae --- /dev/null +++ b/Crescent/crescent-starter/src/test/mappingHandlers.test.ts @@ -0,0 +1,12 @@ +import {subqlTest} from "@subql/testing"; + +/* +// https://academy.subquery.network/build/testing.html +subqlTest( + "testName", // test name + 1000003, // block height to process + [], // dependent entities + [], // expected entities + "handleEvent" //handler name +); +*/ diff --git a/Crescent/crescent-starter/src/types/CosmosMessageTypes.ts b/Crescent/crescent-starter/src/types/CosmosMessageTypes.ts new file mode 100644 index 000000000..6fc14ec78 --- /dev/null +++ b/Crescent/crescent-starter/src/types/CosmosMessageTypes.ts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Auto-generated , DO NOT EDIT +import {CosmosMessage} from "@subql/types-cosmos"; + +import {MsgUnjail} from "./proto-interfaces/cosmos/slashing/v1beta1/tx"; + +import {MsgVoteWeighted} from "./proto-interfaces/cosmos/gov/v1beta1/tx"; + +import {WeightedVoteOption} from "./proto-interfaces/cosmos/gov/v1beta1/gov"; + + +export type MsgUnjailMessage = CosmosMessage; + +export type MsgVoteWeightedMessage = CosmosMessage; + +export type WeightedVoteOptionMessage = CosmosMessage; diff --git a/Crescent/crescent-starter/src/types/index.ts b/Crescent/crescent-starter/src/types/index.ts new file mode 100644 index 000000000..f660b992a --- /dev/null +++ b/Crescent/crescent-starter/src/types/index.ts @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Auto-generated , DO NOT EDIT +export * from "./models"; + + + diff --git a/Crescent/crescent-starter/src/types/models/Message.ts b/Crescent/crescent-starter/src/types/models/Message.ts new file mode 100644 index 000000000..a226e1d5f --- /dev/null +++ b/Crescent/crescent-starter/src/types/models/Message.ts @@ -0,0 +1,101 @@ +// Auto-generated , DO NOT EDIT +import {Entity, FunctionPropertyNames} from "@subql/types"; +import assert from 'assert'; + + + + +export type MessageProps = Omit>| '_name'>; + +export class Message implements Entity { + + constructor( + + id: string, + + blockHeight: bigint, + + txHash: string, + + from: string, + + to: string, + + amount: string, + + ) { + + this.id = id; + + this.blockHeight = blockHeight; + + this.txHash = txHash; + + this.from = from; + + this.to = to; + + this.amount = amount; + + } + + + public id: string; + + public blockHeight: bigint; + + public txHash: string; + + public from: string; + + public to: string; + + public amount: string; + + + get _name(): string { + return 'Message'; + } + + async save(): Promise{ + let id = this.id; + assert(id !== null, "Cannot save Message entity without an ID"); + await store.set('Message', id.toString(), this); + } + static async remove(id:string): Promise{ + assert(id !== null, "Cannot remove Message entity without an ID"); + await store.remove('Message', id.toString()); + } + + static async get(id:string): Promise{ + assert((id !== null && id !== undefined), "Cannot get Message entity without an ID"); + const record = await store.get('Message', id.toString()); + if (record){ + return this.create(record as MessageProps); + }else{ + return; + } + } + + + + static create(record: MessageProps): Message { + assert(typeof record.id === 'string', "id must be provided"); + let entity = new this( + + record.id, + + record.blockHeight, + + record.txHash, + + record.from, + + record.to, + + record.amount, + ); + Object.assign(entity,record); + return entity; + } +} diff --git a/Crescent/crescent-starter/src/types/models/TransferEvent.ts b/Crescent/crescent-starter/src/types/models/TransferEvent.ts new file mode 100644 index 000000000..2bf3772c3 --- /dev/null +++ b/Crescent/crescent-starter/src/types/models/TransferEvent.ts @@ -0,0 +1,101 @@ +// Auto-generated , DO NOT EDIT +import {Entity, FunctionPropertyNames} from "@subql/types"; +import assert from 'assert'; + + + + +export type TransferEventProps = Omit>| '_name'>; + +export class TransferEvent implements Entity { + + constructor( + + id: string, + + blockHeight: bigint, + + txHash: string, + + recipient: string, + + sender: string, + + amount: string, + + ) { + + this.id = id; + + this.blockHeight = blockHeight; + + this.txHash = txHash; + + this.recipient = recipient; + + this.sender = sender; + + this.amount = amount; + + } + + + public id: string; + + public blockHeight: bigint; + + public txHash: string; + + public recipient: string; + + public sender: string; + + public amount: string; + + + get _name(): string { + return 'TransferEvent'; + } + + async save(): Promise{ + let id = this.id; + assert(id !== null, "Cannot save TransferEvent entity without an ID"); + await store.set('TransferEvent', id.toString(), this); + } + static async remove(id:string): Promise{ + assert(id !== null, "Cannot remove TransferEvent entity without an ID"); + await store.remove('TransferEvent', id.toString()); + } + + static async get(id:string): Promise{ + assert((id !== null && id !== undefined), "Cannot get TransferEvent entity without an ID"); + const record = await store.get('TransferEvent', id.toString()); + if (record){ + return this.create(record as TransferEventProps); + }else{ + return; + } + } + + + + static create(record: TransferEventProps): TransferEvent { + assert(typeof record.id === 'string', "id must be provided"); + let entity = new this( + + record.id, + + record.blockHeight, + + record.txHash, + + record.recipient, + + record.sender, + + record.amount, + ); + Object.assign(entity,record); + return entity; + } +} diff --git a/Crescent/crescent-starter/src/types/models/index.ts b/Crescent/crescent-starter/src/types/models/index.ts new file mode 100644 index 000000000..df98b9024 --- /dev/null +++ b/Crescent/crescent-starter/src/types/models/index.ts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Auto-generated , DO NOT EDIT + +export {TransferEvent} from "./TransferEvent" + +export {Message} from "./Message" + diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/confio/proofs.ts b/Crescent/crescent-starter/src/types/proto-interfaces/confio/proofs.ts new file mode 100644 index 000000000..70e920991 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/confio/proofs.ts @@ -0,0 +1,753 @@ +export enum HashOp { + /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + UNRECOGNIZED = -1, +} +export const HashOpSDKType = HashOp; +export const HashOpAmino = HashOp; +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} +export const LengthOpSDKType = LengthOp; +export const LengthOpAmino = LengthOp; +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + case LengthOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf: LeafOp; + path: InnerOp[]; +} +export interface ExistenceProofProtoMsg { + typeUrl: "/ics23.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: Uint8Array; + value: Uint8Array; + leaf?: LeafOpAmino; + path: InnerOpAmino[]; +} +export interface ExistenceProofAminoMsg { + type: "/ics23.ExistenceProof"; + value: ExistenceProofAmino; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf: LeafOpSDKType; + path: InnerOpSDKType[]; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left: ExistenceProof; + right: ExistenceProof; +} +export interface NonExistenceProofProtoMsg { + typeUrl: "/ics23.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: Uint8Array; + left?: ExistenceProofAmino; + right?: ExistenceProofAmino; +} +export interface NonExistenceProofAminoMsg { + type: "/ics23.NonExistenceProof"; + value: NonExistenceProofAmino; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofSDKType { + key: Uint8Array; + left: ExistenceProofSDKType; + right: ExistenceProofSDKType; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; + batch?: BatchProof; + compressed?: CompressedBatchProof; +} +export interface CommitmentProofProtoMsg { + typeUrl: "/ics23.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: "/ics23.CommitmentProof"; + value: CommitmentProofAmino; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofSDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; + batch?: BatchProofSDKType; + compressed?: CompressedBatchProofSDKType; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} +export interface LeafOpProtoMsg { + typeUrl: "/ics23.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: Uint8Array; +} +export interface LeafOpAminoMsg { + type: "/ics23.LeafOp"; + value: LeafOpAmino; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpSDKType { + hash: HashOp; + prehash_key: HashOp; + prehash_value: HashOp; + length: LengthOp; + prefix: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +export interface InnerOpProtoMsg { + typeUrl: "/ics23.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: Uint8Array; + suffix: Uint8Array; +} +export interface InnerOpAminoMsg { + type: "/ics23.InnerOp"; + value: InnerOpAmino; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpSDKType { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec: LeafOp; + innerSpec: InnerSpec; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; +} +export interface ProofSpecProtoMsg { + typeUrl: "/ics23.ProofSpec"; + value: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecAmino { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leaf_spec?: LeafOpAmino; + inner_spec?: InnerSpecAmino; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + max_depth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + min_depth: number; +} +export interface ProofSpecAminoMsg { + type: "/ics23.ProofSpec"; + value: ProofSpecAmino; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecSDKType { + leaf_spec: LeafOpSDKType; + inner_spec: InnerSpecSDKType; + max_depth: number; + min_depth: number; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +export interface InnerSpecProtoMsg { + typeUrl: "/ics23.InnerSpec"; + value: Uint8Array; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecAmino { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + child_order: number[]; + child_size: number; + min_prefix_length: number; + max_prefix_length: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + empty_child: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +export interface InnerSpecAminoMsg { + type: "/ics23.InnerSpec"; + value: InnerSpecAmino; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecSDKType { + child_order: number[]; + child_size: number; + min_prefix_length: number; + max_prefix_length: number; + empty_child: Uint8Array; + hash: HashOp; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} +export interface BatchProofProtoMsg { + typeUrl: "/ics23.BatchProof"; + value: Uint8Array; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofAmino { + entries: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "/ics23.BatchProof"; + value: BatchProofAmino; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofSDKType { + entries: BatchEntrySDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; +} +export interface BatchEntryProtoMsg { + typeUrl: "/ics23.BatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntryAmino { + exist?: ExistenceProofAmino; + nonexist?: NonExistenceProofAmino; +} +export interface BatchEntryAminoMsg { + type: "/ics23.BatchEntry"; + value: BatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntrySDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/ics23.CompressedBatchProof"; + value: Uint8Array; +} +export interface CompressedBatchProofAmino { + entries: CompressedBatchEntryAmino[]; + lookup_inners: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "/ics23.CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +export interface CompressedBatchProofSDKType { + entries: CompressedBatchEntrySDKType[]; + lookup_inners: InnerOpSDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof; + nonexist?: CompressedNonExistenceProof; +} +export interface CompressedBatchEntryProtoMsg { + typeUrl: "/ics23.CompressedBatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntryAmino { + exist?: CompressedExistenceProofAmino; + nonexist?: CompressedNonExistenceProofAmino; +} +export interface CompressedBatchEntryAminoMsg { + type: "/ics23.CompressedBatchEntry"; + value: CompressedBatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntrySDKType { + exist?: CompressedExistenceProofSDKType; + nonexist?: CompressedNonExistenceProofSDKType; +} +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedExistenceProofProtoMsg { + typeUrl: "/ics23.CompressedExistenceProof"; + value: Uint8Array; +} +export interface CompressedExistenceProofAmino { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpAmino; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedExistenceProofAminoMsg { + type: "/ics23.CompressedExistenceProof"; + value: CompressedExistenceProofAmino; +} +export interface CompressedExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf: LeafOpSDKType; + path: number[]; +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left: CompressedExistenceProof; + right: CompressedExistenceProof; +} +export interface CompressedNonExistenceProofProtoMsg { + typeUrl: "/ics23.CompressedNonExistenceProof"; + value: Uint8Array; +} +export interface CompressedNonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProofAmino; + right?: CompressedExistenceProofAmino; +} +export interface CompressedNonExistenceProofAminoMsg { + type: "/ics23.CompressedNonExistenceProof"; + value: CompressedNonExistenceProofAmino; +} +export interface CompressedNonExistenceProofSDKType { + key: Uint8Array; + left: CompressedExistenceProofSDKType; + right: CompressedExistenceProofSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/config.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/config.ts new file mode 100644 index 000000000..5b35396a7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/config.ts @@ -0,0 +1,102 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface Config { + /** modules are the module configurations for the app. */ + modules: ModuleConfig[]; +} +export interface ConfigProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.Config"; + value: Uint8Array; +} +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface ConfigAmino { + /** modules are the module configurations for the app. */ + modules: ModuleConfigAmino[]; +} +export interface ConfigAminoMsg { + type: "cosmos-sdk/Config"; + value: ConfigAmino; +} +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface ConfigSDKType { + modules: ModuleConfigSDKType[]; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfig { + /** + * name is the unique name of the module within the app. It should be a name + * that persists between different versions of a module so that modules + * can be smoothly upgraded to new versions. + * + * For example, for the module cosmos.bank.module.v1.Module, we may chose + * to simply name the module "bank" in the app. When we upgrade to + * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + * and the framework knows that the v2 module should receive all the same state + * that the v1 module had. Note: modules should provide info on which versions + * they can migrate from in the ModuleDescriptor.can_migration_from field. + */ + name: string; + /** + * config is the config object for the module. Module config messages should + * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + */ + config: Any; +} +export interface ModuleConfigProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleConfig"; + value: Uint8Array; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfigAmino { + /** + * name is the unique name of the module within the app. It should be a name + * that persists between different versions of a module so that modules + * can be smoothly upgraded to new versions. + * + * For example, for the module cosmos.bank.module.v1.Module, we may chose + * to simply name the module "bank" in the app. When we upgrade to + * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + * and the framework knows that the v2 module should receive all the same state + * that the v1 module had. Note: modules should provide info on which versions + * they can migrate from in the ModuleDescriptor.can_migration_from field. + */ + name: string; + /** + * config is the config object for the module. Module config messages should + * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + */ + config?: AnyAmino; +} +export interface ModuleConfigAminoMsg { + type: "cosmos-sdk/ModuleConfig"; + value: ModuleConfigAmino; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfigSDKType { + name: string; + config: AnySDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/module.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/module.ts new file mode 100644 index 000000000..b23746113 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,206 @@ +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptor { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. Either go_import must be defined here + * or the go_package option must be defined at the file level to indicate + * to users where to location the module implementation. go_import takes + * precedence over go_package when both are defined. + */ + goImport: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + usePackage: PackageReference[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + canMigrateFrom: MigrateFromInfo[]; +} +export interface ModuleDescriptorProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; + value: Uint8Array; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorAmino { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. Either go_import must be defined here + * or the go_package option must be defined at the file level to indicate + * to users where to location the module implementation. go_import takes + * precedence over go_package when both are defined. + */ + go_import: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + use_package: PackageReferenceAmino[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + can_migrate_from: MigrateFromInfoAmino[]; +} +export interface ModuleDescriptorAminoMsg { + type: "cosmos-sdk/ModuleDescriptor"; + value: ModuleDescriptorAmino; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorSDKType { + go_import: string; + use_package: PackageReferenceSDKType[]; + can_migrate_from: MigrateFromInfoSDKType[]; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReference { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its fields containing the + * test "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.PackageReference"; + value: Uint8Array; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceAmino { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its fields containing the + * test "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceAminoMsg { + type: "cosmos-sdk/PackageReference"; + value: PackageReferenceAmino; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceSDKType { + name: string; + revision: number; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfo { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; + value: Uint8Array; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoAmino { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoAminoMsg { + type: "cosmos-sdk/MigrateFromInfo"; + value: MigrateFromInfoAmino; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoSDKType { + module: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/auth.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 000000000..591d0a485 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,101 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + address: string; + pubKey: Any; + accountNumber: Long; + sequence: Long; +} +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; +} +/** + * 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 BaseAccountSDKType { + address: string; + pub_key: AnySDKType; + account_number: Long; + sequence: Long; +} +/** 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; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountSDKType { + base_account: BaseAccountSDKType; + name: string; + permissions: string[]; +} +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: Long; + txSigLimit: Long; + txSizeCostPerByte: Long; + sigVerifyCostEd25519: Long; + sigVerifyCostSecp256k1: Long; +} +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/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsSDKType { + max_memo_characters: Long; + tx_sig_limit: Long; + tx_size_cost_per_byte: Long; + sig_verify_cost_ed25519: Long; + sig_verify_cost_secp256k1: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/genesis.ts new file mode 100644 index 000000000..4e8c85aae --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/auth/v1beta1/genesis.ts @@ -0,0 +1,29 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** accounts are the accounts present at genesis. */ + accounts: Any[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** accounts are the accounts present at genesis. */ + accounts: AnyAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + accounts: AnySDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/authz.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/authz.ts new file mode 100644 index 000000000..17df1c99a --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/authz.ts @@ -0,0 +1,134 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * 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; +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationSDKType { + msg: string; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface Grant { + authorization: Any; + /** + * 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; +} +/** + * 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?: Date; +} +export interface GrantAminoMsg { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface GrantSDKType { + authorization: AnySDKType; + expiration?: Date; +} +/** + * 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: Any; + expiration: Date; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +/** + * 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?: Date; +} +export interface GrantAuthorizationAminoMsg { + type: "cosmos-sdk/GrantAuthorization"; + value: GrantAuthorizationAmino; +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationSDKType { + granter: string; + grantee: string; + authorization: AnySDKType; + expiration: Date; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItem { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msgTypeUrls: string[]; +} +export interface GrantQueueItemProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; + value: Uint8Array; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemAmino { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msg_type_urls: string[]; +} +export interface GrantQueueItemAminoMsg { + type: "cosmos-sdk/GrantQueueItem"; + value: GrantQueueItemAmino; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemSDKType { + msg_type_urls: string[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/event.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/event.ts new file mode 100644 index 000000000..237d3ef0d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/event.ts @@ -0,0 +1,64 @@ +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrant { + /** Msg type URL for which an autorization is granted */ + msgTypeUrl: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventGrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.EventGrant"; + value: Uint8Array; +} +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrantAmino { + /** Msg type URL for which an autorization is granted */ + msg_type_url: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventGrantAminoMsg { + type: "cosmos-sdk/EventGrant"; + value: EventGrantAmino; +} +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrantSDKType { + msg_type_url: string; + granter: string; + grantee: string; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevoke { + /** Msg type URL for which an autorization is revoked */ + msgTypeUrl: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventRevokeProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.EventRevoke"; + value: Uint8Array; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevokeAmino { + /** Msg type URL for which an autorization is revoked */ + msg_type_url: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventRevokeAminoMsg { + type: "cosmos-sdk/EventRevoke"; + value: EventRevokeAmino; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevokeSDKType { + msg_type_url: string; + granter: string; + grantee: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/genesis.ts new file mode 100644 index 000000000..d99b1c47b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/genesis.ts @@ -0,0 +1,21 @@ +import { GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisState { + authorization: GrantAuthorization[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisStateAmino { + authorization: GrantAuthorizationAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisStateSDKType { + authorization: GrantAuthorizationSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 000000000..46c414dca --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,165 @@ +import { Grant, GrantAmino, GrantSDKType } from "./authz"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * 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; +} +/** + * 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 MsgGrantSDKType { + granter: string; + grantee: string; + grant: GrantSDKType; +} +/** 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: Uint8Array[]; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseSDKType { + results: Uint8Array[]; +} +/** + * 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; + /** + * Authorization Msg requests to execute. Each msg must implement Authorization interface + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: Any[]; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExec"; + value: Uint8Array; +} +/** + * 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; + /** + * Authorization Msg requests to execute. Each msg must implement Authorization interface + * 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; +} +/** + * 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 MsgExecSDKType { + grantee: string; + msgs: AnySDKType[]; +} +/** 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; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseSDKType {} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +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; +} +/** + * 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 MsgRevokeSDKType { + granter: string; + grantee: string; + msg_type_url: string; +} +/** 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; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/authz.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/authz.ts new file mode 100644 index 000000000..847502352 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/authz.ts @@ -0,0 +1,36 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorization { + spendLimit: Coin[]; +} +export interface SendAuthorizationProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; + value: Uint8Array; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationAmino { + spend_limit: CoinAmino[]; +} +export interface SendAuthorizationAminoMsg { + type: "cosmos-sdk/SendAuthorization"; + value: SendAuthorizationAmino; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationSDKType { + spend_limit: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/bank.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 000000000..f062a1351 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,296 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** Params defines the parameters for the bank module. */ +export interface Params { + 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 { + send_enabled: SendEnabledAmino[]; + default_send_enabled: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the bank module. */ +export interface ParamsSDKType { + send_enabled: SendEnabledSDKType[]; + default_send_enabled: boolean; +} +/** + * 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; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledSDKType { + denom: string; + enabled: boolean; +} +/** 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; +} +/** Input models transaction input. */ +export interface InputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** 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; +} +/** Output models transaction outputs. */ +export interface OutputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** + * 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; +} +/** + * 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 SupplySDKType { + total: CoinSDKType[]; +} +/** + * 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; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitSDKType { + denom: string; + exponent: number; + aliases: string[]; +} +/** + * 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; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataSDKType { + description: string; + denom_units: DenomUnitSDKType[]; + base: string; + display: string; + name: string; + symbol: string; + uri: string; + uri_hash: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/genesis.ts new file mode 100644 index 000000000..c9ce54399 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/genesis.ts @@ -0,0 +1,81 @@ +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** balances is an array containing the balances of all the accounts. */ + balances: Balance[]; + /** + * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + */ + supply: Coin[]; + /** denom_metadata defines the metadata of the differents coins. */ + denomMetadata: Metadata[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** balances is an array containing the balances of all the accounts. */ + balances: BalanceAmino[]; + /** + * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + */ + supply: CoinAmino[]; + /** denom_metadata defines the metadata of the differents coins. */ + denom_metadata: MetadataAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + balances: BalanceSDKType[]; + supply: CoinSDKType[]; + denom_metadata: MetadataSDKType[]; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface Balance { + /** address is the address of the balance holder. */ + address: string; + /** coins defines the different coins this balance holds. */ + coins: Coin[]; +} +export interface BalanceProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Balance"; + value: Uint8Array; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface BalanceAmino { + /** address is the address of the balance holder. */ + address: string; + /** coins defines the different coins this balance holds. */ + coins: CoinAmino[]; +} +export interface BalanceAminoMsg { + type: "cosmos-sdk/Balance"; + value: BalanceAmino; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface BalanceSDKType { + address: string; + coins: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 000000000..d1e2ed19b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,79 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; +/** 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; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** 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; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseSDKType {} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSend { + 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: InputAmino[]; + outputs: OutputAmino[]; +} +export interface MsgMultiSendAminoMsg { + type: "cosmos-sdk/MsgMultiSend"; + value: MsgMultiSendAmino; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendSDKType { + inputs: InputSDKType[]; + outputs: OutputSDKType[]; +} +/** 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; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/abci/v1beta1/abci.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 000000000..f51e5d498 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,472 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; +import { Long } from "../../../../helpers"; +/** + * 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: Long; + /** 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: Long; + /** Amount of gas consumed by transaction. */ + gasUsed: Long; + /** 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 handler. 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 handler. 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; +} +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponseSDKType { + height: Long; + txhash: string; + codespace: string; + code: number; + data: string; + raw_log: string; + logs: ABCIMessageLogSDKType[]; + info: string; + gas_wanted: Long; + gas_used: Long; + tx: AnySDKType; + timestamp: string; + events: EventSDKType[]; +} +/** 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; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLogSDKType { + msg_index: number; + log: string; + events: StringEventSDKType[]; +} +/** + * 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; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEventSDKType { + type: string; + attributes: AttributeSDKType[]; +} +/** + * 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; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface AttributeSDKType { + key: string; + value: string; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfo { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gasWanted: Long; + /** GasUsed is the amount of gas actually consumed. */ + gasUsed: Long; +} +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; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfoSDKType { + gas_wanted: Long; + gas_used: Long; +} +/** 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: 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: 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; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +export interface ResultSDKType { + /** @deprecated */ + data: Uint8Array; + log: string; + events: EventSDKType[]; + msg_responses: AnySDKType[]; +} +/** + * SimulationResponse defines the response generated when a transaction is + * 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; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponseSDKType { + gas_info: GasInfoSDKType; + result: ResultSDKType; +} +/** + * 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: Uint8Array; +} +export interface MsgDataAminoMsg { + type: "cosmos-sdk/MsgData"; + value: MsgDataAmino; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgDataSDKType { + msg_type: string; + data: Uint8Array; +} +/** + * 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; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. + */ +export interface TxMsgDataSDKType { + /** @deprecated */ + data: MsgDataSDKType[]; + msg_responses: AnySDKType[]; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResult { + /** Count of all txs */ + totalCount: Long; + /** Count of txs in current page */ + count: Long; + /** Index of current page, start from 1 */ + pageNumber: Long; + /** Count of total pages */ + pageTotal: Long; + /** Max count txs per page */ + limit: Long; + /** 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; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResultSDKType { + total_count: Long; + count: Long; + page_number: Long; + page_total: Long; + limit: Long; + txs: TxResponseSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/kv/v1beta1/kv.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/kv/v1beta1/kv.ts new file mode 100644 index 000000000..753e150e9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/kv/v1beta1/kv.ts @@ -0,0 +1,43 @@ +/** Pairs defines a repeated slice of Pair objects. */ +export interface Pairs { + pairs: Pair[]; +} +export interface PairsProtoMsg { + typeUrl: "/cosmos.base.kv.v1beta1.Pairs"; + value: Uint8Array; +} +/** Pairs defines a repeated slice of Pair objects. */ +export interface PairsAmino { + pairs: PairAmino[]; +} +export interface PairsAminoMsg { + type: "cosmos-sdk/Pairs"; + value: PairsAmino; +} +/** Pairs defines a repeated slice of Pair objects. */ +export interface PairsSDKType { + pairs: PairSDKType[]; +} +/** Pair defines a key/value bytes tuple. */ +export interface Pair { + key: Uint8Array; + value: Uint8Array; +} +export interface PairProtoMsg { + typeUrl: "/cosmos.base.kv.v1beta1.Pair"; + value: Uint8Array; +} +/** Pair defines a key/value bytes tuple. */ +export interface PairAmino { + key: Uint8Array; + value: Uint8Array; +} +export interface PairAminoMsg { + type: "cosmos-sdk/Pair"; + value: PairAmino; +} +/** Pair defines a key/value bytes tuple. */ +export interface PairSDKType { + key: Uint8Array; + value: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/query/v1beta1/pagination.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 000000000..1f42c359f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,172 @@ +import { Long } from "../../../../helpers"; +/** + * 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: Long; + /** + * 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: Long; + /** + * 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: 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: 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; +} +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequestSDKType { + key: Uint8Array; + offset: Long; + limit: Long; + count_total: boolean; + reverse: boolean; +} +/** + * 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: Long; +} +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: Uint8Array; + /** + * 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; +} +/** + * 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 PageResponseSDKType { + next_key: Uint8Array; + total: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v1beta1/reflection.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v1beta1/reflection.ts new file mode 100644 index 000000000..4f99ecb27 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v1beta1/reflection.ts @@ -0,0 +1,96 @@ +/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesRequest {} +export interface ListAllInterfacesRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest"; + value: Uint8Array; +} +/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesRequestAmino {} +export interface ListAllInterfacesRequestAminoMsg { + type: "cosmos-sdk/ListAllInterfacesRequest"; + value: ListAllInterfacesRequestAmino; +} +/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesRequestSDKType {} +/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesResponse { + /** interface_names is an array of all the registered interfaces. */ + interfaceNames: string[]; +} +export interface ListAllInterfacesResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse"; + value: Uint8Array; +} +/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesResponseAmino { + /** interface_names is an array of all the registered interfaces. */ + interface_names: string[]; +} +export interface ListAllInterfacesResponseAminoMsg { + type: "cosmos-sdk/ListAllInterfacesResponse"; + value: ListAllInterfacesResponseAmino; +} +/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesResponseSDKType { + interface_names: string[]; +} +/** + * ListImplementationsRequest is the request type of the ListImplementations + * RPC. + */ +export interface ListImplementationsRequest { + /** interface_name defines the interface to query the implementations for. */ + interfaceName: string; +} +export interface ListImplementationsRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest"; + value: Uint8Array; +} +/** + * ListImplementationsRequest is the request type of the ListImplementations + * RPC. + */ +export interface ListImplementationsRequestAmino { + /** interface_name defines the interface to query the implementations for. */ + interface_name: string; +} +export interface ListImplementationsRequestAminoMsg { + type: "cosmos-sdk/ListImplementationsRequest"; + value: ListImplementationsRequestAmino; +} +/** + * ListImplementationsRequest is the request type of the ListImplementations + * RPC. + */ +export interface ListImplementationsRequestSDKType { + interface_name: string; +} +/** + * ListImplementationsResponse is the response type of the ListImplementations + * RPC. + */ +export interface ListImplementationsResponse { + implementationMessageNames: string[]; +} +export interface ListImplementationsResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse"; + value: Uint8Array; +} +/** + * ListImplementationsResponse is the response type of the ListImplementations + * RPC. + */ +export interface ListImplementationsResponseAmino { + implementation_message_names: string[]; +} +export interface ListImplementationsResponseAminoMsg { + type: "cosmos-sdk/ListImplementationsResponse"; + value: ListImplementationsResponseAmino; +} +/** + * ListImplementationsResponse is the response type of the ListImplementations + * RPC. + */ +export interface ListImplementationsResponseSDKType { + implementation_message_names: string[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v2alpha1/reflection.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v2alpha1/reflection.ts new file mode 100644 index 000000000..146ab70f2 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/reflection/v2alpha1/reflection.ts @@ -0,0 +1,700 @@ +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptor { + /** + * AuthnDescriptor provides information on how to authenticate transactions on the application + * NOTE: experimental and subject to change in future releases. + */ + authn: AuthnDescriptor; + /** chain provides the chain descriptor */ + chain: ChainDescriptor; + /** codec provides metadata information regarding codec related types */ + codec: CodecDescriptor; + /** configuration provides metadata information regarding the sdk.Config type */ + configuration: ConfigurationDescriptor; + /** query_services provides metadata information regarding the available queriable endpoints */ + queryServices: QueryServicesDescriptor; + /** tx provides metadata information regarding how to send transactions to the given application */ + tx: TxDescriptor; +} +export interface AppDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; + value: Uint8Array; +} +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptorAmino { + /** + * AuthnDescriptor provides information on how to authenticate transactions on the application + * NOTE: experimental and subject to change in future releases. + */ + authn?: AuthnDescriptorAmino; + /** chain provides the chain descriptor */ + chain?: ChainDescriptorAmino; + /** codec provides metadata information regarding codec related types */ + codec?: CodecDescriptorAmino; + /** configuration provides metadata information regarding the sdk.Config type */ + configuration?: ConfigurationDescriptorAmino; + /** query_services provides metadata information regarding the available queriable endpoints */ + query_services?: QueryServicesDescriptorAmino; + /** tx provides metadata information regarding how to send transactions to the given application */ + tx?: TxDescriptorAmino; +} +export interface AppDescriptorAminoMsg { + type: "cosmos-sdk/AppDescriptor"; + value: AppDescriptorAmino; +} +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptorSDKType { + authn: AuthnDescriptorSDKType; + chain: ChainDescriptorSDKType; + codec: CodecDescriptorSDKType; + configuration: ConfigurationDescriptorSDKType; + query_services: QueryServicesDescriptorSDKType; + tx: TxDescriptorSDKType; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptor { + /** + * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + * it is not meant to support polymorphism of transaction types, it is supposed to be used by + * reflection clients to understand if they can handle a specific transaction type in an application. + */ + fullname: string; + /** msgs lists the accepted application messages (sdk.Msg) */ + msgs: MsgDescriptor[]; +} +export interface TxDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor"; + value: Uint8Array; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptorAmino { + /** + * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + * it is not meant to support polymorphism of transaction types, it is supposed to be used by + * reflection clients to understand if they can handle a specific transaction type in an application. + */ + fullname: string; + /** msgs lists the accepted application messages (sdk.Msg) */ + msgs: MsgDescriptorAmino[]; +} +export interface TxDescriptorAminoMsg { + type: "cosmos-sdk/TxDescriptor"; + value: TxDescriptorAmino; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptorSDKType { + fullname: string; + msgs: MsgDescriptorSDKType[]; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptor { + /** sign_modes defines the supported signature algorithm */ + signModes: SigningModeDescriptor[]; +} +export interface AuthnDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor"; + value: Uint8Array; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptorAmino { + /** sign_modes defines the supported signature algorithm */ + sign_modes: SigningModeDescriptorAmino[]; +} +export interface AuthnDescriptorAminoMsg { + type: "cosmos-sdk/AuthnDescriptor"; + value: AuthnDescriptorAmino; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptorSDKType { + sign_modes: SigningModeDescriptorSDKType[]; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptor { + /** name defines the unique name of the signing mode */ + name: string; + /** number is the unique int32 identifier for the sign_mode enum */ + number: number; + /** + * authn_info_provider_method_fullname defines the fullname of the method to call to get + * the metadata required to authenticate using the provided sign_modes + */ + authnInfoProviderMethodFullname: string; +} +export interface SigningModeDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor"; + value: Uint8Array; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptorAmino { + /** name defines the unique name of the signing mode */ + name: string; + /** number is the unique int32 identifier for the sign_mode enum */ + number: number; + /** + * authn_info_provider_method_fullname defines the fullname of the method to call to get + * the metadata required to authenticate using the provided sign_modes + */ + authn_info_provider_method_fullname: string; +} +export interface SigningModeDescriptorAminoMsg { + type: "cosmos-sdk/SigningModeDescriptor"; + value: SigningModeDescriptorAmino; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptorSDKType { + name: string; + number: number; + authn_info_provider_method_fullname: string; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptor { + /** id is the chain id */ + id: string; +} +export interface ChainDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor"; + value: Uint8Array; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptorAmino { + /** id is the chain id */ + id: string; +} +export interface ChainDescriptorAminoMsg { + type: "cosmos-sdk/ChainDescriptor"; + value: ChainDescriptorAmino; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptorSDKType { + id: string; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptor { + /** interfaces is a list of the registerted interfaces descriptors */ + interfaces: InterfaceDescriptor[]; +} +export interface CodecDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor"; + value: Uint8Array; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptorAmino { + /** interfaces is a list of the registerted interfaces descriptors */ + interfaces: InterfaceDescriptorAmino[]; +} +export interface CodecDescriptorAminoMsg { + type: "cosmos-sdk/CodecDescriptor"; + value: CodecDescriptorAmino; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptorSDKType { + interfaces: InterfaceDescriptorSDKType[]; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptor { + /** fullname is the name of the interface */ + fullname: string; + /** + * interface_accepting_messages contains information regarding the proto messages which contain the interface as + * google.protobuf.Any field + */ + interfaceAcceptingMessages: InterfaceAcceptingMessageDescriptor[]; + /** interface_implementers is a list of the descriptors of the interface implementers */ + interfaceImplementers: InterfaceImplementerDescriptor[]; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor"; + value: Uint8Array; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptorAmino { + /** fullname is the name of the interface */ + fullname: string; + /** + * interface_accepting_messages contains information regarding the proto messages which contain the interface as + * google.protobuf.Any field + */ + interface_accepting_messages: InterfaceAcceptingMessageDescriptorAmino[]; + /** interface_implementers is a list of the descriptors of the interface implementers */ + interface_implementers: InterfaceImplementerDescriptorAmino[]; +} +export interface InterfaceDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceDescriptor"; + value: InterfaceDescriptorAmino; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptorSDKType { + fullname: string; + interface_accepting_messages: InterfaceAcceptingMessageDescriptorSDKType[]; + interface_implementers: InterfaceImplementerDescriptorSDKType[]; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptor { + /** fullname is the protobuf queryable name of the interface implementer */ + fullname: string; + /** + * type_url defines the type URL used when marshalling the type as any + * this is required so we can provide type safe google.protobuf.Any marshalling and + * unmarshalling, making sure that we don't accept just 'any' type + * in our interface fields + */ + typeUrl: string; +} +export interface InterfaceImplementerDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor"; + value: Uint8Array; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptorAmino { + /** fullname is the protobuf queryable name of the interface implementer */ + fullname: string; + /** + * type_url defines the type URL used when marshalling the type as any + * this is required so we can provide type safe google.protobuf.Any marshalling and + * unmarshalling, making sure that we don't accept just 'any' type + * in our interface fields + */ + type_url: string; +} +export interface InterfaceImplementerDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceImplementerDescriptor"; + value: InterfaceImplementerDescriptorAmino; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptorSDKType { + fullname: string; + type_url: string; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptor { + /** fullname is the protobuf fullname of the type containing the interface */ + fullname: string; + /** + * field_descriptor_names is a list of the protobuf name (not fullname) of the field + * which contains the interface as google.protobuf.Any (the interface is the same, but + * it can be in multiple fields of the same proto message) + */ + fieldDescriptorNames: string[]; +} +export interface InterfaceAcceptingMessageDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor"; + value: Uint8Array; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptorAmino { + /** fullname is the protobuf fullname of the type containing the interface */ + fullname: string; + /** + * field_descriptor_names is a list of the protobuf name (not fullname) of the field + * which contains the interface as google.protobuf.Any (the interface is the same, but + * it can be in multiple fields of the same proto message) + */ + field_descriptor_names: string[]; +} +export interface InterfaceAcceptingMessageDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor"; + value: InterfaceAcceptingMessageDescriptorAmino; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptorSDKType { + fullname: string; + field_descriptor_names: string[]; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptor { + /** bech32_account_address_prefix is the account address prefix */ + bech32AccountAddressPrefix: string; +} +export interface ConfigurationDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor"; + value: Uint8Array; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptorAmino { + /** bech32_account_address_prefix is the account address prefix */ + bech32_account_address_prefix: string; +} +export interface ConfigurationDescriptorAminoMsg { + type: "cosmos-sdk/ConfigurationDescriptor"; + value: ConfigurationDescriptorAmino; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptorSDKType { + bech32_account_address_prefix: string; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptor { + /** msg_type_url contains the TypeURL of a sdk.Msg. */ + msgTypeUrl: string; +} +export interface MsgDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor"; + value: Uint8Array; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptorAmino { + /** msg_type_url contains the TypeURL of a sdk.Msg. */ + msg_type_url: string; +} +export interface MsgDescriptorAminoMsg { + type: "cosmos-sdk/MsgDescriptor"; + value: MsgDescriptorAmino; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptorSDKType { + msg_type_url: string; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequest {} +export interface GetAuthnDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest"; + value: Uint8Array; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequestAmino {} +export interface GetAuthnDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetAuthnDescriptorRequest"; + value: GetAuthnDescriptorRequestAmino; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequestSDKType {} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponse { + /** authn describes how to authenticate to the application when sending transactions */ + authn: AuthnDescriptor; +} +export interface GetAuthnDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; + value: Uint8Array; +} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponseAmino { + /** authn describes how to authenticate to the application when sending transactions */ + authn?: AuthnDescriptorAmino; +} +export interface GetAuthnDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetAuthnDescriptorResponse"; + value: GetAuthnDescriptorResponseAmino; +} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponseSDKType { + authn: AuthnDescriptorSDKType; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequest {} +export interface GetChainDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest"; + value: Uint8Array; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequestAmino {} +export interface GetChainDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetChainDescriptorRequest"; + value: GetChainDescriptorRequestAmino; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequestSDKType {} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponse { + /** chain describes application chain information */ + chain: ChainDescriptor; +} +export interface GetChainDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; + value: Uint8Array; +} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponseAmino { + /** chain describes application chain information */ + chain?: ChainDescriptorAmino; +} +export interface GetChainDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetChainDescriptorResponse"; + value: GetChainDescriptorResponseAmino; +} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponseSDKType { + chain: ChainDescriptorSDKType; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequest {} +export interface GetCodecDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest"; + value: Uint8Array; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequestAmino {} +export interface GetCodecDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetCodecDescriptorRequest"; + value: GetCodecDescriptorRequestAmino; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequestSDKType {} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponse { + /** codec describes the application codec such as registered interfaces and implementations */ + codec: CodecDescriptor; +} +export interface GetCodecDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; + value: Uint8Array; +} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponseAmino { + /** codec describes the application codec such as registered interfaces and implementations */ + codec?: CodecDescriptorAmino; +} +export interface GetCodecDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetCodecDescriptorResponse"; + value: GetCodecDescriptorResponseAmino; +} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponseSDKType { + codec: CodecDescriptorSDKType; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequest {} +export interface GetConfigurationDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest"; + value: Uint8Array; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequestAmino {} +export interface GetConfigurationDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetConfigurationDescriptorRequest"; + value: GetConfigurationDescriptorRequestAmino; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequestSDKType {} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponse { + /** config describes the application's sdk.Config */ + config: ConfigurationDescriptor; +} +export interface GetConfigurationDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; + value: Uint8Array; +} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponseAmino { + /** config describes the application's sdk.Config */ + config?: ConfigurationDescriptorAmino; +} +export interface GetConfigurationDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetConfigurationDescriptorResponse"; + value: GetConfigurationDescriptorResponseAmino; +} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponseSDKType { + config: ConfigurationDescriptorSDKType; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequest {} +export interface GetQueryServicesDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest"; + value: Uint8Array; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequestAmino {} +export interface GetQueryServicesDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetQueryServicesDescriptorRequest"; + value: GetQueryServicesDescriptorRequestAmino; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequestSDKType {} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponse { + /** queries provides information on the available queryable services */ + queries: QueryServicesDescriptor; +} +export interface GetQueryServicesDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; + value: Uint8Array; +} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponseAmino { + /** queries provides information on the available queryable services */ + queries?: QueryServicesDescriptorAmino; +} +export interface GetQueryServicesDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetQueryServicesDescriptorResponse"; + value: GetQueryServicesDescriptorResponseAmino; +} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponseSDKType { + queries: QueryServicesDescriptorSDKType; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequest {} +export interface GetTxDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest"; + value: Uint8Array; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequestAmino {} +export interface GetTxDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetTxDescriptorRequest"; + value: GetTxDescriptorRequestAmino; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequestSDKType {} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponse { + /** + * tx provides information on msgs that can be forwarded to the application + * alongside the accepted transaction protobuf type + */ + tx: TxDescriptor; +} +export interface GetTxDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; + value: Uint8Array; +} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponseAmino { + /** + * tx provides information on msgs that can be forwarded to the application + * alongside the accepted transaction protobuf type + */ + tx?: TxDescriptorAmino; +} +export interface GetTxDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetTxDescriptorResponse"; + value: GetTxDescriptorResponseAmino; +} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponseSDKType { + tx: TxDescriptorSDKType; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptor { + /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ + queryServices: QueryServiceDescriptor[]; +} +export interface QueryServicesDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor"; + value: Uint8Array; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptorAmino { + /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ + query_services: QueryServiceDescriptorAmino[]; +} +export interface QueryServicesDescriptorAminoMsg { + type: "cosmos-sdk/QueryServicesDescriptor"; + value: QueryServicesDescriptorAmino; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptorSDKType { + query_services: QueryServiceDescriptorSDKType[]; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptor { + /** fullname is the protobuf fullname of the service descriptor */ + fullname: string; + /** is_module describes if this service is actually exposed by an application's module */ + isModule: boolean; + /** methods provides a list of query service methods */ + methods: QueryMethodDescriptor[]; +} +export interface QueryServiceDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor"; + value: Uint8Array; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptorAmino { + /** fullname is the protobuf fullname of the service descriptor */ + fullname: string; + /** is_module describes if this service is actually exposed by an application's module */ + is_module: boolean; + /** methods provides a list of query service methods */ + methods: QueryMethodDescriptorAmino[]; +} +export interface QueryServiceDescriptorAminoMsg { + type: "cosmos-sdk/QueryServiceDescriptor"; + value: QueryServiceDescriptorAmino; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptorSDKType { + fullname: string; + is_module: boolean; + methods: QueryMethodDescriptorSDKType[]; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptor { + /** name is the protobuf name (not fullname) of the method */ + name: string; + /** + * full_query_path is the path that can be used to query + * this method via tendermint abci.Query + */ + fullQueryPath: string; +} +export interface QueryMethodDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor"; + value: Uint8Array; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptorAmino { + /** name is the protobuf name (not fullname) of the method */ + name: string; + /** + * full_query_path is the path that can be used to query + * this method via tendermint abci.Query + */ + full_query_path: string; +} +export interface QueryMethodDescriptorAminoMsg { + type: "cosmos-sdk/QueryMethodDescriptor"; + value: QueryMethodDescriptorAmino; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptorSDKType { + name: string; + full_query_path: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/snapshots/v1beta1/snapshot.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/snapshots/v1beta1/snapshot.ts new file mode 100644 index 000000000..e7a57f598 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -0,0 +1,229 @@ +import { Long } from "../../../../helpers"; +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface Snapshot { + height: Long; + format: number; + chunks: number; + hash: Uint8Array; + metadata: Metadata; +} +export interface SnapshotProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.Snapshot"; + value: Uint8Array; +} +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface SnapshotAmino { + height: string; + format: number; + chunks: number; + hash: Uint8Array; + metadata?: MetadataAmino; +} +export interface SnapshotAminoMsg { + type: "cosmos-sdk/Snapshot"; + value: SnapshotAmino; +} +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface SnapshotSDKType { + height: Long; + format: number; + chunks: number; + hash: Uint8Array; + metadata: MetadataSDKType; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface Metadata { + /** SHA-256 chunk hashes */ + chunkHashes: Uint8Array[]; +} +export interface MetadataProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.Metadata"; + value: Uint8Array; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface MetadataAmino { + /** SHA-256 chunk hashes */ + chunk_hashes: Uint8Array[]; +} +export interface MetadataAminoMsg { + type: "cosmos-sdk/Metadata"; + value: MetadataAmino; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface MetadataSDKType { + chunk_hashes: Uint8Array[]; +} +/** SnapshotItem is an item contained in a rootmulti.Store snapshot. */ +export interface SnapshotItem { + store?: SnapshotStoreItem; + iavl?: SnapshotIAVLItem; + extension?: SnapshotExtensionMeta; + extensionPayload?: SnapshotExtensionPayload; + kv?: SnapshotKVItem; + schema?: SnapshotSchema; +} +export interface SnapshotItemProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotItem"; + value: Uint8Array; +} +/** SnapshotItem is an item contained in a rootmulti.Store snapshot. */ +export interface SnapshotItemAmino { + store?: SnapshotStoreItemAmino; + iavl?: SnapshotIAVLItemAmino; + extension?: SnapshotExtensionMetaAmino; + extension_payload?: SnapshotExtensionPayloadAmino; + kv?: SnapshotKVItemAmino; + schema?: SnapshotSchemaAmino; +} +export interface SnapshotItemAminoMsg { + type: "cosmos-sdk/SnapshotItem"; + value: SnapshotItemAmino; +} +/** SnapshotItem is an item contained in a rootmulti.Store snapshot. */ +export interface SnapshotItemSDKType { + store?: SnapshotStoreItemSDKType; + iavl?: SnapshotIAVLItemSDKType; + extension?: SnapshotExtensionMetaSDKType; + extension_payload?: SnapshotExtensionPayloadSDKType; + kv?: SnapshotKVItemSDKType; + schema?: SnapshotSchemaSDKType; +} +/** SnapshotStoreItem contains metadata about a snapshotted store. */ +export interface SnapshotStoreItem { + name: string; +} +export interface SnapshotStoreItemProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotStoreItem"; + value: Uint8Array; +} +/** SnapshotStoreItem contains metadata about a snapshotted store. */ +export interface SnapshotStoreItemAmino { + name: string; +} +export interface SnapshotStoreItemAminoMsg { + type: "cosmos-sdk/SnapshotStoreItem"; + value: SnapshotStoreItemAmino; +} +/** SnapshotStoreItem contains metadata about a snapshotted store. */ +export interface SnapshotStoreItemSDKType { + name: string; +} +/** SnapshotIAVLItem is an exported IAVL node. */ +export interface SnapshotIAVLItem { + key: Uint8Array; + value: Uint8Array; + /** version is block height */ + version: Long; + /** height is depth of the tree. */ + height: number; +} +export interface SnapshotIAVLItemProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotIAVLItem"; + value: Uint8Array; +} +/** SnapshotIAVLItem is an exported IAVL node. */ +export interface SnapshotIAVLItemAmino { + key: Uint8Array; + value: Uint8Array; + /** version is block height */ + version: string; + /** height is depth of the tree. */ + height: number; +} +export interface SnapshotIAVLItemAminoMsg { + type: "cosmos-sdk/SnapshotIAVLItem"; + value: SnapshotIAVLItemAmino; +} +/** SnapshotIAVLItem is an exported IAVL node. */ +export interface SnapshotIAVLItemSDKType { + key: Uint8Array; + value: Uint8Array; + version: Long; + height: number; +} +/** SnapshotExtensionMeta contains metadata about an external snapshotter. */ +export interface SnapshotExtensionMeta { + name: string; + format: number; +} +export interface SnapshotExtensionMetaProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta"; + value: Uint8Array; +} +/** SnapshotExtensionMeta contains metadata about an external snapshotter. */ +export interface SnapshotExtensionMetaAmino { + name: string; + format: number; +} +export interface SnapshotExtensionMetaAminoMsg { + type: "cosmos-sdk/SnapshotExtensionMeta"; + value: SnapshotExtensionMetaAmino; +} +/** SnapshotExtensionMeta contains metadata about an external snapshotter. */ +export interface SnapshotExtensionMetaSDKType { + name: string; + format: number; +} +/** SnapshotExtensionPayload contains payloads of an external snapshotter. */ +export interface SnapshotExtensionPayload { + payload: Uint8Array; +} +export interface SnapshotExtensionPayloadProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload"; + value: Uint8Array; +} +/** SnapshotExtensionPayload contains payloads of an external snapshotter. */ +export interface SnapshotExtensionPayloadAmino { + payload: Uint8Array; +} +export interface SnapshotExtensionPayloadAminoMsg { + type: "cosmos-sdk/SnapshotExtensionPayload"; + value: SnapshotExtensionPayloadAmino; +} +/** SnapshotExtensionPayload contains payloads of an external snapshotter. */ +export interface SnapshotExtensionPayloadSDKType { + payload: Uint8Array; +} +/** SnapshotKVItem is an exported Key/Value Pair */ +export interface SnapshotKVItem { + key: Uint8Array; + value: Uint8Array; +} +export interface SnapshotKVItemProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotKVItem"; + value: Uint8Array; +} +/** SnapshotKVItem is an exported Key/Value Pair */ +export interface SnapshotKVItemAmino { + key: Uint8Array; + value: Uint8Array; +} +export interface SnapshotKVItemAminoMsg { + type: "cosmos-sdk/SnapshotKVItem"; + value: SnapshotKVItemAmino; +} +/** SnapshotKVItem is an exported Key/Value Pair */ +export interface SnapshotKVItemSDKType { + key: Uint8Array; + value: Uint8Array; +} +/** SnapshotSchema is an exported schema of smt store */ +export interface SnapshotSchema { + keys: Uint8Array[]; +} +export interface SnapshotSchemaProtoMsg { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotSchema"; + value: Uint8Array; +} +/** SnapshotSchema is an exported schema of smt store */ +export interface SnapshotSchemaAmino { + keys: Uint8Array[]; +} +export interface SnapshotSchemaAminoMsg { + type: "cosmos-sdk/SnapshotSchema"; + value: SnapshotSchemaAmino; +} +/** SnapshotSchema is an exported schema of smt store */ +export interface SnapshotSchemaSDKType { + keys: Uint8Array[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/commit_info.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/commit_info.ts new file mode 100644 index 000000000..01c4979ca --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/commit_info.ts @@ -0,0 +1,97 @@ +import { Long } from "../../../../helpers"; +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfo { + version: Long; + storeInfos: StoreInfo[]; +} +export interface CommitInfoProtoMsg { + typeUrl: "/cosmos.base.store.v1beta1.CommitInfo"; + value: Uint8Array; +} +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfoAmino { + version: string; + store_infos: StoreInfoAmino[]; +} +export interface CommitInfoAminoMsg { + type: "cosmos-sdk/CommitInfo"; + value: CommitInfoAmino; +} +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfoSDKType { + version: Long; + store_infos: StoreInfoSDKType[]; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfo { + name: string; + commitId: CommitID; +} +export interface StoreInfoProtoMsg { + typeUrl: "/cosmos.base.store.v1beta1.StoreInfo"; + value: Uint8Array; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfoAmino { + name: string; + commit_id?: CommitIDAmino; +} +export interface StoreInfoAminoMsg { + type: "cosmos-sdk/StoreInfo"; + value: StoreInfoAmino; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfoSDKType { + name: string; + commit_id: CommitIDSDKType; +} +/** + * CommitID defines the committment information when a specific store is + * committed. + */ +export interface CommitID { + version: Long; + hash: Uint8Array; +} +export interface CommitIDProtoMsg { + typeUrl: "/cosmos.base.store.v1beta1.CommitID"; + value: Uint8Array; +} +/** + * CommitID defines the committment information when a specific store is + * committed. + */ +export interface CommitIDAmino { + version: string; + hash: Uint8Array; +} +export interface CommitIDAminoMsg { + type: "cosmos-sdk/CommitID"; + value: CommitIDAmino; +} +/** + * CommitID defines the committment information when a specific store is + * committed. + */ +export interface CommitIDSDKType { + version: Long; + hash: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/listening.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/listening.ts new file mode 100644 index 000000000..10bfc184b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/store/v1beta1/listening.ts @@ -0,0 +1,51 @@ +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPair { + /** the store key for the KVStore this pair originates from */ + storeKey: string; + /** true indicates a delete operation, false indicates a set operation */ + delete: boolean; + key: Uint8Array; + value: Uint8Array; +} +export interface StoreKVPairProtoMsg { + typeUrl: "/cosmos.base.store.v1beta1.StoreKVPair"; + value: Uint8Array; +} +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPairAmino { + /** the store key for the KVStore this pair originates from */ + store_key: string; + /** true indicates a delete operation, false indicates a set operation */ + delete: boolean; + key: Uint8Array; + value: Uint8Array; +} +export interface StoreKVPairAminoMsg { + type: "cosmos-sdk/StoreKVPair"; + value: StoreKVPairAmino; +} +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPairSDKType { + store_key: string; + delete: boolean; + key: Uint8Array; + value: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/v1beta1/coin.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/v1beta1/coin.ts new file mode 100644 index 000000000..4b59cd876 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,116 @@ +/** + * 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; +} +/** + * 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 CoinSDKType { + denom: string; + amount: string; +} +/** + * 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; +} +/** + * 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 DecCoinSDKType { + denom: string; + amount: string; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} +export interface IntProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.IntProto"; + value: Uint8Array; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoAmino { + int: string; +} +export interface IntProtoAminoMsg { + type: "cosmos-sdk/IntProto"; + value: IntProtoAmino; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoSDKType { + int: string; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} +export interface DecProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecProto"; + value: Uint8Array; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoAmino { + dec: string; +} +export interface DecProtoAminoMsg { + type: "cosmos-sdk/DecProto"; + value: DecProtoAmino; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoSDKType { + dec: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts new file mode 100644 index 000000000..cfb49500c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts @@ -0,0 +1,298 @@ +import * as _2 from "./app/v1alpha1/config"; +import * as _3 from "./app/v1alpha1/module"; +import * as _4 from "./auth/v1beta1/auth"; +import * as _5 from "./auth/v1beta1/genesis"; +import * as _6 from "./authz/v1beta1/authz"; +import * as _7 from "./authz/v1beta1/event"; +import * as _8 from "./authz/v1beta1/genesis"; +import * as _9 from "./authz/v1beta1/tx"; +import * as _10 from "./bank/v1beta1/authz"; +import * as _11 from "./bank/v1beta1/bank"; +import * as _12 from "./bank/v1beta1/genesis"; +import * as _13 from "./bank/v1beta1/tx"; +import * as _14 from "./base/abci/v1beta1/abci"; +import * as _15 from "./base/kv/v1beta1/kv"; +import * as _16 from "./base/query/v1beta1/pagination"; +import * as _17 from "./base/reflection/v1beta1/reflection"; +import * as _18 from "./base/reflection/v2alpha1/reflection"; +import * as _19 from "./base/snapshots/v1beta1/snapshot"; +import * as _20 from "./base/store/v1beta1/commit_info"; +import * as _21 from "./base/store/v1beta1/listening"; +import * as _22 from "./base/v1beta1/coin"; +import * as _23 from "./capability/v1beta1/capability"; +import * as _24 from "./capability/v1beta1/genesis"; +import * as _25 from "./crisis/v1beta1/genesis"; +import * as _26 from "./crisis/v1beta1/tx"; +import * as _27 from "./crypto/ed25519/keys"; +import * as _28 from "./crypto/hd/v1/hd"; +import * as _29 from "./crypto/keyring/v1/record"; +import * as _30 from "./crypto/multisig/keys"; +import * as _31 from "./crypto/secp256k1/keys"; +import * as _32 from "./crypto/secp256r1/keys"; +import * as _33 from "./distribution/v1beta1/distribution"; +import * as _34 from "./distribution/v1beta1/genesis"; +import * as _35 from "./distribution/v1beta1/tx"; +import * as _36 from "./evidence/v1beta1/evidence"; +import * as _37 from "./evidence/v1beta1/genesis"; +import * as _38 from "./evidence/v1beta1/tx"; +import * as _39 from "./feegrant/v1beta1/feegrant"; +import * as _40 from "./feegrant/v1beta1/genesis"; +import * as _41 from "./feegrant/v1beta1/tx"; +import * as _42 from "./genutil/v1beta1/genesis"; +import * as _43 from "./gov/v1/genesis"; +import * as _44 from "./gov/v1/gov"; +import * as _45 from "./gov/v1/tx"; +import * as _46 from "./gov/v1beta1/genesis"; +import * as _47 from "./gov/v1beta1/gov"; +import * as _48 from "./gov/v1beta1/tx"; +import * as _49 from "./group/v1/events"; +import * as _50 from "./group/v1/genesis"; +import * as _51 from "./group/v1/tx"; +import * as _52 from "./group/v1/types"; +import * as _53 from "./mint/v1beta1/genesis"; +import * as _54 from "./mint/v1beta1/mint"; +import * as _55 from "./msg/v1/msg"; +import * as _56 from "./slashing/v1beta1/msg"; +import * as _57 from "./nft/v1beta1/event"; +import * as _58 from "./nft/v1beta1/genesis"; +import * as _59 from "./nft/v1beta1/nft"; +import * as _60 from "./nft/v1beta1/tx"; +import * as _61 from "./orm/v1/orm"; +import * as _62 from "./orm/v1alpha1/schema"; +import * as _63 from "./params/v1beta1/params"; +import * as _64 from "./slashing/v1beta1/genesis"; +import * as _65 from "./slashing/v1beta1/slashing"; +import * as _66 from "./slashing/v1beta1/tx"; +import * as _67 from "./staking/v1beta1/authz"; +import * as _68 from "./staking/v1beta1/genesis"; +import * as _69 from "./staking/v1beta1/staking"; +import * as _70 from "./staking/v1beta1/tx"; +import * as _71 from "./tx/signing/v1beta1/signing"; +import * as _72 from "./tx/v1beta1/service"; +import * as _73 from "./tx/v1beta1/tx"; +import * as _74 from "./upgrade/v1beta1/tx"; +import * as _75 from "./upgrade/v1beta1/upgrade"; +import * as _76 from "./vesting/v1beta1/tx"; +import * as _77 from "./vesting/v1beta1/vesting"; +export namespace cosmos { + export namespace app { + export const v1alpha1 = { + ..._2, + ..._3 + }; + } + export namespace auth { + export const v1beta1 = { + ..._4, + ..._5 + }; + } + export namespace authz { + export const v1beta1 = { + ..._6, + ..._7, + ..._8, + ..._9 + }; + } + export namespace bank { + export const v1beta1 = { + ..._10, + ..._11, + ..._12, + ..._13 + }; + } + export namespace base { + export namespace abci { + export const v1beta1 = { + ..._14 + }; + } + export namespace kv { + export const v1beta1 = { + ..._15 + }; + } + export namespace query { + export const v1beta1 = { + ..._16 + }; + } + export namespace reflection { + export const v1beta1 = { + ..._17 + }; + export const v2alpha1 = { + ..._18 + }; + } + export namespace snapshots { + export const v1beta1 = { + ..._19 + }; + } + export namespace store { + export const v1beta1 = { + ..._20, + ..._21 + }; + } + export const v1beta1 = { + ..._22 + }; + } + export namespace capability { + export const v1beta1 = { + ..._23, + ..._24 + }; + } + export namespace crisis { + export const v1beta1 = { + ..._25, + ..._26 + }; + } + export namespace crypto { + export const ed25519 = { + ..._27 + }; + export namespace hd { + export const v1 = { + ..._28 + }; + } + export namespace keyring { + export const v1 = { + ..._29 + }; + } + export const multisig = { + ..._30 + }; + export const secp256k1 = { + ..._31 + }; + export const secp256r1 = { + ..._32 + }; + } + export namespace distribution { + export const v1beta1 = { + ..._33, + ..._34, + ..._35 + }; + } + export namespace evidence { + export const v1beta1 = { + ..._36, + ..._37, + ..._38 + }; + } + export namespace feegrant { + export const v1beta1 = { + ..._39, + ..._40, + ..._41 + }; + } + export namespace genutil { + export const v1beta1 = { + ..._42 + }; + } + export namespace gov { + export const v1 = { + ..._43, + ..._44, + ..._45 + }; + export const v1beta1 = { + ..._46, + ..._47, + ..._48 + }; + } + export namespace group { + export const v1 = { + ..._49, + ..._50, + ..._51, + ..._52 + }; + } + export namespace mint { + export const v1beta1 = { + ..._53, + ..._54 + }; + } + export namespace msg { + export const v1 = { + ..._55, + ..._56 + }; + } + export namespace nft { + export const v1beta1 = { + ..._57, + ..._58, + ..._59, + ..._60 + }; + } + export namespace orm { + export const v1 = { + ..._61 + }; + export const v1alpha1 = { + ..._62 + }; + } + export namespace params { + export const v1beta1 = { + ..._63 + }; + } + export namespace slashing { + export const v1beta1 = { + ..._64, + ..._65, + ..._66 + }; + } + export namespace staking { + export const v1beta1 = { + ..._67, + ..._68, + ..._69, + ..._70 + }; + } + export namespace tx { + export namespace signing { + export const v1beta1 = { + ..._71 + }; + } + export const v1beta1 = { + ..._72, + ..._73 + }; + } + export namespace upgrade { + export const v1beta1 = { + ..._74, + ..._75 + }; + } + export namespace vesting { + export const v1beta1 = { + ..._76, + ..._77 + }; + } +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/capability.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/capability.ts new file mode 100644 index 000000000..c53360b75 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/capability.ts @@ -0,0 +1,91 @@ +import { Long } from "../../../helpers"; +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface Capability { + index: Long; +} +export interface CapabilityProtoMsg { + typeUrl: "/cosmos.capability.v1beta1.Capability"; + value: Uint8Array; +} +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface CapabilityAmino { + index: string; +} +export interface CapabilityAminoMsg { + type: "cosmos-sdk/Capability"; + value: CapabilityAmino; +} +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface CapabilitySDKType { + index: Long; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface Owner { + module: string; + name: string; +} +export interface OwnerProtoMsg { + typeUrl: "/cosmos.capability.v1beta1.Owner"; + value: Uint8Array; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface OwnerAmino { + module: string; + name: string; +} +export interface OwnerAminoMsg { + type: "cosmos-sdk/Owner"; + value: OwnerAmino; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface OwnerSDKType { + module: string; + name: string; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwners { + owners: Owner[]; +} +export interface CapabilityOwnersProtoMsg { + typeUrl: "/cosmos.capability.v1beta1.CapabilityOwners"; + value: Uint8Array; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwnersAmino { + owners: OwnerAmino[]; +} +export interface CapabilityOwnersAminoMsg { + type: "cosmos-sdk/CapabilityOwners"; + value: CapabilityOwnersAmino; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwnersSDKType { + owners: OwnerSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/genesis.ts new file mode 100644 index 000000000..b3a01f2c1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/capability/v1beta1/genesis.ts @@ -0,0 +1,62 @@ +import { CapabilityOwners, CapabilityOwnersAmino, CapabilityOwnersSDKType } from "./capability"; +import { Long } from "../../../helpers"; +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwners { + /** index is the index of the capability owner. */ + index: Long; + /** index_owners are the owners at the given index. */ + indexOwners: CapabilityOwners; +} +export interface GenesisOwnersProtoMsg { + typeUrl: "/cosmos.capability.v1beta1.GenesisOwners"; + value: Uint8Array; +} +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwnersAmino { + /** index is the index of the capability owner. */ + index: string; + /** index_owners are the owners at the given index. */ + index_owners?: CapabilityOwnersAmino; +} +export interface GenesisOwnersAminoMsg { + type: "cosmos-sdk/GenesisOwners"; + value: GenesisOwnersAmino; +} +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwnersSDKType { + index: Long; + index_owners: CapabilityOwnersSDKType; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisState { + /** index is the capability global index. */ + index: Long; + /** + * owners represents a map from index to owners of the capability index + * index key is string to allow amino marshalling. + */ + owners: GenesisOwners[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.capability.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisStateAmino { + /** index is the capability global index. */ + index: string; + /** + * owners represents a map from index to owners of the capability index + * index key is string to allow amino marshalling. + */ + owners: GenesisOwnersAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisStateSDKType { + index: Long; + owners: GenesisOwnersSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/genesis.ts new file mode 100644 index 000000000..264c2fc28 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/genesis.ts @@ -0,0 +1,29 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** GenesisState defines the crisis module's genesis state. */ +export interface GenesisState { + /** + * constant_fee is the fee used to verify the invariant in the crisis + * module. + */ + constantFee: Coin; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.crisis.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the crisis module's genesis state. */ +export interface GenesisStateAmino { + /** + * constant_fee is the fee used to verify the invariant in the crisis + * module. + */ + constant_fee?: CoinAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the crisis module's genesis state. */ +export interface GenesisStateSDKType { + constant_fee: CoinSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/tx.ts new file mode 100644 index 000000000..4107028be --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crisis/v1beta1/tx.ts @@ -0,0 +1,40 @@ +/** MsgVerifyInvariant represents a message to verify a particular invariance. */ +export interface MsgVerifyInvariant { + sender: string; + invariantModuleName: string; + invariantRoute: string; +} +export interface MsgVerifyInvariantProtoMsg { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant"; + value: Uint8Array; +} +/** MsgVerifyInvariant represents a message to verify a particular invariance. */ +export interface MsgVerifyInvariantAmino { + sender: string; + invariant_module_name: string; + invariant_route: string; +} +export interface MsgVerifyInvariantAminoMsg { + type: "cosmos-sdk/MsgVerifyInvariant"; + value: MsgVerifyInvariantAmino; +} +/** MsgVerifyInvariant represents a message to verify a particular invariance. */ +export interface MsgVerifyInvariantSDKType { + sender: string; + invariant_module_name: string; + invariant_route: string; +} +/** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ +export interface MsgVerifyInvariantResponse {} +export interface MsgVerifyInvariantResponseProtoMsg { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariantResponse"; + value: Uint8Array; +} +/** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ +export interface MsgVerifyInvariantResponseAmino {} +export interface MsgVerifyInvariantResponseAminoMsg { + type: "cosmos-sdk/MsgVerifyInvariantResponse"; + value: MsgVerifyInvariantResponseAmino; +} +/** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ +export interface MsgVerifyInvariantResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/ed25519/keys.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/ed25519/keys.ts new file mode 100644 index 000000000..1a43b83a9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/ed25519/keys.ts @@ -0,0 +1,67 @@ +/** + * 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: Uint8Array; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** + * 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 PubKeySDKType { + key: Uint8Array; +} +/** + * Deprecated: 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; +} +/** + * Deprecated: 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: Uint8Array; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** + * Deprecated: PrivKey defines a ed25519 private key. + * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. + */ +export interface PrivKeySDKType { + key: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/hd/v1/hd.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/hd/v1/hd.ts new file mode 100644 index 000000000..548201eb7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/hd/v1/hd.ts @@ -0,0 +1,48 @@ +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44Params { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coinType: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + addressIndex: number; +} +export interface BIP44ParamsProtoMsg { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; + value: Uint8Array; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsAmino { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coin_type: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + address_index: number; +} +export interface BIP44ParamsAminoMsg { + type: "cosmos-sdk/BIP44Params"; + value: BIP44ParamsAmino; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsSDKType { + purpose: number; + coin_type: number; + account: number; + change: boolean; + address_index: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/keyring/v1/record.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/keyring/v1/record.ts new file mode 100644 index 000000000..c208d6be5 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/keyring/v1/record.ts @@ -0,0 +1,129 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; +/** Record is used for representing a key in the keyring. */ +export interface Record { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pubKey: Any; + /** local stores the public information about a locally stored key */ + local?: Record_Local; + /** ledger stores the public information about a Ledger key */ + ledger?: Record_Ledger; + /** Multi does not store any information. */ + multi?: Record_Multi; + /** Offline does not store any information. */ + offline?: Record_Offline; +} +export interface RecordProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Record"; + value: Uint8Array; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordAmino { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pub_key?: AnyAmino; + /** local stores the public information about a locally stored key */ + local?: Record_LocalAmino; + /** ledger stores the public information about a Ledger key */ + ledger?: Record_LedgerAmino; + /** Multi does not store any information. */ + multi?: Record_MultiAmino; + /** Offline does not store any information. */ + offline?: Record_OfflineAmino; +} +export interface RecordAminoMsg { + type: "cosmos-sdk/Record"; + value: RecordAmino; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordSDKType { + name: string; + pub_key: AnySDKType; + local?: Record_LocalSDKType; + ledger?: Record_LedgerSDKType; + multi?: Record_MultiSDKType; + offline?: Record_OfflineSDKType; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_Local { + privKey: Any; + privKeyType: string; +} +export interface Record_LocalProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Local"; + value: Uint8Array; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalAmino { + priv_key?: AnyAmino; + priv_key_type: string; +} +export interface Record_LocalAminoMsg { + type: "cosmos-sdk/Local"; + value: Record_LocalAmino; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalSDKType { + priv_key: AnySDKType; + priv_key_type: string; +} +/** Ledger item */ +export interface Record_Ledger { + path: BIP44Params; +} +export interface Record_LedgerProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; + value: Uint8Array; +} +/** Ledger item */ +export interface Record_LedgerAmino { + path?: BIP44ParamsAmino; +} +export interface Record_LedgerAminoMsg { + type: "cosmos-sdk/Ledger"; + value: Record_LedgerAmino; +} +/** Ledger item */ +export interface Record_LedgerSDKType { + path: BIP44ParamsSDKType; +} +/** Multi item */ +export interface Record_Multi {} +export interface Record_MultiProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Multi"; + value: Uint8Array; +} +/** Multi item */ +export interface Record_MultiAmino {} +export interface Record_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: Record_MultiAmino; +} +/** Multi item */ +export interface Record_MultiSDKType {} +/** Offline item */ +export interface Record_Offline {} +export interface Record_OfflineProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Offline"; + value: Uint8Array; +} +/** Offline item */ +export interface Record_OfflineAmino {} +export interface Record_OfflineAminoMsg { + type: "cosmos-sdk/Offline"; + value: Record_OfflineAmino; +} +/** Offline item */ +export interface Record_OfflineSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/keys.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/keys.ts new file mode 100644 index 000000000..275dcd5f3 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/keys.ts @@ -0,0 +1,36 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKey { + threshold: number; + publicKeys: Any[]; +} +export interface LegacyAminoPubKeyProtoMsg { + typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey"; + value: Uint8Array; +} +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKeyAmino { + threshold: number; + public_keys: AnyAmino[]; +} +export interface LegacyAminoPubKeyAminoMsg { + type: "cosmos-sdk/LegacyAminoPubKey"; + value: LegacyAminoPubKeyAmino; +} +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKeySDKType { + threshold: number; + public_keys: AnySDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/v1beta1/multisig.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 000000000..1fe4691b2 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,70 @@ +/** + * 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: Uint8Array[]; +} +export interface MultiSignatureAminoMsg { + type: "cosmos-sdk/MultiSignature"; + value: MultiSignatureAmino; +} +/** + * 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 MultiSignatureSDKType { + signatures: 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 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: Uint8Array; +} +export interface CompactBitArrayAminoMsg { + type: "cosmos-sdk/CompactBitArray"; + value: CompactBitArrayAmino; +} +/** + * 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 CompactBitArraySDKType { + extra_bits_stored: number; + elems: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256k1/keys.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 000000000..97d73b297 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,58 @@ +/** + * 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: Uint8Array; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** + * 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 PubKeySDKType { + key: Uint8Array; +} +/** 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: Uint8Array; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKeySDKType { + key: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256r1/keys.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256r1/keys.ts new file mode 100644 index 000000000..b54370e26 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/crypto/secp256r1/keys.ts @@ -0,0 +1,50 @@ +/** 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: Uint8Array; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKeySDKType { + key: Uint8Array; +} +/** 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: Uint8Array; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKeySDKType { + secret: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/distribution.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 000000000..81f208171 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,425 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** Params defines the set of params for the distribution module. */ +export interface Params { + communityTax: string; + baseProposerReward: string; + 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; + base_proposer_reward: string; + bonus_proposer_reward: string; + withdraw_addr_enabled: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsSDKType { + community_tax: string; + base_proposer_reward: string; + bonus_proposer_reward: string; + withdraw_addr_enabled: boolean; +} +/** + * 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; +} +/** + * 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 ValidatorHistoricalRewardsSDKType { + cumulative_reward_ratio: DecCoinSDKType[]; + reference_count: number; +} +/** + * 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: Long; +} +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; +} +/** + * 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 ValidatorCurrentRewardsSDKType { + rewards: DecCoinSDKType[]; + period: Long; +} +/** + * 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; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionSDKType { + commission: DecCoinSDKType[]; +} +/** + * 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; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsSDKType { + rewards: DecCoinSDKType[]; +} +/** + * 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: Long; + 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; +} +/** + * 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 ValidatorSlashEventSDKType { + validator_period: Long; + fraction: string; +} +/** 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; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsSDKType { + validator_slash_events: ValidatorSlashEventSDKType[]; +} +/** 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; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolSDKType { + community_pool: DecCoinSDKType[]; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +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. + */ +export interface CommunityPoolSpendProposalAmino { + title: string; + description: string; + recipient: string; + amount: CoinAmino[]; +} +export interface CommunityPoolSpendProposalAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposal"; + value: CommunityPoolSpendProposalAmino; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposalSDKType { + title: string; + description: string; + recipient: string; + amount: CoinSDKType[]; +} +/** + * 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: Long; + stake: string; + height: Long; +} +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; +} +/** + * 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 DelegatorStartingInfoSDKType { + previous_period: Long; + stake: string; + height: Long; +} +/** + * 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; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardSDKType { + validator_address: string; + reward: DecCoinSDKType[]; +} +/** + * 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; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositSDKType { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/genesis.ts new file mode 100644 index 000000000..5a63614b1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/genesis.ts @@ -0,0 +1,309 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; +import { ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorHistoricalRewards, ValidatorHistoricalRewardsAmino, ValidatorHistoricalRewardsSDKType, ValidatorCurrentRewards, ValidatorCurrentRewardsAmino, ValidatorCurrentRewardsSDKType, DelegatorStartingInfo, DelegatorStartingInfoAmino, DelegatorStartingInfoSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, Params, ParamsAmino, ParamsSDKType, FeePool, FeePoolAmino, FeePoolSDKType } from "./distribution"; +import { Long } from "../../../helpers"; +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfo { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** withdraw_address is the address to withdraw the delegation rewards to. */ + withdrawAddress: string; +} +export interface DelegatorWithdrawInfoProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo"; + value: Uint8Array; +} +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfoAmino { + /** delegator_address is the address of the delegator. */ + delegator_address: string; + /** withdraw_address is the address to withdraw the delegation rewards to. */ + withdraw_address: string; +} +export interface DelegatorWithdrawInfoAminoMsg { + type: "cosmos-sdk/DelegatorWithdrawInfo"; + value: DelegatorWithdrawInfoAmino; +} +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfoSDKType { + delegator_address: string; + withdraw_address: string; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** outstanding_rewards represents the oustanding rewards of a validator. */ + outstandingRewards: DecCoin[]; +} +export interface ValidatorOutstandingRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord"; + value: Uint8Array; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address: string; + /** outstanding_rewards represents the oustanding rewards of a validator. */ + outstanding_rewards: DecCoinAmino[]; +} +export interface ValidatorOutstandingRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorOutstandingRewardsRecord"; + value: ValidatorOutstandingRewardsRecordAmino; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecordSDKType { + validator_address: string; + outstanding_rewards: DecCoinSDKType[]; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** accumulated is the accumulated commission of a validator. */ + accumulated: ValidatorAccumulatedCommission; +} +export interface ValidatorAccumulatedCommissionRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord"; + value: Uint8Array; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecordAmino { + /** validator_address is the address of the validator. */ + validator_address: string; + /** accumulated is the accumulated commission of a validator. */ + accumulated?: ValidatorAccumulatedCommissionAmino; +} +export interface ValidatorAccumulatedCommissionRecordAminoMsg { + type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord"; + value: ValidatorAccumulatedCommissionRecordAmino; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecordSDKType { + validator_address: string; + accumulated: ValidatorAccumulatedCommissionSDKType; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** period defines the period the historical rewards apply to. */ + period: Long; + /** rewards defines the historical rewards of a validator. */ + rewards: ValidatorHistoricalRewards; +} +export interface ValidatorHistoricalRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord"; + value: Uint8Array; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address: string; + /** period defines the period the historical rewards apply to. */ + period: string; + /** rewards defines the historical rewards of a validator. */ + rewards?: ValidatorHistoricalRewardsAmino; +} +export interface ValidatorHistoricalRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorHistoricalRewardsRecord"; + value: ValidatorHistoricalRewardsRecordAmino; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecordSDKType { + validator_address: string; + period: Long; + rewards: ValidatorHistoricalRewardsSDKType; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** rewards defines the current rewards of a validator. */ + rewards: ValidatorCurrentRewards; +} +export interface ValidatorCurrentRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord"; + value: Uint8Array; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address: string; + /** rewards defines the current rewards of a validator. */ + rewards?: ValidatorCurrentRewardsAmino; +} +export interface ValidatorCurrentRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorCurrentRewardsRecord"; + value: ValidatorCurrentRewardsRecordAmino; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecordSDKType { + validator_address: string; + rewards: ValidatorCurrentRewardsSDKType; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecord { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** starting_info defines the starting info of a delegator. */ + startingInfo: DelegatorStartingInfo; +} +export interface DelegatorStartingInfoRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord"; + value: Uint8Array; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecordAmino { + /** delegator_address is the address of the delegator. */ + delegator_address: string; + /** validator_address is the address of the validator. */ + validator_address: string; + /** starting_info defines the starting info of a delegator. */ + starting_info?: DelegatorStartingInfoAmino; +} +export interface DelegatorStartingInfoRecordAminoMsg { + type: "cosmos-sdk/DelegatorStartingInfoRecord"; + value: DelegatorStartingInfoRecordAmino; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecordSDKType { + delegator_address: string; + validator_address: string; + starting_info: DelegatorStartingInfoSDKType; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** height defines the block height at which the slash event occured. */ + height: Long; + /** period is the period of the slash event. */ + period: Long; + /** validator_slash_event describes the slash event. */ + validatorSlashEvent: ValidatorSlashEvent; +} +export interface ValidatorSlashEventRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord"; + value: Uint8Array; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecordAmino { + /** validator_address is the address of the validator. */ + validator_address: string; + /** height defines the block height at which the slash event occured. */ + height: string; + /** period is the period of the slash event. */ + period: string; + /** validator_slash_event describes the slash event. */ + validator_slash_event?: ValidatorSlashEventAmino; +} +export interface ValidatorSlashEventRecordAminoMsg { + type: "cosmos-sdk/ValidatorSlashEventRecord"; + value: ValidatorSlashEventRecordAmino; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecordSDKType { + validator_address: string; + height: Long; + period: Long; + validator_slash_event: ValidatorSlashEventSDKType; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** fee_pool defines the fee pool at genesis. */ + feePool: FeePool; + /** fee_pool defines the delegator withdraw infos at genesis. */ + delegatorWithdrawInfos: DelegatorWithdrawInfo[]; + /** fee_pool defines the previous proposer at genesis. */ + previousProposer: string; + /** fee_pool defines the outstanding rewards of all validators at genesis. */ + outstandingRewards: ValidatorOutstandingRewardsRecord[]; + /** fee_pool defines the accumulated commisions of all validators at genesis. */ + validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; + /** fee_pool defines the historical rewards of all validators at genesis. */ + validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; + /** fee_pool defines the current rewards of all validators at genesis. */ + validatorCurrentRewards: ValidatorCurrentRewardsRecord[]; + /** fee_pool defines the delegator starting infos at genesis. */ + delegatorStartingInfos: DelegatorStartingInfoRecord[]; + /** fee_pool defines the validator slash events at genesis. */ + validatorSlashEvents: ValidatorSlashEventRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** fee_pool defines the fee pool at genesis. */ + fee_pool?: FeePoolAmino; + /** fee_pool defines the delegator withdraw infos at genesis. */ + delegator_withdraw_infos: DelegatorWithdrawInfoAmino[]; + /** fee_pool defines the previous proposer at genesis. */ + previous_proposer: string; + /** fee_pool defines the outstanding rewards of all validators at genesis. */ + outstanding_rewards: ValidatorOutstandingRewardsRecordAmino[]; + /** fee_pool defines the accumulated commisions of all validators at genesis. */ + validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordAmino[]; + /** fee_pool defines the historical rewards of all validators at genesis. */ + validator_historical_rewards: ValidatorHistoricalRewardsRecordAmino[]; + /** fee_pool defines the current rewards of all validators at genesis. */ + validator_current_rewards: ValidatorCurrentRewardsRecordAmino[]; + /** fee_pool defines the delegator starting infos at genesis. */ + delegator_starting_infos: DelegatorStartingInfoRecordAmino[]; + /** fee_pool defines the validator slash events at genesis. */ + validator_slash_events: ValidatorSlashEventRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + fee_pool: FeePoolSDKType; + delegator_withdraw_infos: DelegatorWithdrawInfoSDKType[]; + previous_proposer: string; + outstanding_rewards: ValidatorOutstandingRewardsRecordSDKType[]; + validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordSDKType[]; + validator_historical_rewards: ValidatorHistoricalRewardsRecordSDKType[]; + validator_current_rewards: ValidatorCurrentRewardsRecordSDKType[]; + delegator_starting_infos: DelegatorStartingInfoRecordSDKType[]; + validator_slash_events: ValidatorSlashEventRecordSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 000000000..b8e64f4bb --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,194 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** + * 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; +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressSDKType { + delegator_address: string; + withdraw_address: string; +} +/** 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; +} +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponseSDKType {} +/** + * 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; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardSDKType { + delegator_address: string; + validator_address: string; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponse { + amount: Coin[]; +} +export interface MsgWithdrawDelegatorRewardResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; + value: Uint8Array; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponseAmino { + amount: CoinAmino[]; +} +export interface MsgWithdrawDelegatorRewardResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; + value: MsgWithdrawDelegatorRewardResponseAmino; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponseSDKType { + amount: CoinSDKType[]; +} +/** + * 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; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionSDKType { + validator_address: string; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponse { + amount: Coin[]; +} +export interface MsgWithdrawValidatorCommissionResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; + value: Uint8Array; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponseAmino { + amount: CoinAmino[]; +} +export interface MsgWithdrawValidatorCommissionResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; + value: MsgWithdrawValidatorCommissionResponseAmino; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponseSDKType { + amount: CoinSDKType[]; +} +/** + * 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; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolSDKType { + amount: CoinSDKType[]; + depositor: string; +} +/** 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; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/evidence.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/evidence.ts new file mode 100644 index 000000000..cfadfd9bb --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/evidence.ts @@ -0,0 +1,39 @@ +import { Long } from "../../../helpers"; +/** + * Equivocation implements the Evidence interface and defines evidence of double + * signing misbehavior. + */ +export interface Equivocation { + height: Long; + time: Date; + power: Long; + consensusAddress: string; +} +export interface EquivocationProtoMsg { + typeUrl: "/cosmos.evidence.v1beta1.Equivocation"; + value: Uint8Array; +} +/** + * Equivocation implements the Evidence interface and defines evidence of double + * signing misbehavior. + */ +export interface EquivocationAmino { + height: string; + time?: Date; + power: string; + consensus_address: string; +} +export interface EquivocationAminoMsg { + type: "cosmos-sdk/Equivocation"; + value: EquivocationAmino; +} +/** + * Equivocation implements the Evidence interface and defines evidence of double + * signing misbehavior. + */ +export interface EquivocationSDKType { + height: Long; + time: Date; + power: Long; + consensus_address: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/genesis.ts new file mode 100644 index 000000000..f1ebe7996 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/genesis.ts @@ -0,0 +1,23 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** GenesisState defines the evidence module's genesis state. */ +export interface GenesisState { + /** evidence defines all the evidence at genesis. */ + evidence: Any[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.evidence.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the evidence module's genesis state. */ +export interface GenesisStateAmino { + /** evidence defines all the evidence at genesis. */ + evidence: AnyAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the evidence module's genesis state. */ +export interface GenesisStateSDKType { + evidence: AnySDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/tx.ts new file mode 100644 index 000000000..7c56eceb9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/evidence/v1beta1/tx.ts @@ -0,0 +1,55 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * MsgSubmitEvidence represents a message that supports submitting arbitrary + * Evidence of misbehavior such as equivocation or counterfactual signing. + */ +export interface MsgSubmitEvidence { + submitter: string; + evidence: Any; +} +export interface MsgSubmitEvidenceProtoMsg { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence"; + value: Uint8Array; +} +/** + * MsgSubmitEvidence represents a message that supports submitting arbitrary + * Evidence of misbehavior such as equivocation or counterfactual signing. + */ +export interface MsgSubmitEvidenceAmino { + submitter: string; + evidence?: AnyAmino; +} +export interface MsgSubmitEvidenceAminoMsg { + type: "cosmos-sdk/MsgSubmitEvidence"; + value: MsgSubmitEvidenceAmino; +} +/** + * MsgSubmitEvidence represents a message that supports submitting arbitrary + * Evidence of misbehavior such as equivocation or counterfactual signing. + */ +export interface MsgSubmitEvidenceSDKType { + submitter: string; + evidence: AnySDKType; +} +/** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ +export interface MsgSubmitEvidenceResponse { + /** hash defines the hash of the evidence. */ + hash: Uint8Array; +} +export interface MsgSubmitEvidenceResponseProtoMsg { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse"; + value: Uint8Array; +} +/** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ +export interface MsgSubmitEvidenceResponseAmino { + /** hash defines the hash of the evidence. */ + hash: Uint8Array; +} +export interface MsgSubmitEvidenceResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitEvidenceResponse"; + value: MsgSubmitEvidenceResponseAmino; +} +/** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ +export interface MsgSubmitEvidenceResponseSDKType { + hash: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/feegrant.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/feegrant.ts new file mode 100644 index 000000000..4c341b4cc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/feegrant.ts @@ -0,0 +1,177 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowance { + /** + * spend_limit specifies the maximum amount of tokens that can be spent + * by this allowance and will be updated as tokens are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spendLimit: Coin[]; + /** expiration specifies an optional time when this allowance expires */ + expiration: Date; +} +export interface BasicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance"; + value: Uint8Array; +} +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceAmino { + /** + * spend_limit specifies the maximum amount of tokens that can be spent + * by this allowance and will be updated as tokens are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spend_limit: CoinAmino[]; + /** expiration specifies an optional time when this allowance expires */ + expiration?: Date; +} +export interface BasicAllowanceAminoMsg { + type: "cosmos-sdk/BasicAllowance"; + value: BasicAllowanceAmino; +} +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceSDKType { + spend_limit: CoinSDKType[]; + expiration: Date; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowance { + /** basic specifies a struct of `BasicAllowance` */ + basic: BasicAllowance; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period: Duration; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + periodSpendLimit: Coin[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + periodCanSpend: Coin[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + periodReset: Date; +} +export interface PeriodicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + value: Uint8Array; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceAmino { + /** basic specifies a struct of `BasicAllowance` */ + basic?: BasicAllowanceAmino; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period?: DurationAmino; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + period_spend_limit: CoinAmino[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + period_can_spend: CoinAmino[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + period_reset?: Date; +} +export interface PeriodicAllowanceAminoMsg { + type: "cosmos-sdk/PeriodicAllowance"; + value: PeriodicAllowanceAmino; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceSDKType { + basic: BasicAllowanceSDKType; + period: DurationSDKType; + period_spend_limit: CoinSDKType[]; + period_can_spend: CoinSDKType[]; + period_reset: Date; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowance { + /** allowance can be any of basic and periodic fee allowance. */ + allowance: Any; + /** allowed_messages are the messages for which the grantee has the access. */ + allowedMessages: string[]; +} +export interface AllowedMsgAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + value: Uint8Array; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceAmino { + /** allowance can be any of basic and periodic fee allowance. */ + allowance?: AnyAmino; + /** allowed_messages are the messages for which the grantee has the access. */ + allowed_messages: string[]; +} +export interface AllowedMsgAllowanceAminoMsg { + type: "cosmos-sdk/AllowedMsgAllowance"; + value: AllowedMsgAllowanceAmino; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceSDKType { + allowance: AnySDKType; + allowed_messages: string[]; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface Grant { + /** 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; +} +export interface GrantProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.Grant"; + value: Uint8Array; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantAmino { + /** 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 GrantAminoMsg { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantSDKType { + granter: string; + grantee: string; + allowance: AnySDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/genesis.ts new file mode 100644 index 000000000..cf07fcb52 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/genesis.ts @@ -0,0 +1,21 @@ +import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisState { + allowances: Grant[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateAmino { + allowances: GrantAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateSDKType { + allowances: GrantSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 000000000..fada0c29c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,97 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** + * 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; +} +export interface MsgGrantAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; + value: Uint8Array; +} +/** + * 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; +} +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceSDKType { + granter: string; + grantee: string; + allowance: AnySDKType; +} +/** 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; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseSDKType {} +/** 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; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceSDKType { + granter: string; + grantee: string; +} +/** 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; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/genutil/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/genutil/v1beta1/genesis.ts new file mode 100644 index 000000000..ea36e7dea --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/genutil/v1beta1/genesis.ts @@ -0,0 +1,22 @@ +/** GenesisState defines the raw genesis transaction in JSON. */ +export interface GenesisState { + /** gen_txs defines the genesis transactions. */ + genTxs: Uint8Array[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.genutil.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the raw genesis transaction in JSON. */ +export interface GenesisStateAmino { + /** gen_txs defines the genesis transactions. */ + gen_txs: Uint8Array[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the raw genesis transaction in JSON. */ +export interface GenesisStateSDKType { + gen_txs: Uint8Array[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/genesis.ts new file mode 100644 index 000000000..a5fa6ecae --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/genesis.ts @@ -0,0 +1,54 @@ +import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; +import { Long } from "../../../helpers"; +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: Long; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** params defines all the paramaters of related to deposit. */ + depositParams: DepositParams; + /** params defines all the paramaters of related to voting. */ + votingParams: VotingParams; + /** params defines all the paramaters of related to tally. */ + tallyParams: TallyParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.gov.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateAmino { + /** starting_proposal_id is the ID of the starting proposal. */ + starting_proposal_id: string; + /** deposits defines all the deposits present at genesis. */ + deposits: DepositAmino[]; + /** votes defines all the votes present at genesis. */ + votes: VoteAmino[]; + /** proposals defines all the proposals present at genesis. */ + proposals: ProposalAmino[]; + /** params defines all the paramaters of related to deposit. */ + deposit_params?: DepositParamsAmino; + /** params defines all the paramaters of related to voting. */ + voting_params?: VotingParamsAmino; + /** params defines all the paramaters of related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/v1/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateSDKType { + starting_proposal_id: Long; + deposits: DepositSDKType[]; + votes: VoteSDKType[]; + proposals: ProposalSDKType[]; + deposit_params: DepositParamsSDKType; + voting_params: VotingParamsSDKType; + tally_params: TallyParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/gov.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/gov.ts new file mode 100644 index 000000000..d73f1265b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/gov.ts @@ -0,0 +1,423 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOption { + option: VoteOption; + 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: VoteOption; + weight: string; +} +export interface WeightedVoteOptionAminoMsg { + type: "cosmos-sdk/v1/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOptionSDKType { + option: VoteOption; + weight: string; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + proposalId: Long; + depositor: string; + 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: string; + depositor: string; + amount: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "cosmos-sdk/v1/Deposit"; + value: DepositAmino; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: Long; + depositor: string; + amount: CoinSDKType[]; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + id: Long; + messages: Any[]; + 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; + submitTime: Date; + depositEndTime: Date; + totalDeposit: Coin[]; + votingStartTime: Date; + votingEndTime: Date; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: 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: string; + messages: AnyAmino[]; + 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?: Date; + deposit_end_time?: Date; + total_deposit: CoinAmino[]; + voting_start_time?: Date; + voting_end_time?: Date; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/v1/Proposal"; + value: ProposalAmino; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + id: Long; + messages: AnySDKType[]; + status: ProposalStatus; + final_tally_result: TallyResultSDKType; + submit_time: Date; + deposit_end_time: Date; + total_deposit: CoinSDKType[]; + voting_start_time: Date; + voting_end_time: Date; + metadata: string; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + yesCount: string; + abstainCount: string; + noCount: string; + 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: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/v1/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + proposalId: Long; + voter: string; + options: WeightedVoteOption[]; + /** metadata is any arbitrary metadata to attached to the vote. */ + 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: string; + voter: string; + options: WeightedVoteOptionAmino[]; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata: string; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/v1/Vote"; + value: VoteAmino; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: Long; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** 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.v1.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/v1/DepositParams"; + value: DepositParamsAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period: DurationSDKType; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Length 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. */ +export interface VotingParamsAmino { + /** Length of the voting period. */ + voting_period?: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/v1/VotingParams"; + value: VotingParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsSDKType { + voting_period: DurationSDKType; +} +/** 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: 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. */ +export interface TallyParamsAmino { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold: string; +} +export interface TallyParamsAminoMsg { + type: "cosmos-sdk/v1/TallyParams"; + value: TallyParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsSDKType { + quorum: string; + threshold: string; + veto_threshold: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/tx.ts new file mode 100644 index 000000000..544ab094c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1/tx.ts @@ -0,0 +1,240 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType } from "./gov"; +import { Long } from "../../../helpers"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + messages: Any[]; + initialDeposit: Coin[]; + proposer: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; +} +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: AnyAmino[]; + initial_deposit: CoinAmino[]; + proposer: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + messages: AnySDKType[]; + initial_deposit: CoinSDKType[]; + proposer: string; + metadata: string; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: Long; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + proposal_id: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: Long; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContent { + /** content is the proposal's content. */ + content: Any; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentAmino { + /** content is the proposal's content. */ + content?: AnyAmino; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContent"; + value: MsgExecLegacyContentAmino; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentSDKType { + content: AnySDKType; + authority: string; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponse {} +export interface MsgExecLegacyContentResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; + value: Uint8Array; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseAmino {} +export interface MsgExecLegacyContentResponseAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; + value: MsgExecLegacyContentResponseAmino; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseSDKType {} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + proposalId: Long; + voter: string; + option: VoteOption; + 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: string; + voter: string; + option: VoteOption; + metadata: string; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/v1/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: Long; + voter: string; + option: VoteOption; + metadata: string; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + proposalId: Long; + voter: string; + options: WeightedVoteOption[]; + 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: string; + voter: string; + options: WeightedVoteOptionAmino[]; + metadata: string; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedSDKType { + proposal_id: Long; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + proposalId: Long; + depositor: string; + 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: string; + depositor: string; + amount: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "cosmos-sdk/v1/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: Long; + depositor: string; + amount: CoinSDKType[]; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/v1/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/genesis.ts new file mode 100644 index 000000000..b1fe42480 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/genesis.ts @@ -0,0 +1,54 @@ +import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; +import { Long } from "../../../helpers"; +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: Long; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** params defines all the paramaters of related to deposit. */ + depositParams: DepositParams; + /** params defines all the paramaters of related to voting. */ + votingParams: VotingParams; + /** params defines all the paramaters of related to tally. */ + tallyParams: TallyParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateAmino { + /** starting_proposal_id is the ID of the starting proposal. */ + starting_proposal_id: string; + /** deposits defines all the deposits present at genesis. */ + deposits: DepositAmino[]; + /** votes defines all the votes present at genesis. */ + votes: VoteAmino[]; + /** proposals defines all the proposals present at genesis. */ + proposals: ProposalAmino[]; + /** params defines all the paramaters of related to deposit. */ + deposit_params?: DepositParamsAmino; + /** params defines all the paramaters of related to voting. */ + voting_params?: VotingParamsAmino; + /** params defines all the paramaters of related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateSDKType { + starting_proposal_id: Long; + deposits: DepositSDKType[]; + votes: VoteSDKType[]; + proposals: ProposalSDKType[]; + deposit_params: DepositParamsSDKType; + voting_params: VotingParamsSDKType; + tally_params: TallyParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/gov.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 000000000..639c66ce0 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,465 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOption { + option: VoteOption; + 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: VoteOption; + weight: string; +} +export interface WeightedVoteOptionAminoMsg { + type: "cosmos-sdk/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOptionSDKType { + option: VoteOption; + weight: string; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposal { + title: string; + 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: string; + description: string; +} +export interface TextProposalAminoMsg { + type: "cosmos-sdk/TextProposal"; + value: TextProposalAmino; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposalSDKType { + title: string; + description: string; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + proposalId: Long; + depositor: string; + 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: string; + depositor: string; + amount: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "cosmos-sdk/Deposit"; + value: DepositAmino; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: Long; + depositor: string; + amount: CoinSDKType[]; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + proposalId: Long; + content: Any; + status: ProposalStatus; + finalTallyResult: TallyResult; + submitTime: Date; + depositEndTime: Date; + totalDeposit: Coin[]; + votingStartTime: Date; + votingEndTime: Date; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.Proposal"; + value: Uint8Array; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + proposal_id: string; + content?: AnyAmino; + status: ProposalStatus; + final_tally_result?: TallyResultAmino; + submit_time?: Date; + deposit_end_time?: Date; + total_deposit: CoinAmino[]; + voting_start_time?: Date; + voting_end_time?: Date; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/Proposal"; + value: ProposalAmino; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + proposal_id: Long; + content: AnySDKType; + status: ProposalStatus; + final_tally_result: TallyResultSDKType; + submit_time: Date; + deposit_end_time: Date; + total_deposit: CoinSDKType[]; + voting_start_time: Date; + voting_end_time: Date; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + yes: string; + abstain: string; + no: string; + 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: string; + abstain: string; + no: string; + no_with_veto: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes: string; + abstain: string; + no: string; + no_with_veto: string; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + proposalId: Long; + 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; + /** 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: string; + 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; + /** Since: cosmos-sdk 0.43 */ + options: WeightedVoteOptionAmino[]; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: Long; + voter: string; + /** @deprecated */ + option: VoteOption; + options: WeightedVoteOptionSDKType[]; +} +/** 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; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period: DurationSDKType; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Length 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 { + /** Length of the voting period. */ + voting_period?: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/VotingParams"; + value: VotingParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsSDKType { + voting_period: DurationSDKType; +} +/** 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: 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. + */ + veto_threshold: Uint8Array; +} +export interface TallyParamsAminoMsg { + type: "cosmos-sdk/TallyParams"; + value: TallyParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsSDKType { + quorum: Uint8Array; + threshold: Uint8Array; + veto_threshold: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 000000000..233f77383 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,203 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType } from "./gov"; +import { Long } from "../../../helpers"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + content: Any; + initialDeposit: Coin[]; + proposer: string; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; + value: Uint8Array; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + content?: AnyAmino; + initial_deposit: CoinAmino[]; + proposer: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + content: AnySDKType; + initial_deposit: CoinSDKType[]; + proposer: string; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: Long; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + proposal_id: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: Long; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + proposalId: Long; + voter: string; + 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: string; + voter: string; + option: VoteOption; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: Long; + voter: string; + option: VoteOption; +} +/** 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; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeighted { + proposalId: Long; + voter: string; + 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: string; + voter: string; + options: WeightedVoteOptionAmino[]; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedSDKType { + proposal_id: Long; + voter: string; + options: WeightedVoteOptionSDKType[]; +} +/** + * 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; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + proposalId: Long; + depositor: string; + 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: string; + depositor: string; + amount: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "cosmos-sdk/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: Long; + depositor: string; + amount: CoinSDKType[]; +} +/** 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; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/events.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/events.ts new file mode 100644 index 000000000..77b9c0661 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/events.ts @@ -0,0 +1,210 @@ +import { ProposalExecutorResult } from "./types"; +import { Long } from "../../../helpers"; +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroup { + /** group_id is the unique ID of the group. */ + groupId: Long; +} +export interface EventCreateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroup"; + value: Uint8Array; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id: string; +} +export interface EventCreateGroupAminoMsg { + type: "cosmos-sdk/EventCreateGroup"; + value: EventCreateGroupAmino; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupSDKType { + group_id: Long; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroup { + /** group_id is the unique ID of the group. */ + groupId: Long; +} +export interface EventUpdateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroup"; + value: Uint8Array; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id: string; +} +export interface EventUpdateGroupAminoMsg { + type: "cosmos-sdk/EventUpdateGroup"; + value: EventUpdateGroupAmino; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupSDKType { + group_id: Long; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy"; + value: Uint8Array; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventCreateGroupPolicy"; + value: EventCreateGroupPolicyAmino; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicySDKType { + address: string; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventUpdateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy"; + value: Uint8Array; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventUpdateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventUpdateGroupPolicy"; + value: EventUpdateGroupPolicyAmino; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicySDKType { + address: string; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: Long; +} +export interface EventSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventSubmitProposal"; + value: Uint8Array; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id: string; +} +export interface EventSubmitProposalAminoMsg { + type: "cosmos-sdk/EventSubmitProposal"; + value: EventSubmitProposalAmino; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalSDKType { + proposal_id: Long; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: Long; +} +export interface EventWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal"; + value: Uint8Array; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id: string; +} +export interface EventWithdrawProposalAminoMsg { + type: "cosmos-sdk/EventWithdrawProposal"; + value: EventWithdrawProposalAmino; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalSDKType { + proposal_id: Long; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVote { + /** proposal_id is the unique ID of the proposal. */ + proposalId: Long; +} +export interface EventVoteProtoMsg { + typeUrl: "/cosmos.group.v1.EventVote"; + value: Uint8Array; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id: string; +} +export interface EventVoteAminoMsg { + type: "cosmos-sdk/EventVote"; + value: EventVoteAmino; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteSDKType { + proposal_id: Long; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExec { + /** proposal_id is the unique ID of the proposal. */ + proposalId: Long; + /** result is the proposal execution result. */ + result: ProposalExecutorResult; +} +export interface EventExecProtoMsg { + typeUrl: "/cosmos.group.v1.EventExec"; + value: Uint8Array; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id: string; + /** result is the proposal execution result. */ + result: ProposalExecutorResult; +} +export interface EventExecAminoMsg { + type: "cosmos-sdk/EventExec"; + value: EventExecAmino; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecSDKType { + proposal_id: Long; + result: ProposalExecutorResult; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroup { + /** group_id is the unique ID of the group. */ + groupId: Long; + /** address is the account address of the group member. */ + address: string; +} +export interface EventLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventLeaveGroup"; + value: Uint8Array; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupAmino { + /** group_id is the unique ID of the group. */ + group_id: string; + /** address is the account address of the group member. */ + address: string; +} +export interface EventLeaveGroupAminoMsg { + type: "cosmos-sdk/EventLeaveGroup"; + value: EventLeaveGroupAmino; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupSDKType { + group_id: Long; + address: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/genesis.ts new file mode 100644 index 000000000..bc20a71ea --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/genesis.ts @@ -0,0 +1,77 @@ +import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType } from "./types"; +import { Long } from "../../../helpers"; +/** GenesisState defines the group module's genesis state. */ +export interface GenesisState { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + groupSeq: Long; + /** groups is the list of groups info. */ + groups: GroupInfo[]; + /** group_members is the list of groups members. */ + groupMembers: GroupMember[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + groupPolicySeq: Long; + /** group_policies is the list of group policies info. */ + groupPolicies: GroupPolicyInfo[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposalSeq: Long; + /** proposals is the list of proposals. */ + proposals: Proposal[]; + /** votes is the list of votes. */ + votes: Vote[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.group.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateAmino { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + group_seq: string; + /** groups is the list of groups info. */ + groups: GroupInfoAmino[]; + /** group_members is the list of groups members. */ + group_members: GroupMemberAmino[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + group_policy_seq: string; + /** group_policies is the list of group policies info. */ + group_policies: GroupPolicyInfoAmino[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposal_seq: string; + /** proposals is the list of proposals. */ + proposals: ProposalAmino[]; + /** votes is the list of votes. */ + votes: VoteAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateSDKType { + group_seq: Long; + groups: GroupInfoSDKType[]; + group_members: GroupMemberSDKType[]; + group_policy_seq: Long; + group_policies: GroupPolicyInfoSDKType[]; + proposal_seq: Long; + proposals: ProposalSDKType[]; + votes: VoteSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/tx.ts new file mode 100644 index 000000000..2488cb274 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/tx.ts @@ -0,0 +1,778 @@ +import { Member, MemberAmino, MemberSDKType, VoteOption } from "./types"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** Exec defines modes of execution of a proposal on creation or on new vote. */ +export enum Exec { + /** + * EXEC_UNSPECIFIED - An empty value means that there should be a separate + * MsgExec request for the proposal to execute. + */ + EXEC_UNSPECIFIED = 0, + /** + * EXEC_TRY - Try to execute the proposal immediately. + * If the proposal is not allowed per the DecisionPolicy, + * the proposal will still be open and could + * be executed at a later point. + */ + EXEC_TRY = 1, + UNRECOGNIZED = -1, +} +export const ExecSDKType = Exec; +export const ExecAmino = Exec; +export function execFromJSON(object: any): Exec { + switch (object) { + case 0: + case "EXEC_UNSPECIFIED": + return Exec.EXEC_UNSPECIFIED; + case 1: + case "EXEC_TRY": + return Exec.EXEC_TRY; + case -1: + case "UNRECOGNIZED": + default: + return Exec.UNRECOGNIZED; + } +} +export function execToJSON(object: Exec): string { + switch (object) { + case Exec.EXEC_UNSPECIFIED: + return "EXEC_UNSPECIFIED"; + case Exec.EXEC_TRY: + return "EXEC_TRY"; + case Exec.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroup { + /** admin is the account address of the group admin. */ + admin: string; + /** members defines the group members. */ + members: Member[]; + /** 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: MemberAmino[]; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata: string; +} +export interface MsgCreateGroupAminoMsg { + type: "cosmos-sdk/MsgCreateGroup"; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroupSDKType { + admin: string; + members: MemberSDKType[]; + metadata: string; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponse { + /** group_id is the unique ID of the newly created group. */ + groupId: Long; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; + value: Uint8Array; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseAmino { + /** group_id is the unique ID of the newly created group. */ + group_id: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupResponse"; + value: MsgCreateGroupResponseAmino; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseSDKType { + group_id: Long; +} +/** 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: Long; + /** + * member_updates is the list of members to update, + * set weight to 0 to remove a member. + */ + memberUpdates: Member[]; +} +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: MemberAmino[]; +} +export interface MsgUpdateGroupMembersAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembers"; + value: MsgUpdateGroupMembersAmino; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembersSDKType { + admin: string; + group_id: Long; + member_updates: MemberSDKType[]; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponse {} +export interface MsgUpdateGroupMembersResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseAmino {} +export interface MsgUpdateGroupMembersResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembersResponse"; + value: MsgUpdateGroupMembersResponseAmino; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseSDKType {} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdmin { + /** admin is the current account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: Long; + /** new_admin is the group new admin account address. */ + newAdmin: string; +} +export interface MsgUpdateGroupAdminProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin"; + value: Uint8Array; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminAmino { + /** admin is the current account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + group_id: string; + /** new_admin is the group new admin account address. */ + new_admin: string; +} +export interface MsgUpdateGroupAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdmin"; + value: MsgUpdateGroupAdminAmino; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminSDKType { + admin: string; + group_id: Long; + new_admin: string; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponse {} +export interface MsgUpdateGroupAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseAmino {} +export interface MsgUpdateGroupAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdminResponse"; + value: MsgUpdateGroupAdminResponseAmino; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseSDKType {} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: Long; + /** metadata is the updated group's metadata. */ + metadata: string; +} +export interface MsgUpdateGroupMetadataProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataAmino { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + group_id: string; + /** metadata is the updated group's metadata. */ + metadata: string; +} +export interface MsgUpdateGroupMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadata"; + value: MsgUpdateGroupMetadataAmino; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataSDKType { + admin: string; + group_id: Long; + metadata: string; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponse {} +export interface MsgUpdateGroupMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseAmino {} +export interface MsgUpdateGroupMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadataResponse"; + value: MsgUpdateGroupMetadataResponseAmino; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseSDKType {} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: Long; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata: string; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy: Any; +} +export interface MsgCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; + value: Uint8Array; +} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicyAmino { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + group_id: string; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata: string; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicy"; + value: MsgCreateGroupPolicyAmino; +} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicySDKType { + admin: string; + group_id: Long; + metadata: string; + decision_policy: AnySDKType; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponse { + /** address is the account address of the newly created group policy. */ + address: string; +} +export interface MsgCreateGroupPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseAmino { + /** address is the account address of the newly created group policy. */ + address: string; +} +export interface MsgCreateGroupPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicyResponse"; + value: MsgCreateGroupPolicyResponseAmino; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseSDKType { + address: string; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdmin { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of the group policy. */ + address: 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; + /** address is the account address of the group policy. */ + address: string; + /** new_admin is the new group policy admin. */ + new_admin: string; +} +export interface MsgUpdateGroupPolicyAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + value: MsgUpdateGroupPolicyAdminAmino; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdminSDKType { + admin: string; + address: string; + new_admin: string; +} +/** 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: Member[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + groupMetadata: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + groupPolicyMetadata: string; + /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ + groupPolicyAsAdmin: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy: Any; +} +export interface MsgCreateGroupWithPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; + value: Uint8Array; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicyAmino { + /** admin is the account address of the group and group policy admin. */ + admin: string; + /** members defines the group members. */ + members: MemberAmino[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + group_metadata: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + group_policy_metadata: string; + /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ + group_policy_as_admin: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupWithPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicy"; + value: MsgCreateGroupWithPolicyAmino; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicySDKType { + admin: string; + members: MemberSDKType[]; + group_metadata: string; + group_policy_metadata: string; + group_policy_as_admin: boolean; + decision_policy: AnySDKType; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponse { + /** group_id is the unique ID of the newly created group with policy. */ + groupId: Long; + /** group_policy_address is the account address of the newly created group policy. */ + groupPolicyAddress: string; +} +export interface MsgCreateGroupWithPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseAmino { + /** group_id is the unique ID of the newly created group with policy. */ + group_id: string; + /** group_policy_address is the account address of the newly created group policy. */ + group_policy_address: string; +} +export interface MsgCreateGroupWithPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicyResponse"; + value: MsgCreateGroupWithPolicyResponseAmino; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseSDKType { + group_id: Long; + group_policy_address: string; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponse {} +export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseAmino {} +export interface MsgUpdateGroupPolicyAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse"; + value: MsgUpdateGroupPolicyAdminResponseAmino; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseSDKType {} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of group policy. */ + address: string; + /** decision_policy is the updated group policy's decision policy. */ + decisionPolicy: Any; +} +export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyAmino { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of group policy. */ + address: string; + /** decision_policy is the updated group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy"; + value: MsgUpdateGroupPolicyDecisionPolicyAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicySDKType { + admin: string; + address: string; + decision_policy: AnySDKType; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAmino {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: MsgUpdateGroupPolicyDecisionPolicyResponseAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseSDKType {} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of group policy. */ + address: string; + /** metadata is the updated group policy metadata. */ + 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; + /** address is the account address of group policy. */ + address: string; + /** metadata is the updated group policy metadata. */ + metadata: string; +} +export interface MsgUpdateGroupPolicyMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + value: MsgUpdateGroupPolicyMetadataAmino; +} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadataSDKType { + admin: string; + address: string; + metadata: string; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponse {} +export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseAmino {} +export interface MsgUpdateGroupPolicyMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse"; + value: MsgUpdateGroupPolicyMetadataResponseAmino; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseSDKType {} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposal { + /** address is the account address of 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 to 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; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal"; + value: Uint8Array; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalAmino { + /** address is the account address of 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 to 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; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/group/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalSDKType { + address: string; + proposers: string[]; + metadata: string; + messages: AnySDKType[]; + exec: Exec; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal is the unique ID of the proposal. */ + proposalId: Long; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: Long; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposal { + /** proposal is the unique ID of the proposal. */ + proposalId: Long; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address: string; +} +export interface MsgWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal"; + value: Uint8Array; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id: string; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address: string; +} +export interface MsgWithdrawProposalAminoMsg { + type: "cosmos-sdk/group/MsgWithdrawProposal"; + value: MsgWithdrawProposalAmino; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalSDKType { + proposal_id: Long; + address: string; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponse {} +export interface MsgWithdrawProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse"; + value: Uint8Array; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseAmino {} +export interface MsgWithdrawProposalResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawProposalResponse"; + value: MsgWithdrawProposalResponseAmino; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseSDKType {} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVote { + /** proposal is the unique ID of the proposal. */ + proposalId: Long; + /** voter is the voter account address. */ + voter: string; + /** option is the voter's choice on the proposal. */ + option: VoteOption; + /** metadata is any arbitrary metadata to 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 to attached to the vote. */ + metadata: string; + /** + * exec defines whether the proposal should be executed + * immediately after voting or not. + */ + exec: Exec; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/group/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVoteSDKType { + proposal_id: Long; + voter: string; + option: VoteOption; + metadata: string; + exec: Exec; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExec { + /** proposal is the unique ID of the proposal. */ + proposalId: Long; + /** signer is the account address used to execute the proposal. */ + signer: 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; + /** signer is the account address used to execute the proposal. */ + signer: string; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/group/MsgExec"; + value: MsgExecAmino; +} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExecSDKType { + proposal_id: Long; + signer: string; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponse {} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseAmino {} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseSDKType {} +/** 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: Long; +} +export interface MsgLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup"; + value: Uint8Array; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupAmino { + /** address is the account address of the group member. */ + address: string; + /** group_id is the unique ID of the group. */ + group_id: string; +} +export interface MsgLeaveGroupAminoMsg { + type: "cosmos-sdk/group/MsgLeaveGroup"; + value: MsgLeaveGroupAmino; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupSDKType { + address: string; + group_id: Long; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponse {} +export interface MsgLeaveGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse"; + value: Uint8Array; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseAmino {} +export interface MsgLeaveGroupResponseAminoMsg { + type: "cosmos-sdk/MsgLeaveGroupResponse"; + value: MsgLeaveGroupResponseAmino; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/types.ts new file mode 100644 index 000000000..ecfb5739f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/group/v1/types.ts @@ -0,0 +1,753 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus 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 persisted. */ + PROPOSAL_STATUS_SUBMITTED = 1, + /** PROPOSAL_STATUS_CLOSED - Final status of a proposal when the final tally was executed. */ + PROPOSAL_STATUS_CLOSED = 2, + /** PROPOSAL_STATUS_ABORTED - Final status of a proposal when the group was modified before the final tally. */ + PROPOSAL_STATUS_ABORTED = 3, + /** + * PROPOSAL_STATUS_WITHDRAWN - A proposal can be deleted before the voting start time by the owner. When this happens the final status + * is Withdrawn. + */ + PROPOSAL_STATUS_WITHDRAWN = 4, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_SUBMITTED": + return ProposalStatus.PROPOSAL_STATUS_SUBMITTED; + case 2: + case "PROPOSAL_STATUS_CLOSED": + return ProposalStatus.PROPOSAL_STATUS_CLOSED; + case 3: + case "PROPOSAL_STATUS_ABORTED": + return ProposalStatus.PROPOSAL_STATUS_ABORTED; + case 4: + 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_CLOSED: + return "PROPOSAL_STATUS_CLOSED"; + case ProposalStatus.PROPOSAL_STATUS_ABORTED: + return "PROPOSAL_STATUS_ABORTED"; + case ProposalStatus.PROPOSAL_STATUS_WITHDRAWN: + return "PROPOSAL_STATUS_WITHDRAWN"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalResult defines types of proposal results. */ +export enum ProposalResult { + /** PROPOSAL_RESULT_UNSPECIFIED - An empty value is invalid and not allowed */ + PROPOSAL_RESULT_UNSPECIFIED = 0, + /** PROPOSAL_RESULT_UNFINALIZED - Until a final tally has happened the status is unfinalized */ + PROPOSAL_RESULT_UNFINALIZED = 1, + /** PROPOSAL_RESULT_ACCEPTED - Final result of the tally */ + PROPOSAL_RESULT_ACCEPTED = 2, + /** PROPOSAL_RESULT_REJECTED - Final result of the tally */ + PROPOSAL_RESULT_REJECTED = 3, + UNRECOGNIZED = -1, +} +export const ProposalResultSDKType = ProposalResult; +export const ProposalResultAmino = ProposalResult; +export function proposalResultFromJSON(object: any): ProposalResult { + switch (object) { + case 0: + case "PROPOSAL_RESULT_UNSPECIFIED": + return ProposalResult.PROPOSAL_RESULT_UNSPECIFIED; + case 1: + case "PROPOSAL_RESULT_UNFINALIZED": + return ProposalResult.PROPOSAL_RESULT_UNFINALIZED; + case 2: + case "PROPOSAL_RESULT_ACCEPTED": + return ProposalResult.PROPOSAL_RESULT_ACCEPTED; + case 3: + case "PROPOSAL_RESULT_REJECTED": + return ProposalResult.PROPOSAL_RESULT_REJECTED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalResult.UNRECOGNIZED; + } +} +export function proposalResultToJSON(object: ProposalResult): string { + switch (object) { + case ProposalResult.PROPOSAL_RESULT_UNSPECIFIED: + return "PROPOSAL_RESULT_UNSPECIFIED"; + case ProposalResult.PROPOSAL_RESULT_UNFINALIZED: + return "PROPOSAL_RESULT_UNFINALIZED"; + case ProposalResult.PROPOSAL_RESULT_ACCEPTED: + return "PROPOSAL_RESULT_ACCEPTED"; + case ProposalResult.PROPOSAL_RESULT_REJECTED: + return "PROPOSAL_RESULT_REJECTED"; + case ProposalResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalExecutorResult defines types of proposal executor results. */ +export enum ProposalExecutorResult { + /** PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED - An empty value is not allowed. */ + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0, + /** PROPOSAL_EXECUTOR_RESULT_NOT_RUN - We have not yet run the executor. */ + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1, + /** PROPOSAL_EXECUTOR_RESULT_SUCCESS - The executor was successful and proposed action updated state. */ + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2, + /** PROPOSAL_EXECUTOR_RESULT_FAILURE - The executor returned an error and proposed action didn't update state. */ + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3, + UNRECOGNIZED = -1, +} +export const ProposalExecutorResultSDKType = ProposalExecutorResult; +export const ProposalExecutorResultAmino = ProposalExecutorResult; +export function proposalExecutorResultFromJSON(object: any): ProposalExecutorResult { + switch (object) { + case 0: + case "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED; + case 1: + case "PROPOSAL_EXECUTOR_RESULT_NOT_RUN": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN; + case 2: + case "PROPOSAL_EXECUTOR_RESULT_SUCCESS": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS; + case 3: + case "PROPOSAL_EXECUTOR_RESULT_FAILURE": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE; + case -1: + case "UNRECOGNIZED": + default: + return ProposalExecutorResult.UNRECOGNIZED; + } +} +export function proposalExecutorResultToJSON(object: ProposalExecutorResult): string { + switch (object) { + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED: + return "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN: + return "PROPOSAL_EXECUTOR_RESULT_NOT_RUN"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS: + return "PROPOSAL_EXECUTOR_RESULT_SUCCESS"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE: + return "PROPOSAL_EXECUTOR_RESULT_FAILURE"; + case ProposalExecutorResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Member represents a group member with an account address, + * non-zero weight and metadata. + */ +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 to 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 and metadata. + */ +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 to attached to the member. */ + metadata: string; + /** added_at is a timestamp specifying when a member was added. */ + added_at?: Date; +} +export interface MemberAminoMsg { + type: "cosmos-sdk/Member"; + value: MemberAmino; +} +/** + * Member represents a group member with an account address, + * non-zero weight and metadata. + */ +export interface MemberSDKType { + address: string; + weight: string; + metadata: string; + added_at: Date; +} +/** Members defines a repeated slice of Member objects. */ +export interface Members { + /** members is the list of members. */ + members: Member[]; +} +export interface MembersProtoMsg { + typeUrl: "/cosmos.group.v1.Members"; + value: Uint8Array; +} +/** Members defines a repeated slice of Member objects. */ +export interface MembersAmino { + /** members is the list of members. */ + members: MemberAmino[]; +} +export interface MembersAminoMsg { + type: "cosmos-sdk/Members"; + value: MembersAmino; +} +/** Members defines a repeated slice of Member objects. */ +export interface MembersSDKType { + members: MemberSDKType[]; +} +/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +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 implements the DecisionPolicy interface */ +export interface ThresholdDecisionPolicyAmino { + /** threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. */ + threshold: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface ThresholdDecisionPolicyAminoMsg { + type: "cosmos-sdk/ThresholdDecisionPolicy"; + value: ThresholdDecisionPolicyAmino; +} +/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +export interface ThresholdDecisionPolicySDKType { + threshold: string; + windows: DecisionPolicyWindowsSDKType; +} +/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicy { + /** percentage is the minimum percentage 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 implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicyAmino { + /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ + percentage: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface PercentageDecisionPolicyAminoMsg { + type: "cosmos-sdk/PercentageDecisionPolicy"; + value: PercentageDecisionPolicyAmino; +} +/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicySDKType { + percentage: string; + windows: DecisionPolicyWindowsSDKType; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindows { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + votingPeriod: Duration; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + minExecutionPeriod: Duration; +} +export interface DecisionPolicyWindowsProtoMsg { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows"; + value: Uint8Array; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsAmino { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + voting_period?: DurationAmino; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + min_execution_period?: DurationAmino; +} +export interface DecisionPolicyWindowsAminoMsg { + type: "cosmos-sdk/DecisionPolicyWindows"; + value: DecisionPolicyWindowsAmino; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsSDKType { + voting_period: DurationSDKType; + min_execution_period: DurationSDKType; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfo { + /** id is the unique ID of the group. */ + id: Long; + /** admin is the account address of the group's admin. */ + admin: string; + /** metadata is any arbitrary metadata to attached to the group. */ + 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: Long; + /** 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. */ + 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?: Date; +} +export interface GroupInfoAminoMsg { + type: "cosmos-sdk/GroupInfo"; + value: GroupInfoAmino; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfoSDKType { + id: Long; + admin: string; + metadata: string; + version: Long; + total_weight: string; + created_at: Date; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMember { + /** group_id is the unique ID of the group. */ + groupId: Long; + /** member is the member data. */ + member: Member; +} +export interface GroupMemberProtoMsg { + typeUrl: "/cosmos.group.v1.GroupMember"; + value: Uint8Array; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberAmino { + /** group_id is the unique ID of the group. */ + group_id: string; + /** member is the member data. */ + member?: MemberAmino; +} +export interface GroupMemberAminoMsg { + type: "cosmos-sdk/GroupMember"; + value: GroupMemberAmino; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberSDKType { + group_id: Long; + member: MemberSDKType; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfo { + /** address is the account address of group policy. */ + address: string; + /** group_id is the unique ID of the group. */ + groupId: Long; + /** admin is the account address of the group admin. */ + admin: string; + /** metadata is any arbitrary metadata to attached to the group policy. */ + 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: Long; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy: Any; + /** created_at is a timestamp specifying when a group policy was created. */ + createdAt: Date; +} +export interface GroupPolicyInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; + value: Uint8Array; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoAmino { + /** address is the account address of group policy. */ + address: string; + /** group_id is the unique ID of the group. */ + group_id: string; + /** admin is the account address of the group admin. */ + admin: string; + /** metadata is any arbitrary metadata to attached to the group policy. */ + 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?: Date; +} +export interface GroupPolicyInfoAminoMsg { + type: "cosmos-sdk/GroupPolicyInfo"; + value: GroupPolicyInfoAmino; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoSDKType { + address: string; + group_id: Long; + admin: string; + metadata: string; + version: Long; + decision_policy: AnySDKType; + created_at: Date; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface Proposal { + /** id is the unique id of the proposal. */ + id: Long; + /** address is the account address of group policy. */ + address: string; + /** metadata is any arbitrary metadata to attached to the proposal. */ + 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 that this proposal corresponds to. + * When group membership is changed, existing proposals from previous group versions will become invalid. + */ + groupVersion: Long; + /** + * group_policy_version tracks the version of the group policy that this proposal corresponds to. + * When a decision policy is changed, existing proposals from previous policy versions will become invalid. + */ + groupPolicyVersion: Long; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status: ProposalStatus; + /** + * result is the final result based on the votes and election rule. Initial value is unfinalized. + * The result is persisted so that clients can always rely on this state and not have to replicate the logic. + */ + result: ProposalResult; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option, after tallying. When querying a proposal + * via gRPC, this field is not populated until the proposal's voting period + * has ended. + */ + finalTallyResult: TallyResult; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successfull 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`, as well + * as `status` and `result` fields will be accordingly updated. + */ + votingPeriodEnd: Date; + /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ + executorResult: ProposalExecutorResult; + /** messages is a list of Msgs that will be executed if the proposal passes. */ + messages: Any[]; +} +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; + /** address is the account address of group policy. */ + address: string; + /** metadata is any arbitrary metadata to attached to the proposal. */ + 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?: Date; + /** + * group_version tracks the version of the group that this proposal corresponds to. + * When group membership is changed, existing proposals from previous group versions will become invalid. + */ + group_version: string; + /** + * group_policy_version tracks the version of the group policy that this proposal corresponds to. + * When a decision policy is changed, existing proposals from previous policy versions will become invalid. + */ + group_policy_version: string; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status: ProposalStatus; + /** + * result is the final result based on the votes and election rule. Initial value is unfinalized. + * The result is persisted so that clients can always rely on this state and not have to replicate the logic. + */ + result: ProposalResult; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option, after tallying. When querying a proposal + * via gRPC, this field is not populated until the proposal's voting period + * has ended. + */ + final_tally_result?: TallyResultAmino; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successfull 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`, as well + * as `status` and `result` fields will be accordingly updated. + */ + voting_period_end?: Date; + /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ + executor_result: ProposalExecutorResult; + /** messages is a list of Msgs that will be executed if the proposal passes. */ + messages: AnyAmino[]; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/Proposal"; + value: ProposalAmino; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface ProposalSDKType { + id: Long; + address: string; + metadata: string; + proposers: string[]; + submit_time: Date; + group_version: Long; + group_policy_version: Long; + status: ProposalStatus; + result: ProposalResult; + final_tally_result: TallyResultSDKType; + voting_period_end: Date; + executor_result: ProposalExecutorResult; + messages: AnySDKType[]; +} +/** 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 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 is the weighted sum of no votes. */ + no_count: string; + /** no_with_veto_count is the weighted sum of veto. */ + no_with_veto_count: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** Vote represents a vote for a proposal. */ +export interface Vote { + /** proposal is the unique ID of the proposal. */ + proposalId: Long; + /** 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 to attached to the vote. */ + 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. */ +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 to attached to the vote. */ + metadata: string; + /** submit_time is the timestamp when the vote was submitted. */ + submit_time?: Date; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** Vote represents a vote for a proposal. */ +export interface VoteSDKType { + proposal_id: Long; + voter: string; + option: VoteOption; + metadata: string; + submit_time: Date; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/genesis.ts new file mode 100644 index 000000000..7598f5c05 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/genesis.ts @@ -0,0 +1,28 @@ +import { Minter, MinterAmino, MinterSDKType, Params, ParamsAmino, ParamsSDKType } from "./mint"; +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisState { + /** minter is a space for holding current inflation information. */ + minter: Minter; + /** params defines all the paramaters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateAmino { + /** minter is a space for holding current inflation information. */ + minter?: MinterAmino; + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateSDKType { + minter: MinterSDKType; + params: ParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/mint.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/mint.ts new file mode 100644 index 000000000..af52eb48a --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/mint/v1beta1/mint.ts @@ -0,0 +1,75 @@ +import { Long } from "../../../helpers"; +/** Minter represents the minting state. */ +export interface Minter { + /** current annual inflation rate */ + inflation: string; + /** current annual expected provisions */ + annualProvisions: string; +} +export interface MinterProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.Minter"; + value: Uint8Array; +} +/** Minter represents the minting state. */ +export interface MinterAmino { + /** current annual inflation rate */ + inflation: string; + /** current annual expected provisions */ + annual_provisions: string; +} +export interface MinterAminoMsg { + type: "cosmos-sdk/Minter"; + value: MinterAmino; +} +/** Minter represents the minting state. */ +export interface MinterSDKType { + inflation: string; + annual_provisions: string; +} +/** Params holds parameters for the mint module. */ +export interface Params { + /** type of coin to mint */ + mintDenom: string; + /** maximum annual change in inflation rate */ + inflationRateChange: string; + /** maximum inflation rate */ + inflationMax: string; + /** minimum inflation rate */ + inflationMin: string; + /** goal of percent bonded atoms */ + goalBonded: string; + /** expected blocks per year */ + blocksPerYear: Long; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the mint module. */ +export interface ParamsAmino { + /** type of coin to mint */ + mint_denom: string; + /** maximum annual change in inflation rate */ + inflation_rate_change: string; + /** maximum inflation rate */ + inflation_max: string; + /** minimum inflation rate */ + inflation_min: string; + /** goal of percent bonded atoms */ + goal_bonded: string; + /** expected blocks per year */ + blocks_per_year: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params holds parameters for the mint module. */ +export interface ParamsSDKType { + mint_denom: string; + inflation_rate_change: string; + inflation_max: string; + inflation_min: string; + goal_bonded: string; + blocks_per_year: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/msg/v1/msg.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/msg/v1/msg.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/event.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/event.ts new file mode 100644 index 000000000..7fca07ebf --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/event.ts @@ -0,0 +1,81 @@ +/** EventSend is emitted on Msg/Send */ +export interface EventSend { + classId: string; + id: string; + sender: string; + receiver: string; +} +export interface EventSendProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventSend"; + value: Uint8Array; +} +/** EventSend is emitted on Msg/Send */ +export interface EventSendAmino { + class_id: string; + id: string; + sender: string; + receiver: string; +} +export interface EventSendAminoMsg { + type: "cosmos-sdk/EventSend"; + value: EventSendAmino; +} +/** EventSend is emitted on Msg/Send */ +export interface EventSendSDKType { + class_id: string; + id: string; + sender: string; + receiver: string; +} +/** EventMint is emitted on Mint */ +export interface EventMint { + classId: string; + id: string; + owner: string; +} +export interface EventMintProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventMint"; + value: Uint8Array; +} +/** EventMint is emitted on Mint */ +export interface EventMintAmino { + class_id: string; + id: string; + owner: string; +} +export interface EventMintAminoMsg { + type: "cosmos-sdk/EventMint"; + value: EventMintAmino; +} +/** EventMint is emitted on Mint */ +export interface EventMintSDKType { + class_id: string; + id: string; + owner: string; +} +/** EventBurn is emitted on Burn */ +export interface EventBurn { + classId: string; + id: string; + owner: string; +} +export interface EventBurnProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventBurn"; + value: Uint8Array; +} +/** EventBurn is emitted on Burn */ +export interface EventBurnAmino { + class_id: string; + id: string; + owner: string; +} +export interface EventBurnAminoMsg { + type: "cosmos-sdk/EventBurn"; + value: EventBurnAmino; +} +/** EventBurn is emitted on Burn */ +export interface EventBurnSDKType { + class_id: string; + id: string; + owner: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/genesis.ts new file mode 100644 index 000000000..bf916000f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/genesis.ts @@ -0,0 +1,53 @@ +import { Class, ClassAmino, ClassSDKType, NFT, NFTAmino, NFTSDKType } from "./nft"; +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisState { + /** class defines the class of the nft type. */ + classes: Class[]; + entries: Entry[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateAmino { + /** class defines the class of the nft type. */ + classes: ClassAmino[]; + entries: EntryAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateSDKType { + classes: ClassSDKType[]; + entries: EntrySDKType[]; +} +/** Entry Defines all nft owned by a person */ +export interface Entry { + /** owner is the owner address of the following nft */ + owner: string; + /** nfts is a group of nfts of the same owner */ + nfts: NFT[]; +} +export interface EntryProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.Entry"; + value: Uint8Array; +} +/** Entry Defines all nft owned by a person */ +export interface EntryAmino { + /** owner is the owner address of the following nft */ + owner: string; + /** nfts is a group of nfts of the same owner */ + nfts: NFTAmino[]; +} +export interface EntryAminoMsg { + type: "cosmos-sdk/Entry"; + value: EntryAmino; +} +/** Entry Defines all nft owned by a person */ +export interface EntrySDKType { + owner: string; + nfts: NFTSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/nft.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/nft.ts new file mode 100644 index 000000000..0fefd439d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/nft.ts @@ -0,0 +1,95 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +/** Class defines the class of the nft type. */ +export interface Class { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id: string; + /** name defines the human-readable name of the NFT classification. Optional */ + name: string; + /** symbol is an abbreviated name for nft classification. Optional */ + symbol: string; + /** description is a brief description of nft classification. Optional */ + description: string; + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri: string; + /** uri_hash is a hash of the document pointed by uri. Optional */ + uriHash: string; + /** data is the app specific metadata of the NFT class. Optional */ + data: Any; +} +export interface ClassProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.Class"; + value: Uint8Array; +} +/** Class defines the class of the nft type. */ +export interface ClassAmino { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id: string; + /** name defines the human-readable name of the NFT classification. Optional */ + name: string; + /** symbol is an abbreviated name for nft classification. Optional */ + symbol: string; + /** description is a brief description of nft classification. Optional */ + description: string; + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri: string; + /** uri_hash is a hash of the document pointed by uri. Optional */ + uri_hash: string; + /** data is the app specific metadata of the NFT class. Optional */ + data?: AnyAmino; +} +export interface ClassAminoMsg { + type: "cosmos-sdk/Class"; + value: ClassAmino; +} +/** Class defines the class of the nft type. */ +export interface ClassSDKType { + id: string; + name: string; + symbol: string; + description: string; + uri: string; + uri_hash: string; + data: AnySDKType; +} +/** NFT defines the NFT. */ +export interface NFT { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; + /** uri for the NFT metadata stored off chain */ + uri: string; + /** uri_hash is a hash of the document pointed by uri */ + uriHash: string; + /** data is an app specific data of the NFT. Optional */ + data: Any; +} +export interface NFTProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.NFT"; + value: Uint8Array; +} +/** NFT defines the NFT. */ +export interface NFTAmino { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + class_id: string; + /** id is a unique identifier of the NFT */ + id: string; + /** uri for the NFT metadata stored off chain */ + uri: string; + /** uri_hash is a hash of the document pointed by uri */ + uri_hash: string; + /** data is an app specific data of the NFT. Optional */ + data?: AnyAmino; +} +export interface NFTAminoMsg { + type: "cosmos-sdk/NFT"; + value: NFTAmino; +} +/** NFT defines the NFT. */ +export interface NFTSDKType { + class_id: string; + id: string; + uri: string; + uri_hash: string; + data: AnySDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/tx.ts new file mode 100644 index 000000000..74043fa8d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/nft/v1beta1/tx.ts @@ -0,0 +1,51 @@ +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSend { + /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ + classId: string; + /** id defines the unique identification of nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} +export interface MsgSendProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.MsgSend"; + value: Uint8Array; +} +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSendAmino { + /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ + class_id: string; + /** id defines the unique identification of nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} +export interface MsgSendAminoMsg { + type: "cosmos-sdk/MsgNFTSend"; + value: MsgSendAmino; +} +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSendSDKType { + class_id: string; + id: string; + sender: string; + receiver: string; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse"; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: "cosmos-sdk/MsgSendResponse"; + value: MsgSendResponseAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1/orm.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1/orm.ts new file mode 100644 index 000000000..a624db678 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1/orm.ts @@ -0,0 +1,227 @@ +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptor { + /** primary_key defines the primary key for the table. */ + primaryKey: PrimaryKeyDescriptor; + /** index defines one or more secondary indexes. */ + index: SecondaryIndexDescriptor[]; + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface TableDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.TableDescriptor"; + value: Uint8Array; +} +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptorAmino { + /** primary_key defines the primary key for the table. */ + primary_key?: PrimaryKeyDescriptorAmino; + /** index defines one or more secondary indexes. */ + index: SecondaryIndexDescriptorAmino[]; + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface TableDescriptorAminoMsg { + type: "cosmos-sdk/TableDescriptor"; + value: TableDescriptorAmino; +} +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptorSDKType { + primary_key: PrimaryKeyDescriptorSDKType; + index: SecondaryIndexDescriptorSDKType[]; + id: number; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptor { + /** + * fields is a comma-separated list of fields in the primary key. Spaces are + * not allowed. Supported field types, their encodings, and any applicable constraints + * are described below. + * - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers. + * - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers such as auto-incrementing sequences. + * - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + * sorted iteration. These types are well-suited for encoding fixed with + * decimals as integers. + * - string's are encoded as raw bytes in terminal key segments and null-terminated + * in non-terminal segments. Null characters are thus forbidden in strings. + * string fields support sorted iteration. + * - bytes are encoded as raw bytes in terminal segments and length-prefixed + * with a 32-bit unsigned varint in non-terminal segments. + * - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + * an encoding that enables sorted iteration. + * - google.protobuf.Timestamp and google.protobuf.Duration are encoded + * as 12 bytes using an encoding that enables sorted iteration. + * - enum fields are encoded using varint encoding and do not support sorted + * iteration. + * - bool fields are encoded as a single byte 0 or 1. + * + * All other fields types are unsupported in keys including repeated and + * oneof fields. + * + * Primary keys are prefixed by the varint encoded table id and the byte 0x0 + * plus any additional prefix specified by the schema. + */ + fields: string; + /** + * auto_increment specifies that the primary key is generated by an + * auto-incrementing integer. If this is set to true fields must only + * contain one field of that is of type uint64. + */ + autoIncrement: boolean; +} +export interface PrimaryKeyDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor"; + value: Uint8Array; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptorAmino { + /** + * fields is a comma-separated list of fields in the primary key. Spaces are + * not allowed. Supported field types, their encodings, and any applicable constraints + * are described below. + * - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers. + * - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers such as auto-incrementing sequences. + * - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + * sorted iteration. These types are well-suited for encoding fixed with + * decimals as integers. + * - string's are encoded as raw bytes in terminal key segments and null-terminated + * in non-terminal segments. Null characters are thus forbidden in strings. + * string fields support sorted iteration. + * - bytes are encoded as raw bytes in terminal segments and length-prefixed + * with a 32-bit unsigned varint in non-terminal segments. + * - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + * an encoding that enables sorted iteration. + * - google.protobuf.Timestamp and google.protobuf.Duration are encoded + * as 12 bytes using an encoding that enables sorted iteration. + * - enum fields are encoded using varint encoding and do not support sorted + * iteration. + * - bool fields are encoded as a single byte 0 or 1. + * + * All other fields types are unsupported in keys including repeated and + * oneof fields. + * + * Primary keys are prefixed by the varint encoded table id and the byte 0x0 + * plus any additional prefix specified by the schema. + */ + fields: string; + /** + * auto_increment specifies that the primary key is generated by an + * auto-incrementing integer. If this is set to true fields must only + * contain one field of that is of type uint64. + */ + auto_increment: boolean; +} +export interface PrimaryKeyDescriptorAminoMsg { + type: "cosmos-sdk/PrimaryKeyDescriptor"; + value: PrimaryKeyDescriptorAmino; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptorSDKType { + fields: string; + auto_increment: boolean; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptor { + /** + * fields is a comma-separated list of fields in the index. The supported + * field types are the same as those for PrimaryKeyDescriptor.fields. + * Index keys are prefixed by the varint encoded table id and the varint + * encoded index id plus any additional prefix specified by the schema. + * + * In addition the the field segments, non-unique index keys are suffixed with + * any additional primary key fields not present in the index fields so that the + * primary key can be reconstructed. Unique indexes instead of being suffixed + * store the remaining primary key fields in the value.. + */ + fields: string; + /** + * id is a non-zero integer ID that must be unique within the indexes for this + * table and less than 32768. It may be deprecated in the future when this can + * be auto-generated. + */ + id: number; + /** unique specifies that this an unique index. */ + unique: boolean; +} +export interface SecondaryIndexDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor"; + value: Uint8Array; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptorAmino { + /** + * fields is a comma-separated list of fields in the index. The supported + * field types are the same as those for PrimaryKeyDescriptor.fields. + * Index keys are prefixed by the varint encoded table id and the varint + * encoded index id plus any additional prefix specified by the schema. + * + * In addition the the field segments, non-unique index keys are suffixed with + * any additional primary key fields not present in the index fields so that the + * primary key can be reconstructed. Unique indexes instead of being suffixed + * store the remaining primary key fields in the value.. + */ + fields: string; + /** + * id is a non-zero integer ID that must be unique within the indexes for this + * table and less than 32768. It may be deprecated in the future when this can + * be auto-generated. + */ + id: number; + /** unique specifies that this an unique index. */ + unique: boolean; +} +export interface SecondaryIndexDescriptorAminoMsg { + type: "cosmos-sdk/SecondaryIndexDescriptor"; + value: SecondaryIndexDescriptorAmino; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptorSDKType { + fields: string; + id: number; + unique: boolean; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptor { + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface SingletonDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.SingletonDescriptor"; + value: Uint8Array; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptorAmino { + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface SingletonDescriptorAminoMsg { + type: "cosmos-sdk/SingletonDescriptor"; + value: SingletonDescriptorAmino; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptorSDKType { + id: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1alpha1/schema.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1alpha1/schema.ts new file mode 100644 index 000000000..de658d7b1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/orm/v1alpha1/schema.ts @@ -0,0 +1,170 @@ +/** StorageType */ +export enum StorageType { + /** + * STORAGE_TYPE_DEFAULT_UNSPECIFIED - STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + * KV-storage where primary key entries are stored in merkle-tree + * backed commitment storage and indexes and seqs are stored in + * fast index storage. Note that the Cosmos SDK before store/v2alpha1 + * does not support this. + */ + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0, + /** + * STORAGE_TYPE_MEMORY - STORAGE_TYPE_MEMORY indicates in-memory storage that will be + * reloaded every time an app restarts. Tables with this type of storage + * will by default be ignored when importing and exporting a module's + * state from JSON. + */ + STORAGE_TYPE_MEMORY = 1, + /** + * STORAGE_TYPE_TRANSIENT - STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + * at the end of every block. Tables with this type of storage + * will by default be ignored when importing and exporting a module's + * state from JSON. + */ + STORAGE_TYPE_TRANSIENT = 2, + /** + * STORAGE_TYPE_INDEX - STORAGE_TYPE_INDEX indicates persistent storage which is not backed + * by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + * before store/v2alpha1 does not support this. + */ + STORAGE_TYPE_INDEX = 3, + /** + * STORAGE_TYPE_COMMITMENT - STORAGE_TYPE_INDEX indicates persistent storage which is backed by + * a merkle-tree. With this type of storage, both primary and index keys + * will affect the app hash and this is generally less efficient + * than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + * keys into index storage. Note that modules built with the + * Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + * instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + * because this is the only type of persistent storage available. + */ + STORAGE_TYPE_COMMITMENT = 4, + UNRECOGNIZED = -1, +} +export const StorageTypeSDKType = StorageType; +export const StorageTypeAmino = StorageType; +export function storageTypeFromJSON(object: any): StorageType { + switch (object) { + case 0: + case "STORAGE_TYPE_DEFAULT_UNSPECIFIED": + return StorageType.STORAGE_TYPE_DEFAULT_UNSPECIFIED; + case 1: + case "STORAGE_TYPE_MEMORY": + return StorageType.STORAGE_TYPE_MEMORY; + case 2: + case "STORAGE_TYPE_TRANSIENT": + return StorageType.STORAGE_TYPE_TRANSIENT; + case 3: + case "STORAGE_TYPE_INDEX": + return StorageType.STORAGE_TYPE_INDEX; + case 4: + case "STORAGE_TYPE_COMMITMENT": + return StorageType.STORAGE_TYPE_COMMITMENT; + case -1: + case "UNRECOGNIZED": + default: + return StorageType.UNRECOGNIZED; + } +} +export function storageTypeToJSON(object: StorageType): string { + switch (object) { + case StorageType.STORAGE_TYPE_DEFAULT_UNSPECIFIED: + return "STORAGE_TYPE_DEFAULT_UNSPECIFIED"; + case StorageType.STORAGE_TYPE_MEMORY: + return "STORAGE_TYPE_MEMORY"; + case StorageType.STORAGE_TYPE_TRANSIENT: + return "STORAGE_TYPE_TRANSIENT"; + case StorageType.STORAGE_TYPE_INDEX: + return "STORAGE_TYPE_INDEX"; + case StorageType.STORAGE_TYPE_COMMITMENT: + return "STORAGE_TYPE_COMMITMENT"; + case StorageType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptor { + schemaFile: ModuleSchemaDescriptor_FileEntry[]; + /** + * prefix is an optional prefix that precedes all keys in this module's + * store. + */ + prefix: Uint8Array; +} +export interface ModuleSchemaDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor"; + value: Uint8Array; +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptorAmino { + schema_file: ModuleSchemaDescriptor_FileEntryAmino[]; + /** + * prefix is an optional prefix that precedes all keys in this module's + * store. + */ + prefix: Uint8Array; +} +export interface ModuleSchemaDescriptorAminoMsg { + type: "cosmos-sdk/ModuleSchemaDescriptor"; + value: ModuleSchemaDescriptorAmino; +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptorSDKType { + schema_file: ModuleSchemaDescriptor_FileEntrySDKType[]; + prefix: Uint8Array; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntry { + /** + * id is a prefix that will be varint encoded and prepended to all the + * table keys specified in the file's tables. + */ + id: number; + /** + * proto_file_name is the name of a file .proto in that contains + * table definitions. The .proto file must be in a package that the + * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + */ + protoFileName: string; + /** + * storage_type optionally indicates the type of storage this file's + * tables should used. If it is left unspecified, the default KV-storage + * of the app will be used. + */ + storageType: StorageType; +} +export interface ModuleSchemaDescriptor_FileEntryProtoMsg { + typeUrl: "/cosmos.orm.v1alpha1.FileEntry"; + value: Uint8Array; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntryAmino { + /** + * id is a prefix that will be varint encoded and prepended to all the + * table keys specified in the file's tables. + */ + id: number; + /** + * proto_file_name is the name of a file .proto in that contains + * table definitions. The .proto file must be in a package that the + * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + */ + proto_file_name: string; + /** + * storage_type optionally indicates the type of storage this file's + * tables should used. If it is left unspecified, the default KV-storage + * of the app will be used. + */ + storage_type: StorageType; +} +export interface ModuleSchemaDescriptor_FileEntryAminoMsg { + type: "cosmos-sdk/FileEntry"; + value: ModuleSchemaDescriptor_FileEntryAmino; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntrySDKType { + id: number; + proto_file_name: string; + storage_type: StorageType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/params/v1beta1/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/params/v1beta1/params.ts new file mode 100644 index 000000000..a6e7b1d77 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/params/v1beta1/params.ts @@ -0,0 +1,61 @@ +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposal { + title: string; + description: string; + changes: ParamChange[]; +} +export interface ParameterChangeProposalProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal"; + value: Uint8Array; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalAmino { + title: string; + description: string; + changes: ParamChangeAmino[]; +} +export interface ParameterChangeProposalAminoMsg { + type: "cosmos-sdk/ParameterChangeProposal"; + value: ParameterChangeProposalAmino; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalSDKType { + title: string; + description: string; + changes: ParamChangeSDKType[]; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChange { + subspace: string; + key: string; + value: string; +} +export interface ParamChangeProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParamChange"; + value: Uint8Array; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeAmino { + subspace: string; + key: string; + value: string; +} +export interface ParamChangeAminoMsg { + type: "cosmos-sdk/ParamChange"; + value: ParamChangeAmino; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeSDKType { + subspace: string; + key: string; + value: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/genesis.ts new file mode 100644 index 000000000..60a70070e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/genesis.ts @@ -0,0 +1,136 @@ +import { Params, ParamsAmino, ParamsSDKType, ValidatorSigningInfo, ValidatorSigningInfoAmino, ValidatorSigningInfoSDKType } from "./slashing"; +import { Long } from "../../../helpers"; +/** GenesisState defines the slashing module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of related to deposit. */ + params: Params; + /** + * signing_infos represents a map between validator addresses and their + * signing infos. + */ + signingInfos: SigningInfo[]; + /** + * missed_blocks represents a map between validator addresses and their + * missed blocks. + */ + missedBlocks: ValidatorMissedBlocks[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the slashing module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of related to deposit. */ + params?: ParamsAmino; + /** + * signing_infos represents a map between validator addresses and their + * signing infos. + */ + signing_infos: SigningInfoAmino[]; + /** + * missed_blocks represents a map between validator addresses and their + * missed blocks. + */ + missed_blocks: ValidatorMissedBlocksAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the slashing module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + signing_infos: SigningInfoSDKType[]; + missed_blocks: ValidatorMissedBlocksSDKType[]; +} +/** SigningInfo stores validator signing info of corresponding address. */ +export interface SigningInfo { + /** address is the validator address. */ + address: string; + /** validator_signing_info represents the signing info of this validator. */ + validatorSigningInfo: ValidatorSigningInfo; +} +export interface SigningInfoProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.SigningInfo"; + value: Uint8Array; +} +/** SigningInfo stores validator signing info of corresponding address. */ +export interface SigningInfoAmino { + /** address is the validator address. */ + address: string; + /** validator_signing_info represents the signing info of this validator. */ + validator_signing_info?: ValidatorSigningInfoAmino; +} +export interface SigningInfoAminoMsg { + type: "cosmos-sdk/SigningInfo"; + value: SigningInfoAmino; +} +/** SigningInfo stores validator signing info of corresponding address. */ +export interface SigningInfoSDKType { + address: string; + validator_signing_info: ValidatorSigningInfoSDKType; +} +/** + * ValidatorMissedBlocks contains array of missed blocks of corresponding + * address. + */ +export interface ValidatorMissedBlocks { + /** address is the validator address. */ + address: string; + /** missed_blocks is an array of missed blocks by the validator. */ + missedBlocks: MissedBlock[]; +} +export interface ValidatorMissedBlocksProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.ValidatorMissedBlocks"; + value: Uint8Array; +} +/** + * ValidatorMissedBlocks contains array of missed blocks of corresponding + * address. + */ +export interface ValidatorMissedBlocksAmino { + /** address is the validator address. */ + address: string; + /** missed_blocks is an array of missed blocks by the validator. */ + missed_blocks: MissedBlockAmino[]; +} +export interface ValidatorMissedBlocksAminoMsg { + type: "cosmos-sdk/ValidatorMissedBlocks"; + value: ValidatorMissedBlocksAmino; +} +/** + * ValidatorMissedBlocks contains array of missed blocks of corresponding + * address. + */ +export interface ValidatorMissedBlocksSDKType { + address: string; + missed_blocks: MissedBlockSDKType[]; +} +/** MissedBlock contains height and missed status as boolean. */ +export interface MissedBlock { + /** index is the height at which the block was missed. */ + index: Long; + /** missed is the missed status. */ + missed: boolean; +} +export interface MissedBlockProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.MissedBlock"; + value: Uint8Array; +} +/** MissedBlock contains height and missed status as boolean. */ +export interface MissedBlockAmino { + /** index is the height at which the block was missed. */ + index: string; + /** missed is the missed status. */ + missed: boolean; +} +export interface MissedBlockAminoMsg { + type: "cosmos-sdk/MissedBlock"; + value: MissedBlockAmino; +} +/** MissedBlock contains height and missed status as boolean. */ +export interface MissedBlockSDKType { + index: Long; + missed: boolean; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/msg.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/msg.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/slashing.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/slashing.ts new file mode 100644 index 000000000..f5341e23e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/slashing.ts @@ -0,0 +1,108 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** + * ValidatorSigningInfo defines a validator's signing info for monitoring their + * liveness activity. + */ +export interface ValidatorSigningInfo { + address: string; + /** Height at which validator was first a candidate OR was unjailed */ + startHeight: Long; + /** + * Index which is incremented each time the validator was a bonded + * in a block and may have signed a precommit or not. This in conjunction with the + * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + */ + indexOffset: Long; + /** Timestamp until which the validator is jailed due to liveness downtime. */ + jailedUntil: Date; + /** + * Whether or not a validator has been tombstoned (killed out of validator set). It is set + * once the validator commits an equivocation or for any other configured misbehiavor. + */ + tombstoned: boolean; + /** + * A counter kept to avoid unnecessary array reads. + * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + */ + missedBlocksCounter: Long; +} +export interface ValidatorSigningInfoProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.ValidatorSigningInfo"; + value: Uint8Array; +} +/** + * ValidatorSigningInfo defines a validator's signing info for monitoring their + * liveness activity. + */ +export interface ValidatorSigningInfoAmino { + address: string; + /** Height at which validator was first a candidate OR was unjailed */ + start_height: string; + /** + * Index which is incremented each time the validator was a bonded + * in a block and may have signed a precommit or not. This in conjunction with the + * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + */ + index_offset: string; + /** Timestamp until which the validator is jailed due to liveness downtime. */ + jailed_until?: Date; + /** + * Whether or not a validator has been tombstoned (killed out of validator set). It is set + * once the validator commits an equivocation or for any other configured misbehiavor. + */ + tombstoned: boolean; + /** + * A counter kept to avoid unnecessary array reads. + * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + */ + missed_blocks_counter: string; +} +export interface ValidatorSigningInfoAminoMsg { + type: "cosmos-sdk/ValidatorSigningInfo"; + value: ValidatorSigningInfoAmino; +} +/** + * ValidatorSigningInfo defines a validator's signing info for monitoring their + * liveness activity. + */ +export interface ValidatorSigningInfoSDKType { + address: string; + start_height: Long; + index_offset: Long; + jailed_until: Date; + tombstoned: boolean; + missed_blocks_counter: Long; +} +/** Params represents the parameters used for by the slashing module. */ +export interface Params { + signedBlocksWindow: Long; + minSignedPerWindow: Uint8Array; + downtimeJailDuration: Duration; + slashFractionDoubleSign: Uint8Array; + slashFractionDowntime: Uint8Array; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.Params"; + value: Uint8Array; +} +/** Params represents the parameters used for by the slashing module. */ +export interface ParamsAmino { + signed_blocks_window: string; + min_signed_per_window: Uint8Array; + downtime_jail_duration?: DurationAmino; + slash_fraction_double_sign: Uint8Array; + slash_fraction_downtime: Uint8Array; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params represents the parameters used for by the slashing module. */ +export interface ParamsSDKType { + signed_blocks_window: Long; + min_signed_per_window: Uint8Array; + downtime_jail_duration: DurationSDKType; + slash_fraction_double_sign: Uint8Array; + slash_fraction_downtime: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/tx.ts new file mode 100644 index 000000000..abd46ac27 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/slashing/v1beta1/tx.ts @@ -0,0 +1,34 @@ +/** MsgUnjail defines the Msg/Unjail request type */ +export interface MsgUnjail { + validatorAddr: string; +} +export interface MsgUnjailProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail"; + value: Uint8Array; +} +/** MsgUnjail defines the Msg/Unjail request type */ +export interface MsgUnjailAmino { + validator_addr: string; +} +export interface MsgUnjailAminoMsg { + type: "cosmos-sdk/MsgUnjail"; + value: MsgUnjailAmino; +} +/** MsgUnjail defines the Msg/Unjail request type */ +export interface MsgUnjailSDKType { + validator_addr: string; +} +/** MsgUnjailResponse defines the Msg/Unjail response type */ +export interface MsgUnjailResponse {} +export interface MsgUnjailResponseProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjailResponse"; + value: Uint8Array; +} +/** MsgUnjailResponse defines the Msg/Unjail response type */ +export interface MsgUnjailResponseAmino {} +export interface MsgUnjailResponseAminoMsg { + type: "cosmos-sdk/MsgUnjailResponse"; + value: MsgUnjailResponseAmino; +} +/** MsgUnjailResponse defines the Msg/Unjail response type */ +export interface MsgUnjailResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/authz.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/authz.ts new file mode 100644 index 000000000..fe85f61e7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/authz.ts @@ -0,0 +1,135 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** + * AuthorizationType defines the type of staking module authorization type + * + * Since: cosmos-sdk 0.43 + */ +export enum AuthorizationType { + /** AUTHORIZATION_TYPE_UNSPECIFIED - AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type */ + AUTHORIZATION_TYPE_UNSPECIFIED = 0, + /** AUTHORIZATION_TYPE_DELEGATE - AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate */ + AUTHORIZATION_TYPE_DELEGATE = 1, + /** AUTHORIZATION_TYPE_UNDELEGATE - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate */ + AUTHORIZATION_TYPE_UNDELEGATE = 2, + /** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */ + AUTHORIZATION_TYPE_REDELEGATE = 3, + UNRECOGNIZED = -1, +} +export const AuthorizationTypeSDKType = AuthorizationType; +export const AuthorizationTypeAmino = AuthorizationType; +export function authorizationTypeFromJSON(object: any): AuthorizationType { + switch (object) { + case 0: + case "AUTHORIZATION_TYPE_UNSPECIFIED": + return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED; + case 1: + case "AUTHORIZATION_TYPE_DELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE; + case 2: + case "AUTHORIZATION_TYPE_UNDELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE; + case 3: + case "AUTHORIZATION_TYPE_REDELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE; + case -1: + case "UNRECOGNIZED": + default: + return AuthorizationType.UNRECOGNIZED; + } +} +export function authorizationTypeToJSON(object: AuthorizationType): string { + switch (object) { + case AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED: + return "AUTHORIZATION_TYPE_UNSPECIFIED"; + case AuthorizationType.AUTHORIZATION_TYPE_DELEGATE: + return "AUTHORIZATION_TYPE_DELEGATE"; + case AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE: + return "AUTHORIZATION_TYPE_UNDELEGATE"; + case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: + return "AUTHORIZATION_TYPE_REDELEGATE"; + case AuthorizationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorization { + /** + * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + * empty, there is no spend limit and any amount of coins can be delegated. + */ + maxTokens: Coin; + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allowList?: StakeAuthorization_Validators; + /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ + denyList?: StakeAuthorization_Validators; + /** authorization_type defines one of AuthorizationType. */ + authorizationType: AuthorizationType; +} +export interface StakeAuthorizationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization"; + value: Uint8Array; +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationAmino { + /** + * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + * empty, there is no spend limit and any amount of coins can be delegated. + */ + max_tokens?: CoinAmino; + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allow_list?: StakeAuthorization_ValidatorsAmino; + /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ + deny_list?: StakeAuthorization_ValidatorsAmino; + /** authorization_type defines one of AuthorizationType. */ + authorization_type: AuthorizationType; +} +export interface StakeAuthorizationAminoMsg { + type: "cosmos-sdk/StakeAuthorization"; + value: StakeAuthorizationAmino; +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationSDKType { + max_tokens: CoinSDKType; + allow_list?: StakeAuthorization_ValidatorsSDKType; + deny_list?: StakeAuthorization_ValidatorsSDKType; + authorization_type: AuthorizationType; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_Validators { + address: string[]; +} +export interface StakeAuthorization_ValidatorsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validators"; + value: Uint8Array; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsAmino { + address: string[]; +} +export interface StakeAuthorization_ValidatorsAminoMsg { + type: "cosmos-sdk/Validators"; + value: StakeAuthorization_ValidatorsAmino; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsSDKType { + address: string[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/genesis.ts new file mode 100644 index 000000000..3c665e021 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/genesis.ts @@ -0,0 +1,96 @@ +import { Params, ParamsAmino, ParamsSDKType, Validator, ValidatorAmino, ValidatorSDKType, Delegation, DelegationAmino, DelegationSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, RedelegationAmino, RedelegationSDKType } from "./staking"; +import { Long } from "../../../helpers"; +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of related to deposit. */ + params: Params; + /** + * last_total_power tracks the total amounts of bonded tokens recorded during + * the previous end block. + */ + lastTotalPower: Uint8Array; + /** + * last_validator_powers is a special index that provides a historical list + * of the last-block's bonded validators. + */ + lastValidatorPowers: LastValidatorPower[]; + /** delegations defines the validator set at genesis. */ + validators: Validator[]; + /** delegations defines the delegations active at genesis. */ + delegations: Delegation[]; + /** unbonding_delegations defines the unbonding delegations active at genesis. */ + unbondingDelegations: UnbondingDelegation[]; + /** redelegations defines the redelegations active at genesis. */ + redelegations: Redelegation[]; + exported: boolean; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of related to deposit. */ + params?: ParamsAmino; + /** + * last_total_power tracks the total amounts of bonded tokens recorded during + * the previous end block. + */ + last_total_power: Uint8Array; + /** + * last_validator_powers is a special index that provides a historical list + * of the last-block's bonded validators. + */ + last_validator_powers: LastValidatorPowerAmino[]; + /** delegations defines the validator set at genesis. */ + validators: ValidatorAmino[]; + /** delegations defines the delegations active at genesis. */ + delegations: DelegationAmino[]; + /** unbonding_delegations defines the unbonding delegations active at genesis. */ + unbonding_delegations: UnbondingDelegationAmino[]; + /** redelegations defines the redelegations active at genesis. */ + redelegations: RedelegationAmino[]; + exported: boolean; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_total_power: Uint8Array; + last_validator_powers: LastValidatorPowerSDKType[]; + validators: ValidatorSDKType[]; + delegations: DelegationSDKType[]; + unbonding_delegations: UnbondingDelegationSDKType[]; + redelegations: RedelegationSDKType[]; + exported: boolean; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPower { + /** address is the address of the validator. */ + address: string; + /** power defines the power of the validator. */ + power: Long; +} +export interface LastValidatorPowerProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower"; + value: Uint8Array; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPowerAmino { + /** address is the address of the validator. */ + address: string; + /** power defines the power of the validator. */ + power: string; +} +export interface LastValidatorPowerAminoMsg { + type: "cosmos-sdk/LastValidatorPower"; + value: LastValidatorPowerAmino; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPowerSDKType { + address: string; + power: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/staking.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 000000000..ad2ce79cf --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,823 @@ +import { Header, HeaderAmino, HeaderSDKType } from "../../../tendermint/types/types"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** 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 BondStatusSDKType = BondStatus; +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"; + } +} +/** + * 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; +} +/** + * 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 HistoricalInfoSDKType { + header: HeaderSDKType; + valset: ValidatorSDKType[]; +} +/** + * 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; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesSDKType { + rate: string; + max_rate: string; + max_change_rate: string; +} +/** 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?: Date; +} +export interface CommissionAminoMsg { + type: "cosmos-sdk/Commission"; + value: CommissionAmino; +} +/** Commission defines commission parameters for a given validator. */ +export interface CommissionSDKType { + commission_rates: CommissionRatesSDKType; + update_time: Date; +} +/** 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; +} +/** Description defines a validator description. */ +export interface DescriptionSDKType { + moniker: string; + identity: string; + website: string; + security_contact: string; + details: string; +} +/** + * 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; + /** 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: Long; + /** 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. */ + minSelfDelegation: string; +} +export interface ValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validator"; + value: Uint8Array; +} +/** + * 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?: Date; + /** commission defines the commission parameters. */ + commission?: CommissionAmino; + /** min_self_delegation is the validator's self declared minimum self delegation. */ + min_self_delegation: string; +} +export interface ValidatorAminoMsg { + type: "cosmos-sdk/Validator"; + value: ValidatorAmino; +} +/** + * 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 ValidatorSDKType { + operator_address: string; + consensus_pubkey: AnySDKType; + jailed: boolean; + status: BondStatus; + tokens: string; + delegator_shares: string; + description: DescriptionSDKType; + unbonding_height: Long; + unbonding_time: Date; + commission: CommissionSDKType; + min_self_delegation: string; +} +/** 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; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesSDKType { + addresses: string[]; +} +/** + * 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; +} +/** + * 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 DVPairSDKType { + delegator_address: string; + validator_address: string; +} +/** 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; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsSDKType { + pairs: DVPairSDKType[]; +} +/** + * 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; +} +/** + * 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 DVVTripletSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; +} +/** 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; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsSDKType { + triplets: DVVTripletSDKType[]; +} +/** + * 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 bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-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 bech32-encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the bech32-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; +} +/** + * 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 DelegationSDKType { + delegator_address: string; + validator_address: string; + shares: string; +} +/** + * 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 bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-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 bech32-encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the bech32-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; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + entries: UnbondingDelegationEntrySDKType[]; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: Long; + /** 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; +} +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?: Date; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initial_balance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; +} +export interface UnbondingDelegationEntryAminoMsg { + type: "cosmos-sdk/UnbondingDelegationEntry"; + value: UnbondingDelegationEntryAmino; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntrySDKType { + creation_height: Long; + completion_time: Date; + initial_balance: string; + balance: string; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: Long; + /** 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; +} +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?: Date; + /** 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; +} +export interface RedelegationEntryAminoMsg { + type: "cosmos-sdk/RedelegationEntry"; + value: RedelegationEntryAmino; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntrySDKType { + creation_height: Long; + completion_time: Date; + initial_balance: string; + shares_dst: string; +} +/** + * 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; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + entries: RedelegationEntrySDKType[]; +} +/** Params defines the parameters for the 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 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/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the staking module. */ +export interface ParamsSDKType { + unbonding_time: DurationSDKType; + max_validators: number; + max_entries: number; + historical_entries: number; + bond_denom: string; + min_commission_rate: string; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * 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; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseSDKType { + delegation: DelegationSDKType; + balance: CoinSDKType; +} +/** + * 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; +} +/** + * 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 RedelegationEntryResponseSDKType { + redelegation_entry: RedelegationEntrySDKType; + balance: string; +} +/** + * 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; +} +/** + * 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 RedelegationResponseSDKType { + redelegation: RedelegationSDKType; + entries: RedelegationEntryResponseSDKType[]; +} +/** + * 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; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolSDKType { + not_bonded_tokens: string; + bonded_tokens: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 000000000..61b3bc666 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,272 @@ +import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidator { + description: Description; + commission: CommissionRates; + minSelfDelegation: string; + delegatorAddress: string; + validatorAddress: string; + pubkey: Any; + value: Coin; +} +export interface MsgCreateValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; + value: Uint8Array; +} +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorAmino { + description?: DescriptionAmino; + commission?: CommissionRatesAmino; + min_self_delegation: string; + delegator_address: string; + validator_address: string; + pubkey?: AnyAmino; + value?: CoinAmino; +} +export interface MsgCreateValidatorAminoMsg { + type: "cosmos-sdk/MsgCreateValidator"; + value: MsgCreateValidatorAmino; +} +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorSDKType { + description: DescriptionSDKType; + commission: CommissionRatesSDKType; + min_self_delegation: string; + delegator_address: string; + validator_address: string; + pubkey: AnySDKType; + value: CoinSDKType; +} +/** 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; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseSDKType {} +/** 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; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorSDKType { + description: DescriptionSDKType; + validator_address: string; + commission_rate: string; + min_self_delegation: string; +} +/** 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; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseSDKType {} +/** + * 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; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; +} +/** 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; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseSDKType {} +/** + * 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; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + amount: CoinSDKType; +} +/** 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?: Date; +} +export interface MsgBeginRedelegateResponseAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegateResponse"; + value: MsgBeginRedelegateResponseAmino; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseSDKType { + completion_time: Date; +} +/** + * 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; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponse { + completionTime: Date; +} +export interface MsgUndelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse"; + value: Uint8Array; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseAmino { + completion_time?: Date; +} +export interface MsgUndelegateResponseAminoMsg { + type: "cosmos-sdk/MsgUndelegateResponse"; + value: MsgUndelegateResponseAmino; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseSDKType { + completion_time: Date; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/signing/v1beta1/signing.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 000000000..505e29c29 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,244 @@ +import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Long } from "../../../../helpers"; +/** + * 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. It is currently not supported. + */ + 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`. It also allows + * for adding Tips in transactions. + * + * 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, + UNRECOGNIZED = -1, +} +export const SignModeSDKType = SignMode; +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 -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.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; +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsSDKType { + signatures: SignatureDescriptorSDKType[]; +} +/** + * 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: Long; +} +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; +} +/** + * 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 SignatureDescriptorSDKType { + public_key: AnySDKType; + data: SignatureDescriptor_DataSDKType; + sequence: Long; +} +/** 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; +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataSDKType { + single?: SignatureDescriptor_Data_SingleSDKType; + multi?: SignatureDescriptor_Data_MultiSDKType; +} +/** 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: Uint8Array; +} +export interface SignatureDescriptor_Data_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: SignatureDescriptor_Data_SingleAmino; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleSDKType { + mode: SignMode; + signature: Uint8Array; +} +/** 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; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiSDKType { + bitarray: CompactBitArraySDKType; + signatures: SignatureDescriptor_DataSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/service.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/service.ts new file mode 100644 index 000000000..c47abc99a --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/service.ts @@ -0,0 +1,485 @@ +import { Tx, TxAmino, TxSDKType } from "./tx"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { TxResponse, TxResponseAmino, TxResponseSDKType, GasInfo, GasInfoAmino, GasInfoSDKType, Result, ResultAmino, ResultSDKType } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../tendermint/types/types"; +import { Block, BlockAmino, BlockSDKType } from "../../../tendermint/types/block"; +import { Long } from "../../../helpers"; +/** OrderBy defines the sorting order */ +export enum OrderBy { + /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ + ORDER_BY_UNSPECIFIED = 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 OrderBySDKType = OrderBy; +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 - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + * the tx to be committed in a block. + */ + BROADCAST_MODE_BLOCK = 1, + /** + * BROADCAST_MODE_SYNC - 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 BroadcastModeSDKType = BroadcastMode; +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. */ + events: string[]; + /** pagination defines a pagination for the request. */ + pagination: PageRequest; + orderBy: OrderBy; +} +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. */ + events: string[]; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; + order_by: OrderBy; +} +export interface GetTxsEventRequestAminoMsg { + type: "cosmos-sdk/GetTxsEventRequest"; + value: GetTxsEventRequestAmino; +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequestSDKType { + events: string[]; + pagination: PageRequestSDKType; + order_by: OrderBy; +} +/** + * 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. */ + pagination: PageResponse; +} +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. */ + pagination?: PageResponseAmino; +} +export interface GetTxsEventResponseAminoMsg { + type: "cosmos-sdk/GetTxsEventResponse"; + value: GetTxsEventResponseAmino; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponseSDKType { + txs: TxSDKType[]; + tx_responses: TxResponseSDKType[]; + pagination: PageResponseSDKType; +} +/** + * 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: Uint8Array; + mode: BroadcastMode; +} +export interface BroadcastTxRequestAminoMsg { + type: "cosmos-sdk/BroadcastTxRequest"; + value: BroadcastTxRequestAmino; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequestSDKType { + tx_bytes: Uint8Array; + mode: BroadcastMode; +} +/** + * 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; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponseSDKType { + tx_response: TxResponseSDKType; +} +/** + * 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: Uint8Array; +} +export interface SimulateRequestAminoMsg { + type: "cosmos-sdk/SimulateRequest"; + value: SimulateRequestAmino; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequestSDKType { + /** @deprecated */ + tx: TxSDKType; + tx_bytes: Uint8Array; +} +/** + * 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; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponseSDKType { + gas_info: GasInfoSDKType; + result: ResultSDKType; +} +/** + * 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; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequestSDKType { + hash: string; +} +/** 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; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponseSDKType { + tx: TxSDKType; + tx_response: TxResponseSDKType; +} +/** + * 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: Long; + /** 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; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestSDKType { + height: Long; + pagination: PageRequestSDKType; +} +/** + * 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; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseSDKType { + txs: TxSDKType[]; + block_id: BlockIDSDKType; + block: BlockSDKType; + pagination: PageResponseSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 000000000..200adec5c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,758 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { SignMode } from "../signing/v1beta1/signing"; +import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../crypto/multisig/v1beta1/multisig"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** 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: Uint8Array[]; +} +export interface TxAminoMsg { + type: "cosmos-sdk/Tx"; + value: TxAmino; +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxSDKType { + body: TxBodySDKType; + auth_info: AuthInfoSDKType; + signatures: 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 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: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + auth_info_bytes: 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 TxRawAminoMsg { + type: "cosmos-sdk/TxRaw"; + value: TxRawAmino; +} +/** + * 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 TxRawSDKType { + body_bytes: Uint8Array; + auth_info_bytes: Uint8Array; + signatures: Uint8Array[]; +} +/** 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: Long; +} +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: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + auth_info_bytes: 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 + */ + 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; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocSDKType { + body_bytes: Uint8Array; + auth_info_bytes: Uint8Array; + chain_id: string; + account_number: Long; +} +/** + * 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: Long; + /** sequence is the sequence number of the signing account. */ + sequence: Long; + /** + * Tip is the optional tip used for meta-transactions. It should be left + * empty if the signer is not the tipper for this transaction. + */ + 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: Uint8Array; + /** 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; + /** + * Tip is the optional tip used for meta-transactions. It should be left + * empty if the signer is not the tipper for this transaction. + */ + tip?: TipAmino; +} +export interface SignDocDirectAuxAminoMsg { + type: "cosmos-sdk/SignDocDirectAux"; + value: SignDocDirectAuxAmino; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxSDKType { + body_bytes: Uint8Array; + public_key: AnySDKType; + chain_id: string; + account_number: Long; + sequence: Long; + tip: TipSDKType; +} +/** 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: Long; + /** + * 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; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodySDKType { + messages: AnySDKType[]; + memo: string; + timeout_height: Long; + extension_options: AnySDKType[]; + non_critical_extension_options: AnySDKType[]; +} +/** + * 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 meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ + 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 meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ + tip?: TipAmino; +} +export interface AuthInfoAminoMsg { + type: "cosmos-sdk/AuthInfo"; + value: AuthInfoAmino; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoSDKType { + signer_infos: SignerInfoSDKType[]; + fee: FeeSDKType; + tip: TipSDKType; +} +/** + * 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: Long; +} +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; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoSDKType { + public_key: AnySDKType; + mode_info: ModeInfoSDKType; + sequence: Long; +} +/** 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; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoSDKType { + single?: ModeInfo_SingleSDKType; + multi?: ModeInfo_MultiSDKType; +} +/** + * 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; +} +/** + * 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_SingleSDKType { + mode: SignMode; +} +/** 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; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiSDKType { + bitarray: CompactBitArraySDKType; + mode_infos: ModeInfoSDKType[]; +} +/** + * 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: Long; + /** + * 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; +} +/** + * 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 FeeSDKType { + amount: CoinSDKType[]; + gas_limit: Long; + payer: string; + granter: string; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +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 + */ +export interface TipAmino { + /** amount is the amount of the tip */ + amount: CoinAmino[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} +export interface TipAminoMsg { + type: "cosmos-sdk/Tip"; + value: TipAmino; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipSDKType { + amount: CoinSDKType[]; + tipper: string; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MOD_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_MOD_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: Uint8Array; +} +export interface AuxSignerDataAminoMsg { + type: "cosmos-sdk/AuxSignerData"; + value: AuxSignerDataAmino; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataSDKType { + address: string; + sign_doc: SignDocDirectAuxSDKType; + mode: SignMode; + sig: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 000000000..1d372fd87 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,126 @@ +import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address of the governance account. */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address of the governance account. */ + authority: string; + /** plan is the upgrade plan. */ + plan?: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse"; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address of the governance account. */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address of the governance account. */ + authority: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUpgradeResponse"; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/upgrade.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 000000000..c91c82430 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,218 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** 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. + * Only used if Time is not set. + */ + height: Long; + /** + * 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?: Date; + /** + * The height at which the upgrade must be performed. + * Only used if Time is not set. + */ + 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; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanSDKType { + name: string; + /** @deprecated */ + time: Date; + height: Long; + info: string; + /** @deprecated */ + upgraded_client_state: AnySDKType; +} +/** + * 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: string; + description: string; + 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: string; + description: string; + plan?: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/SoftwareUpgradeProposal"; + value: SoftwareUpgradeProposalAmino; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalSDKType { + title: string; + description: string; + plan: PlanSDKType; +} +/** + * 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: string; + 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: string; + description: string; +} +export interface CancelSoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalSDKType { + title: string; + description: string; +} +/** + * 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: Long; +} +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; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionSDKType { + name: string; + version: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/tx.ts new file mode 100644 index 000000000..ac94847cc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/tx.ts @@ -0,0 +1,168 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Period, PeriodAmino, PeriodSDKType } from "./vesting"; +import { Long } from "../../../helpers"; +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; + endTime: Long; + 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_time: string; + delayed: boolean; +} +export interface MsgCreateVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccount"; + value: MsgCreateVestingAccountAmino; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccountSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; + end_time: Long; + delayed: boolean; +} +/** 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; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponseSDKType {} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + */ +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. + */ +export interface MsgCreatePermanentLockedAccountAmino { + from_address: string; + to_address: string; + amount: CoinAmino[]; +} +export interface MsgCreatePermanentLockedAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePermanentLockedAccount"; + value: MsgCreatePermanentLockedAccountAmino; +} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + */ +export interface MsgCreatePermanentLockedAccountSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponse {} +export interface MsgCreatePermanentLockedAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse"; + value: Uint8Array; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponseAmino {} +export interface MsgCreatePermanentLockedAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse"; + value: MsgCreatePermanentLockedAccountResponseAmino; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponseSDKType {} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccount { + fromAddress: string; + toAddress: string; + startTime: Long; + vestingPeriods: Period[]; +} +export interface MsgCreatePeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccountAmino { + from_address: string; + to_address: string; + start_time: string; + vesting_periods: PeriodAmino[]; +} +export interface MsgCreatePeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccount"; + value: MsgCreatePeriodicVestingAccountAmino; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccountSDKType { + from_address: string; + to_address: string; + start_time: Long; + vesting_periods: PeriodSDKType[]; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponse {} +export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponseAmino {} +export interface MsgCreatePeriodicVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse"; + value: MsgCreatePeriodicVestingAccountResponseAmino; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/vesting.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/vesting.ts new file mode 100644 index 000000000..acbc45d86 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/vesting/v1beta1/vesting.ts @@ -0,0 +1,204 @@ +import { BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "../../auth/v1beta1/auth"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** + * 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[]; + endTime: Long; +} +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[]; + end_time: string; +} +export interface BaseVestingAccountAminoMsg { + type: "cosmos-sdk/BaseVestingAccount"; + value: BaseVestingAccountAmino; +} +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccountSDKType { + base_account: BaseAccountSDKType; + original_vesting: CoinSDKType[]; + delegated_free: CoinSDKType[]; + delegated_vesting: CoinSDKType[]; + end_time: Long; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccount { + baseVestingAccount: BaseVestingAccount; + startTime: Long; +} +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; + start_time: string; +} +export interface ContinuousVestingAccountAminoMsg { + type: "cosmos-sdk/ContinuousVestingAccount"; + value: ContinuousVestingAccountAmino; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccountSDKType { + base_vesting_account: BaseVestingAccountSDKType; + start_time: Long; +} +/** + * 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; +} +/** + * 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 DelayedVestingAccountSDKType { + base_vesting_account: BaseVestingAccountSDKType; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface Period { + length: Long; + 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 { + length: string; + amount: CoinAmino[]; +} +export interface PeriodAminoMsg { + type: "cosmos-sdk/Period"; + value: PeriodAmino; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface PeriodSDKType { + length: Long; + amount: CoinSDKType[]; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccount { + baseVestingAccount: BaseVestingAccount; + startTime: Long; + 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; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccountSDKType { + base_vesting_account: BaseVestingAccountSDKType; + start_time: Long; + vesting_periods: PeriodSDKType[]; +} +/** + * 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; +} +/** + * 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 PermanentLockedAccountSDKType { + base_vesting_account: BaseVestingAccountSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/bundle.ts new file mode 100644 index 000000000..fd4900265 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/bundle.ts @@ -0,0 +1,4 @@ +import * as _1 from "./cosmos"; +export const cosmos_proto = { + ..._1 +}; \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/cosmos.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/cosmos.ts new file mode 100644 index 000000000..b9fa939f8 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos_proto/cosmos.ts @@ -0,0 +1,174 @@ +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} +export const ScalarTypeSDKType = ScalarType; +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; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorSDKType { + name: string; + description: string; +} +/** + * 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; +} +/** + * 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 ScalarDescriptorSDKType { + name: string; + description: string; + field_type: ScalarType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts new file mode 100644 index 000000000..adbed8d64 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts @@ -0,0 +1,18 @@ +import * as _78 from "./wasm/v1/authz"; +import * as _79 from "./wasm/v1/genesis"; +import * as _80 from "./wasm/v1/ibc"; +import * as _81 from "./wasm/v1/proposal"; +import * as _82 from "./wasm/v1/tx"; +import * as _83 from "./wasm/v1/types"; +export namespace cosmwasm { + export namespace wasm { + export const v1 = { + ..._78, + ..._79, + ..._80, + ..._81, + ..._82, + ..._83 + }; + } +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/authz.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/authz.ts new file mode 100644 index 000000000..389ebd622 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/authz.ts @@ -0,0 +1,315 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorization { + /** Grants for contract executions */ + grants: ContractGrant[]; +} +export interface ContractExecutionAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; + value: Uint8Array; +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationAmino { + /** Grants for contract executions */ + grants: ContractGrantAmino[]; +} +export interface ContractExecutionAuthorizationAminoMsg { + type: "wasm/ContractExecutionAuthorization"; + value: ContractExecutionAuthorizationAmino; +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationSDKType { + grants: ContractGrantSDKType[]; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorization { + /** Grants for contract migrations */ + grants: ContractGrant[]; +} +export interface ContractMigrationAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; + value: Uint8Array; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationAmino { + /** Grants for contract migrations */ + grants: ContractGrantAmino[]; +} +export interface ContractMigrationAuthorizationAminoMsg { + type: "wasm/ContractMigrationAuthorization"; + value: ContractMigrationAuthorizationAmino; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationSDKType { + grants: ContractGrantSDKType[]; +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrant { + /** Contract is the bech32 address of the smart contract */ + contract: string; + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit: Any; + /** + * Filter define more fine-grained control on the message payload passed + * to the contract in the operation. When no filter applies on execution, the + * operation is prohibited. + */ + filter: Any; +} +export interface ContractGrantProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractGrant"; + value: Uint8Array; +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantAmino { + /** Contract is the bech32 address of the smart contract */ + contract: string; + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: AnyAmino; + /** + * Filter define more fine-grained control on the message payload passed + * to the contract in the operation. When no filter applies on execution, the + * operation is prohibited. + */ + filter?: AnyAmino; +} +export interface ContractGrantAminoMsg { + type: "wasm/ContractGrant"; + value: ContractGrantAmino; +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantSDKType { + contract: string; + limit: AnySDKType; + filter: AnySDKType; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimit { + /** Remaining number that is decremented on each execution */ + remaining: Long; +} +export interface MaxCallsLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit"; + value: Uint8Array; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitAmino { + /** Remaining number that is decremented on each execution */ + remaining: string; +} +export interface MaxCallsLimitAminoMsg { + type: "wasm/MaxCallsLimit"; + value: MaxCallsLimitAmino; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitSDKType { + remaining: Long; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimit { + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: Coin[]; +} +export interface MaxFundsLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit"; + value: Uint8Array; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitAmino { + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: CoinAmino[]; +} +export interface MaxFundsLimitAminoMsg { + type: "wasm/MaxFundsLimit"; + value: MaxFundsLimitAmino; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitSDKType { + amounts: CoinSDKType[]; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimit { + /** Remaining number that is decremented on each execution */ + callsRemaining: Long; + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: Coin[]; +} +export interface CombinedLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CombinedLimit"; + value: Uint8Array; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitAmino { + /** Remaining number that is decremented on each execution */ + calls_remaining: string; + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: CoinAmino[]; +} +export interface CombinedLimitAminoMsg { + type: "wasm/CombinedLimit"; + value: CombinedLimitAmino; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitSDKType { + calls_remaining: Long; + amounts: CoinSDKType[]; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilter {} +export interface AllowAllMessagesFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; + value: Uint8Array; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterAmino {} +export interface AllowAllMessagesFilterAminoMsg { + type: "wasm/AllowAllMessagesFilter"; + value: AllowAllMessagesFilterAmino; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterSDKType {} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilter { + /** Messages is the list of unique keys */ + keys: string[]; +} +export interface AcceptedMessageKeysFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; + value: Uint8Array; +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterAmino { + /** Messages is the list of unique keys */ + keys: string[]; +} +export interface AcceptedMessageKeysFilterAminoMsg { + type: "wasm/AcceptedMessageKeysFilter"; + value: AcceptedMessageKeysFilterAmino; +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterSDKType { + keys: string[]; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilter { + /** Messages is the list of raw contract messages */ + messages: Uint8Array[]; +} +export interface AcceptedMessagesFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; + value: Uint8Array; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterAmino { + /** Messages is the list of raw contract messages */ + messages: Uint8Array[]; +} +export interface AcceptedMessagesFilterAminoMsg { + type: "wasm/AcceptedMessagesFilter"; + value: AcceptedMessagesFilterAmino; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterSDKType { + messages: Uint8Array[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/genesis.ts new file mode 100644 index 000000000..dac8647c5 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/genesis.ts @@ -0,0 +1,114 @@ +import { Params, ParamsAmino, ParamsSDKType, CodeInfo, CodeInfoAmino, CodeInfoSDKType, ContractInfo, ContractInfoAmino, ContractInfoSDKType, Model, ModelAmino, ModelSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType } from "./types"; +import { Long } from "../../../helpers"; +/** GenesisState - genesis state of x/wasm */ +export interface GenesisState { + params: Params; + codes: Code[]; + contracts: Contract[]; + sequences: Sequence[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateAmino { + params?: ParamsAmino; + codes: CodeAmino[]; + contracts: ContractAmino[]; + sequences: SequenceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "wasm/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + codes: CodeSDKType[]; + contracts: ContractSDKType[]; + sequences: SequenceSDKType[]; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface Code { + codeId: Long; + codeInfo: CodeInfo; + codeBytes: Uint8Array; + /** Pinned to wasmvm cache */ + pinned: boolean; +} +export interface CodeProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Code"; + value: Uint8Array; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeAmino { + code_id: string; + code_info?: CodeInfoAmino; + code_bytes: Uint8Array; + /** Pinned to wasmvm cache */ + pinned: boolean; +} +export interface CodeAminoMsg { + type: "wasm/Code"; + value: CodeAmino; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeSDKType { + code_id: Long; + code_info: CodeInfoSDKType; + code_bytes: Uint8Array; + pinned: boolean; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface Contract { + contractAddress: string; + contractInfo: ContractInfo; + contractState: Model[]; + contractCodeHistory: ContractCodeHistoryEntry[]; +} +export interface ContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Contract"; + value: Uint8Array; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractAmino { + contract_address: string; + contract_info?: ContractInfoAmino; + contract_state: ModelAmino[]; + contract_code_history: ContractCodeHistoryEntryAmino[]; +} +export interface ContractAminoMsg { + type: "wasm/Contract"; + value: ContractAmino; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractSDKType { + contract_address: string; + contract_info: ContractInfoSDKType; + contract_state: ModelSDKType[]; + contract_code_history: ContractCodeHistoryEntrySDKType[]; +} +/** Sequence key and value of an id generation counter */ +export interface Sequence { + idKey: Uint8Array; + value: Long; +} +export interface SequenceProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Sequence"; + value: Uint8Array; +} +/** Sequence key and value of an id generation counter */ +export interface SequenceAmino { + id_key: Uint8Array; + value: string; +} +export interface SequenceAminoMsg { + type: "wasm/Sequence"; + value: SequenceAmino; +} +/** Sequence key and value of an id generation counter */ +export interface SequenceSDKType { + id_key: Uint8Array; + value: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/ibc.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/ibc.ts new file mode 100644 index 000000000..9d093292a --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/ibc.ts @@ -0,0 +1,76 @@ +import { Long } from "../../../helpers"; +/** MsgIBCSend */ +export interface MsgIBCSend { + /** the channel by which the packet will be sent */ + channel: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Long; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: Long; + /** + * Data is the payload to transfer. We must not make assumption what format or + * content is in here. + */ + data: Uint8Array; +} +export interface MsgIBCSendProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend"; + value: Uint8Array; +} +/** MsgIBCSend */ +export interface MsgIBCSendAmino { + /** the channel by which the packet will be sent */ + channel: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height: string; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeout_timestamp: string; + /** + * Data is the payload to transfer. We must not make assumption what format or + * content is in here. + */ + data: Uint8Array; +} +export interface MsgIBCSendAminoMsg { + type: "wasm/MsgIBCSend"; + value: MsgIBCSendAmino; +} +/** MsgIBCSend */ +export interface MsgIBCSendSDKType { + channel: string; + timeout_height: Long; + timeout_timestamp: Long; + data: Uint8Array; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannel { + channel: string; +} +export interface MsgIBCCloseChannelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel"; + value: Uint8Array; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannelAmino { + channel: string; +} +export interface MsgIBCCloseChannelAminoMsg { + type: "wasm/MsgIBCCloseChannel"; + value: MsgIBCCloseChannelAmino; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannelSDKType { + channel: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/proposal.ts new file mode 100644 index 000000000..2db14c952 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/proposal.ts @@ -0,0 +1,706 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +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; +} +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +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: Uint8Array; +} +export interface StoreCodeProposalAminoMsg { + type: "wasm/StoreCodeProposal"; + value: StoreCodeProposalAmino; +} +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +export interface StoreCodeProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission: AccessConfigSDKType; + unpin_code: boolean; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +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: Long; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface InstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal"; + value: Uint8Array; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposalAmino { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface InstantiateContractProposalAminoMsg { + type: "wasm/InstantiateContractProposal"; + value: InstantiateContractProposalAmino; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: Long; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2Proposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} +export interface InstantiateContract2ProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; + value: Uint8Array; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2ProposalAmino { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + run_as: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** 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: Uint8Array; + /** + * 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; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2ProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: Long; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +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: Long; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MigrateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; + value: Uint8Array; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +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: Uint8Array; +} +export interface MigrateContractProposalAminoMsg { + type: "wasm/MigrateContractProposal"; + value: MigrateContractProposalAmino; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +export interface MigrateContractProposalSDKType { + title: string; + description: string; + contract: string; + code_id: Long; + msg: Uint8Array; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +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; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +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: Uint8Array; +} +export interface SudoContractProposalAminoMsg { + type: "wasm/SudoContractProposal"; + value: SudoContractProposalAmino; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +export interface SudoContractProposalSDKType { + title: string; + description: string; + contract: string; + msg: Uint8Array; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +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; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +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: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface ExecuteContractProposalAminoMsg { + type: "wasm/ExecuteContractProposal"; + value: ExecuteContractProposalAmino; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +export interface ExecuteContractProposalSDKType { + title: string; + description: string; + run_as: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +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; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +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; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +export interface UpdateAdminProposalSDKType { + title: string; + description: string; + new_admin: string; + contract: string; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +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; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +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; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +export interface ClearAdminProposalSDKType { + title: string; + description: string; + contract: string; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +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: Long[]; +} +export interface PinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal"; + value: Uint8Array; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +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; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +export interface PinCodesProposalSDKType { + title: string; + description: string; + code_ids: Long[]; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: Long[]; +} +export interface UnpinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal"; + value: Uint8Array; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +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; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposalSDKType { + title: string; + description: string; + code_ids: Long[]; +} +/** + * 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: Long; + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfig; +} +export interface AccessConfigUpdateProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate"; + value: Uint8Array; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateAmino { + /** CodeID is the reference to the stored WASM code to be updated */ + code_id: string; + /** InstantiatePermission to apply to the set of code ids */ + instantiate_permission?: AccessConfigAmino; +} +export interface AccessConfigUpdateAminoMsg { + type: "wasm/AccessConfigUpdate"; + value: AccessConfigUpdateAmino; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateSDKType { + code_id: Long; + instantiate_permission: AccessConfigSDKType; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +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; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +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; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +export interface UpdateInstantiateConfigProposalSDKType { + title: string; + description: string; + access_config_updates: AccessConfigUpdateSDKType[]; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission: AccessConfig; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreAndInstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; + value: Uint8Array; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposalAmino { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** UnpinCode code on upload, optional */ + unpin_code: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** 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: Uint8Array; +} +export interface StoreAndInstantiateContractProposalAminoMsg { + type: "wasm/StoreAndInstantiateContractProposal"; + value: StoreAndInstantiateContractProposalAmino; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/tx.ts new file mode 100644 index 000000000..9e48320e1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/tx.ts @@ -0,0 +1,461 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the that 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 that 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; +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeSDKType { + sender: string; + wasm_byte_code: Uint8Array; + instantiate_permission: AccessConfigSDKType; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** 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: Uint8Array; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "wasm/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseSDKType { + code_id: Long; + checksum: Uint8Array; +} +/** + * 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: Long; + /** 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: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface MsgInstantiateContractAminoMsg { + type: "wasm/MsgInstantiateContract"; + value: MsgInstantiateContractAmino; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractSDKType { + sender: string; + admin: string; + code_id: Long; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable 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: Long; + /** 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 predicable 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: Uint8Array; + /** 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: Uint8Array; + /** + * 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; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2SDKType { + sender: string; + admin: string; + code_id: Long; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "wasm/MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2Response { + /** Address is the bech32 address of the new contract instance. */ + 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: Uint8Array; +} +export interface MsgInstantiateContract2ResponseAminoMsg { + type: "wasm/MsgInstantiateContract2Response"; + value: MsgInstantiateContract2ResponseAmino; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseSDKType { + address: string; + data: Uint8Array; +} +/** 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: Uint8Array; + /** Funds coins that are transferred to the contract on execution */ + funds: CoinAmino[]; +} +export interface MsgExecuteContractAminoMsg { + type: "wasm/MsgExecuteContract"; + value: MsgExecuteContractAmino; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractSDKType { + sender: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** 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: Uint8Array; +} +export interface MsgExecuteContractResponseAminoMsg { + type: "wasm/MsgExecuteContractResponse"; + value: MsgExecuteContractResponseAmino; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseSDKType { + data: Uint8Array; +} +/** 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: Long; + /** 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: Uint8Array; +} +export interface MsgMigrateContractAminoMsg { + type: "wasm/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractSDKType { + sender: string; + contract: string; + code_id: Long; + msg: Uint8Array; +} +/** 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: Uint8Array; +} +export interface MsgMigrateContractResponseAminoMsg { + type: "wasm/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseSDKType { + data: Uint8Array; +} +/** 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; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminSDKType { + sender: string; + new_admin: string; + contract: string; +} +/** 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; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseSDKType {} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the that 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 that 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; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminSDKType { + sender: string; + contract: string; +} +/** 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; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/types.ts new file mode 100644 index 000000000..841056322 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/wasm/v1/types.ts @@ -0,0 +1,377 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** 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_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address + * Deprecated: use AccessTypeAnyOfAddresses instead + */ + ACCESS_TYPE_ONLY_ADDRESS = 2, + /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ + ACCESS_TYPE_EVERYBODY = 3, + /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ + ACCESS_TYPE_ANY_OF_ADDRESSES = 4, + UNRECOGNIZED = -1, +} +export const AccessTypeSDKType = AccessType; +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 2: + case "ACCESS_TYPE_ONLY_ADDRESS": + return AccessType.ACCESS_TYPE_ONLY_ADDRESS; + 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_ONLY_ADDRESS: + return "ACCESS_TYPE_ONLY_ADDRESS"; + 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 ContractCodeHistoryOperationTypeSDKType = ContractCodeHistoryOperationType; +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; +} +/** AccessTypeParam */ +export interface AccessTypeParamSDKType { + value: AccessType; +} +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType; + /** + * Address + * Deprecated: replaced by addresses + */ + address: string; + addresses: string[]; +} +export interface AccessConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; + value: Uint8Array; +} +/** AccessConfig access control type. */ +export interface AccessConfigAmino { + permission: AccessType; + /** + * Address + * Deprecated: replaced by addresses + */ + address: string; + addresses: string[]; +} +export interface AccessConfigAminoMsg { + type: "wasm/AccessConfig"; + value: AccessConfigAmino; +} +/** AccessConfig access control type. */ +export interface AccessConfigSDKType { + permission: AccessType; + address: string; + addresses: string[]; +} +/** 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; +} +/** Params defines the set of wasm parameters. */ +export interface ParamsSDKType { + code_upload_access: AccessConfigSDKType; + instantiate_default_permission: AccessType; +} +/** 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: Uint8Array; + /** 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; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoSDKType { + code_hash: Uint8Array; + creator: string; + instantiate_config: AccessConfigSDKType; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: Long; + /** 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; +} +export interface ContractInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; + value: Uint8Array; +} +/** 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; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoSDKType { + code_id: Long; + creator: string; + admin: string; + label: string; + created: AbsoluteTxPositionSDKType; + ibc_port_id: string; + extension: AnySDKType; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** 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: Uint8Array; +} +export interface ContractCodeHistoryEntryAminoMsg { + type: "wasm/ContractCodeHistoryEntry"; + value: ContractCodeHistoryEntryAmino; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntrySDKType { + operation: ContractCodeHistoryOperationType; + code_id: Long; + updated: AbsoluteTxPositionSDKType; + msg: Uint8Array; +} +/** + * 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: Long; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: Long; +} +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; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionSDKType { + block_height: Long; + tx_index: Long; +} +/** 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: Uint8Array; + /** base64-encode raw value */ + value: Uint8Array; +} +export interface ModelAminoMsg { + type: "wasm/Model"; + value: ModelAmino; +} +/** Model is a struct that holds a KV pair */ +export interface ModelSDKType { + key: Uint8Array; + value: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/api/annotations.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/api/annotations.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/api/annotations.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/api/http.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/api/http.ts new file mode 100644 index 000000000..21437d980 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/api/http.ts @@ -0,0 +1,1025 @@ +/** + * 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; +} +/** + * 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 HttpSDKType { + rules: HttpRuleSDKType[]; + fully_decode_reserved_expansion: boolean; +} +/** + * # 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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `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. + * + * Example: + * + * 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 + * + * 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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `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. + * + * Example: + * + * 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 + * + * 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; +} +/** + * # 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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `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 | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `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. + * + * Example: + * + * 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 + * + * 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 HttpRuleSDKType { + selector: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: CustomHttpPatternSDKType; + body: string; + response_body: string; + additional_bindings: HttpRuleSDKType[]; +} +/** 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; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternSDKType { + kind: string; + path: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts new file mode 100644 index 000000000..b5687f182 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts @@ -0,0 +1,20 @@ +import * as _84 from "./api/annotations"; +import * as _85 from "./api/http"; +import * as _86 from "./protobuf/any"; +import * as _87 from "./protobuf/descriptor"; +import * as _88 from "./protobuf/duration"; +import * as _89 from "./protobuf/empty"; +import * as _90 from "./protobuf/timestamp"; +export namespace google { + export const api = { + ..._84, + ..._85 + }; + export const protobuf = { + ..._86, + ..._87, + ..._88, + ..._89, + ..._90 + }; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/any.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/any.ts new file mode 100644 index 000000000..5948c6446 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/any.ts @@ -0,0 +1,325 @@ +/** + * `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); + * } + * + * 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 := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, 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 { + $typeUrl?: string; + /** + * 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. + * + * 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); + * } + * + * 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 := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, 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. + * + * 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; +} +/** + * `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); + * } + * + * 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 := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, 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 AnySDKType { + $typeUrl?: string; + type_url: string; + value: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/descriptor.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/descriptor.ts new file mode 100644 index 000000000..57f1a95d5 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/descriptor.ts @@ -0,0 +1,2197 @@ +import { Long } from "../../helpers"; +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 in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + /** 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_TypeSDKType = FieldDescriptorProto_Type; +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_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_LabelSDKType = FieldDescriptorProto_Label; +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 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + 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_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + 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, + * etc. + */ + SPEED = 1, + /** CODE_SIZE - Use ReflectionOps to implement these methods. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export const FileOptions_OptimizeModeSDKType = FileOptions_OptimizeMode; +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 = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_CTypeSDKType = FieldOptions_CType; +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_JSTypeSDKType = FieldOptions_JSType; +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"; + } +} +/** + * 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_IdempotencyLevelSDKType = MethodOptions_IdempotencyLevel; +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"; + } +} +/** + * 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; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetSDKType { + file: FileDescriptorProtoSDKType[]; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + 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" and "proto3". + */ + syntax: string; +} +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; + 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" and "proto3". + */ + syntax: string; +} +export interface FileDescriptorProtoAminoMsg { + type: "/google.protobuf.FileDescriptorProto"; + value: FileDescriptorProtoAmino; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoSDKType { + name: string; + package: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + service: ServiceDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + options: FileOptionsSDKType; + source_code_info: SourceCodeInfoSDKType; + syntax: string; +} +/** 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; +} +/** Describes a message type. */ +export interface DescriptorProtoSDKType { + name: string; + field: FieldDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + nested_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + extension_range: DescriptorProto_ExtensionRangeSDKType[]; + oneof_decl: OneofDescriptorProtoSDKType[]; + options: MessageOptionsSDKType; + reserved_range: DescriptorProto_ReservedRangeSDKType[]; + reserved_name: string[]; +} +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; +} +export interface DescriptorProto_ExtensionRangeSDKType { + start: number; + end: number; + options: ExtensionRangeOptionsSDKType; +} +/** + * 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; +} +/** + * 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_ReservedRangeSDKType { + start: number; + end: number; +} +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +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[]; +} +export interface ExtensionRangeOptionsAminoMsg { + type: "/google.protobuf.ExtensionRangeOptions"; + value: ExtensionRangeOptionsAmino; +} +export interface ExtensionRangeOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** 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. + * TODO(kenton): Base-64 encode? + */ + 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; +} +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. + * TODO(kenton): Base-64 encode? + */ + 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; +} +export interface FieldDescriptorProtoAminoMsg { + type: "/google.protobuf.FieldDescriptorProto"; + value: FieldDescriptorProtoAmino; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoSDKType { + name: string; + number: number; + label: FieldDescriptorProto_Label; + type: FieldDescriptorProto_Type; + type_name: string; + extendee: string; + default_value: string; + oneof_index: number; + json_name: string; + options: FieldOptionsSDKType; +} +/** 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 a oneof. */ +export interface OneofDescriptorProtoSDKType { + name: string; + options: OneofOptionsSDKType; +} +/** 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; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoSDKType { + name: string; + value: EnumValueDescriptorProtoSDKType[]; + options: EnumOptionsSDKType; + reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; + reserved_name: string[]; +} +/** + * 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; +} +/** + * 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_EnumReservedRangeSDKType { + start: number; + end: number; +} +/** 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 value within an enum. */ +export interface EnumValueDescriptorProtoSDKType { + name: string; + number: number; + options: EnumValueOptionsSDKType; +} +/** 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 service. */ +export interface ServiceDescriptorProtoSDKType { + name: string; + method: MethodDescriptorProtoSDKType[]; + options: ServiceOptionsSDKType; +} +/** 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; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoSDKType { + name: string; + input_type: string; + output_type: string; + options: MethodOptionsSDKType; + client_streaming: boolean; + server_streaming: boolean; +} +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; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, 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 outer class + * named by java_outer_classname. However, the outer 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; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + 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; + phpGenericServices: 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; + /** + * 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; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + java_outer_classname: string; + /** + * If set true, 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 outer class + * named by java_outer_classname. However, the outer 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; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + 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; + php_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; + /** + * 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 FileOptionsSDKType { + java_package: string; + java_outer_classname: string; + java_multiple_files: boolean; + /** @deprecated */ + java_generate_equals_and_hash: boolean; + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + go_package: string; + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + deprecated: boolean; + cc_enable_arenas: boolean; + objc_class_prefix: string; + csharp_namespace: string; + swift_prefix: string; + php_class_prefix: string; + php_namespace: string; + php_metadata_namespace: string; + ruby_package: string; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +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; + /** 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; + /** 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 MessageOptionsSDKType { + message_set_wire_format: boolean; + no_standard_descriptor_accessor: boolean; + deprecated: boolean; + map_entry: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + 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. + */ + 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 implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + 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; + /** 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 { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + 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. + */ + 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 implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + 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; + /** 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 FieldOptionsSDKType { + ctype: FieldOptions_CType; + packed: boolean; + jstype: FieldOptions_JSType; + lazy: boolean; + deprecated: boolean; + weak: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface OneofOptions { + /** 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 { + /** 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 OneofOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +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; + /** 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; + /** 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 EnumOptionsSDKType { + allow_alias: boolean; + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +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; + /** 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; + /** 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 EnumValueOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface ServiceOptions { + /** + * 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 { + /** + * 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 ServiceOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +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; + /** 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; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface MethodOptionsAminoMsg { + type: "/google.protobuf.MethodOptions"; + value: MethodOptionsAmino; +} +export interface MethodOptionsSDKType { + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** + * 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: Long; + negativeIntValue: Long; + 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: Uint8Array; + aggregate_value: string; +} +export interface UninterpretedOptionAminoMsg { + type: "/google.protobuf.UninterpretedOption"; + value: UninterpretedOptionAmino; +} +/** + * 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 UninterpretedOptionSDKType { + name: UninterpretedOption_NamePartSDKType[]; + identifier_value: string; + positive_int_value: Long; + negative_int_value: Long; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} +/** + * 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartAmino { + name_part: string; + is_extension: boolean; +} +export interface UninterpretedOption_NamePartAminoMsg { + type: "/google.protobuf.NamePart"; + value: UninterpretedOption_NamePartAmino; +} +/** + * 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartSDKType { + name_part: string; + is_extension: boolean; +} +/** + * 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; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoSDKType { + location: SourceCodeInfo_LocationSDKType[]; +} +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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; +} +export interface SourceCodeInfo_LocationSDKType { + path: number[]; + span: number[]; + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} +/** + * 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; +} +/** + * 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 GeneratedCodeInfoSDKType { + annotation: GeneratedCodeInfo_AnnotationSDKType[]; +} +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 offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} +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 offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} +export interface GeneratedCodeInfo_AnnotationAminoMsg { + type: "/google.protobuf.Annotation"; + value: GeneratedCodeInfo_AnnotationAmino; +} +export interface GeneratedCodeInfo_AnnotationSDKType { + path: number[]; + source_file: string; + begin: number; + end: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/duration.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/duration.ts new file mode 100644 index 000000000..c23b319ca --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/duration.ts @@ -0,0 +1,211 @@ +import { Long } from "../../helpers"; +/** + * 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 (durations.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: Long; + /** + * 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 (durations.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; +} +/** + * 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 (durations.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 DurationSDKType { + seconds: Long; + nanos: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/empty.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/empty.ts new file mode 100644 index 000000000..a40ea656f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/empty.ts @@ -0,0 +1,44 @@ +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface Empty {} +export interface EmptyProtoMsg { + typeUrl: "/google.protobuf.Empty"; + value: Uint8Array; +} +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface EmptyAmino {} +export interface EmptyAminoMsg { + type: "/google.protobuf.Empty"; + value: EmptyAmino; +} +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface EmptySDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/timestamp.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/timestamp.ts new file mode 100644 index 000000000..377a754c9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/timestamp.ts @@ -0,0 +1,281 @@ +import { Long } from "../../helpers"; +/** + * 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 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) 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: Long; + /** + * 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 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export type TimestampAmino = string; +export interface TimestampAminoMsg { + type: "/google.protobuf.Timestamp"; + value: TimestampAmino; +} +/** + * 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 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface TimestampSDKType { + seconds: Long; + nanos: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/helpers.ts b/Crescent/crescent-starter/src/types/proto-interfaces/helpers.ts new file mode 100644 index 000000000..330c2ca7d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/helpers.ts @@ -0,0 +1,242 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@0.104.0 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + +import * as _m0 from "protobufjs/minimal"; +import Long from 'long'; + +// @ts-ignore +if (_m0.util.Long !== Long) { + _m0.util.Long = (Long as any); + + _m0.configure(); +} + +export { Long }; + +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 (Long.isLong(input)) { + return input.isZero() ? 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: Long; + /** + * 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: Long.fromNumber(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: Long; + limit: Long; + 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 | boolean | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : 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>, never>; + +export interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +}; + +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: Long; + /** + * 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 = t.seconds.toNumber() * 1000; + millis += t.nanos / 1000000; + return new Date(millis); +}; + +const fromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; +}; + +const timestampFromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + 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 Long.fromNumber(number); +} diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/genesis.ts new file mode 100644 index 000000000..294230177 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/genesis.ts @@ -0,0 +1,27 @@ +import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisState { + portId: string; + denomTraces: DenomTrace[]; + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisStateAmino { + port_id: string; + denom_traces: DenomTraceAmino[]; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisStateSDKType { + port_id: string; + denom_traces: DenomTraceSDKType[]; + params: ParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/transfer.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 000000000..f35c6ca62 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,96 @@ +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + baseDenom: string; +} +export interface DenomTraceProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.DenomTrace"; + value: Uint8Array; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceAmino { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + base_denom: string; +} +export interface DenomTraceAminoMsg { + type: "cosmos-sdk/DenomTrace"; + value: DenomTraceAmino; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceSDKType { + path: string; + base_denom: string; +} +/** + * 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; +} +/** + * 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 ParamsSDKType { + send_enabled: boolean; + receive_enabled: boolean; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 000000000..0fe0bb683 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,93 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { Long } from "../../../../helpers"; +/** + * 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 tokens to be transferred */ + 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 nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: Long; +} +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 tokens to be transferred */ + 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 nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeout_timestamp: string; +} +export interface MsgTransferAminoMsg { + type: "cosmos-sdk/MsgTransfer"; + value: MsgTransferAmino; +} +/** + * 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 MsgTransferSDKType { + source_port: string; + source_channel: string; + token: CoinSDKType; + sender: string; + receiver: string; + timeout_height: HeightSDKType; + timeout_timestamp: Long; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse {} +export interface MsgTransferResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; + value: Uint8Array; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino {} +export interface MsgTransferResponseAminoMsg { + type: "cosmos-sdk/MsgTransferResponse"; + value: MsgTransferResponseAmino; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v2/packet.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v2/packet.ts new file mode 100644 index 000000000..5112bbc2d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/applications/transfer/v2/packet.ts @@ -0,0 +1,49 @@ +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketData { + /** the token denomination to be transferred */ + denom: string; + /** the token amount to be transferred */ + amount: string; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; +} +export interface FungibleTokenPacketDataProtoMsg { + typeUrl: "/ibc.applications.transfer.v2.FungibleTokenPacketData"; + value: Uint8Array; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataAmino { + /** the token denomination to be transferred */ + denom: string; + /** the token amount to be transferred */ + amount: string; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; +} +export interface FungibleTokenPacketDataAminoMsg { + type: "cosmos-sdk/FungibleTokenPacketData"; + value: FungibleTokenPacketDataAmino; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataSDKType { + denom: string; + amount: string; + sender: string; + receiver: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts new file mode 100644 index 000000000..9d578b69f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts @@ -0,0 +1,86 @@ +import * as _91 from "./applications/transfer/v1/genesis"; +import * as _92 from "./applications/transfer/v1/transfer"; +import * as _93 from "./applications/transfer/v1/tx"; +import * as _94 from "./applications/transfer/v2/packet"; +import * as _95 from "./core/channel/v1/channel"; +import * as _96 from "./core/channel/v1/genesis"; +import * as _97 from "./core/channel/v1/tx"; +import * as _98 from "./core/client/v1/client"; +import * as _99 from "./core/client/v1/genesis"; +import * as _100 from "./core/client/v1/tx"; +import * as _101 from "./core/commitment/v1/commitment"; +import * as _102 from "./core/connection/v1/connection"; +import * as _103 from "./core/connection/v1/genesis"; +import * as _104 from "./core/connection/v1/tx"; +import * as _105 from "./core/types/v1/genesis"; +import * as _106 from "./lightclients/localhost/v1/localhost"; +import * as _107 from "./lightclients/solomachine/v1/solomachine"; +import * as _108 from "./lightclients/solomachine/v2/solomachine"; +import * as _109 from "./lightclients/tendermint/v1/tendermint"; +export namespace ibc { + export namespace applications { + export namespace transfer { + export const v1 = { + ..._91, + ..._92, + ..._93 + }; + export const v2 = { + ..._94 + }; + } + } + export namespace core { + export namespace channel { + export const v1 = { + ..._95, + ..._96, + ..._97 + }; + } + export namespace client { + export const v1 = { + ..._98, + ..._99, + ..._100 + }; + } + export namespace commitment { + export const v1 = { + ..._101 + }; + } + export namespace connection { + export const v1 = { + ..._102, + ..._103, + ..._104 + }; + } + export namespace types { + export const v1 = { + ..._105 + }; + } + } + export namespace lightclients { + export namespace localhost { + export const v1 = { + ..._106 + }; + } + export namespace solomachine { + export const v1 = { + ..._107 + }; + export const v2 = { + ..._108 + }; + } + export namespace tendermint { + export const v1 = { + ..._109 + }; + } + } +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/channel.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/channel.ts new file mode 100644 index 000000000..c60a8095e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/channel.ts @@ -0,0 +1,430 @@ +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Long } from "../../../../helpers"; +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN 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, + UNRECOGNIZED = -1, +} +export const StateSDKType = State; +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 -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.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 OrderSDKType = Order; +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; +} +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; +} +export interface ChannelAminoMsg { + type: "cosmos-sdk/Channel"; + value: ChannelAmino; +} +/** + * 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 ChannelSDKType { + state: State; + ordering: Order; + counterparty: CounterpartySDKType; + connection_hops: string[]; + version: string; +} +/** + * 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; +} +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; +} +export interface IdentifiedChannelAminoMsg { + type: "cosmos-sdk/IdentifiedChannel"; + value: IdentifiedChannelAmino; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelSDKType { + state: State; + ordering: Order; + counterparty: CounterpartySDKType; + connection_hops: string[]; + version: string; + port_id: string; + channel_id: string; +} +/** 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; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartySDKType { + port_id: string; + channel_id: string; +} +/** 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: Long; + /** 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: Long; +} +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: Uint8Array; + /** 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; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketSDKType { + sequence: Long; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: HeightSDKType; + timeout_timestamp: Long; +} +/** + * 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: Long; + /** 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: Uint8Array; +} +export interface PacketStateAminoMsg { + type: "cosmos-sdk/PacketState"; + value: PacketStateAmino; +} +/** + * 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 PacketStateSDKType { + port_id: string; + channel_id: string; + sequence: Long; + data: 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 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?: Uint8Array; + error?: string; +} +export interface AcknowledgementAminoMsg { + type: "cosmos-sdk/Acknowledgement"; + value: AcknowledgementAmino; +} +/** + * 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 AcknowledgementSDKType { + result?: Uint8Array; + error?: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/genesis.ts new file mode 100644 index 000000000..a7cd2f91b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/genesis.ts @@ -0,0 +1,80 @@ +import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { Long } from "../../../../helpers"; +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisState { + channels: IdentifiedChannel[]; + acknowledgements: PacketState[]; + commitments: PacketState[]; + receipts: PacketState[]; + sendSequences: PacketSequence[]; + recvSequences: PacketSequence[]; + ackSequences: PacketSequence[]; + /** the sequence for the next generated channel identifier */ + nextChannelSequence: Long; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisStateAmino { + channels: IdentifiedChannelAmino[]; + acknowledgements: PacketStateAmino[]; + commitments: PacketStateAmino[]; + receipts: PacketStateAmino[]; + send_sequences: PacketSequenceAmino[]; + recv_sequences: PacketSequenceAmino[]; + ack_sequences: PacketSequenceAmino[]; + /** the sequence for the next generated channel identifier */ + next_channel_sequence: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisStateSDKType { + channels: IdentifiedChannelSDKType[]; + acknowledgements: PacketStateSDKType[]; + commitments: PacketStateSDKType[]; + receipts: PacketStateSDKType[]; + send_sequences: PacketSequenceSDKType[]; + recv_sequences: PacketSequenceSDKType[]; + ack_sequences: PacketSequenceSDKType[]; + next_channel_sequence: Long; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequence { + portId: string; + channelId: string; + sequence: Long; +} +export interface PacketSequenceProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketSequence"; + value: Uint8Array; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequenceAmino { + port_id: string; + channel_id: string; + sequence: string; +} +export interface PacketSequenceAminoMsg { + type: "cosmos-sdk/PacketSequence"; + value: PacketSequenceAmino; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequenceSDKType { + port_id: string; + channel_id: string; + sequence: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/tx.ts new file mode 100644 index 000000000..0b3e000fd --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/channel/v1/tx.ts @@ -0,0 +1,543 @@ +import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType } from "./channel"; +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Long } from "../../../../helpers"; +/** + * 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; +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitSDKType { + port_id: string; + channel: ChannelSDKType; + signer: string; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse {} +export interface MsgChannelOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; + value: Uint8Array; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseAmino {} +export interface MsgChannelOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInitResponse"; + value: MsgChannelOpenInitResponseAmino; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseSDKType {} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTry { + portId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the channel identifier of the previous channel in state INIT + */ + previousChannelId: string; + 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. + */ +export interface MsgChannelOpenTryAmino { + port_id: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the channel identifier of the previous channel in state INIT + */ + previous_channel_id: string; + channel?: ChannelAmino; + counterparty_version: string; + proof_init: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgChannelOpenTryAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTry"; + value: MsgChannelOpenTryAmino; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTrySDKType { + port_id: string; + previous_channel_id: string; + channel: ChannelSDKType; + counterparty_version: string; + proof_init: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse {} +export interface MsgChannelOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; + value: Uint8Array; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseAmino {} +export interface MsgChannelOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTryResponse"; + value: MsgChannelOpenTryResponseAmino; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseSDKType {} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +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. + */ +export interface MsgChannelOpenAckAmino { + port_id: string; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgChannelOpenAckAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAck"; + value: MsgChannelOpenAckAmino; +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAckSDKType { + port_id: string; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** 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; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseSDKType {} +/** + * 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: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgChannelOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirm"; + value: MsgChannelOpenConfirmAmino; +} +/** + * 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 MsgChannelOpenConfirmSDKType { + port_id: string; + channel_id: string; + proof_ack: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * 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; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseSDKType {} +/** + * 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; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitSDKType { + port_id: string; + channel_id: string; + signer: string; +} +/** 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; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseSDKType {} +/** + * 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; +} +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: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgChannelCloseConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirm"; + value: MsgChannelCloseConfirmAmino; +} +/** + * 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 MsgChannelCloseConfirmSDKType { + port_id: string; + channel_id: string; + proof_init: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * 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; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseSDKType {} +/** 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: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgRecvPacketAminoMsg { + type: "cosmos-sdk/MsgRecvPacket"; + value: MsgRecvPacketAmino; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketSDKType { + packet: PacketSDKType; + proof_commitment: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse {} +export interface MsgRecvPacketResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; + value: Uint8Array; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseAmino {} +export interface MsgRecvPacketResponseAminoMsg { + type: "cosmos-sdk/MsgRecvPacketResponse"; + value: MsgRecvPacketResponseAmino; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseSDKType {} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet; + proofUnreceived: Uint8Array; + proofHeight: Height; + nextSequenceRecv: Long; + 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: Uint8Array; + proof_height?: HeightAmino; + next_sequence_recv: string; + signer: string; +} +export interface MsgTimeoutAminoMsg { + type: "cosmos-sdk/MsgTimeout"; + value: MsgTimeoutAmino; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutSDKType { + packet: PacketSDKType; + proof_unreceived: Uint8Array; + proof_height: HeightSDKType; + next_sequence_recv: Long; + signer: string; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse {} +export interface MsgTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; + value: Uint8Array; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseAmino {} +export interface MsgTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutResponse"; + value: MsgTimeoutResponseAmino; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseSDKType {} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight: Height; + nextSequenceRecv: Long; + signer: string; +} +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: Uint8Array; + proof_close: Uint8Array; + proof_height?: HeightAmino; + next_sequence_recv: string; + signer: string; +} +export interface MsgTimeoutOnCloseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnClose"; + value: MsgTimeoutOnCloseAmino; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseSDKType { + packet: PacketSDKType; + proof_unreceived: Uint8Array; + proof_close: Uint8Array; + proof_height: HeightSDKType; + next_sequence_recv: Long; + signer: string; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse {} +export interface MsgTimeoutOnCloseResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; + value: Uint8Array; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseAmino {} +export interface MsgTimeoutOnCloseResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; + value: MsgTimeoutOnCloseResponseAmino; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseSDKType {} +/** 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: Uint8Array; + proof_acked: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgAcknowledgementAminoMsg { + type: "cosmos-sdk/MsgAcknowledgement"; + value: MsgAcknowledgementAmino; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementSDKType { + packet: PacketSDKType; + acknowledgement: Uint8Array; + proof_acked: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse {} +export interface MsgAcknowledgementResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseAmino {} +export interface MsgAcknowledgementResponseAminoMsg { + type: "cosmos-sdk/MsgAcknowledgementResponse"; + value: MsgAcknowledgementResponseAmino; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/client.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/client.ts new file mode 100644 index 000000000..ad45b8c3b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/client.ts @@ -0,0 +1,305 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Long } from "../../../../helpers"; +/** + * 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; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateSDKType { + client_id: string; + client_state: AnySDKType; +} +/** + * 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; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightSDKType { + height: HeightSDKType; + consensus_state: AnySDKType; +} +/** + * 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; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesSDKType { + client_id: string; + consensus_states: ConsensusStateWithHeightSDKType[]; +} +/** + * ClientUpdateProposal is a 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). + */ +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 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). + */ +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; +} +/** + * ClientUpdateProposal is a 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). + */ +export interface ClientUpdateProposalSDKType { + title: string; + description: string; + subject_client_id: string; + substitute_client_id: string; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +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. + */ +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; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposalSDKType { + title: string; + description: string; + plan: PlanSDKType; + upgraded_client_state: AnySDKType; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: Long; + /** the height within the given revision */ + revisionHeight: Long; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number: string; + /** the height within the given revision */ + revision_height: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: Long; + revision_height: Long; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** allowed_clients defines the list of allowed client state types. */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** allowed_clients defines the list of allowed client state types. */ + allowed_clients: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/genesis.ts new file mode 100644 index 000000000..527bbc841 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/genesis.ts @@ -0,0 +1,115 @@ +import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { Long } from "../../../../helpers"; +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisState { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientState[]; + /** consensus states from each client */ + clientsConsensus: ClientConsensusStates[]; + /** metadata from each client */ + clientsMetadata: IdentifiedGenesisMetadata[]; + params: Params; + /** create localhost on initialization */ + createLocalhost: boolean; + /** the sequence for the next generated client identifier */ + nextClientSequence: Long; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateAmino { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientStateAmino[]; + /** consensus states from each client */ + clients_consensus: ClientConsensusStatesAmino[]; + /** metadata from each client */ + clients_metadata: IdentifiedGenesisMetadataAmino[]; + params?: ParamsAmino; + /** create localhost on initialization */ + create_localhost: boolean; + /** the sequence for the next generated client identifier */ + next_client_sequence: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateSDKType { + clients: IdentifiedClientStateSDKType[]; + clients_consensus: ClientConsensusStatesSDKType[]; + clients_metadata: IdentifiedGenesisMetadataSDKType[]; + params: ParamsSDKType; + create_localhost: boolean; + next_client_sequence: Long; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadata { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} +export interface GenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisMetadata"; + value: Uint8Array; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataAmino { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} +export interface GenesisMetadataAminoMsg { + type: "cosmos-sdk/GenesisMetadata"; + value: GenesisMetadataAmino; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataSDKType { + key: Uint8Array; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadata { + clientId: string; + clientMetadata: GenesisMetadata[]; +} +export interface IdentifiedGenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata"; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataAmino { + client_id: string; + client_metadata: GenesisMetadataAmino[]; +} +export interface IdentifiedGenesisMetadataAminoMsg { + type: "cosmos-sdk/IdentifiedGenesisMetadata"; + value: IdentifiedGenesisMetadataAmino; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataSDKType { + client_id: string; + client_metadata: GenesisMetadataSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/tx.ts new file mode 100644 index 000000000..a4659ae2b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/client/v1/tx.ts @@ -0,0 +1,248 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +/** 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; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientSDKType { + client_state: AnySDKType; + consensus_state: AnySDKType; + signer: string; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse {} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; + value: Uint8Array; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino {} +export interface MsgCreateClientResponseAminoMsg { + type: "cosmos-sdk/MsgCreateClientResponse"; + value: MsgCreateClientResponseAmino; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseSDKType {} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** header to update the light client */ + header: 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 header. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id: string; + /** header to update the light client */ + header?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientAminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: MsgUpdateClientAmino; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClientSDKType { + client_id: string; + header: AnySDKType; + signer: string; +} +/** 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; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseSDKType {} +/** + * 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: Uint8Array; + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state: Uint8Array; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientAminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: MsgUpgradeClientAmino; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientSDKType { + client_id: string; + client_state: AnySDKType; + consensus_state: AnySDKType; + proof_upgrade_client: Uint8Array; + proof_upgrade_consensus_state: Uint8Array; + signer: string; +} +/** 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; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseSDKType {} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +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. + */ +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; +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +export interface MsgSubmitMisbehaviourSDKType { + client_id: string; + misbehaviour: AnySDKType; + signer: string; +} +/** + * 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; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/commitment/v1/commitment.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 000000000..e757f68fd --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,132 @@ +import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../confio/proofs"; +/** + * 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: Uint8Array; +} +export interface MerkleRootAminoMsg { + type: "cosmos-sdk/MerkleRoot"; + value: MerkleRootAmino; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootSDKType { + hash: 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 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: Uint8Array; +} +export interface MerklePrefixAminoMsg { + type: "cosmos-sdk/MerklePrefix"; + value: MerklePrefixAmino; +} +/** + * 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 MerklePrefixSDKType { + key_prefix: 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 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; +} +/** + * 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 MerklePathSDKType { + key_path: string[]; +} +/** + * 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; +} +/** + * 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 MerkleProofSDKType { + proofs: CommitmentProofSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/connection.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/connection.ts new file mode 100644 index 000000000..32000cc68 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/connection.ts @@ -0,0 +1,349 @@ +import { MerklePrefix, MerklePrefixAmino, MerklePrefixSDKType } from "../../commitment/v1/commitment"; +import { Long } from "../../../../helpers"; +/** + * 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 StateSDKType = State; +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: Long; +} +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; +} +/** + * 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 ConnectionEndSDKType { + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType; + delay_period: Long; +} +/** + * 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: Long; +} +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; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionSDKType { + id: string; + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType; + delay_period: Long; +} +/** 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; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartySDKType { + client_id: string; + connection_id: string; + prefix: MerklePrefixSDKType; +} +/** 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; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsSDKType { + paths: string[]; +} +/** 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; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsSDKType { + client_id: string; + paths: string[]; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison 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 verison 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; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface VersionSDKType { + identifier: string; + features: string[]; +} +/** 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: Long; +} +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; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsSDKType { + max_expected_time_per_block: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/genesis.ts new file mode 100644 index 000000000..c91f2fab2 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/genesis.ts @@ -0,0 +1,33 @@ +import { IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType, ConnectionPaths, ConnectionPathsAmino, ConnectionPathsSDKType, Params, ParamsAmino, ParamsSDKType } from "./connection"; +import { Long } from "../../../../helpers"; +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisState { + connections: IdentifiedConnection[]; + clientConnectionPaths: ConnectionPaths[]; + /** the sequence for the next generated connection identifier */ + nextConnectionSequence: Long; + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.connection.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateAmino { + connections: IdentifiedConnectionAmino[]; + client_connection_paths: ConnectionPathsAmino[]; + /** the sequence for the next generated connection identifier */ + next_connection_sequence: string; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateSDKType { + connections: IdentifiedConnectionSDKType[]; + client_connection_paths: ConnectionPathsSDKType[]; + next_connection_sequence: Long; + params: ParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/tx.ts new file mode 100644 index 000000000..3a18a15b1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/connection/v1/tx.ts @@ -0,0 +1,309 @@ +import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Long } from "../../../../helpers"; +/** + * 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: Long; + 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; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitSDKType { + client_id: string; + counterparty: CounterpartySDKType; + version: VersionSDKType; + delay_period: Long; + signer: string; +} +/** + * 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; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseSDKType {} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the connection identifier of the previous connection in state INIT + */ + previousConnectionId: string; + clientState: Any; + counterparty: Counterparty; + delayPeriod: Long; + counterpartyVersions: Version[]; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height; + signer: string; +} +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; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the connection identifier of the previous connection in state INIT + */ + previous_connection_id: string; + client_state?: AnyAmino; + counterparty?: CounterpartyAmino; + delay_period: string; + counterparty_versions: VersionAmino[]; + proof_height?: HeightAmino; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proof_init: Uint8Array; + /** proof of client state included in message */ + proof_client: Uint8Array; + /** proof of client consensus state */ + proof_consensus: Uint8Array; + consensus_height?: HeightAmino; + signer: string; +} +export interface MsgConnectionOpenTryAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: MsgConnectionOpenTryAmino; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTrySDKType { + client_id: string; + previous_connection_id: string; + client_state: AnySDKType; + counterparty: CounterpartySDKType; + delay_period: Long; + counterparty_versions: VersionSDKType[]; + proof_height: HeightSDKType; + proof_init: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType; + signer: string; +} +/** 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; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseSDKType {} +/** + * 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; + clientState: Any; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height; + signer: string; +} +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; + client_state?: AnyAmino; + proof_height?: HeightAmino; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proof_try: Uint8Array; + /** proof of client state included in message */ + proof_client: Uint8Array; + /** proof of client consensus state */ + proof_consensus: Uint8Array; + consensus_height?: HeightAmino; + signer: string; +} +export interface MsgConnectionOpenAckAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: MsgConnectionOpenAckAmino; +} +/** + * 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 MsgConnectionOpenAckSDKType { + connection_id: string; + counterparty_connection_id: string; + version: VersionSDKType; + client_state: AnySDKType; + proof_height: HeightSDKType; + proof_try: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType; + signer: string; +} +/** 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; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseSDKType {} +/** + * 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: Uint8Array; + proof_height?: HeightAmino; + signer: string; +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: MsgConnectionOpenConfirmAmino; +} +/** + * 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 MsgConnectionOpenConfirmSDKType { + connection_id: string; + proof_ack: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * 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; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/types/v1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/types/v1/genesis.ts new file mode 100644 index 000000000..1256ae0aa --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/core/types/v1/genesis.ts @@ -0,0 +1,41 @@ +import { GenesisState as GenesisState1 } from "../../client/v1/genesis"; +import { GenesisStateAmino as GenesisState1Amino } from "../../client/v1/genesis"; +import { GenesisStateSDKType as GenesisState1SDKType } from "../../client/v1/genesis"; +import { GenesisState as GenesisState2 } from "../../connection/v1/genesis"; +import { GenesisStateAmino as GenesisState2Amino } from "../../connection/v1/genesis"; +import { GenesisStateSDKType as GenesisState2SDKType } from "../../connection/v1/genesis"; +import { GenesisState as GenesisState3 } from "../../channel/v1/genesis"; +import { GenesisStateAmino as GenesisState3Amino } from "../../channel/v1/genesis"; +import { GenesisStateSDKType as GenesisState3SDKType } from "../../channel/v1/genesis"; +/** GenesisState defines the ibc module's genesis state. */ +export interface GenesisState { + /** ICS002 - Clients genesis state */ + clientGenesis: GenesisState1; + /** ICS003 - Connections genesis state */ + connectionGenesis: GenesisState2; + /** ICS004 - Channel genesis state */ + channelGenesis: GenesisState3; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.types.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc module's genesis state. */ +export interface GenesisStateAmino { + /** ICS002 - Clients genesis state */ + client_genesis?: GenesisState1Amino; + /** ICS003 - Connections genesis state */ + connection_genesis?: GenesisState2Amino; + /** ICS004 - Channel genesis state */ + channel_genesis?: GenesisState3Amino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc module's genesis state. */ +export interface GenesisStateSDKType { + client_genesis: GenesisState1SDKType; + connection_genesis: GenesisState2SDKType; + channel_genesis: GenesisState3SDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/localhost/v1/localhost.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/localhost/v1/localhost.ts new file mode 100644 index 000000000..465727fd8 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/localhost/v1/localhost.ts @@ -0,0 +1,37 @@ +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientState { + /** self chain ID */ + chainId: string; + /** self latest block height */ + height: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.localhost.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientStateAmino { + /** self chain ID */ + chain_id: string; + /** self latest block height */ + height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientStateSDKType { + chain_id: string; + height: HeightSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v1/solomachine.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v1/solomachine.ts new file mode 100644 index 000000000..b2f167378 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v1/solomachine.ts @@ -0,0 +1,647 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; +import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; +import { Long } from "../../../../helpers"; +/** + * DataType defines the type of solo machine proof being created. This is done + * to preserve uniqueness of different data sign byte encodings. + */ +export enum DataType { + /** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */ + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, + /** DATA_TYPE_CLIENT_STATE - Data type for client state verification */ + DATA_TYPE_CLIENT_STATE = 1, + /** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */ + DATA_TYPE_CONSENSUS_STATE = 2, + /** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */ + DATA_TYPE_CONNECTION_STATE = 3, + /** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */ + DATA_TYPE_CHANNEL_STATE = 4, + /** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */ + DATA_TYPE_PACKET_COMMITMENT = 5, + /** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */ + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, + /** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */ + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, + /** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */ + DATA_TYPE_NEXT_SEQUENCE_RECV = 8, + /** DATA_TYPE_HEADER - Data type for header verification */ + DATA_TYPE_HEADER = 9, + UNRECOGNIZED = -1, +} +export const DataTypeSDKType = DataType; +export const DataTypeAmino = DataType; +export function dataTypeFromJSON(object: any): DataType { + switch (object) { + case 0: + case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": + return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "DATA_TYPE_CLIENT_STATE": + return DataType.DATA_TYPE_CLIENT_STATE; + case 2: + case "DATA_TYPE_CONSENSUS_STATE": + return DataType.DATA_TYPE_CONSENSUS_STATE; + case 3: + case "DATA_TYPE_CONNECTION_STATE": + return DataType.DATA_TYPE_CONNECTION_STATE; + case 4: + case "DATA_TYPE_CHANNEL_STATE": + return DataType.DATA_TYPE_CHANNEL_STATE; + case 5: + case "DATA_TYPE_PACKET_COMMITMENT": + return DataType.DATA_TYPE_PACKET_COMMITMENT; + case 6: + case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": + return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT; + case 7: + case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": + return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE; + case 8: + case "DATA_TYPE_NEXT_SEQUENCE_RECV": + return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV; + case 9: + case "DATA_TYPE_HEADER": + return DataType.DATA_TYPE_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return DataType.UNRECOGNIZED; + } +} +export function dataTypeToJSON(object: DataType): string { + switch (object) { + case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED: + return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"; + case DataType.DATA_TYPE_CLIENT_STATE: + return "DATA_TYPE_CLIENT_STATE"; + case DataType.DATA_TYPE_CONSENSUS_STATE: + return "DATA_TYPE_CONSENSUS_STATE"; + case DataType.DATA_TYPE_CONNECTION_STATE: + return "DATA_TYPE_CONNECTION_STATE"; + case DataType.DATA_TYPE_CHANNEL_STATE: + return "DATA_TYPE_CHANNEL_STATE"; + case DataType.DATA_TYPE_PACKET_COMMITMENT: + return "DATA_TYPE_PACKET_COMMITMENT"; + case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT: + return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"; + case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE: + return "DATA_TYPE_PACKET_RECEIPT_ABSENCE"; + case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV: + return "DATA_TYPE_NEXT_SEQUENCE_RECV"; + case DataType.DATA_TYPE_HEADER: + return "DATA_TYPE_HEADER"; + case DataType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: Long; + /** frozen sequence of the solo machine */ + frozenSequence: Long; + consensusState: ConsensusState; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allowUpdateAfterProposal: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateAmino { + /** latest sequence of the client state */ + sequence: string; + /** frozen sequence of the solo machine */ + frozen_sequence: string; + consensus_state?: ConsensusStateAmino; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allow_update_after_proposal: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateSDKType { + sequence: Long; + frozen_sequence: Long; + consensus_state: ConsensusStateSDKType; + allow_update_after_proposal: boolean; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey: Any; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: Long; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState"; + value: Uint8Array; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateAmino { + /** public key of the solo machine */ + public_key?: AnyAmino; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateSDKType { + public_key: AnySDKType; + diversifier: string; + timestamp: Long; +} +/** Header defines a solo machine consensus header */ +export interface Header { + /** sequence to update solo machine public key at */ + sequence: Long; + timestamp: Long; + signature: Uint8Array; + newPublicKey: Any; + newDiversifier: string; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.Header"; + value: Uint8Array; +} +/** Header defines a solo machine consensus header */ +export interface HeaderAmino { + /** sequence to update solo machine public key at */ + sequence: string; + timestamp: string; + signature: Uint8Array; + new_public_key?: AnyAmino; + new_diversifier: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines a solo machine consensus header */ +export interface HeaderSDKType { + sequence: Long; + timestamp: Long; + signature: Uint8Array; + new_public_key: AnySDKType; + new_diversifier: string; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + clientId: string; + sequence: Long; + signatureOne: SignatureAndData; + signatureTwo: SignatureAndData; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourAmino { + client_id: string; + sequence: string; + signature_one?: SignatureAndDataAmino; + signature_two?: SignatureAndDataAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourSDKType { + client_id: string; + sequence: Long; + signature_one: SignatureAndDataSDKType; + signature_two: SignatureAndDataSDKType; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + dataType: DataType; + data: Uint8Array; + timestamp: Long; +} +export interface SignatureAndDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.SignatureAndData"; + value: Uint8Array; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataAmino { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: string; +} +export interface SignatureAndDataAminoMsg { + type: "cosmos-sdk/SignatureAndData"; + value: SignatureAndDataAmino; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataSDKType { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: Long; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: Long; +} +export interface TimestampedSignatureDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.TimestampedSignatureData"; + value: Uint8Array; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataAmino { + signature_data: Uint8Array; + timestamp: string; +} +export interface TimestampedSignatureDataAminoMsg { + type: "cosmos-sdk/TimestampedSignatureData"; + value: TimestampedSignatureDataAmino; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataSDKType { + signature_data: Uint8Array; + timestamp: Long; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + sequence: Long; + timestamp: Long; + diversifier: string; + /** type of the data used */ + dataType: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.SignBytes"; + value: Uint8Array; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesAmino { + sequence: string; + timestamp: string; + diversifier: string; + /** type of the data used */ + data_type: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesAminoMsg { + type: "cosmos-sdk/SignBytes"; + value: SignBytesAmino; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesSDKType { + sequence: Long; + timestamp: Long; + diversifier: string; + data_type: DataType; + data: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey: Any; + /** header diversifier */ + newDiversifier: string; +} +export interface HeaderDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.HeaderData"; + value: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataAmino { + /** header public key */ + new_pub_key?: AnyAmino; + /** header diversifier */ + new_diversifier: string; +} +export interface HeaderDataAminoMsg { + type: "cosmos-sdk/HeaderData"; + value: HeaderDataAmino; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataSDKType { + new_pub_key: AnySDKType; + new_diversifier: string; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateData { + path: Uint8Array; + clientState: Any; +} +export interface ClientStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientStateData"; + value: Uint8Array; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataAmino { + path: Uint8Array; + client_state?: AnyAmino; +} +export interface ClientStateDataAminoMsg { + type: "cosmos-sdk/ClientStateData"; + value: ClientStateDataAmino; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataSDKType { + path: Uint8Array; + client_state: AnySDKType; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateData { + path: Uint8Array; + consensusState: Any; +} +export interface ConsensusStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusStateData"; + value: Uint8Array; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataAmino { + path: Uint8Array; + consensus_state?: AnyAmino; +} +export interface ConsensusStateDataAminoMsg { + type: "cosmos-sdk/ConsensusStateData"; + value: ConsensusStateDataAmino; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataSDKType { + path: Uint8Array; + consensus_state: AnySDKType; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateData { + path: Uint8Array; + connection: ConnectionEnd; +} +export interface ConnectionStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConnectionStateData"; + value: Uint8Array; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataAmino { + path: Uint8Array; + connection?: ConnectionEndAmino; +} +export interface ConnectionStateDataAminoMsg { + type: "cosmos-sdk/ConnectionStateData"; + value: ConnectionStateDataAmino; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataSDKType { + path: Uint8Array; + connection: ConnectionEndSDKType; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateData { + path: Uint8Array; + channel: Channel; +} +export interface ChannelStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ChannelStateData"; + value: Uint8Array; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataAmino { + path: Uint8Array; + channel?: ChannelAmino; +} +export interface ChannelStateDataAminoMsg { + type: "cosmos-sdk/ChannelStateData"; + value: ChannelStateDataAmino; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataSDKType { + path: Uint8Array; + channel: ChannelSDKType; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentData { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketCommitmentData"; + value: Uint8Array; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataAmino { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataAminoMsg { + type: "cosmos-sdk/PacketCommitmentData"; + value: PacketCommitmentDataAmino; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataSDKType { + path: Uint8Array; + commitment: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementData { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData"; + value: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataAmino { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataAminoMsg { + type: "cosmos-sdk/PacketAcknowledgementData"; + value: PacketAcknowledgementDataAmino; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataSDKType { + path: Uint8Array; + acknowledgement: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceData { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData"; + value: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataAmino { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataAminoMsg { + type: "cosmos-sdk/PacketReceiptAbsenceData"; + value: PacketReceiptAbsenceDataAmino; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataSDKType { + path: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvData { + path: Uint8Array; + nextSeqRecv: Long; +} +export interface NextSequenceRecvDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.NextSequenceRecvData"; + value: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataAmino { + path: Uint8Array; + next_seq_recv: string; +} +export interface NextSequenceRecvDataAminoMsg { + type: "cosmos-sdk/NextSequenceRecvData"; + value: NextSequenceRecvDataAmino; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataSDKType { + path: Uint8Array; + next_seq_recv: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v2/solomachine.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v2/solomachine.ts new file mode 100644 index 000000000..ca76f30f9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/solomachine/v2/solomachine.ts @@ -0,0 +1,647 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; +import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; +import { Long } from "../../../../helpers"; +/** + * DataType defines the type of solo machine proof being created. This is done + * to preserve uniqueness of different data sign byte encodings. + */ +export enum DataType { + /** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */ + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, + /** DATA_TYPE_CLIENT_STATE - Data type for client state verification */ + DATA_TYPE_CLIENT_STATE = 1, + /** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */ + DATA_TYPE_CONSENSUS_STATE = 2, + /** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */ + DATA_TYPE_CONNECTION_STATE = 3, + /** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */ + DATA_TYPE_CHANNEL_STATE = 4, + /** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */ + DATA_TYPE_PACKET_COMMITMENT = 5, + /** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */ + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, + /** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */ + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, + /** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */ + DATA_TYPE_NEXT_SEQUENCE_RECV = 8, + /** DATA_TYPE_HEADER - Data type for header verification */ + DATA_TYPE_HEADER = 9, + UNRECOGNIZED = -1, +} +export const DataTypeSDKType = DataType; +export const DataTypeAmino = DataType; +export function dataTypeFromJSON(object: any): DataType { + switch (object) { + case 0: + case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": + return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "DATA_TYPE_CLIENT_STATE": + return DataType.DATA_TYPE_CLIENT_STATE; + case 2: + case "DATA_TYPE_CONSENSUS_STATE": + return DataType.DATA_TYPE_CONSENSUS_STATE; + case 3: + case "DATA_TYPE_CONNECTION_STATE": + return DataType.DATA_TYPE_CONNECTION_STATE; + case 4: + case "DATA_TYPE_CHANNEL_STATE": + return DataType.DATA_TYPE_CHANNEL_STATE; + case 5: + case "DATA_TYPE_PACKET_COMMITMENT": + return DataType.DATA_TYPE_PACKET_COMMITMENT; + case 6: + case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": + return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT; + case 7: + case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": + return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE; + case 8: + case "DATA_TYPE_NEXT_SEQUENCE_RECV": + return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV; + case 9: + case "DATA_TYPE_HEADER": + return DataType.DATA_TYPE_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return DataType.UNRECOGNIZED; + } +} +export function dataTypeToJSON(object: DataType): string { + switch (object) { + case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED: + return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"; + case DataType.DATA_TYPE_CLIENT_STATE: + return "DATA_TYPE_CLIENT_STATE"; + case DataType.DATA_TYPE_CONSENSUS_STATE: + return "DATA_TYPE_CONSENSUS_STATE"; + case DataType.DATA_TYPE_CONNECTION_STATE: + return "DATA_TYPE_CONNECTION_STATE"; + case DataType.DATA_TYPE_CHANNEL_STATE: + return "DATA_TYPE_CHANNEL_STATE"; + case DataType.DATA_TYPE_PACKET_COMMITMENT: + return "DATA_TYPE_PACKET_COMMITMENT"; + case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT: + return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"; + case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE: + return "DATA_TYPE_PACKET_RECEIPT_ABSENCE"; + case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV: + return "DATA_TYPE_NEXT_SEQUENCE_RECV"; + case DataType.DATA_TYPE_HEADER: + return "DATA_TYPE_HEADER"; + case DataType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: Long; + /** frozen sequence of the solo machine */ + isFrozen: boolean; + consensusState: ConsensusState; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allowUpdateAfterProposal: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateAmino { + /** latest sequence of the client state */ + sequence: string; + /** frozen sequence of the solo machine */ + is_frozen: boolean; + consensus_state?: ConsensusStateAmino; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allow_update_after_proposal: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateSDKType { + sequence: Long; + is_frozen: boolean; + consensus_state: ConsensusStateSDKType; + allow_update_after_proposal: boolean; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey: Any; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: Long; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusState"; + value: Uint8Array; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateAmino { + /** public key of the solo machine */ + public_key?: AnyAmino; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateSDKType { + public_key: AnySDKType; + diversifier: string; + timestamp: Long; +} +/** Header defines a solo machine consensus header */ +export interface Header { + /** sequence to update solo machine public key at */ + sequence: Long; + timestamp: Long; + signature: Uint8Array; + newPublicKey: Any; + newDiversifier: string; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.Header"; + value: Uint8Array; +} +/** Header defines a solo machine consensus header */ +export interface HeaderAmino { + /** sequence to update solo machine public key at */ + sequence: string; + timestamp: string; + signature: Uint8Array; + new_public_key?: AnyAmino; + new_diversifier: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines a solo machine consensus header */ +export interface HeaderSDKType { + sequence: Long; + timestamp: Long; + signature: Uint8Array; + new_public_key: AnySDKType; + new_diversifier: string; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + clientId: string; + sequence: Long; + signatureOne: SignatureAndData; + signatureTwo: SignatureAndData; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourAmino { + client_id: string; + sequence: string; + signature_one?: SignatureAndDataAmino; + signature_two?: SignatureAndDataAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourSDKType { + client_id: string; + sequence: Long; + signature_one: SignatureAndDataSDKType; + signature_two: SignatureAndDataSDKType; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + dataType: DataType; + data: Uint8Array; + timestamp: Long; +} +export interface SignatureAndDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.SignatureAndData"; + value: Uint8Array; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataAmino { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: string; +} +export interface SignatureAndDataAminoMsg { + type: "cosmos-sdk/SignatureAndData"; + value: SignatureAndDataAmino; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataSDKType { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: Long; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: Long; +} +export interface TimestampedSignatureDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.TimestampedSignatureData"; + value: Uint8Array; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataAmino { + signature_data: Uint8Array; + timestamp: string; +} +export interface TimestampedSignatureDataAminoMsg { + type: "cosmos-sdk/TimestampedSignatureData"; + value: TimestampedSignatureDataAmino; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataSDKType { + signature_data: Uint8Array; + timestamp: Long; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + sequence: Long; + timestamp: Long; + diversifier: string; + /** type of the data used */ + dataType: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.SignBytes"; + value: Uint8Array; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesAmino { + sequence: string; + timestamp: string; + diversifier: string; + /** type of the data used */ + data_type: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesAminoMsg { + type: "cosmos-sdk/SignBytes"; + value: SignBytesAmino; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesSDKType { + sequence: Long; + timestamp: Long; + diversifier: string; + data_type: DataType; + data: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey: Any; + /** header diversifier */ + newDiversifier: string; +} +export interface HeaderDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.HeaderData"; + value: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataAmino { + /** header public key */ + new_pub_key?: AnyAmino; + /** header diversifier */ + new_diversifier: string; +} +export interface HeaderDataAminoMsg { + type: "cosmos-sdk/HeaderData"; + value: HeaderDataAmino; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataSDKType { + new_pub_key: AnySDKType; + new_diversifier: string; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateData { + path: Uint8Array; + clientState: Any; +} +export interface ClientStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData"; + value: Uint8Array; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataAmino { + path: Uint8Array; + client_state?: AnyAmino; +} +export interface ClientStateDataAminoMsg { + type: "cosmos-sdk/ClientStateData"; + value: ClientStateDataAmino; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataSDKType { + path: Uint8Array; + client_state: AnySDKType; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateData { + path: Uint8Array; + consensusState: Any; +} +export interface ConsensusStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData"; + value: Uint8Array; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataAmino { + path: Uint8Array; + consensus_state?: AnyAmino; +} +export interface ConsensusStateDataAminoMsg { + type: "cosmos-sdk/ConsensusStateData"; + value: ConsensusStateDataAmino; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataSDKType { + path: Uint8Array; + consensus_state: AnySDKType; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateData { + path: Uint8Array; + connection: ConnectionEnd; +} +export interface ConnectionStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData"; + value: Uint8Array; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataAmino { + path: Uint8Array; + connection?: ConnectionEndAmino; +} +export interface ConnectionStateDataAminoMsg { + type: "cosmos-sdk/ConnectionStateData"; + value: ConnectionStateDataAmino; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataSDKType { + path: Uint8Array; + connection: ConnectionEndSDKType; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateData { + path: Uint8Array; + channel: Channel; +} +export interface ChannelStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData"; + value: Uint8Array; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataAmino { + path: Uint8Array; + channel?: ChannelAmino; +} +export interface ChannelStateDataAminoMsg { + type: "cosmos-sdk/ChannelStateData"; + value: ChannelStateDataAmino; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataSDKType { + path: Uint8Array; + channel: ChannelSDKType; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentData { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketCommitmentData"; + value: Uint8Array; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataAmino { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataAminoMsg { + type: "cosmos-sdk/PacketCommitmentData"; + value: PacketCommitmentDataAmino; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataSDKType { + path: Uint8Array; + commitment: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementData { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData"; + value: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataAmino { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataAminoMsg { + type: "cosmos-sdk/PacketAcknowledgementData"; + value: PacketAcknowledgementDataAmino; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataSDKType { + path: Uint8Array; + acknowledgement: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceData { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData"; + value: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataAmino { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataAminoMsg { + type: "cosmos-sdk/PacketReceiptAbsenceData"; + value: PacketReceiptAbsenceDataAmino; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataSDKType { + path: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvData { + path: Uint8Array; + nextSeqRecv: Long; +} +export interface NextSequenceRecvDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.NextSequenceRecvData"; + value: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataAmino { + path: Uint8Array; + next_seq_recv: string; +} +export interface NextSequenceRecvDataAminoMsg { + type: "cosmos-sdk/NextSequenceRecvData"; + value: NextSequenceRecvDataAmino; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataSDKType { + path: Uint8Array; + next_seq_recv: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/tendermint/v1/tendermint.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/tendermint/v1/tendermint.ts new file mode 100644 index 000000000..24e86f733 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/lightclients/tendermint/v1/tendermint.ts @@ -0,0 +1,289 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { ProofSpec, ProofSpecAmino, ProofSpecSDKType } from "../../../../confio/proofs"; +import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/commitment/v1/commitment"; +import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; +import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "../../../../tendermint/types/validator"; +import { Long } from "../../../../helpers"; +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientState { + chainId: string; + trustLevel: Fraction; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trustingPeriod: Duration; + /** duration of the staking unbonding period */ + unbondingPeriod: Duration; + /** defines how much new (untrusted) header's Time can drift into the future. */ + maxClockDrift: Duration; + /** Block height when the client was frozen due to a misbehaviour */ + frozenHeight: Height; + /** Latest height the client was updated to */ + latestHeight: Height; + /** Proof specifications used in verifying counterparty state */ + proofSpecs: ProofSpec[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgradePath: string[]; + /** + * This flag, when set to true, will allow governance to recover a client + * which has expired + */ + allowUpdateAfterExpiry: boolean; + /** + * This flag, when set to true, will allow governance to unfreeze a client + * whose chain has experienced a misbehaviour event + */ + allowUpdateAfterMisbehaviour: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateAmino { + chain_id: string; + trust_level?: FractionAmino; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trusting_period?: DurationAmino; + /** duration of the staking unbonding period */ + unbonding_period?: DurationAmino; + /** defines how much new (untrusted) header's Time can drift into the future. */ + max_clock_drift?: DurationAmino; + /** Block height when the client was frozen due to a misbehaviour */ + frozen_height?: HeightAmino; + /** Latest height the client was updated to */ + latest_height?: HeightAmino; + /** Proof specifications used in verifying counterparty state */ + proof_specs: ProofSpecAmino[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgrade_path: string[]; + /** + * This flag, when set to true, will allow governance to recover a client + * which has expired + */ + allow_update_after_expiry: boolean; + /** + * This flag, when set to true, will allow governance to unfreeze a client + * whose chain has experienced a misbehaviour event + */ + allow_update_after_misbehaviour: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateSDKType { + chain_id: string; + trust_level: FractionSDKType; + trusting_period: DurationSDKType; + unbonding_period: DurationSDKType; + max_clock_drift: DurationSDKType; + frozen_height: HeightSDKType; + latest_height: HeightSDKType; + proof_specs: ProofSpecSDKType[]; + upgrade_path: string[]; + allow_update_after_expiry: boolean; + allow_update_after_misbehaviour: boolean; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusState { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp: Date; + /** commitment root (i.e app hash) */ + root: MerkleRoot; + nextValidatorsHash: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState"; + value: Uint8Array; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateAmino { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp?: Date; + /** commitment root (i.e app hash) */ + root?: MerkleRootAmino; + next_validators_hash: Uint8Array; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateSDKType { + timestamp: Date; + root: MerkleRootSDKType; + next_validators_hash: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface Misbehaviour { + clientId: string; + header1: Header; + header2: Header; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourAmino { + client_id: string; + header_1?: HeaderAmino; + header_2?: HeaderAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourSDKType { + client_id: string; + header_1: HeaderSDKType; + header_2: HeaderSDKType; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface Header { + signedHeader: SignedHeader; + validatorSet: ValidatorSet; + trustedHeight: Height; + trustedValidators: ValidatorSet; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Header"; + value: Uint8Array; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderAmino { + signed_header?: SignedHeaderAmino; + validator_set?: ValidatorSetAmino; + trusted_height?: HeightAmino; + trusted_validators?: ValidatorSetAmino; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderSDKType { + signed_header: SignedHeaderSDKType; + validator_set: ValidatorSetSDKType; + trusted_height: HeightSDKType; + trusted_validators: ValidatorSetSDKType; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface Fraction { + numerator: Long; + denominator: Long; +} +export interface FractionProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction"; + value: Uint8Array; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionAmino { + numerator: string; + denominator: string; +} +export interface FractionAminoMsg { + type: "cosmos-sdk/Fraction"; + value: FractionAmino; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionSDKType { + numerator: Long; + denominator: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ics23/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ics23/bundle.ts new file mode 100644 index 000000000..30bc1c53e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ics23/bundle.ts @@ -0,0 +1,4 @@ +import * as _0 from "../confio/proofs"; +export const ics23 = { + ..._0 +}; \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/index.ts b/Crescent/crescent-starter/src/types/proto-interfaces/index.ts new file mode 100644 index 000000000..2a80bc607 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/index.ts @@ -0,0 +1,13 @@ +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@0.104.0 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +export * from "./ics23/bundle"; +export * from "./cosmos_proto/bundle"; +export * from "./cosmos/bundle"; +export * from "./cosmwasm/bundle"; +export * from "./google/bundle"; +export * from "./ibc/bundle"; +export * from "./tendermint/bundle"; \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/abci/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/abci/types.ts new file mode 100644 index 000000000..e74191556 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/abci/types.ts @@ -0,0 +1,1385 @@ +import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; +import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; +import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; +import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; +import { Long } from "../../helpers"; +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} +export const CheckTxTypeSDKType = CheckTxType; +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_ResultSDKType = ResponseOfferSnapshot_Result; +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_ResultSDKType = ResponseApplySnapshotChunk_Result; +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 EvidenceType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} +export const EvidenceTypeSDKType = EvidenceType; +export const EvidenceTypeAmino = EvidenceType; +export function evidenceTypeFromJSON(object: any): EvidenceType { + switch (object) { + case 0: + case "UNKNOWN": + return EvidenceType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return EvidenceType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return EvidenceType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return EvidenceType.UNRECOGNIZED; + } +} +export function evidenceTypeToJSON(object: EvidenceType): string { + switch (object) { + case EvidenceType.UNKNOWN: + return "UNKNOWN"; + case EvidenceType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case EvidenceType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + case EvidenceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Request { + echo?: RequestEcho; + flush?: RequestFlush; + info?: RequestInfo; + setOption?: RequestSetOption; + initChain?: RequestInitChain; + query?: RequestQuery; + beginBlock?: RequestBeginBlock; + checkTx?: RequestCheckTx; + deliverTx?: RequestDeliverTx; + endBlock?: RequestEndBlock; + commit?: RequestCommit; + listSnapshots?: RequestListSnapshots; + offerSnapshot?: RequestOfferSnapshot; + loadSnapshotChunk?: RequestLoadSnapshotChunk; + applySnapshotChunk?: RequestApplySnapshotChunk; +} +export interface RequestProtoMsg { + typeUrl: "/tendermint.abci.Request"; + value: Uint8Array; +} +export interface RequestAmino { + echo?: RequestEchoAmino; + flush?: RequestFlushAmino; + info?: RequestInfoAmino; + set_option?: RequestSetOptionAmino; + init_chain?: RequestInitChainAmino; + query?: RequestQueryAmino; + begin_block?: RequestBeginBlockAmino; + check_tx?: RequestCheckTxAmino; + deliver_tx?: RequestDeliverTxAmino; + end_block?: RequestEndBlockAmino; + commit?: RequestCommitAmino; + list_snapshots?: RequestListSnapshotsAmino; + offer_snapshot?: RequestOfferSnapshotAmino; + load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; + apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; +} +export interface RequestAminoMsg { + type: "/tendermint.abci.Request"; + value: RequestAmino; +} +export interface RequestSDKType { + echo?: RequestEchoSDKType; + flush?: RequestFlushSDKType; + info?: RequestInfoSDKType; + set_option?: RequestSetOptionSDKType; + init_chain?: RequestInitChainSDKType; + query?: RequestQuerySDKType; + begin_block?: RequestBeginBlockSDKType; + check_tx?: RequestCheckTxSDKType; + deliver_tx?: RequestDeliverTxSDKType; + end_block?: RequestEndBlockSDKType; + commit?: RequestCommitSDKType; + list_snapshots?: RequestListSnapshotsSDKType; + offer_snapshot?: RequestOfferSnapshotSDKType; + load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; + apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; +} +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 RequestEchoSDKType { + message: string; +} +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 RequestFlushSDKType {} +export interface RequestInfo { + version: string; + blockVersion: Long; + p2pVersion: Long; +} +export interface RequestInfoProtoMsg { + typeUrl: "/tendermint.abci.RequestInfo"; + value: Uint8Array; +} +export interface RequestInfoAmino { + version: string; + block_version: string; + p2p_version: string; +} +export interface RequestInfoAminoMsg { + type: "/tendermint.abci.RequestInfo"; + value: RequestInfoAmino; +} +export interface RequestInfoSDKType { + version: string; + block_version: Long; + p2p_version: Long; +} +/** nondeterministic */ +export interface RequestSetOption { + key: string; + value: string; +} +export interface RequestSetOptionProtoMsg { + typeUrl: "/tendermint.abci.RequestSetOption"; + value: Uint8Array; +} +/** nondeterministic */ +export interface RequestSetOptionAmino { + key: string; + value: string; +} +export interface RequestSetOptionAminoMsg { + type: "/tendermint.abci.RequestSetOption"; + value: RequestSetOptionAmino; +} +/** nondeterministic */ +export interface RequestSetOptionSDKType { + key: string; + value: string; +} +export interface RequestInitChain { + time: Date; + chainId: string; + consensusParams: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: Long; +} +export interface RequestInitChainProtoMsg { + typeUrl: "/tendermint.abci.RequestInitChain"; + value: Uint8Array; +} +export interface RequestInitChainAmino { + time?: Date; + chain_id: string; + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_state_bytes: Uint8Array; + initial_height: string; +} +export interface RequestInitChainAminoMsg { + type: "/tendermint.abci.RequestInitChain"; + value: RequestInitChainAmino; +} +export interface RequestInitChainSDKType { + time: Date; + chain_id: string; + consensus_params: ConsensusParamsSDKType; + validators: ValidatorUpdateSDKType[]; + app_state_bytes: Uint8Array; + initial_height: Long; +} +export interface RequestQuery { + data: Uint8Array; + path: string; + height: Long; + prove: boolean; +} +export interface RequestQueryProtoMsg { + typeUrl: "/tendermint.abci.RequestQuery"; + value: Uint8Array; +} +export interface RequestQueryAmino { + data: Uint8Array; + path: string; + height: string; + prove: boolean; +} +export interface RequestQueryAminoMsg { + type: "/tendermint.abci.RequestQuery"; + value: RequestQueryAmino; +} +export interface RequestQuerySDKType { + data: Uint8Array; + path: string; + height: Long; + prove: boolean; +} +export interface RequestBeginBlock { + hash: Uint8Array; + header: Header; + lastCommitInfo: LastCommitInfo; + byzantineValidators: Evidence[]; +} +export interface RequestBeginBlockProtoMsg { + typeUrl: "/tendermint.abci.RequestBeginBlock"; + value: Uint8Array; +} +export interface RequestBeginBlockAmino { + hash: Uint8Array; + header?: HeaderAmino; + last_commit_info?: LastCommitInfoAmino; + byzantine_validators: EvidenceAmino[]; +} +export interface RequestBeginBlockAminoMsg { + type: "/tendermint.abci.RequestBeginBlock"; + value: RequestBeginBlockAmino; +} +export interface RequestBeginBlockSDKType { + hash: Uint8Array; + header: HeaderSDKType; + last_commit_info: LastCommitInfoSDKType; + byzantine_validators: EvidenceSDKType[]; +} +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestCheckTxProtoMsg { + typeUrl: "/tendermint.abci.RequestCheckTx"; + value: Uint8Array; +} +export interface RequestCheckTxAmino { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestCheckTxAminoMsg { + type: "/tendermint.abci.RequestCheckTx"; + value: RequestCheckTxAmino; +} +export interface RequestCheckTxSDKType { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestDeliverTx { + tx: Uint8Array; +} +export interface RequestDeliverTxProtoMsg { + typeUrl: "/tendermint.abci.RequestDeliverTx"; + value: Uint8Array; +} +export interface RequestDeliverTxAmino { + tx: Uint8Array; +} +export interface RequestDeliverTxAminoMsg { + type: "/tendermint.abci.RequestDeliverTx"; + value: RequestDeliverTxAmino; +} +export interface RequestDeliverTxSDKType { + tx: Uint8Array; +} +export interface RequestEndBlock { + height: Long; +} +export interface RequestEndBlockProtoMsg { + typeUrl: "/tendermint.abci.RequestEndBlock"; + value: Uint8Array; +} +export interface RequestEndBlockAmino { + height: string; +} +export interface RequestEndBlockAminoMsg { + type: "/tendermint.abci.RequestEndBlock"; + value: RequestEndBlockAmino; +} +export interface RequestEndBlockSDKType { + height: Long; +} +export interface RequestCommit {} +export interface RequestCommitProtoMsg { + typeUrl: "/tendermint.abci.RequestCommit"; + value: Uint8Array; +} +export interface RequestCommitAmino {} +export interface RequestCommitAminoMsg { + type: "/tendermint.abci.RequestCommit"; + value: RequestCommitAmino; +} +export interface RequestCommitSDKType {} +/** 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; +} +/** lists available snapshots */ +export interface RequestListSnapshotsSDKType {} +/** 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: Uint8Array; +} +export interface RequestOfferSnapshotAminoMsg { + type: "/tendermint.abci.RequestOfferSnapshot"; + value: RequestOfferSnapshotAmino; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotSDKType { + snapshot: SnapshotSDKType; + app_hash: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: Long; + 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; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkSDKType { + height: Long; + format: number; + chunk: number; +} +/** 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: Uint8Array; + sender: string; +} +export interface RequestApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestApplySnapshotChunk"; + value: RequestApplySnapshotChunkAmino; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkSDKType { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface Response { + exception?: ResponseException; + echo?: ResponseEcho; + flush?: ResponseFlush; + info?: ResponseInfo; + setOption?: ResponseSetOption; + initChain?: ResponseInitChain; + query?: ResponseQuery; + beginBlock?: ResponseBeginBlock; + checkTx?: ResponseCheckTx; + deliverTx?: ResponseDeliverTx; + endBlock?: ResponseEndBlock; + commit?: ResponseCommit; + listSnapshots?: ResponseListSnapshots; + offerSnapshot?: ResponseOfferSnapshot; + loadSnapshotChunk?: ResponseLoadSnapshotChunk; + applySnapshotChunk?: ResponseApplySnapshotChunk; +} +export interface ResponseProtoMsg { + typeUrl: "/tendermint.abci.Response"; + value: Uint8Array; +} +export interface ResponseAmino { + exception?: ResponseExceptionAmino; + echo?: ResponseEchoAmino; + flush?: ResponseFlushAmino; + info?: ResponseInfoAmino; + set_option?: ResponseSetOptionAmino; + init_chain?: ResponseInitChainAmino; + query?: ResponseQueryAmino; + begin_block?: ResponseBeginBlockAmino; + check_tx?: ResponseCheckTxAmino; + deliver_tx?: ResponseDeliverTxAmino; + end_block?: ResponseEndBlockAmino; + commit?: ResponseCommitAmino; + list_snapshots?: ResponseListSnapshotsAmino; + offer_snapshot?: ResponseOfferSnapshotAmino; + load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; + apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; +} +export interface ResponseAminoMsg { + type: "/tendermint.abci.Response"; + value: ResponseAmino; +} +export interface ResponseSDKType { + exception?: ResponseExceptionSDKType; + echo?: ResponseEchoSDKType; + flush?: ResponseFlushSDKType; + info?: ResponseInfoSDKType; + set_option?: ResponseSetOptionSDKType; + init_chain?: ResponseInitChainSDKType; + query?: ResponseQuerySDKType; + begin_block?: ResponseBeginBlockSDKType; + check_tx?: ResponseCheckTxSDKType; + deliver_tx?: ResponseDeliverTxSDKType; + end_block?: ResponseEndBlockSDKType; + commit?: ResponseCommitSDKType; + list_snapshots?: ResponseListSnapshotsSDKType; + offer_snapshot?: ResponseOfferSnapshotSDKType; + load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; + apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; +} +/** 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; +} +/** nondeterministic */ +export interface ResponseExceptionSDKType { + error: string; +} +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 ResponseEchoSDKType { + message: string; +} +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 ResponseFlushSDKType {} +export interface ResponseInfo { + data: string; + version: string; + appVersion: Long; + lastBlockHeight: Long; + 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: Uint8Array; +} +export interface ResponseInfoAminoMsg { + type: "/tendermint.abci.ResponseInfo"; + value: ResponseInfoAmino; +} +export interface ResponseInfoSDKType { + data: string; + version: string; + app_version: Long; + last_block_height: Long; + last_block_app_hash: Uint8Array; +} +/** nondeterministic */ +export interface ResponseSetOption { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} +export interface ResponseSetOptionProtoMsg { + typeUrl: "/tendermint.abci.ResponseSetOption"; + value: Uint8Array; +} +/** nondeterministic */ +export interface ResponseSetOptionAmino { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} +export interface ResponseSetOptionAminoMsg { + type: "/tendermint.abci.ResponseSetOption"; + value: ResponseSetOptionAmino; +} +/** nondeterministic */ +export interface ResponseSetOptionSDKType { + code: number; + log: string; + info: string; +} +export interface ResponseInitChain { + consensusParams: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} +export interface ResponseInitChainProtoMsg { + typeUrl: "/tendermint.abci.ResponseInitChain"; + value: Uint8Array; +} +export interface ResponseInitChainAmino { + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_hash: Uint8Array; +} +export interface ResponseInitChainAminoMsg { + type: "/tendermint.abci.ResponseInitChain"; + value: ResponseInitChainAmino; +} +export interface ResponseInitChainSDKType { + consensus_params: ConsensusParamsSDKType; + validators: ValidatorUpdateSDKType[]; + app_hash: Uint8Array; +} +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: Long; + key: Uint8Array; + value: Uint8Array; + proofOps: ProofOps; + height: Long; + 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: Uint8Array; + value: Uint8Array; + proof_ops?: ProofOpsAmino; + height: string; + codespace: string; +} +export interface ResponseQueryAminoMsg { + type: "/tendermint.abci.ResponseQuery"; + value: ResponseQueryAmino; +} +export interface ResponseQuerySDKType { + code: number; + log: string; + info: string; + index: Long; + key: Uint8Array; + value: Uint8Array; + proof_ops: ProofOpsSDKType; + height: Long; + codespace: string; +} +export interface ResponseBeginBlock { + events: Event[]; +} +export interface ResponseBeginBlockProtoMsg { + typeUrl: "/tendermint.abci.ResponseBeginBlock"; + value: Uint8Array; +} +export interface ResponseBeginBlockAmino { + events: EventAmino[]; +} +export interface ResponseBeginBlockAminoMsg { + type: "/tendermint.abci.ResponseBeginBlock"; + value: ResponseBeginBlockAmino; +} +export interface ResponseBeginBlockSDKType { + events: EventSDKType[]; +} +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} +export interface ResponseCheckTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseCheckTx"; + value: Uint8Array; +} +export interface ResponseCheckTxAmino { + code: number; + data: Uint8Array; + /** 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 ResponseCheckTxSDKType { + code: number; + data: Uint8Array; + log: string; + info: string; + gas_wanted: Long; + gas_used: Long; + events: EventSDKType[]; + codespace: string; +} +export interface ResponseDeliverTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} +export interface ResponseDeliverTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseDeliverTx"; + value: Uint8Array; +} +export interface ResponseDeliverTxAmino { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gas_wanted: string; + gas_used: string; + events: EventAmino[]; + codespace: string; +} +export interface ResponseDeliverTxAminoMsg { + type: "/tendermint.abci.ResponseDeliverTx"; + value: ResponseDeliverTxAmino; +} +export interface ResponseDeliverTxSDKType { + code: number; + data: Uint8Array; + log: string; + info: string; + gas_wanted: Long; + gas_used: Long; + events: EventSDKType[]; + codespace: string; +} +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates: ConsensusParams; + events: Event[]; +} +export interface ResponseEndBlockProtoMsg { + typeUrl: "/tendermint.abci.ResponseEndBlock"; + value: Uint8Array; +} +export interface ResponseEndBlockAmino { + validator_updates: ValidatorUpdateAmino[]; + consensus_param_updates?: ConsensusParamsAmino; + events: EventAmino[]; +} +export interface ResponseEndBlockAminoMsg { + type: "/tendermint.abci.ResponseEndBlock"; + value: ResponseEndBlockAmino; +} +export interface ResponseEndBlockSDKType { + validator_updates: ValidatorUpdateSDKType[]; + consensus_param_updates: ConsensusParamsSDKType; + events: EventSDKType[]; +} +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: Long; +} +export interface ResponseCommitProtoMsg { + typeUrl: "/tendermint.abci.ResponseCommit"; + value: Uint8Array; +} +export interface ResponseCommitAmino { + /** reserve 1 */ + data: Uint8Array; + retain_height: string; +} +export interface ResponseCommitAminoMsg { + type: "/tendermint.abci.ResponseCommit"; + value: ResponseCommitAmino; +} +export interface ResponseCommitSDKType { + data: Uint8Array; + retain_height: Long; +} +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 ResponseListSnapshotsSDKType { + snapshots: SnapshotSDKType[]; +} +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 ResponseOfferSnapshotSDKType { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} +export interface ResponseLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: Uint8Array; +} +export interface ResponseLoadSnapshotChunkAmino { + chunk: Uint8Array; +} +export interface ResponseLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: ResponseLoadSnapshotChunkAmino; +} +export interface ResponseLoadSnapshotChunkSDKType { + chunk: Uint8Array; +} +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 ResponseApplySnapshotChunkSDKType { + result: ResponseApplySnapshotChunk_Result; + refetch_chunks: number[]; + reject_senders: string[]; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParams { + block: BlockParams; + evidence: EvidenceParams; + validator: ValidatorParams; + version: VersionParams; +} +export interface ConsensusParamsProtoMsg { + typeUrl: "/tendermint.abci.ConsensusParams"; + value: Uint8Array; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + version?: VersionParamsAmino; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.abci.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParamsSDKType { + block: BlockParamsSDKType; + evidence: EvidenceParamsSDKType; + validator: ValidatorParamsSDKType; + version: VersionParamsSDKType; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** Note: must be greater than 0 */ + maxBytes: Long; + /** Note: must be greater or equal to -1 */ + maxGas: Long; +} +export interface BlockParamsProtoMsg { + typeUrl: "/tendermint.abci.BlockParams"; + value: Uint8Array; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** Note: must be greater than 0 */ + max_bytes: string; + /** Note: must be greater or equal to -1 */ + max_gas: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.abci.BlockParams"; + value: BlockParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsSDKType { + max_bytes: Long; + max_gas: Long; +} +export interface LastCommitInfo { + round: number; + votes: VoteInfo[]; +} +export interface LastCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.LastCommitInfo"; + value: Uint8Array; +} +export interface LastCommitInfoAmino { + round: number; + votes: VoteInfoAmino[]; +} +export interface LastCommitInfoAminoMsg { + type: "/tendermint.abci.LastCommitInfo"; + value: LastCommitInfoAmino; +} +export interface LastCommitInfoSDKType { + round: number; + votes: VoteInfoSDKType[]; +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * 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 + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventAmino { + type: string; + attributes: EventAttributeAmino[]; +} +export interface EventAminoMsg { + type: "/tendermint.abci.Event"; + value: EventAmino; +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventSDKType { + type: string; + attributes: EventAttributeSDKType[]; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: Uint8Array; + value: Uint8Array; + /** 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: Uint8Array; + value: Uint8Array; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeAminoMsg { + type: "/tendermint.abci.EventAttribute"; + value: EventAttributeAmino; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeSDKType { + key: Uint8Array; + value: Uint8Array; + index: boolean; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: Long; + index: number; + tx: Uint8Array; + result: ResponseDeliverTx; +} +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: Uint8Array; + result?: ResponseDeliverTxAmino; +} +export interface TxResultAminoMsg { + type: "/tendermint.abci.TxResult"; + value: TxResultAmino; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultSDKType { + height: Long; + index: number; + tx: Uint8Array; + result: ResponseDeliverTxSDKType; +} +/** Validator */ +export interface Validator { + /** + * The first 20 bytes of SHA256(public key) + * PubKey pub_key = 2 [(gogoproto.nullable)=false]; + */ + address: Uint8Array; + /** The voting power */ + power: Long; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.abci.Validator"; + value: Uint8Array; +} +/** Validator */ +export interface ValidatorAmino { + /** + * The first 20 bytes of SHA256(public key) + * PubKey pub_key = 2 [(gogoproto.nullable)=false]; + */ + address: Uint8Array; + /** The voting power */ + power: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.abci.Validator"; + value: ValidatorAmino; +} +/** Validator */ +export interface ValidatorSDKType { + address: Uint8Array; + power: Long; +} +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey: PublicKey; + power: Long; +} +export interface ValidatorUpdateProtoMsg { + typeUrl: "/tendermint.abci.ValidatorUpdate"; + value: Uint8Array; +} +/** ValidatorUpdate */ +export interface ValidatorUpdateAmino { + pub_key?: PublicKeyAmino; + power: string; +} +export interface ValidatorUpdateAminoMsg { + type: "/tendermint.abci.ValidatorUpdate"; + value: ValidatorUpdateAmino; +} +/** ValidatorUpdate */ +export interface ValidatorUpdateSDKType { + pub_key: PublicKeySDKType; + power: Long; +} +/** VoteInfo */ +export interface VoteInfo { + validator: Validator; + signedLastBlock: boolean; +} +export interface VoteInfoProtoMsg { + typeUrl: "/tendermint.abci.VoteInfo"; + value: Uint8Array; +} +/** VoteInfo */ +export interface VoteInfoAmino { + validator?: ValidatorAmino; + signed_last_block: boolean; +} +export interface VoteInfoAminoMsg { + type: "/tendermint.abci.VoteInfo"; + value: VoteInfoAmino; +} +/** VoteInfo */ +export interface VoteInfoSDKType { + validator: ValidatorSDKType; + signed_last_block: boolean; +} +export interface Evidence { + type: EvidenceType; + /** The offending validator */ + validator: Validator; + /** The height when the offense occurred */ + height: Long; + /** 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: Long; +} +export interface EvidenceProtoMsg { + typeUrl: "/tendermint.abci.Evidence"; + value: Uint8Array; +} +export interface EvidenceAmino { + type: EvidenceType; + /** The offending validator */ + validator?: ValidatorAmino; + /** The height when the offense occurred */ + height: string; + /** 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 + */ + total_voting_power: string; +} +export interface EvidenceAminoMsg { + type: "/tendermint.abci.Evidence"; + value: EvidenceAmino; +} +export interface EvidenceSDKType { + type: EvidenceType; + validator: ValidatorSDKType; + height: Long; + time: Date; + total_voting_power: Long; +} +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: Long; + /** 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: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} +export interface SnapshotAminoMsg { + type: "/tendermint.abci.Snapshot"; + value: SnapshotAmino; +} +export interface SnapshotSDKType { + height: Long; + format: number; + chunks: number; + hash: Uint8Array; + metadata: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts new file mode 100644 index 000000000..3d5692578 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts @@ -0,0 +1,38 @@ +import * as _110 from "./abci/types"; +import * as _111 from "./crypto/keys"; +import * as _112 from "./crypto/proof"; +import * as _113 from "./libs/bits/types"; +import * as _114 from "./p2p/types"; +import * as _115 from "./types/block"; +import * as _116 from "./types/evidence"; +import * as _117 from "./types/params"; +import * as _118 from "./types/types"; +import * as _119 from "./types/validator"; +import * as _120 from "./version/types"; +export namespace tendermint { + export const abci = { + ..._110 + }; + export const crypto = { + ..._111, + ..._112 + }; + export namespace libs { + export const bits = { + ..._113 + }; + } + export const p2p = { + ..._114 + }; + export const types = { + ..._115, + ..._116, + ..._117, + ..._118, + ..._119 + }; + export const version = { + ..._120 + }; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/keys.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/keys.ts new file mode 100644 index 000000000..a36cf67eb --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/keys.ts @@ -0,0 +1,23 @@ +/** PublicKey defines the keys available for use with Tendermint 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 Tendermint Validators */ +export interface PublicKeyAmino { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} +export interface PublicKeyAminoMsg { + type: "/tendermint.crypto.PublicKey"; + value: PublicKeyAmino; +} +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKeySDKType { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/proof.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/proof.ts new file mode 100644 index 000000000..d5de8a3f1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/crypto/proof.ts @@ -0,0 +1,132 @@ +import { Long } from "../../helpers"; +export interface Proof { + total: Long; + index: Long; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ProofProtoMsg { + typeUrl: "/tendermint.crypto.Proof"; + value: Uint8Array; +} +export interface ProofAmino { + total: string; + index: string; + leaf_hash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ProofAminoMsg { + type: "/tendermint.crypto.Proof"; + value: ProofAmino; +} +export interface ProofSDKType { + total: Long; + index: Long; + leaf_hash: Uint8Array; + aunts: Uint8Array[]; +} +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: Uint8Array; + /** To encode in ProofOp.Data */ + proof?: ProofAmino; +} +export interface ValueOpAminoMsg { + type: "/tendermint.crypto.ValueOp"; + value: ValueOpAmino; +} +export interface ValueOpSDKType { + key: Uint8Array; + proof: ProofSDKType; +} +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; +} +export interface DominoOpSDKType { + key: string; + input: string; + output: string; +} +/** + * 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: Uint8Array; + data: Uint8Array; +} +export interface ProofOpAminoMsg { + type: "/tendermint.crypto.ProofOp"; + value: ProofOpAmino; +} +/** + * 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 ProofOpSDKType { + type: string; + key: Uint8Array; + data: Uint8Array; +} +/** 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; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsSDKType { + ops: ProofOpSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/libs/bits/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/libs/bits/types.ts new file mode 100644 index 000000000..65594023d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/libs/bits/types.ts @@ -0,0 +1,21 @@ +import { Long } from "../../../helpers"; +export interface BitArray { + bits: Long; + elems: Long[]; +} +export interface BitArrayProtoMsg { + typeUrl: "/tendermint.libs.bits.BitArray"; + value: Uint8Array; +} +export interface BitArrayAmino { + bits: string; + elems: string[]; +} +export interface BitArrayAminoMsg { + type: "/tendermint.libs.bits.BitArray"; + value: BitArrayAmino; +} +export interface BitArraySDKType { + bits: Long; + elems: Long[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/p2p/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/p2p/types.ts new file mode 100644 index 000000000..0d2eca4e2 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/p2p/types.ts @@ -0,0 +1,131 @@ +import { Long } from "../../helpers"; +export interface ProtocolVersion { + p2p: Long; + block: Long; + app: Long; +} +export interface ProtocolVersionProtoMsg { + typeUrl: "/tendermint.p2p.ProtocolVersion"; + value: Uint8Array; +} +export interface ProtocolVersionAmino { + p2p: string; + block: string; + app: string; +} +export interface ProtocolVersionAminoMsg { + type: "/tendermint.p2p.ProtocolVersion"; + value: ProtocolVersionAmino; +} +export interface ProtocolVersionSDKType { + p2p: Long; + block: Long; + app: Long; +} +export interface NodeInfo { + protocolVersion: ProtocolVersion; + nodeId: string; + listenAddr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other: NodeInfoOther; +} +export interface NodeInfoProtoMsg { + typeUrl: "/tendermint.p2p.NodeInfo"; + value: Uint8Array; +} +export interface NodeInfoAmino { + protocol_version?: ProtocolVersionAmino; + node_id: string; + listen_addr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other?: NodeInfoOtherAmino; +} +export interface NodeInfoAminoMsg { + type: "/tendermint.p2p.NodeInfo"; + value: NodeInfoAmino; +} +export interface NodeInfoSDKType { + protocol_version: ProtocolVersionSDKType; + node_id: string; + listen_addr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other: NodeInfoOtherSDKType; +} +export interface NodeInfoOther { + txIndex: string; + rpcAddress: string; +} +export interface NodeInfoOtherProtoMsg { + typeUrl: "/tendermint.p2p.NodeInfoOther"; + value: Uint8Array; +} +export interface NodeInfoOtherAmino { + tx_index: string; + rpc_address: string; +} +export interface NodeInfoOtherAminoMsg { + type: "/tendermint.p2p.NodeInfoOther"; + value: NodeInfoOtherAmino; +} +export interface NodeInfoOtherSDKType { + tx_index: string; + rpc_address: string; +} +export interface PeerInfo { + id: string; + addressInfo: PeerAddressInfo[]; + lastConnected: Date; +} +export interface PeerInfoProtoMsg { + typeUrl: "/tendermint.p2p.PeerInfo"; + value: Uint8Array; +} +export interface PeerInfoAmino { + id: string; + address_info: PeerAddressInfoAmino[]; + last_connected?: Date; +} +export interface PeerInfoAminoMsg { + type: "/tendermint.p2p.PeerInfo"; + value: PeerInfoAmino; +} +export interface PeerInfoSDKType { + id: string; + address_info: PeerAddressInfoSDKType[]; + last_connected: Date; +} +export interface PeerAddressInfo { + address: string; + lastDialSuccess: Date; + lastDialFailure: Date; + dialFailures: number; +} +export interface PeerAddressInfoProtoMsg { + typeUrl: "/tendermint.p2p.PeerAddressInfo"; + value: Uint8Array; +} +export interface PeerAddressInfoAmino { + address: string; + last_dial_success?: Date; + last_dial_failure?: Date; + dial_failures: number; +} +export interface PeerAddressInfoAminoMsg { + type: "/tendermint.p2p.PeerAddressInfo"; + value: PeerAddressInfoAmino; +} +export interface PeerAddressInfoSDKType { + address: string; + last_dial_success: Date; + last_dial_failure: Date; + dial_failures: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/block.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/block.ts new file mode 100644 index 000000000..271128477 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/block.ts @@ -0,0 +1,28 @@ +import { Header, HeaderAmino, HeaderSDKType, Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType } from "./types"; +import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "./evidence"; +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; +} +export interface BlockSDKType { + header: HeaderSDKType; + data: DataSDKType; + evidence: EvidenceListSDKType; + last_commit: CommitSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/evidence.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/evidence.ts new file mode 100644 index 000000000..a139b6c14 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/evidence.ts @@ -0,0 +1,104 @@ +import { Vote, VoteAmino, VoteSDKType, LightBlock, LightBlockAmino, LightBlockSDKType } from "./types"; +import { Validator, ValidatorAmino, ValidatorSDKType } from "./validator"; +import { Long } from "../../helpers"; +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; +} +export interface EvidenceSDKType { + duplicate_vote_evidence?: DuplicateVoteEvidenceSDKType; + light_client_attack_evidence?: LightClientAttackEvidenceSDKType; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidence { + voteA: Vote; + voteB: Vote; + totalVotingPower: Long; + validatorPower: Long; + 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?: Date; +} +export interface DuplicateVoteEvidenceAminoMsg { + type: "/tendermint.types.DuplicateVoteEvidence"; + value: DuplicateVoteEvidenceAmino; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidenceSDKType { + vote_a: VoteSDKType; + vote_b: VoteSDKType; + total_voting_power: Long; + validator_power: Long; + timestamp: Date; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidence { + conflictingBlock: LightBlock; + commonHeight: Long; + byzantineValidators: Validator[]; + totalVotingPower: Long; + 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?: Date; +} +export interface LightClientAttackEvidenceAminoMsg { + type: "/tendermint.types.LightClientAttackEvidence"; + value: LightClientAttackEvidenceAmino; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidenceSDKType { + conflicting_block: LightBlockSDKType; + common_height: Long; + byzantine_validators: ValidatorSDKType[]; + total_voting_power: Long; + timestamp: Date; +} +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; +} +export interface EvidenceListSDKType { + evidence: EvidenceSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/params.ts new file mode 100644 index 000000000..7b84b7e22 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/params.ts @@ -0,0 +1,240 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { Long } from "../../helpers"; +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block: BlockParams; + evidence: EvidenceParams; + validator: ValidatorParams; + version: VersionParams; +} +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; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.types.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsSDKType { + block: BlockParamsSDKType; + evidence: EvidenceParamsSDKType; + validator: ValidatorParamsSDKType; + version: VersionParamsSDKType; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: Long; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: Long; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + timeIotaMs: Long; +} +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; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + time_iota_ms: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.types.BlockParams"; + value: BlockParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsSDKType { + max_bytes: Long; + max_gas: Long; + time_iota_ms: Long; +} +/** 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: Long; + /** + * 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: Long; +} +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; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsSDKType { + max_age_num_blocks: Long; + max_age_duration: DurationSDKType; + max_bytes: Long; +} +/** + * 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; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsSDKType { + pub_key_types: string[]; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + appVersion: Long; +} +export interface VersionParamsProtoMsg { + typeUrl: "/tendermint.types.VersionParams"; + value: Uint8Array; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsAmino { + app_version: string; +} +export interface VersionParamsAminoMsg { + type: "/tendermint.types.VersionParams"; + value: VersionParamsAmino; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsSDKType { + app_version: Long; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: Long; + blockMaxGas: Long; +} +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; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsSDKType { + block_max_bytes: Long; + block_max_gas: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/types.ts new file mode 100644 index 000000000..7d4cbde34 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/types.ts @@ -0,0 +1,509 @@ +import { Proof, ProofAmino, ProofSDKType } from "../crypto/proof"; +import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; +import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; +import { Long } from "../../helpers"; +/** BlockIdFlag indicates which BlcokID the signature is for */ +export enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0, + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1, +} +export const BlockIDFlagSDKType = BlockIDFlag; +export const BlockIDFlagAmino = BlockIDFlag; +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case "BLOCK_ID_FLAG_UNKNOWN": + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + case 1: + case "BLOCK_ID_FLAG_ABSENT": + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + case 2: + case "BLOCK_ID_FLAG_COMMIT": + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + case 3: + case "BLOCK_ID_FLAG_NIL": + return BlockIDFlag.BLOCK_ID_FLAG_NIL; + case -1: + case "UNRECOGNIZED": + default: + return BlockIDFlag.UNRECOGNIZED; + } +} +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return "BLOCK_ID_FLAG_UNKNOWN"; + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return "BLOCK_ID_FLAG_ABSENT"; + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return "BLOCK_ID_FLAG_COMMIT"; + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** 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 SignedMsgTypeSDKType = SignedMsgType; +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: Uint8Array; +} +export interface PartSetHeaderAminoMsg { + type: "/tendermint.types.PartSetHeader"; + value: PartSetHeaderAmino; +} +/** PartsetHeader */ +export interface PartSetHeaderSDKType { + total: number; + hash: Uint8Array; +} +export interface Part { + index: number; + bytes: Uint8Array; + proof: Proof; +} +export interface PartProtoMsg { + typeUrl: "/tendermint.types.Part"; + value: Uint8Array; +} +export interface PartAmino { + index: number; + bytes: Uint8Array; + proof?: ProofAmino; +} +export interface PartAminoMsg { + type: "/tendermint.types.Part"; + value: PartAmino; +} +export interface PartSDKType { + index: number; + bytes: Uint8Array; + proof: ProofSDKType; +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader: PartSetHeader; +} +export interface BlockIDProtoMsg { + typeUrl: "/tendermint.types.BlockID"; + value: Uint8Array; +} +/** BlockID */ +export interface BlockIDAmino { + hash: Uint8Array; + part_set_header?: PartSetHeaderAmino; +} +export interface BlockIDAminoMsg { + type: "/tendermint.types.BlockID"; + value: BlockIDAmino; +} +/** BlockID */ +export interface BlockIDSDKType { + hash: Uint8Array; + part_set_header: PartSetHeaderSDKType; +} +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version: Consensus; + chainId: string; + height: Long; + time: Date; + /** prev block info */ + lastBlockId: BlockID; + /** hashes of block data */ + lastCommitHash: Uint8Array; + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} +export interface HeaderProtoMsg { + typeUrl: "/tendermint.types.Header"; + value: Uint8Array; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderAmino { + /** basic block info */ + version?: ConsensusAmino; + chain_id: string; + height: string; + time?: Date; + /** prev block info */ + last_block_id?: BlockIDAmino; + /** hashes of block data */ + last_commit_hash: Uint8Array; + data_hash: Uint8Array; + /** hashes from the app output from the prev block */ + validators_hash: Uint8Array; + /** validators for the next block */ + next_validators_hash: Uint8Array; + /** consensus params for current block */ + consensus_hash: Uint8Array; + /** state after txs from the previous block */ + app_hash: Uint8Array; + last_results_hash: Uint8Array; + /** consensus info */ + evidence_hash: Uint8Array; + /** original proposer of the block */ + proposer_address: Uint8Array; +} +export interface HeaderAminoMsg { + type: "/tendermint.types.Header"; + value: HeaderAmino; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderSDKType { + version: ConsensusSDKType; + chain_id: string; + height: Long; + time: Date; + last_block_id: BlockIDSDKType; + last_commit_hash: Uint8Array; + data_hash: Uint8Array; + validators_hash: Uint8Array; + next_validators_hash: Uint8Array; + consensus_hash: Uint8Array; + app_hash: Uint8Array; + last_results_hash: Uint8Array; + evidence_hash: Uint8Array; + proposer_address: Uint8Array; +} +/** 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: Uint8Array[]; +} +export interface DataAminoMsg { + type: "/tendermint.types.Data"; + value: DataAmino; +} +/** Data contains the set of transactions included in the block */ +export interface DataSDKType { + txs: Uint8Array[]; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface Vote { + type: SignedMsgType; + height: Long; + round: number; + /** zero if vote is nil. */ + blockId: BlockID; + timestamp: Date; + validatorAddress: Uint8Array; + validatorIndex: number; + signature: Uint8Array; +} +export interface VoteProtoMsg { + typeUrl: "/tendermint.types.Vote"; + value: Uint8Array; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteAmino { + type: SignedMsgType; + height: string; + round: number; + /** zero if vote is nil. */ + block_id?: BlockIDAmino; + timestamp?: Date; + validator_address: Uint8Array; + validator_index: number; + signature: Uint8Array; +} +export interface VoteAminoMsg { + type: "/tendermint.types.Vote"; + value: VoteAmino; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteSDKType { + type: SignedMsgType; + height: Long; + round: number; + block_id: BlockIDSDKType; + timestamp: Date; + validator_address: Uint8Array; + validator_index: number; + signature: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: Long; + 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; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitSDKType { + height: Long; + round: number; + block_id: BlockIDSDKType; + signatures: CommitSigSDKType[]; +} +/** 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: Uint8Array; + timestamp?: Date; + signature: Uint8Array; +} +export interface CommitSigAminoMsg { + type: "/tendermint.types.CommitSig"; + value: CommitSigAmino; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigSDKType { + block_id_flag: BlockIDFlag; + validator_address: Uint8Array; + timestamp: Date; + signature: Uint8Array; +} +export interface Proposal { + type: SignedMsgType; + height: Long; + 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?: Date; + signature: Uint8Array; +} +export interface ProposalAminoMsg { + type: "/tendermint.types.Proposal"; + value: ProposalAmino; +} +export interface ProposalSDKType { + type: SignedMsgType; + height: Long; + round: number; + pol_round: number; + block_id: BlockIDSDKType; + timestamp: Date; + signature: Uint8Array; +} +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 SignedHeaderSDKType { + header: HeaderSDKType; + commit: CommitSDKType; +} +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 LightBlockSDKType { + signed_header: SignedHeaderSDKType; + validator_set: ValidatorSetSDKType; +} +export interface BlockMeta { + blockId: BlockID; + blockSize: Long; + header: Header; + numTxs: Long; +} +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; +} +export interface BlockMetaSDKType { + block_id: BlockIDSDKType; + block_size: Long; + header: HeaderSDKType; + num_txs: Long; +} +/** 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: Uint8Array; + data: Uint8Array; + proof?: ProofAmino; +} +export interface TxProofAminoMsg { + type: "/tendermint.types.TxProof"; + value: TxProofAmino; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofSDKType { + root_hash: Uint8Array; + data: Uint8Array; + proof: ProofSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/validator.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/validator.ts new file mode 100644 index 000000000..88af6ca84 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/types/validator.ts @@ -0,0 +1,71 @@ +import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; +import { Long } from "../../helpers"; +export interface ValidatorSet { + validators: Validator[]; + proposer: Validator; + totalVotingPower: Long; +} +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 ValidatorSetSDKType { + validators: ValidatorSDKType[]; + proposer: ValidatorSDKType; + total_voting_power: Long; +} +export interface Validator { + address: Uint8Array; + pubKey: PublicKey; + votingPower: Long; + proposerPriority: Long; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.types.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + address: Uint8Array; + pub_key?: PublicKeyAmino; + voting_power: string; + proposer_priority: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.types.Validator"; + value: ValidatorAmino; +} +export interface ValidatorSDKType { + address: Uint8Array; + pub_key: PublicKeySDKType; + voting_power: Long; + proposer_priority: Long; +} +export interface SimpleValidator { + pubKey: PublicKey; + votingPower: Long; +} +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; +} +export interface SimpleValidatorSDKType { + pub_key: PublicKeySDKType; + voting_power: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/version/types.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/version/types.ts new file mode 100644 index 000000000..e6e0c282c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/version/types.ts @@ -0,0 +1,71 @@ +import { Long } from "../../helpers"; +/** + * 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: Long; + 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; +} +/** + * 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 AppSDKType { + protocol: Long; + software: string; +} +/** + * 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: Long; + app: Long; +} +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; +} +/** + * 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 ConsensusSDKType { + block: Long; + app: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/tsconfig.json b/Crescent/crescent-starter/tsconfig.json new file mode 100644 index 000000000..721196b1b --- /dev/null +++ b/Crescent/crescent-starter/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "esModuleInterop": true, + "declaration": true, + "importHelpers": true, + "resolveJsonModule": true, + "module": "commonjs", + "outDir": "dist", + "rootDir": "src", + "target": "es2017", + "strict": true + }, + "include": [ + "src/**/*", + "node_modules/@subql/types-cosmos/dist/global.d.ts" + ] +} From a46a2c1486d1c716a8e6844e900357d44272ec12 Mon Sep 17 00:00:00 2001 From: web3cdn Date: Fri, 8 Sep 2023 14:58:15 +0300 Subject: [PATCH 2/3] Cresent Cosmos Subql Starter - add Proto. --- .../base/query/v1beta1/pagination.proto | 54 ++ .../proto/cosmos/base/v1beta1/coin.proto | 40 ++ .../proto/crescent/claim/v1beta1/claim.proto | 69 +++ .../crescent/claim/v1beta1/genesis.proto | 17 + .../proto/crescent/claim/v1beta1/query.proto | 61 +++ .../proto/crescent/claim/v1beta1/tx.proto | 27 + .../crescent/farming/v1beta1/farming.proto | 205 ++++++++ .../crescent/farming/v1beta1/genesis.proto | 172 +++++++ .../crescent/farming/v1beta1/proposal.proto | 133 +++++ .../crescent/farming/v1beta1/query.proto | 461 ++++++++++++++++++ .../proto/crescent/farming/v1beta1/tx.proto | 188 +++++++ .../liquidfarming/v1beta1/genesis.proto | 49 ++ .../liquidfarming/v1beta1/liquidfarming.proto | 94 ++++ .../liquidfarming/v1beta1/params.proto | 38 ++ .../liquidfarming/v1beta1/query.proto | 178 +++++++ .../crescent/liquidfarming/v1beta1/tx.proto | 117 +++++ .../crescent/liquidity/v1beta1/genesis.proto | 37 ++ .../liquidity/v1beta1/liquidity.proto | 285 +++++++++++ .../crescent/liquidity/v1beta1/query.proto | 326 +++++++++++++ .../proto/crescent/liquidity/v1beta1/tx.proto | 243 +++++++++ .../liquidstaking/v1beta1/genesis.proto | 20 + .../liquidstaking/v1beta1/liquidstaking.proto | 177 +++++++ .../liquidstaking/v1beta1/query.proto | 92 ++++ .../crescent/liquidstaking/v1beta1/tx.proto | 49 ++ .../crescent/lpfarm/v1beta1/events.proto | 40 ++ .../crescent/lpfarm/v1beta1/genesis.proto | 32 ++ .../crescent/lpfarm/v1beta1/lpfarm.proto | 64 +++ .../crescent/lpfarm/v1beta1/proposal.proto | 30 ++ .../proto/crescent/lpfarm/v1beta1/query.proto | 131 +++++ .../proto/crescent/lpfarm/v1beta1/tx.proto | 69 +++ .../crescent/marker/v1beta1/genesis.proto | 15 + .../crescent/marker/v1beta1/marker.proto | 11 + .../proto/crescent/marker/v1beta1/query.proto | 31 ++ .../marketmaker/v1beta1/genesis.proto | 30 ++ .../marketmaker/v1beta1/marketmaker.proto | 159 ++++++ .../marketmaker/v1beta1/proposal.proto | 62 +++ .../crescent/marketmaker/v1beta1/query.proto | 138 ++++++ .../crescent/marketmaker/v1beta1/tx.proto | 36 ++ .../proto/crescent/mint/v1beta1/genesis.proto | 18 + .../proto/crescent/mint/v1beta1/mint.proto | 39 ++ .../proto/crescent/mint/v1beta1/query.proto | 40 ++ 41 files changed, 4077 insertions(+) create mode 100644 Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto create mode 100644 Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto create mode 100644 Crescent/crescent-starter/proto/crescent/claim/v1beta1/claim.proto create mode 100644 Crescent/crescent-starter/proto/crescent/claim/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/claim/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/claim/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/farming/v1beta1/farming.proto create mode 100644 Crescent/crescent-starter/proto/crescent/farming/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/farming/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/farming/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/farming/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/liquidfarming.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/params.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/liquidity.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/liquidstaking.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/events.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/lpfarm.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marker/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marker/v1beta1/marker.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marker/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/mint/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/mint/v1beta1/mint.proto create mode 100644 Crescent/crescent-starter/proto/crescent/mint/v1beta1/query.proto diff --git a/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto b/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 000000000..2e906335a --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,54 @@ +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. + 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 + 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/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto b/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto new file mode 100644 index 000000000..fab75284b --- /dev/null +++ b/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.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 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// 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 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/claim/v1beta1/claim.proto b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/claim.proto new file mode 100644 index 000000000..34a3affe5 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/claim.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; +package crescent.claim.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/claim/types"; +option (gogoproto.goproto_getters_all) = false; + +// Airdrop defines airdrop information. +message Airdrop { + // id specifies index of the airdrop + uint64 id = 1; + + // source_address defines the bech32-encoded source address + // where the source of coins from + string source_address = 2; + + // conditions specifies a list of conditions + repeated ConditionType conditions = 3; + + // start_time specifies the start time of the airdrop + google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // end_time specifies the start time of the airdrop + google.protobuf.Timestamp end_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +// ClaimRecord defines claim record that corresponds to the airdrop. +message ClaimRecord { + // airdrop_id specifies airdrop id + uint64 airdrop_id = 1; + + // recipient specifies the bech32-encoded address that is eligible to claim airdrop + string recipient = 2; + + // initial_claimable_coins specifies the initial claimable coins + repeated cosmos.base.v1beta1.Coin initial_claimable_coins = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + // claimable_coins specifies the unclaimed claimable coins + repeated cosmos.base.v1beta1.Coin claimable_coins = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + // claimed_conditions specifies a list of condition types + // initial values are empty and each condition type gets appended when claim is successfully executed + repeated ConditionType claimed_conditions = 5; +} + +// ConditionType defines the type of condition that a recipient must execute in order to receive a claimable amount. +enum ConditionType { + option (gogoproto.goproto_enum_prefix) = false; + + // CONDITION_TYPE_UNSPECIFIED specifies an unknown condition type + CONDITION_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ConditionTypeUnspecified"]; + + // CONDITION_TYPE_DEPOSIT specifies deposit condition type + CONDITION_TYPE_DEPOSIT = 1 [(gogoproto.enumvalue_customname) = "ConditionTypeDeposit"]; + + // CONDITION_TYPE_SWAP specifies swap condition type + CONDITION_TYPE_SWAP = 2 [(gogoproto.enumvalue_customname) = "ConditionTypeSwap"]; + + // CONDITION_TYPE_LIQUIDSTAKE specifies liquid stake condition type + CONDITION_TYPE_LIQUIDSTAKE = 3 [(gogoproto.enumvalue_customname) = "ConditionTypeLiquidStake"]; + + // CONDITION_TYPE_VOTE specifies governance vote condition type + CONDITION_TYPE_VOTE = 4 [(gogoproto.enumvalue_customname) = "ConditionTypeVote"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/claim/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/genesis.proto new file mode 100644 index 000000000..99d60c512 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package crescent.claim.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/claim/v1beta1/claim.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/claim/types"; + +// GenesisState defines the claim module's genesis state. +message GenesisState { + // airdrops specifies a list of airdrops + repeated Airdrop airdrops = 1 [(gogoproto.nullable) = false]; + + // claim_records specifies a list of claim records + repeated ClaimRecord claim_records = 2 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/claim/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/query.proto new file mode 100644 index 000000000..ce0e715e9 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/query.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package crescent.claim.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "crescent/claim/v1beta1/claim.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/claim/types"; + +// Query defines the gRPC querier service. +service Query { + // Airdrops returns all airdrops. + rpc Airdrops(QueryAirdropsRequest) returns (QueryAirdropsResponse) { + option (google.api.http).get = "/crescent/claim/v1beta1/airdrops"; + } + + // Airdrop returns the specific airdrop. + rpc Airdrop(QueryAirdropRequest) returns (QueryAirdropResponse) { + option (google.api.http).get = "/crescent/claim/v1beta1/airdrops/{airdrop_id}"; + } + + // ClaimRecord returns the claim record for the recipient address. + rpc ClaimRecord(QueryClaimRecordRequest) returns (QueryClaimRecordResponse) { + option (google.api.http).get = "/crescent/claim/v1beta1/airdrops/{airdrop_id}/claim_records/{recipient}"; + } +} + +// QueryAirdropsRequest is request type for the Query/Airdrops RPC method. +message QueryAirdropsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAirdropsResponse is response type for the Query/Airdrops RPC method. +message QueryAirdropsResponse { + repeated Airdrop airdrops = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAirdropRequest is request type for the Query/Airdrop RPC method. +message QueryAirdropRequest { + uint64 airdrop_id = 1; +} + +// QueryAirdropResponse is response type for the Query/Airdrop RPC method. +message QueryAirdropResponse { + Airdrop airdrop = 1 [(gogoproto.nullable) = false]; +} + +// QueryClaimRecordRequest is request type for the Query/ClaimRecord RPC method. +message QueryClaimRecordRequest { + uint64 airdrop_id = 1; + + string recipient = 2; +} + +// QueryClaimRecordResponse is response type for the Query/ClaimRecord RPC method. +message QueryClaimRecordResponse { + ClaimRecord claim_record = 1 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/claim/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/tx.proto new file mode 100644 index 000000000..0b8474aa2 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/claim/v1beta1/tx.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package crescent.claim.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/claim/v1beta1/claim.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/claim/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the Msg service. +service Msg { + rpc Claim(MsgClaim) returns (MsgClaimResponse); +} + +// MsgClaim defines a SDK message for claiming claimable amount. +message MsgClaim { + // airdrop_id specifies index of the airdrop + uint64 airdrop_id = 1; + + // recipient specifies the bech32-encoded address that is eligible to claim airdrop + string recipient = 2; + + // condition_type specifies the condition type + ConditionType condition_type = 3; +} + +message MsgClaimResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/farming/v1beta1/farming.proto b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/farming.proto new file mode 100644 index 000000000..a479e7389 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/farming.proto @@ -0,0 +1,205 @@ +syntax = "proto3"; + +package crescent.farming.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/farming/types"; + +// Params defines the set of params for the farming module. +message Params { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // private_plan_creation_fee specifies the fee for plan creation + // this fee prevents from spamming and is collected in the community pool + repeated cosmos.base.v1beta1.Coin private_plan_creation_fee = 1 [ + (gogoproto.moretags) = "yaml:\"private_plan_creation_fee\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + + // next_epoch_days is the epoch length in number of days + // it updates internal state called CurrentEpochDays that is used to process + // staking and reward distribution in end blocker + uint32 next_epoch_days = 2 [(gogoproto.moretags) = "yaml:\"next_epoch_days\""]; + + // farming_fee_collector is the module account address to collect fees within the farming module + string farming_fee_collector = 3 [(gogoproto.moretags) = "yaml:\"farming_fee_collector\""]; + + // delayed_staking_gas_fee is used to impose gas fee for the delayed staking + uint64 delayed_staking_gas_fee = 4 [ + (gogoproto.moretags) = "yaml:\"delayed_staking_gas_fee\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", + (gogoproto.nullable) = false + ]; + + // max_num_private_plans is the maximum number of active private plans + uint32 max_num_private_plans = 5 [(gogoproto.moretags) = "yaml:\"max_num_private_plans\""]; +} + +// BasePlan defines a base plan type and contains the required fields +// for basic farming plan functionality. Any custom farming plan type must +// extend this type for additional functionality (for example, fixed amount plan, ratio +// plan). +message BasePlan { + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "PlanI"; + + // id specifies index of the farming plan + uint64 id = 1; + + // name specifies the name for the plan + string name = 2; + + // type specifies the plan type; type 0 is public and 1 is private + // public plan must be created through governance proposal and private plan is + // created by account + PlanType type = 3; + + // farming_pool_address defines the bech32-encoded address of the farming pool + string farming_pool_address = 4 [(gogoproto.moretags) = "yaml:\"farming_pool_address\""]; + + // termination_address defines the Bech32-encoded address that terminates the plan + // when the plan ends after the end time, the balance of the farming pool address + // is transferred to the termination address + string termination_address = 5 [(gogoproto.moretags) = "yaml:\"termination_address\""]; + + // staking_coin_weights specifies the coin weights for the plan + repeated cosmos.base.v1beta1.DecCoin staking_coin_weights = 6 [ + (gogoproto.moretags) = "yaml:\"staking_coin_weights\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + + // start_time specifies the start time of the plan + google.protobuf.Timestamp start_time = 7 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the plan + google.protobuf.Timestamp end_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + + // terminated indicates whether the plan has been terminated or not + bool terminated = 9; + + // last_distribution_time specifies the last time a distribution occurred + google.protobuf.Timestamp last_distribution_time = 10 + [(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_distribution_time\""]; + + // distributed_coins specifies the total coins distributed by this plan + repeated cosmos.base.v1beta1.Coin distributed_coins = 11 [ + (gogoproto.moretags) = "yaml:\"distributed_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// FixedAmountPlan defines a fixed amount plan that distributes a fixed amount +// of coins for every epoch. +message FixedAmountPlan { + option (gogoproto.goproto_getters) = false; + + BasePlan base_plan = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_plan\""]; + + // epoch_amount specifies the distributing amount for each epoch + repeated cosmos.base.v1beta1.Coin epoch_amount = 2 [ + (gogoproto.moretags) = "yaml:\"epoch_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// RatioPlan defines a plan that distributes to farmers by ratio +// distribution for every epoch day. +message RatioPlan { + option (gogoproto.goproto_getters) = false; + + BasePlan base_plan = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_plan\""]; + + // epoch_ratio specifies the distributing amount by ratio + string epoch_ratio = 2 [ + (gogoproto.moretags) = "yaml:\"epoch_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// PlanType enumerates the valid types of a plan. +enum PlanType { + option (gogoproto.goproto_enum_prefix) = false; + + // PLAN_TYPE_UNSPECIFIED defines the default plan type. + PLAN_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "PlanTypeNil"]; + // PLAN_TYPE_PUBLIC defines the public plan type. + PLAN_TYPE_PUBLIC = 1 [(gogoproto.enumvalue_customname) = "PlanTypePublic"]; + // PLAN_TYPE_PRIVATE defines the private plan type. + PLAN_TYPE_PRIVATE = 2 [(gogoproto.enumvalue_customname) = "PlanTypePrivate"]; +} + +// Staking defines a farmer's staking information. +message Staking { + option (gogoproto.goproto_getters) = false; + + string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + uint64 starting_epoch = 2 [(gogoproto.moretags) = "yaml:\"starting_epoch\""]; +} + +// QueuedStaking defines staking that is waiting in a queue. +message QueuedStaking { + option (gogoproto.goproto_getters) = false; + + string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// TotalStakings defines the total staking amount for a staking coin denom. +message TotalStakings { + option (gogoproto.goproto_getters) = false; + + string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. +message HistoricalRewards { + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.DecCoin cumulative_unit_rewards = 1 [ + (gogoproto.moretags) = "yaml:\"cumulative_unit_rewards\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; +} + +// OutstandingRewards represents outstanding (un-withdrawn) rewards +// for a staking coin denom. +message OutstandingRewards { + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// UnharvestedRewards represents unharvested rewards of a farmer for a +// staking coin denom, which increases when there was an automatic withdrawal +// of rewards due to changes in staked coin amount. +message UnharvestedRewards { + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// AddressType enumerates the available types of a address. +enum AddressType { + option (gogoproto.goproto_enum_prefix) = false; + + // the 32 bytes length address type of ADR 028. + ADDRESS_TYPE_32_BYTES = 0 [(gogoproto.enumvalue_customname) = "AddressType32Bytes"]; + // the default 20 bytes length address type. + ADDRESS_TYPE_20_BYTES = 1 [(gogoproto.enumvalue_customname) = "AddressType20Bytes"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/farming/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/genesis.proto new file mode 100644 index 000000000..9adc8160c --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/genesis.proto @@ -0,0 +1,172 @@ +syntax = "proto3"; + +package crescent.farming.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/farming/v1beta1/farming.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/farming/types"; +option (gogoproto.equal_all) = true; + +// GenesisState defines the farming module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters for the farming module + Params params = 1 [(gogoproto.nullable) = false]; + + uint64 global_plan_id = 2 [(gogoproto.moretags) = "yaml:\"global_plan_id\""]; + + // plan_records defines the plan records used for genesis state + repeated PlanRecord plan_records = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"plan_records\""]; + + repeated StakingRecord staking_records = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"staking_records\""]; + + repeated QueuedStakingRecord queued_staking_records = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"queued_staking_records\""]; + + repeated HistoricalRewardsRecord historical_rewards_records = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards_records\""]; + + repeated OutstandingRewardsRecord outstanding_rewards_records = 7 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards_records\""]; + + repeated UnharvestedRewardsRecord unharvested_rewards_records = 8 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"unharvested_rewards_records\""]; + + repeated CurrentEpochRecord current_epoch_records = 9 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_epoch_records\""]; + + repeated TotalStakingsRecord total_stakings_records = 10 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_stakings_records\""]; + + // reward_pool_coins specifies balance of the reward pool to be distributed in the plans + // this param is needed for import/export validation + repeated cosmos.base.v1beta1.Coin reward_pool_coins = 11 [ + (gogoproto.moretags) = "yaml:\"reward_pool_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + + // last_epoch_time specifies the last executed epoch time of the plans + google.protobuf.Timestamp last_epoch_time = 12 + [(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_epoch_time\""]; + + // current_epoch_days specifies the epoch used when allocating farming rewards in end blocker + uint32 current_epoch_days = 13; +} + +// PlanRecord is used for import/export via genesis json. +message PlanRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // plan specifies the plan interface; it can be FixedAmountPlan or RatioPlan + google.protobuf.Any plan = 1 [(gogoproto.nullable) = false, (cosmos_proto.accepts_interface) = "PlanI"]; + + // farming_pool_coins specifies balance of the farming pool for the plan + // this param is needed for import/export validation + repeated cosmos.base.v1beta1.Coin farming_pool_coins = 2 [ + (gogoproto.moretags) = "yaml:\"farming_pool_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// StakingRecord is used for import/export via genesis json. +message StakingRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + string farmer = 2; + + Staking staking = 3 [(gogoproto.nullable) = false]; +} + +// QueuedStakingRecord is used for import/export via genesis json. +message QueuedStakingRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + google.protobuf.Timestamp end_time = 1 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + + string staking_coin_denom = 2 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + string farmer = 3; + + QueuedStaking queued_staking = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"queued_staking\""]; +} + +// TotalStakingsRecord is used for import/export via genesis json. +message TotalStakingsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + // amount specifies total amount of the staking for the staking coin denom except queued staking + string amount = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // staking_reserve_coins specifies balance of the staking reserve account where staking and queued staking for the + // staking coin denom is stored this param is needed for import/export validation + repeated cosmos.base.v1beta1.Coin staking_reserve_coins = 9 [ + (gogoproto.moretags) = "yaml:\"staking_reserve_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// HistoricalRewardsRecord is used for import/export via genesis json. +message HistoricalRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + uint64 epoch = 2; + + HistoricalRewards historical_rewards = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards\""]; +} + +// OutstandingRewardsRecord is used for import/export via genesis json. +message OutstandingRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + OutstandingRewards outstanding_rewards = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""]; +} + +message UnharvestedRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string farmer = 1; + + string staking_coin_denom = 2 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + UnharvestedRewards unharvested_rewards = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"unharvested_rewards\""]; +} + +// CurrentEpochRecord is used for import/export via genesis json. +message CurrentEpochRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""]; + + uint64 current_epoch = 2 [(gogoproto.moretags) = "yaml:\"current_epoch\""]; +} diff --git a/Crescent/crescent-starter/proto/crescent/farming/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/proposal.proto new file mode 100644 index 000000000..9470bbc58 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/proposal.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; + +package crescent.farming.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/farming/v1beta1/farming.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/farming/types"; + +// PublicPlanProposal defines a public farming plan governance proposal that receives one of the following requests: +// A request that creates a public farming plan, a request that updates the plan, and a request that deletes the plan. +// For public plan creation, depending on which field is passed, either epoch amount or epoch ratio, it creates a fixed +// amount plan or ratio plan. +message PublicPlanProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // title specifies the title of the plan + string title = 1; + + // description specifies the description of the plan + string description = 2; + + // add_plan_requests specifies AddPlanRequest object + repeated AddPlanRequest add_plan_requests = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"add_plan_requests\""]; + + // modify_plan_requests specifies ModifyPlanRequest object + repeated ModifyPlanRequest modify_plan_requests = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"modify_plan_requests\""]; + + // delete_plan_requests specifies DeletePlanRequest object + repeated DeletePlanRequest delete_plan_requests = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delete_plan_requests\""]; +} + +// AddPlanRequest details a proposal for creating a public plan. +message AddPlanRequest { + // name specifies the plan name for display + string name = 1; + + // farming_pool_address defines the bech32-encoded address of the farming pool + string farming_pool_address = 2 [(gogoproto.moretags) = "yaml:\"farming_pool_address\""]; + + // termination_address defines the bech32-encoded address that terminates plan + // when the plan ends after the end time, the balance of farming pool address + // is transferred to the termination address + string termination_address = 3 [(gogoproto.moretags) = "yaml:\"termination_address\""]; + + // staking_coin_weights specifies coin weights for the plan + repeated cosmos.base.v1beta1.DecCoin staking_coin_weights = 4 [ + (gogoproto.moretags) = "yaml:\"staking_coin_weights\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + + // start_time specifies the start time of the plan + google.protobuf.Timestamp start_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the plan + google.protobuf.Timestamp end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + + // epoch_amount specifies the distributing amount for each epoch + repeated cosmos.base.v1beta1.Coin epoch_amount = 7 [ + (gogoproto.moretags) = "yaml:\"epoch_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + + // epoch_ratio specifies the distributing amount by ratio + string epoch_ratio = 8 [ + (gogoproto.moretags) = "yaml:\"epoch_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// ModifyPlanRequest details a proposal for modifying the existing public plan. +message ModifyPlanRequest { + // plan_id specifies index of the farming plan + uint64 plan_id = 1; + + // name specifies the plan name for display + string name = 2; + + // farming_pool_address defines the bech32-encoded address of the farming pool + string farming_pool_address = 3 [(gogoproto.moretags) = "yaml:\"farming_pool_address\""]; + + // termination_address defines the bech32-encoded address that terminates plan + // when the plan ends after the end time, the balance of farming pool address + // is transferred to the termination address + string termination_address = 4 [(gogoproto.moretags) = "yaml:\"termination_address\""]; + + // staking_coin_weights specifies coin weights for the plan + repeated cosmos.base.v1beta1.DecCoin staking_coin_weights = 5 [ + (gogoproto.moretags) = "yaml:\"staking_coin_weights\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + + // start_time specifies the start time of the plan + google.protobuf.Timestamp start_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the plan + google.protobuf.Timestamp end_time = 7 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "yaml:\"end_time\""]; + + // epoch_amount specifies the distributing amount for each epoch + repeated cosmos.base.v1beta1.Coin epoch_amount = 8 [ + (gogoproto.moretags) = "yaml:\"epoch_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + + // epoch_ratio specifies the distributing amount by ratio + string epoch_ratio = 9 [ + (gogoproto.moretags) = "yaml:\"epoch_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// DeletePlanRequest details a proposal for deleting an existing public plan. +message DeletePlanRequest { + // plan_id specifies index of the farming plan + uint64 plan_id = 1; +} diff --git a/Crescent/crescent-starter/proto/crescent/farming/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/query.proto new file mode 100644 index 000000000..37d168601 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/query.proto @@ -0,0 +1,461 @@ +syntax = "proto3"; + +package crescent.farming.v1beta1; + +import "crescent/farming/v1beta1/farming.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/farming/types"; + +// Query defines the gRPC query service for the farming module. +service Query { + // Params returns parameters of the farming module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/params"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all parameters of the farming module." + external_docs: { + url: "https://github.com/crescent-network/crescent/blob/main/x/farming/spec/07_params.md" + description: "Find out more about the params" + } + }; + } + + // Plans returns all plans. + rpc Plans(QueryPlansRequest) returns (QueryPlansResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/plans"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns a list of all farming plans with pagination result." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = invalid plan type PLAN_TYPE","details":[]}' + } + } + } + responses: { + key: "500" + value: { + description: "Internal Server Error" + examples: { + key: "application/json" + value: '{"code":13,"message":"rpc error: code = Internal desc = error","details":[]}' + } + } + } + }; + } + + // Plan returns a specific plan. + rpc Plan(QueryPlanRequest) returns (QueryPlanResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/plans/{plan_id}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns the farming plan that corresponds to the plan_id." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + responses: { + key: "404" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":5,"message":"rpc error: code = NotFound desc = plan plan_id not found","details":[]}' + } + } + } + responses: { + key: "500" + value: { + description: "Internal Server Error" + examples: { + key: "application/json" + value: '{"code":13,"message":"rpc error: code = Internal desc = error","details":[]}' + } + } + } + }; + } + + rpc Position(QueryPositionRequest) returns (QueryPositionResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/positions/{farmer}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns the farming position of the farmer" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // Stakings returns all stakings by a farmer. + rpc Stakings(QueryStakingsRequest) returns (QueryStakingsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/stakings/{farmer}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all stakings (staked and queued coins) that corresponds to the farmer" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // QueryStakings returns all queued stakings by a farmer. + rpc QueuedStakings(QueryQueuedStakingsRequest) returns (QueryQueuedStakingsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/queued_stakings/{farmer}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all queued stakings that corresponds to the farmer" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // TotalStakings returns total staking amount for a staking coin denom + rpc TotalStakings(QueryTotalStakingsRequest) returns (QueryTotalStakingsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/total_stakings/{staking_coin_denom}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns total stakings that corresponds to the staking_coin_denom" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // Rewards returns rewards for a farmer + rpc Rewards(QueryRewardsRequest) returns (QueryRewardsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/rewards/{farmer}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all rewards coins that corresponds to the farmer" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // UnharvestedRewards returns unharvested rewards for a farmer + rpc UnharvestedRewards(QueryUnharvestedRewardsRequest) returns (QueryUnharvestedRewardsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/unharvested_rewards/{farmer}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all unharvested rewards that corresponds to the farmer" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // CurrentEpochDays returns current epoch days. + rpc CurrentEpochDays(QueryCurrentEpochDaysRequest) returns (QueryCurrentEpochDaysResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/current_epoch_days"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns the current epoch days" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } + + // HistoricalRewards returns HistoricalRewards records for a staking coin denom. + rpc HistoricalRewards(QueryHistoricalRewardsRequest) returns (QueryHistoricalRewardsResponse) { + option (google.api.http).get = "/crescent/farming/v1beta1/historical_rewards/{staking_coin_denom}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns HistoricalRewards records for a staking coin denom" + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + }; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryPlansRequest is the request type for the Query/Plans RPC method. +message QueryPlansRequest { + string type = 1; + string farming_pool_address = 2; + string termination_address = 3; + string staking_coin_denom = 4; + string terminated = 5; + cosmos.base.query.v1beta1.PageRequest pagination = 6; +} + +// QueryPlansResponse is the response type for the Query/Plans RPC method. +message QueryPlansResponse { + // plans are the existing plans + repeated google.protobuf.Any plans = 1 [(cosmos_proto.accepts_interface) = "PlanI"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPlanRequest is the request type for the Query/Plan RPC method. +message QueryPlanRequest { + uint64 plan_id = 1; +} + +// QueryPlanResponse is the response type for the Query/Plan RPC method. +message QueryPlanResponse { + google.protobuf.Any plan = 1 [(cosmos_proto.accepts_interface) = "PlanI"]; +} + +// QueryPositionRequest is the request type for the Query/Position RPC method. +message QueryPositionRequest { + string farmer = 1; + string staking_coin_denom = 2; +} + +// QueryPositionResponse is the response type for the Query/Position RPC method. +message QueryPositionResponse { + repeated cosmos.base.v1beta1.Coin staked_coins = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin queued_coins = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin rewards = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// QueryStakingsRequest is the request type for the Query/Stakings RPC method. +message QueryStakingsRequest { + string farmer = 1; + string staking_coin_denom = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryStakingsResponse is the response type for the Query/Stakings RPC method. +message QueryStakingsResponse { + repeated StakingResponse stakings = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryQueuedStakingsRequest is the request type for the Query/QueuedStakings RPC method. +message QueryQueuedStakingsRequest { + string farmer = 1; + string staking_coin_denom = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryQueuedStakingsResponse is the response type for the Query/QueuedStakings RPC method. +message QueryQueuedStakingsResponse { + repeated QueuedStakingResponse queued_stakings = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTotalStakingsRequest is the request type for the Query/TotalStakings RPC method. +message QueryTotalStakingsRequest { + string staking_coin_denom = 1; +} + +// QueryTotalStakingsResponse is the response type for the Query/TotalStakings RPC method. +message QueryTotalStakingsResponse { + string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// QueryRewardsRequest is the request type for the Query/Rewards RPC method. +message QueryRewardsRequest { + string farmer = 1; + string staking_coin_denom = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryRewardsResponse is the response type for the Query/Rewards RPC method. +message QueryRewardsResponse { + repeated RewardsResponse rewards = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryUnharvestedRewardsRequest is the request type for the Query/UnharvestedRewards RPC method. +message QueryUnharvestedRewardsRequest { + string farmer = 1; + string staking_coin_denom = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryUnharvestedRewardsResponse is the response type for the Query/UnharvestedRewards RPC method. +message QueryUnharvestedRewardsResponse { + repeated UnharvestedRewardsResponse unharvested_rewards = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryCurrentEpochDaysRequest is the request type for the Query/CurrentEpochDays RPC method. +message QueryCurrentEpochDaysRequest {} + +// QueryCurrentEpochDaysResponse is the response type for the Query/CurrentEpochDays RPC method. +message QueryCurrentEpochDaysResponse { + uint32 current_epoch_days = 1; +} + +// QueryHistoricalRewardsRequest is the request type for the Query/HistoricalRewards RPC method. +message QueryHistoricalRewardsRequest { + string staking_coin_denom = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryHistoricalRewardsResponse is the response type for the Query/HistoricalRewards RPC method. +message QueryHistoricalRewardsResponse { + repeated HistoricalRewardsResponse historical_rewards = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message StakingResponse { + string staking_coin_denom = 1; + + string amount = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + uint64 starting_epoch = 3; +} + +message QueuedStakingResponse { + string staking_coin_denom = 1; + + string amount = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + google.protobuf.Timestamp end_time = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message RewardsResponse { + string staking_coin_denom = 1; + + repeated cosmos.base.v1beta1.Coin rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message UnharvestedRewardsResponse { + string staking_coin_denom = 1; + + repeated cosmos.base.v1beta1.Coin rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message HistoricalRewardsResponse { + uint64 epoch = 1; + + repeated cosmos.base.v1beta1.DecCoin cumulative_unit_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/farming/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/tx.proto new file mode 100644 index 000000000..9eea2ed09 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/farming/v1beta1/tx.proto @@ -0,0 +1,188 @@ +syntax = "proto3"; + +package crescent.farming.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/farming/types"; + +// Msg defines the farming Msg service. +service Msg { + // CreateFixedAmountPlan defines a method for creating a new fixed amount + // farming plan + rpc CreateFixedAmountPlan(MsgCreateFixedAmountPlan) returns (MsgCreateFixedAmountPlanResponse); + + // CreateRatioPlan defines a method for creating a new ratio farming plan + rpc CreateRatioPlan(MsgCreateRatioPlan) returns (MsgCreateRatioPlanResponse); + + // Stake defines a method for staking coins into the farming plan + rpc Stake(MsgStake) returns (MsgStakeResponse); + + // Unstake defines a method for unstaking coins from the farming plan + rpc Unstake(MsgUnstake) returns (MsgUnstakeResponse); + + // Harvest defines a method for claiming farming rewards + rpc Harvest(MsgHarvest) returns (MsgHarvestResponse); + + // RemovePlan defines a method for removing a terminated plan. + rpc RemovePlan(MsgRemovePlan) returns (MsgRemovePlanResponse); + + // AdvanceEpoch defines a method for advancing epoch by one, just for testing purpose + // and shouldn't be used in real world + rpc AdvanceEpoch(MsgAdvanceEpoch) returns (MsgAdvanceEpochResponse); +} + +// MsgCreateFixedAmountPlan defines a SDK message for creating a new fixed +// amount farming plan. +message MsgCreateFixedAmountPlan { + option (gogoproto.goproto_getters) = false; + + // name specifies the name for the plan + string name = 1; + + // creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + // this creator. + string creator = 2; + + // staking_coin_weights specifies coins weight for the plan + repeated cosmos.base.v1beta1.DecCoin staking_coin_weights = 3 [ + (gogoproto.moretags) = "yaml:\"staking_coin_weights\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + + // start_time specifies the start time of the plan + google.protobuf.Timestamp start_time = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the plan + google.protobuf.Timestamp end_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + + // epoch_amount specifies the distributing amount for each epoch + repeated cosmos.base.v1beta1.Coin epoch_amount = 6 [ + (gogoproto.moretags) = "yaml:\"epoch_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// MsgCreateFixedAmountPlanResponse defines the MsgCreateFixedAmountPlanResponse response type. +message MsgCreateFixedAmountPlanResponse {} + +// MsgCreateRatioPlan defines a SDK message for creating a new ratio farming +// plan. +message MsgCreateRatioPlan { + option (gogoproto.goproto_getters) = false; + + // name specifies the name for the plan + string name = 1; + + // creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + // this creator. + string creator = 2; + + // staking_coin_weights specifies coins weight for the plan + repeated cosmos.base.v1beta1.DecCoin staking_coin_weights = 3 [ + (gogoproto.moretags) = "yaml:\"staking_coin_weights\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + + // start_time specifies the start time of the plan + google.protobuf.Timestamp start_time = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the plan + google.protobuf.Timestamp end_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + + // epoch_ratio specifies the distributing amount by ratio + string epoch_ratio = 6 [ + (gogoproto.moretags) = "yaml:\"epoch_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// MsgCreateRatioPlanResponse defines the Msg/MsgCreateRatioPlanResponse +// response type. +message MsgCreateRatioPlanResponse {} + +// MsgStake defines a SDK message for staking coins into the farming plan. +message MsgStake { + option (gogoproto.goproto_getters) = false; + + // farmer defines the bech32-encoded address of the farmer + string farmer = 1; + + // staking_coins specifies coins to stake + repeated cosmos.base.v1beta1.Coin staking_coins = 2 [ + (gogoproto.moretags) = "yaml:\"staking_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// MsgStakeResponse defines the Msg/MsgStakeResponse response type. +message MsgStakeResponse {} + +// MsgUnstake defines a SDK message for performing unstaking of coins from the +// farming plan. +message MsgUnstake { + option (gogoproto.goproto_getters) = false; + + // farmer defines the bech32-encoded address of the farmer + string farmer = 1; + + // unstaking_coins specifies coins to stake + repeated cosmos.base.v1beta1.Coin unstaking_coins = 2 [ + (gogoproto.moretags) = "yaml:\"unstaking_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// MsgUnstakeResponse defines the Msg/MsgUnstakeResponse response type. +message MsgUnstakeResponse {} + +// MsgHarvest defines a SDK message for claiming rewards from the farming plan. +message MsgHarvest { + option (gogoproto.goproto_getters) = false; + + // farmer defines the bech32-encoded address of the farmer + string farmer = 1; + + // staking_coin_denoms is the set of denoms of staked coins as a source of the reward for + // harvesting + repeated string staking_coin_denoms = 2 [(gogoproto.moretags) = "yaml:\"staking_coin_denoms\""]; +} + +// MsgHarvestResponse defines the Msg/MsgHarvestResponse response type. +message MsgHarvestResponse {} + +// MsgRemovePlan defines a message for removing a terminated plan. +message MsgRemovePlan { + option (gogoproto.goproto_getters) = false; + + string creator = 1; + + uint64 plan_id = 2 [(gogoproto.moretags) = "yaml:\"plan_id\""]; +} + +// MsgRemovePlanResponse defines the Msg/RemovePlan response type. +message MsgRemovePlanResponse {} + +// MsgAdvanceEpoch defines a message to advance epoch by one. +message MsgAdvanceEpoch { + option (gogoproto.goproto_getters) = false; + + // requester defines the bech32-encoded address of the requester + string requester = 1; +} + +// MsgAdvanceEpochResponse defines the Msg/AdvanceEpoch response type. +message MsgAdvanceEpochResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/genesis.proto new file mode 100644 index 000000000..d88e6f9ab --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/genesis.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package crescent.liquidfarming.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "crescent/liquidfarming/v1beta1/liquidfarming.proto"; +import "crescent/liquidfarming/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidfarming/types"; + +// GenesisState defines the liquidfarming module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Params params = 1 [(gogoproto.nullable) = false]; + + repeated LastRewardsAuctionIdRecord last_rewards_auction_id_record = 2 [(gogoproto.nullable) = false]; + + repeated LiquidFarm liquid_farms = 3 [(gogoproto.nullable) = false]; + + repeated RewardsAuction rewards_auctions = 4 [(gogoproto.nullable) = false]; + + repeated Bid bids = 5 [(gogoproto.nullable) = false]; + + repeated WinningBidRecord winning_bid_records = 6 [(gogoproto.nullable) = false]; + + google.protobuf.Timestamp last_rewards_auction_end_time = 7 [(gogoproto.stdtime) = true]; +} + +message LastRewardsAuctionIdRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + uint64 pool_id = 1; + + uint64 auction_id = 2; +} + +// WinningBidRecord defines a custom winning bid record that is required to be recorded +// in genesis state. +message WinningBidRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + uint64 auction_id = 1; + + Bid winning_bid = 2 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/liquidfarming.proto b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/liquidfarming.proto new file mode 100644 index 000000000..adb0bac32 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/liquidfarming.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; +package crescent.liquidfarming.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidfarming/types"; +option (gogoproto.goproto_getters_all) = false; + +// RewardsAuction defines rewards auction that is created by the module +// for every rewards_auction_duration in params. +message RewardsAuction { + // id specifies the unique auction id + uint64 id = 1; + + // pool_id specifies the liquidity pool id + uint64 pool_id = 2; + + // bidding_coin_denom specifies the bidding coin denomination + string bidding_coin_denom = 3; + + // paying_reserve_address specfies the account that reserves bidding amounts placed by bidders + string paying_reserve_address = 4; + + // start_time specifies the start time of an auction + google.protobuf.Timestamp start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // end_time specifies the end time of an auction + google.protobuf.Timestamp end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // status specifies the status of an auction + AuctionStatus status = 7; + + // winner specifies the bidder who won the auction + // the value is determined when an auction is finished + string winner = 8; + + // winning_amount specifies the winning amount for the uaction + cosmos.base.v1beta1.Coin winning_amount = 9 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + + // rewards specifies the farming rewards for are accumulated in the farm module + // the value is determined when an auction is finished + repeated cosmos.base.v1beta1.Coin rewards = 10 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + repeated cosmos.base.v1beta1.Coin fees = 11 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + string fee_rate = 12 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// CompoundingRewards records the amount of pool coin that is used for a bidder to place a bid +// for an auction. It is used internally to calculate unfarm amount. +message CompoundingRewards { + option (gogoproto.goproto_getters) = false; + + string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// Bid defines standard bid for a rewards auction. +message Bid { + option (gogoproto.goproto_getters) = false; + + // pool_id specifies the pool id + uint64 pool_id = 1; + + // bidder specifies the bech32-encoded address that places a bid for the auction + string bidder = 2; + + // amount specifies the amount to place a bid + cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; +} + +// AuctionStatus enumerates the valid status of an auction. +enum AuctionStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // AUCTION_STATUS_UNSPECIFIED defines the default auction status + AUCTION_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "AuctionStatusNil"]; + + // AUCTION_STATUS_STARTED defines the started auction status + AUCTION_STATUS_STARTED = 1 [(gogoproto.enumvalue_customname) = "AuctionStatusStarted"]; + + // AUCTION_STATUS_FINISHED defines the finished auction status + AUCTION_STATUS_FINISHED = 2 [(gogoproto.enumvalue_customname) = "AuctionStatusFinished"]; + + // AUCTION_STATUS_SKIPPED defines the skipped auction status + AUCTION_STATUS_SKIPPED = 3 [(gogoproto.enumvalue_customname) = "AuctionStatusSkipped"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/params.proto b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/params.proto new file mode 100644 index 000000000..45e6db74b --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/params.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package crescent.liquidfarming.v1beta1; + +import "google/protobuf/duration.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidfarming/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_getters) = false; + + string fee_collector = 1; + + google.protobuf.Duration rewards_auction_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + repeated LiquidFarm liquid_farms = 3 [(gogoproto.nullable) = false]; +} + +// LiquidFarm defines liquid farm object that provides auto compounding functionality +// for the liquidity pool and undergoes farming rewards auction process. +// See the technical spec for more detailed information. +message LiquidFarm { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + uint64 pool_id = 1; + + string min_farm_amount = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string min_bid_amount = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string fee_rate = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/query.proto new file mode 100644 index 000000000..0368e3535 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/query.proto @@ -0,0 +1,178 @@ +syntax = "proto3"; +package crescent.liquidfarming.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "crescent/liquidfarming/v1beta1/liquidfarming.proto"; +import "crescent/liquidfarming/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidfarming/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns parameters of the module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/params"; + } + + // LiquidFarms returns all liquid farms registered in params + rpc LiquidFarms(QueryLiquidFarmsRequest) returns (QueryLiquidFarmsResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms"; + } + + // LiquidFarm returns the specific liquid farm + rpc LiquidFarm(QueryLiquidFarmRequest) returns (QueryLiquidFarmResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}"; + } + + // RewardsAuctions returns all rewards auctions that correspond to the given pool id + rpc RewardsAuctions(QueryRewardsAuctionsRequest) returns (QueryRewardsAuctionsResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}/rewards_auctions"; + } + + // RewardsAuction returns the specific rewards auction + rpc RewardsAuction(QueryRewardsAuctionRequest) returns (QueryRewardsAuctionResponse) { + option (google.api.http).get = + "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}/rewards_auctions/{auction_id}"; + } + + // Bids returns all bids for the liquid farm + rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}/bids"; + } + + // Rewards returns all accumulated farming rewards for the liquid farm + rpc Rewards(QueryRewardsRequest) returns (QueryRewardsResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}/rewards"; + } + + // ExchangeRate returns exchange rates (mint rate and burn rate) for the liquid farm + rpc ExchangeRate(QueryExchangeRateRequest) returns (QueryExchangeRateResponse) { + option (google.api.http).get = "/crescent/liquidfarming/v1beta1/liquidfarms/{pool_id}/exchange_rate"; + } +} + +// QueryLiquidFarmsRequest is the request type for the Query/LiquidFarms RPC method. +message QueryLiquidFarmsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryLiquidFarmsResponse is response type for the Query/LiquidFarms RPC method. +message QueryLiquidFarmsResponse { + repeated LiquidFarmResponse liquid_farms = 1 [(gogoproto.nullable) = false]; +} + +// QueryLiquidFarmRequest is the request type for the Query/LiquidFarm RPC method. +message QueryLiquidFarmRequest { + uint64 pool_id = 1; +} + +// QueryLiquidFarmResponse is response type for the Query/LiquidFarm RPC method. +message QueryLiquidFarmResponse { + LiquidFarmResponse liquid_farm = 1 [(gogoproto.nullable) = false]; +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryRewardsAuctionsRequest is request type for the Query/RewardsAuctions RPC method. +message QueryRewardsAuctionsRequest { + uint64 pool_id = 1; + string status = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryRewardsAuctionsResponse is response type for the Query/RewardsAuctions RPC method. +message QueryRewardsAuctionsResponse { + repeated RewardsAuction rewards_auctions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRewardsAuctionRequest is request type for the Query/RewardsAuction RPC method. +message QueryRewardsAuctionRequest { + uint64 auction_id = 1; + uint64 pool_id = 2; +} + +// QueryRewardsAuctionResponse is response type for the Query/RewardsAuction RPC method. +message QueryRewardsAuctionResponse { + RewardsAuction rewards_auction = 1 [(gogoproto.nullable) = false]; +} + +// QueryBidsRequest is request type for the Query/Bids RPC method. +message QueryBidsRequest { + uint64 pool_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryBidsResponse is response type for the Query/Bids RPC method. +message QueryBidsResponse { + repeated Bid bids = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRewardsRequest is request type for the Query/Rewards RPC method. +message QueryRewardsRequest { + uint64 pool_id = 1; +} + +// QueryRewardsResponse is response type for the Query/Rewards RPC method. +message QueryRewardsResponse { + repeated cosmos.base.v1beta1.Coin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// QueryExchangeRateRequest is request type for the Query/ExchangeRate RPC method. +message QueryExchangeRateRequest { + uint64 pool_id = 1; +} + +// QueryExchangeRateResponse is response type for the Query/ExchangeRate RPC method. +message QueryExchangeRateResponse { + ExchangeRateResponse exchange_rate = 1 [(gogoproto.nullable) = false]; +} + +// +// Custom response messages +// + +// LiquidFarmResponse is response type for the Query/LiquidFarm RPC method. +message LiquidFarmResponse { + uint64 pool_id = 1; + + string liquid_farm_reserve_address = 2; + + string lf_coin_denom = 3 [(gogoproto.customname) = "LFCoinDenom"]; + + string lf_coin_supply = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.customname) = "LFCoinSupply" + ]; + + string pool_coin_denom = 5; + + string pool_coin_farming_amount = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string min_farm_amount = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string min_bid_amount = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +message ExchangeRateResponse { + string mint_rate = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + string burn_rate = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/tx.proto new file mode 100644 index 000000000..9e6a062a4 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidfarming/v1beta1/tx.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package crescent.liquidfarming.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidfarming/types"; + +// Msg defines the Msg service. +service Msg { + // LiquidFarm defines a method for farming pool coin for a liquid farm + rpc LiquidFarm(MsgLiquidFarm) returns (MsgLiquidFarmResponse); + + // LiquidUnfarm defines a method for unfarming amount of LFCoin + rpc LiquidUnfarm(MsgLiquidUnfarm) returns (MsgLiquidUnfarmResponse); + + // LiquidUnfarmAndWithdraw defines a method for unfarming amount of LFCoin and withdraw pool coin from the pool + rpc LiquidUnfarmAndWithdraw(MsgLiquidUnfarmAndWithdraw) returns (MsgLiquidUnfarmAndWithdrawResponse); + + // PlaceBid defines a method for placing a bid for a rewards auction + rpc PlaceBid(MsgPlaceBid) returns (MsgPlaceBidResponse); + + // RefundBid defines a method for refunding the bid that is not winning for the auction + rpc RefundBid(MsgRefundBid) returns (MsgRefundBidResponse); + + // AdvanceAuction defines a method for advancing rewards auction by one. + // This Msg is defined just for testing purpose and it shouldn't be used in production. + rpc AdvanceAuction(MsgAdvanceAuction) returns (MsgAdvanceAuctionResponse); +} + +// MsgLiquidFarm defines a SDK message for farming pool coin for a liquid farm. +message MsgLiquidFarm { + option (gogoproto.goproto_getters) = false; + + uint64 pool_id = 1; + + string farmer = 2; + + cosmos.base.v1beta1.Coin farming_coin = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; +} + +// MsgLiquidFarmResponse defines the MsgLiquidFarmResponse response type. +message MsgLiquidFarmResponse {} + +// MsgLiquidUnfarm defines a SDK message for unfarming LFCoin. +message MsgLiquidUnfarm { + option (gogoproto.goproto_getters) = false; + + uint64 pool_id = 1; + + string farmer = 2; + + cosmos.base.v1beta1.Coin unfarming_coin = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; +} + +// MsgLiquidUnfarmResponse defines the MsgLiquidUnfarmResponse response type. +message MsgLiquidUnfarmResponse {} + +// MsgLiquidUnfarmAndWithdraw defines a SDK message for unfarming LFCoin. +message MsgLiquidUnfarmAndWithdraw { + option (gogoproto.goproto_getters) = false; + + uint64 pool_id = 1; + + string farmer = 2; + + cosmos.base.v1beta1.Coin unfarming_coin = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; +} + +// MsgLiquidUnfarmAndWithdrawResponse defines the MsgLiquidUnfarmAndWithdrawResponse response type. +message MsgLiquidUnfarmAndWithdrawResponse {} + +// MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. +message MsgPlaceBid { + option (gogoproto.goproto_getters) = false; + + uint64 auction_id = 1; + + uint64 pool_id = 2; + + string bidder = 3; + + cosmos.base.v1beta1.Coin bidding_coin = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; +} + +// MsgPlaceBidResponse defines the MsgPlaceBidResponse response type. +message MsgPlaceBidResponse {} + +// MsgRefundBid defines a SDK message for refunding the bid that is not winning for the auction. +message MsgRefundBid { + option (gogoproto.goproto_getters) = false; + + uint64 auction_id = 1; + + uint64 pool_id = 2; + + string bidder = 3; +} + +// MsgRefundBidResponse defines the MsgRefundBidResponse response type. +message MsgRefundBidResponse {} + +// MsgAdvanceAuction defines a message to advance rewards auction by one. +message MsgAdvanceAuction { + option (gogoproto.goproto_getters) = false; + + // requester defines the bech32-encoded address of the requester + string requester = 1; +} + +// MsgAdvanceAuctionResponse defines the Msg/AdvanceAuction response type. +message MsgAdvanceAuctionResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/genesis.proto new file mode 100644 index 000000000..bb294e5db --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/genesis.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package crescent.liquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/liquidity/v1beta1/liquidity.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidity/types"; +option (gogoproto.goproto_getters_all) = false; + +// GenesisState defines the liquidity module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + + uint64 last_pair_id = 2; + + uint64 last_pool_id = 3; + + repeated Pair pairs = 4 [(gogoproto.nullable) = false]; + + repeated Pool pools = 5 [(gogoproto.nullable) = false]; + + repeated DepositRequest deposit_requests = 6 [(gogoproto.nullable) = false]; + + repeated WithdrawRequest withdraw_requests = 7 [(gogoproto.nullable) = false]; + + repeated Order orders = 8 [(gogoproto.nullable) = false]; + + repeated NumMMOrdersRecord num_market_making_orders_records = 9 [(gogoproto.nullable) = false]; +} + +// NumMMOrdersRecord holds information about how many MM orders an orderer +// ordered per pair. +message NumMMOrdersRecord { + string orderer = 1; + uint64 pair_id = 2; + uint32 num_market_making_orders = 3; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/liquidity.proto b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/liquidity.proto new file mode 100644 index 000000000..cbbfe592e --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/liquidity.proto @@ -0,0 +1,285 @@ +syntax = "proto3"; +package crescent.liquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidity/types"; +option (gogoproto.goproto_getters_all) = false; + +// Params defines the parameters for the liquidity module. +message Params { + uint32 batch_size = 1; + + uint32 tick_precision = 2; + + string fee_collector_address = 3; + + string dust_collector_address = 4; + + string min_initial_pool_coin_supply = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + repeated cosmos.base.v1beta1.Coin pair_creation_fee = 6 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + repeated cosmos.base.v1beta1.Coin pool_creation_fee = 7 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + string min_initial_deposit_amount = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string max_price_limit_ratio = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + uint32 max_num_market_making_order_ticks = 10; + + uint32 max_num_market_making_orders_per_pair = 11; + + google.protobuf.Duration max_order_lifespan = 12 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + string swap_fee_rate = 13 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + string withdraw_fee_rate = 14 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + uint64 deposit_extra_gas = 15 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + + uint64 withdraw_extra_gas = 16 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + + uint64 order_extra_gas = 17 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + + uint32 max_num_active_pools_per_pair = 18; +} + +// Pair defines a coin pair. +message Pair { + uint64 id = 1; + + string base_coin_denom = 2; + + string quote_coin_denom = 3; + + string escrow_address = 4; + + uint64 last_order_id = 5; + + string last_price = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + uint64 current_batch_id = 7; +} + +// Pool defines generic liquidity pool object which can be either a basic pool or a +// ranged pool. +message Pool { + PoolType type = 1; + + uint64 id = 2; + + uint64 pair_id = 3; + + string creator = 4; + + string reserve_address = 5; + + string pool_coin_denom = 6; + + string min_price = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + string max_price = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + uint64 last_deposit_request_id = 9; + + uint64 last_withdraw_request_id = 10; + + bool disabled = 11; +} + +// DepositRequest defines a deposit request. +message DepositRequest { + // id specifies the id for the request + uint64 id = 1; + + // pool_id specifies the pool id + uint64 pool_id = 2; + + // msg_height specifies the block height when the request is stored for the batch execution + int64 msg_height = 3; + + // depositor specifies the bech32-encoded address that makes a deposit to the pool + string depositor = 4; + + // deposit_coins specifies the amount of coins to deposit. + repeated cosmos.base.v1beta1.Coin deposit_coins = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + // accepted_coins specifies the amount of coins that are accepted. + repeated cosmos.base.v1beta1.Coin accepted_coins = 6 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + cosmos.base.v1beta1.Coin minted_pool_coin = 7 [(gogoproto.nullable) = false]; + + RequestStatus status = 8; +} + +// WithdrawRequest defines a withdraw request. +message WithdrawRequest { + // id specifies the id for the request + uint64 id = 1; + + // pool_id specifies the pool id + uint64 pool_id = 2; + + // msg_height specifies the block height when the request is stored for the batch execution + int64 msg_height = 3; + + // withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool + string withdrawer = 4; + + // pool_coin specifies the pool coin that is a proof of liquidity provider for the pool + cosmos.base.v1beta1.Coin pool_coin = 5 [(gogoproto.nullable) = false]; + + // withdrawn_coins specifies the amount of coins that are withdrawn. + repeated cosmos.base.v1beta1.Coin withdrawn_coins = 6 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + RequestStatus status = 7; +} + +// Order defines an order. +message Order { + // type specifies the typo of the order + OrderType type = 1; + + // id specifies the id of the order + uint64 id = 2; + + // pair_id specifies the pair id + uint64 pair_id = 3; + + // msg_height specifies the block height when the order is stored for the batch execution + int64 msg_height = 4; + + // orderer specifies the bech32-encoded address that makes an order + string orderer = 5; + + // direction specifies the order direction; either buy or sell + OrderDirection direction = 6; + + cosmos.base.v1beta1.Coin offer_coin = 7 [(gogoproto.nullable) = false]; + + // remaining_offer_coin specifies the remaining offer coin + cosmos.base.v1beta1.Coin remaining_offer_coin = 8 [(gogoproto.nullable) = false]; + + // received_coin specifies the received coin after the swap + cosmos.base.v1beta1.Coin received_coin = 9 [(gogoproto.nullable) = false]; + + // price specifies the price that an orderer is willing to swap + string price = 10 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + string amount = 11 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string open_amount = 12 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // batch_id specifies the pair's batch id when the request is stored + uint64 batch_id = 13; + + google.protobuf.Timestamp expire_at = 14 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + OrderStatus status = 15; +} + +// PoolType enumerates pool types. +enum PoolType { + option (gogoproto.goproto_enum_prefix) = false; + + // POOL_TYPE_UNSPECIFIED specifies unknown pool type + POOL_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "PoolTypeUnspecified"]; + + // POOL_TYPE_BASIC specifies the basic pool type + POOL_TYPE_BASIC = 1 [(gogoproto.enumvalue_customname) = "PoolTypeBasic"]; + + // POOL_TYPE_RANGED specifies the ranged pool type + POOL_TYPE_RANGED = 2 [(gogoproto.enumvalue_customname) = "PoolTypeRanged"]; +} + +// OrderType enumerates order types. +enum OrderType { + option (gogoproto.goproto_enum_prefix) = false; + + // ORDER_TYPE_UNSPECIFIED specifies unknown order type. + ORDER_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OrderTypeUnspecified"]; + + // ORDER_TYPE_LIMIT specifies limit order type. + ORDER_TYPE_LIMIT = 1 [(gogoproto.enumvalue_customname) = "OrderTypeLimit"]; + + // ORDER_TYPE_MARKET specifies market order type. + ORDER_TYPE_MARKET = 2 [(gogoproto.enumvalue_customname) = "OrderTypeMarket"]; + + // ORDER_TYPE_MM specifies MM(market making) order type. + ORDER_TYPE_MM = 3 [(gogoproto.enumvalue_customname) = "OrderTypeMM"]; +} + +// OrderDirection enumerates order directions. +enum OrderDirection { + option (gogoproto.goproto_enum_prefix) = false; + + // ORDER_DIRECTION_UNSPECIFIED specifies unknown order direction + ORDER_DIRECTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OrderDirectionUnspecified"]; + + // ORDER_DIRECTION_BUY specifies buy(swap quote coin to base coin) order direction + ORDER_DIRECTION_BUY = 1 [(gogoproto.enumvalue_customname) = "OrderDirectionBuy"]; + + // ORDER_DIRECTION_SELL specifies sell(swap base coin to quote coin) order direction + ORDER_DIRECTION_SELL = 2 [(gogoproto.enumvalue_customname) = "OrderDirectionSell"]; +} + +// RequestStatus enumerates request statuses. +enum RequestStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // REQUEST_STATUS_UNSPECIFIED specifies unknown request status + REQUEST_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "RequestStatusUnspecified"]; + + // REQUEST_STATUS_NOT_EXECUTED indicates the request is not executed yet + REQUEST_STATUS_NOT_EXECUTED = 1 [(gogoproto.enumvalue_customname) = "RequestStatusNotExecuted"]; + + // REQUEST_STATUS_SUCCEEDED indicates the request has been succeeded + REQUEST_STATUS_SUCCEEDED = 2 [(gogoproto.enumvalue_customname) = "RequestStatusSucceeded"]; + + // REQUEST_STATUS_FAILED indicates the request is failed + REQUEST_STATUS_FAILED = 3 [(gogoproto.enumvalue_customname) = "RequestStatusFailed"]; +} + +// OrderStatus enumerates order statuses. +enum OrderStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // ORDER_STATUS_UNSPECIFIED specifies unknown order status + ORDER_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OrderStatusUnspecified"]; + + // ORDER_STATUS_NOT_EXECUTED indicates the order has not been executed yet + ORDER_STATUS_NOT_EXECUTED = 1 [(gogoproto.enumvalue_customname) = "OrderStatusNotExecuted"]; + + // ORDER_STATUS_NOT_MATCHED indicates the order has been executed but has no match + ORDER_STATUS_NOT_MATCHED = 2 [(gogoproto.enumvalue_customname) = "OrderStatusNotMatched"]; + + // ORDER_STATUS_PARTIALLY_MATCHED indicates the order has been partially matched + ORDER_STATUS_PARTIALLY_MATCHED = 3 [(gogoproto.enumvalue_customname) = "OrderStatusPartiallyMatched"]; + + // ORDER_STATUS_COMPLETED indicates the order has been fully matched and completed + ORDER_STATUS_COMPLETED = 4 [(gogoproto.enumvalue_customname) = "OrderStatusCompleted"]; + + // ORDER_STATUS_CANCELED indicates the order has been canceled + ORDER_STATUS_CANCELED = 5 [(gogoproto.enumvalue_customname) = "OrderStatusCanceled"]; + + // ORDER_STATUS_EXPIRED indicates the order has been expired + ORDER_STATUS_EXPIRED = 6 [(gogoproto.enumvalue_customname) = "OrderStatusExpired"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/query.proto new file mode 100644 index 000000000..2d67689eb --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/query.proto @@ -0,0 +1,326 @@ +syntax = "proto3"; +package crescent.liquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "crescent/liquidity/v1beta1/liquidity.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidity/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/params"; + } + + // Pools returns all liquidity pools. + rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools"; + } + + // Pool returns the specific liquidity pool. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/{pool_id}"; + } + + // PoolByReserveAddress returns all pools that correspond to the reserve account. + rpc PoolByReserveAddress(QueryPoolByReserveAddressRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/reserve_address/{reserve_address}"; + } + + // PoolByPoolCoinDenom returns all pools that correspond to the pool coin denom. + rpc PoolByPoolCoinDenom(QueryPoolByPoolCoinDenomRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/pool_coin_denom/{pool_coin_denom}"; + } + + // Pairs returns all liquidity pairs. + rpc Pairs(QueryPairsRequest) returns (QueryPairsResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pairs"; + } + + // Pair returns the specific pair. + rpc Pair(QueryPairRequest) returns (QueryPairResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pairs/{pair_id}"; + } + + // DepositRequests returns all deposit requests. + rpc DepositRequests(QueryDepositRequestsRequest) returns (QueryDepositRequestsResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/{pool_id}/deposit_requests"; + } + + // DepositRequest returns the specific deposit request. + rpc DepositRequest(QueryDepositRequestRequest) returns (QueryDepositRequestResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/{pool_id}/deposit_requests/{id}"; + } + + // WithdrawRequests returns all withdraw requests. + rpc WithdrawRequests(QueryWithdrawRequestsRequest) returns (QueryWithdrawRequestsResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/{pool_id}/withdraw_requests"; + } + + // WithdrawRequest returns the specific withdraw request. + rpc WithdrawRequest(QueryWithdrawRequestRequest) returns (QueryWithdrawRequestResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pools/{pool_id}/withdraw_requests/{id}"; + } + + // Orders returns all orders within the pair. + rpc Orders(QueryOrdersRequest) returns (QueryOrdersResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pairs/{pair_id}/orders"; + } + + // Order returns the specific order. + rpc Order(QueryOrderRequest) returns (QueryOrderResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/pairs/{pair_id}/orders/{id}"; + } + + // OrdersByOrderer returns orders made by an orderer. + rpc OrdersByOrderer(QueryOrdersByOrdererRequest) returns (QueryOrdersResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/orders/{orderer}"; + } + + rpc OrderBooks(QueryOrderBooksRequest) returns (QueryOrderBooksResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/order_books"; + } + + rpc NumMMOrders(QueryNumMMOrdersRequest) returns (QueryNumMMOrdersResponse) { + option (google.api.http).get = "/crescent/liquidity/v1beta1/num_mm_orders/{orderer}/{pair_id}"; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryPoolsRequest is request type for the Query/Pools RPC method. +message QueryPoolsRequest { + uint64 pair_id = 1; + + string disabled = 2; + + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryPoolsResponse is response type for the Query/Pools RPC method. +message QueryPoolsResponse { + repeated PoolResponse pools = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest { + uint64 pool_id = 1; +} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + PoolResponse pool = 1 [(gogoproto.nullable) = false]; +} + +// QueryPoolByReserveAddressRequest is request type for the Query/PoolByReserveAddress RPC method. +message QueryPoolByReserveAddressRequest { + string reserve_address = 1; +} + +// QueryPoolByPoolCoinDenomRequest is request type for the Query/PoolByPoolCoinDenom RPC method. +message QueryPoolByPoolCoinDenomRequest { + string pool_coin_denom = 1; +} + +// QueryPairsRequest is request type for the Query/Pairs RPC method. +message QueryPairsRequest { + repeated string denoms = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryPairsResponse is response type for the Query/Pairs RPC method. +message QueryPairsResponse { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPairRequest is request type for the Query/Pair RPC method. +message QueryPairRequest { + uint64 pair_id = 1; +} + +// QueryPairResponse is response type for the Query/Pair RPC method. +message QueryPairResponse { + Pair pair = 1 [(gogoproto.nullable) = false]; +} + +// QueryDepositRequestsRequest is request type for the Query/DepositRequests RPC method. +message QueryDepositRequestsRequest { + uint64 pool_id = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositRequestsResponse is response type for the Query/DepositRequests RPC method. +message QueryDepositRequestsResponse { + repeated DepositRequest deposit_requests = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDepositRequestRequest is request type for the Query/DepositRequest RPC method. +message QueryDepositRequestRequest { + uint64 pool_id = 1; + uint64 id = 2; +} + +// QueryDepositRequestResponse is response type for the Query/DepositRequest RPC method. +message QueryDepositRequestResponse { + DepositRequest deposit_request = 1 [(gogoproto.nullable) = false]; +} + +// QueryWithdrawRequestsRequest is request type for the Query/WithdrawRequests RPC method. +message QueryWithdrawRequestsRequest { + uint64 pool_id = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryWithdrawRequestsResponse is response type for the Query/WithdrawRequests RPC method. +message QueryWithdrawRequestsResponse { + repeated WithdrawRequest withdraw_requests = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWithdrawRequestRequest is request type for the Query/WithdrawRequest RPC method. +message QueryWithdrawRequestRequest { + uint64 pool_id = 1; + uint64 id = 2; +} + +// QueryWithdrawRequestResponse is response type for the Query/WithdrawRequest RPC method. +message QueryWithdrawRequestResponse { + WithdrawRequest withdraw_request = 1 [(gogoproto.nullable) = false]; +} + +// QueryOrdersRequest is request type for the Query/Orders RPC method. +message QueryOrdersRequest { + uint64 pair_id = 1; + + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryOrdersResponse is response type for the Query/Orders RPC method. +message QueryOrdersResponse { + repeated Order orders = 1 [(gogoproto.nullable) = false]; + + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryOrderRequest is request type for the Query/Order RPC method. +message QueryOrderRequest { + uint64 pair_id = 1; + uint64 id = 2; +} + +// QueryOrderResponse is response type for the Query/Order RPC method. +message QueryOrderResponse { + Order order = 1 [(gogoproto.nullable) = false]; +} + +// QueryOrdersByOrdererRequest is request type for the Query/OrdersByOrderer RPC method. +message QueryOrdersByOrdererRequest { + string orderer = 1; + uint64 pair_id = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryOrderBooksRequest is request type for the Query/OrderBooks RPC method. +message QueryOrderBooksRequest { + repeated uint64 pair_ids = 1; + repeated uint32 price_unit_powers = 2; + uint32 num_ticks = 3; +} + +// QueryOrderBooksResponse is response type for Query/OrderBooks RPC method. +message QueryOrderBooksResponse { + repeated OrderBookPairResponse pairs = 2 [(gogoproto.nullable) = false]; +} + +message QueryNumMMOrdersRequest { + string orderer = 1; + uint64 pair_id = 2; +} + +message QueryNumMMOrdersResponse { + uint32 num_market_making_orders = 1; +} + +// +// Custom response messages +// + +// PoolResponse defines a custom pool response message. +message PoolResponse { + PoolType type = 1; + + uint64 id = 2; + + uint64 pair_id = 3; + + string creator = 4; + + string reserve_address = 5; + + string pool_coin_denom = 6; + + string pool_coin_supply = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + string min_price = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + string max_price = 9 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + string price = 10 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + + PoolBalances balances = 11 [(gogoproto.nullable) = false]; + + uint64 last_deposit_request_id = 12; + + uint64 last_withdraw_request_id = 13; + + bool disabled = 14; +} + +message PoolBalances { + cosmos.base.v1beta1.Coin base_coin = 1 [(gogoproto.nullable) = false]; + + cosmos.base.v1beta1.Coin quote_coin = 2 [(gogoproto.nullable) = false]; +} + +message OrderBookPairResponse { + uint64 pair_id = 1; + string base_price = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + repeated OrderBookResponse order_books = 3 [(gogoproto.nullable) = false]; +} + +message OrderBookResponse { + string price_unit = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + repeated OrderBookTickResponse sells = 2 [(gogoproto.nullable) = false]; + repeated OrderBookTickResponse buys = 3 [(gogoproto.nullable) = false]; +} + +message OrderBookTickResponse { + string price = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string user_order_amount = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string pool_order_amount = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/tx.proto new file mode 100644 index 000000000..2df1c4fcc --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidity/v1beta1/tx.proto @@ -0,0 +1,243 @@ +syntax = "proto3"; +package crescent.liquidity.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; +import "crescent/liquidity/v1beta1/liquidity.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidity/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the Msg service. +service Msg { + // CreatePair defines a method for creating a pair + rpc CreatePair(MsgCreatePair) returns (MsgCreatePairResponse); + + // CreatePool defines a method for creating a pool + rpc CreatePool(MsgCreatePool) returns (MsgCreatePoolResponse); + + // CreateRangePool defines a method for creating a ranged pool + rpc CreateRangedPool(MsgCreateRangedPool) returns (MsgCreateRangedPoolResponse); + + // Deposit defines a method for depositing coins to the pool + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // Withdraw defines a method for withdrawing pool coin from the pool + rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse); + + // LimitOrder defines a method for making a limit order + rpc LimitOrder(MsgLimitOrder) returns (MsgLimitOrderResponse); + + // MarketOrder defines a method for making a market order + rpc MarketOrder(MsgMarketOrder) returns (MsgMarketOrderResponse); + + // MsgMMOrder defines a method for making a MM(market making) order + rpc MMOrder(MsgMMOrder) returns (MsgMMOrderResponse); + + // CancelOrder defines a method for cancelling an order + rpc CancelOrder(MsgCancelOrder) returns (MsgCancelOrderResponse); + + // CancelAllOrders defines a method for cancelling all orders + rpc CancelAllOrders(MsgCancelAllOrders) returns (MsgCancelAllOrdersResponse); +} + +// MsgCreatePair defines an SDK message for creating a pair. +message MsgCreatePair { + // creator specifies the bech32-encoded address that is the pair creator. + string creator = 1; + + // base_coin_denom specifies the base coin denom of the pair. + string base_coin_denom = 2; + + // quote_coin_denom specifies the quote coin denom of the pair. + string quote_coin_denom = 3; +} + +message MsgCreatePairResponse {} + +// MsgCreatePool defines an SDK message for creating a pool. +message MsgCreatePool { + // creator specifies the bech32-encoded address that is the pool creator + string creator = 1; + + // pair_id specifies the pair id. + uint64 pair_id = 2; + + // deposit_coins specifies the amount of coins to deposit. + repeated cosmos.base.v1beta1.Coin deposit_coins = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// MsgCreatePoolResponse defines the Msg/CreatePool response type. +message MsgCreatePoolResponse {} + +// MsgCreateRangedPool defines an SDK message for creating a ranged pool. +message MsgCreateRangedPool { + // creator specifies the bech32-encoded address that is the pool creator + string creator = 1; + + // pair_id specifies the pair id. + uint64 pair_id = 2; + + // deposit_coins specifies the amount of coins to deposit. + repeated cosmos.base.v1beta1.Coin deposit_coins = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + string min_price = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + string max_price = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + string initial_price = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// MsgCreateRangedPoolResponse defines the Msg/CreateRangedPool response type. +message MsgCreateRangedPoolResponse {} + +// MsgDeposit defines an SDK message for depositing coins to the pool +message MsgDeposit { + // depositor specifies the bech32-encoded address that makes a deposit to the pool + string depositor = 1; + + // pool_id specifies the pool id + uint64 pool_id = 2; + + // deposit_coins specifies the amount of coins to deposit. + repeated cosmos.base.v1beta1.Coin deposit_coins = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} + +// MsgWithdraw defines an SDK message for withdrawing pool coin from the pool +message MsgWithdraw { + // withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool + string withdrawer = 1; + + // pool_id specifies the pool id + uint64 pool_id = 2; + + // pool_coin specifies the pool coin that is a proof of liquidity provider for the pool + cosmos.base.v1beta1.Coin pool_coin = 3 [(gogoproto.nullable) = false]; +} + +// MsgWithdrawResponse defines the Msg/Withdraw response type. +message MsgWithdrawResponse {} + +// MsgLimitOrder defines an SDK message for making a limit order +message MsgLimitOrder { + // orderer specifies the bech32-encoded address that makes an order + string orderer = 1; + + // pair_id specifies the pair id + uint64 pair_id = 2; + + // direction specifies the order direction(buy or sell) + OrderDirection direction = 3; + + // offer_coin specifies the amount of coin the orderer offers + cosmos.base.v1beta1.Coin offer_coin = 4 [(gogoproto.nullable) = false]; + + // demand_coin_denom specifies the demand coin denom + string demand_coin_denom = 5; + + // price specifies the order price + string price = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // amount specifies the amount of base coin the orderer wants to buy or sell + string amount = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // order_lifespan specifies the order lifespan + google.protobuf.Duration order_lifespan = 8 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +// MsgLimitOrderResponse defines the Msg/LimitOrder response type. +message MsgLimitOrderResponse {} + +// MsgMarketOrder defines an SDK message for making a market order +message MsgMarketOrder { + // orderer specifies the bech32-encoded address that makes an order + string orderer = 1; + + // pair_id specifies the pair id + uint64 pair_id = 2; + + // direction specifies the order direction(buy or sell) + OrderDirection direction = 3; + + // offer_coin specifies the amount of coin the orderer offers + cosmos.base.v1beta1.Coin offer_coin = 4 [(gogoproto.nullable) = false]; + + // demand_coin_denom specifies the demand coin denom + string demand_coin_denom = 5; + + // amount specifies the amount of base coin the orderer wants to buy or sell + string amount = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // order_lifespan specifies the order lifespan + google.protobuf.Duration order_lifespan = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +// MsgMarketOrderResponse defines the Msg/MarketOrder response type. +message MsgMarketOrderResponse {} + +// MsgMMOrder defines an SDK message for making a MM(market making) order. +message MsgMMOrder { + // orderer specifies the bech32-encoded address that makes an order + string orderer = 1; + + // pair_id specifies the pair id + uint64 pair_id = 2; + + // direction specifies the order direction(buy or sell) + OrderDirection direction = 3; + + // offer_coin specifies the amount of coin the orderer offers + cosmos.base.v1beta1.Coin offer_coin = 4 [(gogoproto.nullable) = false]; + + // demand_coin_denom specifies the demand coin denom + string demand_coin_denom = 5; + + // price specifies the order price + string price = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // amount specifies the amount of base coin the orderer wants to buy or sell + string amount = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // order_lifespan specifies the order lifespan + google.protobuf.Duration order_lifespan = 8 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +// MsgMMOrderResponse defines the Msg/MMOrder response type. +message MsgMMOrderResponse {} + +// MsgCancelOrder defines an SDK message for cancelling an order +message MsgCancelOrder { + // orderer specifies the bech32-encoded address that makes an order + string orderer = 1; + + // pair_id specifies the pair id + uint64 pair_id = 2; + + // order_id specifies the order id + uint64 order_id = 3; +} + +// MsgCancelOrderResponse defines the Msg/CancelOrder response type. +message MsgCancelOrderResponse {} + +// MsgCancelAllOrders defines an SDK message for cancelling all orders +message MsgCancelAllOrders { + // orderer specifies the bech32-encoded address that makes an order + string orderer = 1; + + // pair_ids specifies pair ids to cancel orders + repeated uint64 pair_ids = 2; +} + +// MsgCancelAllOrdersResponse defines the Msg/CancelAllOrders response type. +message MsgCancelAllOrdersResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/genesis.proto new file mode 100644 index 000000000..592a3717e --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package crescent.liquidstaking.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/liquidstaking/v1beta1/liquidstaking.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidstaking/types"; +option (gogoproto.equal_all) = true; + +// GenesisState defines the liquidstaking module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters for the liquidstaking module + Params params = 1 [(gogoproto.nullable) = false]; + + repeated LiquidValidator liquid_validators = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquid_validators\""]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/liquidstaking.proto b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/liquidstaking.proto new file mode 100644 index 000000000..775189a42 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/liquidstaking.proto @@ -0,0 +1,177 @@ +syntax = "proto3"; + +package crescent.liquidstaking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidstaking/types"; + +// Params defines the set of params for the liquidstaking module. +message Params { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // LiquidBondDenom specifies the denomination of the token receiving after LiquidStaking, The value is calculated + // through NetAmount. + string liquid_bond_denom = 1 [(gogoproto.moretags) = "yaml:\"liquid_bond_denom\""]; + + // WhitelistedValidators specifies the validators elected to become Active Liquid Validators. + repeated WhitelistedValidator whitelisted_validators = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"whitelisted_validators\""]; + + // UnstakeFeeRate specifies the fee rate when liquid unstake is requested, unbonded by subtracting it from + // unbondingAmount + string unstake_fee_rate = 3 [ + (gogoproto.moretags) = "yaml:\"unstake_fee_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // MinLiquidStakingAmount specifies the minimum number of coins to be staked to the active liquid validators on liquid + // staking to minimize decimal loss and consider gas efficiency. + string min_liquid_staking_amount = 5 [ + (gogoproto.moretags) = "yaml:\"min_liquid_staking_amount\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"1000000\"", format: "sdk.Int"} + ]; +} + +// ValidatorStatus enumerates the status of a liquid validator. +enum ValidatorStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. + VALIDATOR_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ValidatorStatusUnspecified"]; + // VALIDATOR_STATUS_ACTIVE defines the active, valid status + VALIDATOR_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "ValidatorStatusActive"]; + // VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status + VALIDATOR_STATUS_INACTIVE = 2 [(gogoproto.enumvalue_customname) = "ValidatorStatusInactive"]; +} + +// WhitelistedValidator consists of the validator operator address and the target weight, which is a value for +// calculating the real weight to be derived according to the active status. In the case of inactive, it is calculated +// as zero. +message WhitelistedValidator { + option (gogoproto.goproto_getters) = false; + + // validator_address defines the bech32-encoded address that whitelisted validator + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // target_weight specifies the target weight for liquid staking, unstaking amount, which is a value for calculating + // the real weight to be derived according to the active status + string target_weight = 2 [ + (gogoproto.moretags) = "yaml:\"target_weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"10\"", format: "sdk.Int"} + ]; +} + +// LiquidValidator defines a Validator that can be the target of LiquidStaking and LiquidUnstaking, Active, Weight, etc. +// fields are derived as functions to deal with by maintaining consistency with the state of the staking module. +message LiquidValidator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; +} + +// LiquidValidatorState is type LiquidValidator with state added to return to query results. +message LiquidValidatorState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; + + // weight specifies the weight for liquid staking, unstaking amount + string weight = 2 [ + (gogoproto.moretags) = "yaml:\"weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"10\"", format: "sdk.Int"} + ]; + + // status is the liquid validator status + ValidatorStatus status = 3; + + // del_shares define the delegation shares of the validator + string del_shares = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // liquid_tokens define the token amount worth of delegation shares of the validator (slashing applied amount) + string liquid_tokens = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// NetAmountState is type for net amount raw data and mint rate, This is a value that depends on the several module +// state every time, so it is used only for calculation and query and is not stored in kv. +message NetAmountState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = true; + + // mint_rate is bTokenTotalSupply / NetAmount + string mint_rate = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // btoken_total_supply returns the total supply of btoken(liquid_bond_denom) + string btoken_total_supply = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // net_amount is proxy account's native token balance + total liquid tokens + total remaining rewards + total + // unbonding balance + string net_amount = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // total_del_shares define the delegation shares of all liquid validators + string total_del_shares = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // total_liquid_tokens define the token amount worth of delegation shares of all liquid validator (slashing applied + // amount) + string total_liquid_tokens = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // total_remaining_rewards define the sum of remaining rewards of proxy account by all liquid validators + string total_remaining_rewards = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + + // total_unbonding_balance define the unbonding balance of proxy account by all liquid validator (slashing applied + // amount) + string total_unbonding_balance = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // proxy_acc_balance define the balance of proxy account for the native token + string proxy_acc_balance = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// VotingPower is type for current voting power of the voter including staking module's voting power and liquid staking +// module's voting power, It depends on the amount of delegation of staking module, the bonded state of the delegated +// validator, the value of btoken(liquid_bond_denom), and the pool coin and farming position containing btoken.. +message VotingPower { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // voter defines the address of the voter; bech encoded in JSON. + string voter = 1; + + // staking_voting_power return the voting power of staking that can be exercised. + string staking_voting_power = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // liquid_staking_voting_power return the voting power of liquid staking that can be exercised. + string liquid_staking_voting_power = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // validator_voting_power return the voting power of the validator if the voter is the validator operator that can be + // exercised. + string validator_voting_power = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/query.proto new file mode 100644 index 000000000..9b3cf6a1e --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/query.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; +package crescent.liquidstaking.v1beta1; + +import "google/api/annotations.proto"; +import "crescent/liquidstaking/v1beta1/liquidstaking.proto"; +import "gogoproto/gogo.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidstaking/types"; + +// Query defines the gRPC query service for the liquidstaking module. +service Query { + // Params returns parameters of the liquidstaking module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/liquidstaking/v1beta1/params"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all parameters of the liquid staking module." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/x/liquidstaking/spec" + description: "Find out more about the params" + } + }; + } + // LiquidValidators returns liquid validators with states of the liquidstaking module. + rpc LiquidValidators(QueryLiquidValidatorsRequest) returns (QueryLiquidValidatorsResponse) { + option (google.api.http).get = "/crescent/liquidstaking/v1beta1/validators"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all liquid validators of the liquid staking module." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/x/liquidstaking/spec" + description: "Find out more about the liquid validators" + } + }; + } + // VotingPower returns voting power of staking and liquid staking module's of the voter that can be exercised. + rpc VotingPower(QueryVotingPowerRequest) returns (QueryVotingPowerResponse) { + option (google.api.http).get = "/crescent/liquidstaking/v1beta1/voting_power/{voter}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns voting power of staking and liquid staking module's of the voter that can be exercised." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/x/liquidstaking/spec" + description: "Find out more about the liquid validators" + } + }; + } + + // States returns states of the liquidstaking module. + rpc States(QueryStatesRequest) returns (QueryStatesResponse) { + option (google.api.http).get = "/crescent/liquidstaking/v1beta1/states"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns states of the liquid staking module." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/x/liquidstaking/spec" + description: "Find out more about the liquid staking" + } + }; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryLiquidValidatorsRequest is the request type for the Query/LiquidValidators RPC method. +message QueryLiquidValidatorsRequest {} + +// QueryLiquidValidatorsResponse is the response type for the Query/LiquidValidators RPC method. +message QueryLiquidValidatorsResponse { + repeated LiquidValidatorState liquid_validators = 1 [(gogoproto.nullable) = false]; +} + +// QueryStatesRequest is the request type for the Query/States RPC method. +message QueryStatesRequest {} + +// QueryStatesResponse is the response type for the Query/States RPC method. +message QueryStatesResponse { + NetAmountState net_amount_state = 1 [(gogoproto.nullable) = false]; +} + +// QueryVotingPowerRequest is the request type for the Query/States RPC method. +message QueryVotingPowerRequest { + string voter = 1; +} + +// QueryVotingPowerResponse is the response type for the Query/States RPC method. +message QueryVotingPowerResponse { + VotingPower voting_power = 1 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/tx.proto new file mode 100644 index 000000000..3424952b7 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidstaking/v1beta1/tx.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package crescent.liquidstaking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidstaking/types"; + +// Msg defines the liquid staking Msg service. +service Msg { + + // LiquidStake defines a method for performing a delegation of coins + // from a delegator to whitelisted validators. + rpc LiquidStake(MsgLiquidStake) returns (MsgLiquidStakeResponse); + + // LiquidUnstake defines a method for performing an undelegation of liquid staking from a + // delegate. + rpc LiquidUnstake(MsgLiquidUnstake) returns (MsgLiquidUnstakeResponse); +} + +// MsgLiquidStake defines a SDK message for performing a liquid stake of coins +// from a delegator to whitelisted validators. +message MsgLiquidStake { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgLiquidStakeResponse defines the Msg/LiquidStake response type. +message MsgLiquidStakeResponse {} + +// MsgLiquidUnstake defines a SDK message for performing an undelegation of liquid staking from a +// delegate. +message MsgLiquidUnstake { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgLiquidUnstakeResponse defines the Msg/LiquidUnstake response type. +message MsgLiquidUnstakeResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/events.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/events.proto new file mode 100644 index 000000000..f6966c750 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/events.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; +option (gogoproto.goproto_getters_all) = false; + +message EventCreatePrivatePlan { + string creator = 1; + uint64 plan_id = 2; + string farming_pool_address = 3; +} + +message EventFarm { + string farmer = 1; + cosmos.base.v1beta1.Coin coin = 2 [(gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventUnfarm { + string farmer = 1; + cosmos.base.v1beta1.Coin coin = 2 [(gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventHarvest { + string farmer = 1; + string denom = 2; + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventTerminatePlan { + uint64 plan_id = 1; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/genesis.proto new file mode 100644 index 000000000..708d35cff --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/lpfarm/v1beta1/lpfarm.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; +option (gogoproto.goproto_getters_all) = false; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp last_block_time = 2 [(gogoproto.stdtime) = true]; + uint64 last_plan_id = 3; + uint64 num_private_plans = 4; + repeated Plan plans = 5 [(gogoproto.nullable) = false]; + repeated FarmRecord farms = 6 [(gogoproto.nullable) = false]; + repeated Position positions = 7 [(gogoproto.nullable) = false]; + repeated HistoricalRewardsRecord historical_rewards = 8 [(gogoproto.nullable) = false]; +} + +message FarmRecord { + string denom = 1; + Farm farm = 2 [(gogoproto.nullable) = false]; +} + +message HistoricalRewardsRecord { + string denom = 1; + uint64 period = 2; + HistoricalRewards historical_rewards = 3 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/lpfarm.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/lpfarm.proto new file mode 100644 index 000000000..bc819dcac --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/lpfarm.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; +option (gogoproto.goproto_getters_all) = false; + +message Params { + repeated cosmos.base.v1beta1.Coin private_plan_creation_fee = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + string fee_collector = 2; + uint32 max_num_private_plans = 3; + google.protobuf.Duration max_block_duration = 4 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +message Plan { + uint64 id = 1; + string description = 2; + string farming_pool_address = 3; + string termination_address = 4; + repeated RewardAllocation reward_allocations = 5 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + bool is_private = 8; + bool is_terminated = 9; +} + +message RewardAllocation { + string denom = 1; + uint64 pair_id = 2; + repeated cosmos.base.v1beta1.Coin rewards_per_day = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message Farm { + string total_farming_amount = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin current_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint64 period = 4; + string previous_share = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; +} + +message Position { + string farmer = 1; + string denom = 2; + string farming_amount = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + uint64 previous_period = 4; + int64 starting_block_height = 5; +} + +message HistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_unit_rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint32 reference_count = 2; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/proposal.proto new file mode 100644 index 000000000..0cce01ec9 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/proposal.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/lpfarm/v1beta1/lpfarm.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; +option (gogoproto.goproto_getters_all) = false; + +message FarmingPlanProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + repeated CreatePlanRequest create_plan_requests = 3 [(gogoproto.nullable) = false]; + repeated TerminatePlanRequest terminate_plan_requests = 4 [(gogoproto.nullable) = false]; +} + +message CreatePlanRequest { + string description = 1; + string farming_pool_address = 2; + repeated RewardAllocation reward_allocations = 3 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message TerminatePlanRequest { + uint64 plan_id = 1; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/query.proto new file mode 100644 index 000000000..d8c25dbf8 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "crescent/lpfarm/v1beta1/lpfarm.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/params"; + } + rpc Plans(QueryPlansRequest) returns (QueryPlansResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/plans"; + } + rpc Plan(QueryPlanRequest) returns (QueryPlanResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/plans/{plan_id}"; + } + rpc Farm(QueryFarmRequest) returns (QueryFarmResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/farms/{denom}"; + } + rpc Positions(QueryPositionsRequest) returns (QueryPositionsResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/positions/{farmer}"; + } + rpc Position(QueryPositionRequest) returns (QueryPositionResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/positions/{farmer}/{denom}"; + } + rpc HistoricalRewards(QueryHistoricalRewardsRequest) returns (QueryHistoricalRewardsResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/historical_rewards/{denom}"; + } + rpc TotalRewards(QueryTotalRewardsRequest) returns (QueryTotalRewardsResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/rewards/{farmer}"; + } + rpc Rewards(QueryRewardsRequest) returns (QueryRewardsResponse) { + option (google.api.http).get = "/crescent/lpfarm/v1beta1/rewards/{farmer}/{denom}"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryPlansRequest { + string farming_pool_address = 1; + string termination_address = 2; + string is_private = 3; + string is_terminated = 4; + cosmos.base.query.v1beta1.PageRequest pagination = 5; +} + +message QueryPlansResponse { + repeated Plan plans = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryPlanRequest { + uint64 plan_id = 1; +} + +message QueryPlanResponse { + Plan plan = 1 [(gogoproto.nullable) = false]; +} + +message QueryFarmRequest { + string denom = 1; +} + +message QueryFarmResponse { + Farm farm = 1 [(gogoproto.nullable) = false]; +} + +message QueryPositionsRequest { + string farmer = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryPositionsResponse { + repeated Position positions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryPositionRequest { + string farmer = 1; + string denom = 2; +} + +message QueryPositionResponse { + Position position = 1 [(gogoproto.nullable) = false]; +} + +message QueryHistoricalRewardsRequest { + string denom = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryHistoricalRewardsResponse { + repeated HistoricalRewardsResponse historical_rewards = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryTotalRewardsRequest { + string farmer = 1; +} + +message QueryTotalRewardsResponse { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +message QueryRewardsRequest { + string farmer = 1; + string denom = 2; +} + +message QueryRewardsResponse { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +message HistoricalRewardsResponse { + uint64 period = 1; + repeated cosmos.base.v1beta1.DecCoin cumulative_unit_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint32 reference_count = 3; +} diff --git a/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/tx.proto new file mode 100644 index 000000000..307026e14 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/lpfarm/v1beta1/tx.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package crescent.lpfarm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "crescent/lpfarm/v1beta1/lpfarm.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/lpfarm/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + rpc CreatePrivatePlan(MsgCreatePrivatePlan) returns (MsgCreatePrivatePlanResponse); + rpc TerminatePrivatePlan(MsgTerminatePrivatePlan) returns (MsgTerminatePrivatePlanResponse); + rpc Farm(MsgFarm) returns (MsgFarmResponse); + rpc Unfarm(MsgUnfarm) returns (MsgUnfarmResponse); + rpc Harvest(MsgHarvest) returns (MsgHarvestResponse); +} + +message MsgCreatePrivatePlan { + string creator = 1; + string description = 2; + repeated RewardAllocation reward_allocations = 3 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message MsgCreatePrivatePlanResponse { + uint64 plan_id = 1; + string farming_pool_address = 2; +} + +message MsgTerminatePrivatePlan { + string creator = 1; + uint64 plan_id = 2; +} + +message MsgTerminatePrivatePlanResponse {} + +message MsgFarm { + string farmer = 1; + cosmos.base.v1beta1.Coin coin = 2 [(gogoproto.nullable) = false]; +} + +message MsgFarmResponse { + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgUnfarm { + string farmer = 1; + cosmos.base.v1beta1.Coin coin = 2 [(gogoproto.nullable) = false]; +} + +message MsgUnfarmResponse { + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgHarvest { + string farmer = 1; + string denom = 2; +} + +message MsgHarvestResponse { + repeated cosmos.base.v1beta1.Coin withdrawn_rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marker/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/genesis.proto new file mode 100644 index 000000000..cf61dd289 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package crescent.marker.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "crescent/marker/v1beta1/marker.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marker/types"; +option (gogoproto.goproto_getters_all) = false; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp last_block_time = 2 [(gogoproto.stdtime) = true]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marker/v1beta1/marker.proto b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/marker.proto new file mode 100644 index 000000000..bb69b55e1 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/marker.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package crescent.marker.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marker/types"; +option (gogoproto.goproto_getters_all) = false; + +message Params {} diff --git a/Crescent/crescent-starter/proto/crescent/marker/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/query.proto new file mode 100644 index 000000000..5bcc6c184 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marker/v1beta1/query.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package crescent.marker.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; +import "crescent/marker/v1beta1/marker.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marker/types"; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/marker/v1beta1/params"; + } + rpc LastBlockTime(QueryLastBlockTimeRequest) returns (QueryLastBlockTimeResponse) { + option (google.api.http).get = "/crescent/marker/v1beta1/last_block_time"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryLastBlockTimeRequest {} + +message QueryLastBlockTimeResponse { + google.protobuf.Timestamp last_block_time = 1 [(gogoproto.stdtime) = true]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/genesis.proto new file mode 100644 index 000000000..78618db50 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package crescent.marketmaker.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/marketmaker/v1beta1/marketmaker.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marketmaker/types"; +option (gogoproto.equal_all) = true; + +// GenesisState defines the marketmaker module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters for the marketmaker module + Params params = 1 [(gogoproto.nullable) = false]; + + repeated MarketMaker market_makers = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"market_makers\""]; + + repeated Incentive incentives = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"incentives\""]; + + repeated DepositRecord deposit_records = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_records\""]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto new file mode 100644 index 000000000..ec7576734 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto @@ -0,0 +1,159 @@ +syntax = "proto3"; + +package crescent.marketmaker.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marketmaker/types"; + +// Params defines the set of params for the marketmaker module. +message Params { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // Address containing the funds used to distribute incentives + string incentive_budget_address = 1 [(gogoproto.moretags) = "yaml:\"incentive_budget_address\""]; + + // The amount of deposit to be applied to the market maker, which is calculated per pair and is refunded when the + // market maker included or rejected through the MarketMaker Proposal + repeated cosmos.base.v1beta1.Coin deposit_amount = 2 [ + (gogoproto.moretags) = "yaml:\"deposit_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + + // Common variables used in market maker scoring system + Common common = 3 [(gogoproto.moretags) = "yaml:\"common\"", (gogoproto.nullable) = false]; + + // Include the pairs that are incentive target pairs and the variables used in market maker scoring system + repeated IncentivePair incentive_pairs = 4 + [(gogoproto.moretags) = "yaml:\"incentive_pairs\"", (gogoproto.nullable) = false]; + ; +} + +message Common { + option (gogoproto.goproto_getters) = false; + + // Minimum ratio to maintain the tick order + string min_open_ratio = 1 [ + (gogoproto.moretags) = "yaml:\"min_open_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Minimum ratio of open amount to MinDepth + string min_open_depth_ratio = 2 [ + (gogoproto.moretags) = "yaml:\"min_open_depth_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Maximum allowable consecutive blocks of outage + uint32 max_downtime = 3 [(gogoproto.moretags) = "yaml:\"max_downtime\""]; + + // Maximum allowable sum of blocks in an hour + uint32 max_total_downtime = 4 [(gogoproto.moretags) = "yaml:\"max_total_downtime\""]; + + // Minimum value of LiveHour to achieve LiveDay + uint32 min_hours = 5 [(gogoproto.moretags) = "yaml:\"min_hours\""]; + + // Minimum value of LiveDay to maintain MM eligibility + uint32 min_days = 6 [(gogoproto.moretags) = "yaml:\"min_days\""]; +} + +message IncentivePair { + option (gogoproto.goproto_getters) = false; + + // Pair id of liquidity module + uint64 pair_id = 1 [(gogoproto.moretags) = "yaml:\"pair_id\""]; + + // Time the pair variables start to be applied to the scoring system + google.protobuf.Timestamp update_time = 2 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"update_time\""]; + + // Incentive weights for each pair + string incentive_weight = 3 [ + (gogoproto.moretags) = "yaml:\"incentive_weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Maximum allowable spread between bid and ask + string max_spread = 4 [ + (gogoproto.moretags) = "yaml:\"max_spread\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Minimum allowable price difference of high and low on both side of orders + string min_width = 5 [ + (gogoproto.moretags) = "yaml:\"min_width\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Minimum allowable order depth on each side + string min_depth = 6 [ + (gogoproto.moretags) = "yaml:\"min_depth\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// Store the total amount of incentives distributed through `MarketMakerProposal`, and it can be claimed at once through +// `MsgClaimIncentives` +message Incentive { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + + repeated cosmos.base.v1beta1.Coin claimable = 2 [ + (gogoproto.moretags) = "yaml:\"claimable\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// Market maker object created by applying, if included through `MarketMakerProposal`, eligible becomes true and is +// deleted if rejected or excluded +message MarketMaker { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + + uint64 pair_id = 2 [(gogoproto.moretags) = "yaml:\"pair_id\""]; + + bool eligible = 3 [(gogoproto.moretags) = "yaml:\"eligible\""]; +} + +// stores apply deposit amount for a future refund +message Deposit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +message DepositRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + + uint64 pair_id = 2 [(gogoproto.moretags) = "yaml:\"pair_id\""]; + + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/proposal.proto new file mode 100644 index 000000000..a863eddbf --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/proposal.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package crescent.marketmaker.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/marketmaker/v1beta1/marketmaker.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marketmaker/types"; + +message MarketMakerProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // title specifies the title of the proposal + string title = 1; + + // description specifies the description of the proposal + string description = 2; + + // set the market makers to eligible, refund deposit + repeated MarketMakerHandle inclusions = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inclusions\""]; + + // delete existing eligible market makers + repeated MarketMakerHandle exclusions = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"exclusions\""]; + + // delete the not eligible market makers, refund deposit + repeated MarketMakerHandle rejections = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rejections\""]; + + // distribute claimable incentive to eligible market makers + repeated IncentiveDistribution distributions = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"distributions\""]; +} + +message MarketMakerHandle { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + + uint64 pair_id = 2 [(gogoproto.moretags) = "yaml:\"pair_id\""]; +} + +message IncentiveDistribution { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + + uint64 pair_id = 2 [(gogoproto.moretags) = "yaml:\"pair_id\""]; + + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/query.proto new file mode 100644 index 000000000..671a68b25 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/query.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; + +package crescent.marketmaker.v1beta1; + +import "crescent/marketmaker/v1beta1/marketmaker.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marketmaker/types"; + +// Query defines the gRPC query service for the marketmaker module. +service Query { + // Params returns parameters of the marketmaker module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/marketmaker/v1beta1/params"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all parameters of the marketmaker module." + external_docs: { + url: "https://github.com/crescent-network/crescent/blob/main/x/marketmaker/spec/07_params.md" + description: "Find out more about the params" + } + }; + } + + // MarketMakers returns all market makers. + rpc MarketMakers(QueryMarketMakersRequest) returns (QueryMarketMakersResponse) { + option (google.api.http).get = "/crescent/marketmaker/v1beta1/marketmakers"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns a list of all market makers with pagination result." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + responses: { + key: "500" + value: { + description: "Internal Server Error" + examples: { + key: "application/json" + value: '{"code":13,"message":"rpc error: code = Internal desc = error","details":[]}' + } + } + } + }; + } + + // Incentive returns a specific incentive. + rpc Incentive(QueryIncentiveRequest) returns (QueryIncentiveResponse) { + option (google.api.http).get = "/crescent/marketmaker/v1beta1/incentive/{address}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns the marketmaker's claimable incentive." + external_docs: { + url: "https://github.com/crescent-network/crescent/tree/main/docs" + description: "Find out more about the query and error codes" + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"rpc error: code = InvalidArgument desc = empty request","details":[]}' + } + } + } + responses: { + key: "404" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":5,"message":"rpc error: code = NotFound desc = incentive address not found","details":[]}' + } + } + } + responses: { + key: "500" + value: { + description: "Internal Server Error" + examples: { + key: "application/json" + value: '{"code":13,"message":"rpc error: code = Internal desc = error","details":[]}' + } + } + } + }; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryMarketMakersRequest is the request type for the Query/MarketMakers RPC method. +message QueryMarketMakersRequest { + string address = 1; + uint64 pair_id = 2; + string eligible = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryMarketMakersResponse is the response type for the Query/MarketMakers RPC method. +message QueryMarketMakersResponse { + repeated MarketMaker marketmakers = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryIncentiveRequest is the request type for the Query/Incentive RPC method. +message QueryIncentiveRequest { + string address = 1; +} + +// QueryIncentiveResponse is the response type for the Query/Incentive RPC method. +message QueryIncentiveResponse { + Incentive incentive = 1 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/tx.proto new file mode 100644 index 000000000..d4b349517 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/tx.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package crescent.marketmaker.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/marketmaker/types"; + +// Msg defines the marketmaker Msg service. +service Msg { + + rpc ApplyMarketMaker(MsgApplyMarketMaker) returns (MsgApplyMarketMakerResponse); + + rpc ClaimIncentives(MsgClaimIncentives) returns (MsgClaimIncentivesResponse); +} + +message MsgApplyMarketMaker { + option (gogoproto.goproto_getters) = false; + + string address = 1; + + repeated uint64 pair_ids = 2 [(gogoproto.moretags) = "yaml:\"pair_ids\""]; +} + +message MsgApplyMarketMakerResponse {} + +message MsgClaimIncentives { + option (gogoproto.goproto_getters) = false; + + string address = 1; +} + +message MsgClaimIncentivesResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/mint/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/genesis.proto new file mode 100644 index 000000000..b5a3478b8 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package crescent.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/mint/v1beta1/mint.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // last_block_time defines the last block time, which is used to calculate inflation. + google.protobuf.Timestamp last_block_time = 1 + [(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_block_time\""]; + + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/mint/v1beta1/mint.proto b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/mint.proto new file mode 100644 index 000000000..bdd514b9c --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/mint.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package crescent.mint.v1beta1; + +option go_package = "github.com/crescent-network/crescent/v5/x/mint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// Params holds parameters for the mint module. +message Params { + // mint_denom defines denomination of coin to be minted + string mint_denom = 1; + + // mint_pool_address defines the address where inflation will be minted. The default is FeeCollector, + // but if it is set to FeeCollector, minted inflation could be mixed together with collected tx fees. + // Therefore, it is recommended to specify a separate address depending on usage. + string mint_pool_address = 2; + + // block_time_threshold defines block time threshold to prevent from any inflationary manipulation attacks + // it is used for maximum block duration when calculating block inflation + google.protobuf.Duration block_time_threshold = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + // inflation_schedules defines a list of inflation schedules + repeated InflationSchedule inflation_schedules = 4 [(gogoproto.nullable) = false]; +} + +// InflationSchedule defines the start and end time of the inflation period, and the amount of inflation during that +// period. +message InflationSchedule { + // start_time defines the start date time for the inflation schedule + google.protobuf.Timestamp start_time = 1 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + // end_time defines the end date time for the inflation schedule + google.protobuf.Timestamp end_time = 2 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; + // amount defines the total amount of inflation for the schedule + string amount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/mint/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/query.proto new file mode 100644 index 000000000..c0827f776 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/mint/v1beta1/query.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package crescent.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "crescent/mint/v1beta1/mint.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/mint/v1beta1/params"; + } + + // LastBlockTime returns the last block time. + rpc LastBlockTime(QueryLastBlockTimeRequest) returns (QueryLastBlockTimeResponse) { + option (google.api.http).get = "/crescent/mint/v1beta1/last_block_time"; + } +} + +// 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]; +} + +// QueryLastBlockTimeRequest is the request type for the Query/LastBlockTime RPC method. +message QueryLastBlockTimeRequest {} + +// QueryLastBlockTimeResponse is the response type for the Query/LastBlockTime RPC method. +message QueryLastBlockTimeResponse { + google.protobuf.Timestamp last_block_time = 1 + [(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_block_time\""]; +} From 70bf80c38f8c39809d6f6b4885a5fb2b110a3a04 Mon Sep 17 00:00:00 2001 From: web3cdn Date: Wed, 13 Sep 2023 14:31:29 +0300 Subject: [PATCH 3/3] Cresent Cosmos Subql Starter --- .../base/query/v1beta1/pagination.proto | 54 - .../proto/cosmos/base/v1beta1/coin.proto | 40 - .../proto/crescent/amm/v1beta1/amm.proto | 66 + .../proto/crescent/amm/v1beta1/event.proto | 80 + .../proto/crescent/amm/v1beta1/farming.proto | 28 + .../proto/crescent/amm/v1beta1/genesis.proto | 34 + .../proto/crescent/amm/v1beta1/params.proto | 24 + .../proto/crescent/amm/v1beta1/proposal.proto | 45 + .../proto/crescent/amm/v1beta1/query.proto | 242 ++ .../proto/crescent/amm/v1beta1/tx.proto | 93 + .../crescent/exchange/v1beta1/event.proto | 146 + .../crescent/exchange/v1beta1/exchange.proto | 60 + .../crescent/exchange/v1beta1/genesis.proto | 31 + .../exchange/v1beta1/order_book.proto | 22 + .../crescent/exchange/v1beta1/params.proto | 31 + .../crescent/exchange/v1beta1/proposal.proto | 25 + .../crescent/exchange/v1beta1/query.proto | 115 + .../proto/crescent/exchange/v1beta1/tx.proto | 136 + .../crescent/liquidamm/v1beta1/event.proto | 60 + .../crescent/liquidamm/v1beta1/genesis.proto | 21 + .../liquidamm/v1beta1/liquidamm.proto | 76 + .../crescent/liquidamm/v1beta1/params.proto | 15 + .../crescent/liquidamm/v1beta1/proposal.proto | 36 + .../crescent/liquidamm/v1beta1/query.proto | 170 + .../proto/crescent/liquidamm/v1beta1/tx.proto | 61 + .../marketmaker/v1beta1/marketmaker.proto | 2 +- .../protoc-gen-openapiv2/options/BUILD.bazel | 38 + .../options/annotations.pb.go | 241 ++ .../options/annotations.proto | 44 + .../options/openapiv2.pb.go | 2790 +++++++++++++++++ .../options/openapiv2.proto | 645 ++++ .../tendermint/budget/v1beta1/budget.proto | 64 + .../tendermint/budget/v1beta1/genesis.proto | 39 + .../tendermint/budget/v1beta1/query.proto | 115 + .../types/proto-interfaces/cosmos/bundle.ts | 8 + .../types/proto-interfaces/cosmwasm/bundle.ts | 18 +- .../crescent/amm/v1beta1/amm.ts | 145 + .../crescent/amm/v1beta1/event.ts | 229 ++ .../crescent/amm/v1beta1/farming.ts | 63 + .../crescent/amm/v1beta1/genesis.ts | 88 + .../crescent/amm/v1beta1/params.ts | 37 + .../crescent/amm/v1beta1/proposal.ts | 126 + .../crescent/amm/v1beta1/tx.ts | 254 ++ .../types/proto-interfaces/crescent/bundle.ts | 150 + .../crescent/claim/v1beta1/claim.ts | 154 + .../crescent/claim/v1beta1/genesis.ts | 28 + .../crescent/claim/v1beta1/tx.ts | 45 + .../crescent/exchange/v1beta1/event.ts | 449 +++ .../crescent/exchange/v1beta1/exchange.ts | 171 + .../crescent/exchange/v1beta1/genesis.ts | 78 + .../crescent/exchange/v1beta1/order_book.ts | 47 + .../crescent/exchange/v1beta1/params.ts | 59 + .../crescent/exchange/v1beta1/proposal.ts | 50 + .../crescent/exchange/v1beta1/tx.ts | 424 +++ .../crescent/farming/v1beta1/farming.ts | 450 +++ .../crescent/farming/v1beta1/genesis.ts | 295 ++ .../crescent/farming/v1beta1/proposal.ts | 216 ++ .../crescent/farming/v1beta1/tx.ts | 374 +++ .../crescent/liquidamm/v1beta1/event.ts | 167 + .../crescent/liquidamm/v1beta1/genesis.ts | 38 + .../crescent/liquidamm/v1beta1/liquidamm.ts | 213 ++ .../crescent/liquidamm/v1beta1/params.ts | 24 + .../crescent/liquidamm/v1beta1/proposal.ts | 82 + .../crescent/liquidamm/v1beta1/tx.ts | 137 + .../crescent/liquidfarming/v1beta1/genesis.ts | 93 + .../liquidfarming/v1beta1/liquidfarming.ts | 206 ++ .../crescent/liquidfarming/v1beta1/params.ts | 69 + .../crescent/liquidfarming/v1beta1/tx.ts | 241 ++ .../crescent/liquidity/v1beta1/genesis.ts | 81 + .../crescent/liquidity/v1beta1/liquidity.ts | 608 ++++ .../crescent/liquidity/v1beta1/tx.ts | 535 ++++ .../crescent/liquidstaking/v1beta1/genesis.ts | 26 + .../liquidstaking/v1beta1/liquidstaking.ts | 354 +++ .../crescent/liquidstaking/v1beta1/tx.ts | 99 + .../crescent/lpfarm/v1beta1/events.ts | 111 + .../crescent/lpfarm/v1beta1/genesis.ts | 83 + .../crescent/lpfarm/v1beta1/lpfarm.ts | 171 + .../crescent/lpfarm/v1beta1/proposal.ts | 74 + .../crescent/lpfarm/v1beta1/tx.ts | 194 ++ .../crescent/marker/v1beta1/genesis.ts | 21 + .../crescent/marker/v1beta1/marker.ts | 11 + .../crescent/marketmaker/v1beta1/genesis.ts | 32 + .../marketmaker/v1beta1/marketmaker.ts | 243 ++ .../crescent/marketmaker/v1beta1/proposal.ts | 89 + .../crescent/marketmaker/v1beta1/tx.ts | 60 + .../crescent/mint/v1beta1/genesis.ts | 28 + .../crescent/mint/v1beta1/mint.ts | 93 + .../types/proto-interfaces/google/bundle.ts | 30 +- .../google/protobuf/struct.ts | 210 ++ .../src/types/proto-interfaces/grpc/bundle.ts | 12 + .../src/types/proto-interfaces/ibc/bundle.ts | 76 +- .../src/types/proto-interfaces/index.ts | 2 + .../options/annotations.ts | 1 + .../protoc-gen-openapiv2/options/openapiv2.ts | 2279 ++++++++++++++ .../tendermint/budget/v1beta1/budget.ts | 109 + .../tendermint/budget/v1beta1/genesis.ts | 56 + .../tendermint/budget/v1beta1/query.ts | 189 ++ .../proto-interfaces/tendermint/bundle.ts | 44 +- 98 files changed, 16660 insertions(+), 178 deletions(-) delete mode 100644 Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto delete mode 100644 Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/amm.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/event.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/farming.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/params.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/amm/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/event.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/exchange.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/order_book.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/params.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/exchange/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/event.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/liquidamm.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/params.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/proposal.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/tx.proto create mode 100644 Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/BUILD.bazel create mode 100644 Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.pb.go create mode 100644 Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.proto create mode 100644 Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.pb.go create mode 100644 Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.proto create mode 100644 Crescent/crescent-starter/proto/tendermint/budget/v1beta1/budget.proto create mode 100644 Crescent/crescent-starter/proto/tendermint/budget/v1beta1/genesis.proto create mode 100644 Crescent/crescent-starter/proto/tendermint/budget/v1beta1/query.proto create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/amm.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/event.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/farming.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/claim.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/event.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/exchange.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/order_book.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/farming.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/event.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/liquidamm.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/liquidfarming.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/params.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/liquidity.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/liquidstaking.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/events.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/lpfarm.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/marker.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/marketmaker.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/proposal.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/tx.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/mint.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/struct.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/grpc/bundle.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/annotations.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/openapiv2.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/budget.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/genesis.ts create mode 100644 Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/query.ts diff --git a/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto b/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto deleted file mode 100644 index 2e906335a..000000000 --- a/Crescent/crescent-starter/proto/cosmos/base/query/v1beta1/pagination.proto +++ /dev/null @@ -1,54 +0,0 @@ -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. - 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 - 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/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto b/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto deleted file mode 100644 index fab75284b..000000000 --- a/Crescent/crescent-starter/proto/cosmos/base/v1beta1/coin.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package cosmos.base.v1beta1; - -import "gogoproto/gogo.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 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// 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 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} - -// IntProto defines a Protobuf wrapper around an Int object. -message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecProto defines a Protobuf wrapper around a Dec object. -message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/amm.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/amm.proto new file mode 100644 index 000000000..936d619b7 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/amm.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message Pool { + uint64 id = 1; + uint64 market_id = 2; + string denom0 = 3; + string denom1 = 4; + string reserve_address = 5; + string rewards_pool = 6; + uint32 tick_spacing = 7; + string min_order_quantity = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string min_order_quote = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message PoolState { + int32 current_tick = 1; + string current_price = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string current_liquidity = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string total_liquidity = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin fee_growth_global = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin farming_rewards_growth_global = 6 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +message Position { + uint64 id = 1; + uint64 pool_id = 2; + string owner = 3; + int32 lower_tick = 4; + int32 upper_tick = 5; + string liquidity = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin last_fee_growth_inside = 7 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin owed_fee = 8 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin last_farming_rewards_growth_inside = 9 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin owed_farming_rewards = 10 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message TickInfo { + string gross_liquidity = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string net_liquidity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin fee_growth_outside = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin farming_rewards_growth_outside = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/event.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/event.proto new file mode 100644 index 000000000..132e8e6f1 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/event.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/amm/v1beta1/farming.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message EventCreatePool { + string creator = 1; + uint64 market_id = 2; + string price = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint64 pool_id = 4; +} + +message EventAddLiquidity { + string owner = 1; + uint64 pool_id = 2; + string lower_price = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string upper_price = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint64 position_id = 5; + string liquidity = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 7 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventRemoveLiquidity { + string owner = 1; + uint64 position_id = 2; + string liquidity = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventCollect { + string owner = 1; + uint64 position_id = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventCreatePrivateFarmingPlan { + string creator = 1; + string description = 2; + string termination_address = 3; + repeated FarmingRewardAllocation reward_allocations = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + uint64 farming_plan_id = 7; + string farming_pool_address = 8; +} + +message EventCreatePublicFarmingPlan { + string description = 1; + string farming_pool_address = 2; + string termination_address = 3; + repeated FarmingRewardAllocation reward_allocations = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + uint64 farming_plan_id = 7; +} + +message EventFarmingPlanTerminated { + uint64 farming_plan_id = 1; +} + +message EventPoolParameterChanged { + uint64 pool_id = 1; + uint32 tick_spacing = 2; + string min_order_quantity = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_order_quote = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/farming.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/farming.proto new file mode 100644 index 000000000..2bb370e33 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/farming.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message FarmingPlan { + uint64 id = 1; + string description = 2; + string farming_pool_address = 3; + string termination_address = 4; + repeated FarmingRewardAllocation reward_allocations = 5 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + bool is_private = 8; + bool is_terminated = 9; +} + +message FarmingRewardAllocation { + uint64 pool_id = 1; + repeated cosmos.base.v1beta1.Coin rewards_per_day = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/genesis.proto new file mode 100644 index 000000000..29cc4d440 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/genesis.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/amm/v1beta1/amm.proto"; +import "crescent/amm/v1beta1/farming.proto"; +import "crescent/amm/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + uint64 last_pool_id = 2; + uint64 last_position_id = 3; + repeated PoolRecord pool_records = 4 [(gogoproto.nullable) = false]; + repeated Position positions = 5 [(gogoproto.nullable) = false]; + repeated TickInfoRecord tick_info_records = 6 [(gogoproto.nullable) = false]; + uint64 last_farming_plan_id = 7; + uint32 num_private_farming_plans = 8; + repeated FarmingPlan farming_plans = 9 [(gogoproto.nullable) = false]; +} + +message PoolRecord { + Pool pool = 1 [(gogoproto.nullable) = false]; + PoolState state = 2 [(gogoproto.nullable) = false]; +} + +message TickInfoRecord { + uint64 pool_id = 1; + int32 tick = 2; + TickInfo tick_info = 3 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/params.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/params.proto new file mode 100644 index 000000000..59f3f4e85 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/params.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message Params { + repeated cosmos.base.v1beta1.Coin pool_creation_fee = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + uint32 default_tick_spacing = 2; + string default_min_order_quantity = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string default_min_order_quote = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin private_farming_plan_creation_fee = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + uint32 max_num_private_farming_plans = 6; + google.protobuf.Duration max_farming_block_time = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/proposal.proto new file mode 100644 index 000000000..32dfc70b4 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/proposal.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/amm/v1beta1/farming.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +message PublicFarmingPlanProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + repeated CreatePublicFarmingPlanRequest create_requests = 3 [(gogoproto.nullable) = false]; + repeated TerminateFarmingPlanRequest terminate_requests = 4 [(gogoproto.nullable) = false]; +} + +message CreatePublicFarmingPlanRequest { + string description = 1; + string farming_pool_address = 2; + string termination_address = 3; + repeated FarmingRewardAllocation reward_allocations = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message TerminateFarmingPlanRequest { + uint64 farming_plan_id = 1; +} + +message PoolParameterChangeProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + repeated PoolParameterChange changes = 3 [(gogoproto.nullable) = false]; +} + +message PoolParameterChange { + uint64 pool_id = 1; + uint32 tick_spacing = 2; + string min_order_quantity = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_order_quote = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/query.proto new file mode 100644 index 000000000..14262e031 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/query.proto @@ -0,0 +1,242 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "crescent/amm/v1beta1/amm.proto"; +import "crescent/amm/v1beta1/farming.proto"; +import "crescent/amm/v1beta1/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/params"; + } + rpc AllPools(QueryAllPoolsRequest) returns (QueryAllPoolsResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/pools"; + } + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/pools/{pool_id}"; + } + rpc AllPositions(QueryAllPositionsRequest) returns (QueryAllPositionsResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/positions"; + } + rpc Position(QueryPositionRequest) returns (QueryPositionResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/positions/{position_id}"; + } + rpc PositionAssets(QueryPositionAssetsRequest) returns (QueryPositionAssetsResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/positions/{position_id}/assets"; + } + rpc AddLiquiditySimulation(QueryAddLiquiditySimulationRequest) returns (QueryAddLiquiditySimulationResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/simulation/add_liquidity"; + } + rpc RemoveLiquiditySimulation(QueryRemoveLiquiditySimulationRequest) + returns (QueryRemoveLiquiditySimulationResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/simulation/remove_liquidity"; + } + rpc CollectibleCoins(QueryCollectibleCoinsRequest) returns (QueryCollectibleCoinsResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/collectible_coins"; + } + rpc AllTickInfos(QueryAllTickInfosRequest) returns (QueryAllTickInfosResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/pools/{pool_id}/tick_infos"; + } + rpc TickInfo(QueryTickInfoRequest) returns (QueryTickInfoResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/pools/{pool_id}/tick_infos/{tick}"; + } + rpc AllFarmingPlans(QueryAllFarmingPlansRequest) returns (QueryAllFarmingPlansResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/farming_plans"; + } + rpc FarmingPlan(QueryFarmingPlanRequest) returns (QueryFarmingPlanResponse) { + option (google.api.http).get = "/crescent/amm/v1beta1/farming_plans/{plan_id}"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllPoolsRequest { + uint64 market_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryAllPoolsResponse { + repeated PoolResponse pools = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryPoolRequest { + uint64 pool_id = 1; +} + +message QueryPoolResponse { + PoolResponse pool = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllPositionsRequest { + uint64 pool_id = 1; + string owner = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryAllPositionsResponse { + repeated PositionResponse positions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryPositionRequest { + uint64 position_id = 1; +} + +message QueryPositionResponse { + PositionResponse position = 1 [(gogoproto.nullable) = false]; +} + +message QueryPositionAssetsRequest { + uint64 position_id = 1; +} + +message QueryPositionAssetsResponse { + cosmos.base.v1beta1.Coin coin0 = 1 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin coin1 = 2 [(gogoproto.nullable) = false]; +} + +message QueryAddLiquiditySimulationRequest { + uint64 pool_id = 1; + string lower_price = 2; + string upper_price = 3; + string desired_amount = 4; +} + +message QueryAddLiquiditySimulationResponse { + string liquidity = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message QueryRemoveLiquiditySimulationRequest { + uint64 position_id = 1; + string liquidity = 2; +} + +message QueryRemoveLiquiditySimulationResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message QueryCollectibleCoinsRequest { + string owner = 1; + uint64 position_id = 2; +} + +message QueryCollectibleCoinsResponse { + repeated cosmos.base.v1beta1.Coin fee = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin farming_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message QueryAllTickInfosRequest { + uint64 pool_id = 1; + string lower_tick = 2; + string upper_tick = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +message QueryAllTickInfosResponse { + repeated TickInfoResponse tick_infos = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryTickInfoRequest { + uint64 pool_id = 1; + int32 tick = 2; +} + +message QueryTickInfoResponse { + TickInfoResponse tick_info = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllFarmingPlansRequest { + string is_private = 1; + string is_terminated = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryAllFarmingPlansResponse { + repeated FarmingPlan farming_plans = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryFarmingPlanRequest { + uint64 plan_id = 1; +} + +message QueryFarmingPlanResponse { + FarmingPlan farming_plan = 1 [(gogoproto.nullable) = false]; +} + +message PoolResponse { + uint64 id = 1; + uint64 market_id = 2; + cosmos.base.v1beta1.Coin balance0 = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin balance1 = 4 [(gogoproto.nullable) = false]; + string reserve_address = 5; + string rewards_pool = 6; + uint32 tick_spacing = 7; + string min_order_quantity = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string min_order_quote = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + int32 current_tick = 10; + string current_price = 11 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string current_liquidity = 12 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string total_liquidity = 13 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin fee_growth_global = 14 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin farming_rewards_growth_global = 15 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +message PositionResponse { + uint64 id = 1; + uint64 pool_id = 2; + string owner = 3; + string lower_price = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string upper_price = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string liquidity = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin last_fee_growth_inside = 7 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin owed_fee = 8 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin last_farming_rewards_growth_inside = 9 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin owed_farming_rewards = 10 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message TickInfoResponse { + int32 tick = 1; + string gross_liquidity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string net_liquidity = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin fee_growth_outside = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin farming_rewards_growth_outside = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/amm/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/tx.proto new file mode 100644 index 000000000..233687496 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/amm/v1beta1/tx.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package crescent.amm.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/amm/v1beta1/amm.proto"; +import "crescent/amm/v1beta1/farming.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/amm/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + rpc CreatePool(MsgCreatePool) returns (MsgCreatePoolResponse); + rpc AddLiquidity(MsgAddLiquidity) returns (MsgAddLiquidityResponse); + rpc RemoveLiquidity(MsgRemoveLiquidity) returns (MsgRemoveLiquidityResponse); + rpc Collect(MsgCollect) returns (MsgCollectResponse); + rpc CreatePrivateFarmingPlan(MsgCreatePrivateFarmingPlan) returns (MsgCreatePrivateFarmingPlanResponse); + rpc TerminatePrivateFarmingPlan(MsgTerminatePrivateFarmingPlan) returns (MsgTerminatePrivateFarmingPlanResponse); +} + +message MsgCreatePool { + string sender = 1; + uint64 market_id = 2; + string price = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message MsgCreatePoolResponse { + uint64 pool_id = 1; +} + +message MsgAddLiquidity { + string sender = 1; + uint64 pool_id = 2; + string lower_price = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string upper_price = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin desired_amount = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgAddLiquidityResponse { + uint64 position_id = 1; + string liquidity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgRemoveLiquidity { + string sender = 1; + uint64 position_id = 2; + string liquidity = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +message MsgRemoveLiquidityResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgCollect { + string sender = 1; + uint64 position_id = 2; + // TODO: if amount is nil, collect all? + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgCollectResponse {} + +message MsgCreatePrivateFarmingPlan { + string sender = 1; + string description = 2; + string termination_address = 3; + repeated FarmingRewardAllocation reward_allocations = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message MsgCreatePrivateFarmingPlanResponse { + uint64 farming_plan_id = 1; + string farming_pool_address = 2; +} + +message MsgTerminatePrivateFarmingPlan { + string sender = 1; + uint64 farming_plan_id = 2; +} + +message MsgTerminatePrivateFarmingPlanResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/event.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/event.proto new file mode 100644 index 000000000..d936d51dd --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/event.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "crescent/exchange/v1beta1/exchange.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message EventCreateMarket { + string creator = 1; + string base_denom = 2; + string quote_denom = 3; + uint64 market_id = 4; +} + +message EventPlaceLimitOrder { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deadline = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + string executed_quantity = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 10 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 11 [(gogoproto.nullable) = false]; +} + +message EventPlaceBatchLimitOrder { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deadline = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message EventPlaceMMLimitOrder { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deadline = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + string executed_quantity = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 10 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 11 [(gogoproto.nullable) = false]; +} + +message EventPlaceMMBatchLimitOrder { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 7 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deadline = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message EventPlaceMarketOrder { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string quantity = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string executed_quantity = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 7 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 8 [(gogoproto.nullable) = false]; +} + +message EventCancelOrder { + string orderer = 1; + uint64 order_id = 2; +} + +message EventCancelAllOrders { + string orderer = 1; + uint64 market_id = 2; + repeated uint64 cancelled_order_ids = 3; +} + +message EventSwapExactAmountIn { + string orderer = 1; + repeated uint64 routes = 2; + cosmos.base.v1beta1.DecCoin input = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin output = 4 [(gogoproto.nullable) = false]; + repeated SwapRouteResult results = 5 [(gogoproto.nullable) = false]; +} + +message EventOrderFilled { + uint64 market_id = 1; + uint64 order_id = 2; + string orderer = 3; + bool is_buy = 4; + string price = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string open_quantity = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string executed_quantity = 8 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 9 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 10 [(gogoproto.nullable) = false]; +} + +message EventOrderSourceOrdersFilled { + uint64 market_id = 1; + string source_name = 2; + string orderer = 3; + bool is_buy = 4; + string executed_quantity = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 6 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 7 [(gogoproto.nullable) = false]; +} + +message EventOrderCompleted { + uint64 order_id = 1; +} + +message EventOrderExpired { + uint64 order_id = 1; +} + +message EventMarketParameterChanged { + uint64 market_id = 1; + string maker_fee_rate = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string taker_fee_rate = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string order_source_fee_ratio = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/exchange.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/exchange.proto new file mode 100644 index 000000000..27c1aca32 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/exchange.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message Market { + uint64 id = 1; + string base_denom = 2; + string quote_denom = 3; + string escrow_address = 4; + string maker_fee_rate = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string taker_fee_rate = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string order_source_fee_ratio = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message MarketState { + string last_price = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + int64 last_matching_height = 2; +} + +message Order { + uint64 id = 1; + OrderType type = 2; + string orderer = 3; + uint64 market_id = 4; + bool is_buy = 5; + string price = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + int64 msg_height = 8; + string open_quantity = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string remaining_deposit = 10 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Timestamp deadline = 11 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +enum OrderType { + option (gogoproto.goproto_enum_prefix) = false; + ORDER_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OrderTypeUnspecified"]; + ORDER_TYPE_LIMIT = 1 [(gogoproto.enumvalue_customname) = "OrderTypeLimit"]; + ORDER_TYPE_MM = 2 [(gogoproto.enumvalue_customname) = "OrderTypeMM"]; +} + +message SwapRouteResult { + uint64 market_id = 1; + string executed_quantity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin input = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin output = 4 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin fee = 5 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/genesis.proto new file mode 100644 index 000000000..fc250e227 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "crescent/exchange/v1beta1/exchange.proto"; +import "crescent/exchange/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + uint64 last_market_id = 2; + uint64 last_order_id = 3; + repeated MarketRecord market_records = 4 [(gogoproto.nullable) = false]; + repeated Order orders = 5 [(gogoproto.nullable) = false]; + repeated NumMMOrdersRecord num_mm_orders_records = 6 + [(gogoproto.nullable) = false, (gogoproto.customname) = "NumMMOrdersRecords"]; +} + +message MarketRecord { + Market market = 1 [(gogoproto.nullable) = false]; + MarketState state = 2 [(gogoproto.nullable) = false]; +} + +message NumMMOrdersRecord { + string orderer = 1; + uint64 market_id = 2; + uint32 num_mm_orders = 3 [(gogoproto.customname) = "NumMMOrders"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/order_book.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/order_book.proto new file mode 100644 index 000000000..bd3a74545 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/order_book.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message OrderBook { + string price_interval = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + repeated OrderBookPriceLevel sells = 2 [(gogoproto.nullable) = false]; + repeated OrderBookPriceLevel buys = 3 [(gogoproto.nullable) = false]; +} + +message OrderBookPriceLevel { + // p denotes price + string p = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + // q denotes quantity + string q = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/params.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/params.proto new file mode 100644 index 000000000..25e5aee8a --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/params.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message Params { + repeated cosmos.base.v1beta1.Coin market_creation_fee = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + Fees fees = 2 [(gogoproto.nullable) = false]; + google.protobuf.Duration max_order_lifespan = 3 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + // max_order_price_ratio defines the ratio of the maximum possible order price compared to the market's last price + string max_order_price_ratio = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint32 max_swap_routes_len = 5; + uint32 max_num_mm_orders = 6 [(gogoproto.customname) = "MaxNumMMOrders"]; +} + +message Fees { + string default_maker_fee_rate = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string default_taker_fee_rate = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string default_order_source_fee_ratio = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/proposal.proto new file mode 100644 index 000000000..9280c94be --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/proposal.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +message MarketParameterChangeProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + repeated MarketParameterChange changes = 3 [(gogoproto.nullable) = false]; +} + +message MarketParameterChange { + uint64 market_id = 1; + string maker_fee_rate = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string taker_fee_rate = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string order_source_fee_ratio = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/query.proto new file mode 100644 index 000000000..4d2cccc14 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/query.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "crescent/exchange/v1beta1/exchange.proto"; +import "crescent/exchange/v1beta1/params.proto"; +import "crescent/exchange/v1beta1/order_book.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/params"; + } + rpc AllMarkets(QueryAllMarketsRequest) returns (QueryAllMarketsResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/markets"; + } + rpc Market(QueryMarketRequest) returns (QueryMarketResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/markets/{market_id}"; + } + rpc AllOrders(QueryAllOrdersRequest) returns (QueryAllOrdersResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/orders"; + } + rpc Order(QueryOrderRequest) returns (QueryOrderResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/orders/{order_id}"; + } + rpc BestSwapExactAmountInRoutes(QueryBestSwapExactAmountInRoutesRequest) + returns (QueryBestSwapExactAmountInRoutesResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/best_swap_exact_amount_in_routes"; + } + rpc OrderBook(QueryOrderBookRequest) returns (QueryOrderBookResponse) { + option (google.api.http).get = "/crescent/exchange/v1beta1/markets/{market_id}/order_book"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllMarketsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllMarketsResponse { + repeated MarketResponse markets = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryMarketRequest { + uint64 market_id = 1; +} + +message QueryMarketResponse { + MarketResponse market = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllOrdersRequest { + string orderer = 1; + uint64 market_id = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryAllOrdersResponse { + repeated Order orders = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryOrderRequest { + uint64 order_id = 1; +} + +message QueryOrderResponse { + Order order = 1 [(gogoproto.nullable) = false]; +} + +message QueryBestSwapExactAmountInRoutesRequest { + string input = 1; + string output_denom = 2; +} + +message QueryBestSwapExactAmountInRoutesResponse { + repeated uint64 routes = 1; + cosmos.base.v1beta1.DecCoin output = 2 [(gogoproto.nullable) = false]; + repeated SwapRouteResult results = 3 [(gogoproto.nullable) = false]; +} + +message QueryOrderBookRequest { + uint64 market_id = 1; +} + +message QueryOrderBookResponse { + repeated OrderBook order_books = 1 [(gogoproto.nullable) = false]; +} + +message MarketResponse { + uint64 id = 1; + string base_denom = 2; + string quote_denom = 3; + string escrow_address = 4; + string maker_fee_rate = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string taker_fee_rate = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string order_source_fee_ratio = 7 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string last_price = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + int64 last_matching_height = 9; +} diff --git a/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/tx.proto new file mode 100644 index 000000000..197edcad9 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/exchange/v1beta1/tx.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; + +package crescent.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "crescent/exchange/v1beta1/exchange.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/exchange/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + rpc CreateMarket(MsgCreateMarket) returns (MsgCreateMarketResponse); + rpc PlaceLimitOrder(MsgPlaceLimitOrder) returns (MsgPlaceLimitOrderResponse); + rpc PlaceBatchLimitOrder(MsgPlaceBatchLimitOrder) returns (MsgPlaceBatchLimitOrderResponse); + rpc PlaceMMLimitOrder(MsgPlaceMMLimitOrder) returns (MsgPlaceMMLimitOrderResponse); + rpc PlaceMMBatchLimitOrder(MsgPlaceMMBatchLimitOrder) returns (MsgPlaceMMBatchLimitOrderResponse); + rpc PlaceMarketOrder(MsgPlaceMarketOrder) returns (MsgPlaceMarketOrderResponse); + rpc CancelOrder(MsgCancelOrder) returns (MsgCancelOrderResponse); + rpc CancelAllOrders(MsgCancelAllOrders) returns (MsgCancelAllOrdersResponse); + rpc SwapExactAmountIn(MsgSwapExactAmountIn) returns (MsgSwapExactAmountInResponse); +} + +message MsgCreateMarket { + string sender = 1; + string base_denom = 2; + string quote_denom = 3; +} + +message MsgCreateMarketResponse { + uint64 market_id = 1; +} + +message MsgPlaceLimitOrder { + string sender = 1; + uint64 market_id = 2; + bool is_buy = 3; + string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 6 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +message MsgPlaceLimitOrderResponse { + uint64 order_id = 1; + string executed_quantity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 4 [(gogoproto.nullable) = false]; +} + +message MsgPlaceBatchLimitOrder { + string sender = 1; + uint64 market_id = 2; + bool is_buy = 3; + string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 6 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +message MsgPlaceBatchLimitOrderResponse { + uint64 order_id = 1; +} + +message MsgPlaceMMLimitOrder { + string sender = 1; + uint64 market_id = 2; + bool is_buy = 3; + string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 6 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +message MsgPlaceMMLimitOrderResponse { + uint64 order_id = 1; + string executed_quantity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 4 [(gogoproto.nullable) = false]; +} + +message MsgPlaceMMBatchLimitOrder { + string sender = 1; + uint64 market_id = 2; + bool is_buy = 3; + string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string quantity = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration lifespan = 6 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +message MsgPlaceMMBatchLimitOrderResponse { + uint64 order_id = 1; +} + +message MsgPlaceMarketOrder { + string sender = 1; + uint64 market_id = 2; + bool is_buy = 3; + string quantity = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message MsgPlaceMarketOrderResponse { + uint64 order_id = 1; + string executed_quantity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin paid = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin received = 4 [(gogoproto.nullable) = false]; +} + +message MsgCancelOrder { + string sender = 1; + uint64 order_id = 2; +} + +message MsgCancelOrderResponse {} + +message MsgCancelAllOrders { + string sender = 1; + uint64 market_id = 2; +} + +message MsgCancelAllOrdersResponse { + repeated uint64 cancelled_order_ids = 1; +} + +message MsgSwapExactAmountIn { + string sender = 1; + repeated uint64 routes = 2; + cosmos.base.v1beta1.DecCoin input = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.DecCoin min_output = 4 [(gogoproto.nullable) = false]; +} + +message MsgSwapExactAmountInResponse { + cosmos.base.v1beta1.DecCoin output = 1 [(gogoproto.nullable) = false]; + repeated SwapRouteResult results = 2 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/event.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/event.proto new file mode 100644 index 000000000..5b915b019 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/event.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +message EventPublicPositionCreated { + uint64 public_position_id = 1; + uint64 pool_id = 2; + int32 lower_tick = 3; + int32 upper_tick = 4; + string min_bid_amount = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message EventMintShare { + string minter = 1; + uint64 public_position_id = 2; + cosmos.base.v1beta1.Coin minted_share = 3 [(gogoproto.nullable) = false]; + string liquidity = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventBurnShare { + string burner = 1; + uint64 public_position_id = 2; + cosmos.base.v1beta1.Coin share = 3 [(gogoproto.nullable) = false]; + string removed_liquidity = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 5 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message EventPlaceBid { + string bidder = 1; + uint64 public_position_id = 2; + uint64 rewards_auction_id = 3; + cosmos.base.v1beta1.Coin share = 4 [(gogoproto.nullable) = false]; +} + +message EventBidRefunded { + string bidder = 1; + uint64 public_position_id = 2; + uint64 rewards_auction_id = 3; + cosmos.base.v1beta1.Coin share = 4 [(gogoproto.nullable) = false]; +} + +message EventPublicPositionParameterChanged { + uint64 public_position_id = 1; + string min_bid_amount = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/genesis.proto new file mode 100644 index 000000000..c86c156bd --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/genesis.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "crescent/liquidamm/v1beta1/liquidamm.proto"; +import "crescent/liquidamm/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +// GenesisState defines the module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + uint64 last_public_position_id = 2; + repeated PublicPosition public_positions = 3 [(gogoproto.nullable) = false]; + repeated RewardsAuction rewards_auctions = 4 [(gogoproto.nullable) = false]; + repeated Bid bids = 5 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp next_rewards_auction_end_time = 6 [(gogoproto.stdtime) = true]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/liquidamm.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/liquidamm.proto new file mode 100644 index 000000000..4fc268623 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/liquidamm.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +// PublicPosition defines public position object that provides auto compounding functionality +// for the amm position and undergoes rewards auction process. +// See the technical spec for more detailed information. +message PublicPosition { + uint64 id = 1; + uint64 pool_id = 2; + int32 lower_tick = 3; + int32 upper_tick = 4; + // bid_reserve_address specifies the account that reserves bidding amounts placed by bidders + string bid_reserve_address = 5; + string min_bid_amount = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint64 last_rewards_auction_id = 8; +} + +// RewardsAuction defines rewards auction that is created by the module +// for every rewards_auction_duration in params. +message RewardsAuction { + // public_position_id specifies the public position's id. + uint64 public_position_id = 1; + // id specifies the unique auction id in the public position + uint64 id = 2; + // start_time specifies the start time of an auction + google.protobuf.Timestamp start_time = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // end_time specifies the end time of an auction + google.protobuf.Timestamp end_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // status specifies the status of an auction + AuctionStatus status = 5; + // winning_bid specifies the winning bid + Bid winning_bid = 6; + // rewards specifies the rewards the winning bidder has received + // the value is determined when an auction is finished + repeated cosmos.base.v1beta1.Coin rewards = 7 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin fees = 8 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// Bid defines standard bid for a rewards auction. +message Bid { + // public_position_id specifies the public position's id + uint64 public_position_id = 1; + // rewards_auction_id specifies the reward auction's id + uint64 rewards_auction_id = 2; + // bidder specifies the bech32-encoded address that places a bid for the auction + string bidder = 3; + // share specifies the share amount to place a bid + cosmos.base.v1beta1.Coin share = 4 [(gogoproto.nullable) = false]; +} + +// AuctionStatus enumerates the valid status of an auction. +enum AuctionStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // AUCTION_STATUS_UNSPECIFIED defines the default auction status + AUCTION_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "AuctionStatusNil"]; + // AUCTION_STATUS_STARTED defines the started auction status + AUCTION_STATUS_STARTED = 1 [(gogoproto.enumvalue_customname) = "AuctionStatusStarted"]; + // AUCTION_STATUS_FINISHED defines the finished auction status + AUCTION_STATUS_FINISHED = 2 [(gogoproto.enumvalue_customname) = "AuctionStatusFinished"]; + // AUCTION_STATUS_SKIPPED defines the skipped auction status + AUCTION_STATUS_SKIPPED = 3 [(gogoproto.enumvalue_customname) = "AuctionStatusSkipped"]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/params.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/params.proto new file mode 100644 index 000000000..d36fae38a --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "google/protobuf/duration.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +// Params defines the parameters for the module. +message Params { + google.protobuf.Duration rewards_auction_duration = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + uint32 max_num_recent_rewards_auctions = 2; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/proposal.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/proposal.proto new file mode 100644 index 000000000..3ac73548c --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/proposal.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +message PublicPositionCreateProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + uint64 pool_id = 3; + string lower_price = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string upper_price = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string min_bid_amount = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +message PublicPositionParameterChangeProposal { + option (gogoproto.goproto_stringer) = false; + string title = 1; + string description = 2; + repeated PublicPositionParameterChange changes = 3 [(gogoproto.nullable) = false]; +} + +message PublicPositionParameterChange { + uint64 public_position_id = 1; + string min_bid_amount = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/query.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/query.proto new file mode 100644 index 000000000..05e6a68e8 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/query.proto @@ -0,0 +1,170 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "crescent/liquidamm/v1beta1/liquidamm.proto"; +import "crescent/liquidamm/v1beta1/params.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns parameters of the module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/params"; + } + + // PublicPositions returns all public positions registered in module + rpc PublicPositions(QueryPublicPositionsRequest) returns (QueryPublicPositionsResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/public_positions"; + } + + // PublicPosition returns the specific public position + rpc PublicPosition(QueryPublicPositionRequest) returns (QueryPublicPositionResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}"; + } + + // RewardsAuctions returns all rewards auctions that correspond to the given pool id + rpc RewardsAuctions(QueryRewardsAuctionsRequest) returns (QueryRewardsAuctionsResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}/rewards_auctions"; + } + + // RewardsAuction returns the specific rewards auction + rpc RewardsAuction(QueryRewardsAuctionRequest) returns (QueryRewardsAuctionResponse) { + option (google.api.http).get = + "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}/rewards_auctions/{auction_id}"; + } + + // Bids returns all bids for the rewards auction + rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { + option (google.api.http).get = + "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}/rewards_auctions/{auction_id}/bids"; + } + + // Rewards returns all accumulated rewards for the public position + rpc Rewards(QueryRewardsRequest) returns (QueryRewardsResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}/rewards"; + } + + // ExchangeRate returns exchange rates (mint rate and burn rate) for the public position + rpc ExchangeRate(QueryExchangeRateRequest) returns (QueryExchangeRateResponse) { + option (google.api.http).get = "/crescent/liquidamm/v1beta1/public_positions/{public_position_id}/exchange_rate"; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryPublicPositionsRequest is the request type for the Query/PublicPositions RPC method. +message QueryPublicPositionsRequest { + uint64 pool_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryPublicPositionsResponse is response type for the Query/PublicPositions RPC method. +message QueryPublicPositionsResponse { + repeated PublicPositionResponse public_positions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPublicPositionRequest is the request type for the Query/PublicPosition RPC method. +message QueryPublicPositionRequest { + uint64 public_position_id = 1; +} + +// QueryPublicPositionResponse is response type for the Query/PublicPosition RPC method. +message QueryPublicPositionResponse { + PublicPositionResponse public_position = 1 [(gogoproto.nullable) = false]; +} + +// QueryRewardsAuctionsRequest is request type for the Query/RewardsAuctions RPC method. +message QueryRewardsAuctionsRequest { + uint64 public_position_id = 1; + string status = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryRewardsAuctionsResponse is response type for the Query/RewardsAuctions RPC method. +message QueryRewardsAuctionsResponse { + repeated RewardsAuction rewards_auctions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRewardsAuctionRequest is request type for the Query/RewardsAuction RPC method. +message QueryRewardsAuctionRequest { + uint64 public_position_id = 1; + uint64 auction_id = 2; +} + +// QueryRewardsAuctionResponse is response type for the Query/RewardsAuction RPC method. +message QueryRewardsAuctionResponse { + RewardsAuction rewards_auction = 1 [(gogoproto.nullable) = false]; +} + +// QueryBidsRequest is request type for the Query/Bids RPC method. +message QueryBidsRequest { + uint64 public_position_id = 1; + uint64 auction_id = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryBidsResponse is response type for the Query/Bids RPC method. +message QueryBidsResponse { + repeated Bid bids = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRewardsRequest is request type for the Query/Rewards RPC method. +message QueryRewardsRequest { + uint64 public_position_id = 1; +} + +// QueryRewardsResponse is response type for the Query/Rewards RPC method. +message QueryRewardsResponse { + repeated cosmos.base.v1beta1.Coin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// QueryExchangeRateRequest is request type for the Query/ExchangeRate RPC method. +message QueryExchangeRateRequest { + uint64 public_position_id = 1; +} + +// QueryExchangeRateResponse is response type for the Query/ExchangeRate RPC method. +message QueryExchangeRateResponse { + string mint_rate = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string burn_rate = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// +// Custom response messages +// + +// PublicPositionResponse is response type for the Query/PublicPosition RPC method. +message PublicPositionResponse { + uint64 id = 1; + uint64 pool_id = 2; + int32 lower_tick = 3; + int32 upper_tick = 4; + // bid_reserve_address specifies the account that reserves bidding amounts placed by bidders + string bid_reserve_address = 5; + string min_bid_amount = 6 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string fee_rate = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint64 last_rewards_auction_id = 8; + string liquidity = 9 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + uint64 position_id = 10; // underlying x/amm position's id + cosmos.base.v1beta1.Coin total_share = 11 [(gogoproto.nullable) = false]; +} diff --git a/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/tx.proto b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/tx.proto new file mode 100644 index 000000000..9e686e6a2 --- /dev/null +++ b/Crescent/crescent-starter/proto/crescent/liquidamm/v1beta1/tx.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +package crescent.liquidamm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/liquidamm/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the Msg service. +service Msg { + // MintShare defines a method for minting share of public position + rpc MintShare(MsgMintShare) returns (MsgMintShareResponse); + + // BurnShare defines a method for burning share of public position + rpc BurnShare(MsgBurnShare) returns (MsgBurnShareResponse); + + // PlaceBid defines a method for placing a bid for a rewards auction + rpc PlaceBid(MsgPlaceBid) returns (MsgPlaceBidResponse); +} + +// MsgMintShare defines a SDK message for minting share of public position. +message MsgMintShare { + string sender = 1; + uint64 public_position_id = 2; + repeated cosmos.base.v1beta1.Coin desired_amount = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +message MsgMintShareResponse { + cosmos.base.v1beta1.Coin minted_share = 1 [(gogoproto.nullable) = false]; + string liquidity = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// MsgBurnShare defines a SDK message for burning share of public position. +message MsgBurnShare { + string sender = 1; + uint64 public_position_id = 2; + cosmos.base.v1beta1.Coin share = 3 [(gogoproto.nullable) = false]; +} + +message MsgBurnShareResponse { + string removed_liquidity = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. +message MsgPlaceBid { + string sender = 1; + uint64 public_position_id = 2; + uint64 rewards_auction_id = 3; + cosmos.base.v1beta1.Coin share = 4 [(gogoproto.nullable) = false]; +} + +message MsgPlaceBidResponse {} diff --git a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto index ec7576734..ca2efddaf 100644 --- a/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto +++ b/Crescent/crescent-starter/proto/crescent/marketmaker/v1beta1/marketmaker.proto @@ -30,7 +30,7 @@ message Params { // Include the pairs that are incentive target pairs and the variables used in market maker scoring system repeated IncentivePair incentive_pairs = 4 - [(gogoproto.moretags) = "yaml:\"incentive_pairs\"", (gogoproto.nullable) = false]; + [(gogoproto.moretags) = "yaml:\"incentive_pairs\"", (gogoproto.nullable) = false] ; } diff --git a/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/BUILD.bazel b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/BUILD.bazel new file mode 100644 index 000000000..363699941 --- /dev/null +++ b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/BUILD.bazel @@ -0,0 +1,38 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "options_proto_files", + srcs = [ + "annotations.proto", + "openapiv2.proto", + ], +) + +go_library( + name = "go_default_library", + embed = [":options_go_proto"], + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options", +) + +proto_library( + name = "options_proto", + srcs = [ + "annotations.proto", + "openapiv2.proto", + ], + deps = [ + "@com_google_protobuf//:descriptor_proto", + "@com_google_protobuf//:struct_proto", + ], +) + +go_proto_library( + name = "options_go_proto", + compilers = ["//:go_apiv2"], + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options", + proto = ":options_proto", +) diff --git a/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.pb.go b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.pb.go new file mode 100644 index 000000000..dbe535168 --- /dev/null +++ b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.pb.go @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.0 +// source: protoc-gen-openapiv2/options/annotations.proto + +package options + +import ( + proto "github.com/golang/protobuf/proto" + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var file_protoc_gen_openapiv2_options_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.FileOptions)(nil), + ExtensionType: (*Swagger)(nil), + Field: 1042, + Name: "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger", + Tag: "bytes,1042,opt,name=openapiv2_swagger", + Filename: "protoc-gen-openapiv2/options/annotations.proto", + }, + { + ExtendedType: (*descriptor.MethodOptions)(nil), + ExtensionType: (*Operation)(nil), + Field: 1042, + Name: "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation", + Tag: "bytes,1042,opt,name=openapiv2_operation", + Filename: "protoc-gen-openapiv2/options/annotations.proto", + }, + { + ExtendedType: (*descriptor.MessageOptions)(nil), + ExtensionType: (*Schema)(nil), + Field: 1042, + Name: "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema", + Tag: "bytes,1042,opt,name=openapiv2_schema", + Filename: "protoc-gen-openapiv2/options/annotations.proto", + }, + { + ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtensionType: (*Tag)(nil), + Field: 1042, + Name: "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag", + Tag: "bytes,1042,opt,name=openapiv2_tag", + Filename: "protoc-gen-openapiv2/options/annotations.proto", + }, + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*JSONSchema)(nil), + Field: 1042, + Name: "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field", + Tag: "bytes,1042,opt,name=openapiv2_field", + Filename: "protoc-gen-openapiv2/options/annotations.proto", + }, +} + +// Extension fields to descriptor.FileOptions. +var ( + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + // + // optional grpc.gateway.protoc_gen_openapiv2.options.Swagger openapiv2_swagger = 1042; + E_Openapiv2Swagger = &file_protoc_gen_openapiv2_options_annotations_proto_extTypes[0] +) + +// Extension fields to descriptor.MethodOptions. +var ( + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + // + // optional grpc.gateway.protoc_gen_openapiv2.options.Operation openapiv2_operation = 1042; + E_Openapiv2Operation = &file_protoc_gen_openapiv2_options_annotations_proto_extTypes[1] +) + +// Extension fields to descriptor.MessageOptions. +var ( + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + // + // optional grpc.gateway.protoc_gen_openapiv2.options.Schema openapiv2_schema = 1042; + E_Openapiv2Schema = &file_protoc_gen_openapiv2_options_annotations_proto_extTypes[2] +) + +// Extension fields to descriptor.ServiceOptions. +var ( + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + // + // optional grpc.gateway.protoc_gen_openapiv2.options.Tag openapiv2_tag = 1042; + E_Openapiv2Tag = &file_protoc_gen_openapiv2_options_annotations_proto_extTypes[3] +) + +// Extension fields to descriptor.FieldOptions. +var ( + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + // + // optional grpc.gateway.protoc_gen_openapiv2.options.JSONSchema openapiv2_field = 1042; + E_Openapiv2Field = &file_protoc_gen_openapiv2_options_annotations_proto_extTypes[4] +) + +var File_protoc_gen_openapiv2_options_annotations_proto protoreflect.FileDescriptor + +var file_protoc_gen_openapiv2_options_annotations_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x29, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x7e, 0x0a, 0x11, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x5f, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x92, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x3a, 0x86, 0x01, 0x0a, 0x13, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x92, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x12, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x7e, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x92, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x3a, 0x75, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x5f, 0x74, 0x61, 0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x92, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x0c, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x54, 0x61, 0x67, 0x3a, 0x7e, 0x0a, 0x0f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x92, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x48, 0x5a, 0x46, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, + 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_protoc_gen_openapiv2_options_annotations_proto_goTypes = []interface{}{ + (*descriptor.FileOptions)(nil), // 0: google.protobuf.FileOptions + (*descriptor.MethodOptions)(nil), // 1: google.protobuf.MethodOptions + (*descriptor.MessageOptions)(nil), // 2: google.protobuf.MessageOptions + (*descriptor.ServiceOptions)(nil), // 3: google.protobuf.ServiceOptions + (*descriptor.FieldOptions)(nil), // 4: google.protobuf.FieldOptions + (*Swagger)(nil), // 5: grpc.gateway.protoc_gen_openapiv2.options.Swagger + (*Operation)(nil), // 6: grpc.gateway.protoc_gen_openapiv2.options.Operation + (*Schema)(nil), // 7: grpc.gateway.protoc_gen_openapiv2.options.Schema + (*Tag)(nil), // 8: grpc.gateway.protoc_gen_openapiv2.options.Tag + (*JSONSchema)(nil), // 9: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema +} +var file_protoc_gen_openapiv2_options_annotations_proto_depIdxs = []int32{ + 0, // 0: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger:extendee -> google.protobuf.FileOptions + 1, // 1: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation:extendee -> google.protobuf.MethodOptions + 2, // 2: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema:extendee -> google.protobuf.MessageOptions + 3, // 3: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag:extendee -> google.protobuf.ServiceOptions + 4, // 4: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field:extendee -> google.protobuf.FieldOptions + 5, // 5: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Swagger + 6, // 6: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Operation + 7, // 7: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Schema + 8, // 8: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Tag + 9, // 9: grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field:type_name -> grpc.gateway.protoc_gen_openapiv2.options.JSONSchema + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 5, // [5:10] is the sub-list for extension type_name + 0, // [0:5] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_protoc_gen_openapiv2_options_annotations_proto_init() } +func file_protoc_gen_openapiv2_options_annotations_proto_init() { + if File_protoc_gen_openapiv2_options_annotations_proto != nil { + return + } + file_protoc_gen_openapiv2_options_openapiv2_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protoc_gen_openapiv2_options_annotations_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 5, + NumServices: 0, + }, + GoTypes: file_protoc_gen_openapiv2_options_annotations_proto_goTypes, + DependencyIndexes: file_protoc_gen_openapiv2_options_annotations_proto_depIdxs, + ExtensionInfos: file_protoc_gen_openapiv2_options_annotations_proto_extTypes, + }.Build() + File_protoc_gen_openapiv2_options_annotations_proto = out.File + file_protoc_gen_openapiv2_options_annotations_proto_rawDesc = nil + file_protoc_gen_openapiv2_options_annotations_proto_goTypes = nil + file_protoc_gen_openapiv2_options_annotations_proto_depIdxs = nil +} diff --git a/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.proto b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.proto new file mode 100644 index 000000000..1c189e206 --- /dev/null +++ b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/annotations.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package grpc.gateway.protoc_gen_openapiv2.options; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; + +import "google/protobuf/descriptor.proto"; +import "protoc-gen-openapiv2/options/openapiv2.proto"; + +extend google.protobuf.FileOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Swagger openapiv2_swagger = 1042; +} +extend google.protobuf.MethodOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Operation openapiv2_operation = 1042; +} +extend google.protobuf.MessageOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Schema openapiv2_schema = 1042; +} +extend google.protobuf.ServiceOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Tag openapiv2_tag = 1042; +} +extend google.protobuf.FieldOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + JSONSchema openapiv2_field = 1042; +} diff --git a/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.pb.go b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.pb.go new file mode 100644 index 000000000..e3ef175d0 --- /dev/null +++ b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.pb.go @@ -0,0 +1,2790 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.0 +// source: protoc-gen-openapiv2/options/openapiv2.proto + +package options + +import ( + proto "github.com/golang/protobuf/proto" + _struct "github.com/golang/protobuf/ptypes/struct" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Scheme describes the schemes supported by the OpenAPI Swagger +// and Operation objects. +type Scheme int32 + +const ( + Scheme_UNKNOWN Scheme = 0 + Scheme_HTTP Scheme = 1 + Scheme_HTTPS Scheme = 2 + Scheme_WS Scheme = 3 + Scheme_WSS Scheme = 4 +) + +// Enum value maps for Scheme. +var ( + Scheme_name = map[int32]string{ + 0: "UNKNOWN", + 1: "HTTP", + 2: "HTTPS", + 3: "WS", + 4: "WSS", + } + Scheme_value = map[string]int32{ + "UNKNOWN": 0, + "HTTP": 1, + "HTTPS": 2, + "WS": 3, + "WSS": 4, + } +) + +func (x Scheme) Enum() *Scheme { + p := new(Scheme) + *p = x + return p +} + +func (x Scheme) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Scheme) Descriptor() protoreflect.EnumDescriptor { + return file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[0].Descriptor() +} + +func (Scheme) Type() protoreflect.EnumType { + return &file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[0] +} + +func (x Scheme) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Scheme.Descriptor instead. +func (Scheme) EnumDescriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{0} +} + +type JSONSchema_JSONSchemaSimpleTypes int32 + +const ( + JSONSchema_UNKNOWN JSONSchema_JSONSchemaSimpleTypes = 0 + JSONSchema_ARRAY JSONSchema_JSONSchemaSimpleTypes = 1 + JSONSchema_BOOLEAN JSONSchema_JSONSchemaSimpleTypes = 2 + JSONSchema_INTEGER JSONSchema_JSONSchemaSimpleTypes = 3 + JSONSchema_NULL JSONSchema_JSONSchemaSimpleTypes = 4 + JSONSchema_NUMBER JSONSchema_JSONSchemaSimpleTypes = 5 + JSONSchema_OBJECT JSONSchema_JSONSchemaSimpleTypes = 6 + JSONSchema_STRING JSONSchema_JSONSchemaSimpleTypes = 7 +) + +// Enum value maps for JSONSchema_JSONSchemaSimpleTypes. +var ( + JSONSchema_JSONSchemaSimpleTypes_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ARRAY", + 2: "BOOLEAN", + 3: "INTEGER", + 4: "NULL", + 5: "NUMBER", + 6: "OBJECT", + 7: "STRING", + } + JSONSchema_JSONSchemaSimpleTypes_value = map[string]int32{ + "UNKNOWN": 0, + "ARRAY": 1, + "BOOLEAN": 2, + "INTEGER": 3, + "NULL": 4, + "NUMBER": 5, + "OBJECT": 6, + "STRING": 7, + } +) + +func (x JSONSchema_JSONSchemaSimpleTypes) Enum() *JSONSchema_JSONSchemaSimpleTypes { + p := new(JSONSchema_JSONSchemaSimpleTypes) + *p = x + return p +} + +func (x JSONSchema_JSONSchemaSimpleTypes) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (JSONSchema_JSONSchemaSimpleTypes) Descriptor() protoreflect.EnumDescriptor { + return file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[1].Descriptor() +} + +func (JSONSchema_JSONSchemaSimpleTypes) Type() protoreflect.EnumType { + return &file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[1] +} + +func (x JSONSchema_JSONSchemaSimpleTypes) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use JSONSchema_JSONSchemaSimpleTypes.Descriptor instead. +func (JSONSchema_JSONSchemaSimpleTypes) EnumDescriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{9, 0} +} + +// The type of the security scheme. Valid values are "basic", +// "apiKey" or "oauth2". +type SecurityScheme_Type int32 + +const ( + SecurityScheme_TYPE_INVALID SecurityScheme_Type = 0 + SecurityScheme_TYPE_BASIC SecurityScheme_Type = 1 + SecurityScheme_TYPE_API_KEY SecurityScheme_Type = 2 + SecurityScheme_TYPE_OAUTH2 SecurityScheme_Type = 3 +) + +// Enum value maps for SecurityScheme_Type. +var ( + SecurityScheme_Type_name = map[int32]string{ + 0: "TYPE_INVALID", + 1: "TYPE_BASIC", + 2: "TYPE_API_KEY", + 3: "TYPE_OAUTH2", + } + SecurityScheme_Type_value = map[string]int32{ + "TYPE_INVALID": 0, + "TYPE_BASIC": 1, + "TYPE_API_KEY": 2, + "TYPE_OAUTH2": 3, + } +) + +func (x SecurityScheme_Type) Enum() *SecurityScheme_Type { + p := new(SecurityScheme_Type) + *p = x + return p +} + +func (x SecurityScheme_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SecurityScheme_Type) Descriptor() protoreflect.EnumDescriptor { + return file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[2].Descriptor() +} + +func (SecurityScheme_Type) Type() protoreflect.EnumType { + return &file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[2] +} + +func (x SecurityScheme_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SecurityScheme_Type.Descriptor instead. +func (SecurityScheme_Type) EnumDescriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{12, 0} +} + +// The location of the API key. Valid values are "query" or "header". +type SecurityScheme_In int32 + +const ( + SecurityScheme_IN_INVALID SecurityScheme_In = 0 + SecurityScheme_IN_QUERY SecurityScheme_In = 1 + SecurityScheme_IN_HEADER SecurityScheme_In = 2 +) + +// Enum value maps for SecurityScheme_In. +var ( + SecurityScheme_In_name = map[int32]string{ + 0: "IN_INVALID", + 1: "IN_QUERY", + 2: "IN_HEADER", + } + SecurityScheme_In_value = map[string]int32{ + "IN_INVALID": 0, + "IN_QUERY": 1, + "IN_HEADER": 2, + } +) + +func (x SecurityScheme_In) Enum() *SecurityScheme_In { + p := new(SecurityScheme_In) + *p = x + return p +} + +func (x SecurityScheme_In) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SecurityScheme_In) Descriptor() protoreflect.EnumDescriptor { + return file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[3].Descriptor() +} + +func (SecurityScheme_In) Type() protoreflect.EnumType { + return &file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[3] +} + +func (x SecurityScheme_In) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SecurityScheme_In.Descriptor instead. +func (SecurityScheme_In) EnumDescriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{12, 1} +} + +// The flow used by the OAuth2 security scheme. Valid values are +// "implicit", "password", "application" or "accessCode". +type SecurityScheme_Flow int32 + +const ( + SecurityScheme_FLOW_INVALID SecurityScheme_Flow = 0 + SecurityScheme_FLOW_IMPLICIT SecurityScheme_Flow = 1 + SecurityScheme_FLOW_PASSWORD SecurityScheme_Flow = 2 + SecurityScheme_FLOW_APPLICATION SecurityScheme_Flow = 3 + SecurityScheme_FLOW_ACCESS_CODE SecurityScheme_Flow = 4 +) + +// Enum value maps for SecurityScheme_Flow. +var ( + SecurityScheme_Flow_name = map[int32]string{ + 0: "FLOW_INVALID", + 1: "FLOW_IMPLICIT", + 2: "FLOW_PASSWORD", + 3: "FLOW_APPLICATION", + 4: "FLOW_ACCESS_CODE", + } + SecurityScheme_Flow_value = map[string]int32{ + "FLOW_INVALID": 0, + "FLOW_IMPLICIT": 1, + "FLOW_PASSWORD": 2, + "FLOW_APPLICATION": 3, + "FLOW_ACCESS_CODE": 4, + } +) + +func (x SecurityScheme_Flow) Enum() *SecurityScheme_Flow { + p := new(SecurityScheme_Flow) + *p = x + return p +} + +func (x SecurityScheme_Flow) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SecurityScheme_Flow) Descriptor() protoreflect.EnumDescriptor { + return file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[4].Descriptor() +} + +func (SecurityScheme_Flow) Type() protoreflect.EnumType { + return &file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes[4] +} + +func (x SecurityScheme_Flow) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SecurityScheme_Flow.Descriptor instead. +func (SecurityScheme_Flow) EnumDescriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{12, 2} +} + +// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: "; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// }; +// schemes: HTTPS; +// consumes: "application/json"; +// produces: "application/json"; +// }; +// +type Swagger struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Specifies the OpenAPI Specification version being used. It can be + // used by the OpenAPI UI and other clients to interpret the API listing. The + // value MUST be "2.0". + Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` + // Provides metadata about the API. The metadata can be used by the + // clients if needed. + Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // The host (name or ip) serving the API. This MUST be the host only and does + // not include the scheme nor sub-paths. It MAY include a port. If the host is + // not included, the host serving the documentation is to be used (including + // the port). The host does not support path templating. + Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` + // The base path on which the API is served, which is relative to the host. If + // it is not included, the API is served directly under the host. The value + // MUST start with a leading slash (/). The basePath does not support path + // templating. + // Note that using `base_path` does not change the endpoint paths that are + // generated in the resulting OpenAPI file. If you wish to use `base_path` + // with relatively generated OpenAPI paths, the `base_path` prefix must be + // manually removed from your `google.api.http` paths and your code changed to + // serve the API from the `base_path`. + BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` + // The transfer protocol of the API. Values MUST be from the list: "http", + // "https", "ws", "wss". If the schemes is not included, the default scheme to + // be used is the one used to access the OpenAPI definition itself. + Schemes []Scheme `protobuf:"varint,5,rep,packed,name=schemes,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.Scheme" json:"schemes,omitempty"` + // A list of MIME types the APIs can consume. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` + // A list of MIME types the APIs can produce. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` + // An object to hold responses that can be used across operations. This + // property does not define global responses for all operations. + Responses map[string]*Response `protobuf:"bytes,10,rep,name=responses,proto3" json:"responses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Security scheme definitions that can be used across the specification. + SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,11,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` + // A declaration of which security schemes are applied for the API as a whole. + // The list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). + // Individual operations can override this definition. + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` + // Additional external documentation. + ExternalDocs *ExternalDocumentation `protobuf:"bytes,14,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + Extensions map[string]*_struct.Value `protobuf:"bytes,15,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Swagger) Reset() { + *x = Swagger{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Swagger) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Swagger) ProtoMessage() {} + +func (x *Swagger) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Swagger.ProtoReflect.Descriptor instead. +func (*Swagger) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{0} +} + +func (x *Swagger) GetSwagger() string { + if x != nil { + return x.Swagger + } + return "" +} + +func (x *Swagger) GetInfo() *Info { + if x != nil { + return x.Info + } + return nil +} + +func (x *Swagger) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Swagger) GetBasePath() string { + if x != nil { + return x.BasePath + } + return "" +} + +func (x *Swagger) GetSchemes() []Scheme { + if x != nil { + return x.Schemes + } + return nil +} + +func (x *Swagger) GetConsumes() []string { + if x != nil { + return x.Consumes + } + return nil +} + +func (x *Swagger) GetProduces() []string { + if x != nil { + return x.Produces + } + return nil +} + +func (x *Swagger) GetResponses() map[string]*Response { + if x != nil { + return x.Responses + } + return nil +} + +func (x *Swagger) GetSecurityDefinitions() *SecurityDefinitions { + if x != nil { + return x.SecurityDefinitions + } + return nil +} + +func (x *Swagger) GetSecurity() []*SecurityRequirement { + if x != nil { + return x.Security + } + return nil +} + +func (x *Swagger) GetExternalDocs() *ExternalDocumentation { + if x != nil { + return x.ExternalDocs + } + return nil +} + +func (x *Swagger) GetExtensions() map[string]*_struct.Value { + if x != nil { + return x.Extensions + } + return nil +} + +// `Operation` is a representation of OpenAPI v2 specification's Operation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject +// +// Example: +// +// service EchoService { +// rpc Echo(SimpleMessage) returns (SimpleMessage) { +// option (google.api.http) = { +// get: "/v1/example/echo/{id}" +// }; +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { +// summary: "Get a message."; +// operation_id: "getMessage"; +// tags: "echo"; +// responses: { +// key: "200" +// value: { +// description: "OK"; +// } +// } +// }; +// } +// } +type Operation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A list of tags for API documentation control. Tags can be used for logical + // grouping of operations by resources or any other qualifier. + Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` + // A short summary of what the operation does. For maximum readability in the + // swagger-ui, this field SHOULD be less than 120 characters. + Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` + // A verbose explanation of the operation behavior. GFM syntax can be used for + // rich text representation. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Additional external documentation for this operation. + ExternalDocs *ExternalDocumentation `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + // Unique string used to identify the operation. The id MUST be unique among + // all operations described in the API. Tools and libraries MAY use the + // operationId to uniquely identify an operation, therefore, it is recommended + // to follow common programming naming conventions. + OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` + // A list of MIME types the operation can consume. This overrides the consumes + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` + // A list of MIME types the operation can produce. This overrides the produces + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` + // The list of possible responses as they are returned from executing this + // operation. + Responses map[string]*Response `protobuf:"bytes,9,rep,name=responses,proto3" json:"responses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The transfer protocol for the operation. Values MUST be from the list: + // "http", "https", "ws", "wss". The value overrides the OpenAPI Object + // schemes definition. + Schemes []Scheme `protobuf:"varint,10,rep,packed,name=schemes,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.Scheme" json:"schemes,omitempty"` + // Declares this operation to be deprecated. Usage of the declared operation + // should be refrained. Default value is false. + Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + // A declaration of which security schemes are applied for this operation. The + // list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). This + // definition overrides any declared top-level security. To remove a top-level + // security declaration, an empty array can be used. + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` + Extensions map[string]*_struct.Value `protobuf:"bytes,13,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Operation) Reset() { + *x = Operation{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Operation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Operation) ProtoMessage() {} + +func (x *Operation) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Operation.ProtoReflect.Descriptor instead. +func (*Operation) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{1} +} + +func (x *Operation) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *Operation) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *Operation) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Operation) GetExternalDocs() *ExternalDocumentation { + if x != nil { + return x.ExternalDocs + } + return nil +} + +func (x *Operation) GetOperationId() string { + if x != nil { + return x.OperationId + } + return "" +} + +func (x *Operation) GetConsumes() []string { + if x != nil { + return x.Consumes + } + return nil +} + +func (x *Operation) GetProduces() []string { + if x != nil { + return x.Produces + } + return nil +} + +func (x *Operation) GetResponses() map[string]*Response { + if x != nil { + return x.Responses + } + return nil +} + +func (x *Operation) GetSchemes() []Scheme { + if x != nil { + return x.Schemes + } + return nil +} + +func (x *Operation) GetDeprecated() bool { + if x != nil { + return x.Deprecated + } + return false +} + +func (x *Operation) GetSecurity() []*SecurityRequirement { + if x != nil { + return x.Security + } + return nil +} + +func (x *Operation) GetExtensions() map[string]*_struct.Value { + if x != nil { + return x.Extensions + } + return nil +} + +// `Header` is a representation of OpenAPI v2 specification's Header object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject +// +type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // `Description` is a short description of the header. + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // `Format` The extending format for the previously mentioned type. + Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"` + // `Default` Declares the value of the header that the server will use if none is provided. + // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + // Unlike JSON Schema this value MUST conform to the defined type for the header. + Default string `protobuf:"bytes,6,opt,name=default,proto3" json:"default,omitempty"` + // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. + Pattern string `protobuf:"bytes,13,opt,name=pattern,proto3" json:"pattern,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{2} +} + +func (x *Header) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Header) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Header) GetFormat() string { + if x != nil { + return x.Format + } + return "" +} + +func (x *Header) GetDefault() string { + if x != nil { + return x.Default + } + return "" +} + +func (x *Header) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +// `Response` is a representation of OpenAPI v2 specification's Response object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject +// +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // `Description` is a short description of the response. + // GFM syntax can be used for rich text representation. + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // `Schema` optionally defines the structure of the response. + // If `Schema` is not provided, it means there is no content to the response. + Schema *Schema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + // `Headers` A list of headers that are sent with the response. + // `Header` name is expected to be a string in the canonical format of the MIME header key + // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + Headers map[string]*Header `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // `Examples` gives per-mimetype response examples. + // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + Examples map[string]string `protobuf:"bytes,4,rep,name=examples,proto3" json:"examples,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Extensions map[string]*_struct.Value `protobuf:"bytes,5,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{3} +} + +func (x *Response) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Response) GetSchema() *Schema { + if x != nil { + return x.Schema + } + return nil +} + +func (x *Response) GetHeaders() map[string]*Header { + if x != nil { + return x.Headers + } + return nil +} + +func (x *Response) GetExamples() map[string]string { + if x != nil { + return x.Examples + } + return nil +} + +func (x *Response) GetExtensions() map[string]*_struct.Value { + if x != nil { + return x.Extensions + } + return nil +} + +// `Info` is a representation of OpenAPI v2 specification's Info object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: "; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// }; +// ... +// }; +// +type Info struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The title of the application. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // A short description of the application. GFM syntax can be used for rich + // text representation. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The Terms of Service for the API. + TermsOfService string `protobuf:"bytes,3,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` + // The contact information for the exposed API. + Contact *Contact `protobuf:"bytes,4,opt,name=contact,proto3" json:"contact,omitempty"` + // The license information for the exposed API. + License *License `protobuf:"bytes,5,opt,name=license,proto3" json:"license,omitempty"` + // Provides the version of the application API (not to be confused + // with the specification version). + Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"` + Extensions map[string]*_struct.Value `protobuf:"bytes,7,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Info) Reset() { + *x = Info{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Info) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Info) ProtoMessage() {} + +func (x *Info) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Info.ProtoReflect.Descriptor instead. +func (*Info) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{4} +} + +func (x *Info) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Info) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Info) GetTermsOfService() string { + if x != nil { + return x.TermsOfService + } + return "" +} + +func (x *Info) GetContact() *Contact { + if x != nil { + return x.Contact + } + return nil +} + +func (x *Info) GetLicense() *License { + if x != nil { + return x.License + } + return nil +} + +func (x *Info) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Info) GetExtensions() map[string]*_struct.Value { + if x != nil { + return x.Extensions + } + return nil +} + +// `Contact` is a representation of OpenAPI v2 specification's Contact object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// ... +// }; +// ... +// }; +// +type Contact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identifying name of the contact person/organization. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The URL pointing to the contact information. MUST be in the format of a + // URL. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // The email address of the contact person/organization. MUST be in the format + // of an email address. + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *Contact) Reset() { + *x = Contact{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Contact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Contact) ProtoMessage() {} + +func (x *Contact) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Contact.ProtoReflect.Descriptor instead. +func (*Contact) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{5} +} + +func (x *Contact) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Contact) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Contact) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +// `License` is a representation of OpenAPI v2 specification's License object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// ... +// }; +// ... +// }; +// +type License struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The license name used for the API. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A URL to the license used for the API. MUST be in the format of a URL. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *License) Reset() { + *x = License{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *License) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*License) ProtoMessage() {} + +func (x *License) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use License.ProtoReflect.Descriptor instead. +func (*License) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{6} +} + +func (x *License) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *License) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +// `ExternalDocumentation` is a representation of OpenAPI v2 specification's +// ExternalDocumentation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// ... +// external_docs: { +// description: "More about gRPC-Gateway"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// } +// ... +// }; +// +type ExternalDocumentation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A short description of the target documentation. GFM syntax can be used for + // rich text representation. + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // The URL for the target documentation. Value MUST be in the format + // of a URL. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *ExternalDocumentation) Reset() { + *x = ExternalDocumentation{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExternalDocumentation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExternalDocumentation) ProtoMessage() {} + +func (x *ExternalDocumentation) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExternalDocumentation.ProtoReflect.Descriptor instead. +func (*ExternalDocumentation) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{7} +} + +func (x *ExternalDocumentation) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ExternalDocumentation) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +// `Schema` is a representation of OpenAPI v2 specification's Schema object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +type Schema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JsonSchema *JSONSchema `protobuf:"bytes,1,opt,name=json_schema,json=jsonSchema,proto3" json:"json_schema,omitempty"` + // Adds support for polymorphism. The discriminator is the schema property + // name that is used to differentiate between other schema that inherit this + // schema. The property name used MUST be defined at this schema and it MUST + // be in the required property list. When used, the value MUST be the name of + // this schema or any schema that inherits it. + Discriminator string `protobuf:"bytes,2,opt,name=discriminator,proto3" json:"discriminator,omitempty"` + // Relevant only for Schema "properties" definitions. Declares the property as + // "read only". This means that it MAY be sent as part of a response but MUST + // NOT be sent as part of the request. Properties marked as readOnly being + // true SHOULD NOT be in the required list of the defined schema. Default + // value is false. + ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + // Additional external documentation for this schema. + ExternalDocs *ExternalDocumentation `protobuf:"bytes,5,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + // A free-form property to include an example of an instance for this schema in JSON. + // This is copied verbatim to the output. + Example string `protobuf:"bytes,6,opt,name=example,proto3" json:"example,omitempty"` +} + +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema) ProtoMessage() {} + +func (x *Schema) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{8} +} + +func (x *Schema) GetJsonSchema() *JSONSchema { + if x != nil { + return x.JsonSchema + } + return nil +} + +func (x *Schema) GetDiscriminator() string { + if x != nil { + return x.Discriminator + } + return "" +} + +func (x *Schema) GetReadOnly() bool { + if x != nil { + return x.ReadOnly + } + return false +} + +func (x *Schema) GetExternalDocs() *ExternalDocumentation { + if x != nil { + return x.ExternalDocs + } + return nil +} + +func (x *Schema) GetExample() string { + if x != nil { + return x.Example + } + return "" +} + +// `JSONSchema` represents properties from JSON Schema taken, and as used, in +// the OpenAPI v2 spec. +// +// This includes changes made by OpenAPI v2. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, +// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json +// +// Example: +// +// message SimpleMessage { +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { +// json_schema: { +// title: "SimpleMessage" +// description: "A simple message." +// required: ["id"] +// } +// }; +// +// // Id represents the message identifier. +// string id = 1; [ +// (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { +// {description: "The unique identifier of the simple message." +// }]; +// } +// +type JSONSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Ref is used to define an external reference to include in the message. + // This could be a fully qualified proto message reference, and that type must + // be imported into the protofile. If no message is identified, the Ref will + // be used verbatim in the output. + // For example: + // `ref: ".google.protobuf.Timestamp"`. + Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` + // The title of the schema. + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + // A short description of the schema. + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + Default string `protobuf:"bytes,7,opt,name=default,proto3" json:"default,omitempty"` + ReadOnly bool `protobuf:"varint,8,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + // A free-form property to include a JSON example of this field. This is copied + // verbatim to the output swagger.json. Quotes must be escaped. + // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + Example string `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` + MultipleOf float64 `protobuf:"fixed64,10,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + // Maximum represents an inclusive upper limit for a numeric instance. The + // value of MUST be a number, + Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + // minimum represents an inclusive lower limit for a numeric instance. The + // value of MUST be a number, + Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength uint64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength uint64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems uint64 `protobuf:"varint,20,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems uint64 `protobuf:"varint,21,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,22,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + MaxProperties uint64 `protobuf:"varint,24,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` + MinProperties uint64 `protobuf:"varint,25,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` + Required []string `protobuf:"bytes,26,rep,name=required,proto3" json:"required,omitempty"` + // Items in 'array' must be unique. + Array []string `protobuf:"bytes,34,rep,name=array,proto3" json:"array,omitempty"` + Type []JSONSchema_JSONSchemaSimpleTypes `protobuf:"varint,35,rep,packed,name=type,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.JSONSchema_JSONSchemaSimpleTypes" json:"type,omitempty"` + // `Format` + Format string `protobuf:"bytes,36,opt,name=format,proto3" json:"format,omitempty"` + // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 + Enum []string `protobuf:"bytes,46,rep,name=enum,proto3" json:"enum,omitempty"` +} + +func (x *JSONSchema) Reset() { + *x = JSONSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JSONSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JSONSchema) ProtoMessage() {} + +func (x *JSONSchema) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use JSONSchema.ProtoReflect.Descriptor instead. +func (*JSONSchema) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{9} +} + +func (x *JSONSchema) GetRef() string { + if x != nil { + return x.Ref + } + return "" +} + +func (x *JSONSchema) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *JSONSchema) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *JSONSchema) GetDefault() string { + if x != nil { + return x.Default + } + return "" +} + +func (x *JSONSchema) GetReadOnly() bool { + if x != nil { + return x.ReadOnly + } + return false +} + +func (x *JSONSchema) GetExample() string { + if x != nil { + return x.Example + } + return "" +} + +func (x *JSONSchema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf + } + return 0 +} + +func (x *JSONSchema) GetMaximum() float64 { + if x != nil { + return x.Maximum + } + return 0 +} + +func (x *JSONSchema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum + } + return false +} + +func (x *JSONSchema) GetMinimum() float64 { + if x != nil { + return x.Minimum + } + return 0 +} + +func (x *JSONSchema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum + } + return false +} + +func (x *JSONSchema) GetMaxLength() uint64 { + if x != nil { + return x.MaxLength + } + return 0 +} + +func (x *JSONSchema) GetMinLength() uint64 { + if x != nil { + return x.MinLength + } + return 0 +} + +func (x *JSONSchema) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +func (x *JSONSchema) GetMaxItems() uint64 { + if x != nil { + return x.MaxItems + } + return 0 +} + +func (x *JSONSchema) GetMinItems() uint64 { + if x != nil { + return x.MinItems + } + return 0 +} + +func (x *JSONSchema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems + } + return false +} + +func (x *JSONSchema) GetMaxProperties() uint64 { + if x != nil { + return x.MaxProperties + } + return 0 +} + +func (x *JSONSchema) GetMinProperties() uint64 { + if x != nil { + return x.MinProperties + } + return 0 +} + +func (x *JSONSchema) GetRequired() []string { + if x != nil { + return x.Required + } + return nil +} + +func (x *JSONSchema) GetArray() []string { + if x != nil { + return x.Array + } + return nil +} + +func (x *JSONSchema) GetType() []JSONSchema_JSONSchemaSimpleTypes { + if x != nil { + return x.Type + } + return nil +} + +func (x *JSONSchema) GetFormat() string { + if x != nil { + return x.Format + } + return "" +} + +func (x *JSONSchema) GetEnum() []string { + if x != nil { + return x.Enum + } + return nil +} + +// `Tag` is a representation of OpenAPI v2 specification's Tag object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject +// +type Tag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A short description for the tag. GFM syntax can be used for rich text + // representation. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Additional external documentation for this tag. + ExternalDocs *ExternalDocumentation `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` +} + +func (x *Tag) Reset() { + *x = Tag{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tag) ProtoMessage() {} + +func (x *Tag) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tag.ProtoReflect.Descriptor instead. +func (*Tag) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{10} +} + +func (x *Tag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Tag) GetExternalDocs() *ExternalDocumentation { + if x != nil { + return x.ExternalDocs + } + return nil +} + +// `SecurityDefinitions` is a representation of OpenAPI v2 specification's +// Security Definitions object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject +// +// A declaration of the security schemes available to be used in the +// specification. This does not enforce the security schemes on the operations +// and only serves to provide the relevant details for each scheme. +type SecurityDefinitions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A single security scheme definition, mapping a "name" to the scheme it + // defines. + Security map[string]*SecurityScheme `protobuf:"bytes,1,rep,name=security,proto3" json:"security,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *SecurityDefinitions) Reset() { + *x = SecurityDefinitions{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityDefinitions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityDefinitions) ProtoMessage() {} + +func (x *SecurityDefinitions) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecurityDefinitions.ProtoReflect.Descriptor instead. +func (*SecurityDefinitions) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{11} +} + +func (x *SecurityDefinitions) GetSecurity() map[string]*SecurityScheme { + if x != nil { + return x.Security + } + return nil +} + +// `SecurityScheme` is a representation of OpenAPI v2 specification's +// Security Scheme object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject +// +// Allows the definition of a security scheme that can be used by the +// operations. Supported schemes are basic authentication, an API key (either as +// a header or as a query parameter) and OAuth2's common flows (implicit, +// password, application and access code). +type SecurityScheme struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type of the security scheme. Valid values are "basic", + // "apiKey" or "oauth2". + Type SecurityScheme_Type `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme_Type" json:"type,omitempty"` + // A short description for security scheme. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The name of the header or query parameter to be used. + // Valid for apiKey. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // The location of the API key. Valid values are "query" or + // "header". + // Valid for apiKey. + In SecurityScheme_In `protobuf:"varint,4,opt,name=in,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme_In" json:"in,omitempty"` + // The flow used by the OAuth2 security scheme. Valid values are + // "implicit", "password", "application" or "accessCode". + // Valid for oauth2. + Flow SecurityScheme_Flow `protobuf:"varint,5,opt,name=flow,proto3,enum=grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme_Flow" json:"flow,omitempty"` + // The authorization URL to be used for this flow. This SHOULD be in + // the form of a URL. + // Valid for oauth2/implicit and oauth2/accessCode. + AuthorizationUrl string `protobuf:"bytes,6,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` + // The token URL to be used for this flow. This SHOULD be in the + // form of a URL. + // Valid for oauth2/password, oauth2/application and oauth2/accessCode. + TokenUrl string `protobuf:"bytes,7,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + // The available scopes for the OAuth2 security scheme. + // Valid for oauth2. + Scopes *Scopes `protobuf:"bytes,8,opt,name=scopes,proto3" json:"scopes,omitempty"` + Extensions map[string]*_struct.Value `protobuf:"bytes,9,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *SecurityScheme) Reset() { + *x = SecurityScheme{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityScheme) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityScheme) ProtoMessage() {} + +func (x *SecurityScheme) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecurityScheme.ProtoReflect.Descriptor instead. +func (*SecurityScheme) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{12} +} + +func (x *SecurityScheme) GetType() SecurityScheme_Type { + if x != nil { + return x.Type + } + return SecurityScheme_TYPE_INVALID +} + +func (x *SecurityScheme) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *SecurityScheme) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SecurityScheme) GetIn() SecurityScheme_In { + if x != nil { + return x.In + } + return SecurityScheme_IN_INVALID +} + +func (x *SecurityScheme) GetFlow() SecurityScheme_Flow { + if x != nil { + return x.Flow + } + return SecurityScheme_FLOW_INVALID +} + +func (x *SecurityScheme) GetAuthorizationUrl() string { + if x != nil { + return x.AuthorizationUrl + } + return "" +} + +func (x *SecurityScheme) GetTokenUrl() string { + if x != nil { + return x.TokenUrl + } + return "" +} + +func (x *SecurityScheme) GetScopes() *Scopes { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *SecurityScheme) GetExtensions() map[string]*_struct.Value { + if x != nil { + return x.Extensions + } + return nil +} + +// `SecurityRequirement` is a representation of OpenAPI v2 specification's +// Security Requirement object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject +// +// Lists the required security schemes to execute this operation. The object can +// have multiple security schemes declared in it which are all required (that +// is, there is a logical AND between the schemes). +// +// The name used for each property MUST correspond to a security scheme +// declared in the Security Definitions. +type SecurityRequirement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Each name must correspond to a security scheme which is declared in + // the Security Definitions. If the security scheme is of type "oauth2", + // then the value is a list of scope names required for the execution. + // For other security scheme types, the array MUST be empty. + SecurityRequirement map[string]*SecurityRequirement_SecurityRequirementValue `protobuf:"bytes,1,rep,name=security_requirement,json=securityRequirement,proto3" json:"security_requirement,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *SecurityRequirement) Reset() { + *x = SecurityRequirement{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityRequirement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityRequirement) ProtoMessage() {} + +func (x *SecurityRequirement) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead. +func (*SecurityRequirement) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{13} +} + +func (x *SecurityRequirement) GetSecurityRequirement() map[string]*SecurityRequirement_SecurityRequirementValue { + if x != nil { + return x.SecurityRequirement + } + return nil +} + +// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject +// +// Lists the available scopes for an OAuth2 security scheme. +type Scopes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Maps between a name of a scope to a short description of it (as the value + // of the property). + Scope map[string]string `protobuf:"bytes,1,rep,name=scope,proto3" json:"scope,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Scopes) Reset() { + *x = Scopes{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scopes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scopes) ProtoMessage() {} + +func (x *Scopes) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scopes.ProtoReflect.Descriptor instead. +func (*Scopes) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{14} +} + +func (x *Scopes) GetScope() map[string]string { + if x != nil { + return x.Scope + } + return nil +} + +// If the security scheme is of type "oauth2", then the value is a list of +// scope names required for the execution. For other security scheme types, +// the array MUST be empty. +type SecurityRequirement_SecurityRequirementValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scope []string `protobuf:"bytes,1,rep,name=scope,proto3" json:"scope,omitempty"` +} + +func (x *SecurityRequirement_SecurityRequirementValue) Reset() { + *x = SecurityRequirement_SecurityRequirementValue{} + if protoimpl.UnsafeEnabled { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityRequirement_SecurityRequirementValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityRequirement_SecurityRequirementValue) ProtoMessage() {} + +func (x *SecurityRequirement_SecurityRequirementValue) ProtoReflect() protoreflect.Message { + mi := &file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecurityRequirement_SecurityRequirementValue.ProtoReflect.Descriptor instead. +func (*SecurityRequirement_SecurityRequirementValue) Descriptor() ([]byte, []int) { + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *SecurityRequirement_SecurityRequirementValue) GetScope() []string { + if x != nil { + return x.Scope + } + return nil +} + +var File_protoc_gen_openapiv2_options_openapiv2_proto protoreflect.FileDescriptor + +var file_protoc_gen_openapiv2_options_openapiv2_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x07, 0x0a, 0x07, 0x53, 0x77, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x12, 0x43, 0x0a, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x73, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x4b, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x71, 0x0a, 0x14, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x13, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x08, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, + 0x62, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x1a, 0x71, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, + 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, + 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0d, 0x10, 0x0e, 0x22, + 0xff, 0x06, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x65, 0x0a, + 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x44, 0x6f, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, + 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, + 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, + 0x61, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x0a, 0x20, + 0x03, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, + 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x5a, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x64, 0x0a, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x44, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x1a, 0x71, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x08, 0x10, + 0x09, 0x22, 0xd8, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, + 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0a, + 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x4a, 0x04, 0x08, 0x0c, 0x10, 0x0d, 0x4a, 0x04, + 0x08, 0x0e, 0x10, 0x0f, 0x4a, 0x04, 0x08, 0x0f, 0x10, 0x10, 0x4a, 0x04, 0x08, 0x10, 0x10, 0x11, + 0x4a, 0x04, 0x08, 0x11, 0x10, 0x12, 0x4a, 0x04, 0x08, 0x12, 0x10, 0x13, 0x22, 0x9a, 0x05, 0x0a, + 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x5a, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x12, 0x63, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x6d, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x47, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x55, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd6, 0x03, 0x0a, 0x04, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, + 0x72, 0x6d, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x4f, 0x66, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x12, 0x4c, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5f, 0x0a, 0x0a, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x55, 0x0a, 0x0f, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x45, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x2f, 0x0a, 0x07, 0x4c, 0x69, 0x63, + 0x65, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x4b, 0x0a, 0x15, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0xaa, 0x02, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x12, 0x56, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0a, + 0x6a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x69, + 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x65, 0x0a, + 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x44, 0x6f, 0x63, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x22, 0xdf, 0x07, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, + 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, + 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, + 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, + 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, + 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, + 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x1a, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x22, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x72, 0x72, + 0x61, 0x79, 0x12, 0x5f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x23, 0x20, 0x03, 0x28, 0x0e, + 0x32, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x4f, + 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x24, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x18, 0x2e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x22, + 0x77, 0x0a, 0x15, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x69, 0x6d, + 0x70, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x01, + 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x0b, 0x0a, + 0x07, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, + 0x4c, 0x4c, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x05, + 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, + 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x12, 0x10, 0x13, + 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, 0x04, 0x08, 0x17, 0x10, 0x18, 0x4a, 0x04, 0x08, 0x1b, + 0x10, 0x1c, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x1d, 0x10, 0x1e, 0x4a, 0x04, + 0x08, 0x1e, 0x10, 0x22, 0x4a, 0x04, 0x08, 0x25, 0x10, 0x2a, 0x4a, 0x04, 0x08, 0x2a, 0x10, 0x2b, + 0x4a, 0x04, 0x08, 0x2b, 0x10, 0x2e, 0x22, 0x94, 0x01, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x65, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xf7, 0x01, + 0x0a, 0x13, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x68, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x1a, + 0x76, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x4f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xff, 0x06, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x52, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, + 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x3c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x49, 0x6e, 0x52, 0x02, + 0x69, 0x6e, 0x12, 0x52, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x46, 0x6c, 0x6f, 0x77, + 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, + 0x12, 0x49, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x63, 0x6f, + 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x69, 0x0a, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x49, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x55, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4b, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x41, 0x50, 0x49, 0x5f, 0x4b, 0x45, 0x59, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x4f, 0x41, 0x55, 0x54, 0x48, 0x32, 0x10, 0x03, 0x22, 0x31, 0x0a, 0x02, 0x49, 0x6e, + 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x49, 0x4e, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x02, 0x22, 0x6a, 0x0a, + 0x04, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x4c, 0x4f, 0x57, 0x5f, + 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x4c, + 0x4f, 0x57, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x12, 0x14, 0x0a, + 0x10, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x04, 0x22, 0xf6, 0x02, 0x0a, 0x13, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x8a, 0x01, 0x0a, 0x14, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x57, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x13, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x30, + 0x0a, 0x18, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x1a, 0x9f, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x6d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x57, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x96, 0x01, 0x0a, 0x06, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x52, 0x0a, + 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x3b, 0x0a, 0x06, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, + 0x48, 0x54, 0x54, 0x50, 0x53, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x57, 0x53, 0x10, 0x03, 0x12, + 0x07, 0x0a, 0x03, 0x57, 0x53, 0x53, 0x10, 0x04, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescOnce sync.Once + file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescData = file_protoc_gen_openapiv2_options_openapiv2_proto_rawDesc +) + +func file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescGZIP() []byte { + file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescOnce.Do(func() { + file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescData = protoimpl.X.CompressGZIP(file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescData) + }) + return file_protoc_gen_openapiv2_options_openapiv2_proto_rawDescData +} + +var file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_protoc_gen_openapiv2_options_openapiv2_proto_goTypes = []interface{}{ + (Scheme)(0), // 0: grpc.gateway.protoc_gen_openapiv2.options.Scheme + (JSONSchema_JSONSchemaSimpleTypes)(0), // 1: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes + (SecurityScheme_Type)(0), // 2: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type + (SecurityScheme_In)(0), // 3: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In + (SecurityScheme_Flow)(0), // 4: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow + (*Swagger)(nil), // 5: grpc.gateway.protoc_gen_openapiv2.options.Swagger + (*Operation)(nil), // 6: grpc.gateway.protoc_gen_openapiv2.options.Operation + (*Header)(nil), // 7: grpc.gateway.protoc_gen_openapiv2.options.Header + (*Response)(nil), // 8: grpc.gateway.protoc_gen_openapiv2.options.Response + (*Info)(nil), // 9: grpc.gateway.protoc_gen_openapiv2.options.Info + (*Contact)(nil), // 10: grpc.gateway.protoc_gen_openapiv2.options.Contact + (*License)(nil), // 11: grpc.gateway.protoc_gen_openapiv2.options.License + (*ExternalDocumentation)(nil), // 12: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + (*Schema)(nil), // 13: grpc.gateway.protoc_gen_openapiv2.options.Schema + (*JSONSchema)(nil), // 14: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema + (*Tag)(nil), // 15: grpc.gateway.protoc_gen_openapiv2.options.Tag + (*SecurityDefinitions)(nil), // 16: grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions + (*SecurityScheme)(nil), // 17: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme + (*SecurityRequirement)(nil), // 18: grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement + (*Scopes)(nil), // 19: grpc.gateway.protoc_gen_openapiv2.options.Scopes + nil, // 20: grpc.gateway.protoc_gen_openapiv2.options.Swagger.ResponsesEntry + nil, // 21: grpc.gateway.protoc_gen_openapiv2.options.Swagger.ExtensionsEntry + nil, // 22: grpc.gateway.protoc_gen_openapiv2.options.Operation.ResponsesEntry + nil, // 23: grpc.gateway.protoc_gen_openapiv2.options.Operation.ExtensionsEntry + nil, // 24: grpc.gateway.protoc_gen_openapiv2.options.Response.HeadersEntry + nil, // 25: grpc.gateway.protoc_gen_openapiv2.options.Response.ExamplesEntry + nil, // 26: grpc.gateway.protoc_gen_openapiv2.options.Response.ExtensionsEntry + nil, // 27: grpc.gateway.protoc_gen_openapiv2.options.Info.ExtensionsEntry + nil, // 28: grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.SecurityEntry + nil, // 29: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.ExtensionsEntry + (*SecurityRequirement_SecurityRequirementValue)(nil), // 30: grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue + nil, // 31: grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementEntry + nil, // 32: grpc.gateway.protoc_gen_openapiv2.options.Scopes.ScopeEntry + (*_struct.Value)(nil), // 33: google.protobuf.Value +} +var file_protoc_gen_openapiv2_options_openapiv2_proto_depIdxs = []int32{ + 9, // 0: grpc.gateway.protoc_gen_openapiv2.options.Swagger.info:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Info + 0, // 1: grpc.gateway.protoc_gen_openapiv2.options.Swagger.schemes:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Scheme + 20, // 2: grpc.gateway.protoc_gen_openapiv2.options.Swagger.responses:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Swagger.ResponsesEntry + 16, // 3: grpc.gateway.protoc_gen_openapiv2.options.Swagger.security_definitions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions + 18, // 4: grpc.gateway.protoc_gen_openapiv2.options.Swagger.security:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement + 12, // 5: grpc.gateway.protoc_gen_openapiv2.options.Swagger.external_docs:type_name -> grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + 21, // 6: grpc.gateway.protoc_gen_openapiv2.options.Swagger.extensions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Swagger.ExtensionsEntry + 12, // 7: grpc.gateway.protoc_gen_openapiv2.options.Operation.external_docs:type_name -> grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + 22, // 8: grpc.gateway.protoc_gen_openapiv2.options.Operation.responses:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Operation.ResponsesEntry + 0, // 9: grpc.gateway.protoc_gen_openapiv2.options.Operation.schemes:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Scheme + 18, // 10: grpc.gateway.protoc_gen_openapiv2.options.Operation.security:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement + 23, // 11: grpc.gateway.protoc_gen_openapiv2.options.Operation.extensions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Operation.ExtensionsEntry + 13, // 12: grpc.gateway.protoc_gen_openapiv2.options.Response.schema:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Schema + 24, // 13: grpc.gateway.protoc_gen_openapiv2.options.Response.headers:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Response.HeadersEntry + 25, // 14: grpc.gateway.protoc_gen_openapiv2.options.Response.examples:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Response.ExamplesEntry + 26, // 15: grpc.gateway.protoc_gen_openapiv2.options.Response.extensions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Response.ExtensionsEntry + 10, // 16: grpc.gateway.protoc_gen_openapiv2.options.Info.contact:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Contact + 11, // 17: grpc.gateway.protoc_gen_openapiv2.options.Info.license:type_name -> grpc.gateway.protoc_gen_openapiv2.options.License + 27, // 18: grpc.gateway.protoc_gen_openapiv2.options.Info.extensions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Info.ExtensionsEntry + 14, // 19: grpc.gateway.protoc_gen_openapiv2.options.Schema.json_schema:type_name -> grpc.gateway.protoc_gen_openapiv2.options.JSONSchema + 12, // 20: grpc.gateway.protoc_gen_openapiv2.options.Schema.external_docs:type_name -> grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + 1, // 21: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.type:type_name -> grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes + 12, // 22: grpc.gateway.protoc_gen_openapiv2.options.Tag.external_docs:type_name -> grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + 28, // 23: grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.security:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.SecurityEntry + 2, // 24: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.type:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type + 3, // 25: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.in:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In + 4, // 26: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.flow:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow + 19, // 27: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.scopes:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Scopes + 29, // 28: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.extensions:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.ExtensionsEntry + 31, // 29: grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.security_requirement:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementEntry + 32, // 30: grpc.gateway.protoc_gen_openapiv2.options.Scopes.scope:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Scopes.ScopeEntry + 8, // 31: grpc.gateway.protoc_gen_openapiv2.options.Swagger.ResponsesEntry.value:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Response + 33, // 32: grpc.gateway.protoc_gen_openapiv2.options.Swagger.ExtensionsEntry.value:type_name -> google.protobuf.Value + 8, // 33: grpc.gateway.protoc_gen_openapiv2.options.Operation.ResponsesEntry.value:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Response + 33, // 34: grpc.gateway.protoc_gen_openapiv2.options.Operation.ExtensionsEntry.value:type_name -> google.protobuf.Value + 7, // 35: grpc.gateway.protoc_gen_openapiv2.options.Response.HeadersEntry.value:type_name -> grpc.gateway.protoc_gen_openapiv2.options.Header + 33, // 36: grpc.gateway.protoc_gen_openapiv2.options.Response.ExtensionsEntry.value:type_name -> google.protobuf.Value + 33, // 37: grpc.gateway.protoc_gen_openapiv2.options.Info.ExtensionsEntry.value:type_name -> google.protobuf.Value + 17, // 38: grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.SecurityEntry.value:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme + 33, // 39: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.ExtensionsEntry.value:type_name -> google.protobuf.Value + 30, // 40: grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementEntry.value:type_name -> grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue + 41, // [41:41] is the sub-list for method output_type + 41, // [41:41] is the sub-list for method input_type + 41, // [41:41] is the sub-list for extension type_name + 41, // [41:41] is the sub-list for extension extendee + 0, // [0:41] is the sub-list for field type_name +} + +func init() { file_protoc_gen_openapiv2_options_openapiv2_proto_init() } +func file_protoc_gen_openapiv2_options_openapiv2_proto_init() { + if File_protoc_gen_openapiv2_options_openapiv2_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Swagger); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Contact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*License); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExternalDocumentation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JSONSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityDefinitions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityScheme); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityRequirement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scopes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityRequirement_SecurityRequirementValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protoc_gen_openapiv2_options_openapiv2_proto_rawDesc, + NumEnums: 5, + NumMessages: 28, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protoc_gen_openapiv2_options_openapiv2_proto_goTypes, + DependencyIndexes: file_protoc_gen_openapiv2_options_openapiv2_proto_depIdxs, + EnumInfos: file_protoc_gen_openapiv2_options_openapiv2_proto_enumTypes, + MessageInfos: file_protoc_gen_openapiv2_options_openapiv2_proto_msgTypes, + }.Build() + File_protoc_gen_openapiv2_options_openapiv2_proto = out.File + file_protoc_gen_openapiv2_options_openapiv2_proto_rawDesc = nil + file_protoc_gen_openapiv2_options_openapiv2_proto_goTypes = nil + file_protoc_gen_openapiv2_options_openapiv2_proto_depIdxs = nil +} diff --git a/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.proto b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.proto new file mode 100644 index 000000000..7be1fb572 --- /dev/null +++ b/Crescent/crescent-starter/proto/protoc-gen-openapiv2/options/openapiv2.proto @@ -0,0 +1,645 @@ +syntax = "proto3"; + +package grpc.gateway.protoc_gen_openapiv2.options; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; + +import "google/protobuf/struct.proto"; + +// Scheme describes the schemes supported by the OpenAPI Swagger +// and Operation objects. +enum Scheme { + UNKNOWN = 0; + HTTP = 1; + HTTPS = 2; + WS = 3; + WSS = 4; +} + +// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: "; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// }; +// schemes: HTTPS; +// consumes: "application/json"; +// produces: "application/json"; +// }; +// +message Swagger { + // Specifies the OpenAPI Specification version being used. It can be + // used by the OpenAPI UI and other clients to interpret the API listing. The + // value MUST be "2.0". + string swagger = 1; + // Provides metadata about the API. The metadata can be used by the + // clients if needed. + Info info = 2; + // The host (name or ip) serving the API. This MUST be the host only and does + // not include the scheme nor sub-paths. It MAY include a port. If the host is + // not included, the host serving the documentation is to be used (including + // the port). The host does not support path templating. + string host = 3; + // The base path on which the API is served, which is relative to the host. If + // it is not included, the API is served directly under the host. The value + // MUST start with a leading slash (/). The basePath does not support path + // templating. + // Note that using `base_path` does not change the endpoint paths that are + // generated in the resulting OpenAPI file. If you wish to use `base_path` + // with relatively generated OpenAPI paths, the `base_path` prefix must be + // manually removed from your `google.api.http` paths and your code changed to + // serve the API from the `base_path`. + string base_path = 4; + // The transfer protocol of the API. Values MUST be from the list: "http", + // "https", "ws", "wss". If the schemes is not included, the default scheme to + // be used is the one used to access the OpenAPI definition itself. + repeated Scheme schemes = 5; + // A list of MIME types the APIs can consume. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + repeated string consumes = 6; + // A list of MIME types the APIs can produce. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + repeated string produces = 7; + // field 8 is reserved for 'paths'. + reserved 8; + // field 9 is reserved for 'definitions', which at this time are already + // exposed as and customizable as proto messages. + reserved 9; + // An object to hold responses that can be used across operations. This + // property does not define global responses for all operations. + map responses = 10; + // Security scheme definitions that can be used across the specification. + SecurityDefinitions security_definitions = 11; + // A declaration of which security schemes are applied for the API as a whole. + // The list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). + // Individual operations can override this definition. + repeated SecurityRequirement security = 12; + // field 13 is reserved for 'tags', which are supposed to be exposed as and + // customizable as proto services. TODO(ivucica): add processing of proto + // service objects into OpenAPI v2 Tag objects. + reserved 13; + // Additional external documentation. + ExternalDocumentation external_docs = 14; + map extensions = 15; +} + +// `Operation` is a representation of OpenAPI v2 specification's Operation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject +// +// Example: +// +// service EchoService { +// rpc Echo(SimpleMessage) returns (SimpleMessage) { +// option (google.api.http) = { +// get: "/v1/example/echo/{id}" +// }; +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { +// summary: "Get a message."; +// operation_id: "getMessage"; +// tags: "echo"; +// responses: { +// key: "200" +// value: { +// description: "OK"; +// } +// } +// }; +// } +// } +message Operation { + // A list of tags for API documentation control. Tags can be used for logical + // grouping of operations by resources or any other qualifier. + repeated string tags = 1; + // A short summary of what the operation does. For maximum readability in the + // swagger-ui, this field SHOULD be less than 120 characters. + string summary = 2; + // A verbose explanation of the operation behavior. GFM syntax can be used for + // rich text representation. + string description = 3; + // Additional external documentation for this operation. + ExternalDocumentation external_docs = 4; + // Unique string used to identify the operation. The id MUST be unique among + // all operations described in the API. Tools and libraries MAY use the + // operationId to uniquely identify an operation, therefore, it is recommended + // to follow common programming naming conventions. + string operation_id = 5; + // A list of MIME types the operation can consume. This overrides the consumes + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + repeated string consumes = 6; + // A list of MIME types the operation can produce. This overrides the produces + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + repeated string produces = 7; + // field 8 is reserved for 'parameters'. + reserved 8; + // The list of possible responses as they are returned from executing this + // operation. + map responses = 9; + // The transfer protocol for the operation. Values MUST be from the list: + // "http", "https", "ws", "wss". The value overrides the OpenAPI Object + // schemes definition. + repeated Scheme schemes = 10; + // Declares this operation to be deprecated. Usage of the declared operation + // should be refrained. Default value is false. + bool deprecated = 11; + // A declaration of which security schemes are applied for this operation. The + // list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). This + // definition overrides any declared top-level security. To remove a top-level + // security declaration, an empty array can be used. + repeated SecurityRequirement security = 12; + map extensions = 13; +} + +// `Header` is a representation of OpenAPI v2 specification's Header object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject +// +message Header { + // `Description` is a short description of the header. + string description = 1; + // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + string type = 2; + // `Format` The extending format for the previously mentioned type. + string format = 3; + // field 4 is reserved for 'items', but in OpenAPI-specific way. + reserved 4; + // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. + reserved 5; + // `Default` Declares the value of the header that the server will use if none is provided. + // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + // Unlike JSON Schema this value MUST conform to the defined type for the header. + string default = 6; + // field 7 is reserved for 'maximum'. + reserved 7; + // field 8 is reserved for 'exclusiveMaximum'. + reserved 8; + // field 9 is reserved for 'minimum'. + reserved 9; + // field 10 is reserved for 'exclusiveMinimum'. + reserved 10; + // field 11 is reserved for 'maxLength'. + reserved 11; + // field 12 is reserved for 'minLength'. + reserved 12; + // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. + string pattern = 13; + // field 14 is reserved for 'maxItems'. + reserved 14; + // field 15 is reserved for 'minItems'. + reserved 15; + // field 16 is reserved for 'uniqueItems'. + reserved 16; + // field 17 is reserved for 'enum'. + reserved 17; + // field 18 is reserved for 'multipleOf'. + reserved 18; +} + +// `Response` is a representation of OpenAPI v2 specification's Response object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject +// +message Response { + // `Description` is a short description of the response. + // GFM syntax can be used for rich text representation. + string description = 1; + // `Schema` optionally defines the structure of the response. + // If `Schema` is not provided, it means there is no content to the response. + Schema schema = 2; + // `Headers` A list of headers that are sent with the response. + // `Header` name is expected to be a string in the canonical format of the MIME header key + // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + map headers = 3; + // `Examples` gives per-mimetype response examples. + // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + map examples = 4; + map extensions = 5; +} + +// `Info` is a representation of OpenAPI v2 specification's Info object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: "; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// }; +// ... +// }; +// +message Info { + // The title of the application. + string title = 1; + // A short description of the application. GFM syntax can be used for rich + // text representation. + string description = 2; + // The Terms of Service for the API. + string terms_of_service = 3; + // The contact information for the exposed API. + Contact contact = 4; + // The license information for the exposed API. + License license = 5; + // Provides the version of the application API (not to be confused + // with the specification version). + string version = 6; + map extensions = 7; +} + +// `Contact` is a representation of OpenAPI v2 specification's Contact object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// ... +// }; +// ... +// }; +// +message Contact { + // The identifying name of the contact person/organization. + string name = 1; + // The URL pointing to the contact information. MUST be in the format of a + // URL. + string url = 2; + // The email address of the contact person/organization. MUST be in the format + // of an email address. + string email = 3; +} + +// `License` is a representation of OpenAPI v2 specification's License object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; +// }; +// ... +// }; +// ... +// }; +// +message License { + // The license name used for the API. + string name = 1; + // A URL to the license used for the API. MUST be in the format of a URL. + string url = 2; +} + +// `ExternalDocumentation` is a representation of OpenAPI v2 specification's +// ExternalDocumentation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// ... +// external_docs: { +// description: "More about gRPC-Gateway"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// } +// ... +// }; +// +message ExternalDocumentation { + // A short description of the target documentation. GFM syntax can be used for + // rich text representation. + string description = 1; + // The URL for the target documentation. Value MUST be in the format + // of a URL. + string url = 2; +} + +// `Schema` is a representation of OpenAPI v2 specification's Schema object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +message Schema { + JSONSchema json_schema = 1; + // Adds support for polymorphism. The discriminator is the schema property + // name that is used to differentiate between other schema that inherit this + // schema. The property name used MUST be defined at this schema and it MUST + // be in the required property list. When used, the value MUST be the name of + // this schema or any schema that inherits it. + string discriminator = 2; + // Relevant only for Schema "properties" definitions. Declares the property as + // "read only". This means that it MAY be sent as part of a response but MUST + // NOT be sent as part of the request. Properties marked as readOnly being + // true SHOULD NOT be in the required list of the defined schema. Default + // value is false. + bool read_only = 3; + // field 4 is reserved for 'xml'. + reserved 4; + // Additional external documentation for this schema. + ExternalDocumentation external_docs = 5; + // A free-form property to include an example of an instance for this schema in JSON. + // This is copied verbatim to the output. + string example = 6; +} + +// `JSONSchema` represents properties from JSON Schema taken, and as used, in +// the OpenAPI v2 spec. +// +// This includes changes made by OpenAPI v2. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, +// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json +// +// Example: +// +// message SimpleMessage { +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { +// json_schema: { +// title: "SimpleMessage" +// description: "A simple message." +// required: ["id"] +// } +// }; +// +// // Id represents the message identifier. +// string id = 1; [ +// (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { +// {description: "The unique identifier of the simple message." +// }]; +// } +// +message JSONSchema { + // field 1 is reserved for '$id', omitted from OpenAPI v2. + reserved 1; + // field 2 is reserved for '$schema', omitted from OpenAPI v2. + reserved 2; + // Ref is used to define an external reference to include in the message. + // This could be a fully qualified proto message reference, and that type must + // be imported into the protofile. If no message is identified, the Ref will + // be used verbatim in the output. + // For example: + // `ref: ".google.protobuf.Timestamp"`. + string ref = 3; + // field 4 is reserved for '$comment', omitted from OpenAPI v2. + reserved 4; + // The title of the schema. + string title = 5; + // A short description of the schema. + string description = 6; + string default = 7; + bool read_only = 8; + // A free-form property to include a JSON example of this field. This is copied + // verbatim to the output swagger.json. Quotes must be escaped. + // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + string example = 9; + double multiple_of = 10; + // Maximum represents an inclusive upper limit for a numeric instance. The + // value of MUST be a number, + double maximum = 11; + bool exclusive_maximum = 12; + // minimum represents an inclusive lower limit for a numeric instance. The + // value of MUST be a number, + double minimum = 13; + bool exclusive_minimum = 14; + uint64 max_length = 15; + uint64 min_length = 16; + string pattern = 17; + // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. + reserved 18; + // field 19 is reserved for 'items', but in OpenAPI-specific way. + // TODO(ivucica): add 'items'? + reserved 19; + uint64 max_items = 20; + uint64 min_items = 21; + bool unique_items = 22; + // field 23 is reserved for 'contains', omitted from OpenAPI v2. + reserved 23; + uint64 max_properties = 24; + uint64 min_properties = 25; + repeated string required = 26; + // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific + // way. TODO(ivucica): add 'additionalProperties'? + reserved 27; + // field 28 is reserved for 'definitions', omitted from OpenAPI v2. + reserved 28; + // field 29 is reserved for 'properties', but in OpenAPI-specific way. + // TODO(ivucica): add 'additionalProperties'? + reserved 29; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: + // patternProperties, dependencies, propertyNames, const + reserved 30 to 33; + // Items in 'array' must be unique. + repeated string array = 34; + + enum JSONSchemaSimpleTypes { + UNKNOWN = 0; + ARRAY = 1; + BOOLEAN = 2; + INTEGER = 3; + NULL = 4; + NUMBER = 5; + OBJECT = 6; + STRING = 7; + } + + repeated JSONSchemaSimpleTypes type = 35; + // `Format` + string format = 36; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: contentMediaType, contentEncoding, if, then, else + reserved 37 to 41; + // field 42 is reserved for 'allOf', but in OpenAPI-specific way. + // TODO(ivucica): add 'allOf'? + reserved 42; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: + // anyOf, oneOf, not + reserved 43 to 45; + // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 + repeated string enum = 46; +} + +// `Tag` is a representation of OpenAPI v2 specification's Tag object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject +// +message Tag { + // field 1 is reserved for 'name'. In our generator, this is (to be) extracted + // from the name of proto service, and thus not exposed to the user, as + // changing tag object's name would break the link to the references to the + // tag in individual operation specifications. + // + // TODO(ivucica): Add 'name' property. Use it to allow override of the name of + // global Tag object, then use that name to reference the tag throughout the + // OpenAPI file. + reserved 1; + // A short description for the tag. GFM syntax can be used for rich text + // representation. + string description = 2; + // Additional external documentation for this tag. + ExternalDocumentation external_docs = 3; +} + +// `SecurityDefinitions` is a representation of OpenAPI v2 specification's +// Security Definitions object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject +// +// A declaration of the security schemes available to be used in the +// specification. This does not enforce the security schemes on the operations +// and only serves to provide the relevant details for each scheme. +message SecurityDefinitions { + // A single security scheme definition, mapping a "name" to the scheme it + // defines. + map security = 1; +} + +// `SecurityScheme` is a representation of OpenAPI v2 specification's +// Security Scheme object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject +// +// Allows the definition of a security scheme that can be used by the +// operations. Supported schemes are basic authentication, an API key (either as +// a header or as a query parameter) and OAuth2's common flows (implicit, +// password, application and access code). +message SecurityScheme { + // The type of the security scheme. Valid values are "basic", + // "apiKey" or "oauth2". + enum Type { + TYPE_INVALID = 0; + TYPE_BASIC = 1; + TYPE_API_KEY = 2; + TYPE_OAUTH2 = 3; + } + + // The location of the API key. Valid values are "query" or "header". + enum In { + IN_INVALID = 0; + IN_QUERY = 1; + IN_HEADER = 2; + } + + // The flow used by the OAuth2 security scheme. Valid values are + // "implicit", "password", "application" or "accessCode". + enum Flow { + FLOW_INVALID = 0; + FLOW_IMPLICIT = 1; + FLOW_PASSWORD = 2; + FLOW_APPLICATION = 3; + FLOW_ACCESS_CODE = 4; + } + + // The type of the security scheme. Valid values are "basic", + // "apiKey" or "oauth2". + Type type = 1; + // A short description for security scheme. + string description = 2; + // The name of the header or query parameter to be used. + // Valid for apiKey. + string name = 3; + // The location of the API key. Valid values are "query" or + // "header". + // Valid for apiKey. + In in = 4; + // The flow used by the OAuth2 security scheme. Valid values are + // "implicit", "password", "application" or "accessCode". + // Valid for oauth2. + Flow flow = 5; + // The authorization URL to be used for this flow. This SHOULD be in + // the form of a URL. + // Valid for oauth2/implicit and oauth2/accessCode. + string authorization_url = 6; + // The token URL to be used for this flow. This SHOULD be in the + // form of a URL. + // Valid for oauth2/password, oauth2/application and oauth2/accessCode. + string token_url = 7; + // The available scopes for the OAuth2 security scheme. + // Valid for oauth2. + Scopes scopes = 8; + map extensions = 9; +} + +// `SecurityRequirement` is a representation of OpenAPI v2 specification's +// Security Requirement object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject +// +// Lists the required security schemes to execute this operation. The object can +// have multiple security schemes declared in it which are all required (that +// is, there is a logical AND between the schemes). +// +// The name used for each property MUST correspond to a security scheme +// declared in the Security Definitions. +message SecurityRequirement { + // If the security scheme is of type "oauth2", then the value is a list of + // scope names required for the execution. For other security scheme types, + // the array MUST be empty. + message SecurityRequirementValue { + repeated string scope = 1; + } + // Each name must correspond to a security scheme which is declared in + // the Security Definitions. If the security scheme is of type "oauth2", + // then the value is a list of scope names required for the execution. + // For other security scheme types, the array MUST be empty. + map security_requirement = 1; +} + +// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject +// +// Lists the available scopes for an OAuth2 security scheme. +message Scopes { + // Maps between a name of a scope to a short description of it (as the value + // of the property). + map scope = 1; +} diff --git a/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/budget.proto b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/budget.proto new file mode 100644 index 000000000..bc4a2d313 --- /dev/null +++ b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/budget.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; + +package cosmos.budget.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/budget/types"; + +// Params defines the parameters for the budget module. +message Params { + option (gogoproto.goproto_stringer) = false; + // The universal epoch length in number of blocks + // A collection of budgets is executed with this epoch_blocks parameter + uint32 epoch_blocks = 1 [(gogoproto.moretags) = "yaml:\"epoch_blocks\""]; + + // Budgets parameter can be added, modified, and deleted through + // parameter change governance proposal + repeated Budget budgets = 2 [(gogoproto.moretags) = "yaml:\"budgets\"", (gogoproto.nullable) = false]; +} + +// Budget defines a budget object. +message Budget { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // name defines the name of the budget + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; + + // rate specifies the distributing amount by ratio of total budget source + string rate = 2 [ + (gogoproto.moretags) = "yaml:\"rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // source_address defines the bech32-encoded address that source of the budget + string source_address = 3 [(gogoproto.moretags) = "yaml:\"source_address\""]; + + // destination_address defines the bech32-encoded address of the budget pool to distribute + string destination_address = 4 [(gogoproto.moretags) = "yaml:\"destination_address\""]; + + // start_time specifies the start time of the budget + google.protobuf.Timestamp start_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; + + // end_time specifies the end time of the budget + google.protobuf.Timestamp end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"end_time\""]; +} + +// TotalCollectedCoins defines total collected coins with relevant metadata. +message TotalCollectedCoins { + option (gogoproto.goproto_getters) = false; + + // total_collected_coins specifies the total collected coins in a budget ever since the budget is created + repeated cosmos.base.v1beta1.Coin total_collected_coins = 1 [ + (gogoproto.moretags) = "yaml:\"total_collected_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} diff --git a/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/genesis.proto b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/genesis.proto new file mode 100644 index 000000000..96bfaddae --- /dev/null +++ b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/genesis.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package cosmos.budget.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "tendermint/budget/v1beta1/budget.proto"; +import "tendermint/budget/v1beta1/query.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/budget/types"; +option (gogoproto.equal_all) = true; + +// GenesisState defines the budget module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters for the budget module + Params params = 1 [(gogoproto.nullable) = false]; + + // budget_records defines the budget records used for genesis state + repeated BudgetRecord budget_records = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"budget_records\""]; +} + +// BudgetRecord records the state of each budget after genesis import or export. +message BudgetRecord { + // name defines the name of the budget + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; + + // total_collected_coins specifies the total collected coins in a budget ever since the budget is created + repeated cosmos.base.v1beta1.Coin total_collected_coins = 2 [ + (gogoproto.moretags) = "yaml:\"total_collected_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} diff --git a/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/query.proto b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/query.proto new file mode 100644 index 000000000..1c089123c --- /dev/null +++ b/Crescent/crescent-starter/proto/tendermint/budget/v1beta1/query.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package cosmos.budget.v1beta1; + +import "tendermint/budget/v1beta1/budget.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/crescent-network/crescent/v5/x/budget/types"; + +// Query defines the gRPC query service for the budget module. +service Query { + // Params returns parameters of the budget module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/budget/v1beta1/params"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all parameters of the budget module." + }; +} + +// Budgets returns all budgets. +rpc Budgets(QueryBudgetsRequest) returns (QueryBudgetsResponse) { + option (google.api.http).get = "/cosmos/budget/v1beta1/budgets"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Returns all budgets." +}; +} + +// Addresses returns an address that can be used as source and destination is derived according to the given type, +// module name, and name. +rpc Addresses(QueryAddressesRequest) returns (QueryAddressesResponse) { + option (google.api.http).get = "/cosmos/budget/v1beta1/addresses/{name}"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"at least one input of name or module name is required: invalid request","details":[]}' + } + } + } + responses: { + key: "400" + value: { + description: "Bad Request" + examples: { + key: "application/json" + value: '{"code":3,"message":"invalid names with address type: invalid request","details":[]}' + } + } + } + }; +} +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QueryBudgetsRequest is the request type for the Query/Budgets RPC method. +message QueryBudgetsRequest { + string name = 1; + string source_address = 2; + string destination_address = 3; +} + +// QueryBudgetsResponse is the response type for the Query/Budgets RPC method. +message QueryBudgetsResponse { + repeated BudgetResponse budgets = 1 [(gogoproto.nullable) = false]; +} + +message BudgetResponse { + Budget budget = 1 [(gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin total_collected_coins = 2 [ + (gogoproto.moretags) = "yaml:\"total_collected_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// AddressType enumerates the available types of a address. +enum AddressType { + option (gogoproto.goproto_enum_prefix) = false; + + // the 32 bytes length address type of ADR 028. + ADDRESS_TYPE_32_BYTES = 0 [(gogoproto.enumvalue_customname) = "AddressType32Bytes"]; + // the default 20 bytes length address type. + ADDRESS_TYPE_20_BYTES = 1 [(gogoproto.enumvalue_customname) = "AddressType20Bytes"]; +} + +// QueryAddressesRequest is the request type for the Query/Addresses RPC method. +message QueryAddressesRequest { + // The Address Type, default 0 for ADDRESS_TYPE_32_BYTES or 1 for ADDRESS_TYPE_20_BYTES + AddressType type = 1; + // The module name to be used for address derivation, default is budget. + string module_name = 2; + // The name to be used for address derivation. + string name = 3; +} + +// QueryAddressesResponse is the response type for the Query/Addresses RPC method. +message QueryAddressesResponse { + string address = 1; +} diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts index cfb49500c..7d704852c 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmos/bundle.ts @@ -74,6 +74,8 @@ import * as _74 from "./upgrade/v1beta1/tx"; import * as _75 from "./upgrade/v1beta1/upgrade"; import * as _76 from "./vesting/v1beta1/tx"; import * as _77 from "./vesting/v1beta1/vesting"; +import * as _78 from "../tendermint/budget/v1beta1/budget"; +import * as _79 from "../tendermint/budget/v1beta1/genesis"; export namespace cosmos { export namespace app { export const v1alpha1 = { @@ -295,4 +297,10 @@ export namespace cosmos { ..._77 }; } + export namespace budget { + export const v1beta1 = { + ..._78, + ..._79 + }; + } } \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts index adbed8d64..b424ae120 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/cosmwasm/bundle.ts @@ -1,18 +1,18 @@ -import * as _78 from "./wasm/v1/authz"; -import * as _79 from "./wasm/v1/genesis"; -import * as _80 from "./wasm/v1/ibc"; -import * as _81 from "./wasm/v1/proposal"; -import * as _82 from "./wasm/v1/tx"; -import * as _83 from "./wasm/v1/types"; +import * as _80 from "./wasm/v1/authz"; +import * as _81 from "./wasm/v1/genesis"; +import * as _82 from "./wasm/v1/ibc"; +import * as _83 from "./wasm/v1/proposal"; +import * as _84 from "./wasm/v1/tx"; +import * as _85 from "./wasm/v1/types"; export namespace cosmwasm { export namespace wasm { export const v1 = { - ..._78, - ..._79, ..._80, ..._81, ..._82, - ..._83 + ..._83, + ..._84, + ..._85 }; } } \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/amm.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/amm.ts new file mode 100644 index 000000000..a33bc721e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/amm.ts @@ -0,0 +1,145 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface Pool { + id: Long; + marketId: Long; + denom0: string; + denom1: string; + reserveAddress: string; + rewardsPool: string; + tickSpacing: number; + minOrderQuantity: string; + minOrderQuote: string; +} +export interface PoolProtoMsg { + typeUrl: "/crescent.amm.v1beta1.Pool"; + value: Uint8Array; +} +export interface PoolAmino { + id: string; + market_id: string; + denom0: string; + denom1: string; + reserve_address: string; + rewards_pool: string; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} +export interface PoolAminoMsg { + type: "/crescent.amm.v1beta1.Pool"; + value: PoolAmino; +} +export interface PoolSDKType { + id: Long; + market_id: Long; + denom0: string; + denom1: string; + reserve_address: string; + rewards_pool: string; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} +export interface PoolState { + currentTick: number; + currentPrice: string; + currentLiquidity: string; + totalLiquidity: string; + feeGrowthGlobal: DecCoin[]; + farmingRewardsGrowthGlobal: DecCoin[]; +} +export interface PoolStateProtoMsg { + typeUrl: "/crescent.amm.v1beta1.PoolState"; + value: Uint8Array; +} +export interface PoolStateAmino { + current_tick: number; + current_price: string; + current_liquidity: string; + total_liquidity: string; + fee_growth_global: DecCoinAmino[]; + farming_rewards_growth_global: DecCoinAmino[]; +} +export interface PoolStateAminoMsg { + type: "/crescent.amm.v1beta1.PoolState"; + value: PoolStateAmino; +} +export interface PoolStateSDKType { + current_tick: number; + current_price: string; + current_liquidity: string; + total_liquidity: string; + fee_growth_global: DecCoinSDKType[]; + farming_rewards_growth_global: DecCoinSDKType[]; +} +export interface Position { + id: Long; + poolId: Long; + owner: string; + lowerTick: number; + upperTick: number; + liquidity: string; + lastFeeGrowthInside: DecCoin[]; + owedFee: Coin[]; + lastFarmingRewardsGrowthInside: DecCoin[]; + owedFarmingRewards: Coin[]; +} +export interface PositionProtoMsg { + typeUrl: "/crescent.amm.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + id: string; + pool_id: string; + owner: string; + lower_tick: number; + upper_tick: number; + liquidity: string; + last_fee_growth_inside: DecCoinAmino[]; + owed_fee: CoinAmino[]; + last_farming_rewards_growth_inside: DecCoinAmino[]; + owed_farming_rewards: CoinAmino[]; +} +export interface PositionAminoMsg { + type: "/crescent.amm.v1beta1.Position"; + value: PositionAmino; +} +export interface PositionSDKType { + id: Long; + pool_id: Long; + owner: string; + lower_tick: number; + upper_tick: number; + liquidity: string; + last_fee_growth_inside: DecCoinSDKType[]; + owed_fee: CoinSDKType[]; + last_farming_rewards_growth_inside: DecCoinSDKType[]; + owed_farming_rewards: CoinSDKType[]; +} +export interface TickInfo { + grossLiquidity: string; + netLiquidity: string; + feeGrowthOutside: DecCoin[]; + farmingRewardsGrowthOutside: DecCoin[]; +} +export interface TickInfoProtoMsg { + typeUrl: "/crescent.amm.v1beta1.TickInfo"; + value: Uint8Array; +} +export interface TickInfoAmino { + gross_liquidity: string; + net_liquidity: string; + fee_growth_outside: DecCoinAmino[]; + farming_rewards_growth_outside: DecCoinAmino[]; +} +export interface TickInfoAminoMsg { + type: "/crescent.amm.v1beta1.TickInfo"; + value: TickInfoAmino; +} +export interface TickInfoSDKType { + gross_liquidity: string; + net_liquidity: string; + fee_growth_outside: DecCoinSDKType[]; + farming_rewards_growth_outside: DecCoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/event.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/event.ts new file mode 100644 index 000000000..fa8a1d5b9 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/event.ts @@ -0,0 +1,229 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { FarmingRewardAllocation, FarmingRewardAllocationAmino, FarmingRewardAllocationSDKType } from "./farming"; +import { Long } from "../../../helpers"; +export interface EventCreatePool { + creator: string; + marketId: Long; + price: string; + poolId: Long; +} +export interface EventCreatePoolProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventCreatePool"; + value: Uint8Array; +} +export interface EventCreatePoolAmino { + creator: string; + market_id: string; + price: string; + pool_id: string; +} +export interface EventCreatePoolAminoMsg { + type: "/crescent.amm.v1beta1.EventCreatePool"; + value: EventCreatePoolAmino; +} +export interface EventCreatePoolSDKType { + creator: string; + market_id: Long; + price: string; + pool_id: Long; +} +export interface EventAddLiquidity { + owner: string; + poolId: Long; + lowerPrice: string; + upperPrice: string; + positionId: Long; + liquidity: string; + amount: Coin[]; +} +export interface EventAddLiquidityProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventAddLiquidity"; + value: Uint8Array; +} +export interface EventAddLiquidityAmino { + owner: string; + pool_id: string; + lower_price: string; + upper_price: string; + position_id: string; + liquidity: string; + amount: CoinAmino[]; +} +export interface EventAddLiquidityAminoMsg { + type: "/crescent.amm.v1beta1.EventAddLiquidity"; + value: EventAddLiquidityAmino; +} +export interface EventAddLiquiditySDKType { + owner: string; + pool_id: Long; + lower_price: string; + upper_price: string; + position_id: Long; + liquidity: string; + amount: CoinSDKType[]; +} +export interface EventRemoveLiquidity { + owner: string; + positionId: Long; + liquidity: string; + amount: Coin[]; +} +export interface EventRemoveLiquidityProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventRemoveLiquidity"; + value: Uint8Array; +} +export interface EventRemoveLiquidityAmino { + owner: string; + position_id: string; + liquidity: string; + amount: CoinAmino[]; +} +export interface EventRemoveLiquidityAminoMsg { + type: "/crescent.amm.v1beta1.EventRemoveLiquidity"; + value: EventRemoveLiquidityAmino; +} +export interface EventRemoveLiquiditySDKType { + owner: string; + position_id: Long; + liquidity: string; + amount: CoinSDKType[]; +} +export interface EventCollect { + owner: string; + positionId: Long; + amount: Coin[]; +} +export interface EventCollectProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventCollect"; + value: Uint8Array; +} +export interface EventCollectAmino { + owner: string; + position_id: string; + amount: CoinAmino[]; +} +export interface EventCollectAminoMsg { + type: "/crescent.amm.v1beta1.EventCollect"; + value: EventCollectAmino; +} +export interface EventCollectSDKType { + owner: string; + position_id: Long; + amount: CoinSDKType[]; +} +export interface EventCreatePrivateFarmingPlan { + creator: string; + description: string; + terminationAddress: string; + rewardAllocations: FarmingRewardAllocation[]; + startTime: Date; + endTime: Date; + farmingPlanId: Long; + farmingPoolAddress: string; +} +export interface EventCreatePrivateFarmingPlanProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventCreatePrivateFarmingPlan"; + value: Uint8Array; +} +export interface EventCreatePrivateFarmingPlanAmino { + creator: string; + description: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; + farming_plan_id: string; + farming_pool_address: string; +} +export interface EventCreatePrivateFarmingPlanAminoMsg { + type: "/crescent.amm.v1beta1.EventCreatePrivateFarmingPlan"; + value: EventCreatePrivateFarmingPlanAmino; +} +export interface EventCreatePrivateFarmingPlanSDKType { + creator: string; + description: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationSDKType[]; + start_time: Date; + end_time: Date; + farming_plan_id: Long; + farming_pool_address: string; +} +export interface EventCreatePublicFarmingPlan { + description: string; + farmingPoolAddress: string; + terminationAddress: string; + rewardAllocations: FarmingRewardAllocation[]; + startTime: Date; + endTime: Date; + farmingPlanId: Long; +} +export interface EventCreatePublicFarmingPlanProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventCreatePublicFarmingPlan"; + value: Uint8Array; +} +export interface EventCreatePublicFarmingPlanAmino { + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; + farming_plan_id: string; +} +export interface EventCreatePublicFarmingPlanAminoMsg { + type: "/crescent.amm.v1beta1.EventCreatePublicFarmingPlan"; + value: EventCreatePublicFarmingPlanAmino; +} +export interface EventCreatePublicFarmingPlanSDKType { + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationSDKType[]; + start_time: Date; + end_time: Date; + farming_plan_id: Long; +} +export interface EventFarmingPlanTerminated { + farmingPlanId: Long; +} +export interface EventFarmingPlanTerminatedProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventFarmingPlanTerminated"; + value: Uint8Array; +} +export interface EventFarmingPlanTerminatedAmino { + farming_plan_id: string; +} +export interface EventFarmingPlanTerminatedAminoMsg { + type: "/crescent.amm.v1beta1.EventFarmingPlanTerminated"; + value: EventFarmingPlanTerminatedAmino; +} +export interface EventFarmingPlanTerminatedSDKType { + farming_plan_id: Long; +} +export interface EventPoolParameterChanged { + poolId: Long; + tickSpacing: number; + minOrderQuantity: string; + minOrderQuote: string; +} +export interface EventPoolParameterChangedProtoMsg { + typeUrl: "/crescent.amm.v1beta1.EventPoolParameterChanged"; + value: Uint8Array; +} +export interface EventPoolParameterChangedAmino { + pool_id: string; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} +export interface EventPoolParameterChangedAminoMsg { + type: "/crescent.amm.v1beta1.EventPoolParameterChanged"; + value: EventPoolParameterChangedAmino; +} +export interface EventPoolParameterChangedSDKType { + pool_id: Long; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/farming.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/farming.ts new file mode 100644 index 000000000..1be047622 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/farming.ts @@ -0,0 +1,63 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface FarmingPlan { + id: Long; + description: string; + farmingPoolAddress: string; + terminationAddress: string; + rewardAllocations: FarmingRewardAllocation[]; + startTime: Date; + endTime: Date; + isPrivate: boolean; + isTerminated: boolean; +} +export interface FarmingPlanProtoMsg { + typeUrl: "/crescent.amm.v1beta1.FarmingPlan"; + value: Uint8Array; +} +export interface FarmingPlanAmino { + id: string; + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; + is_private: boolean; + is_terminated: boolean; +} +export interface FarmingPlanAminoMsg { + type: "/crescent.amm.v1beta1.FarmingPlan"; + value: FarmingPlanAmino; +} +export interface FarmingPlanSDKType { + id: Long; + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationSDKType[]; + start_time: Date; + end_time: Date; + is_private: boolean; + is_terminated: boolean; +} +export interface FarmingRewardAllocation { + poolId: Long; + rewardsPerDay: Coin[]; +} +export interface FarmingRewardAllocationProtoMsg { + typeUrl: "/crescent.amm.v1beta1.FarmingRewardAllocation"; + value: Uint8Array; +} +export interface FarmingRewardAllocationAmino { + pool_id: string; + rewards_per_day: CoinAmino[]; +} +export interface FarmingRewardAllocationAminoMsg { + type: "/crescent.amm.v1beta1.FarmingRewardAllocation"; + value: FarmingRewardAllocationAmino; +} +export interface FarmingRewardAllocationSDKType { + pool_id: Long; + rewards_per_day: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/genesis.ts new file mode 100644 index 000000000..ec1fc2376 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/genesis.ts @@ -0,0 +1,88 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Position, PositionAmino, PositionSDKType, Pool, PoolAmino, PoolSDKType, PoolState, PoolStateAmino, PoolStateSDKType, TickInfo, TickInfoAmino, TickInfoSDKType } from "./amm"; +import { FarmingPlan, FarmingPlanAmino, FarmingPlanSDKType } from "./farming"; +import { Long } from "../../../helpers"; +export interface GenesisState { + params: Params; + lastPoolId: Long; + lastPositionId: Long; + poolRecords: PoolRecord[]; + positions: Position[]; + tickInfoRecords: TickInfoRecord[]; + lastFarmingPlanId: Long; + numPrivateFarmingPlans: number; + farmingPlans: FarmingPlan[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.amm.v1beta1.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; + last_pool_id: string; + last_position_id: string; + pool_records: PoolRecordAmino[]; + positions: PositionAmino[]; + tick_info_records: TickInfoRecordAmino[]; + last_farming_plan_id: string; + num_private_farming_plans: number; + farming_plans: FarmingPlanAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.amm.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_pool_id: Long; + last_position_id: Long; + pool_records: PoolRecordSDKType[]; + positions: PositionSDKType[]; + tick_info_records: TickInfoRecordSDKType[]; + last_farming_plan_id: Long; + num_private_farming_plans: number; + farming_plans: FarmingPlanSDKType[]; +} +export interface PoolRecord { + pool: Pool; + state: PoolState; +} +export interface PoolRecordProtoMsg { + typeUrl: "/crescent.amm.v1beta1.PoolRecord"; + value: Uint8Array; +} +export interface PoolRecordAmino { + pool?: PoolAmino; + state?: PoolStateAmino; +} +export interface PoolRecordAminoMsg { + type: "/crescent.amm.v1beta1.PoolRecord"; + value: PoolRecordAmino; +} +export interface PoolRecordSDKType { + pool: PoolSDKType; + state: PoolStateSDKType; +} +export interface TickInfoRecord { + poolId: Long; + tick: number; + tickInfo: TickInfo; +} +export interface TickInfoRecordProtoMsg { + typeUrl: "/crescent.amm.v1beta1.TickInfoRecord"; + value: Uint8Array; +} +export interface TickInfoRecordAmino { + pool_id: string; + tick: number; + tick_info?: TickInfoAmino; +} +export interface TickInfoRecordAminoMsg { + type: "/crescent.amm.v1beta1.TickInfoRecord"; + value: TickInfoRecordAmino; +} +export interface TickInfoRecordSDKType { + pool_id: Long; + tick: number; + tick_info: TickInfoSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/params.ts new file mode 100644 index 000000000..776e8db27 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/params.ts @@ -0,0 +1,37 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +export interface Params { + poolCreationFee: Coin[]; + defaultTickSpacing: number; + defaultMinOrderQuantity: string; + defaultMinOrderQuote: string; + privateFarmingPlanCreationFee: Coin[]; + maxNumPrivateFarmingPlans: number; + maxFarmingBlockTime: Duration; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.amm.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + pool_creation_fee: CoinAmino[]; + default_tick_spacing: number; + default_min_order_quantity: string; + default_min_order_quote: string; + private_farming_plan_creation_fee: CoinAmino[]; + max_num_private_farming_plans: number; + max_farming_block_time?: DurationAmino; +} +export interface ParamsAminoMsg { + type: "/crescent.amm.v1beta1.Params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + pool_creation_fee: CoinSDKType[]; + default_tick_spacing: number; + default_min_order_quantity: string; + default_min_order_quote: string; + private_farming_plan_creation_fee: CoinSDKType[]; + max_num_private_farming_plans: number; + max_farming_block_time: DurationSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/proposal.ts new file mode 100644 index 000000000..64acedf61 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/proposal.ts @@ -0,0 +1,126 @@ +import { FarmingRewardAllocation, FarmingRewardAllocationAmino, FarmingRewardAllocationSDKType } from "./farming"; +import { Long } from "../../../helpers"; +export interface PublicFarmingPlanProposal { + title: string; + description: string; + createRequests: CreatePublicFarmingPlanRequest[]; + terminateRequests: TerminateFarmingPlanRequest[]; +} +export interface PublicFarmingPlanProposalProtoMsg { + typeUrl: "/crescent.amm.v1beta1.PublicFarmingPlanProposal"; + value: Uint8Array; +} +export interface PublicFarmingPlanProposalAmino { + title: string; + description: string; + create_requests: CreatePublicFarmingPlanRequestAmino[]; + terminate_requests: TerminateFarmingPlanRequestAmino[]; +} +export interface PublicFarmingPlanProposalAminoMsg { + type: "/crescent.amm.v1beta1.PublicFarmingPlanProposal"; + value: PublicFarmingPlanProposalAmino; +} +export interface PublicFarmingPlanProposalSDKType { + title: string; + description: string; + create_requests: CreatePublicFarmingPlanRequestSDKType[]; + terminate_requests: TerminateFarmingPlanRequestSDKType[]; +} +export interface CreatePublicFarmingPlanRequest { + description: string; + farmingPoolAddress: string; + terminationAddress: string; + rewardAllocations: FarmingRewardAllocation[]; + startTime: Date; + endTime: Date; +} +export interface CreatePublicFarmingPlanRequestProtoMsg { + typeUrl: "/crescent.amm.v1beta1.CreatePublicFarmingPlanRequest"; + value: Uint8Array; +} +export interface CreatePublicFarmingPlanRequestAmino { + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; +} +export interface CreatePublicFarmingPlanRequestAminoMsg { + type: "/crescent.amm.v1beta1.CreatePublicFarmingPlanRequest"; + value: CreatePublicFarmingPlanRequestAmino; +} +export interface CreatePublicFarmingPlanRequestSDKType { + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationSDKType[]; + start_time: Date; + end_time: Date; +} +export interface TerminateFarmingPlanRequest { + farmingPlanId: Long; +} +export interface TerminateFarmingPlanRequestProtoMsg { + typeUrl: "/crescent.amm.v1beta1.TerminateFarmingPlanRequest"; + value: Uint8Array; +} +export interface TerminateFarmingPlanRequestAmino { + farming_plan_id: string; +} +export interface TerminateFarmingPlanRequestAminoMsg { + type: "/crescent.amm.v1beta1.TerminateFarmingPlanRequest"; + value: TerminateFarmingPlanRequestAmino; +} +export interface TerminateFarmingPlanRequestSDKType { + farming_plan_id: Long; +} +export interface PoolParameterChangeProposal { + title: string; + description: string; + changes: PoolParameterChange[]; +} +export interface PoolParameterChangeProposalProtoMsg { + typeUrl: "/crescent.amm.v1beta1.PoolParameterChangeProposal"; + value: Uint8Array; +} +export interface PoolParameterChangeProposalAmino { + title: string; + description: string; + changes: PoolParameterChangeAmino[]; +} +export interface PoolParameterChangeProposalAminoMsg { + type: "/crescent.amm.v1beta1.PoolParameterChangeProposal"; + value: PoolParameterChangeProposalAmino; +} +export interface PoolParameterChangeProposalSDKType { + title: string; + description: string; + changes: PoolParameterChangeSDKType[]; +} +export interface PoolParameterChange { + poolId: Long; + tickSpacing: number; + minOrderQuantity: string; + minOrderQuote: string; +} +export interface PoolParameterChangeProtoMsg { + typeUrl: "/crescent.amm.v1beta1.PoolParameterChange"; + value: Uint8Array; +} +export interface PoolParameterChangeAmino { + pool_id: string; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} +export interface PoolParameterChangeAminoMsg { + type: "/crescent.amm.v1beta1.PoolParameterChange"; + value: PoolParameterChangeAmino; +} +export interface PoolParameterChangeSDKType { + pool_id: Long; + tick_spacing: number; + min_order_quantity: string; + min_order_quote: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/tx.ts new file mode 100644 index 000000000..11de16354 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/amm/v1beta1/tx.ts @@ -0,0 +1,254 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { FarmingRewardAllocation, FarmingRewardAllocationAmino, FarmingRewardAllocationSDKType } from "./farming"; +import { Long } from "../../../helpers"; +export interface MsgCreatePool { + sender: string; + marketId: Long; + price: string; +} +export interface MsgCreatePoolProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCreatePool"; + value: Uint8Array; +} +export interface MsgCreatePoolAmino { + sender: string; + market_id: string; + price: string; +} +export interface MsgCreatePoolAminoMsg { + type: "/crescent.amm.v1beta1.MsgCreatePool"; + value: MsgCreatePoolAmino; +} +export interface MsgCreatePoolSDKType { + sender: string; + market_id: Long; + price: string; +} +export interface MsgCreatePoolResponse { + poolId: Long; +} +export interface MsgCreatePoolResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCreatePoolResponse"; + value: Uint8Array; +} +export interface MsgCreatePoolResponseAmino { + pool_id: string; +} +export interface MsgCreatePoolResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgCreatePoolResponse"; + value: MsgCreatePoolResponseAmino; +} +export interface MsgCreatePoolResponseSDKType { + pool_id: Long; +} +export interface MsgAddLiquidity { + sender: string; + poolId: Long; + lowerPrice: string; + upperPrice: string; + desiredAmount: Coin[]; +} +export interface MsgAddLiquidityProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgAddLiquidity"; + value: Uint8Array; +} +export interface MsgAddLiquidityAmino { + sender: string; + pool_id: string; + lower_price: string; + upper_price: string; + desired_amount: CoinAmino[]; +} +export interface MsgAddLiquidityAminoMsg { + type: "/crescent.amm.v1beta1.MsgAddLiquidity"; + value: MsgAddLiquidityAmino; +} +export interface MsgAddLiquiditySDKType { + sender: string; + pool_id: Long; + lower_price: string; + upper_price: string; + desired_amount: CoinSDKType[]; +} +export interface MsgAddLiquidityResponse { + positionId: Long; + liquidity: string; + amount: Coin[]; +} +export interface MsgAddLiquidityResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgAddLiquidityResponse"; + value: Uint8Array; +} +export interface MsgAddLiquidityResponseAmino { + position_id: string; + liquidity: string; + amount: CoinAmino[]; +} +export interface MsgAddLiquidityResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgAddLiquidityResponse"; + value: MsgAddLiquidityResponseAmino; +} +export interface MsgAddLiquidityResponseSDKType { + position_id: Long; + liquidity: string; + amount: CoinSDKType[]; +} +export interface MsgRemoveLiquidity { + sender: string; + positionId: Long; + liquidity: string; +} +export interface MsgRemoveLiquidityProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgRemoveLiquidity"; + value: Uint8Array; +} +export interface MsgRemoveLiquidityAmino { + sender: string; + position_id: string; + liquidity: string; +} +export interface MsgRemoveLiquidityAminoMsg { + type: "/crescent.amm.v1beta1.MsgRemoveLiquidity"; + value: MsgRemoveLiquidityAmino; +} +export interface MsgRemoveLiquiditySDKType { + sender: string; + position_id: Long; + liquidity: string; +} +export interface MsgRemoveLiquidityResponse { + amount: Coin[]; +} +export interface MsgRemoveLiquidityResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgRemoveLiquidityResponse"; + value: Uint8Array; +} +export interface MsgRemoveLiquidityResponseAmino { + amount: CoinAmino[]; +} +export interface MsgRemoveLiquidityResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgRemoveLiquidityResponse"; + value: MsgRemoveLiquidityResponseAmino; +} +export interface MsgRemoveLiquidityResponseSDKType { + amount: CoinSDKType[]; +} +export interface MsgCollect { + sender: string; + positionId: Long; + /** TODO: if amount is nil, collect all? */ + amount: Coin[]; +} +export interface MsgCollectProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCollect"; + value: Uint8Array; +} +export interface MsgCollectAmino { + sender: string; + position_id: string; + /** TODO: if amount is nil, collect all? */ + amount: CoinAmino[]; +} +export interface MsgCollectAminoMsg { + type: "/crescent.amm.v1beta1.MsgCollect"; + value: MsgCollectAmino; +} +export interface MsgCollectSDKType { + sender: string; + position_id: Long; + amount: CoinSDKType[]; +} +export interface MsgCollectResponse {} +export interface MsgCollectResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCollectResponse"; + value: Uint8Array; +} +export interface MsgCollectResponseAmino {} +export interface MsgCollectResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgCollectResponse"; + value: MsgCollectResponseAmino; +} +export interface MsgCollectResponseSDKType {} +export interface MsgCreatePrivateFarmingPlan { + sender: string; + description: string; + terminationAddress: string; + rewardAllocations: FarmingRewardAllocation[]; + startTime: Date; + endTime: Date; +} +export interface MsgCreatePrivateFarmingPlanProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCreatePrivateFarmingPlan"; + value: Uint8Array; +} +export interface MsgCreatePrivateFarmingPlanAmino { + sender: string; + description: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; +} +export interface MsgCreatePrivateFarmingPlanAminoMsg { + type: "/crescent.amm.v1beta1.MsgCreatePrivateFarmingPlan"; + value: MsgCreatePrivateFarmingPlanAmino; +} +export interface MsgCreatePrivateFarmingPlanSDKType { + sender: string; + description: string; + termination_address: string; + reward_allocations: FarmingRewardAllocationSDKType[]; + start_time: Date; + end_time: Date; +} +export interface MsgCreatePrivateFarmingPlanResponse { + farmingPlanId: Long; + farmingPoolAddress: string; +} +export interface MsgCreatePrivateFarmingPlanResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgCreatePrivateFarmingPlanResponse"; + value: Uint8Array; +} +export interface MsgCreatePrivateFarmingPlanResponseAmino { + farming_plan_id: string; + farming_pool_address: string; +} +export interface MsgCreatePrivateFarmingPlanResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgCreatePrivateFarmingPlanResponse"; + value: MsgCreatePrivateFarmingPlanResponseAmino; +} +export interface MsgCreatePrivateFarmingPlanResponseSDKType { + farming_plan_id: Long; + farming_pool_address: string; +} +export interface MsgTerminatePrivateFarmingPlan { + sender: string; + farmingPlanId: Long; +} +export interface MsgTerminatePrivateFarmingPlanProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgTerminatePrivateFarmingPlan"; + value: Uint8Array; +} +export interface MsgTerminatePrivateFarmingPlanAmino { + sender: string; + farming_plan_id: string; +} +export interface MsgTerminatePrivateFarmingPlanAminoMsg { + type: "/crescent.amm.v1beta1.MsgTerminatePrivateFarmingPlan"; + value: MsgTerminatePrivateFarmingPlanAmino; +} +export interface MsgTerminatePrivateFarmingPlanSDKType { + sender: string; + farming_plan_id: Long; +} +export interface MsgTerminatePrivateFarmingPlanResponse {} +export interface MsgTerminatePrivateFarmingPlanResponseProtoMsg { + typeUrl: "/crescent.amm.v1beta1.MsgTerminatePrivateFarmingPlanResponse"; + value: Uint8Array; +} +export interface MsgTerminatePrivateFarmingPlanResponseAmino {} +export interface MsgTerminatePrivateFarmingPlanResponseAminoMsg { + type: "/crescent.amm.v1beta1.MsgTerminatePrivateFarmingPlanResponse"; + value: MsgTerminatePrivateFarmingPlanResponseAmino; +} +export interface MsgTerminatePrivateFarmingPlanResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/bundle.ts new file mode 100644 index 000000000..ca3ffbeff --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/bundle.ts @@ -0,0 +1,150 @@ +import * as _86 from "./amm/v1beta1/amm"; +import * as _87 from "./amm/v1beta1/event"; +import * as _88 from "./amm/v1beta1/farming"; +import * as _89 from "./amm/v1beta1/genesis"; +import * as _90 from "./amm/v1beta1/params"; +import * as _91 from "./amm/v1beta1/proposal"; +import * as _92 from "./amm/v1beta1/tx"; +import * as _93 from "./claim/v1beta1/claim"; +import * as _94 from "./claim/v1beta1/genesis"; +import * as _95 from "./claim/v1beta1/tx"; +import * as _96 from "./exchange/v1beta1/event"; +import * as _97 from "./exchange/v1beta1/exchange"; +import * as _98 from "./exchange/v1beta1/genesis"; +import * as _99 from "./exchange/v1beta1/order_book"; +import * as _100 from "./exchange/v1beta1/params"; +import * as _101 from "./exchange/v1beta1/proposal"; +import * as _102 from "./exchange/v1beta1/tx"; +import * as _103 from "./farming/v1beta1/farming"; +import * as _104 from "./farming/v1beta1/genesis"; +import * as _105 from "./farming/v1beta1/proposal"; +import * as _106 from "./farming/v1beta1/tx"; +import * as _107 from "./liquidamm/v1beta1/event"; +import * as _108 from "./liquidamm/v1beta1/genesis"; +import * as _109 from "./liquidamm/v1beta1/liquidamm"; +import * as _110 from "./liquidamm/v1beta1/params"; +import * as _111 from "./liquidamm/v1beta1/proposal"; +import * as _112 from "./liquidamm/v1beta1/tx"; +import * as _113 from "./liquidfarming/v1beta1/genesis"; +import * as _114 from "./liquidfarming/v1beta1/liquidfarming"; +import * as _115 from "./liquidfarming/v1beta1/params"; +import * as _116 from "./liquidfarming/v1beta1/tx"; +import * as _117 from "./liquidity/v1beta1/genesis"; +import * as _118 from "./liquidity/v1beta1/liquidity"; +import * as _119 from "./liquidity/v1beta1/tx"; +import * as _120 from "./liquidstaking/v1beta1/genesis"; +import * as _121 from "./liquidstaking/v1beta1/liquidstaking"; +import * as _122 from "./liquidstaking/v1beta1/tx"; +import * as _123 from "./lpfarm/v1beta1/events"; +import * as _124 from "./lpfarm/v1beta1/genesis"; +import * as _125 from "./lpfarm/v1beta1/lpfarm"; +import * as _126 from "./lpfarm/v1beta1/proposal"; +import * as _127 from "./lpfarm/v1beta1/tx"; +import * as _128 from "./marker/v1beta1/genesis"; +import * as _129 from "./marker/v1beta1/marker"; +import * as _130 from "./marketmaker/v1beta1/genesis"; +import * as _131 from "./marketmaker/v1beta1/marketmaker"; +import * as _132 from "./marketmaker/v1beta1/proposal"; +import * as _133 from "./marketmaker/v1beta1/tx"; +import * as _134 from "./mint/v1beta1/genesis"; +import * as _135 from "./mint/v1beta1/mint"; +export namespace crescent { + export namespace amm { + export const v1beta1 = { + ..._86, + ..._87, + ..._88, + ..._89, + ..._90, + ..._91, + ..._92 + }; + } + export namespace claim { + export const v1beta1 = { + ..._93, + ..._94, + ..._95 + }; + } + export namespace exchange { + export const v1beta1 = { + ..._96, + ..._97, + ..._98, + ..._99, + ..._100, + ..._101, + ..._102 + }; + } + export namespace farming { + export const v1beta1 = { + ..._103, + ..._104, + ..._105, + ..._106 + }; + } + export namespace liquidamm { + export const v1beta1 = { + ..._107, + ..._108, + ..._109, + ..._110, + ..._111, + ..._112 + }; + } + export namespace liquidfarming { + export const v1beta1 = { + ..._113, + ..._114, + ..._115, + ..._116 + }; + } + export namespace liquidity { + export const v1beta1 = { + ..._117, + ..._118, + ..._119 + }; + } + export namespace liquidstaking { + export const v1beta1 = { + ..._120, + ..._121, + ..._122 + }; + } + export namespace lpfarm { + export const v1beta1 = { + ..._123, + ..._124, + ..._125, + ..._126, + ..._127 + }; + } + export namespace marker { + export const v1beta1 = { + ..._128, + ..._129 + }; + } + export namespace marketmaker { + export const v1beta1 = { + ..._130, + ..._131, + ..._132, + ..._133 + }; + } + export namespace mint { + export const v1beta1 = { + ..._134, + ..._135 + }; + } +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/claim.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/claim.ts new file mode 100644 index 000000000..4f440e0c0 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/claim.ts @@ -0,0 +1,154 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** ConditionType defines the type of condition that a recipient must execute in order to receive a claimable amount. */ +export enum ConditionType { + /** CONDITION_TYPE_UNSPECIFIED - CONDITION_TYPE_UNSPECIFIED specifies an unknown condition type */ + CONDITION_TYPE_UNSPECIFIED = 0, + /** CONDITION_TYPE_DEPOSIT - CONDITION_TYPE_DEPOSIT specifies deposit condition type */ + CONDITION_TYPE_DEPOSIT = 1, + /** CONDITION_TYPE_SWAP - CONDITION_TYPE_SWAP specifies swap condition type */ + CONDITION_TYPE_SWAP = 2, + /** CONDITION_TYPE_LIQUIDSTAKE - CONDITION_TYPE_LIQUIDSTAKE specifies liquid stake condition type */ + CONDITION_TYPE_LIQUIDSTAKE = 3, + /** CONDITION_TYPE_VOTE - CONDITION_TYPE_VOTE specifies governance vote condition type */ + CONDITION_TYPE_VOTE = 4, + UNRECOGNIZED = -1, +} +export const ConditionTypeSDKType = ConditionType; +export const ConditionTypeAmino = ConditionType; +export function conditionTypeFromJSON(object: any): ConditionType { + switch (object) { + case 0: + case "CONDITION_TYPE_UNSPECIFIED": + return ConditionType.CONDITION_TYPE_UNSPECIFIED; + case 1: + case "CONDITION_TYPE_DEPOSIT": + return ConditionType.CONDITION_TYPE_DEPOSIT; + case 2: + case "CONDITION_TYPE_SWAP": + return ConditionType.CONDITION_TYPE_SWAP; + case 3: + case "CONDITION_TYPE_LIQUIDSTAKE": + return ConditionType.CONDITION_TYPE_LIQUIDSTAKE; + case 4: + case "CONDITION_TYPE_VOTE": + return ConditionType.CONDITION_TYPE_VOTE; + case -1: + case "UNRECOGNIZED": + default: + return ConditionType.UNRECOGNIZED; + } +} +export function conditionTypeToJSON(object: ConditionType): string { + switch (object) { + case ConditionType.CONDITION_TYPE_UNSPECIFIED: + return "CONDITION_TYPE_UNSPECIFIED"; + case ConditionType.CONDITION_TYPE_DEPOSIT: + return "CONDITION_TYPE_DEPOSIT"; + case ConditionType.CONDITION_TYPE_SWAP: + return "CONDITION_TYPE_SWAP"; + case ConditionType.CONDITION_TYPE_LIQUIDSTAKE: + return "CONDITION_TYPE_LIQUIDSTAKE"; + case ConditionType.CONDITION_TYPE_VOTE: + return "CONDITION_TYPE_VOTE"; + case ConditionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Airdrop defines airdrop information. */ +export interface Airdrop { + /** id specifies index of the airdrop */ + id: Long; + /** + * source_address defines the bech32-encoded source address + * where the source of coins from + */ + sourceAddress: string; + /** conditions specifies a list of conditions */ + conditions: ConditionType[]; + /** start_time specifies the start time of the airdrop */ + startTime: Date; + /** end_time specifies the start time of the airdrop */ + endTime: Date; +} +export interface AirdropProtoMsg { + typeUrl: "/crescent.claim.v1beta1.Airdrop"; + value: Uint8Array; +} +/** Airdrop defines airdrop information. */ +export interface AirdropAmino { + /** id specifies index of the airdrop */ + id: string; + /** + * source_address defines the bech32-encoded source address + * where the source of coins from + */ + source_address: string; + /** conditions specifies a list of conditions */ + conditions: ConditionType[]; + /** start_time specifies the start time of the airdrop */ + start_time?: Date; + /** end_time specifies the start time of the airdrop */ + end_time?: Date; +} +export interface AirdropAminoMsg { + type: "/crescent.claim.v1beta1.Airdrop"; + value: AirdropAmino; +} +/** Airdrop defines airdrop information. */ +export interface AirdropSDKType { + id: Long; + source_address: string; + conditions: ConditionType[]; + start_time: Date; + end_time: Date; +} +/** ClaimRecord defines claim record that corresponds to the airdrop. */ +export interface ClaimRecord { + /** airdrop_id specifies airdrop id */ + airdropId: Long; + /** recipient specifies the bech32-encoded address that is eligible to claim airdrop */ + recipient: string; + /** initial_claimable_coins specifies the initial claimable coins */ + initialClaimableCoins: Coin[]; + /** claimable_coins specifies the unclaimed claimable coins */ + claimableCoins: Coin[]; + /** + * claimed_conditions specifies a list of condition types + * initial values are empty and each condition type gets appended when claim is successfully executed + */ + claimedConditions: ConditionType[]; +} +export interface ClaimRecordProtoMsg { + typeUrl: "/crescent.claim.v1beta1.ClaimRecord"; + value: Uint8Array; +} +/** ClaimRecord defines claim record that corresponds to the airdrop. */ +export interface ClaimRecordAmino { + /** airdrop_id specifies airdrop id */ + airdrop_id: string; + /** recipient specifies the bech32-encoded address that is eligible to claim airdrop */ + recipient: string; + /** initial_claimable_coins specifies the initial claimable coins */ + initial_claimable_coins: CoinAmino[]; + /** claimable_coins specifies the unclaimed claimable coins */ + claimable_coins: CoinAmino[]; + /** + * claimed_conditions specifies a list of condition types + * initial values are empty and each condition type gets appended when claim is successfully executed + */ + claimed_conditions: ConditionType[]; +} +export interface ClaimRecordAminoMsg { + type: "/crescent.claim.v1beta1.ClaimRecord"; + value: ClaimRecordAmino; +} +/** ClaimRecord defines claim record that corresponds to the airdrop. */ +export interface ClaimRecordSDKType { + airdrop_id: Long; + recipient: string; + initial_claimable_coins: CoinSDKType[]; + claimable_coins: CoinSDKType[]; + claimed_conditions: ConditionType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/genesis.ts new file mode 100644 index 000000000..19e039fe4 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/genesis.ts @@ -0,0 +1,28 @@ +import { Airdrop, AirdropAmino, AirdropSDKType, ClaimRecord, ClaimRecordAmino, ClaimRecordSDKType } from "./claim"; +/** GenesisState defines the claim module's genesis state. */ +export interface GenesisState { + /** airdrops specifies a list of airdrops */ + airdrops: Airdrop[]; + /** claim_records specifies a list of claim records */ + claimRecords: ClaimRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.claim.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the claim module's genesis state. */ +export interface GenesisStateAmino { + /** airdrops specifies a list of airdrops */ + airdrops: AirdropAmino[]; + /** claim_records specifies a list of claim records */ + claim_records: ClaimRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.claim.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the claim module's genesis state. */ +export interface GenesisStateSDKType { + airdrops: AirdropSDKType[]; + claim_records: ClaimRecordSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/tx.ts new file mode 100644 index 000000000..3ae2db2ef --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/claim/v1beta1/tx.ts @@ -0,0 +1,45 @@ +import { ConditionType } from "./claim"; +import { Long } from "../../../helpers"; +/** MsgClaim defines a SDK message for claiming claimable amount. */ +export interface MsgClaim { + /** airdrop_id specifies index of the airdrop */ + airdropId: Long; + /** recipient specifies the bech32-encoded address that is eligible to claim airdrop */ + recipient: string; + /** condition_type specifies the condition type */ + conditionType: ConditionType; +} +export interface MsgClaimProtoMsg { + typeUrl: "/crescent.claim.v1beta1.MsgClaim"; + value: Uint8Array; +} +/** MsgClaim defines a SDK message for claiming claimable amount. */ +export interface MsgClaimAmino { + /** airdrop_id specifies index of the airdrop */ + airdrop_id: string; + /** recipient specifies the bech32-encoded address that is eligible to claim airdrop */ + recipient: string; + /** condition_type specifies the condition type */ + condition_type: ConditionType; +} +export interface MsgClaimAminoMsg { + type: "/crescent.claim.v1beta1.MsgClaim"; + value: MsgClaimAmino; +} +/** MsgClaim defines a SDK message for claiming claimable amount. */ +export interface MsgClaimSDKType { + airdrop_id: Long; + recipient: string; + condition_type: ConditionType; +} +export interface MsgClaimResponse {} +export interface MsgClaimResponseProtoMsg { + typeUrl: "/crescent.claim.v1beta1.MsgClaimResponse"; + value: Uint8Array; +} +export interface MsgClaimResponseAmino {} +export interface MsgClaimResponseAminoMsg { + type: "/crescent.claim.v1beta1.MsgClaimResponse"; + value: MsgClaimResponseAmino; +} +export interface MsgClaimResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/event.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/event.ts new file mode 100644 index 000000000..18377d2f8 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/event.ts @@ -0,0 +1,449 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { SwapRouteResult, SwapRouteResultAmino, SwapRouteResultSDKType } from "./exchange"; +import { Long } from "../../../helpers"; +export interface EventCreateMarket { + creator: string; + baseDenom: string; + quoteDenom: string; + marketId: Long; +} +export interface EventCreateMarketProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventCreateMarket"; + value: Uint8Array; +} +export interface EventCreateMarketAmino { + creator: string; + base_denom: string; + quote_denom: string; + market_id: string; +} +export interface EventCreateMarketAminoMsg { + type: "/crescent.exchange.v1beta1.EventCreateMarket"; + value: EventCreateMarketAmino; +} +export interface EventCreateMarketSDKType { + creator: string; + base_denom: string; + quote_denom: string; + market_id: Long; +} +export interface EventPlaceLimitOrder { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; + deadline: Date; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface EventPlaceLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventPlaceLimitOrder"; + value: Uint8Array; +} +export interface EventPlaceLimitOrderAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; + deadline?: Date; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface EventPlaceLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventPlaceLimitOrder"; + value: EventPlaceLimitOrderAmino; +} +export interface EventPlaceLimitOrderSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; + deadline: Date; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface EventPlaceBatchLimitOrder { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; + deadline: Date; +} +export interface EventPlaceBatchLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventPlaceBatchLimitOrder"; + value: Uint8Array; +} +export interface EventPlaceBatchLimitOrderAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; + deadline?: Date; +} +export interface EventPlaceBatchLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventPlaceBatchLimitOrder"; + value: EventPlaceBatchLimitOrderAmino; +} +export interface EventPlaceBatchLimitOrderSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; + deadline: Date; +} +export interface EventPlaceMMLimitOrder { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; + deadline: Date; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface EventPlaceMMLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventPlaceMMLimitOrder"; + value: Uint8Array; +} +export interface EventPlaceMMLimitOrderAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; + deadline?: Date; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface EventPlaceMMLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventPlaceMMLimitOrder"; + value: EventPlaceMMLimitOrderAmino; +} +export interface EventPlaceMMLimitOrderSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; + deadline: Date; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface EventPlaceMMBatchLimitOrder { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; + deadline: Date; +} +export interface EventPlaceMMBatchLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventPlaceMMBatchLimitOrder"; + value: Uint8Array; +} +export interface EventPlaceMMBatchLimitOrderAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; + deadline?: Date; +} +export interface EventPlaceMMBatchLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventPlaceMMBatchLimitOrder"; + value: EventPlaceMMBatchLimitOrderAmino; +} +export interface EventPlaceMMBatchLimitOrderSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; + deadline: Date; +} +export interface EventPlaceMarketOrder { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + quantity: string; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface EventPlaceMarketOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventPlaceMarketOrder"; + value: Uint8Array; +} +export interface EventPlaceMarketOrderAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + quantity: string; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface EventPlaceMarketOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventPlaceMarketOrder"; + value: EventPlaceMarketOrderAmino; +} +export interface EventPlaceMarketOrderSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + quantity: string; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface EventCancelOrder { + orderer: string; + orderId: Long; +} +export interface EventCancelOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventCancelOrder"; + value: Uint8Array; +} +export interface EventCancelOrderAmino { + orderer: string; + order_id: string; +} +export interface EventCancelOrderAminoMsg { + type: "/crescent.exchange.v1beta1.EventCancelOrder"; + value: EventCancelOrderAmino; +} +export interface EventCancelOrderSDKType { + orderer: string; + order_id: Long; +} +export interface EventCancelAllOrders { + orderer: string; + marketId: Long; + cancelledOrderIds: Long[]; +} +export interface EventCancelAllOrdersProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventCancelAllOrders"; + value: Uint8Array; +} +export interface EventCancelAllOrdersAmino { + orderer: string; + market_id: string; + cancelled_order_ids: string[]; +} +export interface EventCancelAllOrdersAminoMsg { + type: "/crescent.exchange.v1beta1.EventCancelAllOrders"; + value: EventCancelAllOrdersAmino; +} +export interface EventCancelAllOrdersSDKType { + orderer: string; + market_id: Long; + cancelled_order_ids: Long[]; +} +export interface EventSwapExactAmountIn { + orderer: string; + routes: Long[]; + input: DecCoin; + output: DecCoin; + results: SwapRouteResult[]; +} +export interface EventSwapExactAmountInProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventSwapExactAmountIn"; + value: Uint8Array; +} +export interface EventSwapExactAmountInAmino { + orderer: string; + routes: string[]; + input?: DecCoinAmino; + output?: DecCoinAmino; + results: SwapRouteResultAmino[]; +} +export interface EventSwapExactAmountInAminoMsg { + type: "/crescent.exchange.v1beta1.EventSwapExactAmountIn"; + value: EventSwapExactAmountInAmino; +} +export interface EventSwapExactAmountInSDKType { + orderer: string; + routes: Long[]; + input: DecCoinSDKType; + output: DecCoinSDKType; + results: SwapRouteResultSDKType[]; +} +export interface EventOrderFilled { + marketId: Long; + orderId: Long; + orderer: string; + isBuy: boolean; + price: string; + quantity: string; + openQuantity: string; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface EventOrderFilledProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventOrderFilled"; + value: Uint8Array; +} +export interface EventOrderFilledAmino { + market_id: string; + order_id: string; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + open_quantity: string; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface EventOrderFilledAminoMsg { + type: "/crescent.exchange.v1beta1.EventOrderFilled"; + value: EventOrderFilledAmino; +} +export interface EventOrderFilledSDKType { + market_id: Long; + order_id: Long; + orderer: string; + is_buy: boolean; + price: string; + quantity: string; + open_quantity: string; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface EventOrderSourceOrdersFilled { + marketId: Long; + sourceName: string; + orderer: string; + isBuy: boolean; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface EventOrderSourceOrdersFilledProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventOrderSourceOrdersFilled"; + value: Uint8Array; +} +export interface EventOrderSourceOrdersFilledAmino { + market_id: string; + source_name: string; + orderer: string; + is_buy: boolean; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface EventOrderSourceOrdersFilledAminoMsg { + type: "/crescent.exchange.v1beta1.EventOrderSourceOrdersFilled"; + value: EventOrderSourceOrdersFilledAmino; +} +export interface EventOrderSourceOrdersFilledSDKType { + market_id: Long; + source_name: string; + orderer: string; + is_buy: boolean; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface EventOrderCompleted { + orderId: Long; +} +export interface EventOrderCompletedProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventOrderCompleted"; + value: Uint8Array; +} +export interface EventOrderCompletedAmino { + order_id: string; +} +export interface EventOrderCompletedAminoMsg { + type: "/crescent.exchange.v1beta1.EventOrderCompleted"; + value: EventOrderCompletedAmino; +} +export interface EventOrderCompletedSDKType { + order_id: Long; +} +export interface EventOrderExpired { + orderId: Long; +} +export interface EventOrderExpiredProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventOrderExpired"; + value: Uint8Array; +} +export interface EventOrderExpiredAmino { + order_id: string; +} +export interface EventOrderExpiredAminoMsg { + type: "/crescent.exchange.v1beta1.EventOrderExpired"; + value: EventOrderExpiredAmino; +} +export interface EventOrderExpiredSDKType { + order_id: Long; +} +export interface EventMarketParameterChanged { + marketId: Long; + makerFeeRate: string; + takerFeeRate: string; + orderSourceFeeRatio: string; +} +export interface EventMarketParameterChangedProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.EventMarketParameterChanged"; + value: Uint8Array; +} +export interface EventMarketParameterChangedAmino { + market_id: string; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} +export interface EventMarketParameterChangedAminoMsg { + type: "/crescent.exchange.v1beta1.EventMarketParameterChanged"; + value: EventMarketParameterChangedAmino; +} +export interface EventMarketParameterChangedSDKType { + market_id: Long; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/exchange.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/exchange.ts new file mode 100644 index 000000000..65fcdbb21 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/exchange.ts @@ -0,0 +1,171 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export enum OrderType { + ORDER_TYPE_UNSPECIFIED = 0, + ORDER_TYPE_LIMIT = 1, + ORDER_TYPE_MM = 2, + UNRECOGNIZED = -1, +} +export const OrderTypeSDKType = OrderType; +export const OrderTypeAmino = OrderType; +export function orderTypeFromJSON(object: any): OrderType { + switch (object) { + case 0: + case "ORDER_TYPE_UNSPECIFIED": + return OrderType.ORDER_TYPE_UNSPECIFIED; + case 1: + case "ORDER_TYPE_LIMIT": + return OrderType.ORDER_TYPE_LIMIT; + case 2: + case "ORDER_TYPE_MM": + return OrderType.ORDER_TYPE_MM; + case -1: + case "UNRECOGNIZED": + default: + return OrderType.UNRECOGNIZED; + } +} +export function orderTypeToJSON(object: OrderType): string { + switch (object) { + case OrderType.ORDER_TYPE_UNSPECIFIED: + return "ORDER_TYPE_UNSPECIFIED"; + case OrderType.ORDER_TYPE_LIMIT: + return "ORDER_TYPE_LIMIT"; + case OrderType.ORDER_TYPE_MM: + return "ORDER_TYPE_MM"; + case OrderType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Market { + id: Long; + baseDenom: string; + quoteDenom: string; + escrowAddress: string; + makerFeeRate: string; + takerFeeRate: string; + orderSourceFeeRatio: string; +} +export interface MarketProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.Market"; + value: Uint8Array; +} +export interface MarketAmino { + id: string; + base_denom: string; + quote_denom: string; + escrow_address: string; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} +export interface MarketAminoMsg { + type: "/crescent.exchange.v1beta1.Market"; + value: MarketAmino; +} +export interface MarketSDKType { + id: Long; + base_denom: string; + quote_denom: string; + escrow_address: string; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} +export interface MarketState { + lastPrice: string; + lastMatchingHeight: Long; +} +export interface MarketStateProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MarketState"; + value: Uint8Array; +} +export interface MarketStateAmino { + last_price: string; + last_matching_height: string; +} +export interface MarketStateAminoMsg { + type: "/crescent.exchange.v1beta1.MarketState"; + value: MarketStateAmino; +} +export interface MarketStateSDKType { + last_price: string; + last_matching_height: Long; +} +export interface Order { + id: Long; + type: OrderType; + orderer: string; + marketId: Long; + isBuy: boolean; + price: string; + quantity: string; + msgHeight: Long; + openQuantity: string; + remainingDeposit: string; + deadline: Date; +} +export interface OrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.Order"; + value: Uint8Array; +} +export interface OrderAmino { + id: string; + type: OrderType; + orderer: string; + market_id: string; + is_buy: boolean; + price: string; + quantity: string; + msg_height: string; + open_quantity: string; + remaining_deposit: string; + deadline?: Date; +} +export interface OrderAminoMsg { + type: "/crescent.exchange.v1beta1.Order"; + value: OrderAmino; +} +export interface OrderSDKType { + id: Long; + type: OrderType; + orderer: string; + market_id: Long; + is_buy: boolean; + price: string; + quantity: string; + msg_height: Long; + open_quantity: string; + remaining_deposit: string; + deadline: Date; +} +export interface SwapRouteResult { + marketId: Long; + executedQuantity: string; + input: DecCoin; + output: DecCoin; + fee: DecCoin; +} +export interface SwapRouteResultProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.SwapRouteResult"; + value: Uint8Array; +} +export interface SwapRouteResultAmino { + market_id: string; + executed_quantity: string; + input?: DecCoinAmino; + output?: DecCoinAmino; + fee?: DecCoinAmino; +} +export interface SwapRouteResultAminoMsg { + type: "/crescent.exchange.v1beta1.SwapRouteResult"; + value: SwapRouteResultAmino; +} +export interface SwapRouteResultSDKType { + market_id: Long; + executed_quantity: string; + input: DecCoinSDKType; + output: DecCoinSDKType; + fee: DecCoinSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/genesis.ts new file mode 100644 index 000000000..d6ec0035f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/genesis.ts @@ -0,0 +1,78 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Order, OrderAmino, OrderSDKType, Market, MarketAmino, MarketSDKType, MarketState, MarketStateAmino, MarketStateSDKType } from "./exchange"; +import { Long } from "../../../helpers"; +export interface GenesisState { + params: Params; + lastMarketId: Long; + lastOrderId: Long; + marketRecords: MarketRecord[]; + orders: Order[]; + numMmOrdersRecords: NumMMOrdersRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; + last_market_id: string; + last_order_id: string; + market_records: MarketRecordAmino[]; + orders: OrderAmino[]; + num_mm_orders_records: NumMMOrdersRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.exchange.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_market_id: Long; + last_order_id: Long; + market_records: MarketRecordSDKType[]; + orders: OrderSDKType[]; + num_mm_orders_records: NumMMOrdersRecordSDKType[]; +} +export interface MarketRecord { + market: Market; + state: MarketState; +} +export interface MarketRecordProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MarketRecord"; + value: Uint8Array; +} +export interface MarketRecordAmino { + market?: MarketAmino; + state?: MarketStateAmino; +} +export interface MarketRecordAminoMsg { + type: "/crescent.exchange.v1beta1.MarketRecord"; + value: MarketRecordAmino; +} +export interface MarketRecordSDKType { + market: MarketSDKType; + state: MarketStateSDKType; +} +export interface NumMMOrdersRecord { + orderer: string; + marketId: Long; + numMmOrders: number; +} +export interface NumMMOrdersRecordProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.NumMMOrdersRecord"; + value: Uint8Array; +} +export interface NumMMOrdersRecordAmino { + orderer: string; + market_id: string; + num_mm_orders: number; +} +export interface NumMMOrdersRecordAminoMsg { + type: "/crescent.exchange.v1beta1.NumMMOrdersRecord"; + value: NumMMOrdersRecordAmino; +} +export interface NumMMOrdersRecordSDKType { + orderer: string; + market_id: Long; + num_mm_orders: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/order_book.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/order_book.ts new file mode 100644 index 000000000..e35e9e535 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/order_book.ts @@ -0,0 +1,47 @@ +export interface OrderBook { + priceInterval: string; + sells: OrderBookPriceLevel[]; + buys: OrderBookPriceLevel[]; +} +export interface OrderBookProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.OrderBook"; + value: Uint8Array; +} +export interface OrderBookAmino { + price_interval: string; + sells: OrderBookPriceLevelAmino[]; + buys: OrderBookPriceLevelAmino[]; +} +export interface OrderBookAminoMsg { + type: "/crescent.exchange.v1beta1.OrderBook"; + value: OrderBookAmino; +} +export interface OrderBookSDKType { + price_interval: string; + sells: OrderBookPriceLevelSDKType[]; + buys: OrderBookPriceLevelSDKType[]; +} +export interface OrderBookPriceLevel { + /** p denotes price */ + p: string; + /** q denotes quantity */ + q: string; +} +export interface OrderBookPriceLevelProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.OrderBookPriceLevel"; + value: Uint8Array; +} +export interface OrderBookPriceLevelAmino { + /** p denotes price */ + p: string; + /** q denotes quantity */ + q: string; +} +export interface OrderBookPriceLevelAminoMsg { + type: "/crescent.exchange.v1beta1.OrderBookPriceLevel"; + value: OrderBookPriceLevelAmino; +} +export interface OrderBookPriceLevelSDKType { + p: string; + q: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/params.ts new file mode 100644 index 000000000..53870b11f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/params.ts @@ -0,0 +1,59 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +export interface Params { + marketCreationFee: Coin[]; + fees: Fees; + maxOrderLifespan: Duration; + /** max_order_price_ratio defines the ratio of the maximum possible order price compared to the market's last price */ + maxOrderPriceRatio: string; + maxSwapRoutesLen: number; + maxNumMmOrders: number; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + market_creation_fee: CoinAmino[]; + fees?: FeesAmino; + max_order_lifespan?: DurationAmino; + /** max_order_price_ratio defines the ratio of the maximum possible order price compared to the market's last price */ + max_order_price_ratio: string; + max_swap_routes_len: number; + max_num_mm_orders: number; +} +export interface ParamsAminoMsg { + type: "/crescent.exchange.v1beta1.Params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + market_creation_fee: CoinSDKType[]; + fees: FeesSDKType; + max_order_lifespan: DurationSDKType; + max_order_price_ratio: string; + max_swap_routes_len: number; + max_num_mm_orders: number; +} +export interface Fees { + defaultMakerFeeRate: string; + defaultTakerFeeRate: string; + defaultOrderSourceFeeRatio: string; +} +export interface FeesProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.Fees"; + value: Uint8Array; +} +export interface FeesAmino { + default_maker_fee_rate: string; + default_taker_fee_rate: string; + default_order_source_fee_ratio: string; +} +export interface FeesAminoMsg { + type: "/crescent.exchange.v1beta1.Fees"; + value: FeesAmino; +} +export interface FeesSDKType { + default_maker_fee_rate: string; + default_taker_fee_rate: string; + default_order_source_fee_ratio: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/proposal.ts new file mode 100644 index 000000000..df13da601 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/proposal.ts @@ -0,0 +1,50 @@ +import { Long } from "../../../helpers"; +export interface MarketParameterChangeProposal { + title: string; + description: string; + changes: MarketParameterChange[]; +} +export interface MarketParameterChangeProposalProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MarketParameterChangeProposal"; + value: Uint8Array; +} +export interface MarketParameterChangeProposalAmino { + title: string; + description: string; + changes: MarketParameterChangeAmino[]; +} +export interface MarketParameterChangeProposalAminoMsg { + type: "/crescent.exchange.v1beta1.MarketParameterChangeProposal"; + value: MarketParameterChangeProposalAmino; +} +export interface MarketParameterChangeProposalSDKType { + title: string; + description: string; + changes: MarketParameterChangeSDKType[]; +} +export interface MarketParameterChange { + marketId: Long; + makerFeeRate: string; + takerFeeRate: string; + orderSourceFeeRatio: string; +} +export interface MarketParameterChangeProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MarketParameterChange"; + value: Uint8Array; +} +export interface MarketParameterChangeAmino { + market_id: string; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} +export interface MarketParameterChangeAminoMsg { + type: "/crescent.exchange.v1beta1.MarketParameterChange"; + value: MarketParameterChangeAmino; +} +export interface MarketParameterChangeSDKType { + market_id: Long; + maker_fee_rate: string; + taker_fee_rate: string; + order_source_fee_ratio: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/tx.ts new file mode 100644 index 000000000..574e65b12 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/exchange/v1beta1/tx.ts @@ -0,0 +1,424 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { SwapRouteResult, SwapRouteResultAmino, SwapRouteResultSDKType } from "./exchange"; +import { Long } from "../../../helpers"; +export interface MsgCreateMarket { + sender: string; + baseDenom: string; + quoteDenom: string; +} +export interface MsgCreateMarketProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCreateMarket"; + value: Uint8Array; +} +export interface MsgCreateMarketAmino { + sender: string; + base_denom: string; + quote_denom: string; +} +export interface MsgCreateMarketAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCreateMarket"; + value: MsgCreateMarketAmino; +} +export interface MsgCreateMarketSDKType { + sender: string; + base_denom: string; + quote_denom: string; +} +export interface MsgCreateMarketResponse { + marketId: Long; +} +export interface MsgCreateMarketResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCreateMarketResponse"; + value: Uint8Array; +} +export interface MsgCreateMarketResponseAmino { + market_id: string; +} +export interface MsgCreateMarketResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCreateMarketResponse"; + value: MsgCreateMarketResponseAmino; +} +export interface MsgCreateMarketResponseSDKType { + market_id: Long; +} +export interface MsgPlaceLimitOrder { + sender: string; + marketId: Long; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; +} +export interface MsgPlaceLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceLimitOrder"; + value: Uint8Array; +} +export interface MsgPlaceLimitOrderAmino { + sender: string; + market_id: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; +} +export interface MsgPlaceLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceLimitOrder"; + value: MsgPlaceLimitOrderAmino; +} +export interface MsgPlaceLimitOrderSDKType { + sender: string; + market_id: Long; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; +} +export interface MsgPlaceLimitOrderResponse { + orderId: Long; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface MsgPlaceLimitOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceLimitOrderResponse"; + value: Uint8Array; +} +export interface MsgPlaceLimitOrderResponseAmino { + order_id: string; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface MsgPlaceLimitOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceLimitOrderResponse"; + value: MsgPlaceLimitOrderResponseAmino; +} +export interface MsgPlaceLimitOrderResponseSDKType { + order_id: Long; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface MsgPlaceBatchLimitOrder { + sender: string; + marketId: Long; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; +} +export interface MsgPlaceBatchLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceBatchLimitOrder"; + value: Uint8Array; +} +export interface MsgPlaceBatchLimitOrderAmino { + sender: string; + market_id: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; +} +export interface MsgPlaceBatchLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceBatchLimitOrder"; + value: MsgPlaceBatchLimitOrderAmino; +} +export interface MsgPlaceBatchLimitOrderSDKType { + sender: string; + market_id: Long; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; +} +export interface MsgPlaceBatchLimitOrderResponse { + orderId: Long; +} +export interface MsgPlaceBatchLimitOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceBatchLimitOrderResponse"; + value: Uint8Array; +} +export interface MsgPlaceBatchLimitOrderResponseAmino { + order_id: string; +} +export interface MsgPlaceBatchLimitOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceBatchLimitOrderResponse"; + value: MsgPlaceBatchLimitOrderResponseAmino; +} +export interface MsgPlaceBatchLimitOrderResponseSDKType { + order_id: Long; +} +export interface MsgPlaceMMLimitOrder { + sender: string; + marketId: Long; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; +} +export interface MsgPlaceMMLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMMLimitOrder"; + value: Uint8Array; +} +export interface MsgPlaceMMLimitOrderAmino { + sender: string; + market_id: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; +} +export interface MsgPlaceMMLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMMLimitOrder"; + value: MsgPlaceMMLimitOrderAmino; +} +export interface MsgPlaceMMLimitOrderSDKType { + sender: string; + market_id: Long; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; +} +export interface MsgPlaceMMLimitOrderResponse { + orderId: Long; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface MsgPlaceMMLimitOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMMLimitOrderResponse"; + value: Uint8Array; +} +export interface MsgPlaceMMLimitOrderResponseAmino { + order_id: string; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface MsgPlaceMMLimitOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMMLimitOrderResponse"; + value: MsgPlaceMMLimitOrderResponseAmino; +} +export interface MsgPlaceMMLimitOrderResponseSDKType { + order_id: Long; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface MsgPlaceMMBatchLimitOrder { + sender: string; + marketId: Long; + isBuy: boolean; + price: string; + quantity: string; + lifespan: Duration; +} +export interface MsgPlaceMMBatchLimitOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMMBatchLimitOrder"; + value: Uint8Array; +} +export interface MsgPlaceMMBatchLimitOrderAmino { + sender: string; + market_id: string; + is_buy: boolean; + price: string; + quantity: string; + lifespan?: DurationAmino; +} +export interface MsgPlaceMMBatchLimitOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMMBatchLimitOrder"; + value: MsgPlaceMMBatchLimitOrderAmino; +} +export interface MsgPlaceMMBatchLimitOrderSDKType { + sender: string; + market_id: Long; + is_buy: boolean; + price: string; + quantity: string; + lifespan: DurationSDKType; +} +export interface MsgPlaceMMBatchLimitOrderResponse { + orderId: Long; +} +export interface MsgPlaceMMBatchLimitOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMMBatchLimitOrderResponse"; + value: Uint8Array; +} +export interface MsgPlaceMMBatchLimitOrderResponseAmino { + order_id: string; +} +export interface MsgPlaceMMBatchLimitOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMMBatchLimitOrderResponse"; + value: MsgPlaceMMBatchLimitOrderResponseAmino; +} +export interface MsgPlaceMMBatchLimitOrderResponseSDKType { + order_id: Long; +} +export interface MsgPlaceMarketOrder { + sender: string; + marketId: Long; + isBuy: boolean; + quantity: string; +} +export interface MsgPlaceMarketOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMarketOrder"; + value: Uint8Array; +} +export interface MsgPlaceMarketOrderAmino { + sender: string; + market_id: string; + is_buy: boolean; + quantity: string; +} +export interface MsgPlaceMarketOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMarketOrder"; + value: MsgPlaceMarketOrderAmino; +} +export interface MsgPlaceMarketOrderSDKType { + sender: string; + market_id: Long; + is_buy: boolean; + quantity: string; +} +export interface MsgPlaceMarketOrderResponse { + orderId: Long; + executedQuantity: string; + paid: DecCoin; + received: DecCoin; +} +export interface MsgPlaceMarketOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgPlaceMarketOrderResponse"; + value: Uint8Array; +} +export interface MsgPlaceMarketOrderResponseAmino { + order_id: string; + executed_quantity: string; + paid?: DecCoinAmino; + received?: DecCoinAmino; +} +export interface MsgPlaceMarketOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgPlaceMarketOrderResponse"; + value: MsgPlaceMarketOrderResponseAmino; +} +export interface MsgPlaceMarketOrderResponseSDKType { + order_id: Long; + executed_quantity: string; + paid: DecCoinSDKType; + received: DecCoinSDKType; +} +export interface MsgCancelOrder { + sender: string; + orderId: Long; +} +export interface MsgCancelOrderProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCancelOrder"; + value: Uint8Array; +} +export interface MsgCancelOrderAmino { + sender: string; + order_id: string; +} +export interface MsgCancelOrderAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCancelOrder"; + value: MsgCancelOrderAmino; +} +export interface MsgCancelOrderSDKType { + sender: string; + order_id: Long; +} +export interface MsgCancelOrderResponse {} +export interface MsgCancelOrderResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCancelOrderResponse"; + value: Uint8Array; +} +export interface MsgCancelOrderResponseAmino {} +export interface MsgCancelOrderResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCancelOrderResponse"; + value: MsgCancelOrderResponseAmino; +} +export interface MsgCancelOrderResponseSDKType {} +export interface MsgCancelAllOrders { + sender: string; + marketId: Long; +} +export interface MsgCancelAllOrdersProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCancelAllOrders"; + value: Uint8Array; +} +export interface MsgCancelAllOrdersAmino { + sender: string; + market_id: string; +} +export interface MsgCancelAllOrdersAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCancelAllOrders"; + value: MsgCancelAllOrdersAmino; +} +export interface MsgCancelAllOrdersSDKType { + sender: string; + market_id: Long; +} +export interface MsgCancelAllOrdersResponse { + cancelledOrderIds: Long[]; +} +export interface MsgCancelAllOrdersResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgCancelAllOrdersResponse"; + value: Uint8Array; +} +export interface MsgCancelAllOrdersResponseAmino { + cancelled_order_ids: string[]; +} +export interface MsgCancelAllOrdersResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgCancelAllOrdersResponse"; + value: MsgCancelAllOrdersResponseAmino; +} +export interface MsgCancelAllOrdersResponseSDKType { + cancelled_order_ids: Long[]; +} +export interface MsgSwapExactAmountIn { + sender: string; + routes: Long[]; + input: DecCoin; + minOutput: DecCoin; +} +export interface MsgSwapExactAmountInProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgSwapExactAmountIn"; + value: Uint8Array; +} +export interface MsgSwapExactAmountInAmino { + sender: string; + routes: string[]; + input?: DecCoinAmino; + min_output?: DecCoinAmino; +} +export interface MsgSwapExactAmountInAminoMsg { + type: "/crescent.exchange.v1beta1.MsgSwapExactAmountIn"; + value: MsgSwapExactAmountInAmino; +} +export interface MsgSwapExactAmountInSDKType { + sender: string; + routes: Long[]; + input: DecCoinSDKType; + min_output: DecCoinSDKType; +} +export interface MsgSwapExactAmountInResponse { + output: DecCoin; + results: SwapRouteResult[]; +} +export interface MsgSwapExactAmountInResponseProtoMsg { + typeUrl: "/crescent.exchange.v1beta1.MsgSwapExactAmountInResponse"; + value: Uint8Array; +} +export interface MsgSwapExactAmountInResponseAmino { + output?: DecCoinAmino; + results: SwapRouteResultAmino[]; +} +export interface MsgSwapExactAmountInResponseAminoMsg { + type: "/crescent.exchange.v1beta1.MsgSwapExactAmountInResponse"; + value: MsgSwapExactAmountInResponseAmino; +} +export interface MsgSwapExactAmountInResponseSDKType { + output: DecCoinSDKType; + results: SwapRouteResultSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/farming.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/farming.ts new file mode 100644 index 000000000..4d3372a01 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/farming.ts @@ -0,0 +1,450 @@ +import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** PlanType enumerates the valid types of a plan. */ +export enum PlanType { + /** PLAN_TYPE_UNSPECIFIED - PLAN_TYPE_UNSPECIFIED defines the default plan type. */ + PLAN_TYPE_UNSPECIFIED = 0, + /** PLAN_TYPE_PUBLIC - PLAN_TYPE_PUBLIC defines the public plan type. */ + PLAN_TYPE_PUBLIC = 1, + /** PLAN_TYPE_PRIVATE - PLAN_TYPE_PRIVATE defines the private plan type. */ + PLAN_TYPE_PRIVATE = 2, + UNRECOGNIZED = -1, +} +export const PlanTypeSDKType = PlanType; +export const PlanTypeAmino = PlanType; +export function planTypeFromJSON(object: any): PlanType { + switch (object) { + case 0: + case "PLAN_TYPE_UNSPECIFIED": + return PlanType.PLAN_TYPE_UNSPECIFIED; + case 1: + case "PLAN_TYPE_PUBLIC": + return PlanType.PLAN_TYPE_PUBLIC; + case 2: + case "PLAN_TYPE_PRIVATE": + return PlanType.PLAN_TYPE_PRIVATE; + case -1: + case "UNRECOGNIZED": + default: + return PlanType.UNRECOGNIZED; + } +} +export function planTypeToJSON(object: PlanType): string { + switch (object) { + case PlanType.PLAN_TYPE_UNSPECIFIED: + return "PLAN_TYPE_UNSPECIFIED"; + case PlanType.PLAN_TYPE_PUBLIC: + return "PLAN_TYPE_PUBLIC"; + case PlanType.PLAN_TYPE_PRIVATE: + return "PLAN_TYPE_PRIVATE"; + case PlanType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** AddressType enumerates the available types of a address. */ +export enum AddressType { + /** ADDRESS_TYPE_32_BYTES - the 32 bytes length address type of ADR 028. */ + ADDRESS_TYPE_32_BYTES = 0, + /** ADDRESS_TYPE_20_BYTES - the default 20 bytes length address type. */ + ADDRESS_TYPE_20_BYTES = 1, + UNRECOGNIZED = -1, +} +export const AddressTypeSDKType = AddressType; +export const AddressTypeAmino = AddressType; +export function addressTypeFromJSON(object: any): AddressType { + switch (object) { + case 0: + case "ADDRESS_TYPE_32_BYTES": + return AddressType.ADDRESS_TYPE_32_BYTES; + case 1: + case "ADDRESS_TYPE_20_BYTES": + return AddressType.ADDRESS_TYPE_20_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return AddressType.UNRECOGNIZED; + } +} +export function addressTypeToJSON(object: AddressType): string { + switch (object) { + case AddressType.ADDRESS_TYPE_32_BYTES: + return "ADDRESS_TYPE_32_BYTES"; + case AddressType.ADDRESS_TYPE_20_BYTES: + return "ADDRESS_TYPE_20_BYTES"; + case AddressType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Params defines the set of params for the farming module. */ +export interface Params { + /** + * private_plan_creation_fee specifies the fee for plan creation + * this fee prevents from spamming and is collected in the community pool + */ + privatePlanCreationFee: Coin[]; + /** + * next_epoch_days is the epoch length in number of days + * it updates internal state called CurrentEpochDays that is used to process + * staking and reward distribution in end blocker + */ + nextEpochDays: number; + /** farming_fee_collector is the module account address to collect fees within the farming module */ + farmingFeeCollector: string; + /** delayed_staking_gas_fee is used to impose gas fee for the delayed staking */ + delayedStakingGasFee: Long; + /** max_num_private_plans is the maximum number of active private plans */ + maxNumPrivatePlans: number; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.farming.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the farming module. */ +export interface ParamsAmino { + /** + * private_plan_creation_fee specifies the fee for plan creation + * this fee prevents from spamming and is collected in the community pool + */ + private_plan_creation_fee: CoinAmino[]; + /** + * next_epoch_days is the epoch length in number of days + * it updates internal state called CurrentEpochDays that is used to process + * staking and reward distribution in end blocker + */ + next_epoch_days: number; + /** farming_fee_collector is the module account address to collect fees within the farming module */ + farming_fee_collector: string; + /** delayed_staking_gas_fee is used to impose gas fee for the delayed staking */ + delayed_staking_gas_fee: string; + /** max_num_private_plans is the maximum number of active private plans */ + max_num_private_plans: number; +} +export interface ParamsAminoMsg { + type: "/crescent.farming.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the farming module. */ +export interface ParamsSDKType { + private_plan_creation_fee: CoinSDKType[]; + next_epoch_days: number; + farming_fee_collector: string; + delayed_staking_gas_fee: Long; + max_num_private_plans: number; +} +/** + * BasePlan defines a base plan type and contains the required fields + * for basic farming plan functionality. Any custom farming plan type must + * extend this type for additional functionality (for example, fixed amount plan, ratio + * plan). + */ +export interface BasePlan { + /** id specifies index of the farming plan */ + id: Long; + /** name specifies the name for the plan */ + name: string; + /** + * type specifies the plan type; type 0 is public and 1 is private + * public plan must be created through governance proposal and private plan is + * created by account + */ + type: PlanType; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farmingPoolAddress: string; + /** + * termination_address defines the Bech32-encoded address that terminates the plan + * when the plan ends after the end time, the balance of the farming pool address + * is transferred to the termination address + */ + terminationAddress: string; + /** staking_coin_weights specifies the coin weights for the plan */ + stakingCoinWeights: DecCoin[]; + /** start_time specifies the start time of the plan */ + startTime: Date; + /** end_time specifies the end time of the plan */ + endTime: Date; + /** terminated indicates whether the plan has been terminated or not */ + terminated: boolean; + /** last_distribution_time specifies the last time a distribution occurred */ + lastDistributionTime: Date; + /** distributed_coins specifies the total coins distributed by this plan */ + distributedCoins: Coin[]; +} +export interface BasePlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.BasePlan"; + value: Uint8Array; +} +/** + * BasePlan defines a base plan type and contains the required fields + * for basic farming plan functionality. Any custom farming plan type must + * extend this type for additional functionality (for example, fixed amount plan, ratio + * plan). + */ +export interface BasePlanAmino { + /** id specifies index of the farming plan */ + id: string; + /** name specifies the name for the plan */ + name: string; + /** + * type specifies the plan type; type 0 is public and 1 is private + * public plan must be created through governance proposal and private plan is + * created by account + */ + type: PlanType; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farming_pool_address: string; + /** + * termination_address defines the Bech32-encoded address that terminates the plan + * when the plan ends after the end time, the balance of the farming pool address + * is transferred to the termination address + */ + termination_address: string; + /** staking_coin_weights specifies the coin weights for the plan */ + staking_coin_weights: DecCoinAmino[]; + /** start_time specifies the start time of the plan */ + start_time?: Date; + /** end_time specifies the end time of the plan */ + end_time?: Date; + /** terminated indicates whether the plan has been terminated or not */ + terminated: boolean; + /** last_distribution_time specifies the last time a distribution occurred */ + last_distribution_time?: Date; + /** distributed_coins specifies the total coins distributed by this plan */ + distributed_coins: CoinAmino[]; +} +export interface BasePlanAminoMsg { + type: "/crescent.farming.v1beta1.BasePlan"; + value: BasePlanAmino; +} +/** + * BasePlan defines a base plan type and contains the required fields + * for basic farming plan functionality. Any custom farming plan type must + * extend this type for additional functionality (for example, fixed amount plan, ratio + * plan). + */ +export interface BasePlanSDKType { + id: Long; + name: string; + type: PlanType; + farming_pool_address: string; + termination_address: string; + staking_coin_weights: DecCoinSDKType[]; + start_time: Date; + end_time: Date; + terminated: boolean; + last_distribution_time: Date; + distributed_coins: CoinSDKType[]; +} +/** + * FixedAmountPlan defines a fixed amount plan that distributes a fixed amount + * of coins for every epoch. + */ +export interface FixedAmountPlan { + basePlan: BasePlan; + /** epoch_amount specifies the distributing amount for each epoch */ + epochAmount: Coin[]; +} +export interface FixedAmountPlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.FixedAmountPlan"; + value: Uint8Array; +} +/** + * FixedAmountPlan defines a fixed amount plan that distributes a fixed amount + * of coins for every epoch. + */ +export interface FixedAmountPlanAmino { + base_plan?: BasePlanAmino; + /** epoch_amount specifies the distributing amount for each epoch */ + epoch_amount: CoinAmino[]; +} +export interface FixedAmountPlanAminoMsg { + type: "/crescent.farming.v1beta1.FixedAmountPlan"; + value: FixedAmountPlanAmino; +} +/** + * FixedAmountPlan defines a fixed amount plan that distributes a fixed amount + * of coins for every epoch. + */ +export interface FixedAmountPlanSDKType { + base_plan: BasePlanSDKType; + epoch_amount: CoinSDKType[]; +} +/** + * RatioPlan defines a plan that distributes to farmers by ratio + * distribution for every epoch day. + */ +export interface RatioPlan { + basePlan: BasePlan; + /** epoch_ratio specifies the distributing amount by ratio */ + epochRatio: string; +} +export interface RatioPlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.RatioPlan"; + value: Uint8Array; +} +/** + * RatioPlan defines a plan that distributes to farmers by ratio + * distribution for every epoch day. + */ +export interface RatioPlanAmino { + base_plan?: BasePlanAmino; + /** epoch_ratio specifies the distributing amount by ratio */ + epoch_ratio: string; +} +export interface RatioPlanAminoMsg { + type: "/crescent.farming.v1beta1.RatioPlan"; + value: RatioPlanAmino; +} +/** + * RatioPlan defines a plan that distributes to farmers by ratio + * distribution for every epoch day. + */ +export interface RatioPlanSDKType { + base_plan: BasePlanSDKType; + epoch_ratio: string; +} +/** Staking defines a farmer's staking information. */ +export interface Staking { + amount: string; + startingEpoch: Long; +} +export interface StakingProtoMsg { + typeUrl: "/crescent.farming.v1beta1.Staking"; + value: Uint8Array; +} +/** Staking defines a farmer's staking information. */ +export interface StakingAmino { + amount: string; + starting_epoch: string; +} +export interface StakingAminoMsg { + type: "/crescent.farming.v1beta1.Staking"; + value: StakingAmino; +} +/** Staking defines a farmer's staking information. */ +export interface StakingSDKType { + amount: string; + starting_epoch: Long; +} +/** QueuedStaking defines staking that is waiting in a queue. */ +export interface QueuedStaking { + amount: string; +} +export interface QueuedStakingProtoMsg { + typeUrl: "/crescent.farming.v1beta1.QueuedStaking"; + value: Uint8Array; +} +/** QueuedStaking defines staking that is waiting in a queue. */ +export interface QueuedStakingAmino { + amount: string; +} +export interface QueuedStakingAminoMsg { + type: "/crescent.farming.v1beta1.QueuedStaking"; + value: QueuedStakingAmino; +} +/** QueuedStaking defines staking that is waiting in a queue. */ +export interface QueuedStakingSDKType { + amount: string; +} +/** TotalStakings defines the total staking amount for a staking coin denom. */ +export interface TotalStakings { + amount: string; +} +export interface TotalStakingsProtoMsg { + typeUrl: "/crescent.farming.v1beta1.TotalStakings"; + value: Uint8Array; +} +/** TotalStakings defines the total staking amount for a staking coin denom. */ +export interface TotalStakingsAmino { + amount: string; +} +export interface TotalStakingsAminoMsg { + type: "/crescent.farming.v1beta1.TotalStakings"; + value: TotalStakingsAmino; +} +/** TotalStakings defines the total staking amount for a staking coin denom. */ +export interface TotalStakingsSDKType { + amount: string; +} +/** HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. */ +export interface HistoricalRewards { + cumulativeUnitRewards: DecCoin[]; +} +export interface HistoricalRewardsProtoMsg { + typeUrl: "/crescent.farming.v1beta1.HistoricalRewards"; + value: Uint8Array; +} +/** HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. */ +export interface HistoricalRewardsAmino { + cumulative_unit_rewards: DecCoinAmino[]; +} +export interface HistoricalRewardsAminoMsg { + type: "/crescent.farming.v1beta1.HistoricalRewards"; + value: HistoricalRewardsAmino; +} +/** HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. */ +export interface HistoricalRewardsSDKType { + cumulative_unit_rewards: DecCoinSDKType[]; +} +/** + * OutstandingRewards represents outstanding (un-withdrawn) rewards + * for a staking coin denom. + */ +export interface OutstandingRewards { + rewards: DecCoin[]; +} +export interface OutstandingRewardsProtoMsg { + typeUrl: "/crescent.farming.v1beta1.OutstandingRewards"; + value: Uint8Array; +} +/** + * OutstandingRewards represents outstanding (un-withdrawn) rewards + * for a staking coin denom. + */ +export interface OutstandingRewardsAmino { + rewards: DecCoinAmino[]; +} +export interface OutstandingRewardsAminoMsg { + type: "/crescent.farming.v1beta1.OutstandingRewards"; + value: OutstandingRewardsAmino; +} +/** + * OutstandingRewards represents outstanding (un-withdrawn) rewards + * for a staking coin denom. + */ +export interface OutstandingRewardsSDKType { + rewards: DecCoinSDKType[]; +} +/** + * UnharvestedRewards represents unharvested rewards of a farmer for a + * staking coin denom, which increases when there was an automatic withdrawal + * of rewards due to changes in staked coin amount. + */ +export interface UnharvestedRewards { + rewards: Coin[]; +} +export interface UnharvestedRewardsProtoMsg { + typeUrl: "/crescent.farming.v1beta1.UnharvestedRewards"; + value: Uint8Array; +} +/** + * UnharvestedRewards represents unharvested rewards of a farmer for a + * staking coin denom, which increases when there was an automatic withdrawal + * of rewards due to changes in staked coin amount. + */ +export interface UnharvestedRewardsAmino { + rewards: CoinAmino[]; +} +export interface UnharvestedRewardsAminoMsg { + type: "/crescent.farming.v1beta1.UnharvestedRewards"; + value: UnharvestedRewardsAmino; +} +/** + * UnharvestedRewards represents unharvested rewards of a farmer for a + * staking coin denom, which increases when there was an automatic withdrawal + * of rewards due to changes in staked coin amount. + */ +export interface UnharvestedRewardsSDKType { + rewards: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/genesis.ts new file mode 100644 index 000000000..1e52cc8b5 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/genesis.ts @@ -0,0 +1,295 @@ +import { Params, ParamsAmino, ParamsSDKType, Staking, StakingAmino, StakingSDKType, QueuedStaking, QueuedStakingAmino, QueuedStakingSDKType, HistoricalRewards, HistoricalRewardsAmino, HistoricalRewardsSDKType, OutstandingRewards, OutstandingRewardsAmino, OutstandingRewardsSDKType, UnharvestedRewards, UnharvestedRewardsAmino, UnharvestedRewardsSDKType } from "./farming"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Long } from "../../../helpers"; +/** GenesisState defines the farming module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters for the farming module */ + params: Params; + globalPlanId: Long; + /** plan_records defines the plan records used for genesis state */ + planRecords: PlanRecord[]; + stakingRecords: StakingRecord[]; + queuedStakingRecords: QueuedStakingRecord[]; + historicalRewardsRecords: HistoricalRewardsRecord[]; + outstandingRewardsRecords: OutstandingRewardsRecord[]; + unharvestedRewardsRecords: UnharvestedRewardsRecord[]; + currentEpochRecords: CurrentEpochRecord[]; + totalStakingsRecords: TotalStakingsRecord[]; + /** + * reward_pool_coins specifies balance of the reward pool to be distributed in the plans + * this param is needed for import/export validation + */ + rewardPoolCoins: Coin[]; + /** last_epoch_time specifies the last executed epoch time of the plans */ + lastEpochTime: Date; + /** current_epoch_days specifies the epoch used when allocating farming rewards in end blocker */ + currentEpochDays: number; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.farming.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the farming module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters for the farming module */ + params?: ParamsAmino; + global_plan_id: string; + /** plan_records defines the plan records used for genesis state */ + plan_records: PlanRecordAmino[]; + staking_records: StakingRecordAmino[]; + queued_staking_records: QueuedStakingRecordAmino[]; + historical_rewards_records: HistoricalRewardsRecordAmino[]; + outstanding_rewards_records: OutstandingRewardsRecordAmino[]; + unharvested_rewards_records: UnharvestedRewardsRecordAmino[]; + current_epoch_records: CurrentEpochRecordAmino[]; + total_stakings_records: TotalStakingsRecordAmino[]; + /** + * reward_pool_coins specifies balance of the reward pool to be distributed in the plans + * this param is needed for import/export validation + */ + reward_pool_coins: CoinAmino[]; + /** last_epoch_time specifies the last executed epoch time of the plans */ + last_epoch_time?: Date; + /** current_epoch_days specifies the epoch used when allocating farming rewards in end blocker */ + current_epoch_days: number; +} +export interface GenesisStateAminoMsg { + type: "/crescent.farming.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the farming module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + global_plan_id: Long; + plan_records: PlanRecordSDKType[]; + staking_records: StakingRecordSDKType[]; + queued_staking_records: QueuedStakingRecordSDKType[]; + historical_rewards_records: HistoricalRewardsRecordSDKType[]; + outstanding_rewards_records: OutstandingRewardsRecordSDKType[]; + unharvested_rewards_records: UnharvestedRewardsRecordSDKType[]; + current_epoch_records: CurrentEpochRecordSDKType[]; + total_stakings_records: TotalStakingsRecordSDKType[]; + reward_pool_coins: CoinSDKType[]; + last_epoch_time: Date; + current_epoch_days: number; +} +/** PlanRecord is used for import/export via genesis json. */ +export interface PlanRecord { + /** plan specifies the plan interface; it can be FixedAmountPlan or RatioPlan */ + plan: Any; + /** + * farming_pool_coins specifies balance of the farming pool for the plan + * this param is needed for import/export validation + */ + farmingPoolCoins: Coin[]; +} +export interface PlanRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.PlanRecord"; + value: Uint8Array; +} +/** PlanRecord is used for import/export via genesis json. */ +export interface PlanRecordAmino { + /** plan specifies the plan interface; it can be FixedAmountPlan or RatioPlan */ + plan?: AnyAmino; + /** + * farming_pool_coins specifies balance of the farming pool for the plan + * this param is needed for import/export validation + */ + farming_pool_coins: CoinAmino[]; +} +export interface PlanRecordAminoMsg { + type: "/crescent.farming.v1beta1.PlanRecord"; + value: PlanRecordAmino; +} +/** PlanRecord is used for import/export via genesis json. */ +export interface PlanRecordSDKType { + plan: AnySDKType; + farming_pool_coins: CoinSDKType[]; +} +/** StakingRecord is used for import/export via genesis json. */ +export interface StakingRecord { + stakingCoinDenom: string; + farmer: string; + staking: Staking; +} +export interface StakingRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.StakingRecord"; + value: Uint8Array; +} +/** StakingRecord is used for import/export via genesis json. */ +export interface StakingRecordAmino { + staking_coin_denom: string; + farmer: string; + staking?: StakingAmino; +} +export interface StakingRecordAminoMsg { + type: "/crescent.farming.v1beta1.StakingRecord"; + value: StakingRecordAmino; +} +/** StakingRecord is used for import/export via genesis json. */ +export interface StakingRecordSDKType { + staking_coin_denom: string; + farmer: string; + staking: StakingSDKType; +} +/** QueuedStakingRecord is used for import/export via genesis json. */ +export interface QueuedStakingRecord { + endTime: Date; + stakingCoinDenom: string; + farmer: string; + queuedStaking: QueuedStaking; +} +export interface QueuedStakingRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.QueuedStakingRecord"; + value: Uint8Array; +} +/** QueuedStakingRecord is used for import/export via genesis json. */ +export interface QueuedStakingRecordAmino { + end_time?: Date; + staking_coin_denom: string; + farmer: string; + queued_staking?: QueuedStakingAmino; +} +export interface QueuedStakingRecordAminoMsg { + type: "/crescent.farming.v1beta1.QueuedStakingRecord"; + value: QueuedStakingRecordAmino; +} +/** QueuedStakingRecord is used for import/export via genesis json. */ +export interface QueuedStakingRecordSDKType { + end_time: Date; + staking_coin_denom: string; + farmer: string; + queued_staking: QueuedStakingSDKType; +} +/** TotalStakingsRecord is used for import/export via genesis json. */ +export interface TotalStakingsRecord { + stakingCoinDenom: string; + /** amount specifies total amount of the staking for the staking coin denom except queued staking */ + amount: string; + /** + * staking_reserve_coins specifies balance of the staking reserve account where staking and queued staking for the + * staking coin denom is stored this param is needed for import/export validation + */ + stakingReserveCoins: Coin[]; +} +export interface TotalStakingsRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.TotalStakingsRecord"; + value: Uint8Array; +} +/** TotalStakingsRecord is used for import/export via genesis json. */ +export interface TotalStakingsRecordAmino { + staking_coin_denom: string; + /** amount specifies total amount of the staking for the staking coin denom except queued staking */ + amount: string; + /** + * staking_reserve_coins specifies balance of the staking reserve account where staking and queued staking for the + * staking coin denom is stored this param is needed for import/export validation + */ + staking_reserve_coins: CoinAmino[]; +} +export interface TotalStakingsRecordAminoMsg { + type: "/crescent.farming.v1beta1.TotalStakingsRecord"; + value: TotalStakingsRecordAmino; +} +/** TotalStakingsRecord is used for import/export via genesis json. */ +export interface TotalStakingsRecordSDKType { + staking_coin_denom: string; + amount: string; + staking_reserve_coins: CoinSDKType[]; +} +/** HistoricalRewardsRecord is used for import/export via genesis json. */ +export interface HistoricalRewardsRecord { + stakingCoinDenom: string; + epoch: Long; + historicalRewards: HistoricalRewards; +} +export interface HistoricalRewardsRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.HistoricalRewardsRecord"; + value: Uint8Array; +} +/** HistoricalRewardsRecord is used for import/export via genesis json. */ +export interface HistoricalRewardsRecordAmino { + staking_coin_denom: string; + epoch: string; + historical_rewards?: HistoricalRewardsAmino; +} +export interface HistoricalRewardsRecordAminoMsg { + type: "/crescent.farming.v1beta1.HistoricalRewardsRecord"; + value: HistoricalRewardsRecordAmino; +} +/** HistoricalRewardsRecord is used for import/export via genesis json. */ +export interface HistoricalRewardsRecordSDKType { + staking_coin_denom: string; + epoch: Long; + historical_rewards: HistoricalRewardsSDKType; +} +/** OutstandingRewardsRecord is used for import/export via genesis json. */ +export interface OutstandingRewardsRecord { + stakingCoinDenom: string; + outstandingRewards: OutstandingRewards; +} +export interface OutstandingRewardsRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.OutstandingRewardsRecord"; + value: Uint8Array; +} +/** OutstandingRewardsRecord is used for import/export via genesis json. */ +export interface OutstandingRewardsRecordAmino { + staking_coin_denom: string; + outstanding_rewards?: OutstandingRewardsAmino; +} +export interface OutstandingRewardsRecordAminoMsg { + type: "/crescent.farming.v1beta1.OutstandingRewardsRecord"; + value: OutstandingRewardsRecordAmino; +} +/** OutstandingRewardsRecord is used for import/export via genesis json. */ +export interface OutstandingRewardsRecordSDKType { + staking_coin_denom: string; + outstanding_rewards: OutstandingRewardsSDKType; +} +export interface UnharvestedRewardsRecord { + farmer: string; + stakingCoinDenom: string; + unharvestedRewards: UnharvestedRewards; +} +export interface UnharvestedRewardsRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.UnharvestedRewardsRecord"; + value: Uint8Array; +} +export interface UnharvestedRewardsRecordAmino { + farmer: string; + staking_coin_denom: string; + unharvested_rewards?: UnharvestedRewardsAmino; +} +export interface UnharvestedRewardsRecordAminoMsg { + type: "/crescent.farming.v1beta1.UnharvestedRewardsRecord"; + value: UnharvestedRewardsRecordAmino; +} +export interface UnharvestedRewardsRecordSDKType { + farmer: string; + staking_coin_denom: string; + unharvested_rewards: UnharvestedRewardsSDKType; +} +/** CurrentEpochRecord is used for import/export via genesis json. */ +export interface CurrentEpochRecord { + stakingCoinDenom: string; + currentEpoch: Long; +} +export interface CurrentEpochRecordProtoMsg { + typeUrl: "/crescent.farming.v1beta1.CurrentEpochRecord"; + value: Uint8Array; +} +/** CurrentEpochRecord is used for import/export via genesis json. */ +export interface CurrentEpochRecordAmino { + staking_coin_denom: string; + current_epoch: string; +} +export interface CurrentEpochRecordAminoMsg { + type: "/crescent.farming.v1beta1.CurrentEpochRecord"; + value: CurrentEpochRecordAmino; +} +/** CurrentEpochRecord is used for import/export via genesis json. */ +export interface CurrentEpochRecordSDKType { + staking_coin_denom: string; + current_epoch: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/proposal.ts new file mode 100644 index 000000000..3e6cb3c52 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/proposal.ts @@ -0,0 +1,216 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** + * PublicPlanProposal defines a public farming plan governance proposal that receives one of the following requests: + * A request that creates a public farming plan, a request that updates the plan, and a request that deletes the plan. + * For public plan creation, depending on which field is passed, either epoch amount or epoch ratio, it creates a fixed + * amount plan or ratio plan. + */ +export interface PublicPlanProposal { + /** title specifies the title of the plan */ + title: string; + /** description specifies the description of the plan */ + description: string; + /** add_plan_requests specifies AddPlanRequest object */ + addPlanRequests: AddPlanRequest[]; + /** modify_plan_requests specifies ModifyPlanRequest object */ + modifyPlanRequests: ModifyPlanRequest[]; + /** delete_plan_requests specifies DeletePlanRequest object */ + deletePlanRequests: DeletePlanRequest[]; +} +export interface PublicPlanProposalProtoMsg { + typeUrl: "/crescent.farming.v1beta1.PublicPlanProposal"; + value: Uint8Array; +} +/** + * PublicPlanProposal defines a public farming plan governance proposal that receives one of the following requests: + * A request that creates a public farming plan, a request that updates the plan, and a request that deletes the plan. + * For public plan creation, depending on which field is passed, either epoch amount or epoch ratio, it creates a fixed + * amount plan or ratio plan. + */ +export interface PublicPlanProposalAmino { + /** title specifies the title of the plan */ + title: string; + /** description specifies the description of the plan */ + description: string; + /** add_plan_requests specifies AddPlanRequest object */ + add_plan_requests: AddPlanRequestAmino[]; + /** modify_plan_requests specifies ModifyPlanRequest object */ + modify_plan_requests: ModifyPlanRequestAmino[]; + /** delete_plan_requests specifies DeletePlanRequest object */ + delete_plan_requests: DeletePlanRequestAmino[]; +} +export interface PublicPlanProposalAminoMsg { + type: "/crescent.farming.v1beta1.PublicPlanProposal"; + value: PublicPlanProposalAmino; +} +/** + * PublicPlanProposal defines a public farming plan governance proposal that receives one of the following requests: + * A request that creates a public farming plan, a request that updates the plan, and a request that deletes the plan. + * For public plan creation, depending on which field is passed, either epoch amount or epoch ratio, it creates a fixed + * amount plan or ratio plan. + */ +export interface PublicPlanProposalSDKType { + title: string; + description: string; + add_plan_requests: AddPlanRequestSDKType[]; + modify_plan_requests: ModifyPlanRequestSDKType[]; + delete_plan_requests: DeletePlanRequestSDKType[]; +} +/** AddPlanRequest details a proposal for creating a public plan. */ +export interface AddPlanRequest { + /** name specifies the plan name for display */ + name: string; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farmingPoolAddress: string; + /** + * termination_address defines the bech32-encoded address that terminates plan + * when the plan ends after the end time, the balance of farming pool address + * is transferred to the termination address + */ + terminationAddress: string; + /** staking_coin_weights specifies coin weights for the plan */ + stakingCoinWeights: DecCoin[]; + /** start_time specifies the start time of the plan */ + startTime: Date; + /** end_time specifies the end time of the plan */ + endTime: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epochAmount: Coin[]; + /** epoch_ratio specifies the distributing amount by ratio */ + epochRatio: string; +} +export interface AddPlanRequestProtoMsg { + typeUrl: "/crescent.farming.v1beta1.AddPlanRequest"; + value: Uint8Array; +} +/** AddPlanRequest details a proposal for creating a public plan. */ +export interface AddPlanRequestAmino { + /** name specifies the plan name for display */ + name: string; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farming_pool_address: string; + /** + * termination_address defines the bech32-encoded address that terminates plan + * when the plan ends after the end time, the balance of farming pool address + * is transferred to the termination address + */ + termination_address: string; + /** staking_coin_weights specifies coin weights for the plan */ + staking_coin_weights: DecCoinAmino[]; + /** start_time specifies the start time of the plan */ + start_time?: Date; + /** end_time specifies the end time of the plan */ + end_time?: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epoch_amount: CoinAmino[]; + /** epoch_ratio specifies the distributing amount by ratio */ + epoch_ratio: string; +} +export interface AddPlanRequestAminoMsg { + type: "/crescent.farming.v1beta1.AddPlanRequest"; + value: AddPlanRequestAmino; +} +/** AddPlanRequest details a proposal for creating a public plan. */ +export interface AddPlanRequestSDKType { + name: string; + farming_pool_address: string; + termination_address: string; + staking_coin_weights: DecCoinSDKType[]; + start_time: Date; + end_time: Date; + epoch_amount: CoinSDKType[]; + epoch_ratio: string; +} +/** ModifyPlanRequest details a proposal for modifying the existing public plan. */ +export interface ModifyPlanRequest { + /** plan_id specifies index of the farming plan */ + planId: Long; + /** name specifies the plan name for display */ + name: string; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farmingPoolAddress: string; + /** + * termination_address defines the bech32-encoded address that terminates plan + * when the plan ends after the end time, the balance of farming pool address + * is transferred to the termination address + */ + terminationAddress: string; + /** staking_coin_weights specifies coin weights for the plan */ + stakingCoinWeights: DecCoin[]; + /** start_time specifies the start time of the plan */ + startTime?: Date; + /** end_time specifies the end time of the plan */ + endTime?: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epochAmount: Coin[]; + /** epoch_ratio specifies the distributing amount by ratio */ + epochRatio: string; +} +export interface ModifyPlanRequestProtoMsg { + typeUrl: "/crescent.farming.v1beta1.ModifyPlanRequest"; + value: Uint8Array; +} +/** ModifyPlanRequest details a proposal for modifying the existing public plan. */ +export interface ModifyPlanRequestAmino { + /** plan_id specifies index of the farming plan */ + plan_id: string; + /** name specifies the plan name for display */ + name: string; + /** farming_pool_address defines the bech32-encoded address of the farming pool */ + farming_pool_address: string; + /** + * termination_address defines the bech32-encoded address that terminates plan + * when the plan ends after the end time, the balance of farming pool address + * is transferred to the termination address + */ + termination_address: string; + /** staking_coin_weights specifies coin weights for the plan */ + staking_coin_weights: DecCoinAmino[]; + /** start_time specifies the start time of the plan */ + start_time?: Date; + /** end_time specifies the end time of the plan */ + end_time?: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epoch_amount: CoinAmino[]; + /** epoch_ratio specifies the distributing amount by ratio */ + epoch_ratio: string; +} +export interface ModifyPlanRequestAminoMsg { + type: "/crescent.farming.v1beta1.ModifyPlanRequest"; + value: ModifyPlanRequestAmino; +} +/** ModifyPlanRequest details a proposal for modifying the existing public plan. */ +export interface ModifyPlanRequestSDKType { + plan_id: Long; + name: string; + farming_pool_address: string; + termination_address: string; + staking_coin_weights: DecCoinSDKType[]; + start_time?: Date; + end_time?: Date; + epoch_amount: CoinSDKType[]; + epoch_ratio: string; +} +/** DeletePlanRequest details a proposal for deleting an existing public plan. */ +export interface DeletePlanRequest { + /** plan_id specifies index of the farming plan */ + planId: Long; +} +export interface DeletePlanRequestProtoMsg { + typeUrl: "/crescent.farming.v1beta1.DeletePlanRequest"; + value: Uint8Array; +} +/** DeletePlanRequest details a proposal for deleting an existing public plan. */ +export interface DeletePlanRequestAmino { + /** plan_id specifies index of the farming plan */ + plan_id: string; +} +export interface DeletePlanRequestAminoMsg { + type: "/crescent.farming.v1beta1.DeletePlanRequest"; + value: DeletePlanRequestAmino; +} +/** DeletePlanRequest details a proposal for deleting an existing public plan. */ +export interface DeletePlanRequestSDKType { + plan_id: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/tx.ts new file mode 100644 index 000000000..98ad49bee --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/farming/v1beta1/tx.ts @@ -0,0 +1,374 @@ +import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** + * MsgCreateFixedAmountPlan defines a SDK message for creating a new fixed + * amount farming plan. + */ +export interface MsgCreateFixedAmountPlan { + /** name specifies the name for the plan */ + name: string; + /** + * creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + * this creator. + */ + creator: string; + /** staking_coin_weights specifies coins weight for the plan */ + stakingCoinWeights: DecCoin[]; + /** start_time specifies the start time of the plan */ + startTime: Date; + /** end_time specifies the end time of the plan */ + endTime: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epochAmount: Coin[]; +} +export interface MsgCreateFixedAmountPlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgCreateFixedAmountPlan"; + value: Uint8Array; +} +/** + * MsgCreateFixedAmountPlan defines a SDK message for creating a new fixed + * amount farming plan. + */ +export interface MsgCreateFixedAmountPlanAmino { + /** name specifies the name for the plan */ + name: string; + /** + * creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + * this creator. + */ + creator: string; + /** staking_coin_weights specifies coins weight for the plan */ + staking_coin_weights: DecCoinAmino[]; + /** start_time specifies the start time of the plan */ + start_time?: Date; + /** end_time specifies the end time of the plan */ + end_time?: Date; + /** epoch_amount specifies the distributing amount for each epoch */ + epoch_amount: CoinAmino[]; +} +export interface MsgCreateFixedAmountPlanAminoMsg { + type: "/crescent.farming.v1beta1.MsgCreateFixedAmountPlan"; + value: MsgCreateFixedAmountPlanAmino; +} +/** + * MsgCreateFixedAmountPlan defines a SDK message for creating a new fixed + * amount farming plan. + */ +export interface MsgCreateFixedAmountPlanSDKType { + name: string; + creator: string; + staking_coin_weights: DecCoinSDKType[]; + start_time: Date; + end_time: Date; + epoch_amount: CoinSDKType[]; +} +/** MsgCreateFixedAmountPlanResponse defines the MsgCreateFixedAmountPlanResponse response type. */ +export interface MsgCreateFixedAmountPlanResponse {} +export interface MsgCreateFixedAmountPlanResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgCreateFixedAmountPlanResponse"; + value: Uint8Array; +} +/** MsgCreateFixedAmountPlanResponse defines the MsgCreateFixedAmountPlanResponse response type. */ +export interface MsgCreateFixedAmountPlanResponseAmino {} +export interface MsgCreateFixedAmountPlanResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgCreateFixedAmountPlanResponse"; + value: MsgCreateFixedAmountPlanResponseAmino; +} +/** MsgCreateFixedAmountPlanResponse defines the MsgCreateFixedAmountPlanResponse response type. */ +export interface MsgCreateFixedAmountPlanResponseSDKType {} +/** + * MsgCreateRatioPlan defines a SDK message for creating a new ratio farming + * plan. + */ +export interface MsgCreateRatioPlan { + /** name specifies the name for the plan */ + name: string; + /** + * creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + * this creator. + */ + creator: string; + /** staking_coin_weights specifies coins weight for the plan */ + stakingCoinWeights: DecCoin[]; + /** start_time specifies the start time of the plan */ + startTime: Date; + /** end_time specifies the end time of the plan */ + endTime: Date; + /** epoch_ratio specifies the distributing amount by ratio */ + epochRatio: string; +} +export interface MsgCreateRatioPlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgCreateRatioPlan"; + value: Uint8Array; +} +/** + * MsgCreateRatioPlan defines a SDK message for creating a new ratio farming + * plan. + */ +export interface MsgCreateRatioPlanAmino { + /** name specifies the name for the plan */ + name: string; + /** + * creator defines the bech32-encoded address of the creator for the private plan, termination address is also set to + * this creator. + */ + creator: string; + /** staking_coin_weights specifies coins weight for the plan */ + staking_coin_weights: DecCoinAmino[]; + /** start_time specifies the start time of the plan */ + start_time?: Date; + /** end_time specifies the end time of the plan */ + end_time?: Date; + /** epoch_ratio specifies the distributing amount by ratio */ + epoch_ratio: string; +} +export interface MsgCreateRatioPlanAminoMsg { + type: "/crescent.farming.v1beta1.MsgCreateRatioPlan"; + value: MsgCreateRatioPlanAmino; +} +/** + * MsgCreateRatioPlan defines a SDK message for creating a new ratio farming + * plan. + */ +export interface MsgCreateRatioPlanSDKType { + name: string; + creator: string; + staking_coin_weights: DecCoinSDKType[]; + start_time: Date; + end_time: Date; + epoch_ratio: string; +} +/** + * MsgCreateRatioPlanResponse defines the Msg/MsgCreateRatioPlanResponse + * response type. + */ +export interface MsgCreateRatioPlanResponse {} +export interface MsgCreateRatioPlanResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgCreateRatioPlanResponse"; + value: Uint8Array; +} +/** + * MsgCreateRatioPlanResponse defines the Msg/MsgCreateRatioPlanResponse + * response type. + */ +export interface MsgCreateRatioPlanResponseAmino {} +export interface MsgCreateRatioPlanResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgCreateRatioPlanResponse"; + value: MsgCreateRatioPlanResponseAmino; +} +/** + * MsgCreateRatioPlanResponse defines the Msg/MsgCreateRatioPlanResponse + * response type. + */ +export interface MsgCreateRatioPlanResponseSDKType {} +/** MsgStake defines a SDK message for staking coins into the farming plan. */ +export interface MsgStake { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** staking_coins specifies coins to stake */ + stakingCoins: Coin[]; +} +export interface MsgStakeProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgStake"; + value: Uint8Array; +} +/** MsgStake defines a SDK message for staking coins into the farming plan. */ +export interface MsgStakeAmino { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** staking_coins specifies coins to stake */ + staking_coins: CoinAmino[]; +} +export interface MsgStakeAminoMsg { + type: "/crescent.farming.v1beta1.MsgStake"; + value: MsgStakeAmino; +} +/** MsgStake defines a SDK message for staking coins into the farming plan. */ +export interface MsgStakeSDKType { + farmer: string; + staking_coins: CoinSDKType[]; +} +/** MsgStakeResponse defines the Msg/MsgStakeResponse response type. */ +export interface MsgStakeResponse {} +export interface MsgStakeResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgStakeResponse"; + value: Uint8Array; +} +/** MsgStakeResponse defines the Msg/MsgStakeResponse response type. */ +export interface MsgStakeResponseAmino {} +export interface MsgStakeResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgStakeResponse"; + value: MsgStakeResponseAmino; +} +/** MsgStakeResponse defines the Msg/MsgStakeResponse response type. */ +export interface MsgStakeResponseSDKType {} +/** + * MsgUnstake defines a SDK message for performing unstaking of coins from the + * farming plan. + */ +export interface MsgUnstake { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** unstaking_coins specifies coins to stake */ + unstakingCoins: Coin[]; +} +export interface MsgUnstakeProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgUnstake"; + value: Uint8Array; +} +/** + * MsgUnstake defines a SDK message for performing unstaking of coins from the + * farming plan. + */ +export interface MsgUnstakeAmino { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** unstaking_coins specifies coins to stake */ + unstaking_coins: CoinAmino[]; +} +export interface MsgUnstakeAminoMsg { + type: "/crescent.farming.v1beta1.MsgUnstake"; + value: MsgUnstakeAmino; +} +/** + * MsgUnstake defines a SDK message for performing unstaking of coins from the + * farming plan. + */ +export interface MsgUnstakeSDKType { + farmer: string; + unstaking_coins: CoinSDKType[]; +} +/** MsgUnstakeResponse defines the Msg/MsgUnstakeResponse response type. */ +export interface MsgUnstakeResponse {} +export interface MsgUnstakeResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgUnstakeResponse"; + value: Uint8Array; +} +/** MsgUnstakeResponse defines the Msg/MsgUnstakeResponse response type. */ +export interface MsgUnstakeResponseAmino {} +export interface MsgUnstakeResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgUnstakeResponse"; + value: MsgUnstakeResponseAmino; +} +/** MsgUnstakeResponse defines the Msg/MsgUnstakeResponse response type. */ +export interface MsgUnstakeResponseSDKType {} +/** MsgHarvest defines a SDK message for claiming rewards from the farming plan. */ +export interface MsgHarvest { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** + * staking_coin_denoms is the set of denoms of staked coins as a source of the reward for + * harvesting + */ + stakingCoinDenoms: string[]; +} +export interface MsgHarvestProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgHarvest"; + value: Uint8Array; +} +/** MsgHarvest defines a SDK message for claiming rewards from the farming plan. */ +export interface MsgHarvestAmino { + /** farmer defines the bech32-encoded address of the farmer */ + farmer: string; + /** + * staking_coin_denoms is the set of denoms of staked coins as a source of the reward for + * harvesting + */ + staking_coin_denoms: string[]; +} +export interface MsgHarvestAminoMsg { + type: "/crescent.farming.v1beta1.MsgHarvest"; + value: MsgHarvestAmino; +} +/** MsgHarvest defines a SDK message for claiming rewards from the farming plan. */ +export interface MsgHarvestSDKType { + farmer: string; + staking_coin_denoms: string[]; +} +/** MsgHarvestResponse defines the Msg/MsgHarvestResponse response type. */ +export interface MsgHarvestResponse {} +export interface MsgHarvestResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgHarvestResponse"; + value: Uint8Array; +} +/** MsgHarvestResponse defines the Msg/MsgHarvestResponse response type. */ +export interface MsgHarvestResponseAmino {} +export interface MsgHarvestResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgHarvestResponse"; + value: MsgHarvestResponseAmino; +} +/** MsgHarvestResponse defines the Msg/MsgHarvestResponse response type. */ +export interface MsgHarvestResponseSDKType {} +/** MsgRemovePlan defines a message for removing a terminated plan. */ +export interface MsgRemovePlan { + creator: string; + planId: Long; +} +export interface MsgRemovePlanProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgRemovePlan"; + value: Uint8Array; +} +/** MsgRemovePlan defines a message for removing a terminated plan. */ +export interface MsgRemovePlanAmino { + creator: string; + plan_id: string; +} +export interface MsgRemovePlanAminoMsg { + type: "/crescent.farming.v1beta1.MsgRemovePlan"; + value: MsgRemovePlanAmino; +} +/** MsgRemovePlan defines a message for removing a terminated plan. */ +export interface MsgRemovePlanSDKType { + creator: string; + plan_id: Long; +} +/** MsgRemovePlanResponse defines the Msg/RemovePlan response type. */ +export interface MsgRemovePlanResponse {} +export interface MsgRemovePlanResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgRemovePlanResponse"; + value: Uint8Array; +} +/** MsgRemovePlanResponse defines the Msg/RemovePlan response type. */ +export interface MsgRemovePlanResponseAmino {} +export interface MsgRemovePlanResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgRemovePlanResponse"; + value: MsgRemovePlanResponseAmino; +} +/** MsgRemovePlanResponse defines the Msg/RemovePlan response type. */ +export interface MsgRemovePlanResponseSDKType {} +/** MsgAdvanceEpoch defines a message to advance epoch by one. */ +export interface MsgAdvanceEpoch { + /** requester defines the bech32-encoded address of the requester */ + requester: string; +} +export interface MsgAdvanceEpochProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgAdvanceEpoch"; + value: Uint8Array; +} +/** MsgAdvanceEpoch defines a message to advance epoch by one. */ +export interface MsgAdvanceEpochAmino { + /** requester defines the bech32-encoded address of the requester */ + requester: string; +} +export interface MsgAdvanceEpochAminoMsg { + type: "/crescent.farming.v1beta1.MsgAdvanceEpoch"; + value: MsgAdvanceEpochAmino; +} +/** MsgAdvanceEpoch defines a message to advance epoch by one. */ +export interface MsgAdvanceEpochSDKType { + requester: string; +} +/** MsgAdvanceEpochResponse defines the Msg/AdvanceEpoch response type. */ +export interface MsgAdvanceEpochResponse {} +export interface MsgAdvanceEpochResponseProtoMsg { + typeUrl: "/crescent.farming.v1beta1.MsgAdvanceEpochResponse"; + value: Uint8Array; +} +/** MsgAdvanceEpochResponse defines the Msg/AdvanceEpoch response type. */ +export interface MsgAdvanceEpochResponseAmino {} +export interface MsgAdvanceEpochResponseAminoMsg { + type: "/crescent.farming.v1beta1.MsgAdvanceEpochResponse"; + value: MsgAdvanceEpochResponseAmino; +} +/** MsgAdvanceEpochResponse defines the Msg/AdvanceEpoch response type. */ +export interface MsgAdvanceEpochResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/event.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/event.ts new file mode 100644 index 000000000..d2534e2cb --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/event.ts @@ -0,0 +1,167 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface EventPublicPositionCreated { + publicPositionId: Long; + poolId: Long; + lowerTick: number; + upperTick: number; + minBidAmount: string; + feeRate: string; +} +export interface EventPublicPositionCreatedProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventPublicPositionCreated"; + value: Uint8Array; +} +export interface EventPublicPositionCreatedAmino { + public_position_id: string; + pool_id: string; + lower_tick: number; + upper_tick: number; + min_bid_amount: string; + fee_rate: string; +} +export interface EventPublicPositionCreatedAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventPublicPositionCreated"; + value: EventPublicPositionCreatedAmino; +} +export interface EventPublicPositionCreatedSDKType { + public_position_id: Long; + pool_id: Long; + lower_tick: number; + upper_tick: number; + min_bid_amount: string; + fee_rate: string; +} +export interface EventMintShare { + minter: string; + publicPositionId: Long; + mintedShare: Coin; + liquidity: string; + amount: Coin[]; +} +export interface EventMintShareProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventMintShare"; + value: Uint8Array; +} +export interface EventMintShareAmino { + minter: string; + public_position_id: string; + minted_share?: CoinAmino; + liquidity: string; + amount: CoinAmino[]; +} +export interface EventMintShareAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventMintShare"; + value: EventMintShareAmino; +} +export interface EventMintShareSDKType { + minter: string; + public_position_id: Long; + minted_share: CoinSDKType; + liquidity: string; + amount: CoinSDKType[]; +} +export interface EventBurnShare { + burner: string; + publicPositionId: Long; + share: Coin; + removedLiquidity: string; + amount: Coin[]; +} +export interface EventBurnShareProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventBurnShare"; + value: Uint8Array; +} +export interface EventBurnShareAmino { + burner: string; + public_position_id: string; + share?: CoinAmino; + removed_liquidity: string; + amount: CoinAmino[]; +} +export interface EventBurnShareAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventBurnShare"; + value: EventBurnShareAmino; +} +export interface EventBurnShareSDKType { + burner: string; + public_position_id: Long; + share: CoinSDKType; + removed_liquidity: string; + amount: CoinSDKType[]; +} +export interface EventPlaceBid { + bidder: string; + publicPositionId: Long; + rewardsAuctionId: Long; + share: Coin; +} +export interface EventPlaceBidProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventPlaceBid"; + value: Uint8Array; +} +export interface EventPlaceBidAmino { + bidder: string; + public_position_id: string; + rewards_auction_id: string; + share?: CoinAmino; +} +export interface EventPlaceBidAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventPlaceBid"; + value: EventPlaceBidAmino; +} +export interface EventPlaceBidSDKType { + bidder: string; + public_position_id: Long; + rewards_auction_id: Long; + share: CoinSDKType; +} +export interface EventBidRefunded { + bidder: string; + publicPositionId: Long; + rewardsAuctionId: Long; + share: Coin; +} +export interface EventBidRefundedProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventBidRefunded"; + value: Uint8Array; +} +export interface EventBidRefundedAmino { + bidder: string; + public_position_id: string; + rewards_auction_id: string; + share?: CoinAmino; +} +export interface EventBidRefundedAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventBidRefunded"; + value: EventBidRefundedAmino; +} +export interface EventBidRefundedSDKType { + bidder: string; + public_position_id: Long; + rewards_auction_id: Long; + share: CoinSDKType; +} +export interface EventPublicPositionParameterChanged { + publicPositionId: Long; + minBidAmount: string; + feeRate: string; +} +export interface EventPublicPositionParameterChangedProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.EventPublicPositionParameterChanged"; + value: Uint8Array; +} +export interface EventPublicPositionParameterChangedAmino { + public_position_id: string; + min_bid_amount: string; + fee_rate: string; +} +export interface EventPublicPositionParameterChangedAminoMsg { + type: "/crescent.liquidamm.v1beta1.EventPublicPositionParameterChanged"; + value: EventPublicPositionParameterChangedAmino; +} +export interface EventPublicPositionParameterChangedSDKType { + public_position_id: Long; + min_bid_amount: string; + fee_rate: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/genesis.ts new file mode 100644 index 000000000..48ae3a946 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/genesis.ts @@ -0,0 +1,38 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { PublicPosition, PublicPositionAmino, PublicPositionSDKType, RewardsAuction, RewardsAuctionAmino, RewardsAuctionSDKType, Bid, BidAmino, BidSDKType } from "./liquidamm"; +import { Long } from "../../../helpers"; +/** GenesisState defines the module's genesis state. */ +export interface GenesisState { + params: Params; + lastPublicPositionId: Long; + publicPositions: PublicPosition[]; + rewardsAuctions: RewardsAuction[]; + bids: Bid[]; + nextRewardsAuctionEndTime: Date; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino; + last_public_position_id: string; + public_positions: PublicPositionAmino[]; + rewards_auctions: RewardsAuctionAmino[]; + bids: BidAmino[]; + next_rewards_auction_end_time?: Date; +} +export interface GenesisStateAminoMsg { + type: "/crescent.liquidamm.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_public_position_id: Long; + public_positions: PublicPositionSDKType[]; + rewards_auctions: RewardsAuctionSDKType[]; + bids: BidSDKType[]; + next_rewards_auction_end_time: Date; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/liquidamm.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/liquidamm.ts new file mode 100644 index 000000000..0c7299104 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/liquidamm.ts @@ -0,0 +1,213 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** AuctionStatus enumerates the valid status of an auction. */ +export enum AuctionStatus { + /** AUCTION_STATUS_UNSPECIFIED - AUCTION_STATUS_UNSPECIFIED defines the default auction status */ + AUCTION_STATUS_UNSPECIFIED = 0, + /** AUCTION_STATUS_STARTED - AUCTION_STATUS_STARTED defines the started auction status */ + AUCTION_STATUS_STARTED = 1, + /** AUCTION_STATUS_FINISHED - AUCTION_STATUS_FINISHED defines the finished auction status */ + AUCTION_STATUS_FINISHED = 2, + /** AUCTION_STATUS_SKIPPED - AUCTION_STATUS_SKIPPED defines the skipped auction status */ + AUCTION_STATUS_SKIPPED = 3, + UNRECOGNIZED = -1, +} +export const AuctionStatusSDKType = AuctionStatus; +export const AuctionStatusAmino = AuctionStatus; +export function auctionStatusFromJSON(object: any): AuctionStatus { + switch (object) { + case 0: + case "AUCTION_STATUS_UNSPECIFIED": + return AuctionStatus.AUCTION_STATUS_UNSPECIFIED; + case 1: + case "AUCTION_STATUS_STARTED": + return AuctionStatus.AUCTION_STATUS_STARTED; + case 2: + case "AUCTION_STATUS_FINISHED": + return AuctionStatus.AUCTION_STATUS_FINISHED; + case 3: + case "AUCTION_STATUS_SKIPPED": + return AuctionStatus.AUCTION_STATUS_SKIPPED; + case -1: + case "UNRECOGNIZED": + default: + return AuctionStatus.UNRECOGNIZED; + } +} +export function auctionStatusToJSON(object: AuctionStatus): string { + switch (object) { + case AuctionStatus.AUCTION_STATUS_UNSPECIFIED: + return "AUCTION_STATUS_UNSPECIFIED"; + case AuctionStatus.AUCTION_STATUS_STARTED: + return "AUCTION_STATUS_STARTED"; + case AuctionStatus.AUCTION_STATUS_FINISHED: + return "AUCTION_STATUS_FINISHED"; + case AuctionStatus.AUCTION_STATUS_SKIPPED: + return "AUCTION_STATUS_SKIPPED"; + case AuctionStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * PublicPosition defines public position object that provides auto compounding functionality + * for the amm position and undergoes rewards auction process. + * See the technical spec for more detailed information. + */ +export interface PublicPosition { + id: Long; + poolId: Long; + lowerTick: number; + upperTick: number; + /** bid_reserve_address specifies the account that reserves bidding amounts placed by bidders */ + bidReserveAddress: string; + minBidAmount: string; + feeRate: string; + lastRewardsAuctionId: Long; +} +export interface PublicPositionProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.PublicPosition"; + value: Uint8Array; +} +/** + * PublicPosition defines public position object that provides auto compounding functionality + * for the amm position and undergoes rewards auction process. + * See the technical spec for more detailed information. + */ +export interface PublicPositionAmino { + id: string; + pool_id: string; + lower_tick: number; + upper_tick: number; + /** bid_reserve_address specifies the account that reserves bidding amounts placed by bidders */ + bid_reserve_address: string; + min_bid_amount: string; + fee_rate: string; + last_rewards_auction_id: string; +} +export interface PublicPositionAminoMsg { + type: "/crescent.liquidamm.v1beta1.PublicPosition"; + value: PublicPositionAmino; +} +/** + * PublicPosition defines public position object that provides auto compounding functionality + * for the amm position and undergoes rewards auction process. + * See the technical spec for more detailed information. + */ +export interface PublicPositionSDKType { + id: Long; + pool_id: Long; + lower_tick: number; + upper_tick: number; + bid_reserve_address: string; + min_bid_amount: string; + fee_rate: string; + last_rewards_auction_id: Long; +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuction { + /** public_position_id specifies the public position's id. */ + publicPositionId: Long; + /** id specifies the unique auction id in the public position */ + id: Long; + /** start_time specifies the start time of an auction */ + startTime: Date; + /** end_time specifies the end time of an auction */ + endTime: Date; + /** status specifies the status of an auction */ + status: AuctionStatus; + /** winning_bid specifies the winning bid */ + winningBid: Bid; + /** + * rewards specifies the rewards the winning bidder has received + * the value is determined when an auction is finished + */ + rewards: Coin[]; + fees: Coin[]; +} +export interface RewardsAuctionProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.RewardsAuction"; + value: Uint8Array; +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuctionAmino { + /** public_position_id specifies the public position's id. */ + public_position_id: string; + /** id specifies the unique auction id in the public position */ + id: string; + /** start_time specifies the start time of an auction */ + start_time?: Date; + /** end_time specifies the end time of an auction */ + end_time?: Date; + /** status specifies the status of an auction */ + status: AuctionStatus; + /** winning_bid specifies the winning bid */ + winning_bid?: BidAmino; + /** + * rewards specifies the rewards the winning bidder has received + * the value is determined when an auction is finished + */ + rewards: CoinAmino[]; + fees: CoinAmino[]; +} +export interface RewardsAuctionAminoMsg { + type: "/crescent.liquidamm.v1beta1.RewardsAuction"; + value: RewardsAuctionAmino; +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuctionSDKType { + public_position_id: Long; + id: Long; + start_time: Date; + end_time: Date; + status: AuctionStatus; + winning_bid: BidSDKType; + rewards: CoinSDKType[]; + fees: CoinSDKType[]; +} +/** Bid defines standard bid for a rewards auction. */ +export interface Bid { + /** public_position_id specifies the public position's id */ + publicPositionId: Long; + /** rewards_auction_id specifies the reward auction's id */ + rewardsAuctionId: Long; + /** bidder specifies the bech32-encoded address that places a bid for the auction */ + bidder: string; + /** share specifies the share amount to place a bid */ + share: Coin; +} +export interface BidProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.Bid"; + value: Uint8Array; +} +/** Bid defines standard bid for a rewards auction. */ +export interface BidAmino { + /** public_position_id specifies the public position's id */ + public_position_id: string; + /** rewards_auction_id specifies the reward auction's id */ + rewards_auction_id: string; + /** bidder specifies the bech32-encoded address that places a bid for the auction */ + bidder: string; + /** share specifies the share amount to place a bid */ + share?: CoinAmino; +} +export interface BidAminoMsg { + type: "/crescent.liquidamm.v1beta1.Bid"; + value: BidAmino; +} +/** Bid defines standard bid for a rewards auction. */ +export interface BidSDKType { + public_position_id: Long; + rewards_auction_id: Long; + bidder: string; + share: CoinSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/params.ts new file mode 100644 index 000000000..3baf2a1c3 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/params.ts @@ -0,0 +1,24 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +/** Params defines the parameters for the module. */ +export interface Params { + rewardsAuctionDuration: Duration; + maxNumRecentRewardsAuctions: number; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + rewards_auction_duration?: DurationAmino; + max_num_recent_rewards_auctions: number; +} +export interface ParamsAminoMsg { + type: "/crescent.liquidamm.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + rewards_auction_duration: DurationSDKType; + max_num_recent_rewards_auctions: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/proposal.ts new file mode 100644 index 000000000..530675943 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/proposal.ts @@ -0,0 +1,82 @@ +import { Long } from "../../../helpers"; +export interface PublicPositionCreateProposal { + title: string; + description: string; + poolId: Long; + lowerPrice: string; + upperPrice: string; + minBidAmount: string; + feeRate: string; +} +export interface PublicPositionCreateProposalProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.PublicPositionCreateProposal"; + value: Uint8Array; +} +export interface PublicPositionCreateProposalAmino { + title: string; + description: string; + pool_id: string; + lower_price: string; + upper_price: string; + min_bid_amount: string; + fee_rate: string; +} +export interface PublicPositionCreateProposalAminoMsg { + type: "/crescent.liquidamm.v1beta1.PublicPositionCreateProposal"; + value: PublicPositionCreateProposalAmino; +} +export interface PublicPositionCreateProposalSDKType { + title: string; + description: string; + pool_id: Long; + lower_price: string; + upper_price: string; + min_bid_amount: string; + fee_rate: string; +} +export interface PublicPositionParameterChangeProposal { + title: string; + description: string; + changes: PublicPositionParameterChange[]; +} +export interface PublicPositionParameterChangeProposalProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.PublicPositionParameterChangeProposal"; + value: Uint8Array; +} +export interface PublicPositionParameterChangeProposalAmino { + title: string; + description: string; + changes: PublicPositionParameterChangeAmino[]; +} +export interface PublicPositionParameterChangeProposalAminoMsg { + type: "/crescent.liquidamm.v1beta1.PublicPositionParameterChangeProposal"; + value: PublicPositionParameterChangeProposalAmino; +} +export interface PublicPositionParameterChangeProposalSDKType { + title: string; + description: string; + changes: PublicPositionParameterChangeSDKType[]; +} +export interface PublicPositionParameterChange { + publicPositionId: Long; + minBidAmount: string; + feeRate: string; +} +export interface PublicPositionParameterChangeProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.PublicPositionParameterChange"; + value: Uint8Array; +} +export interface PublicPositionParameterChangeAmino { + public_position_id: string; + min_bid_amount: string; + fee_rate: string; +} +export interface PublicPositionParameterChangeAminoMsg { + type: "/crescent.liquidamm.v1beta1.PublicPositionParameterChange"; + value: PublicPositionParameterChangeAmino; +} +export interface PublicPositionParameterChangeSDKType { + public_position_id: Long; + min_bid_amount: string; + fee_rate: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/tx.ts new file mode 100644 index 000000000..e7effc746 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidamm/v1beta1/tx.ts @@ -0,0 +1,137 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** MsgMintShare defines a SDK message for minting share of public position. */ +export interface MsgMintShare { + sender: string; + publicPositionId: Long; + desiredAmount: Coin[]; +} +export interface MsgMintShareProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgMintShare"; + value: Uint8Array; +} +/** MsgMintShare defines a SDK message for minting share of public position. */ +export interface MsgMintShareAmino { + sender: string; + public_position_id: string; + desired_amount: CoinAmino[]; +} +export interface MsgMintShareAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgMintShare"; + value: MsgMintShareAmino; +} +/** MsgMintShare defines a SDK message for minting share of public position. */ +export interface MsgMintShareSDKType { + sender: string; + public_position_id: Long; + desired_amount: CoinSDKType[]; +} +export interface MsgMintShareResponse { + mintedShare: Coin; + liquidity: string; + amount: Coin[]; +} +export interface MsgMintShareResponseProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgMintShareResponse"; + value: Uint8Array; +} +export interface MsgMintShareResponseAmino { + minted_share?: CoinAmino; + liquidity: string; + amount: CoinAmino[]; +} +export interface MsgMintShareResponseAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgMintShareResponse"; + value: MsgMintShareResponseAmino; +} +export interface MsgMintShareResponseSDKType { + minted_share: CoinSDKType; + liquidity: string; + amount: CoinSDKType[]; +} +/** MsgBurnShare defines a SDK message for burning share of public position. */ +export interface MsgBurnShare { + sender: string; + publicPositionId: Long; + share: Coin; +} +export interface MsgBurnShareProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgBurnShare"; + value: Uint8Array; +} +/** MsgBurnShare defines a SDK message for burning share of public position. */ +export interface MsgBurnShareAmino { + sender: string; + public_position_id: string; + share?: CoinAmino; +} +export interface MsgBurnShareAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgBurnShare"; + value: MsgBurnShareAmino; +} +/** MsgBurnShare defines a SDK message for burning share of public position. */ +export interface MsgBurnShareSDKType { + sender: string; + public_position_id: Long; + share: CoinSDKType; +} +export interface MsgBurnShareResponse { + removedLiquidity: string; + amount: Coin[]; +} +export interface MsgBurnShareResponseProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgBurnShareResponse"; + value: Uint8Array; +} +export interface MsgBurnShareResponseAmino { + removed_liquidity: string; + amount: CoinAmino[]; +} +export interface MsgBurnShareResponseAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgBurnShareResponse"; + value: MsgBurnShareResponseAmino; +} +export interface MsgBurnShareResponseSDKType { + removed_liquidity: string; + amount: CoinSDKType[]; +} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBid { + sender: string; + publicPositionId: Long; + rewardsAuctionId: Long; + share: Coin; +} +export interface MsgPlaceBidProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgPlaceBid"; + value: Uint8Array; +} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBidAmino { + sender: string; + public_position_id: string; + rewards_auction_id: string; + share?: CoinAmino; +} +export interface MsgPlaceBidAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgPlaceBid"; + value: MsgPlaceBidAmino; +} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBidSDKType { + sender: string; + public_position_id: Long; + rewards_auction_id: Long; + share: CoinSDKType; +} +export interface MsgPlaceBidResponse {} +export interface MsgPlaceBidResponseProtoMsg { + typeUrl: "/crescent.liquidamm.v1beta1.MsgPlaceBidResponse"; + value: Uint8Array; +} +export interface MsgPlaceBidResponseAmino {} +export interface MsgPlaceBidResponseAminoMsg { + type: "/crescent.liquidamm.v1beta1.MsgPlaceBidResponse"; + value: MsgPlaceBidResponseAmino; +} +export interface MsgPlaceBidResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/genesis.ts new file mode 100644 index 000000000..b0bd5ecea --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/genesis.ts @@ -0,0 +1,93 @@ +import { Params, ParamsAmino, ParamsSDKType, LiquidFarm, LiquidFarmAmino, LiquidFarmSDKType } from "./params"; +import { RewardsAuction, RewardsAuctionAmino, RewardsAuctionSDKType, Bid, BidAmino, BidSDKType } from "./liquidfarming"; +import { Long } from "../../../helpers"; +/** GenesisState defines the liquidfarming module's genesis state. */ +export interface GenesisState { + params: Params; + lastRewardsAuctionIdRecord: LastRewardsAuctionIdRecord[]; + liquidFarms: LiquidFarm[]; + rewardsAuctions: RewardsAuction[]; + bids: Bid[]; + winningBidRecords: WinningBidRecord[]; + lastRewardsAuctionEndTime: Date; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the liquidfarming module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino; + last_rewards_auction_id_record: LastRewardsAuctionIdRecordAmino[]; + liquid_farms: LiquidFarmAmino[]; + rewards_auctions: RewardsAuctionAmino[]; + bids: BidAmino[]; + winning_bid_records: WinningBidRecordAmino[]; + last_rewards_auction_end_time?: Date; +} +export interface GenesisStateAminoMsg { + type: "/crescent.liquidfarming.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the liquidfarming module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_rewards_auction_id_record: LastRewardsAuctionIdRecordSDKType[]; + liquid_farms: LiquidFarmSDKType[]; + rewards_auctions: RewardsAuctionSDKType[]; + bids: BidSDKType[]; + winning_bid_records: WinningBidRecordSDKType[]; + last_rewards_auction_end_time: Date; +} +export interface LastRewardsAuctionIdRecord { + poolId: Long; + auctionId: Long; +} +export interface LastRewardsAuctionIdRecordProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.LastRewardsAuctionIdRecord"; + value: Uint8Array; +} +export interface LastRewardsAuctionIdRecordAmino { + pool_id: string; + auction_id: string; +} +export interface LastRewardsAuctionIdRecordAminoMsg { + type: "/crescent.liquidfarming.v1beta1.LastRewardsAuctionIdRecord"; + value: LastRewardsAuctionIdRecordAmino; +} +export interface LastRewardsAuctionIdRecordSDKType { + pool_id: Long; + auction_id: Long; +} +/** + * WinningBidRecord defines a custom winning bid record that is required to be recorded + * in genesis state. + */ +export interface WinningBidRecord { + auctionId: Long; + winningBid: Bid; +} +export interface WinningBidRecordProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.WinningBidRecord"; + value: Uint8Array; +} +/** + * WinningBidRecord defines a custom winning bid record that is required to be recorded + * in genesis state. + */ +export interface WinningBidRecordAmino { + auction_id: string; + winning_bid?: BidAmino; +} +export interface WinningBidRecordAminoMsg { + type: "/crescent.liquidfarming.v1beta1.WinningBidRecord"; + value: WinningBidRecordAmino; +} +/** + * WinningBidRecord defines a custom winning bid record that is required to be recorded + * in genesis state. + */ +export interface WinningBidRecordSDKType { + auction_id: Long; + winning_bid: BidSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/liquidfarming.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/liquidfarming.ts new file mode 100644 index 000000000..58727f0b7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/liquidfarming.ts @@ -0,0 +1,206 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** AuctionStatus enumerates the valid status of an auction. */ +export enum AuctionStatus { + /** AUCTION_STATUS_UNSPECIFIED - AUCTION_STATUS_UNSPECIFIED defines the default auction status */ + AUCTION_STATUS_UNSPECIFIED = 0, + /** AUCTION_STATUS_STARTED - AUCTION_STATUS_STARTED defines the started auction status */ + AUCTION_STATUS_STARTED = 1, + /** AUCTION_STATUS_FINISHED - AUCTION_STATUS_FINISHED defines the finished auction status */ + AUCTION_STATUS_FINISHED = 2, + /** AUCTION_STATUS_SKIPPED - AUCTION_STATUS_SKIPPED defines the skipped auction status */ + AUCTION_STATUS_SKIPPED = 3, + UNRECOGNIZED = -1, +} +export const AuctionStatusSDKType = AuctionStatus; +export const AuctionStatusAmino = AuctionStatus; +export function auctionStatusFromJSON(object: any): AuctionStatus { + switch (object) { + case 0: + case "AUCTION_STATUS_UNSPECIFIED": + return AuctionStatus.AUCTION_STATUS_UNSPECIFIED; + case 1: + case "AUCTION_STATUS_STARTED": + return AuctionStatus.AUCTION_STATUS_STARTED; + case 2: + case "AUCTION_STATUS_FINISHED": + return AuctionStatus.AUCTION_STATUS_FINISHED; + case 3: + case "AUCTION_STATUS_SKIPPED": + return AuctionStatus.AUCTION_STATUS_SKIPPED; + case -1: + case "UNRECOGNIZED": + default: + return AuctionStatus.UNRECOGNIZED; + } +} +export function auctionStatusToJSON(object: AuctionStatus): string { + switch (object) { + case AuctionStatus.AUCTION_STATUS_UNSPECIFIED: + return "AUCTION_STATUS_UNSPECIFIED"; + case AuctionStatus.AUCTION_STATUS_STARTED: + return "AUCTION_STATUS_STARTED"; + case AuctionStatus.AUCTION_STATUS_FINISHED: + return "AUCTION_STATUS_FINISHED"; + case AuctionStatus.AUCTION_STATUS_SKIPPED: + return "AUCTION_STATUS_SKIPPED"; + case AuctionStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuction { + /** id specifies the unique auction id */ + id: Long; + /** pool_id specifies the liquidity pool id */ + poolId: Long; + /** bidding_coin_denom specifies the bidding coin denomination */ + biddingCoinDenom: string; + /** paying_reserve_address specfies the account that reserves bidding amounts placed by bidders */ + payingReserveAddress: string; + /** start_time specifies the start time of an auction */ + startTime: Date; + /** end_time specifies the end time of an auction */ + endTime: Date; + /** status specifies the status of an auction */ + status: AuctionStatus; + /** + * winner specifies the bidder who won the auction + * the value is determined when an auction is finished + */ + winner: string; + /** winning_amount specifies the winning amount for the uaction */ + winningAmount: Coin; + /** + * rewards specifies the farming rewards for are accumulated in the farm module + * the value is determined when an auction is finished + */ + rewards: Coin[]; + fees: Coin[]; + feeRate: string; +} +export interface RewardsAuctionProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.RewardsAuction"; + value: Uint8Array; +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuctionAmino { + /** id specifies the unique auction id */ + id: string; + /** pool_id specifies the liquidity pool id */ + pool_id: string; + /** bidding_coin_denom specifies the bidding coin denomination */ + bidding_coin_denom: string; + /** paying_reserve_address specfies the account that reserves bidding amounts placed by bidders */ + paying_reserve_address: string; + /** start_time specifies the start time of an auction */ + start_time?: Date; + /** end_time specifies the end time of an auction */ + end_time?: Date; + /** status specifies the status of an auction */ + status: AuctionStatus; + /** + * winner specifies the bidder who won the auction + * the value is determined when an auction is finished + */ + winner: string; + /** winning_amount specifies the winning amount for the uaction */ + winning_amount?: CoinAmino; + /** + * rewards specifies the farming rewards for are accumulated in the farm module + * the value is determined when an auction is finished + */ + rewards: CoinAmino[]; + fees: CoinAmino[]; + fee_rate: string; +} +export interface RewardsAuctionAminoMsg { + type: "/crescent.liquidfarming.v1beta1.RewardsAuction"; + value: RewardsAuctionAmino; +} +/** + * RewardsAuction defines rewards auction that is created by the module + * for every rewards_auction_duration in params. + */ +export interface RewardsAuctionSDKType { + id: Long; + pool_id: Long; + bidding_coin_denom: string; + paying_reserve_address: string; + start_time: Date; + end_time: Date; + status: AuctionStatus; + winner: string; + winning_amount: CoinSDKType; + rewards: CoinSDKType[]; + fees: CoinSDKType[]; + fee_rate: string; +} +/** + * CompoundingRewards records the amount of pool coin that is used for a bidder to place a bid + * for an auction. It is used internally to calculate unfarm amount. + */ +export interface CompoundingRewards { + amount: string; +} +export interface CompoundingRewardsProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.CompoundingRewards"; + value: Uint8Array; +} +/** + * CompoundingRewards records the amount of pool coin that is used for a bidder to place a bid + * for an auction. It is used internally to calculate unfarm amount. + */ +export interface CompoundingRewardsAmino { + amount: string; +} +export interface CompoundingRewardsAminoMsg { + type: "/crescent.liquidfarming.v1beta1.CompoundingRewards"; + value: CompoundingRewardsAmino; +} +/** + * CompoundingRewards records the amount of pool coin that is used for a bidder to place a bid + * for an auction. It is used internally to calculate unfarm amount. + */ +export interface CompoundingRewardsSDKType { + amount: string; +} +/** Bid defines standard bid for a rewards auction. */ +export interface Bid { + /** pool_id specifies the pool id */ + poolId: Long; + /** bidder specifies the bech32-encoded address that places a bid for the auction */ + bidder: string; + /** amount specifies the amount to place a bid */ + amount: Coin; +} +export interface BidProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.Bid"; + value: Uint8Array; +} +/** Bid defines standard bid for a rewards auction. */ +export interface BidAmino { + /** pool_id specifies the pool id */ + pool_id: string; + /** bidder specifies the bech32-encoded address that places a bid for the auction */ + bidder: string; + /** amount specifies the amount to place a bid */ + amount?: CoinAmino; +} +export interface BidAminoMsg { + type: "/crescent.liquidfarming.v1beta1.Bid"; + value: BidAmino; +} +/** Bid defines standard bid for a rewards auction. */ +export interface BidSDKType { + pool_id: Long; + bidder: string; + amount: CoinSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/params.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/params.ts new file mode 100644 index 000000000..ccbfad47c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/params.ts @@ -0,0 +1,69 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** Params defines the parameters for the module. */ +export interface Params { + feeCollector: string; + rewardsAuctionDuration: Duration; + liquidFarms: LiquidFarm[]; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + fee_collector: string; + rewards_auction_duration?: DurationAmino; + liquid_farms: LiquidFarmAmino[]; +} +export interface ParamsAminoMsg { + type: "/crescent.liquidfarming.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + fee_collector: string; + rewards_auction_duration: DurationSDKType; + liquid_farms: LiquidFarmSDKType[]; +} +/** + * LiquidFarm defines liquid farm object that provides auto compounding functionality + * for the liquidity pool and undergoes farming rewards auction process. + * See the technical spec for more detailed information. + */ +export interface LiquidFarm { + poolId: Long; + minFarmAmount: string; + minBidAmount: string; + feeRate: string; +} +export interface LiquidFarmProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.LiquidFarm"; + value: Uint8Array; +} +/** + * LiquidFarm defines liquid farm object that provides auto compounding functionality + * for the liquidity pool and undergoes farming rewards auction process. + * See the technical spec for more detailed information. + */ +export interface LiquidFarmAmino { + pool_id: string; + min_farm_amount: string; + min_bid_amount: string; + fee_rate: string; +} +export interface LiquidFarmAminoMsg { + type: "/crescent.liquidfarming.v1beta1.LiquidFarm"; + value: LiquidFarmAmino; +} +/** + * LiquidFarm defines liquid farm object that provides auto compounding functionality + * for the liquidity pool and undergoes farming rewards auction process. + * See the technical spec for more detailed information. + */ +export interface LiquidFarmSDKType { + pool_id: Long; + min_farm_amount: string; + min_bid_amount: string; + fee_rate: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/tx.ts new file mode 100644 index 000000000..f5d9e177e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidfarming/v1beta1/tx.ts @@ -0,0 +1,241 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** MsgLiquidFarm defines a SDK message for farming pool coin for a liquid farm. */ +export interface MsgLiquidFarm { + poolId: Long; + farmer: string; + farmingCoin: Coin; +} +export interface MsgLiquidFarmProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidFarm"; + value: Uint8Array; +} +/** MsgLiquidFarm defines a SDK message for farming pool coin for a liquid farm. */ +export interface MsgLiquidFarmAmino { + pool_id: string; + farmer: string; + farming_coin?: CoinAmino; +} +export interface MsgLiquidFarmAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidFarm"; + value: MsgLiquidFarmAmino; +} +/** MsgLiquidFarm defines a SDK message for farming pool coin for a liquid farm. */ +export interface MsgLiquidFarmSDKType { + pool_id: Long; + farmer: string; + farming_coin: CoinSDKType; +} +/** MsgLiquidFarmResponse defines the MsgLiquidFarmResponse response type. */ +export interface MsgLiquidFarmResponse {} +export interface MsgLiquidFarmResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidFarmResponse"; + value: Uint8Array; +} +/** MsgLiquidFarmResponse defines the MsgLiquidFarmResponse response type. */ +export interface MsgLiquidFarmResponseAmino {} +export interface MsgLiquidFarmResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidFarmResponse"; + value: MsgLiquidFarmResponseAmino; +} +/** MsgLiquidFarmResponse defines the MsgLiquidFarmResponse response type. */ +export interface MsgLiquidFarmResponseSDKType {} +/** MsgLiquidUnfarm defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarm { + poolId: Long; + farmer: string; + unfarmingCoin: Coin; +} +export interface MsgLiquidUnfarmProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarm"; + value: Uint8Array; +} +/** MsgLiquidUnfarm defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarmAmino { + pool_id: string; + farmer: string; + unfarming_coin?: CoinAmino; +} +export interface MsgLiquidUnfarmAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarm"; + value: MsgLiquidUnfarmAmino; +} +/** MsgLiquidUnfarm defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarmSDKType { + pool_id: Long; + farmer: string; + unfarming_coin: CoinSDKType; +} +/** MsgLiquidUnfarmResponse defines the MsgLiquidUnfarmResponse response type. */ +export interface MsgLiquidUnfarmResponse {} +export interface MsgLiquidUnfarmResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmResponse"; + value: Uint8Array; +} +/** MsgLiquidUnfarmResponse defines the MsgLiquidUnfarmResponse response type. */ +export interface MsgLiquidUnfarmResponseAmino {} +export interface MsgLiquidUnfarmResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmResponse"; + value: MsgLiquidUnfarmResponseAmino; +} +/** MsgLiquidUnfarmResponse defines the MsgLiquidUnfarmResponse response type. */ +export interface MsgLiquidUnfarmResponseSDKType {} +/** MsgLiquidUnfarmAndWithdraw defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarmAndWithdraw { + poolId: Long; + farmer: string; + unfarmingCoin: Coin; +} +export interface MsgLiquidUnfarmAndWithdrawProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmAndWithdraw"; + value: Uint8Array; +} +/** MsgLiquidUnfarmAndWithdraw defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarmAndWithdrawAmino { + pool_id: string; + farmer: string; + unfarming_coin?: CoinAmino; +} +export interface MsgLiquidUnfarmAndWithdrawAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmAndWithdraw"; + value: MsgLiquidUnfarmAndWithdrawAmino; +} +/** MsgLiquidUnfarmAndWithdraw defines a SDK message for unfarming LFCoin. */ +export interface MsgLiquidUnfarmAndWithdrawSDKType { + pool_id: Long; + farmer: string; + unfarming_coin: CoinSDKType; +} +/** MsgLiquidUnfarmAndWithdrawResponse defines the MsgLiquidUnfarmAndWithdrawResponse response type. */ +export interface MsgLiquidUnfarmAndWithdrawResponse {} +export interface MsgLiquidUnfarmAndWithdrawResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmAndWithdrawResponse"; + value: Uint8Array; +} +/** MsgLiquidUnfarmAndWithdrawResponse defines the MsgLiquidUnfarmAndWithdrawResponse response type. */ +export interface MsgLiquidUnfarmAndWithdrawResponseAmino {} +export interface MsgLiquidUnfarmAndWithdrawResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgLiquidUnfarmAndWithdrawResponse"; + value: MsgLiquidUnfarmAndWithdrawResponseAmino; +} +/** MsgLiquidUnfarmAndWithdrawResponse defines the MsgLiquidUnfarmAndWithdrawResponse response type. */ +export interface MsgLiquidUnfarmAndWithdrawResponseSDKType {} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBid { + auctionId: Long; + poolId: Long; + bidder: string; + biddingCoin: Coin; +} +export interface MsgPlaceBidProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgPlaceBid"; + value: Uint8Array; +} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBidAmino { + auction_id: string; + pool_id: string; + bidder: string; + bidding_coin?: CoinAmino; +} +export interface MsgPlaceBidAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgPlaceBid"; + value: MsgPlaceBidAmino; +} +/** MsgPlaceBid defines a SDK message for placing a bid for a rewards auction. */ +export interface MsgPlaceBidSDKType { + auction_id: Long; + pool_id: Long; + bidder: string; + bidding_coin: CoinSDKType; +} +/** MsgPlaceBidResponse defines the MsgPlaceBidResponse response type. */ +export interface MsgPlaceBidResponse {} +export interface MsgPlaceBidResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgPlaceBidResponse"; + value: Uint8Array; +} +/** MsgPlaceBidResponse defines the MsgPlaceBidResponse response type. */ +export interface MsgPlaceBidResponseAmino {} +export interface MsgPlaceBidResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgPlaceBidResponse"; + value: MsgPlaceBidResponseAmino; +} +/** MsgPlaceBidResponse defines the MsgPlaceBidResponse response type. */ +export interface MsgPlaceBidResponseSDKType {} +/** MsgRefundBid defines a SDK message for refunding the bid that is not winning for the auction. */ +export interface MsgRefundBid { + auctionId: Long; + poolId: Long; + bidder: string; +} +export interface MsgRefundBidProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgRefundBid"; + value: Uint8Array; +} +/** MsgRefundBid defines a SDK message for refunding the bid that is not winning for the auction. */ +export interface MsgRefundBidAmino { + auction_id: string; + pool_id: string; + bidder: string; +} +export interface MsgRefundBidAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgRefundBid"; + value: MsgRefundBidAmino; +} +/** MsgRefundBid defines a SDK message for refunding the bid that is not winning for the auction. */ +export interface MsgRefundBidSDKType { + auction_id: Long; + pool_id: Long; + bidder: string; +} +/** MsgRefundBidResponse defines the MsgRefundBidResponse response type. */ +export interface MsgRefundBidResponse {} +export interface MsgRefundBidResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgRefundBidResponse"; + value: Uint8Array; +} +/** MsgRefundBidResponse defines the MsgRefundBidResponse response type. */ +export interface MsgRefundBidResponseAmino {} +export interface MsgRefundBidResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgRefundBidResponse"; + value: MsgRefundBidResponseAmino; +} +/** MsgRefundBidResponse defines the MsgRefundBidResponse response type. */ +export interface MsgRefundBidResponseSDKType {} +/** MsgAdvanceAuction defines a message to advance rewards auction by one. */ +export interface MsgAdvanceAuction { + /** requester defines the bech32-encoded address of the requester */ + requester: string; +} +export interface MsgAdvanceAuctionProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgAdvanceAuction"; + value: Uint8Array; +} +/** MsgAdvanceAuction defines a message to advance rewards auction by one. */ +export interface MsgAdvanceAuctionAmino { + /** requester defines the bech32-encoded address of the requester */ + requester: string; +} +export interface MsgAdvanceAuctionAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgAdvanceAuction"; + value: MsgAdvanceAuctionAmino; +} +/** MsgAdvanceAuction defines a message to advance rewards auction by one. */ +export interface MsgAdvanceAuctionSDKType { + requester: string; +} +/** MsgAdvanceAuctionResponse defines the Msg/AdvanceAuction response type. */ +export interface MsgAdvanceAuctionResponse {} +export interface MsgAdvanceAuctionResponseProtoMsg { + typeUrl: "/crescent.liquidfarming.v1beta1.MsgAdvanceAuctionResponse"; + value: Uint8Array; +} +/** MsgAdvanceAuctionResponse defines the Msg/AdvanceAuction response type. */ +export interface MsgAdvanceAuctionResponseAmino {} +export interface MsgAdvanceAuctionResponseAminoMsg { + type: "/crescent.liquidfarming.v1beta1.MsgAdvanceAuctionResponse"; + value: MsgAdvanceAuctionResponseAmino; +} +/** MsgAdvanceAuctionResponse defines the Msg/AdvanceAuction response type. */ +export interface MsgAdvanceAuctionResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/genesis.ts new file mode 100644 index 000000000..a9157a85a --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/genesis.ts @@ -0,0 +1,81 @@ +import { Params, ParamsAmino, ParamsSDKType, Pair, PairAmino, PairSDKType, Pool, PoolAmino, PoolSDKType, DepositRequest, DepositRequestAmino, DepositRequestSDKType, WithdrawRequest, WithdrawRequestAmino, WithdrawRequestSDKType, Order, OrderAmino, OrderSDKType } from "./liquidity"; +import { Long } from "../../../helpers"; +/** GenesisState defines the liquidity module's genesis state. */ +export interface GenesisState { + params: Params; + lastPairId: Long; + lastPoolId: Long; + pairs: Pair[]; + pools: Pool[]; + depositRequests: DepositRequest[]; + withdrawRequests: WithdrawRequest[]; + orders: Order[]; + numMarketMakingOrdersRecords: NumMMOrdersRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the liquidity module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino; + last_pair_id: string; + last_pool_id: string; + pairs: PairAmino[]; + pools: PoolAmino[]; + deposit_requests: DepositRequestAmino[]; + withdraw_requests: WithdrawRequestAmino[]; + orders: OrderAmino[]; + num_market_making_orders_records: NumMMOrdersRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.liquidity.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the liquidity module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_pair_id: Long; + last_pool_id: Long; + pairs: PairSDKType[]; + pools: PoolSDKType[]; + deposit_requests: DepositRequestSDKType[]; + withdraw_requests: WithdrawRequestSDKType[]; + orders: OrderSDKType[]; + num_market_making_orders_records: NumMMOrdersRecordSDKType[]; +} +/** + * NumMMOrdersRecord holds information about how many MM orders an orderer + * ordered per pair. + */ +export interface NumMMOrdersRecord { + orderer: string; + pairId: Long; + numMarketMakingOrders: number; +} +export interface NumMMOrdersRecordProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.NumMMOrdersRecord"; + value: Uint8Array; +} +/** + * NumMMOrdersRecord holds information about how many MM orders an orderer + * ordered per pair. + */ +export interface NumMMOrdersRecordAmino { + orderer: string; + pair_id: string; + num_market_making_orders: number; +} +export interface NumMMOrdersRecordAminoMsg { + type: "/crescent.liquidity.v1beta1.NumMMOrdersRecord"; + value: NumMMOrdersRecordAmino; +} +/** + * NumMMOrdersRecord holds information about how many MM orders an orderer + * ordered per pair. + */ +export interface NumMMOrdersRecordSDKType { + orderer: string; + pair_id: Long; + num_market_making_orders: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/liquidity.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/liquidity.ts new file mode 100644 index 000000000..3e5cc8bc7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/liquidity.ts @@ -0,0 +1,608 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** PoolType enumerates pool types. */ +export enum PoolType { + /** POOL_TYPE_UNSPECIFIED - POOL_TYPE_UNSPECIFIED specifies unknown pool type */ + POOL_TYPE_UNSPECIFIED = 0, + /** POOL_TYPE_BASIC - POOL_TYPE_BASIC specifies the basic pool type */ + POOL_TYPE_BASIC = 1, + /** POOL_TYPE_RANGED - POOL_TYPE_RANGED specifies the ranged pool type */ + POOL_TYPE_RANGED = 2, + UNRECOGNIZED = -1, +} +export const PoolTypeSDKType = PoolType; +export const PoolTypeAmino = PoolType; +export function poolTypeFromJSON(object: any): PoolType { + switch (object) { + case 0: + case "POOL_TYPE_UNSPECIFIED": + return PoolType.POOL_TYPE_UNSPECIFIED; + case 1: + case "POOL_TYPE_BASIC": + return PoolType.POOL_TYPE_BASIC; + case 2: + case "POOL_TYPE_RANGED": + return PoolType.POOL_TYPE_RANGED; + case -1: + case "UNRECOGNIZED": + default: + return PoolType.UNRECOGNIZED; + } +} +export function poolTypeToJSON(object: PoolType): string { + switch (object) { + case PoolType.POOL_TYPE_UNSPECIFIED: + return "POOL_TYPE_UNSPECIFIED"; + case PoolType.POOL_TYPE_BASIC: + return "POOL_TYPE_BASIC"; + case PoolType.POOL_TYPE_RANGED: + return "POOL_TYPE_RANGED"; + case PoolType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderType enumerates order types. */ +export enum OrderType { + /** ORDER_TYPE_UNSPECIFIED - ORDER_TYPE_UNSPECIFIED specifies unknown order type. */ + ORDER_TYPE_UNSPECIFIED = 0, + /** ORDER_TYPE_LIMIT - ORDER_TYPE_LIMIT specifies limit order type. */ + ORDER_TYPE_LIMIT = 1, + /** ORDER_TYPE_MARKET - ORDER_TYPE_MARKET specifies market order type. */ + ORDER_TYPE_MARKET = 2, + /** ORDER_TYPE_MM - ORDER_TYPE_MM specifies MM(market making) order type. */ + ORDER_TYPE_MM = 3, + UNRECOGNIZED = -1, +} +export const OrderTypeSDKType = OrderType; +export const OrderTypeAmino = OrderType; +export function orderTypeFromJSON(object: any): OrderType { + switch (object) { + case 0: + case "ORDER_TYPE_UNSPECIFIED": + return OrderType.ORDER_TYPE_UNSPECIFIED; + case 1: + case "ORDER_TYPE_LIMIT": + return OrderType.ORDER_TYPE_LIMIT; + case 2: + case "ORDER_TYPE_MARKET": + return OrderType.ORDER_TYPE_MARKET; + case 3: + case "ORDER_TYPE_MM": + return OrderType.ORDER_TYPE_MM; + case -1: + case "UNRECOGNIZED": + default: + return OrderType.UNRECOGNIZED; + } +} +export function orderTypeToJSON(object: OrderType): string { + switch (object) { + case OrderType.ORDER_TYPE_UNSPECIFIED: + return "ORDER_TYPE_UNSPECIFIED"; + case OrderType.ORDER_TYPE_LIMIT: + return "ORDER_TYPE_LIMIT"; + case OrderType.ORDER_TYPE_MARKET: + return "ORDER_TYPE_MARKET"; + case OrderType.ORDER_TYPE_MM: + return "ORDER_TYPE_MM"; + case OrderType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderDirection enumerates order directions. */ +export enum OrderDirection { + /** ORDER_DIRECTION_UNSPECIFIED - ORDER_DIRECTION_UNSPECIFIED specifies unknown order direction */ + ORDER_DIRECTION_UNSPECIFIED = 0, + /** ORDER_DIRECTION_BUY - ORDER_DIRECTION_BUY specifies buy(swap quote coin to base coin) order direction */ + ORDER_DIRECTION_BUY = 1, + /** ORDER_DIRECTION_SELL - ORDER_DIRECTION_SELL specifies sell(swap base coin to quote coin) order direction */ + ORDER_DIRECTION_SELL = 2, + UNRECOGNIZED = -1, +} +export const OrderDirectionSDKType = OrderDirection; +export const OrderDirectionAmino = OrderDirection; +export function orderDirectionFromJSON(object: any): OrderDirection { + switch (object) { + case 0: + case "ORDER_DIRECTION_UNSPECIFIED": + return OrderDirection.ORDER_DIRECTION_UNSPECIFIED; + case 1: + case "ORDER_DIRECTION_BUY": + return OrderDirection.ORDER_DIRECTION_BUY; + case 2: + case "ORDER_DIRECTION_SELL": + return OrderDirection.ORDER_DIRECTION_SELL; + case -1: + case "UNRECOGNIZED": + default: + return OrderDirection.UNRECOGNIZED; + } +} +export function orderDirectionToJSON(object: OrderDirection): string { + switch (object) { + case OrderDirection.ORDER_DIRECTION_UNSPECIFIED: + return "ORDER_DIRECTION_UNSPECIFIED"; + case OrderDirection.ORDER_DIRECTION_BUY: + return "ORDER_DIRECTION_BUY"; + case OrderDirection.ORDER_DIRECTION_SELL: + return "ORDER_DIRECTION_SELL"; + case OrderDirection.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** RequestStatus enumerates request statuses. */ +export enum RequestStatus { + /** REQUEST_STATUS_UNSPECIFIED - REQUEST_STATUS_UNSPECIFIED specifies unknown request status */ + REQUEST_STATUS_UNSPECIFIED = 0, + /** REQUEST_STATUS_NOT_EXECUTED - REQUEST_STATUS_NOT_EXECUTED indicates the request is not executed yet */ + REQUEST_STATUS_NOT_EXECUTED = 1, + /** REQUEST_STATUS_SUCCEEDED - REQUEST_STATUS_SUCCEEDED indicates the request has been succeeded */ + REQUEST_STATUS_SUCCEEDED = 2, + /** REQUEST_STATUS_FAILED - REQUEST_STATUS_FAILED indicates the request is failed */ + REQUEST_STATUS_FAILED = 3, + UNRECOGNIZED = -1, +} +export const RequestStatusSDKType = RequestStatus; +export const RequestStatusAmino = RequestStatus; +export function requestStatusFromJSON(object: any): RequestStatus { + switch (object) { + case 0: + case "REQUEST_STATUS_UNSPECIFIED": + return RequestStatus.REQUEST_STATUS_UNSPECIFIED; + case 1: + case "REQUEST_STATUS_NOT_EXECUTED": + return RequestStatus.REQUEST_STATUS_NOT_EXECUTED; + case 2: + case "REQUEST_STATUS_SUCCEEDED": + return RequestStatus.REQUEST_STATUS_SUCCEEDED; + case 3: + case "REQUEST_STATUS_FAILED": + return RequestStatus.REQUEST_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return RequestStatus.UNRECOGNIZED; + } +} +export function requestStatusToJSON(object: RequestStatus): string { + switch (object) { + case RequestStatus.REQUEST_STATUS_UNSPECIFIED: + return "REQUEST_STATUS_UNSPECIFIED"; + case RequestStatus.REQUEST_STATUS_NOT_EXECUTED: + return "REQUEST_STATUS_NOT_EXECUTED"; + case RequestStatus.REQUEST_STATUS_SUCCEEDED: + return "REQUEST_STATUS_SUCCEEDED"; + case RequestStatus.REQUEST_STATUS_FAILED: + return "REQUEST_STATUS_FAILED"; + case RequestStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderStatus enumerates order statuses. */ +export enum OrderStatus { + /** ORDER_STATUS_UNSPECIFIED - ORDER_STATUS_UNSPECIFIED specifies unknown order status */ + ORDER_STATUS_UNSPECIFIED = 0, + /** ORDER_STATUS_NOT_EXECUTED - ORDER_STATUS_NOT_EXECUTED indicates the order has not been executed yet */ + ORDER_STATUS_NOT_EXECUTED = 1, + /** ORDER_STATUS_NOT_MATCHED - ORDER_STATUS_NOT_MATCHED indicates the order has been executed but has no match */ + ORDER_STATUS_NOT_MATCHED = 2, + /** ORDER_STATUS_PARTIALLY_MATCHED - ORDER_STATUS_PARTIALLY_MATCHED indicates the order has been partially matched */ + ORDER_STATUS_PARTIALLY_MATCHED = 3, + /** ORDER_STATUS_COMPLETED - ORDER_STATUS_COMPLETED indicates the order has been fully matched and completed */ + ORDER_STATUS_COMPLETED = 4, + /** ORDER_STATUS_CANCELED - ORDER_STATUS_CANCELED indicates the order has been canceled */ + ORDER_STATUS_CANCELED = 5, + /** ORDER_STATUS_EXPIRED - ORDER_STATUS_EXPIRED indicates the order has been expired */ + ORDER_STATUS_EXPIRED = 6, + UNRECOGNIZED = -1, +} +export const OrderStatusSDKType = OrderStatus; +export const OrderStatusAmino = OrderStatus; +export function orderStatusFromJSON(object: any): OrderStatus { + switch (object) { + case 0: + case "ORDER_STATUS_UNSPECIFIED": + return OrderStatus.ORDER_STATUS_UNSPECIFIED; + case 1: + case "ORDER_STATUS_NOT_EXECUTED": + return OrderStatus.ORDER_STATUS_NOT_EXECUTED; + case 2: + case "ORDER_STATUS_NOT_MATCHED": + return OrderStatus.ORDER_STATUS_NOT_MATCHED; + case 3: + case "ORDER_STATUS_PARTIALLY_MATCHED": + return OrderStatus.ORDER_STATUS_PARTIALLY_MATCHED; + case 4: + case "ORDER_STATUS_COMPLETED": + return OrderStatus.ORDER_STATUS_COMPLETED; + case 5: + case "ORDER_STATUS_CANCELED": + return OrderStatus.ORDER_STATUS_CANCELED; + case 6: + case "ORDER_STATUS_EXPIRED": + return OrderStatus.ORDER_STATUS_EXPIRED; + case -1: + case "UNRECOGNIZED": + default: + return OrderStatus.UNRECOGNIZED; + } +} +export function orderStatusToJSON(object: OrderStatus): string { + switch (object) { + case OrderStatus.ORDER_STATUS_UNSPECIFIED: + return "ORDER_STATUS_UNSPECIFIED"; + case OrderStatus.ORDER_STATUS_NOT_EXECUTED: + return "ORDER_STATUS_NOT_EXECUTED"; + case OrderStatus.ORDER_STATUS_NOT_MATCHED: + return "ORDER_STATUS_NOT_MATCHED"; + case OrderStatus.ORDER_STATUS_PARTIALLY_MATCHED: + return "ORDER_STATUS_PARTIALLY_MATCHED"; + case OrderStatus.ORDER_STATUS_COMPLETED: + return "ORDER_STATUS_COMPLETED"; + case OrderStatus.ORDER_STATUS_CANCELED: + return "ORDER_STATUS_CANCELED"; + case OrderStatus.ORDER_STATUS_EXPIRED: + return "ORDER_STATUS_EXPIRED"; + case OrderStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Params defines the parameters for the liquidity module. */ +export interface Params { + batchSize: number; + tickPrecision: number; + feeCollectorAddress: string; + dustCollectorAddress: string; + minInitialPoolCoinSupply: string; + pairCreationFee: Coin[]; + poolCreationFee: Coin[]; + minInitialDepositAmount: string; + maxPriceLimitRatio: string; + maxNumMarketMakingOrderTicks: number; + maxNumMarketMakingOrdersPerPair: number; + maxOrderLifespan: Duration; + swapFeeRate: string; + withdrawFeeRate: string; + depositExtraGas: Long; + withdrawExtraGas: Long; + orderExtraGas: Long; + maxNumActivePoolsPerPair: number; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the liquidity module. */ +export interface ParamsAmino { + batch_size: number; + tick_precision: number; + fee_collector_address: string; + dust_collector_address: string; + min_initial_pool_coin_supply: string; + pair_creation_fee: CoinAmino[]; + pool_creation_fee: CoinAmino[]; + min_initial_deposit_amount: string; + max_price_limit_ratio: string; + max_num_market_making_order_ticks: number; + max_num_market_making_orders_per_pair: number; + max_order_lifespan?: DurationAmino; + swap_fee_rate: string; + withdraw_fee_rate: string; + deposit_extra_gas: string; + withdraw_extra_gas: string; + order_extra_gas: string; + max_num_active_pools_per_pair: number; +} +export interface ParamsAminoMsg { + type: "/crescent.liquidity.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the liquidity module. */ +export interface ParamsSDKType { + batch_size: number; + tick_precision: number; + fee_collector_address: string; + dust_collector_address: string; + min_initial_pool_coin_supply: string; + pair_creation_fee: CoinSDKType[]; + pool_creation_fee: CoinSDKType[]; + min_initial_deposit_amount: string; + max_price_limit_ratio: string; + max_num_market_making_order_ticks: number; + max_num_market_making_orders_per_pair: number; + max_order_lifespan: DurationSDKType; + swap_fee_rate: string; + withdraw_fee_rate: string; + deposit_extra_gas: Long; + withdraw_extra_gas: Long; + order_extra_gas: Long; + max_num_active_pools_per_pair: number; +} +/** Pair defines a coin pair. */ +export interface Pair { + id: Long; + baseCoinDenom: string; + quoteCoinDenom: string; + escrowAddress: string; + lastOrderId: Long; + lastPrice: string; + currentBatchId: Long; +} +export interface PairProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.Pair"; + value: Uint8Array; +} +/** Pair defines a coin pair. */ +export interface PairAmino { + id: string; + base_coin_denom: string; + quote_coin_denom: string; + escrow_address: string; + last_order_id: string; + last_price: string; + current_batch_id: string; +} +export interface PairAminoMsg { + type: "/crescent.liquidity.v1beta1.Pair"; + value: PairAmino; +} +/** Pair defines a coin pair. */ +export interface PairSDKType { + id: Long; + base_coin_denom: string; + quote_coin_denom: string; + escrow_address: string; + last_order_id: Long; + last_price: string; + current_batch_id: Long; +} +/** + * Pool defines generic liquidity pool object which can be either a basic pool or a + * ranged pool. + */ +export interface Pool { + type: PoolType; + id: Long; + pairId: Long; + creator: string; + reserveAddress: string; + poolCoinDenom: string; + minPrice: string; + maxPrice: string; + lastDepositRequestId: Long; + lastWithdrawRequestId: Long; + disabled: boolean; +} +export interface PoolProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.Pool"; + value: Uint8Array; +} +/** + * Pool defines generic liquidity pool object which can be either a basic pool or a + * ranged pool. + */ +export interface PoolAmino { + type: PoolType; + id: string; + pair_id: string; + creator: string; + reserve_address: string; + pool_coin_denom: string; + min_price: string; + max_price: string; + last_deposit_request_id: string; + last_withdraw_request_id: string; + disabled: boolean; +} +export interface PoolAminoMsg { + type: "/crescent.liquidity.v1beta1.Pool"; + value: PoolAmino; +} +/** + * Pool defines generic liquidity pool object which can be either a basic pool or a + * ranged pool. + */ +export interface PoolSDKType { + type: PoolType; + id: Long; + pair_id: Long; + creator: string; + reserve_address: string; + pool_coin_denom: string; + min_price: string; + max_price: string; + last_deposit_request_id: Long; + last_withdraw_request_id: Long; + disabled: boolean; +} +/** DepositRequest defines a deposit request. */ +export interface DepositRequest { + /** id specifies the id for the request */ + id: Long; + /** pool_id specifies the pool id */ + poolId: Long; + /** msg_height specifies the block height when the request is stored for the batch execution */ + msgHeight: Long; + /** depositor specifies the bech32-encoded address that makes a deposit to the pool */ + depositor: string; + /** deposit_coins specifies the amount of coins to deposit. */ + depositCoins: Coin[]; + /** accepted_coins specifies the amount of coins that are accepted. */ + acceptedCoins: Coin[]; + mintedPoolCoin: Coin; + status: RequestStatus; +} +export interface DepositRequestProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.DepositRequest"; + value: Uint8Array; +} +/** DepositRequest defines a deposit request. */ +export interface DepositRequestAmino { + /** id specifies the id for the request */ + id: string; + /** pool_id specifies the pool id */ + pool_id: string; + /** msg_height specifies the block height when the request is stored for the batch execution */ + msg_height: string; + /** depositor specifies the bech32-encoded address that makes a deposit to the pool */ + depositor: string; + /** deposit_coins specifies the amount of coins to deposit. */ + deposit_coins: CoinAmino[]; + /** accepted_coins specifies the amount of coins that are accepted. */ + accepted_coins: CoinAmino[]; + minted_pool_coin?: CoinAmino; + status: RequestStatus; +} +export interface DepositRequestAminoMsg { + type: "/crescent.liquidity.v1beta1.DepositRequest"; + value: DepositRequestAmino; +} +/** DepositRequest defines a deposit request. */ +export interface DepositRequestSDKType { + id: Long; + pool_id: Long; + msg_height: Long; + depositor: string; + deposit_coins: CoinSDKType[]; + accepted_coins: CoinSDKType[]; + minted_pool_coin: CoinSDKType; + status: RequestStatus; +} +/** WithdrawRequest defines a withdraw request. */ +export interface WithdrawRequest { + /** id specifies the id for the request */ + id: Long; + /** pool_id specifies the pool id */ + poolId: Long; + /** msg_height specifies the block height when the request is stored for the batch execution */ + msgHeight: Long; + /** withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool */ + withdrawer: string; + /** pool_coin specifies the pool coin that is a proof of liquidity provider for the pool */ + poolCoin: Coin; + /** withdrawn_coins specifies the amount of coins that are withdrawn. */ + withdrawnCoins: Coin[]; + status: RequestStatus; +} +export interface WithdrawRequestProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.WithdrawRequest"; + value: Uint8Array; +} +/** WithdrawRequest defines a withdraw request. */ +export interface WithdrawRequestAmino { + /** id specifies the id for the request */ + id: string; + /** pool_id specifies the pool id */ + pool_id: string; + /** msg_height specifies the block height when the request is stored for the batch execution */ + msg_height: string; + /** withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool */ + withdrawer: string; + /** pool_coin specifies the pool coin that is a proof of liquidity provider for the pool */ + pool_coin?: CoinAmino; + /** withdrawn_coins specifies the amount of coins that are withdrawn. */ + withdrawn_coins: CoinAmino[]; + status: RequestStatus; +} +export interface WithdrawRequestAminoMsg { + type: "/crescent.liquidity.v1beta1.WithdrawRequest"; + value: WithdrawRequestAmino; +} +/** WithdrawRequest defines a withdraw request. */ +export interface WithdrawRequestSDKType { + id: Long; + pool_id: Long; + msg_height: Long; + withdrawer: string; + pool_coin: CoinSDKType; + withdrawn_coins: CoinSDKType[]; + status: RequestStatus; +} +/** Order defines an order. */ +export interface Order { + /** type specifies the typo of the order */ + type: OrderType; + /** id specifies the id of the order */ + id: Long; + /** pair_id specifies the pair id */ + pairId: Long; + /** msg_height specifies the block height when the order is stored for the batch execution */ + msgHeight: Long; + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** direction specifies the order direction; either buy or sell */ + direction: OrderDirection; + offerCoin: Coin; + /** remaining_offer_coin specifies the remaining offer coin */ + remainingOfferCoin: Coin; + /** received_coin specifies the received coin after the swap */ + receivedCoin: Coin; + /** price specifies the price that an orderer is willing to swap */ + price: string; + amount: string; + openAmount: string; + /** batch_id specifies the pair's batch id when the request is stored */ + batchId: Long; + expireAt: Date; + status: OrderStatus; +} +export interface OrderProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.Order"; + value: Uint8Array; +} +/** Order defines an order. */ +export interface OrderAmino { + /** type specifies the typo of the order */ + type: OrderType; + /** id specifies the id of the order */ + id: string; + /** pair_id specifies the pair id */ + pair_id: string; + /** msg_height specifies the block height when the order is stored for the batch execution */ + msg_height: string; + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** direction specifies the order direction; either buy or sell */ + direction: OrderDirection; + offer_coin?: CoinAmino; + /** remaining_offer_coin specifies the remaining offer coin */ + remaining_offer_coin?: CoinAmino; + /** received_coin specifies the received coin after the swap */ + received_coin?: CoinAmino; + /** price specifies the price that an orderer is willing to swap */ + price: string; + amount: string; + open_amount: string; + /** batch_id specifies the pair's batch id when the request is stored */ + batch_id: string; + expire_at?: Date; + status: OrderStatus; +} +export interface OrderAminoMsg { + type: "/crescent.liquidity.v1beta1.Order"; + value: OrderAmino; +} +/** Order defines an order. */ +export interface OrderSDKType { + type: OrderType; + id: Long; + pair_id: Long; + msg_height: Long; + orderer: string; + direction: OrderDirection; + offer_coin: CoinSDKType; + remaining_offer_coin: CoinSDKType; + received_coin: CoinSDKType; + price: string; + amount: string; + open_amount: string; + batch_id: Long; + expire_at: Date; + status: OrderStatus; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/tx.ts new file mode 100644 index 000000000..bef5bcfc6 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidity/v1beta1/tx.ts @@ -0,0 +1,535 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { OrderDirection } from "./liquidity"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +/** MsgCreatePair defines an SDK message for creating a pair. */ +export interface MsgCreatePair { + /** creator specifies the bech32-encoded address that is the pair creator. */ + creator: string; + /** base_coin_denom specifies the base coin denom of the pair. */ + baseCoinDenom: string; + /** quote_coin_denom specifies the quote coin denom of the pair. */ + quoteCoinDenom: string; +} +export interface MsgCreatePairProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreatePair"; + value: Uint8Array; +} +/** MsgCreatePair defines an SDK message for creating a pair. */ +export interface MsgCreatePairAmino { + /** creator specifies the bech32-encoded address that is the pair creator. */ + creator: string; + /** base_coin_denom specifies the base coin denom of the pair. */ + base_coin_denom: string; + /** quote_coin_denom specifies the quote coin denom of the pair. */ + quote_coin_denom: string; +} +export interface MsgCreatePairAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreatePair"; + value: MsgCreatePairAmino; +} +/** MsgCreatePair defines an SDK message for creating a pair. */ +export interface MsgCreatePairSDKType { + creator: string; + base_coin_denom: string; + quote_coin_denom: string; +} +export interface MsgCreatePairResponse {} +export interface MsgCreatePairResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreatePairResponse"; + value: Uint8Array; +} +export interface MsgCreatePairResponseAmino {} +export interface MsgCreatePairResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreatePairResponse"; + value: MsgCreatePairResponseAmino; +} +export interface MsgCreatePairResponseSDKType {} +/** MsgCreatePool defines an SDK message for creating a pool. */ +export interface MsgCreatePool { + /** creator specifies the bech32-encoded address that is the pool creator */ + creator: string; + /** pair_id specifies the pair id. */ + pairId: Long; + /** deposit_coins specifies the amount of coins to deposit. */ + depositCoins: Coin[]; +} +export interface MsgCreatePoolProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreatePool"; + value: Uint8Array; +} +/** MsgCreatePool defines an SDK message for creating a pool. */ +export interface MsgCreatePoolAmino { + /** creator specifies the bech32-encoded address that is the pool creator */ + creator: string; + /** pair_id specifies the pair id. */ + pair_id: string; + /** deposit_coins specifies the amount of coins to deposit. */ + deposit_coins: CoinAmino[]; +} +export interface MsgCreatePoolAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreatePool"; + value: MsgCreatePoolAmino; +} +/** MsgCreatePool defines an SDK message for creating a pool. */ +export interface MsgCreatePoolSDKType { + creator: string; + pair_id: Long; + deposit_coins: CoinSDKType[]; +} +/** MsgCreatePoolResponse defines the Msg/CreatePool response type. */ +export interface MsgCreatePoolResponse {} +export interface MsgCreatePoolResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreatePoolResponse"; + value: Uint8Array; +} +/** MsgCreatePoolResponse defines the Msg/CreatePool response type. */ +export interface MsgCreatePoolResponseAmino {} +export interface MsgCreatePoolResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreatePoolResponse"; + value: MsgCreatePoolResponseAmino; +} +/** MsgCreatePoolResponse defines the Msg/CreatePool response type. */ +export interface MsgCreatePoolResponseSDKType {} +/** MsgCreateRangedPool defines an SDK message for creating a ranged pool. */ +export interface MsgCreateRangedPool { + /** creator specifies the bech32-encoded address that is the pool creator */ + creator: string; + /** pair_id specifies the pair id. */ + pairId: Long; + /** deposit_coins specifies the amount of coins to deposit. */ + depositCoins: Coin[]; + minPrice: string; + maxPrice: string; + initialPrice: string; +} +export interface MsgCreateRangedPoolProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreateRangedPool"; + value: Uint8Array; +} +/** MsgCreateRangedPool defines an SDK message for creating a ranged pool. */ +export interface MsgCreateRangedPoolAmino { + /** creator specifies the bech32-encoded address that is the pool creator */ + creator: string; + /** pair_id specifies the pair id. */ + pair_id: string; + /** deposit_coins specifies the amount of coins to deposit. */ + deposit_coins: CoinAmino[]; + min_price: string; + max_price: string; + initial_price: string; +} +export interface MsgCreateRangedPoolAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreateRangedPool"; + value: MsgCreateRangedPoolAmino; +} +/** MsgCreateRangedPool defines an SDK message for creating a ranged pool. */ +export interface MsgCreateRangedPoolSDKType { + creator: string; + pair_id: Long; + deposit_coins: CoinSDKType[]; + min_price: string; + max_price: string; + initial_price: string; +} +/** MsgCreateRangedPoolResponse defines the Msg/CreateRangedPool response type. */ +export interface MsgCreateRangedPoolResponse {} +export interface MsgCreateRangedPoolResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCreateRangedPoolResponse"; + value: Uint8Array; +} +/** MsgCreateRangedPoolResponse defines the Msg/CreateRangedPool response type. */ +export interface MsgCreateRangedPoolResponseAmino {} +export interface MsgCreateRangedPoolResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCreateRangedPoolResponse"; + value: MsgCreateRangedPoolResponseAmino; +} +/** MsgCreateRangedPoolResponse defines the Msg/CreateRangedPool response type. */ +export interface MsgCreateRangedPoolResponseSDKType {} +/** MsgDeposit defines an SDK message for depositing coins to the pool */ +export interface MsgDeposit { + /** depositor specifies the bech32-encoded address that makes a deposit to the pool */ + depositor: string; + /** pool_id specifies the pool id */ + poolId: Long; + /** deposit_coins specifies the amount of coins to deposit. */ + depositCoins: Coin[]; +} +export interface MsgDepositProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgDeposit"; + value: Uint8Array; +} +/** MsgDeposit defines an SDK message for depositing coins to the pool */ +export interface MsgDepositAmino { + /** depositor specifies the bech32-encoded address that makes a deposit to the pool */ + depositor: string; + /** pool_id specifies the pool id */ + pool_id: string; + /** deposit_coins specifies the amount of coins to deposit. */ + deposit_coins: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines an SDK message for depositing coins to the pool */ +export interface MsgDepositSDKType { + depositor: string; + pool_id: Long; + deposit_coins: CoinSDKType[]; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +/** MsgWithdraw defines an SDK message for withdrawing pool coin from the pool */ +export interface MsgWithdraw { + /** withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool */ + withdrawer: string; + /** pool_id specifies the pool id */ + poolId: Long; + /** pool_coin specifies the pool coin that is a proof of liquidity provider for the pool */ + poolCoin: Coin; +} +export interface MsgWithdrawProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgWithdraw"; + value: Uint8Array; +} +/** MsgWithdraw defines an SDK message for withdrawing pool coin from the pool */ +export interface MsgWithdrawAmino { + /** withdrawer specifies the bech32-encoded address that withdraws pool coin from the pool */ + withdrawer: string; + /** pool_id specifies the pool id */ + pool_id: string; + /** pool_coin specifies the pool coin that is a proof of liquidity provider for the pool */ + pool_coin?: CoinAmino; +} +export interface MsgWithdrawAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgWithdraw"; + value: MsgWithdrawAmino; +} +/** MsgWithdraw defines an SDK message for withdrawing pool coin from the pool */ +export interface MsgWithdrawSDKType { + withdrawer: string; + pool_id: Long; + pool_coin: CoinSDKType; +} +/** MsgWithdrawResponse defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponse {} +export interface MsgWithdrawResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgWithdrawResponse"; + value: Uint8Array; +} +/** MsgWithdrawResponse defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponseAmino {} +export interface MsgWithdrawResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgWithdrawResponse"; + value: MsgWithdrawResponseAmino; +} +/** MsgWithdrawResponse defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponseSDKType {} +/** MsgLimitOrder defines an SDK message for making a limit order */ +export interface MsgLimitOrder { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pairId: Long; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offerCoin: Coin; + /** demand_coin_denom specifies the demand coin denom */ + demandCoinDenom: string; + /** price specifies the order price */ + price: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + orderLifespan: Duration; +} +export interface MsgLimitOrderProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgLimitOrder"; + value: Uint8Array; +} +/** MsgLimitOrder defines an SDK message for making a limit order */ +export interface MsgLimitOrderAmino { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pair_id: string; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offer_coin?: CoinAmino; + /** demand_coin_denom specifies the demand coin denom */ + demand_coin_denom: string; + /** price specifies the order price */ + price: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + order_lifespan?: DurationAmino; +} +export interface MsgLimitOrderAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgLimitOrder"; + value: MsgLimitOrderAmino; +} +/** MsgLimitOrder defines an SDK message for making a limit order */ +export interface MsgLimitOrderSDKType { + orderer: string; + pair_id: Long; + direction: OrderDirection; + offer_coin: CoinSDKType; + demand_coin_denom: string; + price: string; + amount: string; + order_lifespan: DurationSDKType; +} +/** MsgLimitOrderResponse defines the Msg/LimitOrder response type. */ +export interface MsgLimitOrderResponse {} +export interface MsgLimitOrderResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgLimitOrderResponse"; + value: Uint8Array; +} +/** MsgLimitOrderResponse defines the Msg/LimitOrder response type. */ +export interface MsgLimitOrderResponseAmino {} +export interface MsgLimitOrderResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgLimitOrderResponse"; + value: MsgLimitOrderResponseAmino; +} +/** MsgLimitOrderResponse defines the Msg/LimitOrder response type. */ +export interface MsgLimitOrderResponseSDKType {} +/** MsgMarketOrder defines an SDK message for making a market order */ +export interface MsgMarketOrder { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pairId: Long; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offerCoin: Coin; + /** demand_coin_denom specifies the demand coin denom */ + demandCoinDenom: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + orderLifespan: Duration; +} +export interface MsgMarketOrderProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgMarketOrder"; + value: Uint8Array; +} +/** MsgMarketOrder defines an SDK message for making a market order */ +export interface MsgMarketOrderAmino { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pair_id: string; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offer_coin?: CoinAmino; + /** demand_coin_denom specifies the demand coin denom */ + demand_coin_denom: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + order_lifespan?: DurationAmino; +} +export interface MsgMarketOrderAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgMarketOrder"; + value: MsgMarketOrderAmino; +} +/** MsgMarketOrder defines an SDK message for making a market order */ +export interface MsgMarketOrderSDKType { + orderer: string; + pair_id: Long; + direction: OrderDirection; + offer_coin: CoinSDKType; + demand_coin_denom: string; + amount: string; + order_lifespan: DurationSDKType; +} +/** MsgMarketOrderResponse defines the Msg/MarketOrder response type. */ +export interface MsgMarketOrderResponse {} +export interface MsgMarketOrderResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgMarketOrderResponse"; + value: Uint8Array; +} +/** MsgMarketOrderResponse defines the Msg/MarketOrder response type. */ +export interface MsgMarketOrderResponseAmino {} +export interface MsgMarketOrderResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgMarketOrderResponse"; + value: MsgMarketOrderResponseAmino; +} +/** MsgMarketOrderResponse defines the Msg/MarketOrder response type. */ +export interface MsgMarketOrderResponseSDKType {} +/** MsgMMOrder defines an SDK message for making a MM(market making) order. */ +export interface MsgMMOrder { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pairId: Long; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offerCoin: Coin; + /** demand_coin_denom specifies the demand coin denom */ + demandCoinDenom: string; + /** price specifies the order price */ + price: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + orderLifespan: Duration; +} +export interface MsgMMOrderProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgMMOrder"; + value: Uint8Array; +} +/** MsgMMOrder defines an SDK message for making a MM(market making) order. */ +export interface MsgMMOrderAmino { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pair_id: string; + /** direction specifies the order direction(buy or sell) */ + direction: OrderDirection; + /** offer_coin specifies the amount of coin the orderer offers */ + offer_coin?: CoinAmino; + /** demand_coin_denom specifies the demand coin denom */ + demand_coin_denom: string; + /** price specifies the order price */ + price: string; + /** amount specifies the amount of base coin the orderer wants to buy or sell */ + amount: string; + /** order_lifespan specifies the order lifespan */ + order_lifespan?: DurationAmino; +} +export interface MsgMMOrderAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgMMOrder"; + value: MsgMMOrderAmino; +} +/** MsgMMOrder defines an SDK message for making a MM(market making) order. */ +export interface MsgMMOrderSDKType { + orderer: string; + pair_id: Long; + direction: OrderDirection; + offer_coin: CoinSDKType; + demand_coin_denom: string; + price: string; + amount: string; + order_lifespan: DurationSDKType; +} +/** MsgMMOrderResponse defines the Msg/MMOrder response type. */ +export interface MsgMMOrderResponse {} +export interface MsgMMOrderResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgMMOrderResponse"; + value: Uint8Array; +} +/** MsgMMOrderResponse defines the Msg/MMOrder response type. */ +export interface MsgMMOrderResponseAmino {} +export interface MsgMMOrderResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgMMOrderResponse"; + value: MsgMMOrderResponseAmino; +} +/** MsgMMOrderResponse defines the Msg/MMOrder response type. */ +export interface MsgMMOrderResponseSDKType {} +/** MsgCancelOrder defines an SDK message for cancelling an order */ +export interface MsgCancelOrder { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pairId: Long; + /** order_id specifies the order id */ + orderId: Long; +} +export interface MsgCancelOrderProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCancelOrder"; + value: Uint8Array; +} +/** MsgCancelOrder defines an SDK message for cancelling an order */ +export interface MsgCancelOrderAmino { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_id specifies the pair id */ + pair_id: string; + /** order_id specifies the order id */ + order_id: string; +} +export interface MsgCancelOrderAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCancelOrder"; + value: MsgCancelOrderAmino; +} +/** MsgCancelOrder defines an SDK message for cancelling an order */ +export interface MsgCancelOrderSDKType { + orderer: string; + pair_id: Long; + order_id: Long; +} +/** MsgCancelOrderResponse defines the Msg/CancelOrder response type. */ +export interface MsgCancelOrderResponse {} +export interface MsgCancelOrderResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCancelOrderResponse"; + value: Uint8Array; +} +/** MsgCancelOrderResponse defines the Msg/CancelOrder response type. */ +export interface MsgCancelOrderResponseAmino {} +export interface MsgCancelOrderResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCancelOrderResponse"; + value: MsgCancelOrderResponseAmino; +} +/** MsgCancelOrderResponse defines the Msg/CancelOrder response type. */ +export interface MsgCancelOrderResponseSDKType {} +/** MsgCancelAllOrders defines an SDK message for cancelling all orders */ +export interface MsgCancelAllOrders { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_ids specifies pair ids to cancel orders */ + pairIds: Long[]; +} +export interface MsgCancelAllOrdersProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCancelAllOrders"; + value: Uint8Array; +} +/** MsgCancelAllOrders defines an SDK message for cancelling all orders */ +export interface MsgCancelAllOrdersAmino { + /** orderer specifies the bech32-encoded address that makes an order */ + orderer: string; + /** pair_ids specifies pair ids to cancel orders */ + pair_ids: string[]; +} +export interface MsgCancelAllOrdersAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCancelAllOrders"; + value: MsgCancelAllOrdersAmino; +} +/** MsgCancelAllOrders defines an SDK message for cancelling all orders */ +export interface MsgCancelAllOrdersSDKType { + orderer: string; + pair_ids: Long[]; +} +/** MsgCancelAllOrdersResponse defines the Msg/CancelAllOrders response type. */ +export interface MsgCancelAllOrdersResponse {} +export interface MsgCancelAllOrdersResponseProtoMsg { + typeUrl: "/crescent.liquidity.v1beta1.MsgCancelAllOrdersResponse"; + value: Uint8Array; +} +/** MsgCancelAllOrdersResponse defines the Msg/CancelAllOrders response type. */ +export interface MsgCancelAllOrdersResponseAmino {} +export interface MsgCancelAllOrdersResponseAminoMsg { + type: "/crescent.liquidity.v1beta1.MsgCancelAllOrdersResponse"; + value: MsgCancelAllOrdersResponseAmino; +} +/** MsgCancelAllOrdersResponse defines the Msg/CancelAllOrders response type. */ +export interface MsgCancelAllOrdersResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/genesis.ts new file mode 100644 index 000000000..b799571b1 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/genesis.ts @@ -0,0 +1,26 @@ +import { Params, ParamsAmino, ParamsSDKType, LiquidValidator, LiquidValidatorAmino, LiquidValidatorSDKType } from "./liquidstaking"; +/** GenesisState defines the liquidstaking module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters for the liquidstaking module */ + params: Params; + liquidValidators: LiquidValidator[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the liquidstaking module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters for the liquidstaking module */ + params?: ParamsAmino; + liquid_validators: LiquidValidatorAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.liquidstaking.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the liquidstaking module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + liquid_validators: LiquidValidatorSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/liquidstaking.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/liquidstaking.ts new file mode 100644 index 000000000..12ae335b7 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/liquidstaking.ts @@ -0,0 +1,354 @@ +/** ValidatorStatus enumerates the status of a liquid validator. */ +export enum ValidatorStatus { + /** VALIDATOR_STATUS_UNSPECIFIED - VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. */ + VALIDATOR_STATUS_UNSPECIFIED = 0, + /** VALIDATOR_STATUS_ACTIVE - VALIDATOR_STATUS_ACTIVE defines the active, valid status */ + VALIDATOR_STATUS_ACTIVE = 1, + /** VALIDATOR_STATUS_INACTIVE - VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status */ + VALIDATOR_STATUS_INACTIVE = 2, + UNRECOGNIZED = -1, +} +export const ValidatorStatusSDKType = ValidatorStatus; +export const ValidatorStatusAmino = ValidatorStatus; +export function validatorStatusFromJSON(object: any): ValidatorStatus { + switch (object) { + case 0: + case "VALIDATOR_STATUS_UNSPECIFIED": + return ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED; + case 1: + case "VALIDATOR_STATUS_ACTIVE": + return ValidatorStatus.VALIDATOR_STATUS_ACTIVE; + case 2: + case "VALIDATOR_STATUS_INACTIVE": + return ValidatorStatus.VALIDATOR_STATUS_INACTIVE; + case -1: + case "UNRECOGNIZED": + default: + return ValidatorStatus.UNRECOGNIZED; + } +} +export function validatorStatusToJSON(object: ValidatorStatus): string { + switch (object) { + case ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED: + return "VALIDATOR_STATUS_UNSPECIFIED"; + case ValidatorStatus.VALIDATOR_STATUS_ACTIVE: + return "VALIDATOR_STATUS_ACTIVE"; + case ValidatorStatus.VALIDATOR_STATUS_INACTIVE: + return "VALIDATOR_STATUS_INACTIVE"; + case ValidatorStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Params defines the set of params for the liquidstaking module. */ +export interface Params { + /** + * LiquidBondDenom specifies the denomination of the token receiving after LiquidStaking, The value is calculated + * through NetAmount. + */ + liquidBondDenom: string; + /** WhitelistedValidators specifies the validators elected to become Active Liquid Validators. */ + whitelistedValidators: WhitelistedValidator[]; + /** + * UnstakeFeeRate specifies the fee rate when liquid unstake is requested, unbonded by subtracting it from + * unbondingAmount + */ + unstakeFeeRate: string; + /** + * MinLiquidStakingAmount specifies the minimum number of coins to be staked to the active liquid validators on liquid + * staking to minimize decimal loss and consider gas efficiency. + */ + minLiquidStakingAmount: string; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the liquidstaking module. */ +export interface ParamsAmino { + /** + * LiquidBondDenom specifies the denomination of the token receiving after LiquidStaking, The value is calculated + * through NetAmount. + */ + liquid_bond_denom: string; + /** WhitelistedValidators specifies the validators elected to become Active Liquid Validators. */ + whitelisted_validators: WhitelistedValidatorAmino[]; + /** + * UnstakeFeeRate specifies the fee rate when liquid unstake is requested, unbonded by subtracting it from + * unbondingAmount + */ + unstake_fee_rate: string; + /** + * MinLiquidStakingAmount specifies the minimum number of coins to be staked to the active liquid validators on liquid + * staking to minimize decimal loss and consider gas efficiency. + */ + min_liquid_staking_amount: string; +} +export interface ParamsAminoMsg { + type: "/crescent.liquidstaking.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the liquidstaking module. */ +export interface ParamsSDKType { + liquid_bond_denom: string; + whitelisted_validators: WhitelistedValidatorSDKType[]; + unstake_fee_rate: string; + min_liquid_staking_amount: string; +} +/** + * WhitelistedValidator consists of the validator operator address and the target weight, which is a value for + * calculating the real weight to be derived according to the active status. In the case of inactive, it is calculated + * as zero. + */ +export interface WhitelistedValidator { + /** validator_address defines the bech32-encoded address that whitelisted validator */ + validatorAddress: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking amount, which is a value for calculating + * the real weight to be derived according to the active status + */ + targetWeight: string; +} +export interface WhitelistedValidatorProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.WhitelistedValidator"; + value: Uint8Array; +} +/** + * WhitelistedValidator consists of the validator operator address and the target weight, which is a value for + * calculating the real weight to be derived according to the active status. In the case of inactive, it is calculated + * as zero. + */ +export interface WhitelistedValidatorAmino { + /** validator_address defines the bech32-encoded address that whitelisted validator */ + validator_address: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking amount, which is a value for calculating + * the real weight to be derived according to the active status + */ + target_weight: string; +} +export interface WhitelistedValidatorAminoMsg { + type: "/crescent.liquidstaking.v1beta1.WhitelistedValidator"; + value: WhitelistedValidatorAmino; +} +/** + * WhitelistedValidator consists of the validator operator address and the target weight, which is a value for + * calculating the real weight to be derived according to the active status. In the case of inactive, it is calculated + * as zero. + */ +export interface WhitelistedValidatorSDKType { + validator_address: string; + target_weight: string; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking and LiquidUnstaking, Active, Weight, etc. + * fields are derived as functions to deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidator { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; +} +export interface LiquidValidatorProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.LiquidValidator"; + value: Uint8Array; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking and LiquidUnstaking, Active, Weight, etc. + * fields are derived as functions to deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidatorAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operator_address: string; +} +export interface LiquidValidatorAminoMsg { + type: "/crescent.liquidstaking.v1beta1.LiquidValidator"; + value: LiquidValidatorAmino; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking and LiquidUnstaking, Active, Weight, etc. + * fields are derived as functions to deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidatorSDKType { + operator_address: string; +} +/** LiquidValidatorState is type LiquidValidator with state added to return to query results. */ +export interface LiquidValidatorState { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; + /** weight specifies the weight for liquid staking, unstaking amount */ + weight: string; + /** status is the liquid validator status */ + status: ValidatorStatus; + /** del_shares define the delegation shares of the validator */ + delShares: string; + /** liquid_tokens define the token amount worth of delegation shares of the validator (slashing applied amount) */ + liquidTokens: string; +} +export interface LiquidValidatorStateProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.LiquidValidatorState"; + value: Uint8Array; +} +/** LiquidValidatorState is type LiquidValidator with state added to return to query results. */ +export interface LiquidValidatorStateAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operator_address: string; + /** weight specifies the weight for liquid staking, unstaking amount */ + weight: string; + /** status is the liquid validator status */ + status: ValidatorStatus; + /** del_shares define the delegation shares of the validator */ + del_shares: string; + /** liquid_tokens define the token amount worth of delegation shares of the validator (slashing applied amount) */ + liquid_tokens: string; +} +export interface LiquidValidatorStateAminoMsg { + type: "/crescent.liquidstaking.v1beta1.LiquidValidatorState"; + value: LiquidValidatorStateAmino; +} +/** LiquidValidatorState is type LiquidValidator with state added to return to query results. */ +export interface LiquidValidatorStateSDKType { + operator_address: string; + weight: string; + status: ValidatorStatus; + del_shares: string; + liquid_tokens: string; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value that depends on the several module + * state every time, so it is used only for calculation and query and is not stored in kv. + */ +export interface NetAmountState { + /** mint_rate is bTokenTotalSupply / NetAmount */ + mintRate: string; + /** btoken_total_supply returns the total supply of btoken(liquid_bond_denom) */ + btokenTotalSupply: string; + /** + * net_amount is proxy account's native token balance + total liquid tokens + total remaining rewards + total + * unbonding balance + */ + netAmount: string; + /** total_del_shares define the delegation shares of all liquid validators */ + totalDelShares: string; + /** + * total_liquid_tokens define the token amount worth of delegation shares of all liquid validator (slashing applied + * amount) + */ + totalLiquidTokens: string; + /** total_remaining_rewards define the sum of remaining rewards of proxy account by all liquid validators */ + totalRemainingRewards: string; + /** + * total_unbonding_balance define the unbonding balance of proxy account by all liquid validator (slashing applied + * amount) + */ + totalUnbondingBalance: string; + /** proxy_acc_balance define the balance of proxy account for the native token */ + proxyAccBalance: string; +} +export interface NetAmountStateProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.NetAmountState"; + value: Uint8Array; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value that depends on the several module + * state every time, so it is used only for calculation and query and is not stored in kv. + */ +export interface NetAmountStateAmino { + /** mint_rate is bTokenTotalSupply / NetAmount */ + mint_rate: string; + /** btoken_total_supply returns the total supply of btoken(liquid_bond_denom) */ + btoken_total_supply: string; + /** + * net_amount is proxy account's native token balance + total liquid tokens + total remaining rewards + total + * unbonding balance + */ + net_amount: string; + /** total_del_shares define the delegation shares of all liquid validators */ + total_del_shares: string; + /** + * total_liquid_tokens define the token amount worth of delegation shares of all liquid validator (slashing applied + * amount) + */ + total_liquid_tokens: string; + /** total_remaining_rewards define the sum of remaining rewards of proxy account by all liquid validators */ + total_remaining_rewards: string; + /** + * total_unbonding_balance define the unbonding balance of proxy account by all liquid validator (slashing applied + * amount) + */ + total_unbonding_balance: string; + /** proxy_acc_balance define the balance of proxy account for the native token */ + proxy_acc_balance: string; +} +export interface NetAmountStateAminoMsg { + type: "/crescent.liquidstaking.v1beta1.NetAmountState"; + value: NetAmountStateAmino; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value that depends on the several module + * state every time, so it is used only for calculation and query and is not stored in kv. + */ +export interface NetAmountStateSDKType { + mint_rate: string; + btoken_total_supply: string; + net_amount: string; + total_del_shares: string; + total_liquid_tokens: string; + total_remaining_rewards: string; + total_unbonding_balance: string; + proxy_acc_balance: string; +} +/** + * VotingPower is type for current voting power of the voter including staking module's voting power and liquid staking + * module's voting power, It depends on the amount of delegation of staking module, the bonded state of the delegated + * validator, the value of btoken(liquid_bond_denom), and the pool coin and farming position containing btoken.. + */ +export interface VotingPower { + /** voter defines the address of the voter; bech encoded in JSON. */ + voter: string; + /** staking_voting_power return the voting power of staking that can be exercised. */ + stakingVotingPower: string; + /** liquid_staking_voting_power return the voting power of liquid staking that can be exercised. */ + liquidStakingVotingPower: string; + /** + * validator_voting_power return the voting power of the validator if the voter is the validator operator that can be + * exercised. + */ + validatorVotingPower: string; +} +export interface VotingPowerProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.VotingPower"; + value: Uint8Array; +} +/** + * VotingPower is type for current voting power of the voter including staking module's voting power and liquid staking + * module's voting power, It depends on the amount of delegation of staking module, the bonded state of the delegated + * validator, the value of btoken(liquid_bond_denom), and the pool coin and farming position containing btoken.. + */ +export interface VotingPowerAmino { + /** voter defines the address of the voter; bech encoded in JSON. */ + voter: string; + /** staking_voting_power return the voting power of staking that can be exercised. */ + staking_voting_power: string; + /** liquid_staking_voting_power return the voting power of liquid staking that can be exercised. */ + liquid_staking_voting_power: string; + /** + * validator_voting_power return the voting power of the validator if the voter is the validator operator that can be + * exercised. + */ + validator_voting_power: string; +} +export interface VotingPowerAminoMsg { + type: "/crescent.liquidstaking.v1beta1.VotingPower"; + value: VotingPowerAmino; +} +/** + * VotingPower is type for current voting power of the voter including staking module's voting power and liquid staking + * module's voting power, It depends on the amount of delegation of staking module, the bonded state of the delegated + * validator, the value of btoken(liquid_bond_denom), and the pool coin and farming position containing btoken.. + */ +export interface VotingPowerSDKType { + voter: string; + staking_voting_power: string; + liquid_staking_voting_power: string; + validator_voting_power: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/tx.ts new file mode 100644 index 000000000..ff57af767 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/liquidstaking/v1beta1/tx.ts @@ -0,0 +1,99 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStake { + delegatorAddress: string; + amount: Coin; +} +export interface MsgLiquidStakeProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.MsgLiquidStake"; + value: Uint8Array; +} +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStakeAmino { + delegator_address: string; + amount?: CoinAmino; +} +export interface MsgLiquidStakeAminoMsg { + type: "/crescent.liquidstaking.v1beta1.MsgLiquidStake"; + value: MsgLiquidStakeAmino; +} +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStakeSDKType { + delegator_address: string; + amount: CoinSDKType; +} +/** MsgLiquidStakeResponse defines the Msg/LiquidStake response type. */ +export interface MsgLiquidStakeResponse {} +export interface MsgLiquidStakeResponseProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.MsgLiquidStakeResponse"; + value: Uint8Array; +} +/** MsgLiquidStakeResponse defines the Msg/LiquidStake response type. */ +export interface MsgLiquidStakeResponseAmino {} +export interface MsgLiquidStakeResponseAminoMsg { + type: "/crescent.liquidstaking.v1beta1.MsgLiquidStakeResponse"; + value: MsgLiquidStakeResponseAmino; +} +/** MsgLiquidStakeResponse defines the Msg/LiquidStake response type. */ +export interface MsgLiquidStakeResponseSDKType {} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of liquid staking from a + * delegate. + */ +export interface MsgLiquidUnstake { + delegatorAddress: string; + amount: Coin; +} +export interface MsgLiquidUnstakeProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.MsgLiquidUnstake"; + value: Uint8Array; +} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of liquid staking from a + * delegate. + */ +export interface MsgLiquidUnstakeAmino { + delegator_address: string; + amount?: CoinAmino; +} +export interface MsgLiquidUnstakeAminoMsg { + type: "/crescent.liquidstaking.v1beta1.MsgLiquidUnstake"; + value: MsgLiquidUnstakeAmino; +} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of liquid staking from a + * delegate. + */ +export interface MsgLiquidUnstakeSDKType { + delegator_address: string; + amount: CoinSDKType; +} +/** MsgLiquidUnstakeResponse defines the Msg/LiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponse { + completionTime: Date; +} +export interface MsgLiquidUnstakeResponseProtoMsg { + typeUrl: "/crescent.liquidstaking.v1beta1.MsgLiquidUnstakeResponse"; + value: Uint8Array; +} +/** MsgLiquidUnstakeResponse defines the Msg/LiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponseAmino { + completion_time?: Date; +} +export interface MsgLiquidUnstakeResponseAminoMsg { + type: "/crescent.liquidstaking.v1beta1.MsgLiquidUnstakeResponse"; + value: MsgLiquidUnstakeResponseAmino; +} +/** MsgLiquidUnstakeResponse defines the Msg/LiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponseSDKType { + completion_time: Date; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/events.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/events.ts new file mode 100644 index 000000000..fafdfd5d6 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/events.ts @@ -0,0 +1,111 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface EventCreatePrivatePlan { + creator: string; + planId: Long; + farmingPoolAddress: string; +} +export interface EventCreatePrivatePlanProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.EventCreatePrivatePlan"; + value: Uint8Array; +} +export interface EventCreatePrivatePlanAmino { + creator: string; + plan_id: string; + farming_pool_address: string; +} +export interface EventCreatePrivatePlanAminoMsg { + type: "/crescent.lpfarm.v1beta1.EventCreatePrivatePlan"; + value: EventCreatePrivatePlanAmino; +} +export interface EventCreatePrivatePlanSDKType { + creator: string; + plan_id: Long; + farming_pool_address: string; +} +export interface EventFarm { + farmer: string; + coin: Coin; + withdrawnRewards: Coin[]; +} +export interface EventFarmProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.EventFarm"; + value: Uint8Array; +} +export interface EventFarmAmino { + farmer: string; + coin?: CoinAmino; + withdrawn_rewards: CoinAmino[]; +} +export interface EventFarmAminoMsg { + type: "/crescent.lpfarm.v1beta1.EventFarm"; + value: EventFarmAmino; +} +export interface EventFarmSDKType { + farmer: string; + coin: CoinSDKType; + withdrawn_rewards: CoinSDKType[]; +} +export interface EventUnfarm { + farmer: string; + coin: Coin; + withdrawnRewards: Coin[]; +} +export interface EventUnfarmProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.EventUnfarm"; + value: Uint8Array; +} +export interface EventUnfarmAmino { + farmer: string; + coin?: CoinAmino; + withdrawn_rewards: CoinAmino[]; +} +export interface EventUnfarmAminoMsg { + type: "/crescent.lpfarm.v1beta1.EventUnfarm"; + value: EventUnfarmAmino; +} +export interface EventUnfarmSDKType { + farmer: string; + coin: CoinSDKType; + withdrawn_rewards: CoinSDKType[]; +} +export interface EventHarvest { + farmer: string; + denom: string; + withdrawnRewards: Coin[]; +} +export interface EventHarvestProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.EventHarvest"; + value: Uint8Array; +} +export interface EventHarvestAmino { + farmer: string; + denom: string; + withdrawn_rewards: CoinAmino[]; +} +export interface EventHarvestAminoMsg { + type: "/crescent.lpfarm.v1beta1.EventHarvest"; + value: EventHarvestAmino; +} +export interface EventHarvestSDKType { + farmer: string; + denom: string; + withdrawn_rewards: CoinSDKType[]; +} +export interface EventTerminatePlan { + planId: Long; +} +export interface EventTerminatePlanProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.EventTerminatePlan"; + value: Uint8Array; +} +export interface EventTerminatePlanAmino { + plan_id: string; +} +export interface EventTerminatePlanAminoMsg { + type: "/crescent.lpfarm.v1beta1.EventTerminatePlan"; + value: EventTerminatePlanAmino; +} +export interface EventTerminatePlanSDKType { + plan_id: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/genesis.ts new file mode 100644 index 000000000..173339f87 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/genesis.ts @@ -0,0 +1,83 @@ +import { Params, ParamsAmino, ParamsSDKType, Plan, PlanAmino, PlanSDKType, Position, PositionAmino, PositionSDKType, Farm, FarmAmino, FarmSDKType, HistoricalRewards, HistoricalRewardsAmino, HistoricalRewardsSDKType } from "./lpfarm"; +import { Long } from "../../../helpers"; +export interface GenesisState { + params: Params; + lastBlockTime: Date; + lastPlanId: Long; + numPrivatePlans: Long; + plans: Plan[]; + farms: FarmRecord[]; + positions: Position[]; + historicalRewards: HistoricalRewardsRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; + last_block_time?: Date; + last_plan_id: string; + num_private_plans: string; + plans: PlanAmino[]; + farms: FarmRecordAmino[]; + positions: PositionAmino[]; + historical_rewards: HistoricalRewardsRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.lpfarm.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_block_time: Date; + last_plan_id: Long; + num_private_plans: Long; + plans: PlanSDKType[]; + farms: FarmRecordSDKType[]; + positions: PositionSDKType[]; + historical_rewards: HistoricalRewardsRecordSDKType[]; +} +export interface FarmRecord { + denom: string; + farm: Farm; +} +export interface FarmRecordProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.FarmRecord"; + value: Uint8Array; +} +export interface FarmRecordAmino { + denom: string; + farm?: FarmAmino; +} +export interface FarmRecordAminoMsg { + type: "/crescent.lpfarm.v1beta1.FarmRecord"; + value: FarmRecordAmino; +} +export interface FarmRecordSDKType { + denom: string; + farm: FarmSDKType; +} +export interface HistoricalRewardsRecord { + denom: string; + period: Long; + historicalRewards: HistoricalRewards; +} +export interface HistoricalRewardsRecordProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.HistoricalRewardsRecord"; + value: Uint8Array; +} +export interface HistoricalRewardsRecordAmino { + denom: string; + period: string; + historical_rewards?: HistoricalRewardsAmino; +} +export interface HistoricalRewardsRecordAminoMsg { + type: "/crescent.lpfarm.v1beta1.HistoricalRewardsRecord"; + value: HistoricalRewardsRecordAmino; +} +export interface HistoricalRewardsRecordSDKType { + denom: string; + period: Long; + historical_rewards: HistoricalRewardsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/lpfarm.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/lpfarm.ts new file mode 100644 index 000000000..9ea0f3297 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/lpfarm.ts @@ -0,0 +1,171 @@ +import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Long } from "../../../helpers"; +export interface Params { + privatePlanCreationFee: Coin[]; + feeCollector: string; + maxNumPrivatePlans: number; + maxBlockDuration: Duration; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + private_plan_creation_fee: CoinAmino[]; + fee_collector: string; + max_num_private_plans: number; + max_block_duration?: DurationAmino; +} +export interface ParamsAminoMsg { + type: "/crescent.lpfarm.v1beta1.Params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + private_plan_creation_fee: CoinSDKType[]; + fee_collector: string; + max_num_private_plans: number; + max_block_duration: DurationSDKType; +} +export interface Plan { + id: Long; + description: string; + farmingPoolAddress: string; + terminationAddress: string; + rewardAllocations: RewardAllocation[]; + startTime: Date; + endTime: Date; + isPrivate: boolean; + isTerminated: boolean; +} +export interface PlanProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.Plan"; + value: Uint8Array; +} +export interface PlanAmino { + id: string; + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: RewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; + is_private: boolean; + is_terminated: boolean; +} +export interface PlanAminoMsg { + type: "/crescent.lpfarm.v1beta1.Plan"; + value: PlanAmino; +} +export interface PlanSDKType { + id: Long; + description: string; + farming_pool_address: string; + termination_address: string; + reward_allocations: RewardAllocationSDKType[]; + start_time: Date; + end_time: Date; + is_private: boolean; + is_terminated: boolean; +} +export interface RewardAllocation { + denom: string; + pairId: Long; + rewardsPerDay: Coin[]; +} +export interface RewardAllocationProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.RewardAllocation"; + value: Uint8Array; +} +export interface RewardAllocationAmino { + denom: string; + pair_id: string; + rewards_per_day: CoinAmino[]; +} +export interface RewardAllocationAminoMsg { + type: "/crescent.lpfarm.v1beta1.RewardAllocation"; + value: RewardAllocationAmino; +} +export interface RewardAllocationSDKType { + denom: string; + pair_id: Long; + rewards_per_day: CoinSDKType[]; +} +export interface Farm { + totalFarmingAmount: string; + currentRewards: DecCoin[]; + outstandingRewards: DecCoin[]; + period: Long; + previousShare: string; +} +export interface FarmProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.Farm"; + value: Uint8Array; +} +export interface FarmAmino { + total_farming_amount: string; + current_rewards: DecCoinAmino[]; + outstanding_rewards: DecCoinAmino[]; + period: string; + previous_share: string; +} +export interface FarmAminoMsg { + type: "/crescent.lpfarm.v1beta1.Farm"; + value: FarmAmino; +} +export interface FarmSDKType { + total_farming_amount: string; + current_rewards: DecCoinSDKType[]; + outstanding_rewards: DecCoinSDKType[]; + period: Long; + previous_share: string; +} +export interface Position { + farmer: string; + denom: string; + farmingAmount: string; + previousPeriod: Long; + startingBlockHeight: Long; +} +export interface PositionProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + farmer: string; + denom: string; + farming_amount: string; + previous_period: string; + starting_block_height: string; +} +export interface PositionAminoMsg { + type: "/crescent.lpfarm.v1beta1.Position"; + value: PositionAmino; +} +export interface PositionSDKType { + farmer: string; + denom: string; + farming_amount: string; + previous_period: Long; + starting_block_height: Long; +} +export interface HistoricalRewards { + cumulativeUnitRewards: DecCoin[]; + referenceCount: number; +} +export interface HistoricalRewardsProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.HistoricalRewards"; + value: Uint8Array; +} +export interface HistoricalRewardsAmino { + cumulative_unit_rewards: DecCoinAmino[]; + reference_count: number; +} +export interface HistoricalRewardsAminoMsg { + type: "/crescent.lpfarm.v1beta1.HistoricalRewards"; + value: HistoricalRewardsAmino; +} +export interface HistoricalRewardsSDKType { + cumulative_unit_rewards: DecCoinSDKType[]; + reference_count: number; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/proposal.ts new file mode 100644 index 000000000..bf770c00c --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/proposal.ts @@ -0,0 +1,74 @@ +import { RewardAllocation, RewardAllocationAmino, RewardAllocationSDKType } from "./lpfarm"; +import { Long } from "../../../helpers"; +export interface FarmingPlanProposal { + title: string; + description: string; + createPlanRequests: CreatePlanRequest[]; + terminatePlanRequests: TerminatePlanRequest[]; +} +export interface FarmingPlanProposalProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.FarmingPlanProposal"; + value: Uint8Array; +} +export interface FarmingPlanProposalAmino { + title: string; + description: string; + create_plan_requests: CreatePlanRequestAmino[]; + terminate_plan_requests: TerminatePlanRequestAmino[]; +} +export interface FarmingPlanProposalAminoMsg { + type: "/crescent.lpfarm.v1beta1.FarmingPlanProposal"; + value: FarmingPlanProposalAmino; +} +export interface FarmingPlanProposalSDKType { + title: string; + description: string; + create_plan_requests: CreatePlanRequestSDKType[]; + terminate_plan_requests: TerminatePlanRequestSDKType[]; +} +export interface CreatePlanRequest { + description: string; + farmingPoolAddress: string; + rewardAllocations: RewardAllocation[]; + startTime: Date; + endTime: Date; +} +export interface CreatePlanRequestProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.CreatePlanRequest"; + value: Uint8Array; +} +export interface CreatePlanRequestAmino { + description: string; + farming_pool_address: string; + reward_allocations: RewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; +} +export interface CreatePlanRequestAminoMsg { + type: "/crescent.lpfarm.v1beta1.CreatePlanRequest"; + value: CreatePlanRequestAmino; +} +export interface CreatePlanRequestSDKType { + description: string; + farming_pool_address: string; + reward_allocations: RewardAllocationSDKType[]; + start_time: Date; + end_time: Date; +} +export interface TerminatePlanRequest { + planId: Long; +} +export interface TerminatePlanRequestProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.TerminatePlanRequest"; + value: Uint8Array; +} +export interface TerminatePlanRequestAmino { + plan_id: string; +} +export interface TerminatePlanRequestAminoMsg { + type: "/crescent.lpfarm.v1beta1.TerminatePlanRequest"; + value: TerminatePlanRequestAmino; +} +export interface TerminatePlanRequestSDKType { + plan_id: Long; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/tx.ts new file mode 100644 index 000000000..9fc2ca9bf --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/lpfarm/v1beta1/tx.ts @@ -0,0 +1,194 @@ +import { RewardAllocation, RewardAllocationAmino, RewardAllocationSDKType } from "./lpfarm"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface MsgCreatePrivatePlan { + creator: string; + description: string; + rewardAllocations: RewardAllocation[]; + startTime: Date; + endTime: Date; +} +export interface MsgCreatePrivatePlanProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgCreatePrivatePlan"; + value: Uint8Array; +} +export interface MsgCreatePrivatePlanAmino { + creator: string; + description: string; + reward_allocations: RewardAllocationAmino[]; + start_time?: Date; + end_time?: Date; +} +export interface MsgCreatePrivatePlanAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgCreatePrivatePlan"; + value: MsgCreatePrivatePlanAmino; +} +export interface MsgCreatePrivatePlanSDKType { + creator: string; + description: string; + reward_allocations: RewardAllocationSDKType[]; + start_time: Date; + end_time: Date; +} +export interface MsgCreatePrivatePlanResponse { + planId: Long; + farmingPoolAddress: string; +} +export interface MsgCreatePrivatePlanResponseProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgCreatePrivatePlanResponse"; + value: Uint8Array; +} +export interface MsgCreatePrivatePlanResponseAmino { + plan_id: string; + farming_pool_address: string; +} +export interface MsgCreatePrivatePlanResponseAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgCreatePrivatePlanResponse"; + value: MsgCreatePrivatePlanResponseAmino; +} +export interface MsgCreatePrivatePlanResponseSDKType { + plan_id: Long; + farming_pool_address: string; +} +export interface MsgTerminatePrivatePlan { + creator: string; + planId: Long; +} +export interface MsgTerminatePrivatePlanProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgTerminatePrivatePlan"; + value: Uint8Array; +} +export interface MsgTerminatePrivatePlanAmino { + creator: string; + plan_id: string; +} +export interface MsgTerminatePrivatePlanAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgTerminatePrivatePlan"; + value: MsgTerminatePrivatePlanAmino; +} +export interface MsgTerminatePrivatePlanSDKType { + creator: string; + plan_id: Long; +} +export interface MsgTerminatePrivatePlanResponse {} +export interface MsgTerminatePrivatePlanResponseProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgTerminatePrivatePlanResponse"; + value: Uint8Array; +} +export interface MsgTerminatePrivatePlanResponseAmino {} +export interface MsgTerminatePrivatePlanResponseAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgTerminatePrivatePlanResponse"; + value: MsgTerminatePrivatePlanResponseAmino; +} +export interface MsgTerminatePrivatePlanResponseSDKType {} +export interface MsgFarm { + farmer: string; + coin: Coin; +} +export interface MsgFarmProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgFarm"; + value: Uint8Array; +} +export interface MsgFarmAmino { + farmer: string; + coin?: CoinAmino; +} +export interface MsgFarmAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgFarm"; + value: MsgFarmAmino; +} +export interface MsgFarmSDKType { + farmer: string; + coin: CoinSDKType; +} +export interface MsgFarmResponse { + withdrawnRewards: Coin[]; +} +export interface MsgFarmResponseProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgFarmResponse"; + value: Uint8Array; +} +export interface MsgFarmResponseAmino { + withdrawn_rewards: CoinAmino[]; +} +export interface MsgFarmResponseAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgFarmResponse"; + value: MsgFarmResponseAmino; +} +export interface MsgFarmResponseSDKType { + withdrawn_rewards: CoinSDKType[]; +} +export interface MsgUnfarm { + farmer: string; + coin: Coin; +} +export interface MsgUnfarmProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgUnfarm"; + value: Uint8Array; +} +export interface MsgUnfarmAmino { + farmer: string; + coin?: CoinAmino; +} +export interface MsgUnfarmAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgUnfarm"; + value: MsgUnfarmAmino; +} +export interface MsgUnfarmSDKType { + farmer: string; + coin: CoinSDKType; +} +export interface MsgUnfarmResponse { + withdrawnRewards: Coin[]; +} +export interface MsgUnfarmResponseProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgUnfarmResponse"; + value: Uint8Array; +} +export interface MsgUnfarmResponseAmino { + withdrawn_rewards: CoinAmino[]; +} +export interface MsgUnfarmResponseAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgUnfarmResponse"; + value: MsgUnfarmResponseAmino; +} +export interface MsgUnfarmResponseSDKType { + withdrawn_rewards: CoinSDKType[]; +} +export interface MsgHarvest { + farmer: string; + denom: string; +} +export interface MsgHarvestProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgHarvest"; + value: Uint8Array; +} +export interface MsgHarvestAmino { + farmer: string; + denom: string; +} +export interface MsgHarvestAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgHarvest"; + value: MsgHarvestAmino; +} +export interface MsgHarvestSDKType { + farmer: string; + denom: string; +} +export interface MsgHarvestResponse { + withdrawnRewards: Coin[]; +} +export interface MsgHarvestResponseProtoMsg { + typeUrl: "/crescent.lpfarm.v1beta1.MsgHarvestResponse"; + value: Uint8Array; +} +export interface MsgHarvestResponseAmino { + withdrawn_rewards: CoinAmino[]; +} +export interface MsgHarvestResponseAminoMsg { + type: "/crescent.lpfarm.v1beta1.MsgHarvestResponse"; + value: MsgHarvestResponseAmino; +} +export interface MsgHarvestResponseSDKType { + withdrawn_rewards: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/genesis.ts new file mode 100644 index 000000000..0202f83aa --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/genesis.ts @@ -0,0 +1,21 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./marker"; +export interface GenesisState { + params: Params; + lastBlockTime: Date; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.marker.v1beta1.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; + last_block_time?: Date; +} +export interface GenesisStateAminoMsg { + type: "/crescent.marker.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_block_time: Date; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/marker.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/marker.ts new file mode 100644 index 000000000..35a927112 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marker/v1beta1/marker.ts @@ -0,0 +1,11 @@ +export interface Params {} +export interface ParamsProtoMsg { + typeUrl: "/crescent.marker.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino {} +export interface ParamsAminoMsg { + type: "/crescent.marker.v1beta1.Params"; + value: ParamsAmino; +} +export interface ParamsSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/genesis.ts new file mode 100644 index 000000000..6aa215abe --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/genesis.ts @@ -0,0 +1,32 @@ +import { Params, ParamsAmino, ParamsSDKType, MarketMaker, MarketMakerAmino, MarketMakerSDKType, Incentive, IncentiveAmino, IncentiveSDKType, DepositRecord, DepositRecordAmino, DepositRecordSDKType } from "./marketmaker"; +/** GenesisState defines the marketmaker module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters for the marketmaker module */ + params: Params; + marketMakers: MarketMaker[]; + incentives: Incentive[]; + depositRecords: DepositRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the marketmaker module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters for the marketmaker module */ + params?: ParamsAmino; + market_makers: MarketMakerAmino[]; + incentives: IncentiveAmino[]; + deposit_records: DepositRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/crescent.marketmaker.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the marketmaker module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + market_makers: MarketMakerSDKType[]; + incentives: IncentiveSDKType[]; + deposit_records: DepositRecordSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/marketmaker.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/marketmaker.ts new file mode 100644 index 000000000..751477167 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/marketmaker.ts @@ -0,0 +1,243 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +/** Params defines the set of params for the marketmaker module. */ +export interface Params { + /** Address containing the funds used to distribute incentives */ + incentiveBudgetAddress: string; + /** + * The amount of deposit to be applied to the market maker, which is calculated per pair and is refunded when the + * market maker included or rejected through the MarketMaker Proposal + */ + depositAmount: Coin[]; + /** Common variables used in market maker scoring system */ + common: Common; + /** Include the pairs that are incentive target pairs and the variables used in market maker scoring system */ + incentivePairs: IncentivePair[]; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the marketmaker module. */ +export interface ParamsAmino { + /** Address containing the funds used to distribute incentives */ + incentive_budget_address: string; + /** + * The amount of deposit to be applied to the market maker, which is calculated per pair and is refunded when the + * market maker included or rejected through the MarketMaker Proposal + */ + deposit_amount: CoinAmino[]; + /** Common variables used in market maker scoring system */ + common?: CommonAmino; + /** Include the pairs that are incentive target pairs and the variables used in market maker scoring system */ + incentive_pairs: IncentivePairAmino[]; +} +export interface ParamsAminoMsg { + type: "/crescent.marketmaker.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the marketmaker module. */ +export interface ParamsSDKType { + incentive_budget_address: string; + deposit_amount: CoinSDKType[]; + common: CommonSDKType; + incentive_pairs: IncentivePairSDKType[]; +} +export interface Common { + /** Minimum ratio to maintain the tick order */ + minOpenRatio: string; + /** Minimum ratio of open amount to MinDepth */ + minOpenDepthRatio: string; + /** Maximum allowable consecutive blocks of outage */ + maxDowntime: number; + /** Maximum allowable sum of blocks in an hour */ + maxTotalDowntime: number; + /** Minimum value of LiveHour to achieve LiveDay */ + minHours: number; + /** Minimum value of LiveDay to maintain MM eligibility */ + minDays: number; +} +export interface CommonProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.Common"; + value: Uint8Array; +} +export interface CommonAmino { + /** Minimum ratio to maintain the tick order */ + min_open_ratio: string; + /** Minimum ratio of open amount to MinDepth */ + min_open_depth_ratio: string; + /** Maximum allowable consecutive blocks of outage */ + max_downtime: number; + /** Maximum allowable sum of blocks in an hour */ + max_total_downtime: number; + /** Minimum value of LiveHour to achieve LiveDay */ + min_hours: number; + /** Minimum value of LiveDay to maintain MM eligibility */ + min_days: number; +} +export interface CommonAminoMsg { + type: "/crescent.marketmaker.v1beta1.Common"; + value: CommonAmino; +} +export interface CommonSDKType { + min_open_ratio: string; + min_open_depth_ratio: string; + max_downtime: number; + max_total_downtime: number; + min_hours: number; + min_days: number; +} +export interface IncentivePair { + /** Pair id of liquidity module */ + pairId: Long; + /** Time the pair variables start to be applied to the scoring system */ + updateTime: Date; + /** Incentive weights for each pair */ + incentiveWeight: string; + /** Maximum allowable spread between bid and ask */ + maxSpread: string; + /** Minimum allowable price difference of high and low on both side of orders */ + minWidth: string; + /** Minimum allowable order depth on each side */ + minDepth: string; +} +export interface IncentivePairProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.IncentivePair"; + value: Uint8Array; +} +export interface IncentivePairAmino { + /** Pair id of liquidity module */ + pair_id: string; + /** Time the pair variables start to be applied to the scoring system */ + update_time?: Date; + /** Incentive weights for each pair */ + incentive_weight: string; + /** Maximum allowable spread between bid and ask */ + max_spread: string; + /** Minimum allowable price difference of high and low on both side of orders */ + min_width: string; + /** Minimum allowable order depth on each side */ + min_depth: string; +} +export interface IncentivePairAminoMsg { + type: "/crescent.marketmaker.v1beta1.IncentivePair"; + value: IncentivePairAmino; +} +export interface IncentivePairSDKType { + pair_id: Long; + update_time: Date; + incentive_weight: string; + max_spread: string; + min_width: string; + min_depth: string; +} +/** + * Store the total amount of incentives distributed through `MarketMakerProposal`, and it can be claimed at once through + * `MsgClaimIncentives` + */ +export interface Incentive { + address: string; + claimable: Coin[]; +} +export interface IncentiveProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.Incentive"; + value: Uint8Array; +} +/** + * Store the total amount of incentives distributed through `MarketMakerProposal`, and it can be claimed at once through + * `MsgClaimIncentives` + */ +export interface IncentiveAmino { + address: string; + claimable: CoinAmino[]; +} +export interface IncentiveAminoMsg { + type: "/crescent.marketmaker.v1beta1.Incentive"; + value: IncentiveAmino; +} +/** + * Store the total amount of incentives distributed through `MarketMakerProposal`, and it can be claimed at once through + * `MsgClaimIncentives` + */ +export interface IncentiveSDKType { + address: string; + claimable: CoinSDKType[]; +} +/** + * Market maker object created by applying, if included through `MarketMakerProposal`, eligible becomes true and is + * deleted if rejected or excluded + */ +export interface MarketMaker { + address: string; + pairId: Long; + eligible: boolean; +} +export interface MarketMakerProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MarketMaker"; + value: Uint8Array; +} +/** + * Market maker object created by applying, if included through `MarketMakerProposal`, eligible becomes true and is + * deleted if rejected or excluded + */ +export interface MarketMakerAmino { + address: string; + pair_id: string; + eligible: boolean; +} +export interface MarketMakerAminoMsg { + type: "/crescent.marketmaker.v1beta1.MarketMaker"; + value: MarketMakerAmino; +} +/** + * Market maker object created by applying, if included through `MarketMakerProposal`, eligible becomes true and is + * deleted if rejected or excluded + */ +export interface MarketMakerSDKType { + address: string; + pair_id: Long; + eligible: boolean; +} +/** stores apply deposit amount for a future refund */ +export interface Deposit { + amount: Coin[]; +} +export interface DepositProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.Deposit"; + value: Uint8Array; +} +/** stores apply deposit amount for a future refund */ +export interface DepositAmino { + amount: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "/crescent.marketmaker.v1beta1.Deposit"; + value: DepositAmino; +} +/** stores apply deposit amount for a future refund */ +export interface DepositSDKType { + amount: CoinSDKType[]; +} +export interface DepositRecord { + address: string; + pairId: Long; + amount: Coin[]; +} +export interface DepositRecordProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.DepositRecord"; + value: Uint8Array; +} +export interface DepositRecordAmino { + address: string; + pair_id: string; + amount: CoinAmino[]; +} +export interface DepositRecordAminoMsg { + type: "/crescent.marketmaker.v1beta1.DepositRecord"; + value: DepositRecordAmino; +} +export interface DepositRecordSDKType { + address: string; + pair_id: Long; + amount: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/proposal.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/proposal.ts new file mode 100644 index 000000000..f45d61fdd --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/proposal.ts @@ -0,0 +1,89 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Long } from "../../../helpers"; +export interface MarketMakerProposal { + /** title specifies the title of the proposal */ + title: string; + /** description specifies the description of the proposal */ + description: string; + /** set the market makers to eligible, refund deposit */ + inclusions: MarketMakerHandle[]; + /** delete existing eligible market makers */ + exclusions: MarketMakerHandle[]; + /** delete the not eligible market makers, refund deposit */ + rejections: MarketMakerHandle[]; + /** distribute claimable incentive to eligible market makers */ + distributions: IncentiveDistribution[]; +} +export interface MarketMakerProposalProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MarketMakerProposal"; + value: Uint8Array; +} +export interface MarketMakerProposalAmino { + /** title specifies the title of the proposal */ + title: string; + /** description specifies the description of the proposal */ + description: string; + /** set the market makers to eligible, refund deposit */ + inclusions: MarketMakerHandleAmino[]; + /** delete existing eligible market makers */ + exclusions: MarketMakerHandleAmino[]; + /** delete the not eligible market makers, refund deposit */ + rejections: MarketMakerHandleAmino[]; + /** distribute claimable incentive to eligible market makers */ + distributions: IncentiveDistributionAmino[]; +} +export interface MarketMakerProposalAminoMsg { + type: "/crescent.marketmaker.v1beta1.MarketMakerProposal"; + value: MarketMakerProposalAmino; +} +export interface MarketMakerProposalSDKType { + title: string; + description: string; + inclusions: MarketMakerHandleSDKType[]; + exclusions: MarketMakerHandleSDKType[]; + rejections: MarketMakerHandleSDKType[]; + distributions: IncentiveDistributionSDKType[]; +} +export interface MarketMakerHandle { + address: string; + pairId: Long; +} +export interface MarketMakerHandleProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MarketMakerHandle"; + value: Uint8Array; +} +export interface MarketMakerHandleAmino { + address: string; + pair_id: string; +} +export interface MarketMakerHandleAminoMsg { + type: "/crescent.marketmaker.v1beta1.MarketMakerHandle"; + value: MarketMakerHandleAmino; +} +export interface MarketMakerHandleSDKType { + address: string; + pair_id: Long; +} +export interface IncentiveDistribution { + address: string; + pairId: Long; + amount: Coin[]; +} +export interface IncentiveDistributionProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.IncentiveDistribution"; + value: Uint8Array; +} +export interface IncentiveDistributionAmino { + address: string; + pair_id: string; + amount: CoinAmino[]; +} +export interface IncentiveDistributionAminoMsg { + type: "/crescent.marketmaker.v1beta1.IncentiveDistribution"; + value: IncentiveDistributionAmino; +} +export interface IncentiveDistributionSDKType { + address: string; + pair_id: Long; + amount: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/tx.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/tx.ts new file mode 100644 index 000000000..1485f8dcc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/marketmaker/v1beta1/tx.ts @@ -0,0 +1,60 @@ +import { Long } from "../../../helpers"; +export interface MsgApplyMarketMaker { + address: string; + pairIds: Long[]; +} +export interface MsgApplyMarketMakerProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MsgApplyMarketMaker"; + value: Uint8Array; +} +export interface MsgApplyMarketMakerAmino { + address: string; + pair_ids: string[]; +} +export interface MsgApplyMarketMakerAminoMsg { + type: "/crescent.marketmaker.v1beta1.MsgApplyMarketMaker"; + value: MsgApplyMarketMakerAmino; +} +export interface MsgApplyMarketMakerSDKType { + address: string; + pair_ids: Long[]; +} +export interface MsgApplyMarketMakerResponse {} +export interface MsgApplyMarketMakerResponseProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MsgApplyMarketMakerResponse"; + value: Uint8Array; +} +export interface MsgApplyMarketMakerResponseAmino {} +export interface MsgApplyMarketMakerResponseAminoMsg { + type: "/crescent.marketmaker.v1beta1.MsgApplyMarketMakerResponse"; + value: MsgApplyMarketMakerResponseAmino; +} +export interface MsgApplyMarketMakerResponseSDKType {} +export interface MsgClaimIncentives { + address: string; +} +export interface MsgClaimIncentivesProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MsgClaimIncentives"; + value: Uint8Array; +} +export interface MsgClaimIncentivesAmino { + address: string; +} +export interface MsgClaimIncentivesAminoMsg { + type: "/crescent.marketmaker.v1beta1.MsgClaimIncentives"; + value: MsgClaimIncentivesAmino; +} +export interface MsgClaimIncentivesSDKType { + address: string; +} +export interface MsgClaimIncentivesResponse {} +export interface MsgClaimIncentivesResponseProtoMsg { + typeUrl: "/crescent.marketmaker.v1beta1.MsgClaimIncentivesResponse"; + value: Uint8Array; +} +export interface MsgClaimIncentivesResponseAmino {} +export interface MsgClaimIncentivesResponseAminoMsg { + type: "/crescent.marketmaker.v1beta1.MsgClaimIncentivesResponse"; + value: MsgClaimIncentivesResponseAmino; +} +export interface MsgClaimIncentivesResponseSDKType {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/genesis.ts new file mode 100644 index 000000000..7c1e0e75e --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/genesis.ts @@ -0,0 +1,28 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./mint"; +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisState { + /** last_block_time defines the last block time, which is used to calculate inflation. */ + lastBlockTime: Date; + /** params defines all the parameters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/crescent.mint.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateAmino { + /** last_block_time defines the last block time, which is used to calculate inflation. */ + last_block_time?: Date; + /** params defines all the parameters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/crescent.mint.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateSDKType { + last_block_time: Date; + params: ParamsSDKType; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/mint.ts b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/mint.ts new file mode 100644 index 000000000..daf571a54 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/crescent/mint/v1beta1/mint.ts @@ -0,0 +1,93 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +/** Params holds parameters for the mint module. */ +export interface Params { + /** mint_denom defines denomination of coin to be minted */ + mintDenom: string; + /** + * mint_pool_address defines the address where inflation will be minted. The default is FeeCollector, + * but if it is set to FeeCollector, minted inflation could be mixed together with collected tx fees. + * Therefore, it is recommended to specify a separate address depending on usage. + */ + mintPoolAddress: string; + /** + * block_time_threshold defines block time threshold to prevent from any inflationary manipulation attacks + * it is used for maximum block duration when calculating block inflation + */ + blockTimeThreshold: Duration; + /** inflation_schedules defines a list of inflation schedules */ + inflationSchedules: InflationSchedule[]; +} +export interface ParamsProtoMsg { + typeUrl: "/crescent.mint.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the mint module. */ +export interface ParamsAmino { + /** mint_denom defines denomination of coin to be minted */ + mint_denom: string; + /** + * mint_pool_address defines the address where inflation will be minted. The default is FeeCollector, + * but if it is set to FeeCollector, minted inflation could be mixed together with collected tx fees. + * Therefore, it is recommended to specify a separate address depending on usage. + */ + mint_pool_address: string; + /** + * block_time_threshold defines block time threshold to prevent from any inflationary manipulation attacks + * it is used for maximum block duration when calculating block inflation + */ + block_time_threshold?: DurationAmino; + /** inflation_schedules defines a list of inflation schedules */ + inflation_schedules: InflationScheduleAmino[]; +} +export interface ParamsAminoMsg { + type: "/crescent.mint.v1beta1.Params"; + value: ParamsAmino; +} +/** Params holds parameters for the mint module. */ +export interface ParamsSDKType { + mint_denom: string; + mint_pool_address: string; + block_time_threshold: DurationSDKType; + inflation_schedules: InflationScheduleSDKType[]; +} +/** + * InflationSchedule defines the start and end time of the inflation period, and the amount of inflation during that + * period. + */ +export interface InflationSchedule { + /** start_time defines the start date time for the inflation schedule */ + startTime: Date; + /** end_time defines the end date time for the inflation schedule */ + endTime: Date; + /** amount defines the total amount of inflation for the schedule */ + amount: string; +} +export interface InflationScheduleProtoMsg { + typeUrl: "/crescent.mint.v1beta1.InflationSchedule"; + value: Uint8Array; +} +/** + * InflationSchedule defines the start and end time of the inflation period, and the amount of inflation during that + * period. + */ +export interface InflationScheduleAmino { + /** start_time defines the start date time for the inflation schedule */ + start_time?: Date; + /** end_time defines the end date time for the inflation schedule */ + end_time?: Date; + /** amount defines the total amount of inflation for the schedule */ + amount: string; +} +export interface InflationScheduleAminoMsg { + type: "/crescent.mint.v1beta1.InflationSchedule"; + value: InflationScheduleAmino; +} +/** + * InflationSchedule defines the start and end time of the inflation period, and the amount of inflation during that + * period. + */ +export interface InflationScheduleSDKType { + start_time: Date; + end_time: Date; + amount: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts index b5687f182..4e8f480ce 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/bundle.ts @@ -1,20 +1,22 @@ -import * as _84 from "./api/annotations"; -import * as _85 from "./api/http"; -import * as _86 from "./protobuf/any"; -import * as _87 from "./protobuf/descriptor"; -import * as _88 from "./protobuf/duration"; -import * as _89 from "./protobuf/empty"; -import * as _90 from "./protobuf/timestamp"; +import * as _136 from "./api/annotations"; +import * as _137 from "./api/http"; +import * as _138 from "./protobuf/any"; +import * as _139 from "./protobuf/descriptor"; +import * as _140 from "./protobuf/duration"; +import * as _141 from "./protobuf/empty"; +import * as _142 from "./protobuf/timestamp"; +import * as _143 from "./protobuf/struct"; export namespace google { export const api = { - ..._84, - ..._85 + ..._136, + ..._137 }; export const protobuf = { - ..._86, - ..._87, - ..._88, - ..._89, - ..._90 + ..._138, + ..._139, + ..._140, + ..._141, + ..._142, + ..._143 }; } \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/struct.ts b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/struct.ts new file mode 100644 index 000000000..395670c21 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/google/protobuf/struct.ts @@ -0,0 +1,210 @@ +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1, +} +export const NullValueSDKType = NullValue; +export const NullValueAmino = NullValue; +export function nullValueFromJSON(object: any): NullValue { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} +export function nullValueToJSON(object: NullValue): string { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + case NullValue.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Struct_FieldsEntry { + key: string; + value: Value; +} +export interface Struct_FieldsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Struct_FieldsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface Struct_FieldsEntryAminoMsg { + type: string; + value: Struct_FieldsEntryAmino; +} +export interface Struct_FieldsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { + [key: string]: Value; + }; +} +export interface StructProtoMsg { + typeUrl: "/google.protobuf.Struct"; + value: Uint8Array; +} +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface StructAmino { + /** Unordered map of dynamically typed values. */ + fields?: { + [key: string]: ValueAmino; + }; +} +export interface StructAminoMsg { + type: "/google.protobuf.Struct"; + value: StructAmino; +} +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface StructSDKType { + fields: { + [key: string]: ValueSDKType; + }; +} +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** Represents a null value. */ + nullValue?: NullValue; + /** Represents a double value. */ + numberValue?: number; + /** Represents a string value. */ + stringValue?: string; + /** Represents a boolean value. */ + boolValue?: boolean; + /** Represents a structured value. */ + structValue?: Struct; + /** Represents a repeated `Value`. */ + listValue?: ListValue; +} +export interface ValueProtoMsg { + typeUrl: "/google.protobuf.Value"; + value: Uint8Array; +} +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface ValueAmino { + /** Represents a null value. */ + null_value?: NullValue; + /** Represents a double value. */ + number_value?: number; + /** Represents a string value. */ + string_value?: string; + /** Represents a boolean value. */ + bool_value?: boolean; + /** Represents a structured value. */ + struct_value?: StructAmino; + /** Represents a repeated `Value`. */ + list_value?: ListValueAmino; +} +export interface ValueAminoMsg { + type: "/google.protobuf.Value"; + value: ValueAmino; +} +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface ValueSDKType { + null_value?: NullValue; + number_value?: number; + string_value?: string; + bool_value?: boolean; + struct_value?: StructSDKType; + list_value?: ListValueSDKType; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: Value[]; +} +export interface ListValueProtoMsg { + typeUrl: "/google.protobuf.ListValue"; + value: Uint8Array; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValueAmino { + /** Repeated field of dynamically typed values. */ + values: ValueAmino[]; +} +export interface ListValueAminoMsg { + type: "/google.protobuf.ListValue"; + value: ListValueAmino; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValueSDKType { + values: ValueSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/grpc/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/grpc/bundle.ts new file mode 100644 index 000000000..bd21ce83f --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/grpc/bundle.ts @@ -0,0 +1,12 @@ +import * as _163 from "../protoc-gen-openapiv2/options/annotations"; +import * as _164 from "../protoc-gen-openapiv2/options/openapiv2"; +export namespace grpc { + export namespace gateway { + export namespace protoc_gen_openapiv2 { + export const options = { + ..._163, + ..._164 + }; + } + } +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts index 9d578b69f..1df2463d4 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/ibc/bundle.ts @@ -1,85 +1,85 @@ -import * as _91 from "./applications/transfer/v1/genesis"; -import * as _92 from "./applications/transfer/v1/transfer"; -import * as _93 from "./applications/transfer/v1/tx"; -import * as _94 from "./applications/transfer/v2/packet"; -import * as _95 from "./core/channel/v1/channel"; -import * as _96 from "./core/channel/v1/genesis"; -import * as _97 from "./core/channel/v1/tx"; -import * as _98 from "./core/client/v1/client"; -import * as _99 from "./core/client/v1/genesis"; -import * as _100 from "./core/client/v1/tx"; -import * as _101 from "./core/commitment/v1/commitment"; -import * as _102 from "./core/connection/v1/connection"; -import * as _103 from "./core/connection/v1/genesis"; -import * as _104 from "./core/connection/v1/tx"; -import * as _105 from "./core/types/v1/genesis"; -import * as _106 from "./lightclients/localhost/v1/localhost"; -import * as _107 from "./lightclients/solomachine/v1/solomachine"; -import * as _108 from "./lightclients/solomachine/v2/solomachine"; -import * as _109 from "./lightclients/tendermint/v1/tendermint"; +import * as _144 from "./applications/transfer/v1/genesis"; +import * as _145 from "./applications/transfer/v1/transfer"; +import * as _146 from "./applications/transfer/v1/tx"; +import * as _147 from "./applications/transfer/v2/packet"; +import * as _148 from "./core/channel/v1/channel"; +import * as _149 from "./core/channel/v1/genesis"; +import * as _150 from "./core/channel/v1/tx"; +import * as _151 from "./core/client/v1/client"; +import * as _152 from "./core/client/v1/genesis"; +import * as _153 from "./core/client/v1/tx"; +import * as _154 from "./core/commitment/v1/commitment"; +import * as _155 from "./core/connection/v1/connection"; +import * as _156 from "./core/connection/v1/genesis"; +import * as _157 from "./core/connection/v1/tx"; +import * as _158 from "./core/types/v1/genesis"; +import * as _159 from "./lightclients/localhost/v1/localhost"; +import * as _160 from "./lightclients/solomachine/v1/solomachine"; +import * as _161 from "./lightclients/solomachine/v2/solomachine"; +import * as _162 from "./lightclients/tendermint/v1/tendermint"; export namespace ibc { export namespace applications { export namespace transfer { export const v1 = { - ..._91, - ..._92, - ..._93 + ..._144, + ..._145, + ..._146 }; export const v2 = { - ..._94 + ..._147 }; } } export namespace core { export namespace channel { export const v1 = { - ..._95, - ..._96, - ..._97 + ..._148, + ..._149, + ..._150 }; } export namespace client { export const v1 = { - ..._98, - ..._99, - ..._100 + ..._151, + ..._152, + ..._153 }; } export namespace commitment { export const v1 = { - ..._101 + ..._154 }; } export namespace connection { export const v1 = { - ..._102, - ..._103, - ..._104 + ..._155, + ..._156, + ..._157 }; } export namespace types { export const v1 = { - ..._105 + ..._158 }; } } export namespace lightclients { export namespace localhost { export const v1 = { - ..._106 + ..._159 }; } export namespace solomachine { export const v1 = { - ..._107 + ..._160 }; export const v2 = { - ..._108 + ..._161 }; } export namespace tendermint { export const v1 = { - ..._109 + ..._162 }; } } diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/index.ts b/Crescent/crescent-starter/src/types/proto-interfaces/index.ts index 2a80bc607..bdcfdf024 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/index.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/index.ts @@ -8,6 +8,8 @@ export * from "./ics23/bundle"; export * from "./cosmos_proto/bundle"; export * from "./cosmos/bundle"; export * from "./cosmwasm/bundle"; +export * from "./crescent/bundle"; export * from "./google/bundle"; export * from "./ibc/bundle"; +export * from "./grpc/bundle"; export * from "./tendermint/bundle"; \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/annotations.ts b/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/annotations.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/annotations.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/openapiv2.ts b/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/openapiv2.ts new file mode 100644 index 000000000..3ed1ee00d --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/protoc-gen-openapiv2/options/openapiv2.ts @@ -0,0 +1,2279 @@ +import { Value, ValueAmino, ValueSDKType } from "../../google/protobuf/struct"; +import { Long } from "../../helpers"; +/** + * Scheme describes the schemes supported by the OpenAPI Swagger + * and Operation objects. + */ +export enum Scheme { + UNKNOWN = 0, + HTTP = 1, + HTTPS = 2, + WS = 3, + WSS = 4, + UNRECOGNIZED = -1, +} +export const SchemeSDKType = Scheme; +export const SchemeAmino = Scheme; +export function schemeFromJSON(object: any): Scheme { + switch (object) { + case 0: + case "UNKNOWN": + return Scheme.UNKNOWN; + case 1: + case "HTTP": + return Scheme.HTTP; + case 2: + case "HTTPS": + return Scheme.HTTPS; + case 3: + case "WS": + return Scheme.WS; + case 4: + case "WSS": + return Scheme.WSS; + case -1: + case "UNRECOGNIZED": + default: + return Scheme.UNRECOGNIZED; + } +} +export function schemeToJSON(object: Scheme): string { + switch (object) { + case Scheme.UNKNOWN: + return "UNKNOWN"; + case Scheme.HTTP: + return "HTTP"; + case Scheme.HTTPS: + return "HTTPS"; + case Scheme.WS: + return "WS"; + case Scheme.WSS: + return "WSS"; + case Scheme.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum JSONSchema_JSONSchemaSimpleTypes { + UNKNOWN = 0, + ARRAY = 1, + BOOLEAN = 2, + INTEGER = 3, + NULL = 4, + NUMBER = 5, + OBJECT = 6, + STRING = 7, + UNRECOGNIZED = -1, +} +export const JSONSchema_JSONSchemaSimpleTypesSDKType = JSONSchema_JSONSchemaSimpleTypes; +export const JSONSchema_JSONSchemaSimpleTypesAmino = JSONSchema_JSONSchemaSimpleTypes; +export function jSONSchema_JSONSchemaSimpleTypesFromJSON(object: any): JSONSchema_JSONSchemaSimpleTypes { + switch (object) { + case 0: + case "UNKNOWN": + return JSONSchema_JSONSchemaSimpleTypes.UNKNOWN; + case 1: + case "ARRAY": + return JSONSchema_JSONSchemaSimpleTypes.ARRAY; + case 2: + case "BOOLEAN": + return JSONSchema_JSONSchemaSimpleTypes.BOOLEAN; + case 3: + case "INTEGER": + return JSONSchema_JSONSchemaSimpleTypes.INTEGER; + case 4: + case "NULL": + return JSONSchema_JSONSchemaSimpleTypes.NULL; + case 5: + case "NUMBER": + return JSONSchema_JSONSchemaSimpleTypes.NUMBER; + case 6: + case "OBJECT": + return JSONSchema_JSONSchemaSimpleTypes.OBJECT; + case 7: + case "STRING": + return JSONSchema_JSONSchemaSimpleTypes.STRING; + case -1: + case "UNRECOGNIZED": + default: + return JSONSchema_JSONSchemaSimpleTypes.UNRECOGNIZED; + } +} +export function jSONSchema_JSONSchemaSimpleTypesToJSON(object: JSONSchema_JSONSchemaSimpleTypes): string { + switch (object) { + case JSONSchema_JSONSchemaSimpleTypes.UNKNOWN: + return "UNKNOWN"; + case JSONSchema_JSONSchemaSimpleTypes.ARRAY: + return "ARRAY"; + case JSONSchema_JSONSchemaSimpleTypes.BOOLEAN: + return "BOOLEAN"; + case JSONSchema_JSONSchemaSimpleTypes.INTEGER: + return "INTEGER"; + case JSONSchema_JSONSchemaSimpleTypes.NULL: + return "NULL"; + case JSONSchema_JSONSchemaSimpleTypes.NUMBER: + return "NUMBER"; + case JSONSchema_JSONSchemaSimpleTypes.OBJECT: + return "OBJECT"; + case JSONSchema_JSONSchemaSimpleTypes.STRING: + return "STRING"; + case JSONSchema_JSONSchemaSimpleTypes.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * The type of the security scheme. Valid values are "basic", + * "apiKey" or "oauth2". + */ +export enum SecurityScheme_Type { + TYPE_INVALID = 0, + TYPE_BASIC = 1, + TYPE_API_KEY = 2, + TYPE_OAUTH2 = 3, + UNRECOGNIZED = -1, +} +export const SecurityScheme_TypeSDKType = SecurityScheme_Type; +export const SecurityScheme_TypeAmino = SecurityScheme_Type; +export function securityScheme_TypeFromJSON(object: any): SecurityScheme_Type { + switch (object) { + case 0: + case "TYPE_INVALID": + return SecurityScheme_Type.TYPE_INVALID; + case 1: + case "TYPE_BASIC": + return SecurityScheme_Type.TYPE_BASIC; + case 2: + case "TYPE_API_KEY": + return SecurityScheme_Type.TYPE_API_KEY; + case 3: + case "TYPE_OAUTH2": + return SecurityScheme_Type.TYPE_OAUTH2; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_Type.UNRECOGNIZED; + } +} +export function securityScheme_TypeToJSON(object: SecurityScheme_Type): string { + switch (object) { + case SecurityScheme_Type.TYPE_INVALID: + return "TYPE_INVALID"; + case SecurityScheme_Type.TYPE_BASIC: + return "TYPE_BASIC"; + case SecurityScheme_Type.TYPE_API_KEY: + return "TYPE_API_KEY"; + case SecurityScheme_Type.TYPE_OAUTH2: + return "TYPE_OAUTH2"; + case SecurityScheme_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** The location of the API key. Valid values are "query" or "header". */ +export enum SecurityScheme_In { + IN_INVALID = 0, + IN_QUERY = 1, + IN_HEADER = 2, + UNRECOGNIZED = -1, +} +export const SecurityScheme_InSDKType = SecurityScheme_In; +export const SecurityScheme_InAmino = SecurityScheme_In; +export function securityScheme_InFromJSON(object: any): SecurityScheme_In { + switch (object) { + case 0: + case "IN_INVALID": + return SecurityScheme_In.IN_INVALID; + case 1: + case "IN_QUERY": + return SecurityScheme_In.IN_QUERY; + case 2: + case "IN_HEADER": + return SecurityScheme_In.IN_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_In.UNRECOGNIZED; + } +} +export function securityScheme_InToJSON(object: SecurityScheme_In): string { + switch (object) { + case SecurityScheme_In.IN_INVALID: + return "IN_INVALID"; + case SecurityScheme_In.IN_QUERY: + return "IN_QUERY"; + case SecurityScheme_In.IN_HEADER: + return "IN_HEADER"; + case SecurityScheme_In.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + */ +export enum SecurityScheme_Flow { + FLOW_INVALID = 0, + FLOW_IMPLICIT = 1, + FLOW_PASSWORD = 2, + FLOW_APPLICATION = 3, + FLOW_ACCESS_CODE = 4, + UNRECOGNIZED = -1, +} +export const SecurityScheme_FlowSDKType = SecurityScheme_Flow; +export const SecurityScheme_FlowAmino = SecurityScheme_Flow; +export function securityScheme_FlowFromJSON(object: any): SecurityScheme_Flow { + switch (object) { + case 0: + case "FLOW_INVALID": + return SecurityScheme_Flow.FLOW_INVALID; + case 1: + case "FLOW_IMPLICIT": + return SecurityScheme_Flow.FLOW_IMPLICIT; + case 2: + case "FLOW_PASSWORD": + return SecurityScheme_Flow.FLOW_PASSWORD; + case 3: + case "FLOW_APPLICATION": + return SecurityScheme_Flow.FLOW_APPLICATION; + case 4: + case "FLOW_ACCESS_CODE": + return SecurityScheme_Flow.FLOW_ACCESS_CODE; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_Flow.UNRECOGNIZED; + } +} +export function securityScheme_FlowToJSON(object: SecurityScheme_Flow): string { + switch (object) { + case SecurityScheme_Flow.FLOW_INVALID: + return "FLOW_INVALID"; + case SecurityScheme_Flow.FLOW_IMPLICIT: + return "FLOW_IMPLICIT"; + case SecurityScheme_Flow.FLOW_PASSWORD: + return "FLOW_PASSWORD"; + case SecurityScheme_Flow.FLOW_APPLICATION: + return "FLOW_APPLICATION"; + case SecurityScheme_Flow.FLOW_ACCESS_CODE: + return "FLOW_ACCESS_CODE"; + case SecurityScheme_Flow.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Swagger_ResponsesEntry { + key: string; + value: Response; +} +export interface Swagger_ResponsesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Swagger_ResponsesEntryAmino { + key: string; + value?: ResponseAmino; +} +export interface Swagger_ResponsesEntryAminoMsg { + type: string; + value: Swagger_ResponsesEntryAmino; +} +export interface Swagger_ResponsesEntrySDKType { + key: string; + value: ResponseSDKType; +} +export interface Swagger_ExtensionsEntry { + key: string; + value: Value; +} +export interface Swagger_ExtensionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Swagger_ExtensionsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface Swagger_ExtensionsEntryAminoMsg { + type: string; + value: Swagger_ExtensionsEntryAmino; +} +export interface Swagger_ExtensionsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `Swagger` is a representation of OpenAPI v2 specification's Swagger object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * schemes: HTTPS; + * consumes: "application/json"; + * produces: "application/json"; + * }; + */ +export interface Swagger { + /** + * Specifies the OpenAPI Specification version being used. It can be + * used by the OpenAPI UI and other clients to interpret the API listing. The + * value MUST be "2.0". + */ + swagger: string; + /** + * Provides metadata about the API. The metadata can be used by the + * clients if needed. + */ + info: Info; + /** + * The host (name or ip) serving the API. This MUST be the host only and does + * not include the scheme nor sub-paths. It MAY include a port. If the host is + * not included, the host serving the documentation is to be used (including + * the port). The host does not support path templating. + */ + host: string; + /** + * The base path on which the API is served, which is relative to the host. If + * it is not included, the API is served directly under the host. The value + * MUST start with a leading slash (/). The basePath does not support path + * templating. + * Note that using `base_path` does not change the endpoint paths that are + * generated in the resulting OpenAPI file. If you wish to use `base_path` + * with relatively generated OpenAPI paths, the `base_path` prefix must be + * manually removed from your `google.api.http` paths and your code changed to + * serve the API from the `base_path`. + */ + basePath: string; + /** + * The transfer protocol of the API. Values MUST be from the list: "http", + * "https", "ws", "wss". If the schemes is not included, the default scheme to + * be used is the one used to access the OpenAPI definition itself. + */ + schemes: Scheme[]; + /** + * A list of MIME types the APIs can consume. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the APIs can produce. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + produces: string[]; + /** + * An object to hold responses that can be used across operations. This + * property does not define global responses for all operations. + */ + responses: { + [key: string]: Response; + }; + /** Security scheme definitions that can be used across the specification. */ + securityDefinitions: SecurityDefinitions; + /** + * A declaration of which security schemes are applied for the API as a whole. + * The list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). + * Individual operations can override this definition. + */ + security: SecurityRequirement[]; + /** Additional external documentation. */ + externalDocs: ExternalDocumentation; + extensions: { + [key: string]: Value; + }; +} +export interface SwaggerProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Swagger"; + value: Uint8Array; +} +/** + * `Swagger` is a representation of OpenAPI v2 specification's Swagger object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * schemes: HTTPS; + * consumes: "application/json"; + * produces: "application/json"; + * }; + */ +export interface SwaggerAmino { + /** + * Specifies the OpenAPI Specification version being used. It can be + * used by the OpenAPI UI and other clients to interpret the API listing. The + * value MUST be "2.0". + */ + swagger: string; + /** + * Provides metadata about the API. The metadata can be used by the + * clients if needed. + */ + info?: InfoAmino; + /** + * The host (name or ip) serving the API. This MUST be the host only and does + * not include the scheme nor sub-paths. It MAY include a port. If the host is + * not included, the host serving the documentation is to be used (including + * the port). The host does not support path templating. + */ + host: string; + /** + * The base path on which the API is served, which is relative to the host. If + * it is not included, the API is served directly under the host. The value + * MUST start with a leading slash (/). The basePath does not support path + * templating. + * Note that using `base_path` does not change the endpoint paths that are + * generated in the resulting OpenAPI file. If you wish to use `base_path` + * with relatively generated OpenAPI paths, the `base_path` prefix must be + * manually removed from your `google.api.http` paths and your code changed to + * serve the API from the `base_path`. + */ + base_path: string; + /** + * The transfer protocol of the API. Values MUST be from the list: "http", + * "https", "ws", "wss". If the schemes is not included, the default scheme to + * be used is the one used to access the OpenAPI definition itself. + */ + schemes: Scheme[]; + /** + * A list of MIME types the APIs can consume. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the APIs can produce. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + produces: string[]; + /** + * An object to hold responses that can be used across operations. This + * property does not define global responses for all operations. + */ + responses?: { + [key: string]: ResponseAmino; + }; + /** Security scheme definitions that can be used across the specification. */ + security_definitions?: SecurityDefinitionsAmino; + /** + * A declaration of which security schemes are applied for the API as a whole. + * The list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). + * Individual operations can override this definition. + */ + security: SecurityRequirementAmino[]; + /** Additional external documentation. */ + external_docs?: ExternalDocumentationAmino; + extensions?: { + [key: string]: ValueAmino; + }; +} +export interface SwaggerAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Swagger"; + value: SwaggerAmino; +} +/** + * `Swagger` is a representation of OpenAPI v2 specification's Swagger object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * schemes: HTTPS; + * consumes: "application/json"; + * produces: "application/json"; + * }; + */ +export interface SwaggerSDKType { + swagger: string; + info: InfoSDKType; + host: string; + base_path: string; + schemes: Scheme[]; + consumes: string[]; + produces: string[]; + responses: { + [key: string]: ResponseSDKType; + }; + security_definitions: SecurityDefinitionsSDKType; + security: SecurityRequirementSDKType[]; + external_docs: ExternalDocumentationSDKType; + extensions: { + [key: string]: ValueSDKType; + }; +} +export interface Operation_ResponsesEntry { + key: string; + value: Response; +} +export interface Operation_ResponsesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Operation_ResponsesEntryAmino { + key: string; + value?: ResponseAmino; +} +export interface Operation_ResponsesEntryAminoMsg { + type: string; + value: Operation_ResponsesEntryAmino; +} +export interface Operation_ResponsesEntrySDKType { + key: string; + value: ResponseSDKType; +} +export interface Operation_ExtensionsEntry { + key: string; + value: Value; +} +export interface Operation_ExtensionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Operation_ExtensionsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface Operation_ExtensionsEntryAminoMsg { + type: string; + value: Operation_ExtensionsEntryAmino; +} +export interface Operation_ExtensionsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `Operation` is a representation of OpenAPI v2 specification's Operation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject + * + * Example: + * + * service EchoService { + * rpc Echo(SimpleMessage) returns (SimpleMessage) { + * option (google.api.http) = { + * get: "/v1/example/echo/{id}" + * }; + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + * summary: "Get a message."; + * operation_id: "getMessage"; + * tags: "echo"; + * responses: { + * key: "200" + * value: { + * description: "OK"; + * } + * } + * }; + * } + * } + */ +export interface Operation { + /** + * A list of tags for API documentation control. Tags can be used for logical + * grouping of operations by resources or any other qualifier. + */ + tags: string[]; + /** + * A short summary of what the operation does. For maximum readability in the + * swagger-ui, this field SHOULD be less than 120 characters. + */ + summary: string; + /** + * A verbose explanation of the operation behavior. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** Additional external documentation for this operation. */ + externalDocs: ExternalDocumentation; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. Tools and libraries MAY use the + * operationId to uniquely identify an operation, therefore, it is recommended + * to follow common programming naming conventions. + */ + operationId: string; + /** + * A list of MIME types the operation can consume. This overrides the consumes + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the operation can produce. This overrides the produces + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + produces: string[]; + /** + * The list of possible responses as they are returned from executing this + * operation. + */ + responses: { + [key: string]: Response; + }; + /** + * The transfer protocol for the operation. Values MUST be from the list: + * "http", "https", "ws", "wss". The value overrides the OpenAPI Object + * schemes definition. + */ + schemes: Scheme[]; + /** + * Declares this operation to be deprecated. Usage of the declared operation + * should be refrained. Default value is false. + */ + deprecated: boolean; + /** + * A declaration of which security schemes are applied for this operation. The + * list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). This + * definition overrides any declared top-level security. To remove a top-level + * security declaration, an empty array can be used. + */ + security: SecurityRequirement[]; + extensions: { + [key: string]: Value; + }; +} +export interface OperationProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Operation"; + value: Uint8Array; +} +/** + * `Operation` is a representation of OpenAPI v2 specification's Operation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject + * + * Example: + * + * service EchoService { + * rpc Echo(SimpleMessage) returns (SimpleMessage) { + * option (google.api.http) = { + * get: "/v1/example/echo/{id}" + * }; + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + * summary: "Get a message."; + * operation_id: "getMessage"; + * tags: "echo"; + * responses: { + * key: "200" + * value: { + * description: "OK"; + * } + * } + * }; + * } + * } + */ +export interface OperationAmino { + /** + * A list of tags for API documentation control. Tags can be used for logical + * grouping of operations by resources or any other qualifier. + */ + tags: string[]; + /** + * A short summary of what the operation does. For maximum readability in the + * swagger-ui, this field SHOULD be less than 120 characters. + */ + summary: string; + /** + * A verbose explanation of the operation behavior. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** Additional external documentation for this operation. */ + external_docs?: ExternalDocumentationAmino; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. Tools and libraries MAY use the + * operationId to uniquely identify an operation, therefore, it is recommended + * to follow common programming naming conventions. + */ + operation_id: string; + /** + * A list of MIME types the operation can consume. This overrides the consumes + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the operation can produce. This overrides the produces + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + produces: string[]; + /** + * The list of possible responses as they are returned from executing this + * operation. + */ + responses?: { + [key: string]: ResponseAmino; + }; + /** + * The transfer protocol for the operation. Values MUST be from the list: + * "http", "https", "ws", "wss". The value overrides the OpenAPI Object + * schemes definition. + */ + schemes: Scheme[]; + /** + * Declares this operation to be deprecated. Usage of the declared operation + * should be refrained. Default value is false. + */ + deprecated: boolean; + /** + * A declaration of which security schemes are applied for this operation. The + * list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). This + * definition overrides any declared top-level security. To remove a top-level + * security declaration, an empty array can be used. + */ + security: SecurityRequirementAmino[]; + extensions?: { + [key: string]: ValueAmino; + }; +} +export interface OperationAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Operation"; + value: OperationAmino; +} +/** + * `Operation` is a representation of OpenAPI v2 specification's Operation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject + * + * Example: + * + * service EchoService { + * rpc Echo(SimpleMessage) returns (SimpleMessage) { + * option (google.api.http) = { + * get: "/v1/example/echo/{id}" + * }; + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + * summary: "Get a message."; + * operation_id: "getMessage"; + * tags: "echo"; + * responses: { + * key: "200" + * value: { + * description: "OK"; + * } + * } + * }; + * } + * } + */ +export interface OperationSDKType { + tags: string[]; + summary: string; + description: string; + external_docs: ExternalDocumentationSDKType; + operation_id: string; + consumes: string[]; + produces: string[]; + responses: { + [key: string]: ResponseSDKType; + }; + schemes: Scheme[]; + deprecated: boolean; + security: SecurityRequirementSDKType[]; + extensions: { + [key: string]: ValueSDKType; + }; +} +/** + * `Header` is a representation of OpenAPI v2 specification's Header object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject + */ +export interface Header { + /** `Description` is a short description of the header. */ + description: string; + /** The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. */ + type: string; + /** `Format` The extending format for the previously mentioned type. */ + format: string; + /** + * `Default` Declares the value of the header that the server will use if none is provided. + * See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + * Unlike JSON Schema this value MUST conform to the defined type for the header. + */ + default: string; + /** 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. */ + pattern: string; +} +export interface HeaderProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Header"; + value: Uint8Array; +} +/** + * `Header` is a representation of OpenAPI v2 specification's Header object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject + */ +export interface HeaderAmino { + /** `Description` is a short description of the header. */ + description: string; + /** The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. */ + type: string; + /** `Format` The extending format for the previously mentioned type. */ + format: string; + /** + * `Default` Declares the value of the header that the server will use if none is provided. + * See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + * Unlike JSON Schema this value MUST conform to the defined type for the header. + */ + default: string; + /** 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. */ + pattern: string; +} +export interface HeaderAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Header"; + value: HeaderAmino; +} +/** + * `Header` is a representation of OpenAPI v2 specification's Header object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject + */ +export interface HeaderSDKType { + description: string; + type: string; + format: string; + default: string; + pattern: string; +} +export interface Response_HeadersEntry { + key: string; + value: Header; +} +export interface Response_HeadersEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Response_HeadersEntryAmino { + key: string; + value?: HeaderAmino; +} +export interface Response_HeadersEntryAminoMsg { + type: string; + value: Response_HeadersEntryAmino; +} +export interface Response_HeadersEntrySDKType { + key: string; + value: HeaderSDKType; +} +export interface Response_ExamplesEntry { + key: string; + value: string; +} +export interface Response_ExamplesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Response_ExamplesEntryAmino { + key: string; + value: string; +} +export interface Response_ExamplesEntryAminoMsg { + type: string; + value: Response_ExamplesEntryAmino; +} +export interface Response_ExamplesEntrySDKType { + key: string; + value: string; +} +export interface Response_ExtensionsEntry { + key: string; + value: Value; +} +export interface Response_ExtensionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Response_ExtensionsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface Response_ExtensionsEntryAminoMsg { + type: string; + value: Response_ExtensionsEntryAmino; +} +export interface Response_ExtensionsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `Response` is a representation of OpenAPI v2 specification's Response object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject + */ +export interface Response { + /** + * `Description` is a short description of the response. + * GFM syntax can be used for rich text representation. + */ + description: string; + /** + * `Schema` optionally defines the structure of the response. + * If `Schema` is not provided, it means there is no content to the response. + */ + schema: Schema; + /** + * `Headers` A list of headers that are sent with the response. + * `Header` name is expected to be a string in the canonical format of the MIME header key + * See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + */ + headers: { + [key: string]: Header; + }; + /** + * `Examples` gives per-mimetype response examples. + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + */ + examples: { + [key: string]: string; + }; + extensions: { + [key: string]: Value; + }; +} +export interface ResponseProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Response"; + value: Uint8Array; +} +/** + * `Response` is a representation of OpenAPI v2 specification's Response object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject + */ +export interface ResponseAmino { + /** + * `Description` is a short description of the response. + * GFM syntax can be used for rich text representation. + */ + description: string; + /** + * `Schema` optionally defines the structure of the response. + * If `Schema` is not provided, it means there is no content to the response. + */ + schema?: SchemaAmino; + /** + * `Headers` A list of headers that are sent with the response. + * `Header` name is expected to be a string in the canonical format of the MIME header key + * See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + */ + headers?: { + [key: string]: HeaderAmino; + }; + /** + * `Examples` gives per-mimetype response examples. + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + */ + examples: { + [key: string]: string; + }; + extensions?: { + [key: string]: ValueAmino; + }; +} +export interface ResponseAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Response"; + value: ResponseAmino; +} +/** + * `Response` is a representation of OpenAPI v2 specification's Response object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject + */ +export interface ResponseSDKType { + description: string; + schema: SchemaSDKType; + headers: { + [key: string]: HeaderSDKType; + }; + examples: { + [key: string]: string; + }; + extensions: { + [key: string]: ValueSDKType; + }; +} +export interface Info_ExtensionsEntry { + key: string; + value: Value; +} +export interface Info_ExtensionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Info_ExtensionsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface Info_ExtensionsEntryAminoMsg { + type: string; + value: Info_ExtensionsEntryAmino; +} +export interface Info_ExtensionsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `Info` is a representation of OpenAPI v2 specification's Info object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * ... + * }; + */ +export interface Info { + /** The title of the application. */ + title: string; + /** + * A short description of the application. GFM syntax can be used for rich + * text representation. + */ + description: string; + /** The Terms of Service for the API. */ + termsOfService: string; + /** The contact information for the exposed API. */ + contact: Contact; + /** The license information for the exposed API. */ + license: License; + /** + * Provides the version of the application API (not to be confused + * with the specification version). + */ + version: string; + extensions: { + [key: string]: Value; + }; +} +export interface InfoProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Info"; + value: Uint8Array; +} +/** + * `Info` is a representation of OpenAPI v2 specification's Info object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * ... + * }; + */ +export interface InfoAmino { + /** The title of the application. */ + title: string; + /** + * A short description of the application. GFM syntax can be used for rich + * text representation. + */ + description: string; + /** The Terms of Service for the API. */ + terms_of_service: string; + /** The contact information for the exposed API. */ + contact?: ContactAmino; + /** The license information for the exposed API. */ + license?: LicenseAmino; + /** + * Provides the version of the application API (not to be confused + * with the specification version). + */ + version: string; + extensions?: { + [key: string]: ValueAmino; + }; +} +export interface InfoAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Info"; + value: InfoAmino; +} +/** + * `Info` is a representation of OpenAPI v2 specification's Info object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: "; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * }; + * ... + * }; + */ +export interface InfoSDKType { + title: string; + description: string; + terms_of_service: string; + contact: ContactSDKType; + license: LicenseSDKType; + version: string; + extensions: { + [key: string]: ValueSDKType; + }; +} +/** + * `Contact` is a representation of OpenAPI v2 specification's Contact object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * ... + * }; + * ... + * }; + */ +export interface Contact { + /** The identifying name of the contact person/organization. */ + name: string; + /** + * The URL pointing to the contact information. MUST be in the format of a + * URL. + */ + url: string; + /** + * The email address of the contact person/organization. MUST be in the format + * of an email address. + */ + email: string; +} +export interface ContactProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Contact"; + value: Uint8Array; +} +/** + * `Contact` is a representation of OpenAPI v2 specification's Contact object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * ... + * }; + * ... + * }; + */ +export interface ContactAmino { + /** The identifying name of the contact person/organization. */ + name: string; + /** + * The URL pointing to the contact information. MUST be in the format of a + * URL. + */ + url: string; + /** + * The email address of the contact person/organization. MUST be in the format + * of an email address. + */ + email: string; +} +export interface ContactAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Contact"; + value: ContactAmino; +} +/** + * `Contact` is a representation of OpenAPI v2 specification's Contact object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * ... + * }; + * ... + * }; + */ +export interface ContactSDKType { + name: string; + url: string; + email: string; +} +/** + * `License` is a representation of OpenAPI v2 specification's License object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * ... + * }; + * ... + * }; + */ +export interface License { + /** The license name used for the API. */ + name: string; + /** A URL to the license used for the API. MUST be in the format of a URL. */ + url: string; +} +export interface LicenseProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.License"; + value: Uint8Array; +} +/** + * `License` is a representation of OpenAPI v2 specification's License object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * ... + * }; + * ... + * }; + */ +export interface LicenseAmino { + /** The license name used for the API. */ + name: string; + /** A URL to the license used for the API. MUST be in the format of a URL. */ + url: string; +} +export interface LicenseAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.License"; + value: LicenseAmino; +} +/** + * `License` is a representation of OpenAPI v2 specification's License object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + * }; + * ... + * }; + * ... + * }; + */ +export interface LicenseSDKType { + name: string; + url: string; +} +/** + * `ExternalDocumentation` is a representation of OpenAPI v2 specification's + * ExternalDocumentation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * ... + * external_docs: { + * description: "More about gRPC-Gateway"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * } + * ... + * }; + */ +export interface ExternalDocumentation { + /** + * A short description of the target documentation. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** + * The URL for the target documentation. Value MUST be in the format + * of a URL. + */ + url: string; +} +export interface ExternalDocumentationProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation"; + value: Uint8Array; +} +/** + * `ExternalDocumentation` is a representation of OpenAPI v2 specification's + * ExternalDocumentation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * ... + * external_docs: { + * description: "More about gRPC-Gateway"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * } + * ... + * }; + */ +export interface ExternalDocumentationAmino { + /** + * A short description of the target documentation. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** + * The URL for the target documentation. Value MUST be in the format + * of a URL. + */ + url: string; +} +export interface ExternalDocumentationAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation"; + value: ExternalDocumentationAmino; +} +/** + * `ExternalDocumentation` is a representation of OpenAPI v2 specification's + * ExternalDocumentation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * ... + * external_docs: { + * description: "More about gRPC-Gateway"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * } + * ... + * }; + */ +export interface ExternalDocumentationSDKType { + description: string; + url: string; +} +/** + * `Schema` is a representation of OpenAPI v2 specification's Schema object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ +export interface Schema { + jsonSchema: JSONSchema; + /** + * Adds support for polymorphism. The discriminator is the schema property + * name that is used to differentiate between other schema that inherit this + * schema. The property name used MUST be defined at this schema and it MUST + * be in the required property list. When used, the value MUST be the name of + * this schema or any schema that inherits it. + */ + discriminator: string; + /** + * Relevant only for Schema "properties" definitions. Declares the property as + * "read only". This means that it MAY be sent as part of a response but MUST + * NOT be sent as part of the request. Properties marked as readOnly being + * true SHOULD NOT be in the required list of the defined schema. Default + * value is false. + */ + readOnly: boolean; + /** Additional external documentation for this schema. */ + externalDocs: ExternalDocumentation; + /** + * A free-form property to include an example of an instance for this schema in JSON. + * This is copied verbatim to the output. + */ + example: string; +} +export interface SchemaProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Schema"; + value: Uint8Array; +} +/** + * `Schema` is a representation of OpenAPI v2 specification's Schema object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ +export interface SchemaAmino { + json_schema?: JSONSchemaAmino; + /** + * Adds support for polymorphism. The discriminator is the schema property + * name that is used to differentiate between other schema that inherit this + * schema. The property name used MUST be defined at this schema and it MUST + * be in the required property list. When used, the value MUST be the name of + * this schema or any schema that inherits it. + */ + discriminator: string; + /** + * Relevant only for Schema "properties" definitions. Declares the property as + * "read only". This means that it MAY be sent as part of a response but MUST + * NOT be sent as part of the request. Properties marked as readOnly being + * true SHOULD NOT be in the required list of the defined schema. Default + * value is false. + */ + read_only: boolean; + /** Additional external documentation for this schema. */ + external_docs?: ExternalDocumentationAmino; + /** + * A free-form property to include an example of an instance for this schema in JSON. + * This is copied verbatim to the output. + */ + example: string; +} +export interface SchemaAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Schema"; + value: SchemaAmino; +} +/** + * `Schema` is a representation of OpenAPI v2 specification's Schema object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ +export interface SchemaSDKType { + json_schema: JSONSchemaSDKType; + discriminator: string; + read_only: boolean; + external_docs: ExternalDocumentationSDKType; + example: string; +} +/** + * `JSONSchema` represents properties from JSON Schema taken, and as used, in + * the OpenAPI v2 spec. + * + * This includes changes made by OpenAPI v2. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + * + * See also: https://cswr.github.io/JsonSchema/spec/basic_types/, + * https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json + * + * Example: + * + * message SimpleMessage { + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + * json_schema: { + * title: "SimpleMessage" + * description: "A simple message." + * required: ["id"] + * } + * }; + * + * // Id represents the message identifier. + * string id = 1; [ + * (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * {description: "The unique identifier of the simple message." + * }]; + * } + */ +export interface JSONSchema { + /** + * Ref is used to define an external reference to include in the message. + * This could be a fully qualified proto message reference, and that type must + * be imported into the protofile. If no message is identified, the Ref will + * be used verbatim in the output. + * For example: + * `ref: ".google.protobuf.Timestamp"`. + */ + ref: string; + /** The title of the schema. */ + title: string; + /** A short description of the schema. */ + description: string; + default: string; + readOnly: boolean; + /** + * A free-form property to include a JSON example of this field. This is copied + * verbatim to the output swagger.json. Quotes must be escaped. + * This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ + example: string; + multipleOf: number; + /** + * Maximum represents an inclusive upper limit for a numeric instance. The + * value of MUST be a number, + */ + maximum: number; + exclusiveMaximum: boolean; + /** + * minimum represents an inclusive lower limit for a numeric instance. The + * value of MUST be a number, + */ + minimum: number; + exclusiveMinimum: boolean; + maxLength: Long; + minLength: Long; + pattern: string; + maxItems: Long; + minItems: Long; + uniqueItems: boolean; + maxProperties: Long; + minProperties: Long; + required: string[]; + /** Items in 'array' must be unique. */ + array: string[]; + type: JSONSchema_JSONSchemaSimpleTypes[]; + /** `Format` */ + format: string; + /** Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 */ + enum: string[]; +} +export interface JSONSchemaProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.JSONSchema"; + value: Uint8Array; +} +/** + * `JSONSchema` represents properties from JSON Schema taken, and as used, in + * the OpenAPI v2 spec. + * + * This includes changes made by OpenAPI v2. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + * + * See also: https://cswr.github.io/JsonSchema/spec/basic_types/, + * https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json + * + * Example: + * + * message SimpleMessage { + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + * json_schema: { + * title: "SimpleMessage" + * description: "A simple message." + * required: ["id"] + * } + * }; + * + * // Id represents the message identifier. + * string id = 1; [ + * (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * {description: "The unique identifier of the simple message." + * }]; + * } + */ +export interface JSONSchemaAmino { + /** + * Ref is used to define an external reference to include in the message. + * This could be a fully qualified proto message reference, and that type must + * be imported into the protofile. If no message is identified, the Ref will + * be used verbatim in the output. + * For example: + * `ref: ".google.protobuf.Timestamp"`. + */ + ref: string; + /** The title of the schema. */ + title: string; + /** A short description of the schema. */ + description: string; + default: string; + read_only: boolean; + /** + * A free-form property to include a JSON example of this field. This is copied + * verbatim to the output swagger.json. Quotes must be escaped. + * This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ + example: string; + multiple_of: number; + /** + * Maximum represents an inclusive upper limit for a numeric instance. The + * value of MUST be a number, + */ + maximum: number; + exclusive_maximum: boolean; + /** + * minimum represents an inclusive lower limit for a numeric instance. The + * value of MUST be a number, + */ + minimum: number; + exclusive_minimum: boolean; + max_length: string; + min_length: string; + pattern: string; + max_items: string; + min_items: string; + unique_items: boolean; + max_properties: string; + min_properties: string; + required: string[]; + /** Items in 'array' must be unique. */ + array: string[]; + type: JSONSchema_JSONSchemaSimpleTypes[]; + /** `Format` */ + format: string; + /** Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 */ + enum: string[]; +} +export interface JSONSchemaAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.JSONSchema"; + value: JSONSchemaAmino; +} +/** + * `JSONSchema` represents properties from JSON Schema taken, and as used, in + * the OpenAPI v2 spec. + * + * This includes changes made by OpenAPI v2. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + * + * See also: https://cswr.github.io/JsonSchema/spec/basic_types/, + * https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json + * + * Example: + * + * message SimpleMessage { + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + * json_schema: { + * title: "SimpleMessage" + * description: "A simple message." + * required: ["id"] + * } + * }; + * + * // Id represents the message identifier. + * string id = 1; [ + * (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * {description: "The unique identifier of the simple message." + * }]; + * } + */ +export interface JSONSchemaSDKType { + ref: string; + title: string; + description: string; + default: string; + read_only: boolean; + example: string; + multiple_of: number; + maximum: number; + exclusive_maximum: boolean; + minimum: number; + exclusive_minimum: boolean; + max_length: Long; + min_length: Long; + pattern: string; + max_items: Long; + min_items: Long; + unique_items: boolean; + max_properties: Long; + min_properties: Long; + required: string[]; + array: string[]; + type: JSONSchema_JSONSchemaSimpleTypes[]; + format: string; + enum: string[]; +} +/** + * `Tag` is a representation of OpenAPI v2 specification's Tag object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject + */ +export interface Tag { + /** + * A short description for the tag. GFM syntax can be used for rich text + * representation. + */ + description: string; + /** Additional external documentation for this tag. */ + externalDocs: ExternalDocumentation; +} +export interface TagProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Tag"; + value: Uint8Array; +} +/** + * `Tag` is a representation of OpenAPI v2 specification's Tag object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject + */ +export interface TagAmino { + /** + * A short description for the tag. GFM syntax can be used for rich text + * representation. + */ + description: string; + /** Additional external documentation for this tag. */ + external_docs?: ExternalDocumentationAmino; +} +export interface TagAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Tag"; + value: TagAmino; +} +/** + * `Tag` is a representation of OpenAPI v2 specification's Tag object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject + */ +export interface TagSDKType { + description: string; + external_docs: ExternalDocumentationSDKType; +} +export interface SecurityDefinitions_SecurityEntry { + key: string; + value: SecurityScheme; +} +export interface SecurityDefinitions_SecurityEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface SecurityDefinitions_SecurityEntryAmino { + key: string; + value?: SecuritySchemeAmino; +} +export interface SecurityDefinitions_SecurityEntryAminoMsg { + type: string; + value: SecurityDefinitions_SecurityEntryAmino; +} +export interface SecurityDefinitions_SecurityEntrySDKType { + key: string; + value: SecuritySchemeSDKType; +} +/** + * `SecurityDefinitions` is a representation of OpenAPI v2 specification's + * Security Definitions object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject + * + * A declaration of the security schemes available to be used in the + * specification. This does not enforce the security schemes on the operations + * and only serves to provide the relevant details for each scheme. + */ +export interface SecurityDefinitions { + /** + * A single security scheme definition, mapping a "name" to the scheme it + * defines. + */ + security: { + [key: string]: SecurityScheme; + }; +} +export interface SecurityDefinitionsProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions"; + value: Uint8Array; +} +/** + * `SecurityDefinitions` is a representation of OpenAPI v2 specification's + * Security Definitions object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject + * + * A declaration of the security schemes available to be used in the + * specification. This does not enforce the security schemes on the operations + * and only serves to provide the relevant details for each scheme. + */ +export interface SecurityDefinitionsAmino { + /** + * A single security scheme definition, mapping a "name" to the scheme it + * defines. + */ + security?: { + [key: string]: SecuritySchemeAmino; + }; +} +export interface SecurityDefinitionsAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions"; + value: SecurityDefinitionsAmino; +} +/** + * `SecurityDefinitions` is a representation of OpenAPI v2 specification's + * Security Definitions object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject + * + * A declaration of the security schemes available to be used in the + * specification. This does not enforce the security schemes on the operations + * and only serves to provide the relevant details for each scheme. + */ +export interface SecurityDefinitionsSDKType { + security: { + [key: string]: SecuritySchemeSDKType; + }; +} +export interface SecurityScheme_ExtensionsEntry { + key: string; + value: Value; +} +export interface SecurityScheme_ExtensionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface SecurityScheme_ExtensionsEntryAmino { + key: string; + value?: ValueAmino; +} +export interface SecurityScheme_ExtensionsEntryAminoMsg { + type: string; + value: SecurityScheme_ExtensionsEntryAmino; +} +export interface SecurityScheme_ExtensionsEntrySDKType { + key: string; + value: ValueSDKType; +} +/** + * `SecurityScheme` is a representation of OpenAPI v2 specification's + * Security Scheme object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject + * + * Allows the definition of a security scheme that can be used by the + * operations. Supported schemes are basic authentication, an API key (either as + * a header or as a query parameter) and OAuth2's common flows (implicit, + * password, application and access code). + */ +export interface SecurityScheme { + /** + * The type of the security scheme. Valid values are "basic", + * "apiKey" or "oauth2". + */ + type: SecurityScheme_Type; + /** A short description for security scheme. */ + description: string; + /** + * The name of the header or query parameter to be used. + * Valid for apiKey. + */ + name: string; + /** + * The location of the API key. Valid values are "query" or + * "header". + * Valid for apiKey. + */ + in: SecurityScheme_In; + /** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + * Valid for oauth2. + */ + flow: SecurityScheme_Flow; + /** + * The authorization URL to be used for this flow. This SHOULD be in + * the form of a URL. + * Valid for oauth2/implicit and oauth2/accessCode. + */ + authorizationUrl: string; + /** + * The token URL to be used for this flow. This SHOULD be in the + * form of a URL. + * Valid for oauth2/password, oauth2/application and oauth2/accessCode. + */ + tokenUrl: string; + /** + * The available scopes for the OAuth2 security scheme. + * Valid for oauth2. + */ + scopes: Scopes; + extensions: { + [key: string]: Value; + }; +} +export interface SecuritySchemeProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme"; + value: Uint8Array; +} +/** + * `SecurityScheme` is a representation of OpenAPI v2 specification's + * Security Scheme object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject + * + * Allows the definition of a security scheme that can be used by the + * operations. Supported schemes are basic authentication, an API key (either as + * a header or as a query parameter) and OAuth2's common flows (implicit, + * password, application and access code). + */ +export interface SecuritySchemeAmino { + /** + * The type of the security scheme. Valid values are "basic", + * "apiKey" or "oauth2". + */ + type: SecurityScheme_Type; + /** A short description for security scheme. */ + description: string; + /** + * The name of the header or query parameter to be used. + * Valid for apiKey. + */ + name: string; + /** + * The location of the API key. Valid values are "query" or + * "header". + * Valid for apiKey. + */ + in: SecurityScheme_In; + /** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + * Valid for oauth2. + */ + flow: SecurityScheme_Flow; + /** + * The authorization URL to be used for this flow. This SHOULD be in + * the form of a URL. + * Valid for oauth2/implicit and oauth2/accessCode. + */ + authorization_url: string; + /** + * The token URL to be used for this flow. This SHOULD be in the + * form of a URL. + * Valid for oauth2/password, oauth2/application and oauth2/accessCode. + */ + token_url: string; + /** + * The available scopes for the OAuth2 security scheme. + * Valid for oauth2. + */ + scopes?: ScopesAmino; + extensions?: { + [key: string]: ValueAmino; + }; +} +export interface SecuritySchemeAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme"; + value: SecuritySchemeAmino; +} +/** + * `SecurityScheme` is a representation of OpenAPI v2 specification's + * Security Scheme object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject + * + * Allows the definition of a security scheme that can be used by the + * operations. Supported schemes are basic authentication, an API key (either as + * a header or as a query parameter) and OAuth2's common flows (implicit, + * password, application and access code). + */ +export interface SecuritySchemeSDKType { + type: SecurityScheme_Type; + description: string; + name: string; + in: SecurityScheme_In; + flow: SecurityScheme_Flow; + authorization_url: string; + token_url: string; + scopes: ScopesSDKType; + extensions: { + [key: string]: ValueSDKType; + }; +} +export interface SecurityRequirement_SecurityRequirementEntry { + key: string; + value: SecurityRequirementValue; +} +export interface SecurityRequirement_SecurityRequirementEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface SecurityRequirement_SecurityRequirementEntryAmino { + key: string; + value?: SecurityRequirementValueAmino; +} +export interface SecurityRequirement_SecurityRequirementEntryAminoMsg { + type: string; + value: SecurityRequirement_SecurityRequirementEntryAmino; +} +export interface SecurityRequirement_SecurityRequirementEntrySDKType { + key: string; + value: SecurityRequirementValueSDKType; +} +/** + * `SecurityRequirement` is a representation of OpenAPI v2 specification's + * Security Requirement object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject + * + * Lists the required security schemes to execute this operation. The object can + * have multiple security schemes declared in it which are all required (that + * is, there is a logical AND between the schemes). + * + * The name used for each property MUST correspond to a security scheme + * declared in the Security Definitions. + */ +export interface SecurityRequirement { + /** + * Each name must correspond to a security scheme which is declared in + * the Security Definitions. If the security scheme is of type "oauth2", + * then the value is a list of scope names required for the execution. + * For other security scheme types, the array MUST be empty. + */ + securityRequirement: { + [key: string]: SecurityRequirement_SecurityRequirementValue; + }; +} +export interface SecurityRequirementProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement"; + value: Uint8Array; +} +/** + * `SecurityRequirement` is a representation of OpenAPI v2 specification's + * Security Requirement object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject + * + * Lists the required security schemes to execute this operation. The object can + * have multiple security schemes declared in it which are all required (that + * is, there is a logical AND between the schemes). + * + * The name used for each property MUST correspond to a security scheme + * declared in the Security Definitions. + */ +export interface SecurityRequirementAmino { + /** + * Each name must correspond to a security scheme which is declared in + * the Security Definitions. If the security scheme is of type "oauth2", + * then the value is a list of scope names required for the execution. + * For other security scheme types, the array MUST be empty. + */ + security_requirement?: { + [key: string]: SecurityRequirement_SecurityRequirementValueAmino; + }; +} +export interface SecurityRequirementAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement"; + value: SecurityRequirementAmino; +} +/** + * `SecurityRequirement` is a representation of OpenAPI v2 specification's + * Security Requirement object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject + * + * Lists the required security schemes to execute this operation. The object can + * have multiple security schemes declared in it which are all required (that + * is, there is a logical AND between the schemes). + * + * The name used for each property MUST correspond to a security scheme + * declared in the Security Definitions. + */ +export interface SecurityRequirementSDKType { + security_requirement: { + [key: string]: SecurityRequirement_SecurityRequirementValueSDKType; + }; +} +/** + * If the security scheme is of type "oauth2", then the value is a list of + * scope names required for the execution. For other security scheme types, + * the array MUST be empty. + */ +export interface SecurityRequirement_SecurityRequirementValue { + scope: string[]; +} +export interface SecurityRequirement_SecurityRequirementValueProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirementValue"; + value: Uint8Array; +} +/** + * If the security scheme is of type "oauth2", then the value is a list of + * scope names required for the execution. For other security scheme types, + * the array MUST be empty. + */ +export interface SecurityRequirement_SecurityRequirementValueAmino { + scope: string[]; +} +export interface SecurityRequirement_SecurityRequirementValueAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirementValue"; + value: SecurityRequirement_SecurityRequirementValueAmino; +} +/** + * If the security scheme is of type "oauth2", then the value is a list of + * scope names required for the execution. For other security scheme types, + * the array MUST be empty. + */ +export interface SecurityRequirement_SecurityRequirementValueSDKType { + scope: string[]; +} +export interface Scopes_ScopeEntry { + key: string; + value: string; +} +export interface Scopes_ScopeEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface Scopes_ScopeEntryAmino { + key: string; + value: string; +} +export interface Scopes_ScopeEntryAminoMsg { + type: string; + value: Scopes_ScopeEntryAmino; +} +export interface Scopes_ScopeEntrySDKType { + key: string; + value: string; +} +/** + * `Scopes` is a representation of OpenAPI v2 specification's Scopes object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject + * + * Lists the available scopes for an OAuth2 security scheme. + */ +export interface Scopes { + /** + * Maps between a name of a scope to a short description of it (as the value + * of the property). + */ + scope: { + [key: string]: string; + }; +} +export interface ScopesProtoMsg { + typeUrl: "/grpc.gateway.protoc_gen_openapiv2.options.Scopes"; + value: Uint8Array; +} +/** + * `Scopes` is a representation of OpenAPI v2 specification's Scopes object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject + * + * Lists the available scopes for an OAuth2 security scheme. + */ +export interface ScopesAmino { + /** + * Maps between a name of a scope to a short description of it (as the value + * of the property). + */ + scope: { + [key: string]: string; + }; +} +export interface ScopesAminoMsg { + type: "/grpc.gateway.protoc_gen_openapiv2.options.Scopes"; + value: ScopesAmino; +} +/** + * `Scopes` is a representation of OpenAPI v2 specification's Scopes object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject + * + * Lists the available scopes for an OAuth2 security scheme. + */ +export interface ScopesSDKType { + scope: { + [key: string]: string; + }; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/budget.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/budget.ts new file mode 100644 index 000000000..b32348d7b --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/budget.ts @@ -0,0 +1,109 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +/** Params defines the parameters for the budget module. */ +export interface Params { + /** + * The universal epoch length in number of blocks + * A collection of budgets is executed with this epoch_blocks parameter + */ + epochBlocks: number; + /** + * Budgets parameter can be added, modified, and deleted through + * parameter change governance proposal + */ + budgets: Budget[]; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the budget module. */ +export interface ParamsAmino { + /** + * The universal epoch length in number of blocks + * A collection of budgets is executed with this epoch_blocks parameter + */ + epoch_blocks: number; + /** + * Budgets parameter can be added, modified, and deleted through + * parameter change governance proposal + */ + budgets: BudgetAmino[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the budget module. */ +export interface ParamsSDKType { + epoch_blocks: number; + budgets: BudgetSDKType[]; +} +/** Budget defines a budget object. */ +export interface Budget { + /** name defines the name of the budget */ + name: string; + /** rate specifies the distributing amount by ratio of total budget source */ + rate: string; + /** source_address defines the bech32-encoded address that source of the budget */ + sourceAddress: string; + /** destination_address defines the bech32-encoded address of the budget pool to distribute */ + destinationAddress: string; + /** start_time specifies the start time of the budget */ + startTime: Date; + /** end_time specifies the end time of the budget */ + endTime: Date; +} +export interface BudgetProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.Budget"; + value: Uint8Array; +} +/** Budget defines a budget object. */ +export interface BudgetAmino { + /** name defines the name of the budget */ + name: string; + /** rate specifies the distributing amount by ratio of total budget source */ + rate: string; + /** source_address defines the bech32-encoded address that source of the budget */ + source_address: string; + /** destination_address defines the bech32-encoded address of the budget pool to distribute */ + destination_address: string; + /** start_time specifies the start time of the budget */ + start_time?: Date; + /** end_time specifies the end time of the budget */ + end_time?: Date; +} +export interface BudgetAminoMsg { + type: "cosmos-sdk/Budget"; + value: BudgetAmino; +} +/** Budget defines a budget object. */ +export interface BudgetSDKType { + name: string; + rate: string; + source_address: string; + destination_address: string; + start_time: Date; + end_time: Date; +} +/** TotalCollectedCoins defines total collected coins with relevant metadata. */ +export interface TotalCollectedCoins { + /** total_collected_coins specifies the total collected coins in a budget ever since the budget is created */ + totalCollectedCoins: Coin[]; +} +export interface TotalCollectedCoinsProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.TotalCollectedCoins"; + value: Uint8Array; +} +/** TotalCollectedCoins defines total collected coins with relevant metadata. */ +export interface TotalCollectedCoinsAmino { + /** total_collected_coins specifies the total collected coins in a budget ever since the budget is created */ + total_collected_coins: CoinAmino[]; +} +export interface TotalCollectedCoinsAminoMsg { + type: "cosmos-sdk/TotalCollectedCoins"; + value: TotalCollectedCoinsAmino; +} +/** TotalCollectedCoins defines total collected coins with relevant metadata. */ +export interface TotalCollectedCoinsSDKType { + total_collected_coins: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/genesis.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/genesis.ts new file mode 100644 index 000000000..452dd9980 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/genesis.ts @@ -0,0 +1,56 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./budget"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +/** GenesisState defines the budget module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters for the budget module */ + params: Params; + /** budget_records defines the budget records used for genesis state */ + budgetRecords: BudgetRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the budget module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters for the budget module */ + params?: ParamsAmino; + /** budget_records defines the budget records used for genesis state */ + budget_records: BudgetRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the budget module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + budget_records: BudgetRecordSDKType[]; +} +/** BudgetRecord records the state of each budget after genesis import or export. */ +export interface BudgetRecord { + /** name defines the name of the budget */ + name: string; + /** total_collected_coins specifies the total collected coins in a budget ever since the budget is created */ + totalCollectedCoins: Coin[]; +} +export interface BudgetRecordProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.BudgetRecord"; + value: Uint8Array; +} +/** BudgetRecord records the state of each budget after genesis import or export. */ +export interface BudgetRecordAmino { + /** name defines the name of the budget */ + name: string; + /** total_collected_coins specifies the total collected coins in a budget ever since the budget is created */ + total_collected_coins: CoinAmino[]; +} +export interface BudgetRecordAminoMsg { + type: "cosmos-sdk/BudgetRecord"; + value: BudgetRecordAmino; +} +/** BudgetRecord records the state of each budget after genesis import or export. */ +export interface BudgetRecordSDKType { + name: string; + total_collected_coins: CoinSDKType[]; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/query.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/query.ts new file mode 100644 index 000000000..a98143952 --- /dev/null +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/budget/v1beta1/query.ts @@ -0,0 +1,189 @@ +import { Params, ParamsAmino, ParamsSDKType, Budget, BudgetAmino, BudgetSDKType } from "./budget"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +/** AddressType enumerates the available types of a address. */ +export enum AddressType { + /** ADDRESS_TYPE_32_BYTES - the 32 bytes length address type of ADR 028. */ + ADDRESS_TYPE_32_BYTES = 0, + /** ADDRESS_TYPE_20_BYTES - the default 20 bytes length address type. */ + ADDRESS_TYPE_20_BYTES = 1, + UNRECOGNIZED = -1, +} +export const AddressTypeSDKType = AddressType; +export const AddressTypeAmino = AddressType; +export function addressTypeFromJSON(object: any): AddressType { + switch (object) { + case 0: + case "ADDRESS_TYPE_32_BYTES": + return AddressType.ADDRESS_TYPE_32_BYTES; + case 1: + case "ADDRESS_TYPE_20_BYTES": + return AddressType.ADDRESS_TYPE_20_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return AddressType.UNRECOGNIZED; + } +} +export function addressTypeToJSON(object: AddressType): string { + switch (object) { + case AddressType.ADDRESS_TYPE_32_BYTES: + return "ADDRESS_TYPE_32_BYTES"; + case AddressType.ADDRESS_TYPE_20_BYTES: + return "ADDRESS_TYPE_20_BYTES"; + case AddressType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.budget.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; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** QueryBudgetsRequest is the request type for the Query/Budgets RPC method. */ +export interface QueryBudgetsRequest { + name: string; + sourceAddress: string; + destinationAddress: string; +} +export interface QueryBudgetsRequestProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.QueryBudgetsRequest"; + value: Uint8Array; +} +/** QueryBudgetsRequest is the request type for the Query/Budgets RPC method. */ +export interface QueryBudgetsRequestAmino { + name: string; + source_address: string; + destination_address: string; +} +export interface QueryBudgetsRequestAminoMsg { + type: "cosmos-sdk/QueryBudgetsRequest"; + value: QueryBudgetsRequestAmino; +} +/** QueryBudgetsRequest is the request type for the Query/Budgets RPC method. */ +export interface QueryBudgetsRequestSDKType { + name: string; + source_address: string; + destination_address: string; +} +/** QueryBudgetsResponse is the response type for the Query/Budgets RPC method. */ +export interface QueryBudgetsResponse { + budgets: BudgetResponse[]; +} +export interface QueryBudgetsResponseProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.QueryBudgetsResponse"; + value: Uint8Array; +} +/** QueryBudgetsResponse is the response type for the Query/Budgets RPC method. */ +export interface QueryBudgetsResponseAmino { + budgets: BudgetResponseAmino[]; +} +export interface QueryBudgetsResponseAminoMsg { + type: "cosmos-sdk/QueryBudgetsResponse"; + value: QueryBudgetsResponseAmino; +} +/** QueryBudgetsResponse is the response type for the Query/Budgets RPC method. */ +export interface QueryBudgetsResponseSDKType { + budgets: BudgetResponseSDKType[]; +} +export interface BudgetResponse { + budget: Budget; + totalCollectedCoins: Coin[]; +} +export interface BudgetResponseProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.BudgetResponse"; + value: Uint8Array; +} +export interface BudgetResponseAmino { + budget?: BudgetAmino; + total_collected_coins: CoinAmino[]; +} +export interface BudgetResponseAminoMsg { + type: "cosmos-sdk/BudgetResponse"; + value: BudgetResponseAmino; +} +export interface BudgetResponseSDKType { + budget: BudgetSDKType; + total_collected_coins: CoinSDKType[]; +} +/** QueryAddressesRequest is the request type for the Query/Addresses RPC method. */ +export interface QueryAddressesRequest { + /** The Address Type, default 0 for ADDRESS_TYPE_32_BYTES or 1 for ADDRESS_TYPE_20_BYTES */ + type: AddressType; + /** The module name to be used for address derivation, default is budget. */ + moduleName: string; + /** The name to be used for address derivation. */ + name: string; +} +export interface QueryAddressesRequestProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.QueryAddressesRequest"; + value: Uint8Array; +} +/** QueryAddressesRequest is the request type for the Query/Addresses RPC method. */ +export interface QueryAddressesRequestAmino { + /** The Address Type, default 0 for ADDRESS_TYPE_32_BYTES or 1 for ADDRESS_TYPE_20_BYTES */ + type: AddressType; + /** The module name to be used for address derivation, default is budget. */ + module_name: string; + /** The name to be used for address derivation. */ + name: string; +} +export interface QueryAddressesRequestAminoMsg { + type: "cosmos-sdk/QueryAddressesRequest"; + value: QueryAddressesRequestAmino; +} +/** QueryAddressesRequest is the request type for the Query/Addresses RPC method. */ +export interface QueryAddressesRequestSDKType { + type: AddressType; + module_name: string; + name: string; +} +/** QueryAddressesResponse is the response type for the Query/Addresses RPC method. */ +export interface QueryAddressesResponse { + address: string; +} +export interface QueryAddressesResponseProtoMsg { + typeUrl: "/cosmos.budget.v1beta1.QueryAddressesResponse"; + value: Uint8Array; +} +/** QueryAddressesResponse is the response type for the Query/Addresses RPC method. */ +export interface QueryAddressesResponseAmino { + address: string; +} +export interface QueryAddressesResponseAminoMsg { + type: "cosmos-sdk/QueryAddressesResponse"; + value: QueryAddressesResponseAmino; +} +/** QueryAddressesResponse is the response type for the Query/Addresses RPC method. */ +export interface QueryAddressesResponseSDKType { + address: string; +} \ No newline at end of file diff --git a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts index 3d5692578..d2a0bf092 100644 --- a/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts +++ b/Crescent/crescent-starter/src/types/proto-interfaces/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _110 from "./abci/types"; -import * as _111 from "./crypto/keys"; -import * as _112 from "./crypto/proof"; -import * as _113 from "./libs/bits/types"; -import * as _114 from "./p2p/types"; -import * as _115 from "./types/block"; -import * as _116 from "./types/evidence"; -import * as _117 from "./types/params"; -import * as _118 from "./types/types"; -import * as _119 from "./types/validator"; -import * as _120 from "./version/types"; +import * as _165 from "./abci/types"; +import * as _166 from "./crypto/keys"; +import * as _167 from "./crypto/proof"; +import * as _168 from "./libs/bits/types"; +import * as _169 from "./p2p/types"; +import * as _170 from "./types/block"; +import * as _171 from "./types/evidence"; +import * as _172 from "./types/params"; +import * as _173 from "./types/types"; +import * as _174 from "./types/validator"; +import * as _175 from "./version/types"; export namespace tendermint { export const abci = { - ..._110 + ..._165 }; export const crypto = { - ..._111, - ..._112 + ..._166, + ..._167 }; export namespace libs { export const bits = { - ..._113 + ..._168 }; } export const p2p = { - ..._114 + ..._169 }; export const types = { - ..._115, - ..._116, - ..._117, - ..._118, - ..._119 + ..._170, + ..._171, + ..._172, + ..._173, + ..._174 }; export const version = { - ..._120 + ..._175 }; } \ No newline at end of file