From d026a92f685c303a7680164e181999d198b820f7 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Wed, 27 Jan 2021 15:07:07 +0000 Subject: [PATCH] stargate: Update ts-proto-generated codec --- packages/stargate/src/codec/confio/proofs.ts | 626 +- .../src/codec/cosmos/auth/v1beta1/auth.ts | 67 +- .../src/codec/cosmos/auth/v1beta1/query.ts | 144 +- .../src/codec/cosmos/bank/v1beta1/bank.ts | 150 +- .../src/codec/cosmos/bank/v1beta1/query.ts | 318 +- .../src/codec/cosmos/bank/v1beta1/tx.ts | 135 +- .../codec/cosmos/base/abci/v1beta1/abci.ts | 289 +- .../cosmos/base/query/v1beta1/pagination.ts | 108 +- .../src/codec/cosmos/base/v1beta1/coin.ts | 75 +- .../crypto/multisig/v1beta1/multisig.ts | 61 +- .../src/codec/cosmos/crypto/secp256k1/keys.ts | 59 +- .../codec/cosmos/staking/v1beta1/staking.ts | 753 +- .../src/codec/cosmos/staking/v1beta1/tx.ts | 372 +- .../cosmos/tx/signing/v1beta1/signing.ts | 223 +- .../src/codec/cosmos/tx/v1beta1/tx.ts | 340 +- .../stargate/src/codec/cosmos_proto/cosmos.ts | 1 - packages/stargate/src/codec/gogoproto/gogo.ts | 1 - .../src/codec/google/api/annotations.ts | 1 - .../stargate/src/codec/google/api/http.ts | 476 +- .../stargate/src/codec/google/protobuf/any.ts | 223 +- .../src/codec/google/protobuf/descriptor.ts | 1936 +- .../src/codec/google/protobuf/duration.ts | 127 +- .../src/codec/google/protobuf/timestamp.ts | 166 +- .../src/codec/ibc/core/channel/v1/channel.ts | 428 +- .../src/codec/ibc/core/channel/v1/query.ts | 1065 +- .../src/codec/ibc/core/client/v1/client.ts | 167 +- .../ibc/core/commitment/v1/commitment.ts | 93 +- .../ibc/core/connection/v1/connection.ts | 311 +- .../src/codec/ibc/core/connection/v1/query.ts | 416 +- .../src/codec/tendermint/abci/types.ts | 1663 +- .../src/codec/tendermint/crypto/keys.ts | 39 +- .../src/codec/tendermint/crypto/proof.ts | 103 +- .../src/codec/tendermint/libs/bits/types.ts | 17 +- .../src/codec/tendermint/types/params.ts | 134 +- .../src/codec/tendermint/types/types.ts | 539 +- .../src/codec/tendermint/types/validator.ts | 63 +- .../src/codec/tendermint/version/types.ts | 42 +- .../types/codec/generated/codecimpl.d.ts | 22173 ---------------- packages/stargate/types/codec/index.d.ts | 5 - 39 files changed, 5798 insertions(+), 28111 deletions(-) delete mode 100644 packages/stargate/types/codec/generated/codecimpl.d.ts delete mode 100644 packages/stargate/types/codec/index.d.ts diff --git a/packages/stargate/src/codec/confio/proofs.ts b/packages/stargate/src/codec/confio/proofs.ts index 8af23e82..a8338425 100644 --- a/packages/stargate/src/codec/confio/proofs.ts +++ b/packages/stargate/src/codec/confio/proofs.ts @@ -1,279 +1,17 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; - -/** - * * - * 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[]; -} - -/** - * - * 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; -} - -/** - * - * CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages - */ -export interface CommitmentProof { - exist?: ExistenceProof | undefined; - nonexist?: NonExistenceProof | undefined; - batch?: BatchProof | undefined; - compressed?: CompressedBatchProof | undefined; -} - -/** - * * - * 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; -} - -/** - * * - * 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; -} - -/** - * * - * 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; -} - -/** - * - * 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; -} - -/** - * - * BatchProof is a group of multiple proof types than can be compressed - */ -export interface BatchProof { - entries: BatchEntry[]; -} - -/** - * Use BatchEntry not CommitmentProof, to avoid recursion - */ -export interface BatchEntry { - exist?: ExistenceProof | undefined; - nonexist?: NonExistenceProof | undefined; -} - -export interface CompressedBatchProof { - entries: CompressedBatchEntry[]; - lookupInners: InnerOp[]; -} - -/** - * Use BatchEntry not CommitmentProof, to avoid recursion - */ -export interface CompressedBatchEntry { - exist?: CompressedExistenceProof | undefined; - nonexist?: CompressedNonExistenceProof | undefined; -} - -export interface CompressedExistenceProof { - key: Uint8Array; - value: Uint8Array; - leaf?: LeafOp; - /** - * these are indexes into the lookup_inners table in CompressedBatchProof - */ - path: number[]; -} - -export interface CompressedNonExistenceProof { - /** - * TODO: remove this as unnecessary??? we prove a range - */ - key: Uint8Array; - left?: CompressedExistenceProof; - right?: CompressedExistenceProof; -} - -const baseExistenceProof: object = {}; - -const baseNonExistenceProof: object = {}; - -const baseCommitmentProof: object = {}; - -const baseLeafOp: object = { - hash: 0, - prehashKey: 0, - prehashValue: 0, - length: 0, -}; - -const baseInnerOp: object = { - hash: 0, -}; - -const baseProofSpec: object = { - maxDepth: 0, - minDepth: 0, -}; - -const baseInnerSpec: object = { - childOrder: 0, - childSize: 0, - minPrefixLength: 0, - maxPrefixLength: 0, - hash: 0, -}; - -const baseBatchProof: object = {}; - -const baseBatchEntry: object = {}; - -const baseCompressedBatchProof: object = {}; - -const baseCompressedBatchEntry: object = {}; - -const baseCompressedExistenceProof: object = { - path: 0, -}; - -const baseCompressedNonExistenceProof: object = {}; +import * as Long from "long"; export const protobufPackage = "ics23"; export enum HashOp { - /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. - */ + /** 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 - ripemd160(sha256(x)) */ BITCOIN = 5, UNRECOGNIZED = -1, } @@ -324,39 +62,30 @@ export function hashOpToJSON(object: HashOp): string { } } -/** * -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) +/** + * 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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, } @@ -422,6 +151,195 @@ export function lengthOpToJSON(object: LengthOp): string { } } +/** + * 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[]; +} + +/** + * 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; +} + +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; + batch?: BatchProof | undefined; + compressed?: CompressedBatchProof | undefined; +} + +/** + * 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; +} + +/** + * 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; +} + +/** + * 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; +} + +/** + * 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; +} + +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; +} + +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof | undefined; + nonexist?: CompressedNonExistenceProof | undefined; +} + +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} + +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; +} + +const baseExistenceProof: object = {}; + export const ExistenceProof = { encode(message: ExistenceProof, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -434,7 +352,8 @@ export const ExistenceProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ExistenceProof { + + decode(input: Reader | Uint8Array, length?: number): ExistenceProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseExistenceProof } as ExistenceProof; @@ -461,6 +380,7 @@ export const ExistenceProof = { } return message; }, + fromJSON(object: any): ExistenceProof { const message = { ...baseExistenceProof } as ExistenceProof; message.path = []; @@ -482,6 +402,7 @@ export const ExistenceProof = { } return message; }, + fromPartial(object: DeepPartial): ExistenceProof { const message = { ...baseExistenceProof } as ExistenceProof; message.path = []; @@ -507,6 +428,7 @@ export const ExistenceProof = { } return message; }, + toJSON(message: ExistenceProof): unknown { const obj: any = {}; message.key !== undefined && @@ -523,6 +445,8 @@ export const ExistenceProof = { }, }; +const baseNonExistenceProof: object = {}; + export const NonExistenceProof = { encode(message: NonExistenceProof, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -534,7 +458,8 @@ export const NonExistenceProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): NonExistenceProof { + + decode(input: Reader | Uint8Array, length?: number): NonExistenceProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseNonExistenceProof } as NonExistenceProof; @@ -557,6 +482,7 @@ export const NonExistenceProof = { } return message; }, + fromJSON(object: any): NonExistenceProof { const message = { ...baseNonExistenceProof } as NonExistenceProof; if (object.key !== undefined && object.key !== null) { @@ -574,6 +500,7 @@ export const NonExistenceProof = { } return message; }, + fromPartial(object: DeepPartial): NonExistenceProof { const message = { ...baseNonExistenceProof } as NonExistenceProof; if (object.key !== undefined && object.key !== null) { @@ -593,6 +520,7 @@ export const NonExistenceProof = { } return message; }, + toJSON(message: NonExistenceProof): unknown { const obj: any = {}; message.key !== undefined && @@ -604,6 +532,8 @@ export const NonExistenceProof = { }, }; +const baseCommitmentProof: object = {}; + export const CommitmentProof = { encode(message: CommitmentProof, writer: Writer = Writer.create()): Writer { if (message.exist !== undefined) { @@ -620,7 +550,8 @@ export const CommitmentProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): CommitmentProof { + + decode(input: Reader | Uint8Array, length?: number): CommitmentProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCommitmentProof } as CommitmentProof; @@ -646,6 +577,7 @@ export const CommitmentProof = { } return message; }, + fromJSON(object: any): CommitmentProof { const message = { ...baseCommitmentProof } as CommitmentProof; if (object.exist !== undefined && object.exist !== null) { @@ -670,6 +602,7 @@ export const CommitmentProof = { } return message; }, + fromPartial(object: DeepPartial): CommitmentProof { const message = { ...baseCommitmentProof } as CommitmentProof; if (object.exist !== undefined && object.exist !== null) { @@ -694,6 +627,7 @@ export const CommitmentProof = { } return message; }, + toJSON(message: CommitmentProof): unknown { const obj: any = {}; message.exist !== undefined && @@ -707,6 +641,8 @@ export const CommitmentProof = { }, }; +const baseLeafOp: object = { hash: 0, prehashKey: 0, prehashValue: 0, length: 0 }; + export const LeafOp = { encode(message: LeafOp, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.hash); @@ -716,7 +652,8 @@ export const LeafOp = { writer.uint32(42).bytes(message.prefix); return writer; }, - decode(input: Uint8Array | Reader, length?: number): LeafOp { + + decode(input: Reader | Uint8Array, length?: number): LeafOp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseLeafOp } as LeafOp; @@ -745,6 +682,7 @@ export const LeafOp = { } return message; }, + fromJSON(object: any): LeafOp { const message = { ...baseLeafOp } as LeafOp; if (object.hash !== undefined && object.hash !== null) { @@ -772,6 +710,7 @@ export const LeafOp = { } return message; }, + fromPartial(object: DeepPartial): LeafOp { const message = { ...baseLeafOp } as LeafOp; if (object.hash !== undefined && object.hash !== null) { @@ -801,6 +740,7 @@ export const LeafOp = { } return message; }, + toJSON(message: LeafOp): unknown { const obj: any = {}; message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); @@ -813,6 +753,8 @@ export const LeafOp = { }, }; +const baseInnerOp: object = { hash: 0 }; + export const InnerOp = { encode(message: InnerOp, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.hash); @@ -820,7 +762,8 @@ export const InnerOp = { writer.uint32(26).bytes(message.suffix); return writer; }, - decode(input: Uint8Array | Reader, length?: number): InnerOp { + + decode(input: Reader | Uint8Array, length?: number): InnerOp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseInnerOp } as InnerOp; @@ -843,6 +786,7 @@ export const InnerOp = { } return message; }, + fromJSON(object: any): InnerOp { const message = { ...baseInnerOp } as InnerOp; if (object.hash !== undefined && object.hash !== null) { @@ -858,6 +802,7 @@ export const InnerOp = { } return message; }, + fromPartial(object: DeepPartial): InnerOp { const message = { ...baseInnerOp } as InnerOp; if (object.hash !== undefined && object.hash !== null) { @@ -877,6 +822,7 @@ export const InnerOp = { } return message; }, + toJSON(message: InnerOp): unknown { const obj: any = {}; message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); @@ -888,6 +834,8 @@ export const InnerOp = { }, }; +const baseProofSpec: object = { maxDepth: 0, minDepth: 0 }; + export const ProofSpec = { encode(message: ProofSpec, writer: Writer = Writer.create()): Writer { if (message.leafSpec !== undefined && message.leafSpec !== undefined) { @@ -900,7 +848,8 @@ export const ProofSpec = { writer.uint32(32).int32(message.minDepth); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ProofSpec { + + decode(input: Reader | Uint8Array, length?: number): ProofSpec { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseProofSpec } as ProofSpec; @@ -926,6 +875,7 @@ export const ProofSpec = { } return message; }, + fromJSON(object: any): ProofSpec { const message = { ...baseProofSpec } as ProofSpec; if (object.leafSpec !== undefined && object.leafSpec !== null) { @@ -950,6 +900,7 @@ export const ProofSpec = { } return message; }, + fromPartial(object: DeepPartial): ProofSpec { const message = { ...baseProofSpec } as ProofSpec; if (object.leafSpec !== undefined && object.leafSpec !== null) { @@ -974,6 +925,7 @@ export const ProofSpec = { } return message; }, + toJSON(message: ProofSpec): unknown { const obj: any = {}; message.leafSpec !== undefined && @@ -986,6 +938,14 @@ export const ProofSpec = { }, }; +const baseInnerSpec: object = { + childOrder: 0, + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + hash: 0, +}; + export const InnerSpec = { encode(message: InnerSpec, writer: Writer = Writer.create()): Writer { writer.uint32(10).fork(); @@ -1000,7 +960,8 @@ export const InnerSpec = { writer.uint32(48).int32(message.hash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): InnerSpec { + + decode(input: Reader | Uint8Array, length?: number): InnerSpec { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseInnerSpec } as InnerSpec; @@ -1040,6 +1001,7 @@ export const InnerSpec = { } return message; }, + fromJSON(object: any): InnerSpec { const message = { ...baseInnerSpec } as InnerSpec; message.childOrder = []; @@ -1073,6 +1035,7 @@ export const InnerSpec = { } return message; }, + fromPartial(object: DeepPartial): InnerSpec { const message = { ...baseInnerSpec } as InnerSpec; message.childOrder = []; @@ -1108,6 +1071,7 @@ export const InnerSpec = { } return message; }, + toJSON(message: InnerSpec): unknown { const obj: any = {}; if (message.childOrder) { @@ -1127,6 +1091,8 @@ export const InnerSpec = { }, }; +const baseBatchProof: object = {}; + export const BatchProof = { encode(message: BatchProof, writer: Writer = Writer.create()): Writer { for (const v of message.entries) { @@ -1134,7 +1100,8 @@ export const BatchProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): BatchProof { + + decode(input: Reader | Uint8Array, length?: number): BatchProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBatchProof } as BatchProof; @@ -1152,6 +1119,7 @@ export const BatchProof = { } return message; }, + fromJSON(object: any): BatchProof { const message = { ...baseBatchProof } as BatchProof; message.entries = []; @@ -1162,6 +1130,7 @@ export const BatchProof = { } return message; }, + fromPartial(object: DeepPartial): BatchProof { const message = { ...baseBatchProof } as BatchProof; message.entries = []; @@ -1172,6 +1141,7 @@ export const BatchProof = { } return message; }, + toJSON(message: BatchProof): unknown { const obj: any = {}; if (message.entries) { @@ -1183,6 +1153,8 @@ export const BatchProof = { }, }; +const baseBatchEntry: object = {}; + export const BatchEntry = { encode(message: BatchEntry, writer: Writer = Writer.create()): Writer { if (message.exist !== undefined) { @@ -1193,7 +1165,8 @@ export const BatchEntry = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): BatchEntry { + + decode(input: Reader | Uint8Array, length?: number): BatchEntry { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBatchEntry } as BatchEntry; @@ -1213,6 +1186,7 @@ export const BatchEntry = { } return message; }, + fromJSON(object: any): BatchEntry { const message = { ...baseBatchEntry } as BatchEntry; if (object.exist !== undefined && object.exist !== null) { @@ -1227,6 +1201,7 @@ export const BatchEntry = { } return message; }, + fromPartial(object: DeepPartial): BatchEntry { const message = { ...baseBatchEntry } as BatchEntry; if (object.exist !== undefined && object.exist !== null) { @@ -1241,6 +1216,7 @@ export const BatchEntry = { } return message; }, + toJSON(message: BatchEntry): unknown { const obj: any = {}; message.exist !== undefined && @@ -1251,6 +1227,8 @@ export const BatchEntry = { }, }; +const baseCompressedBatchProof: object = {}; + export const CompressedBatchProof = { encode(message: CompressedBatchProof, writer: Writer = Writer.create()): Writer { for (const v of message.entries) { @@ -1261,7 +1239,8 @@ export const CompressedBatchProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): CompressedBatchProof { + + decode(input: Reader | Uint8Array, length?: number): CompressedBatchProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCompressedBatchProof } as CompressedBatchProof; @@ -1283,6 +1262,7 @@ export const CompressedBatchProof = { } return message; }, + fromJSON(object: any): CompressedBatchProof { const message = { ...baseCompressedBatchProof } as CompressedBatchProof; message.entries = []; @@ -1299,6 +1279,7 @@ export const CompressedBatchProof = { } return message; }, + fromPartial(object: DeepPartial): CompressedBatchProof { const message = { ...baseCompressedBatchProof } as CompressedBatchProof; message.entries = []; @@ -1315,6 +1296,7 @@ export const CompressedBatchProof = { } return message; }, + toJSON(message: CompressedBatchProof): unknown { const obj: any = {}; if (message.entries) { @@ -1331,6 +1313,8 @@ export const CompressedBatchProof = { }, }; +const baseCompressedBatchEntry: object = {}; + export const CompressedBatchEntry = { encode(message: CompressedBatchEntry, writer: Writer = Writer.create()): Writer { if (message.exist !== undefined) { @@ -1341,7 +1325,8 @@ export const CompressedBatchEntry = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): CompressedBatchEntry { + + decode(input: Reader | Uint8Array, length?: number): CompressedBatchEntry { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; @@ -1361,6 +1346,7 @@ export const CompressedBatchEntry = { } return message; }, + fromJSON(object: any): CompressedBatchEntry { const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; if (object.exist !== undefined && object.exist !== null) { @@ -1375,6 +1361,7 @@ export const CompressedBatchEntry = { } return message; }, + fromPartial(object: DeepPartial): CompressedBatchEntry { const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; if (object.exist !== undefined && object.exist !== null) { @@ -1389,6 +1376,7 @@ export const CompressedBatchEntry = { } return message; }, + toJSON(message: CompressedBatchEntry): unknown { const obj: any = {}; message.exist !== undefined && @@ -1399,6 +1387,8 @@ export const CompressedBatchEntry = { }, }; +const baseCompressedExistenceProof: object = { path: 0 }; + export const CompressedExistenceProof = { encode(message: CompressedExistenceProof, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -1413,7 +1403,8 @@ export const CompressedExistenceProof = { writer.ldelim(); return writer; }, - decode(input: Uint8Array | Reader, length?: number): CompressedExistenceProof { + + decode(input: Reader | Uint8Array, length?: number): CompressedExistenceProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; @@ -1447,6 +1438,7 @@ export const CompressedExistenceProof = { } return message; }, + fromJSON(object: any): CompressedExistenceProof { const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; message.path = []; @@ -1468,6 +1460,7 @@ export const CompressedExistenceProof = { } return message; }, + fromPartial(object: DeepPartial): CompressedExistenceProof { const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; message.path = []; @@ -1493,6 +1486,7 @@ export const CompressedExistenceProof = { } return message; }, + toJSON(message: CompressedExistenceProof): unknown { const obj: any = {}; message.key !== undefined && @@ -1509,6 +1503,8 @@ export const CompressedExistenceProof = { }, }; +const baseCompressedNonExistenceProof: object = {}; + export const CompressedNonExistenceProof = { encode(message: CompressedNonExistenceProof, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -1520,7 +1516,8 @@ export const CompressedNonExistenceProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): CompressedNonExistenceProof { + + decode(input: Reader | Uint8Array, length?: number): CompressedNonExistenceProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; @@ -1543,6 +1540,7 @@ export const CompressedNonExistenceProof = { } return message; }, + fromJSON(object: any): CompressedNonExistenceProof { const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; if (object.key !== undefined && object.key !== null) { @@ -1560,6 +1558,7 @@ export const CompressedNonExistenceProof = { } return message; }, + fromPartial(object: DeepPartial): CompressedNonExistenceProof { const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; if (object.key !== undefined && object.key !== null) { @@ -1579,6 +1578,7 @@ export const CompressedNonExistenceProof = { } return message; }, + toJSON(message: CompressedNonExistenceProof): unknown { const obj: any = {}; message.key !== undefined && @@ -1591,15 +1591,18 @@ export const CompressedNonExistenceProof = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -1609,6 +1612,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -1616,7 +1621,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts b/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts index 03f9c075..7384b464 100644 --- a/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts +++ b/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts @@ -3,10 +3,12 @@ import { Any } from "../../../google/protobuf/any"; import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "cosmos.auth.v1beta1"; + /** - * 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). + * 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; @@ -15,18 +17,14 @@ export interface BaseAccount { sequence: Long; } -/** - * ModuleAccount defines an account for modules that holds coins on a pool. - */ +/** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { baseAccount?: BaseAccount; name: string; permissions: string[]; } -/** - * Params defines the parameters for the auth module. - */ +/** Params defines the parameters for the auth module. */ export interface Params { maxMemoCharacters: Long; txSigLimit: Long; @@ -35,26 +33,7 @@ export interface Params { sigVerifyCostSecp256k1: Long; } -const baseBaseAccount: object = { - address: "", - accountNumber: Long.UZERO, - sequence: Long.UZERO, -}; - -const baseModuleAccount: object = { - name: "", - permissions: "", -}; - -const baseParams: object = { - maxMemoCharacters: Long.UZERO, - txSigLimit: Long.UZERO, - txSizeCostPerByte: Long.UZERO, - sigVerifyCostEd25519: Long.UZERO, - sigVerifyCostSecp256k1: Long.UZERO, -}; - -export const protobufPackage = "cosmos.auth.v1beta1"; +const baseBaseAccount: object = { address: "", accountNumber: Long.UZERO, sequence: Long.UZERO }; export const BaseAccount = { encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { @@ -66,7 +45,8 @@ export const BaseAccount = { writer.uint32(32).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): BaseAccount { + + decode(input: Reader | Uint8Array, length?: number): BaseAccount { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBaseAccount } as BaseAccount; @@ -92,6 +72,7 @@ export const BaseAccount = { } return message; }, + fromJSON(object: any): BaseAccount { const message = { ...baseBaseAccount } as BaseAccount; if (object.address !== undefined && object.address !== null) { @@ -116,6 +97,7 @@ export const BaseAccount = { } return message; }, + fromPartial(object: DeepPartial): BaseAccount { const message = { ...baseBaseAccount } as BaseAccount; if (object.address !== undefined && object.address !== null) { @@ -140,6 +122,7 @@ export const BaseAccount = { } return message; }, + toJSON(message: BaseAccount): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -151,6 +134,8 @@ export const BaseAccount = { }, }; +const baseModuleAccount: object = { name: "", permissions: "" }; + export const ModuleAccount = { encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { if (message.baseAccount !== undefined && message.baseAccount !== undefined) { @@ -162,7 +147,8 @@ export const ModuleAccount = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ModuleAccount { + + decode(input: Reader | Uint8Array, length?: number): ModuleAccount { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseModuleAccount } as ModuleAccount; @@ -186,6 +172,7 @@ export const ModuleAccount = { } return message; }, + fromJSON(object: any): ModuleAccount { const message = { ...baseModuleAccount } as ModuleAccount; message.permissions = []; @@ -206,6 +193,7 @@ export const ModuleAccount = { } return message; }, + fromPartial(object: DeepPartial): ModuleAccount { const message = { ...baseModuleAccount } as ModuleAccount; message.permissions = []; @@ -226,6 +214,7 @@ export const ModuleAccount = { } return message; }, + toJSON(message: ModuleAccount): unknown { const obj: any = {}; message.baseAccount !== undefined && @@ -240,6 +229,14 @@ export const ModuleAccount = { }, }; +const baseParams: object = { + maxMemoCharacters: Long.UZERO, + txSigLimit: Long.UZERO, + txSizeCostPerByte: Long.UZERO, + sigVerifyCostEd25519: Long.UZERO, + sigVerifyCostSecp256k1: Long.UZERO, +}; + export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.maxMemoCharacters); @@ -249,7 +246,8 @@ export const Params = { writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Params { + + decode(input: Reader | Uint8Array, length?: number): Params { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseParams } as Params; @@ -278,6 +276,7 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { const message = { ...baseParams } as Params; if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { @@ -307,6 +306,7 @@ export const Params = { } return message; }, + fromPartial(object: DeepPartial): Params { const message = { ...baseParams } as Params; if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { @@ -336,6 +336,7 @@ export const Params = { } return message; }, + toJSON(message: Params): unknown { const obj: any = {}; message.maxMemoCharacters !== undefined && @@ -351,7 +352,7 @@ export const Params = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts b/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts index 18f5310d..0b687b72 100644 --- a/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts +++ b/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts @@ -2,99 +2,40 @@ import { Any } from "../../../google/protobuf/any"; import { Params } from "../../../cosmos/auth/v1beta1/auth"; import { Reader, Writer } from "protobufjs/minimal"; +import * as Long from "long"; -/** - * QueryAccountRequest is the request type for the Query/Account RPC method. - */ +export const protobufPackage = "cosmos.auth.v1beta1"; + +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ export interface QueryAccountRequest { - /** - * address defines the address to query for. - */ + /** address defines the address to query for. */ address: string; } -/** - * QueryAccountResponse is the response type for the Query/Account RPC method. - */ +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponse { - /** - * account defines the account of the corresponding address. - */ + /** account defines the account of the corresponding address. */ account?: Any; } -/** - * QueryParamsRequest is the request type for the Query/Params RPC method. - */ +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} -/** - * QueryParamsResponse is the response type for the Query/Params RPC method. - */ +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { - /** - * params defines the parameters of the module. - */ + /** params defines the parameters of the module. */ params?: Params; } -const baseQueryAccountRequest: object = { - address: "", -}; - -const baseQueryAccountResponse: object = {}; - -const baseQueryParamsRequest: object = {}; - -const baseQueryParamsResponse: object = {}; - -/** - * Query defines the gRPC querier service. - */ -export interface Query { - /** - * Account returns account details based on address. - */ - Account(request: QueryAccountRequest): Promise; - - /** - * Params queries all parameters. - */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Account(request: QueryAccountRequest): Promise { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); - return promise.then((data) => QueryAccountResponse.decode(new Reader(data))); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -export const protobufPackage = "cosmos.auth.v1beta1"; +const baseQueryAccountRequest: object = { address: "" }; export const QueryAccountRequest = { encode(message: QueryAccountRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.address); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryAccountRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryAccountRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryAccountRequest } as QueryAccountRequest; @@ -111,6 +52,7 @@ export const QueryAccountRequest = { } return message; }, + fromJSON(object: any): QueryAccountRequest { const message = { ...baseQueryAccountRequest } as QueryAccountRequest; if (object.address !== undefined && object.address !== null) { @@ -120,6 +62,7 @@ export const QueryAccountRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryAccountRequest { const message = { ...baseQueryAccountRequest } as QueryAccountRequest; if (object.address !== undefined && object.address !== null) { @@ -129,6 +72,7 @@ export const QueryAccountRequest = { } return message; }, + toJSON(message: QueryAccountRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -136,6 +80,8 @@ export const QueryAccountRequest = { }, }; +const baseQueryAccountResponse: object = {}; + export const QueryAccountResponse = { encode(message: QueryAccountResponse, writer: Writer = Writer.create()): Writer { if (message.account !== undefined && message.account !== undefined) { @@ -143,7 +89,8 @@ export const QueryAccountResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryAccountResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryAccountResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryAccountResponse } as QueryAccountResponse; @@ -160,6 +107,7 @@ export const QueryAccountResponse = { } return message; }, + fromJSON(object: any): QueryAccountResponse { const message = { ...baseQueryAccountResponse } as QueryAccountResponse; if (object.account !== undefined && object.account !== null) { @@ -169,6 +117,7 @@ export const QueryAccountResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryAccountResponse { const message = { ...baseQueryAccountResponse } as QueryAccountResponse; if (object.account !== undefined && object.account !== null) { @@ -178,6 +127,7 @@ export const QueryAccountResponse = { } return message; }, + toJSON(message: QueryAccountResponse): unknown { const obj: any = {}; message.account !== undefined && @@ -186,11 +136,14 @@ export const QueryAccountResponse = { }, }; +const baseQueryParamsRequest: object = {}; + export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryParamsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryParamsRequest } as QueryParamsRequest; @@ -204,20 +157,25 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { const message = { ...baseQueryParamsRequest } as QueryParamsRequest; return message; }, + fromPartial(_: DeepPartial): QueryParamsRequest { const message = { ...baseQueryParamsRequest } as QueryParamsRequest; return message; }, + toJSON(_: QueryParamsRequest): unknown { const obj: any = {}; return obj; }, }; +const baseQueryParamsResponse: object = {}; + export const QueryParamsResponse = { encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer { if (message.params !== undefined && message.params !== undefined) { @@ -225,7 +183,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryParamsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryParamsResponse } as QueryParamsResponse; @@ -242,6 +201,7 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { const message = { ...baseQueryParamsResponse } as QueryParamsResponse; if (object.params !== undefined && object.params !== null) { @@ -251,6 +211,7 @@ export const QueryParamsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryParamsResponse { const message = { ...baseQueryParamsResponse } as QueryParamsResponse; if (object.params !== undefined && object.params !== null) { @@ -260,6 +221,7 @@ export const QueryParamsResponse = { } return message; }, + toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); @@ -267,7 +229,37 @@ export const QueryParamsResponse = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Account returns account details based on address. */ + Account(request: QueryAccountRequest): Promise; + /** Params queries all parameters. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Account(request: QueryAccountRequest): Promise { + const data = QueryAccountRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryAccountResponse.decode(new Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts index afff626e..b87747fb 100644 --- a/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts @@ -1,124 +1,82 @@ /* eslint-disable */ import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; -/** - * Params defines the parameters for the bank module. - */ +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** Params defines the parameters for the bank module. */ export interface Params { sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } /** - * SendEnabled maps coin denom to a send_enabled status (whether a denom is - * sendable). + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). */ export interface SendEnabled { denom: string; enabled: boolean; } -/** - * Input models transaction input. - */ +/** Input models transaction input. */ export interface Input { address: string; coins: Coin[]; } -/** - * Output models transaction outputs. - */ +/** Output models transaction outputs. */ export interface Output { address: string; coins: Coin[]; } /** - * Supply represents a struct that passively keeps track of the total supply - * amounts in the network. + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. */ export interface Supply { total: Coin[]; } /** - * DenomUnit represents a struct that describes a given - * denomination unit of the basic token. + * 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 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 = 1^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 represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 1^exponent base_denom + * (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 is a list of string aliases for the given denom */ aliases: string[]; } /** - * Metadata represents a struct that describes - * a basic token. + * 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 - */ + /** 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 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 indicates the suggested denom that should be + * displayed in clients. */ display: string; } -const baseParams: object = { - defaultSendEnabled: false, -}; - -const baseSendEnabled: object = { - denom: "", - enabled: false, -}; - -const baseInput: object = { - address: "", -}; - -const baseOutput: object = { - address: "", -}; - -const baseSupply: object = {}; - -const baseDenomUnit: object = { - denom: "", - exponent: 0, - aliases: "", -}; - -const baseMetadata: object = { - description: "", - base: "", - display: "", -}; - -export const protobufPackage = "cosmos.bank.v1beta1"; +const baseParams: object = { defaultSendEnabled: false }; export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { @@ -128,7 +86,8 @@ export const Params = { writer.uint32(16).bool(message.defaultSendEnabled); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Params { + + decode(input: Reader | Uint8Array, length?: number): Params { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseParams } as Params; @@ -149,6 +108,7 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { const message = { ...baseParams } as Params; message.sendEnabled = []; @@ -164,6 +124,7 @@ export const Params = { } return message; }, + fromPartial(object: DeepPartial): Params { const message = { ...baseParams } as Params; message.sendEnabled = []; @@ -179,6 +140,7 @@ export const Params = { } return message; }, + toJSON(message: Params): unknown { const obj: any = {}; if (message.sendEnabled) { @@ -191,13 +153,16 @@ export const Params = { }, }; +const baseSendEnabled: object = { denom: "", enabled: false }; + export const SendEnabled = { encode(message: SendEnabled, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.denom); writer.uint32(16).bool(message.enabled); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SendEnabled { + + decode(input: Reader | Uint8Array, length?: number): SendEnabled { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSendEnabled } as SendEnabled; @@ -217,6 +182,7 @@ export const SendEnabled = { } return message; }, + fromJSON(object: any): SendEnabled { const message = { ...baseSendEnabled } as SendEnabled; if (object.denom !== undefined && object.denom !== null) { @@ -231,6 +197,7 @@ export const SendEnabled = { } return message; }, + fromPartial(object: DeepPartial): SendEnabled { const message = { ...baseSendEnabled } as SendEnabled; if (object.denom !== undefined && object.denom !== null) { @@ -245,6 +212,7 @@ export const SendEnabled = { } return message; }, + toJSON(message: SendEnabled): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); @@ -253,6 +221,8 @@ export const SendEnabled = { }, }; +const baseInput: object = { address: "" }; + export const Input = { encode(message: Input, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.address); @@ -261,7 +231,8 @@ export const Input = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Input { + + decode(input: Reader | Uint8Array, length?: number): Input { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseInput } as Input; @@ -282,6 +253,7 @@ export const Input = { } return message; }, + fromJSON(object: any): Input { const message = { ...baseInput } as Input; message.coins = []; @@ -297,6 +269,7 @@ export const Input = { } return message; }, + fromPartial(object: DeepPartial): Input { const message = { ...baseInput } as Input; message.coins = []; @@ -312,6 +285,7 @@ export const Input = { } return message; }, + toJSON(message: Input): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -324,6 +298,8 @@ export const Input = { }, }; +const baseOutput: object = { address: "" }; + export const Output = { encode(message: Output, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.address); @@ -332,7 +308,8 @@ export const Output = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Output { + + decode(input: Reader | Uint8Array, length?: number): Output { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseOutput } as Output; @@ -353,6 +330,7 @@ export const Output = { } return message; }, + fromJSON(object: any): Output { const message = { ...baseOutput } as Output; message.coins = []; @@ -368,6 +346,7 @@ export const Output = { } return message; }, + fromPartial(object: DeepPartial): Output { const message = { ...baseOutput } as Output; message.coins = []; @@ -383,6 +362,7 @@ export const Output = { } return message; }, + toJSON(message: Output): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -395,6 +375,8 @@ export const Output = { }, }; +const baseSupply: object = {}; + export const Supply = { encode(message: Supply, writer: Writer = Writer.create()): Writer { for (const v of message.total) { @@ -402,7 +384,8 @@ export const Supply = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Supply { + + decode(input: Reader | Uint8Array, length?: number): Supply { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSupply } as Supply; @@ -420,6 +403,7 @@ export const Supply = { } return message; }, + fromJSON(object: any): Supply { const message = { ...baseSupply } as Supply; message.total = []; @@ -430,6 +414,7 @@ export const Supply = { } return message; }, + fromPartial(object: DeepPartial): Supply { const message = { ...baseSupply } as Supply; message.total = []; @@ -440,6 +425,7 @@ export const Supply = { } return message; }, + toJSON(message: Supply): unknown { const obj: any = {}; if (message.total) { @@ -451,6 +437,8 @@ export const Supply = { }, }; +const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" }; + export const DenomUnit = { encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.denom); @@ -460,7 +448,8 @@ export const DenomUnit = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DenomUnit { + + decode(input: Reader | Uint8Array, length?: number): DenomUnit { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDenomUnit } as DenomUnit; @@ -484,6 +473,7 @@ export const DenomUnit = { } return message; }, + fromJSON(object: any): DenomUnit { const message = { ...baseDenomUnit } as DenomUnit; message.aliases = []; @@ -504,6 +494,7 @@ export const DenomUnit = { } return message; }, + fromPartial(object: DeepPartial): DenomUnit { const message = { ...baseDenomUnit } as DenomUnit; message.aliases = []; @@ -524,6 +515,7 @@ export const DenomUnit = { } return message; }, + toJSON(message: DenomUnit): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); @@ -537,6 +529,8 @@ export const DenomUnit = { }, }; +const baseMetadata: object = { description: "", base: "", display: "" }; + export const Metadata = { encode(message: Metadata, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.description); @@ -547,7 +541,8 @@ export const Metadata = { writer.uint32(34).string(message.display); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Metadata { + + decode(input: Reader | Uint8Array, length?: number): Metadata { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMetadata } as Metadata; @@ -574,6 +569,7 @@ export const Metadata = { } return message; }, + fromJSON(object: any): Metadata { const message = { ...baseMetadata } as Metadata; message.denomUnits = []; @@ -599,6 +595,7 @@ export const Metadata = { } return message; }, + fromPartial(object: DeepPartial): Metadata { const message = { ...baseMetadata } as Metadata; message.denomUnits = []; @@ -624,6 +621,7 @@ export const Metadata = { } return message; }, + toJSON(message: Metadata): unknown { const obj: any = {}; message.description !== undefined && (obj.description = message.description); @@ -638,7 +636,7 @@ export const Metadata = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts index 4c1fc9a4..d6bb0363 100644 --- a/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts @@ -3,209 +3,79 @@ import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; import { Params } from "../../../cosmos/bank/v1beta1/bank"; import { Reader, Writer } from "protobufjs/minimal"; +import * as Long from "long"; -/** - * QueryBalanceRequest is the request type for the Query/Balance RPC method. - */ +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { - /** - * address is the address to query balances for. - */ + /** address is the address to query balances for. */ address: string; - /** - * denom is the coin denom to query balances for. - */ + /** denom is the coin denom to query balances for. */ denom: string; } -/** - * QueryBalanceResponse is the response type for the Query/Balance RPC method. - */ +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponse { - /** - * balance is the balance of the coin. - */ + /** balance is the balance of the coin. */ balance?: Coin; } -/** - * QueryBalanceRequest is the request type for the Query/AllBalances RPC method. - */ +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequest { - /** - * address is the address to query balances for. - */ + /** address is the address to query balances for. */ address: string; - /** - * pagination defines an optional pagination for the request. - */ + /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; } /** - * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC - * method. + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. */ export interface QueryAllBalancesResponse { - /** - * balances is the balances of all the coins. - */ + /** balances is the balances of all the coins. */ balances: Coin[]; - /** - * pagination defines the pagination in the response. - */ + /** pagination defines the pagination in the response. */ pagination?: PageResponse; } /** - * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC - * method. + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. */ export interface QueryTotalSupplyRequest {} /** - * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC - * method + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method */ export interface QueryTotalSupplyResponse { - /** - * supply is the supply of the coins - */ + /** supply is the supply of the coins */ supply: Coin[]; } -/** - * QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. - */ +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequest { - /** - * denom is the coin denom to query balances for. - */ + /** denom is the coin denom to query balances for. */ denom: string; } -/** - * QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. - */ +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponse { - /** - * amount is the supply of the coin. - */ + /** amount is the supply of the coin. */ amount?: Coin; } -/** - * QueryParamsRequest defines the request type for querying x/bank parameters. - */ +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ export interface QueryParamsRequest {} -/** - * QueryParamsResponse defines the response type for querying x/bank parameters. - */ +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponse { params?: Params; } -const baseQueryBalanceRequest: object = { - address: "", - denom: "", -}; - -const baseQueryBalanceResponse: object = {}; - -const baseQueryAllBalancesRequest: object = { - address: "", -}; - -const baseQueryAllBalancesResponse: object = {}; - -const baseQueryTotalSupplyRequest: object = {}; - -const baseQueryTotalSupplyResponse: object = {}; - -const baseQuerySupplyOfRequest: object = { - denom: "", -}; - -const baseQuerySupplyOfResponse: object = {}; - -const baseQueryParamsRequest: object = {}; - -const baseQueryParamsResponse: object = {}; - -/** - * Query defines the gRPC querier service. - */ -export interface Query { - /** - * Balance queries the balance of a single coin for a single account. - */ - Balance(request: QueryBalanceRequest): Promise; - - /** - * AllBalances queries the balance of all coins for a single account. - */ - AllBalances(request: QueryAllBalancesRequest): Promise; - - /** - * TotalSupply queries the total supply of all coins. - */ - TotalSupply(request: QueryTotalSupplyRequest): Promise; - - /** - * SupplyOf queries the supply of a single coin. - */ - SupplyOf(request: QuerySupplyOfRequest): Promise; - - /** - * Params queries the parameters of x/bank module. - */ - Params(request: QueryParamsRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Balance(request: QueryBalanceRequest): Promise { - const data = QueryBalanceRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); - return promise.then((data) => QueryBalanceResponse.decode(new Reader(data))); - } - - AllBalances(request: QueryAllBalancesRequest): Promise { - const data = QueryAllBalancesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); - return promise.then((data) => QueryAllBalancesResponse.decode(new Reader(data))); - } - - TotalSupply(request: QueryTotalSupplyRequest): Promise { - const data = QueryTotalSupplyRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); - return promise.then((data) => QueryTotalSupplyResponse.decode(new Reader(data))); - } - - SupplyOf(request: QuerySupplyOfRequest): Promise { - const data = QuerySupplyOfRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); - return promise.then((data) => QuerySupplyOfResponse.decode(new Reader(data))); - } - - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -export const protobufPackage = "cosmos.bank.v1beta1"; +const baseQueryBalanceRequest: object = { address: "", denom: "" }; export const QueryBalanceRequest = { encode(message: QueryBalanceRequest, writer: Writer = Writer.create()): Writer { @@ -213,7 +83,8 @@ export const QueryBalanceRequest = { writer.uint32(18).string(message.denom); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryBalanceRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryBalanceRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; @@ -233,6 +104,7 @@ export const QueryBalanceRequest = { } return message; }, + fromJSON(object: any): QueryBalanceRequest { const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; if (object.address !== undefined && object.address !== null) { @@ -247,6 +119,7 @@ export const QueryBalanceRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryBalanceRequest { const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; if (object.address !== undefined && object.address !== null) { @@ -261,6 +134,7 @@ export const QueryBalanceRequest = { } return message; }, + toJSON(message: QueryBalanceRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -269,6 +143,8 @@ export const QueryBalanceRequest = { }, }; +const baseQueryBalanceResponse: object = {}; + export const QueryBalanceResponse = { encode(message: QueryBalanceResponse, writer: Writer = Writer.create()): Writer { if (message.balance !== undefined && message.balance !== undefined) { @@ -276,7 +152,8 @@ export const QueryBalanceResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryBalanceResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryBalanceResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; @@ -293,6 +170,7 @@ export const QueryBalanceResponse = { } return message; }, + fromJSON(object: any): QueryBalanceResponse { const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; if (object.balance !== undefined && object.balance !== null) { @@ -302,6 +180,7 @@ export const QueryBalanceResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryBalanceResponse { const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; if (object.balance !== undefined && object.balance !== null) { @@ -311,6 +190,7 @@ export const QueryBalanceResponse = { } return message; }, + toJSON(message: QueryBalanceResponse): unknown { const obj: any = {}; message.balance !== undefined && @@ -319,6 +199,8 @@ export const QueryBalanceResponse = { }, }; +const baseQueryAllBalancesRequest: object = { address: "" }; + export const QueryAllBalancesRequest = { encode(message: QueryAllBalancesRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.address); @@ -327,7 +209,8 @@ export const QueryAllBalancesRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryAllBalancesRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; @@ -347,6 +230,7 @@ export const QueryAllBalancesRequest = { } return message; }, + fromJSON(object: any): QueryAllBalancesRequest { const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; if (object.address !== undefined && object.address !== null) { @@ -361,6 +245,7 @@ export const QueryAllBalancesRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryAllBalancesRequest { const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; if (object.address !== undefined && object.address !== null) { @@ -375,6 +260,7 @@ export const QueryAllBalancesRequest = { } return message; }, + toJSON(message: QueryAllBalancesRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); @@ -384,6 +270,8 @@ export const QueryAllBalancesRequest = { }, }; +const baseQueryAllBalancesResponse: object = {}; + export const QueryAllBalancesResponse = { encode(message: QueryAllBalancesResponse, writer: Writer = Writer.create()): Writer { for (const v of message.balances) { @@ -394,7 +282,8 @@ export const QueryAllBalancesResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryAllBalancesResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; @@ -415,6 +304,7 @@ export const QueryAllBalancesResponse = { } return message; }, + fromJSON(object: any): QueryAllBalancesResponse { const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; message.balances = []; @@ -430,6 +320,7 @@ export const QueryAllBalancesResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryAllBalancesResponse { const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; message.balances = []; @@ -445,6 +336,7 @@ export const QueryAllBalancesResponse = { } return message; }, + toJSON(message: QueryAllBalancesResponse): unknown { const obj: any = {}; if (message.balances) { @@ -458,11 +350,14 @@ export const QueryAllBalancesResponse = { }, }; +const baseQueryTotalSupplyRequest: object = {}; + export const QueryTotalSupplyRequest = { encode(_: QueryTotalSupplyRequest, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryTotalSupplyRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; @@ -476,20 +371,25 @@ export const QueryTotalSupplyRequest = { } return message; }, + fromJSON(_: any): QueryTotalSupplyRequest { const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; return message; }, + fromPartial(_: DeepPartial): QueryTotalSupplyRequest { const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; return message; }, + toJSON(_: QueryTotalSupplyRequest): unknown { const obj: any = {}; return obj; }, }; +const baseQueryTotalSupplyResponse: object = {}; + export const QueryTotalSupplyResponse = { encode(message: QueryTotalSupplyResponse, writer: Writer = Writer.create()): Writer { for (const v of message.supply) { @@ -497,7 +397,8 @@ export const QueryTotalSupplyResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryTotalSupplyResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; @@ -515,6 +416,7 @@ export const QueryTotalSupplyResponse = { } return message; }, + fromJSON(object: any): QueryTotalSupplyResponse { const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; message.supply = []; @@ -525,6 +427,7 @@ export const QueryTotalSupplyResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryTotalSupplyResponse { const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; message.supply = []; @@ -535,6 +438,7 @@ export const QueryTotalSupplyResponse = { } return message; }, + toJSON(message: QueryTotalSupplyResponse): unknown { const obj: any = {}; if (message.supply) { @@ -546,12 +450,15 @@ export const QueryTotalSupplyResponse = { }, }; +const baseQuerySupplyOfRequest: object = { denom: "" }; + export const QuerySupplyOfRequest = { encode(message: QuerySupplyOfRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.denom); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QuerySupplyOfRequest { + + decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; @@ -568,6 +475,7 @@ export const QuerySupplyOfRequest = { } return message; }, + fromJSON(object: any): QuerySupplyOfRequest { const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; if (object.denom !== undefined && object.denom !== null) { @@ -577,6 +485,7 @@ export const QuerySupplyOfRequest = { } return message; }, + fromPartial(object: DeepPartial): QuerySupplyOfRequest { const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; if (object.denom !== undefined && object.denom !== null) { @@ -586,6 +495,7 @@ export const QuerySupplyOfRequest = { } return message; }, + toJSON(message: QuerySupplyOfRequest): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); @@ -593,6 +503,8 @@ export const QuerySupplyOfRequest = { }, }; +const baseQuerySupplyOfResponse: object = {}; + export const QuerySupplyOfResponse = { encode(message: QuerySupplyOfResponse, writer: Writer = Writer.create()): Writer { if (message.amount !== undefined && message.amount !== undefined) { @@ -600,7 +512,8 @@ export const QuerySupplyOfResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QuerySupplyOfResponse { + + decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; @@ -617,6 +530,7 @@ export const QuerySupplyOfResponse = { } return message; }, + fromJSON(object: any): QuerySupplyOfResponse { const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; if (object.amount !== undefined && object.amount !== null) { @@ -626,6 +540,7 @@ export const QuerySupplyOfResponse = { } return message; }, + fromPartial(object: DeepPartial): QuerySupplyOfResponse { const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; if (object.amount !== undefined && object.amount !== null) { @@ -635,6 +550,7 @@ export const QuerySupplyOfResponse = { } return message; }, + toJSON(message: QuerySupplyOfResponse): unknown { const obj: any = {}; message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); @@ -642,11 +558,14 @@ export const QuerySupplyOfResponse = { }, }; +const baseQueryParamsRequest: object = {}; + export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryParamsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryParamsRequest } as QueryParamsRequest; @@ -660,20 +579,25 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { const message = { ...baseQueryParamsRequest } as QueryParamsRequest; return message; }, + fromPartial(_: DeepPartial): QueryParamsRequest { const message = { ...baseQueryParamsRequest } as QueryParamsRequest; return message; }, + toJSON(_: QueryParamsRequest): unknown { const obj: any = {}; return obj; }, }; +const baseQueryParamsResponse: object = {}; + export const QueryParamsResponse = { encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer { if (message.params !== undefined && message.params !== undefined) { @@ -681,7 +605,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryParamsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryParamsResponse } as QueryParamsResponse; @@ -698,6 +623,7 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { const message = { ...baseQueryParamsResponse } as QueryParamsResponse; if (object.params !== undefined && object.params !== null) { @@ -707,6 +633,7 @@ export const QueryParamsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryParamsResponse { const message = { ...baseQueryParamsResponse } as QueryParamsResponse; if (object.params !== undefined && object.params !== null) { @@ -716,6 +643,7 @@ export const QueryParamsResponse = { } return message; }, + toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); @@ -723,7 +651,61 @@ export const QueryParamsResponse = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Balance queries the balance of a single coin for a single account. */ + Balance(request: QueryBalanceRequest): Promise; + /** AllBalances queries the balance of all coins for a single account. */ + AllBalances(request: QueryAllBalancesRequest): Promise; + /** TotalSupply queries the total supply of all coins. */ + TotalSupply(request: QueryTotalSupplyRequest): Promise; + /** SupplyOf queries the supply of a single coin. */ + SupplyOf(request: QuerySupplyOfRequest): Promise; + /** Params queries the parameters of x/bank module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Balance(request: QueryBalanceRequest): Promise { + const data = QueryBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryBalanceResponse.decode(new Reader(data))); + } + + AllBalances(request: QueryAllBalancesRequest): Promise { + const data = QueryAllBalancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryAllBalancesResponse.decode(new Reader(data))); + } + + TotalSupply(request: QueryTotalSupplyRequest): Promise { + const data = QueryTotalSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryTotalSupplyResponse.decode(new Reader(data))); + } + + SupplyOf(request: QuerySupplyOfRequest): Promise { + const data = QuerySupplyOfRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QuerySupplyOfResponse.decode(new Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts index 6a967bfb..0e15aa40 100644 --- a/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts @@ -1,86 +1,31 @@ /* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; -import { Reader, Writer } from "protobufjs/minimal"; +import * as Long from "long"; -/** - * MsgSend represents a message to send coins from one account to another. - */ +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { fromAddress: string; toAddress: string; amount: Coin[]; } -/** - * MsgSendResponse defines the Msg/Send response type. - */ +/** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse {} -/** - * MsgMultiSend represents an arbitrary multi-in, multi-out send message. - */ +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { inputs: Input[]; outputs: Output[]; } -/** - * MsgMultiSendResponse defines the Msg/MultiSend response type. - */ +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponse {} -const baseMsgSend: object = { - fromAddress: "", - toAddress: "", -}; - -const baseMsgSendResponse: object = {}; - -const baseMsgMultiSend: object = {}; - -const baseMsgMultiSendResponse: object = {}; - -/** - * Msg defines the bank Msg service. - */ -export interface Msg { - /** - * Send defines a method for sending coins from one account to another account. - */ - Send(request: MsgSend): Promise; - - /** - * MultiSend defines a method for sending coins from some accounts to other accounts. - */ - MultiSend(request: MsgMultiSend): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Send(request: MsgSend): Promise { - const data = MsgSend.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); - return promise.then((data) => MsgSendResponse.decode(new Reader(data))); - } - - MultiSend(request: MsgMultiSend): Promise { - const data = MsgMultiSend.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); - return promise.then((data) => MsgMultiSendResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -export const protobufPackage = "cosmos.bank.v1beta1"; +const baseMsgSend: object = { fromAddress: "", toAddress: "" }; export const MsgSend = { encode(message: MsgSend, writer: Writer = Writer.create()): Writer { @@ -91,7 +36,8 @@ export const MsgSend = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgSend { + + decode(input: Reader | Uint8Array, length?: number): MsgSend { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgSend } as MsgSend; @@ -115,6 +61,7 @@ export const MsgSend = { } return message; }, + fromJSON(object: any): MsgSend { const message = { ...baseMsgSend } as MsgSend; message.amount = []; @@ -135,6 +82,7 @@ export const MsgSend = { } return message; }, + fromPartial(object: DeepPartial): MsgSend { const message = { ...baseMsgSend } as MsgSend; message.amount = []; @@ -155,6 +103,7 @@ export const MsgSend = { } return message; }, + toJSON(message: MsgSend): unknown { const obj: any = {}; message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); @@ -168,11 +117,14 @@ export const MsgSend = { }, }; +const baseMsgSendResponse: object = {}; + export const MsgSendResponse = { encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgSendResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgSendResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgSendResponse } as MsgSendResponse; @@ -186,20 +138,25 @@ export const MsgSendResponse = { } return message; }, + fromJSON(_: any): MsgSendResponse { const message = { ...baseMsgSendResponse } as MsgSendResponse; return message; }, + fromPartial(_: DeepPartial): MsgSendResponse { const message = { ...baseMsgSendResponse } as MsgSendResponse; return message; }, + toJSON(_: MsgSendResponse): unknown { const obj: any = {}; return obj; }, }; +const baseMsgMultiSend: object = {}; + export const MsgMultiSend = { encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer { for (const v of message.inputs) { @@ -210,7 +167,8 @@ export const MsgMultiSend = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgMultiSend { + + decode(input: Reader | Uint8Array, length?: number): MsgMultiSend { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgMultiSend } as MsgMultiSend; @@ -232,6 +190,7 @@ export const MsgMultiSend = { } return message; }, + fromJSON(object: any): MsgMultiSend { const message = { ...baseMsgMultiSend } as MsgMultiSend; message.inputs = []; @@ -248,6 +207,7 @@ export const MsgMultiSend = { } return message; }, + fromPartial(object: DeepPartial): MsgMultiSend { const message = { ...baseMsgMultiSend } as MsgMultiSend; message.inputs = []; @@ -264,6 +224,7 @@ export const MsgMultiSend = { } return message; }, + toJSON(message: MsgMultiSend): unknown { const obj: any = {}; if (message.inputs) { @@ -280,11 +241,14 @@ export const MsgMultiSend = { }, }; +const baseMsgMultiSendResponse: object = {}; + export const MsgMultiSendResponse = { encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgMultiSendResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgMultiSendResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; @@ -298,21 +262,54 @@ export const MsgMultiSendResponse = { } return message; }, + fromJSON(_: any): MsgMultiSendResponse { const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; return message; }, + fromPartial(_: DeepPartial): MsgMultiSendResponse { const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; return message; }, + toJSON(_: MsgMultiSendResponse): unknown { const obj: any = {}; return obj; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** Send defines a method for sending coins from one account to another account. */ + Send(request: MsgSend): Promise; + /** MultiSend defines a method for sending coins from some accounts to other accounts. */ + MultiSend(request: MsgMultiSend): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgSendResponse.decode(new Reader(data))); + } + + MultiSend(request: MsgMultiSend): Promise { + const data = MsgMultiSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgMultiSendResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts b/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts index 06c4f129..1a70b44c 100644 --- a/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts @@ -4,80 +4,60 @@ import { Any } from "../../../../google/protobuf/any"; import { Event } from "../../../../tendermint/abci/types"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "cosmos.base.abci.v1beta1"; + /** - * TxResponse defines a structure containing relevant tx data and metadata. The - * tags are stringified and the log is JSON decoded. + * 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 - */ + /** The block height */ height: Long; - /** - * The transaction hash. - */ + /** The transaction hash. */ txhash: string; - /** - * Namespace for the Code - */ + /** Namespace for the Code */ codespace: string; - /** - * Response code. - */ + /** Response code. */ code: number; - /** - * Result bytes, if any. - */ + /** Result bytes, if any. */ data: string; /** - * The output of the application's logger (raw string). May be - * non-deterministic. + * 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. - */ + /** The output of the application's logger (typed). May be non-deterministic. */ logs: ABCIMessageLog[]; - /** - * Additional information. May be non-deterministic. - */ + /** Additional information. May be non-deterministic. */ info: string; - /** - * Amount of gas requested for transaction. - */ + /** Amount of gas requested for transaction. */ gasWanted: Long; - /** - * Amount of gas consumed by transaction. - */ + /** Amount of gas consumed by transaction. */ gasUsed: Long; - /** - * The request transaction bytes. - */ + /** 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. + * 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; } -/** - * ABCIMessageLog defines a structure containing an indexed tx ABCI message log. - */ +/** 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 contains a slice of Event objects that were emitted during some + * execution. */ events: StringEvent[]; } /** - * StringEvent defines en Event object wrapper where all the attributes - * contain key/value pairs that are strings instead of raw bytes. + * 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; @@ -85,51 +65,41 @@ export interface StringEvent { } /** - * Attribute defines an attribute wrapper where the key and value are - * strings instead of raw bytes. + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. */ export interface Attribute { key: string; value: string; } -/** - * GasInfo defines tx execution gas context. - */ +/** GasInfo defines tx execution gas context. */ export interface GasInfo { - /** - * GasWanted is the maximum units of work we allow this tx to perform. - */ + /** GasWanted is the maximum units of work we allow this tx to perform. */ gasWanted: Long; - /** - * GasUsed is the amount of gas actually consumed. - */ + /** GasUsed is the amount of gas actually consumed. */ gasUsed: Long; } -/** - * Result is the union of ResponseFormat and ResponseCheckTx. - */ +/** 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. + * Data is any data returned from message or handler execution. It MUST be + * length prefixed in order to separate data from multiple message executions. */ data: Uint8Array; - /** - * Log contains the log information from message or handler execution. - */ + /** 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 contains a slice of Event objects that were emitted during message + * or handler execution. */ events: Event[]; } /** - * SimulationResponse defines the response generated when a transaction is - * successfully simulated. + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. */ export interface SimulationResponse { gasInfo?: GasInfo; @@ -137,8 +107,8 @@ export interface SimulationResponse { } /** - * MsgData defines the data returned in a Result object during message - * execution. + * MsgData defines the data returned in a Result object during message + * execution. */ export interface MsgData { msgType: string; @@ -146,40 +116,26 @@ export interface MsgData { } /** - * TxMsgData defines a list of MsgData. A transaction will have a MsgData object - * for each message. + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. */ export interface TxMsgData { data: MsgData[]; } -/** - * SearchTxsResult defines a structure for querying txs pageable - */ +/** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { - /** - * Count of all txs - */ + /** Count of all txs */ totalCount: Long; - /** - * Count of txs in current page - */ + /** Count of txs in current page */ count: Long; - /** - * Index of current page, start from 1 - */ + /** Index of current page, start from 1 */ pageNumber: Long; - /** - * Count of total pages - */ + /** Count of total pages */ pageTotal: Long; - /** - * Max count txs per page - */ + /** Max count txs per page */ limit: Long; - /** - * List of txs in current page - */ + /** List of txs in current page */ txs: TxResponse[]; } @@ -196,47 +152,6 @@ const baseTxResponse: object = { timestamp: "", }; -const baseABCIMessageLog: object = { - msgIndex: 0, - log: "", -}; - -const baseStringEvent: object = { - type: "", -}; - -const baseAttribute: object = { - key: "", - value: "", -}; - -const baseGasInfo: object = { - gasWanted: Long.UZERO, - gasUsed: Long.UZERO, -}; - -const baseResult: object = { - log: "", -}; - -const baseSimulationResponse: object = {}; - -const baseMsgData: object = { - msgType: "", -}; - -const baseTxMsgData: object = {}; - -const baseSearchTxsResult: object = { - totalCount: Long.UZERO, - count: Long.UZERO, - pageNumber: Long.UZERO, - pageTotal: Long.UZERO, - limit: Long.UZERO, -}; - -export const protobufPackage = "cosmos.base.abci.v1beta1"; - export const TxResponse = { encode(message: TxResponse, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.height); @@ -257,7 +172,8 @@ export const TxResponse = { writer.uint32(98).string(message.timestamp); return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxResponse { + + decode(input: Reader | Uint8Array, length?: number): TxResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxResponse } as TxResponse; @@ -308,6 +224,7 @@ export const TxResponse = { } return message; }, + fromJSON(object: any): TxResponse { const message = { ...baseTxResponse } as TxResponse; message.logs = []; @@ -373,6 +290,7 @@ export const TxResponse = { } return message; }, + fromPartial(object: DeepPartial): TxResponse { const message = { ...baseTxResponse } as TxResponse; message.logs = []; @@ -438,6 +356,7 @@ export const TxResponse = { } return message; }, + toJSON(message: TxResponse): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); @@ -460,6 +379,8 @@ export const TxResponse = { }, }; +const baseABCIMessageLog: object = { msgIndex: 0, log: "" }; + export const ABCIMessageLog = { encode(message: ABCIMessageLog, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.msgIndex); @@ -469,7 +390,8 @@ export const ABCIMessageLog = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ABCIMessageLog { + + decode(input: Reader | Uint8Array, length?: number): ABCIMessageLog { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseABCIMessageLog } as ABCIMessageLog; @@ -493,6 +415,7 @@ export const ABCIMessageLog = { } return message; }, + fromJSON(object: any): ABCIMessageLog { const message = { ...baseABCIMessageLog } as ABCIMessageLog; message.events = []; @@ -513,6 +436,7 @@ export const ABCIMessageLog = { } return message; }, + fromPartial(object: DeepPartial): ABCIMessageLog { const message = { ...baseABCIMessageLog } as ABCIMessageLog; message.events = []; @@ -533,6 +457,7 @@ export const ABCIMessageLog = { } return message; }, + toJSON(message: ABCIMessageLog): unknown { const obj: any = {}; message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex); @@ -546,6 +471,8 @@ export const ABCIMessageLog = { }, }; +const baseStringEvent: object = { type: "" }; + export const StringEvent = { encode(message: StringEvent, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.type); @@ -554,7 +481,8 @@ export const StringEvent = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): StringEvent { + + decode(input: Reader | Uint8Array, length?: number): StringEvent { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseStringEvent } as StringEvent; @@ -575,6 +503,7 @@ export const StringEvent = { } return message; }, + fromJSON(object: any): StringEvent { const message = { ...baseStringEvent } as StringEvent; message.attributes = []; @@ -590,6 +519,7 @@ export const StringEvent = { } return message; }, + fromPartial(object: DeepPartial): StringEvent { const message = { ...baseStringEvent } as StringEvent; message.attributes = []; @@ -605,6 +535,7 @@ export const StringEvent = { } return message; }, + toJSON(message: StringEvent): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); @@ -617,13 +548,16 @@ export const StringEvent = { }, }; +const baseAttribute: object = { key: "", value: "" }; + export const Attribute = { encode(message: Attribute, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.key); writer.uint32(18).string(message.value); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Attribute { + + decode(input: Reader | Uint8Array, length?: number): Attribute { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAttribute } as Attribute; @@ -643,6 +577,7 @@ export const Attribute = { } return message; }, + fromJSON(object: any): Attribute { const message = { ...baseAttribute } as Attribute; if (object.key !== undefined && object.key !== null) { @@ -657,6 +592,7 @@ export const Attribute = { } return message; }, + fromPartial(object: DeepPartial): Attribute { const message = { ...baseAttribute } as Attribute; if (object.key !== undefined && object.key !== null) { @@ -671,6 +607,7 @@ export const Attribute = { } return message; }, + toJSON(message: Attribute): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); @@ -679,13 +616,16 @@ export const Attribute = { }, }; +const baseGasInfo: object = { gasWanted: Long.UZERO, gasUsed: Long.UZERO }; + export const GasInfo = { encode(message: GasInfo, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.gasWanted); writer.uint32(16).uint64(message.gasUsed); return writer; }, - decode(input: Uint8Array | Reader, length?: number): GasInfo { + + decode(input: Reader | Uint8Array, length?: number): GasInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGasInfo } as GasInfo; @@ -705,6 +645,7 @@ export const GasInfo = { } return message; }, + fromJSON(object: any): GasInfo { const message = { ...baseGasInfo } as GasInfo; if (object.gasWanted !== undefined && object.gasWanted !== null) { @@ -719,6 +660,7 @@ export const GasInfo = { } return message; }, + fromPartial(object: DeepPartial): GasInfo { const message = { ...baseGasInfo } as GasInfo; if (object.gasWanted !== undefined && object.gasWanted !== null) { @@ -733,6 +675,7 @@ export const GasInfo = { } return message; }, + toJSON(message: GasInfo): unknown { const obj: any = {}; message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); @@ -741,6 +684,8 @@ export const GasInfo = { }, }; +const baseResult: object = { log: "" }; + export const Result = { encode(message: Result, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.data); @@ -750,7 +695,8 @@ export const Result = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Result { + + decode(input: Reader | Uint8Array, length?: number): Result { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResult } as Result; @@ -774,6 +720,7 @@ export const Result = { } return message; }, + fromJSON(object: any): Result { const message = { ...baseResult } as Result; message.events = []; @@ -792,6 +739,7 @@ export const Result = { } return message; }, + fromPartial(object: DeepPartial): Result { const message = { ...baseResult } as Result; message.events = []; @@ -812,6 +760,7 @@ export const Result = { } return message; }, + toJSON(message: Result): unknown { const obj: any = {}; message.data !== undefined && @@ -826,6 +775,8 @@ export const Result = { }, }; +const baseSimulationResponse: object = {}; + export const SimulationResponse = { encode(message: SimulationResponse, writer: Writer = Writer.create()): Writer { if (message.gasInfo !== undefined && message.gasInfo !== undefined) { @@ -836,7 +787,8 @@ export const SimulationResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SimulationResponse { + + decode(input: Reader | Uint8Array, length?: number): SimulationResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSimulationResponse } as SimulationResponse; @@ -856,6 +808,7 @@ export const SimulationResponse = { } return message; }, + fromJSON(object: any): SimulationResponse { const message = { ...baseSimulationResponse } as SimulationResponse; if (object.gasInfo !== undefined && object.gasInfo !== null) { @@ -870,6 +823,7 @@ export const SimulationResponse = { } return message; }, + fromPartial(object: DeepPartial): SimulationResponse { const message = { ...baseSimulationResponse } as SimulationResponse; if (object.gasInfo !== undefined && object.gasInfo !== null) { @@ -884,6 +838,7 @@ export const SimulationResponse = { } return message; }, + toJSON(message: SimulationResponse): unknown { const obj: any = {}; message.gasInfo !== undefined && @@ -893,13 +848,16 @@ export const SimulationResponse = { }, }; +const baseMsgData: object = { msgType: "" }; + export const MsgData = { encode(message: MsgData, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.msgType); writer.uint32(18).bytes(message.data); return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgData { + + decode(input: Reader | Uint8Array, length?: number): MsgData { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgData } as MsgData; @@ -919,6 +877,7 @@ export const MsgData = { } return message; }, + fromJSON(object: any): MsgData { const message = { ...baseMsgData } as MsgData; if (object.msgType !== undefined && object.msgType !== null) { @@ -931,6 +890,7 @@ export const MsgData = { } return message; }, + fromPartial(object: DeepPartial): MsgData { const message = { ...baseMsgData } as MsgData; if (object.msgType !== undefined && object.msgType !== null) { @@ -945,6 +905,7 @@ export const MsgData = { } return message; }, + toJSON(message: MsgData): unknown { const obj: any = {}; message.msgType !== undefined && (obj.msgType = message.msgType); @@ -954,6 +915,8 @@ export const MsgData = { }, }; +const baseTxMsgData: object = {}; + export const TxMsgData = { encode(message: TxMsgData, writer: Writer = Writer.create()): Writer { for (const v of message.data) { @@ -961,7 +924,8 @@ export const TxMsgData = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxMsgData { + + decode(input: Reader | Uint8Array, length?: number): TxMsgData { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxMsgData } as TxMsgData; @@ -979,6 +943,7 @@ export const TxMsgData = { } return message; }, + fromJSON(object: any): TxMsgData { const message = { ...baseTxMsgData } as TxMsgData; message.data = []; @@ -989,6 +954,7 @@ export const TxMsgData = { } return message; }, + fromPartial(object: DeepPartial): TxMsgData { const message = { ...baseTxMsgData } as TxMsgData; message.data = []; @@ -999,6 +965,7 @@ export const TxMsgData = { } return message; }, + toJSON(message: TxMsgData): unknown { const obj: any = {}; if (message.data) { @@ -1010,6 +977,14 @@ export const TxMsgData = { }, }; +const baseSearchTxsResult: object = { + totalCount: Long.UZERO, + count: Long.UZERO, + pageNumber: Long.UZERO, + pageTotal: Long.UZERO, + limit: Long.UZERO, +}; + export const SearchTxsResult = { encode(message: SearchTxsResult, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.totalCount); @@ -1022,7 +997,8 @@ export const SearchTxsResult = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SearchTxsResult { + + decode(input: Reader | Uint8Array, length?: number): SearchTxsResult { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSearchTxsResult } as SearchTxsResult; @@ -1055,6 +1031,7 @@ export const SearchTxsResult = { } return message; }, + fromJSON(object: any): SearchTxsResult { const message = { ...baseSearchTxsResult } as SearchTxsResult; message.txs = []; @@ -1090,6 +1067,7 @@ export const SearchTxsResult = { } return message; }, + fromPartial(object: DeepPartial): SearchTxsResult { const message = { ...baseSearchTxsResult } as SearchTxsResult; message.txs = []; @@ -1125,6 +1103,7 @@ export const SearchTxsResult = { } return message; }, + toJSON(message: SearchTxsResult): unknown { const obj: any = {}; message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); @@ -1141,15 +1120,18 @@ export const SearchTxsResult = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -1159,6 +1141,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -1166,7 +1150,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts b/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts index 0beaa413..d9d5a0ed 100644 --- a/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts @@ -2,75 +2,67 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "cosmos.base.query.v1beta1"; + /** - * PageRequest is to be embedded in gRPC request messages for efficient - * pagination. Ex: + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: * - * message SomeRequest { - * Foo some_parameter = 1; - * PageRequest pagination = 2; - * } + * 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 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 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 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. + * 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; } /** - * PageResponse is to be embedded in gRPC response messages where the - * corresponding request message has used PageRequest. + * 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 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 + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently */ nextKey: Uint8Array; /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise */ total: Long; } -const basePageRequest: object = { - offset: Long.UZERO, - limit: Long.UZERO, - countTotal: false, -}; - -const basePageResponse: object = { - total: Long.UZERO, -}; - -export const protobufPackage = "cosmos.base.query.v1beta1"; +const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTotal: false }; export const PageRequest = { encode(message: PageRequest, writer: Writer = Writer.create()): Writer { @@ -80,7 +72,8 @@ export const PageRequest = { writer.uint32(32).bool(message.countTotal); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PageRequest { + + decode(input: Reader | Uint8Array, length?: number): PageRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePageRequest } as PageRequest; @@ -106,6 +99,7 @@ export const PageRequest = { } return message; }, + fromJSON(object: any): PageRequest { const message = { ...basePageRequest } as PageRequest; if (object.key !== undefined && object.key !== null) { @@ -128,6 +122,7 @@ export const PageRequest = { } return message; }, + fromPartial(object: DeepPartial): PageRequest { const message = { ...basePageRequest } as PageRequest; if (object.key !== undefined && object.key !== null) { @@ -152,6 +147,7 @@ export const PageRequest = { } return message; }, + toJSON(message: PageRequest): unknown { const obj: any = {}; message.key !== undefined && @@ -163,13 +159,16 @@ export const PageRequest = { }, }; +const basePageResponse: object = { total: Long.UZERO }; + export const PageResponse = { encode(message: PageResponse, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.nextKey); writer.uint32(16).uint64(message.total); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PageResponse { + + decode(input: Reader | Uint8Array, length?: number): PageResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePageResponse } as PageResponse; @@ -189,6 +188,7 @@ export const PageResponse = { } return message; }, + fromJSON(object: any): PageResponse { const message = { ...basePageResponse } as PageResponse; if (object.nextKey !== undefined && object.nextKey !== null) { @@ -201,6 +201,7 @@ export const PageResponse = { } return message; }, + fromPartial(object: DeepPartial): PageResponse { const message = { ...basePageResponse } as PageResponse; if (object.nextKey !== undefined && object.nextKey !== null) { @@ -215,6 +216,7 @@ export const PageResponse = { } return message; }, + toJSON(message: PageResponse): unknown { const obj: any = {}; message.nextKey !== undefined && @@ -224,15 +226,18 @@ export const PageResponse = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -242,6 +247,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -249,7 +256,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts b/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts index 34f4bad5..b6a459fe 100644 --- a/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts +++ b/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts @@ -1,11 +1,14 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "cosmos.base.v1beta1"; /** - * Coin defines a token with a denomination and an amount. + * 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. + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. */ export interface Coin { denom: string; @@ -13,49 +16,27 @@ export interface Coin { } /** - * DecCoin defines a token with a denomination and a decimal amount. + * 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. + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. */ export interface DecCoin { denom: string; amount: string; } -/** - * IntProto defines a Protobuf wrapper around an Int object. - */ +/** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProto { int: string; } -/** - * DecProto defines a Protobuf wrapper around a Dec object. - */ +/** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProto { dec: string; } -const baseCoin: object = { - denom: "", - amount: "", -}; - -const baseDecCoin: object = { - denom: "", - amount: "", -}; - -const baseIntProto: object = { - int: "", -}; - -const baseDecProto: object = { - dec: "", -}; - -export const protobufPackage = "cosmos.base.v1beta1"; +const baseCoin: object = { denom: "", amount: "" }; export const Coin = { encode(message: Coin, writer: Writer = Writer.create()): Writer { @@ -63,7 +44,8 @@ export const Coin = { writer.uint32(18).string(message.amount); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Coin { + + decode(input: Reader | Uint8Array, length?: number): Coin { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCoin } as Coin; @@ -83,6 +65,7 @@ export const Coin = { } return message; }, + fromJSON(object: any): Coin { const message = { ...baseCoin } as Coin; if (object.denom !== undefined && object.denom !== null) { @@ -97,6 +80,7 @@ export const Coin = { } return message; }, + fromPartial(object: DeepPartial): Coin { const message = { ...baseCoin } as Coin; if (object.denom !== undefined && object.denom !== null) { @@ -111,6 +95,7 @@ export const Coin = { } return message; }, + toJSON(message: Coin): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); @@ -119,13 +104,16 @@ export const Coin = { }, }; +const baseDecCoin: object = { denom: "", amount: "" }; + export const DecCoin = { encode(message: DecCoin, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.denom); writer.uint32(18).string(message.amount); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DecCoin { + + decode(input: Reader | Uint8Array, length?: number): DecCoin { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDecCoin } as DecCoin; @@ -145,6 +133,7 @@ export const DecCoin = { } return message; }, + fromJSON(object: any): DecCoin { const message = { ...baseDecCoin } as DecCoin; if (object.denom !== undefined && object.denom !== null) { @@ -159,6 +148,7 @@ export const DecCoin = { } return message; }, + fromPartial(object: DeepPartial): DecCoin { const message = { ...baseDecCoin } as DecCoin; if (object.denom !== undefined && object.denom !== null) { @@ -173,6 +163,7 @@ export const DecCoin = { } return message; }, + toJSON(message: DecCoin): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); @@ -181,12 +172,15 @@ export const DecCoin = { }, }; +const baseIntProto: object = { int: "" }; + export const IntProto = { encode(message: IntProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.int); return writer; }, - decode(input: Uint8Array | Reader, length?: number): IntProto { + + decode(input: Reader | Uint8Array, length?: number): IntProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseIntProto } as IntProto; @@ -203,6 +197,7 @@ export const IntProto = { } return message; }, + fromJSON(object: any): IntProto { const message = { ...baseIntProto } as IntProto; if (object.int !== undefined && object.int !== null) { @@ -212,6 +207,7 @@ export const IntProto = { } return message; }, + fromPartial(object: DeepPartial): IntProto { const message = { ...baseIntProto } as IntProto; if (object.int !== undefined && object.int !== null) { @@ -221,6 +217,7 @@ export const IntProto = { } return message; }, + toJSON(message: IntProto): unknown { const obj: any = {}; message.int !== undefined && (obj.int = message.int); @@ -228,12 +225,15 @@ export const IntProto = { }, }; +const baseDecProto: object = { dec: "" }; + export const DecProto = { encode(message: DecProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.dec); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DecProto { + + decode(input: Reader | Uint8Array, length?: number): DecProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDecProto } as DecProto; @@ -250,6 +250,7 @@ export const DecProto = { } return message; }, + fromJSON(object: any): DecProto { const message = { ...baseDecProto } as DecProto; if (object.dec !== undefined && object.dec !== null) { @@ -259,6 +260,7 @@ export const DecProto = { } return message; }, + fromPartial(object: DeepPartial): DecProto { const message = { ...baseDecProto } as DecProto; if (object.dec !== undefined && object.dec !== null) { @@ -268,6 +270,7 @@ export const DecProto = { } return message; }, + toJSON(message: DecProto): unknown { const obj: any = {}; message.dec !== undefined && (obj.dec = message.dec); @@ -275,7 +278,7 @@ export const DecProto = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts index 6caa5ba6..5b8dd393 100644 --- a/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,20 +1,23 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; /** - * 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. + * 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[]; } /** - * 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. + * 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; @@ -23,12 +26,6 @@ export interface CompactBitArray { const baseMultiSignature: object = {}; -const baseCompactBitArray: object = { - extraBitsStored: 0, -}; - -export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; - export const MultiSignature = { encode(message: MultiSignature, writer: Writer = Writer.create()): Writer { for (const v of message.signatures) { @@ -36,7 +33,8 @@ export const MultiSignature = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MultiSignature { + + decode(input: Reader | Uint8Array, length?: number): MultiSignature { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMultiSignature } as MultiSignature; @@ -54,6 +52,7 @@ export const MultiSignature = { } return message; }, + fromJSON(object: any): MultiSignature { const message = { ...baseMultiSignature } as MultiSignature; message.signatures = []; @@ -64,6 +63,7 @@ export const MultiSignature = { } return message; }, + fromPartial(object: DeepPartial): MultiSignature { const message = { ...baseMultiSignature } as MultiSignature; message.signatures = []; @@ -74,6 +74,7 @@ export const MultiSignature = { } return message; }, + toJSON(message: MultiSignature): unknown { const obj: any = {}; if (message.signatures) { @@ -85,13 +86,16 @@ export const MultiSignature = { }, }; +const baseCompactBitArray: object = { extraBitsStored: 0 }; + export const CompactBitArray = { encode(message: CompactBitArray, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.extraBitsStored); writer.uint32(18).bytes(message.elems); return writer; }, - decode(input: Uint8Array | Reader, length?: number): CompactBitArray { + + decode(input: Reader | Uint8Array, length?: number): CompactBitArray { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCompactBitArray } as CompactBitArray; @@ -111,6 +115,7 @@ export const CompactBitArray = { } return message; }, + fromJSON(object: any): CompactBitArray { const message = { ...baseCompactBitArray } as CompactBitArray; if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { @@ -123,6 +128,7 @@ export const CompactBitArray = { } return message; }, + fromPartial(object: DeepPartial): CompactBitArray { const message = { ...baseCompactBitArray } as CompactBitArray; if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { @@ -137,6 +143,7 @@ export const CompactBitArray = { } return message; }, + toJSON(message: CompactBitArray): unknown { const obj: any = {}; message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored); @@ -146,15 +153,18 @@ export const CompactBitArray = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -164,6 +174,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -171,7 +183,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts b/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts index eb131770..6ae71a98 100644 --- a/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts +++ b/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts @@ -1,36 +1,34 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "cosmos.crypto.secp256k1"; /** - * PubKey defines a secp256k1 public key - * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte - * if the y-coordinate is the lexicographically largest of the two associated with - * the x-coordinate. Otherwise the first byte is a 0x03. - * This prefix is followed with the x-coordinate. + * 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; } -/** - * PrivKey defines a secp256k1 private key. - */ +/** PrivKey defines a secp256k1 private key. */ export interface PrivKey { key: Uint8Array; } const basePubKey: object = {}; -const basePrivKey: object = {}; - -export const protobufPackage = "cosmos.crypto.secp256k1"; - export const PubKey = { encode(message: PubKey, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PubKey { + + decode(input: Reader | Uint8Array, length?: number): PubKey { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePubKey } as PubKey; @@ -47,6 +45,7 @@ export const PubKey = { } return message; }, + fromJSON(object: any): PubKey { const message = { ...basePubKey } as PubKey; if (object.key !== undefined && object.key !== null) { @@ -54,6 +53,7 @@ export const PubKey = { } return message; }, + fromPartial(object: DeepPartial): PubKey { const message = { ...basePubKey } as PubKey; if (object.key !== undefined && object.key !== null) { @@ -63,6 +63,7 @@ export const PubKey = { } return message; }, + toJSON(message: PubKey): unknown { const obj: any = {}; message.key !== undefined && @@ -71,12 +72,15 @@ export const PubKey = { }, }; +const basePrivKey: object = {}; + export const PrivKey = { encode(message: PrivKey, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PrivKey { + + decode(input: Reader | Uint8Array, length?: number): PrivKey { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePrivKey } as PrivKey; @@ -93,6 +97,7 @@ export const PrivKey = { } return message; }, + fromJSON(object: any): PrivKey { const message = { ...basePrivKey } as PrivKey; if (object.key !== undefined && object.key !== null) { @@ -100,6 +105,7 @@ export const PrivKey = { } return message; }, + fromPartial(object: DeepPartial): PrivKey { const message = { ...basePrivKey } as PrivKey; if (object.key !== undefined && object.key !== null) { @@ -109,6 +115,7 @@ export const PrivKey = { } return message; }, + toJSON(message: PrivKey): unknown { const obj: any = {}; message.key !== undefined && @@ -117,15 +124,18 @@ export const PrivKey = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -135,6 +145,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -142,7 +154,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts b/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts index 3dff79c8..4b899b76 100644 --- a/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts +++ b/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts @@ -5,360 +5,19 @@ import * as Long from "long"; import { Duration } from "../../../google/protobuf/duration"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Writer, Reader, util, configure } from "protobufjs/minimal"; - -/** - * 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[]; -} - -/** - * CommissionRates defines the initial commission rates to be used for creating - * a validator. - */ -export interface CommissionRates { - rate: string; - maxRate: string; - maxChangeRate: string; -} - -/** - * Commission defines commission parameters for a given validator. - */ -export interface Commission { - commissionRates?: CommissionRates; - updateTime?: Date; -} - -/** - * Description defines a validator description. - */ -export interface Description { - moniker: string; - identity: string; - website: string; - securityContact: 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 { - operatorAddress: string; - consensusPubkey?: Any; - jailed: boolean; - status: BondStatus; - tokens: string; - delegatorShares: string; - description?: Description; - unbondingHeight: Long; - unbondingTime?: Date; - commission?: Commission; - minSelfDelegation: string; -} - -/** - * ValAddresses defines a repeated set of validator addresses. - */ -export interface ValAddresses { - 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; -} - -/** - * DVPairs defines an array of DVPair objects. - */ -export interface DVPairs { - pairs: DVPair[]; -} - -/** - * 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; -} - -/** - * DVVTriplets defines an array of DVVTriplet objects. - */ -export interface DVVTriplets { - triplets: DVVTriplet[]; -} - -/** - * 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 { - delegatorAddress: string; - validatorAddress: 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 { - delegatorAddress: string; - validatorAddress: string; - /** - * unbonding delegation entries - */ - entries: UnbondingDelegationEntry[]; -} - -/** - * UnbondingDelegationEntry defines an unbonding object with relevant metadata. - */ -export interface UnbondingDelegationEntry { - creationHeight: Long; - completionTime?: Date; - initialBalance: string; - balance: string; -} - -/** - * RedelegationEntry defines a redelegation object with relevant metadata. - */ -export interface RedelegationEntry { - creationHeight: Long; - completionTime?: Date; - initialBalance: string; - sharesDst: 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 { - delegatorAddress: string; - validatorSrcAddress: string; - validatorDstAddress: string; - /** - * redelegation entries - */ - entries: RedelegationEntry[]; -} - -/** - * Params defines the parameters for the staking module. - */ -export interface Params { - unbondingTime?: Duration; - maxValidators: number; - maxEntries: number; - historicalEntries: number; - bondDenom: 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; -} - -/** - * 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; -} - -/** - * 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[]; -} - -/** - * Pool is used for tracking bonded and not-bonded token supply of the bond - * denomination. - */ -export interface Pool { - notBondedTokens: string; - bondedTokens: string; -} - -const baseHistoricalInfo: object = {}; - -const baseCommissionRates: object = { - rate: "", - maxRate: "", - maxChangeRate: "", -}; - -const baseCommission: object = {}; - -const baseDescription: object = { - moniker: "", - identity: "", - website: "", - securityContact: "", - details: "", -}; - -const baseValidator: object = { - operatorAddress: "", - jailed: false, - status: 0, - tokens: "", - delegatorShares: "", - unbondingHeight: Long.ZERO, - minSelfDelegation: "", -}; - -const baseValAddresses: object = { - addresses: "", -}; - -const baseDVPair: object = { - delegatorAddress: "", - validatorAddress: "", -}; - -const baseDVPairs: object = {}; - -const baseDVVTriplet: object = { - delegatorAddress: "", - validatorSrcAddress: "", - validatorDstAddress: "", -}; - -const baseDVVTriplets: object = {}; - -const baseDelegation: object = { - delegatorAddress: "", - validatorAddress: "", - shares: "", -}; - -const baseUnbondingDelegation: object = { - delegatorAddress: "", - validatorAddress: "", -}; - -const baseUnbondingDelegationEntry: object = { - creationHeight: Long.ZERO, - initialBalance: "", - balance: "", -}; - -const baseRedelegationEntry: object = { - creationHeight: Long.ZERO, - initialBalance: "", - sharesDst: "", -}; - -const baseRedelegation: object = { - delegatorAddress: "", - validatorSrcAddress: "", - validatorDstAddress: "", -}; - -const baseParams: object = { - maxValidators: 0, - maxEntries: 0, - historicalEntries: 0, - bondDenom: "", -}; - -const baseDelegationResponse: object = {}; - -const baseRedelegationEntryResponse: object = { - balance: "", -}; - -const baseRedelegationResponse: object = {}; - -const basePool: object = { - notBondedTokens: "", - bondedTokens: "", -}; - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function numberToLong(number: number) { - return Long.fromNumber(number); -} +import { util, configure, Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "cosmos.staking.v1beta1"; -/** BondStatus is the status of a validator. - */ +/** BondStatus is the status of a validator. */ export enum BondStatus { - /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. - */ + /** 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 - 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 - UNBONDING defines a validator that is unbonding. */ BOND_STATUS_UNBONDING = 2, - /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. - */ + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ BOND_STATUS_BONDED = 3, UNRECOGNIZED = -1, } @@ -399,6 +58,202 @@ export function bondStatusToJSON(object: BondStatus): string { } } +/** + * 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[]; +} + +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + rate: string; + maxRate: string; + maxChangeRate: string; +} + +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + commissionRates?: CommissionRates; + updateTime?: Date; +} + +/** Description defines a validator description. */ +export interface Description { + moniker: string; + identity: string; + website: string; + securityContact: 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 { + operatorAddress: string; + consensusPubkey?: Any; + jailed: boolean; + status: BondStatus; + tokens: string; + delegatorShares: string; + description?: Description; + unbondingHeight: Long; + unbondingTime?: Date; + commission?: Commission; + minSelfDelegation: string; +} + +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + 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; +} + +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} + +/** + * 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; +} + +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} + +/** + * 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 { + delegatorAddress: string; + validatorAddress: 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 { + delegatorAddress: string; + validatorAddress: string; + /** unbonding delegation entries */ + entries: UnbondingDelegationEntry[]; +} + +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + creationHeight: Long; + completionTime?: Date; + initialBalance: string; + balance: string; +} + +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + creationHeight: Long; + completionTime?: Date; + initialBalance: string; + sharesDst: 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 { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + /** redelegation entries */ + entries: RedelegationEntry[]; +} + +/** Params defines the parameters for the staking module. */ +export interface Params { + unbondingTime?: Duration; + maxValidators: number; + maxEntries: number; + historicalEntries: number; + bondDenom: 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; +} + +/** + * 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; +} + +/** + * 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[]; +} + +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} + +const baseHistoricalInfo: object = {}; + export const HistoricalInfo = { encode(message: HistoricalInfo, writer: Writer = Writer.create()): Writer { if (message.header !== undefined && message.header !== undefined) { @@ -409,7 +264,8 @@ export const HistoricalInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): HistoricalInfo { + + decode(input: Reader | Uint8Array, length?: number): HistoricalInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHistoricalInfo } as HistoricalInfo; @@ -430,6 +286,7 @@ export const HistoricalInfo = { } return message; }, + fromJSON(object: any): HistoricalInfo { const message = { ...baseHistoricalInfo } as HistoricalInfo; message.valset = []; @@ -445,6 +302,7 @@ export const HistoricalInfo = { } return message; }, + fromPartial(object: DeepPartial): HistoricalInfo { const message = { ...baseHistoricalInfo } as HistoricalInfo; message.valset = []; @@ -460,6 +318,7 @@ export const HistoricalInfo = { } return message; }, + toJSON(message: HistoricalInfo): unknown { const obj: any = {}; message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); @@ -472,6 +331,8 @@ export const HistoricalInfo = { }, }; +const baseCommissionRates: object = { rate: "", maxRate: "", maxChangeRate: "" }; + export const CommissionRates = { encode(message: CommissionRates, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.rate); @@ -479,7 +340,8 @@ export const CommissionRates = { writer.uint32(26).string(message.maxChangeRate); return writer; }, - decode(input: Uint8Array | Reader, length?: number): CommissionRates { + + decode(input: Reader | Uint8Array, length?: number): CommissionRates { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCommissionRates } as CommissionRates; @@ -502,6 +364,7 @@ export const CommissionRates = { } return message; }, + fromJSON(object: any): CommissionRates { const message = { ...baseCommissionRates } as CommissionRates; if (object.rate !== undefined && object.rate !== null) { @@ -521,6 +384,7 @@ export const CommissionRates = { } return message; }, + fromPartial(object: DeepPartial): CommissionRates { const message = { ...baseCommissionRates } as CommissionRates; if (object.rate !== undefined && object.rate !== null) { @@ -540,6 +404,7 @@ export const CommissionRates = { } return message; }, + toJSON(message: CommissionRates): unknown { const obj: any = {}; message.rate !== undefined && (obj.rate = message.rate); @@ -549,6 +414,8 @@ export const CommissionRates = { }, }; +const baseCommission: object = {}; + export const Commission = { encode(message: Commission, writer: Writer = Writer.create()): Writer { if (message.commissionRates !== undefined && message.commissionRates !== undefined) { @@ -559,7 +426,8 @@ export const Commission = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Commission { + + decode(input: Reader | Uint8Array, length?: number): Commission { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCommission } as Commission; @@ -579,6 +447,7 @@ export const Commission = { } return message; }, + fromJSON(object: any): Commission { const message = { ...baseCommission } as Commission; if (object.commissionRates !== undefined && object.commissionRates !== null) { @@ -593,6 +462,7 @@ export const Commission = { } return message; }, + fromPartial(object: DeepPartial): Commission { const message = { ...baseCommission } as Commission; if (object.commissionRates !== undefined && object.commissionRates !== null) { @@ -607,6 +477,7 @@ export const Commission = { } return message; }, + toJSON(message: Commission): unknown { const obj: any = {}; message.commissionRates !== undefined && @@ -619,6 +490,8 @@ export const Commission = { }, }; +const baseDescription: object = { moniker: "", identity: "", website: "", securityContact: "", details: "" }; + export const Description = { encode(message: Description, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.moniker); @@ -628,7 +501,8 @@ export const Description = { writer.uint32(42).string(message.details); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Description { + + decode(input: Reader | Uint8Array, length?: number): Description { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDescription } as Description; @@ -657,6 +531,7 @@ export const Description = { } return message; }, + fromJSON(object: any): Description { const message = { ...baseDescription } as Description; if (object.moniker !== undefined && object.moniker !== null) { @@ -686,6 +561,7 @@ export const Description = { } return message; }, + fromPartial(object: DeepPartial): Description { const message = { ...baseDescription } as Description; if (object.moniker !== undefined && object.moniker !== null) { @@ -715,6 +591,7 @@ export const Description = { } return message; }, + toJSON(message: Description): unknown { const obj: any = {}; message.moniker !== undefined && (obj.moniker = message.moniker); @@ -726,6 +603,16 @@ export const Description = { }, }; +const baseValidator: object = { + operatorAddress: "", + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + unbondingHeight: Long.ZERO, + minSelfDelegation: "", +}; + export const Validator = { encode(message: Validator, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.operatorAddress); @@ -749,7 +636,8 @@ export const Validator = { writer.uint32(90).string(message.minSelfDelegation); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Validator { + + decode(input: Reader | Uint8Array, length?: number): Validator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidator } as Validator; @@ -796,6 +684,7 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { const message = { ...baseValidator } as Validator; if (object.operatorAddress !== undefined && object.operatorAddress !== null) { @@ -855,6 +744,7 @@ export const Validator = { } return message; }, + fromPartial(object: DeepPartial): Validator { const message = { ...baseValidator } as Validator; if (object.operatorAddress !== undefined && object.operatorAddress !== null) { @@ -914,6 +804,7 @@ export const Validator = { } return message; }, + toJSON(message: Validator): unknown { const obj: any = {}; message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); @@ -936,6 +827,8 @@ export const Validator = { }, }; +const baseValAddresses: object = { addresses: "" }; + export const ValAddresses = { encode(message: ValAddresses, writer: Writer = Writer.create()): Writer { for (const v of message.addresses) { @@ -943,7 +836,8 @@ export const ValAddresses = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ValAddresses { + + decode(input: Reader | Uint8Array, length?: number): ValAddresses { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValAddresses } as ValAddresses; @@ -961,6 +855,7 @@ export const ValAddresses = { } return message; }, + fromJSON(object: any): ValAddresses { const message = { ...baseValAddresses } as ValAddresses; message.addresses = []; @@ -971,6 +866,7 @@ export const ValAddresses = { } return message; }, + fromPartial(object: DeepPartial): ValAddresses { const message = { ...baseValAddresses } as ValAddresses; message.addresses = []; @@ -981,6 +877,7 @@ export const ValAddresses = { } return message; }, + toJSON(message: ValAddresses): unknown { const obj: any = {}; if (message.addresses) { @@ -992,13 +889,16 @@ export const ValAddresses = { }, }; +const baseDVPair: object = { delegatorAddress: "", validatorAddress: "" }; + export const DVPair = { encode(message: DVPair, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); writer.uint32(18).string(message.validatorAddress); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DVPair { + + decode(input: Reader | Uint8Array, length?: number): DVPair { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDVPair } as DVPair; @@ -1018,6 +918,7 @@ export const DVPair = { } return message; }, + fromJSON(object: any): DVPair { const message = { ...baseDVPair } as DVPair; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1032,6 +933,7 @@ export const DVPair = { } return message; }, + fromPartial(object: DeepPartial): DVPair { const message = { ...baseDVPair } as DVPair; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1046,6 +948,7 @@ export const DVPair = { } return message; }, + toJSON(message: DVPair): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -1054,6 +957,8 @@ export const DVPair = { }, }; +const baseDVPairs: object = {}; + export const DVPairs = { encode(message: DVPairs, writer: Writer = Writer.create()): Writer { for (const v of message.pairs) { @@ -1061,7 +966,8 @@ export const DVPairs = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DVPairs { + + decode(input: Reader | Uint8Array, length?: number): DVPairs { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDVPairs } as DVPairs; @@ -1079,6 +985,7 @@ export const DVPairs = { } return message; }, + fromJSON(object: any): DVPairs { const message = { ...baseDVPairs } as DVPairs; message.pairs = []; @@ -1089,6 +996,7 @@ export const DVPairs = { } return message; }, + fromPartial(object: DeepPartial): DVPairs { const message = { ...baseDVPairs } as DVPairs; message.pairs = []; @@ -1099,6 +1007,7 @@ export const DVPairs = { } return message; }, + toJSON(message: DVPairs): unknown { const obj: any = {}; if (message.pairs) { @@ -1110,6 +1019,8 @@ export const DVPairs = { }, }; +const baseDVVTriplet: object = { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; + export const DVVTriplet = { encode(message: DVVTriplet, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -1117,7 +1028,8 @@ export const DVVTriplet = { writer.uint32(26).string(message.validatorDstAddress); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DVVTriplet { + + decode(input: Reader | Uint8Array, length?: number): DVVTriplet { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDVVTriplet } as DVVTriplet; @@ -1140,6 +1052,7 @@ export const DVVTriplet = { } return message; }, + fromJSON(object: any): DVVTriplet { const message = { ...baseDVVTriplet } as DVVTriplet; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1159,6 +1072,7 @@ export const DVVTriplet = { } return message; }, + fromPartial(object: DeepPartial): DVVTriplet { const message = { ...baseDVVTriplet } as DVVTriplet; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1178,6 +1092,7 @@ export const DVVTriplet = { } return message; }, + toJSON(message: DVVTriplet): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -1187,6 +1102,8 @@ export const DVVTriplet = { }, }; +const baseDVVTriplets: object = {}; + export const DVVTriplets = { encode(message: DVVTriplets, writer: Writer = Writer.create()): Writer { for (const v of message.triplets) { @@ -1194,7 +1111,8 @@ export const DVVTriplets = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DVVTriplets { + + decode(input: Reader | Uint8Array, length?: number): DVVTriplets { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDVVTriplets } as DVVTriplets; @@ -1212,6 +1130,7 @@ export const DVVTriplets = { } return message; }, + fromJSON(object: any): DVVTriplets { const message = { ...baseDVVTriplets } as DVVTriplets; message.triplets = []; @@ -1222,6 +1141,7 @@ export const DVVTriplets = { } return message; }, + fromPartial(object: DeepPartial): DVVTriplets { const message = { ...baseDVVTriplets } as DVVTriplets; message.triplets = []; @@ -1232,6 +1152,7 @@ export const DVVTriplets = { } return message; }, + toJSON(message: DVVTriplets): unknown { const obj: any = {}; if (message.triplets) { @@ -1243,6 +1164,8 @@ export const DVVTriplets = { }, }; +const baseDelegation: object = { delegatorAddress: "", validatorAddress: "", shares: "" }; + export const Delegation = { encode(message: Delegation, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -1250,7 +1173,8 @@ export const Delegation = { writer.uint32(26).string(message.shares); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Delegation { + + decode(input: Reader | Uint8Array, length?: number): Delegation { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDelegation } as Delegation; @@ -1273,6 +1197,7 @@ export const Delegation = { } return message; }, + fromJSON(object: any): Delegation { const message = { ...baseDelegation } as Delegation; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1292,6 +1217,7 @@ export const Delegation = { } return message; }, + fromPartial(object: DeepPartial): Delegation { const message = { ...baseDelegation } as Delegation; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -1311,6 +1237,7 @@ export const Delegation = { } return message; }, + toJSON(message: Delegation): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -1320,6 +1247,8 @@ export const Delegation = { }, }; +const baseUnbondingDelegation: object = { delegatorAddress: "", validatorAddress: "" }; + export const UnbondingDelegation = { encode(message: UnbondingDelegation, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -1329,7 +1258,8 @@ export const UnbondingDelegation = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): UnbondingDelegation { + + decode(input: Reader | Uint8Array, length?: number): UnbondingDelegation { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUnbondingDelegation } as UnbondingDelegation; @@ -1353,6 +1283,7 @@ export const UnbondingDelegation = { } return message; }, + fromJSON(object: any): UnbondingDelegation { const message = { ...baseUnbondingDelegation } as UnbondingDelegation; message.entries = []; @@ -1373,6 +1304,7 @@ export const UnbondingDelegation = { } return message; }, + fromPartial(object: DeepPartial): UnbondingDelegation { const message = { ...baseUnbondingDelegation } as UnbondingDelegation; message.entries = []; @@ -1393,6 +1325,7 @@ export const UnbondingDelegation = { } return message; }, + toJSON(message: UnbondingDelegation): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -1406,6 +1339,8 @@ export const UnbondingDelegation = { }, }; +const baseUnbondingDelegationEntry: object = { creationHeight: Long.ZERO, initialBalance: "", balance: "" }; + export const UnbondingDelegationEntry = { encode(message: UnbondingDelegationEntry, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.creationHeight); @@ -1416,7 +1351,8 @@ export const UnbondingDelegationEntry = { writer.uint32(34).string(message.balance); return writer; }, - decode(input: Uint8Array | Reader, length?: number): UnbondingDelegationEntry { + + decode(input: Reader | Uint8Array, length?: number): UnbondingDelegationEntry { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; @@ -1442,6 +1378,7 @@ export const UnbondingDelegationEntry = { } return message; }, + fromJSON(object: any): UnbondingDelegationEntry { const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; if (object.creationHeight !== undefined && object.creationHeight !== null) { @@ -1466,6 +1403,7 @@ export const UnbondingDelegationEntry = { } return message; }, + fromPartial(object: DeepPartial): UnbondingDelegationEntry { const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; if (object.creationHeight !== undefined && object.creationHeight !== null) { @@ -1490,6 +1428,7 @@ export const UnbondingDelegationEntry = { } return message; }, + toJSON(message: UnbondingDelegationEntry): unknown { const obj: any = {}; message.creationHeight !== undefined && @@ -1503,6 +1442,8 @@ export const UnbondingDelegationEntry = { }, }; +const baseRedelegationEntry: object = { creationHeight: Long.ZERO, initialBalance: "", sharesDst: "" }; + export const RedelegationEntry = { encode(message: RedelegationEntry, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.creationHeight); @@ -1513,7 +1454,8 @@ export const RedelegationEntry = { writer.uint32(34).string(message.sharesDst); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RedelegationEntry { + + decode(input: Reader | Uint8Array, length?: number): RedelegationEntry { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRedelegationEntry } as RedelegationEntry; @@ -1539,6 +1481,7 @@ export const RedelegationEntry = { } return message; }, + fromJSON(object: any): RedelegationEntry { const message = { ...baseRedelegationEntry } as RedelegationEntry; if (object.creationHeight !== undefined && object.creationHeight !== null) { @@ -1563,6 +1506,7 @@ export const RedelegationEntry = { } return message; }, + fromPartial(object: DeepPartial): RedelegationEntry { const message = { ...baseRedelegationEntry } as RedelegationEntry; if (object.creationHeight !== undefined && object.creationHeight !== null) { @@ -1587,6 +1531,7 @@ export const RedelegationEntry = { } return message; }, + toJSON(message: RedelegationEntry): unknown { const obj: any = {}; message.creationHeight !== undefined && @@ -1600,6 +1545,8 @@ export const RedelegationEntry = { }, }; +const baseRedelegation: object = { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; + export const Redelegation = { encode(message: Redelegation, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -1610,7 +1557,8 @@ export const Redelegation = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Redelegation { + + decode(input: Reader | Uint8Array, length?: number): Redelegation { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRedelegation } as Redelegation; @@ -1637,6 +1585,7 @@ export const Redelegation = { } return message; }, + fromJSON(object: any): Redelegation { const message = { ...baseRedelegation } as Redelegation; message.entries = []; @@ -1662,6 +1611,7 @@ export const Redelegation = { } return message; }, + fromPartial(object: DeepPartial): Redelegation { const message = { ...baseRedelegation } as Redelegation; message.entries = []; @@ -1687,6 +1637,7 @@ export const Redelegation = { } return message; }, + toJSON(message: Redelegation): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -1701,6 +1652,8 @@ export const Redelegation = { }, }; +const baseParams: object = { maxValidators: 0, maxEntries: 0, historicalEntries: 0, bondDenom: "" }; + export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { if (message.unbondingTime !== undefined && message.unbondingTime !== undefined) { @@ -1712,7 +1665,8 @@ export const Params = { writer.uint32(42).string(message.bondDenom); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Params { + + decode(input: Reader | Uint8Array, length?: number): Params { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseParams } as Params; @@ -1741,6 +1695,7 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { const message = { ...baseParams } as Params; if (object.unbondingTime !== undefined && object.unbondingTime !== null) { @@ -1770,6 +1725,7 @@ export const Params = { } return message; }, + fromPartial(object: DeepPartial): Params { const message = { ...baseParams } as Params; if (object.unbondingTime !== undefined && object.unbondingTime !== null) { @@ -1799,6 +1755,7 @@ export const Params = { } return message; }, + toJSON(message: Params): unknown { const obj: any = {}; message.unbondingTime !== undefined && @@ -1811,6 +1768,8 @@ export const Params = { }, }; +const baseDelegationResponse: object = {}; + export const DelegationResponse = { encode(message: DelegationResponse, writer: Writer = Writer.create()): Writer { if (message.delegation !== undefined && message.delegation !== undefined) { @@ -1821,7 +1780,8 @@ export const DelegationResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DelegationResponse { + + decode(input: Reader | Uint8Array, length?: number): DelegationResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDelegationResponse } as DelegationResponse; @@ -1841,6 +1801,7 @@ export const DelegationResponse = { } return message; }, + fromJSON(object: any): DelegationResponse { const message = { ...baseDelegationResponse } as DelegationResponse; if (object.delegation !== undefined && object.delegation !== null) { @@ -1855,6 +1816,7 @@ export const DelegationResponse = { } return message; }, + fromPartial(object: DeepPartial): DelegationResponse { const message = { ...baseDelegationResponse } as DelegationResponse; if (object.delegation !== undefined && object.delegation !== null) { @@ -1869,6 +1831,7 @@ export const DelegationResponse = { } return message; }, + toJSON(message: DelegationResponse): unknown { const obj: any = {}; message.delegation !== undefined && @@ -1879,6 +1842,8 @@ export const DelegationResponse = { }, }; +const baseRedelegationEntryResponse: object = { balance: "" }; + export const RedelegationEntryResponse = { encode(message: RedelegationEntryResponse, writer: Writer = Writer.create()): Writer { if (message.redelegationEntry !== undefined && message.redelegationEntry !== undefined) { @@ -1887,7 +1852,8 @@ export const RedelegationEntryResponse = { writer.uint32(34).string(message.balance); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RedelegationEntryResponse { + + decode(input: Reader | Uint8Array, length?: number): RedelegationEntryResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; @@ -1907,6 +1873,7 @@ export const RedelegationEntryResponse = { } return message; }, + fromJSON(object: any): RedelegationEntryResponse { const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { @@ -1921,6 +1888,7 @@ export const RedelegationEntryResponse = { } return message; }, + fromPartial(object: DeepPartial): RedelegationEntryResponse { const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { @@ -1935,6 +1903,7 @@ export const RedelegationEntryResponse = { } return message; }, + toJSON(message: RedelegationEntryResponse): unknown { const obj: any = {}; message.redelegationEntry !== undefined && @@ -1946,6 +1915,8 @@ export const RedelegationEntryResponse = { }, }; +const baseRedelegationResponse: object = {}; + export const RedelegationResponse = { encode(message: RedelegationResponse, writer: Writer = Writer.create()): Writer { if (message.redelegation !== undefined && message.redelegation !== undefined) { @@ -1956,7 +1927,8 @@ export const RedelegationResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): RedelegationResponse { + + decode(input: Reader | Uint8Array, length?: number): RedelegationResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRedelegationResponse } as RedelegationResponse; @@ -1977,6 +1949,7 @@ export const RedelegationResponse = { } return message; }, + fromJSON(object: any): RedelegationResponse { const message = { ...baseRedelegationResponse } as RedelegationResponse; message.entries = []; @@ -1992,6 +1965,7 @@ export const RedelegationResponse = { } return message; }, + fromPartial(object: DeepPartial): RedelegationResponse { const message = { ...baseRedelegationResponse } as RedelegationResponse; message.entries = []; @@ -2007,6 +1981,7 @@ export const RedelegationResponse = { } return message; }, + toJSON(message: RedelegationResponse): unknown { const obj: any = {}; message.redelegation !== undefined && @@ -2020,13 +1995,16 @@ export const RedelegationResponse = { }, }; +const basePool: object = { notBondedTokens: "", bondedTokens: "" }; + export const Pool = { encode(message: Pool, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.notBondedTokens); writer.uint32(18).string(message.bondedTokens); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Pool { + + decode(input: Reader | Uint8Array, length?: number): Pool { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePool } as Pool; @@ -2046,6 +2024,7 @@ export const Pool = { } return message; }, + fromJSON(object: any): Pool { const message = { ...basePool } as Pool; if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { @@ -2060,6 +2039,7 @@ export const Pool = { } return message; }, + fromPartial(object: DeepPartial): Pool { const message = { ...basePool } as Pool; if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { @@ -2074,6 +2054,7 @@ export const Pool = { } return message; }, + toJSON(message: Pool): unknown { const obj: any = {}; message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens); @@ -2082,12 +2063,7 @@ export const Pool = { }, }; -if (util.Long !== (Long as any)) { - util.Long = Long as any; - configure(); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array @@ -2097,3 +2073,34 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts index bf05ef5b..ce484609 100644 --- a/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts +++ b/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts @@ -2,13 +2,13 @@ import { Description, CommissionRates } from "../../../cosmos/staking/v1beta1/staking"; import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Reader, Writer, util, configure } from "protobufjs/minimal"; +import { Reader, util, configure, Writer } from "protobufjs/minimal"; import { Timestamp } from "../../../google/protobuf/timestamp"; import * as Long from "long"; -/** - * MsgCreateValidator defines a SDK message for creating a new validator. - */ +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description?: Description; commission?: CommissionRates; @@ -19,35 +19,29 @@ export interface MsgCreateValidator { value?: Coin; } -/** - * MsgCreateValidatorResponse defines the Msg/CreateValidator response type. - */ +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ export interface MsgCreateValidatorResponse {} -/** - * MsgEditValidator defines a SDK message for editing an existing validator. - */ +/** 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 + * 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; } -/** - * MsgEditValidatorResponse defines the Msg/EditValidator response type. - */ +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ export interface MsgEditValidatorResponse {} /** - * MsgDelegate defines a SDK message for performing a delegation of coins - * from a delegator to a validator. + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. */ export interface MsgDelegate { delegatorAddress: string; @@ -55,14 +49,12 @@ export interface MsgDelegate { amount?: Coin; } -/** - * MsgDelegateResponse defines the Msg/Delegate response type. - */ +/** MsgDelegateResponse defines the Msg/Delegate response type. */ export interface MsgDelegateResponse {} /** - * MsgBeginRedelegate defines a SDK message for performing a redelegation - * of coins from a delegator and source validator to a destination validator. + * 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; @@ -71,16 +63,14 @@ export interface MsgBeginRedelegate { amount?: Coin; } -/** - * MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. - */ +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponse { completionTime?: Date; } /** - * MsgUndelegate defines a SDK message for performing an undelegation from a - * delegate and a validator. + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. */ export interface MsgUndelegate { delegatorAddress: string; @@ -88,153 +78,12 @@ export interface MsgUndelegate { amount?: Coin; } -/** - * MsgUndelegateResponse defines the Msg/Undelegate response type. - */ +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponse { completionTime?: Date; } -const baseMsgCreateValidator: object = { - minSelfDelegation: "", - delegatorAddress: "", - validatorAddress: "", -}; - -const baseMsgCreateValidatorResponse: object = {}; - -const baseMsgEditValidator: object = { - validatorAddress: "", - commissionRate: "", - minSelfDelegation: "", -}; - -const baseMsgEditValidatorResponse: object = {}; - -const baseMsgDelegate: object = { - delegatorAddress: "", - validatorAddress: "", -}; - -const baseMsgDelegateResponse: object = {}; - -const baseMsgBeginRedelegate: object = { - delegatorAddress: "", - validatorSrcAddress: "", - validatorDstAddress: "", -}; - -const baseMsgBeginRedelegateResponse: object = {}; - -const baseMsgUndelegate: object = { - delegatorAddress: "", - validatorAddress: "", -}; - -const baseMsgUndelegateResponse: object = {}; - -/** - * Msg defines the staking Msg service. - */ -export interface Msg { - /** - * CreateValidator defines a method for creating a new validator. - */ - CreateValidator(request: MsgCreateValidator): Promise; - - /** - * EditValidator defines a method for editing an existing validator. - */ - EditValidator(request: MsgEditValidator): Promise; - - /** - * Delegate defines a method for performing a delegation of coins - * from a delegator to a validator. - */ - Delegate(request: MsgDelegate): Promise; - - /** - * BeginRedelegate defines a method for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ - BeginRedelegate(request: MsgBeginRedelegate): Promise; - - /** - * Undelegate defines a method for performing an undelegation from a - * delegate and a validator. - */ - Undelegate(request: MsgUndelegate): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - CreateValidator(request: MsgCreateValidator): Promise { - const data = MsgCreateValidator.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); - return promise.then((data) => MsgCreateValidatorResponse.decode(new Reader(data))); - } - - EditValidator(request: MsgEditValidator): Promise { - const data = MsgEditValidator.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); - return promise.then((data) => MsgEditValidatorResponse.decode(new Reader(data))); - } - - Delegate(request: MsgDelegate): Promise { - const data = MsgDelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); - return promise.then((data) => MsgDelegateResponse.decode(new Reader(data))); - } - - BeginRedelegate(request: MsgBeginRedelegate): Promise { - const data = MsgBeginRedelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); - return promise.then((data) => MsgBeginRedelegateResponse.decode(new Reader(data))); - } - - Undelegate(request: MsgUndelegate): Promise { - const data = MsgUndelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); - return promise.then((data) => MsgUndelegateResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function numberToLong(number: number) { - return Long.fromNumber(number); -} - -export const protobufPackage = "cosmos.staking.v1beta1"; +const baseMsgCreateValidator: object = { minSelfDelegation: "", delegatorAddress: "", validatorAddress: "" }; export const MsgCreateValidator = { encode(message: MsgCreateValidator, writer: Writer = Writer.create()): Writer { @@ -255,7 +104,8 @@ export const MsgCreateValidator = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgCreateValidator { + + decode(input: Reader | Uint8Array, length?: number): MsgCreateValidator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgCreateValidator } as MsgCreateValidator; @@ -290,6 +140,7 @@ export const MsgCreateValidator = { } return message; }, + fromJSON(object: any): MsgCreateValidator { const message = { ...baseMsgCreateValidator } as MsgCreateValidator; if (object.description !== undefined && object.description !== null) { @@ -329,6 +180,7 @@ export const MsgCreateValidator = { } return message; }, + fromPartial(object: DeepPartial): MsgCreateValidator { const message = { ...baseMsgCreateValidator } as MsgCreateValidator; if (object.description !== undefined && object.description !== null) { @@ -368,6 +220,7 @@ export const MsgCreateValidator = { } return message; }, + toJSON(message: MsgCreateValidator): unknown { const obj: any = {}; message.description !== undefined && @@ -383,11 +236,14 @@ export const MsgCreateValidator = { }, }; +const baseMsgCreateValidatorResponse: object = {}; + export const MsgCreateValidatorResponse = { encode(_: MsgCreateValidatorResponse, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgCreateValidatorResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; @@ -401,20 +257,25 @@ export const MsgCreateValidatorResponse = { } return message; }, + fromJSON(_: any): MsgCreateValidatorResponse { const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; return message; }, + fromPartial(_: DeepPartial): MsgCreateValidatorResponse { const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; return message; }, + toJSON(_: MsgCreateValidatorResponse): unknown { const obj: any = {}; return obj; }, }; +const baseMsgEditValidator: object = { validatorAddress: "", commissionRate: "", minSelfDelegation: "" }; + export const MsgEditValidator = { encode(message: MsgEditValidator, writer: Writer = Writer.create()): Writer { if (message.description !== undefined && message.description !== undefined) { @@ -425,7 +286,8 @@ export const MsgEditValidator = { writer.uint32(34).string(message.minSelfDelegation); return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgEditValidator { + + decode(input: Reader | Uint8Array, length?: number): MsgEditValidator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgEditValidator } as MsgEditValidator; @@ -451,6 +313,7 @@ export const MsgEditValidator = { } return message; }, + fromJSON(object: any): MsgEditValidator { const message = { ...baseMsgEditValidator } as MsgEditValidator; if (object.description !== undefined && object.description !== null) { @@ -475,6 +338,7 @@ export const MsgEditValidator = { } return message; }, + fromPartial(object: DeepPartial): MsgEditValidator { const message = { ...baseMsgEditValidator } as MsgEditValidator; if (object.description !== undefined && object.description !== null) { @@ -499,6 +363,7 @@ export const MsgEditValidator = { } return message; }, + toJSON(message: MsgEditValidator): unknown { const obj: any = {}; message.description !== undefined && @@ -510,11 +375,14 @@ export const MsgEditValidator = { }, }; +const baseMsgEditValidatorResponse: object = {}; + export const MsgEditValidatorResponse = { encode(_: MsgEditValidatorResponse, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgEditValidatorResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgEditValidatorResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; @@ -528,20 +396,25 @@ export const MsgEditValidatorResponse = { } return message; }, + fromJSON(_: any): MsgEditValidatorResponse { const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; return message; }, + fromPartial(_: DeepPartial): MsgEditValidatorResponse { const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; return message; }, + toJSON(_: MsgEditValidatorResponse): unknown { const obj: any = {}; return obj; }, }; +const baseMsgDelegate: object = { delegatorAddress: "", validatorAddress: "" }; + export const MsgDelegate = { encode(message: MsgDelegate, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -551,7 +424,8 @@ export const MsgDelegate = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgDelegate { + + decode(input: Reader | Uint8Array, length?: number): MsgDelegate { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgDelegate } as MsgDelegate; @@ -574,6 +448,7 @@ export const MsgDelegate = { } return message; }, + fromJSON(object: any): MsgDelegate { const message = { ...baseMsgDelegate } as MsgDelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -593,6 +468,7 @@ export const MsgDelegate = { } return message; }, + fromPartial(object: DeepPartial): MsgDelegate { const message = { ...baseMsgDelegate } as MsgDelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -612,6 +488,7 @@ export const MsgDelegate = { } return message; }, + toJSON(message: MsgDelegate): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -621,11 +498,14 @@ export const MsgDelegate = { }, }; +const baseMsgDelegateResponse: object = {}; + export const MsgDelegateResponse = { encode(_: MsgDelegateResponse, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgDelegateResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgDelegateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; @@ -639,20 +519,29 @@ export const MsgDelegateResponse = { } return message; }, + fromJSON(_: any): MsgDelegateResponse { const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; return message; }, + fromPartial(_: DeepPartial): MsgDelegateResponse { const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; return message; }, + toJSON(_: MsgDelegateResponse): unknown { const obj: any = {}; return obj; }, }; +const baseMsgBeginRedelegate: object = { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", +}; + export const MsgBeginRedelegate = { encode(message: MsgBeginRedelegate, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -663,7 +552,8 @@ export const MsgBeginRedelegate = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgBeginRedelegate { + + decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegate { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; @@ -689,6 +579,7 @@ export const MsgBeginRedelegate = { } return message; }, + fromJSON(object: any): MsgBeginRedelegate { const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -713,6 +604,7 @@ export const MsgBeginRedelegate = { } return message; }, + fromPartial(object: DeepPartial): MsgBeginRedelegate { const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -737,6 +629,7 @@ export const MsgBeginRedelegate = { } return message; }, + toJSON(message: MsgBeginRedelegate): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -747,6 +640,8 @@ export const MsgBeginRedelegate = { }, }; +const baseMsgBeginRedelegateResponse: object = {}; + export const MsgBeginRedelegateResponse = { encode(message: MsgBeginRedelegateResponse, writer: Writer = Writer.create()): Writer { if (message.completionTime !== undefined && message.completionTime !== undefined) { @@ -754,7 +649,8 @@ export const MsgBeginRedelegateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgBeginRedelegateResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; @@ -771,6 +667,7 @@ export const MsgBeginRedelegateResponse = { } return message; }, + fromJSON(object: any): MsgBeginRedelegateResponse { const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; if (object.completionTime !== undefined && object.completionTime !== null) { @@ -780,6 +677,7 @@ export const MsgBeginRedelegateResponse = { } return message; }, + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse { const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; if (object.completionTime !== undefined && object.completionTime !== null) { @@ -789,6 +687,7 @@ export const MsgBeginRedelegateResponse = { } return message; }, + toJSON(message: MsgBeginRedelegateResponse): unknown { const obj: any = {}; message.completionTime !== undefined && @@ -798,6 +697,8 @@ export const MsgBeginRedelegateResponse = { }, }; +const baseMsgUndelegate: object = { delegatorAddress: "", validatorAddress: "" }; + export const MsgUndelegate = { encode(message: MsgUndelegate, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.delegatorAddress); @@ -807,7 +708,8 @@ export const MsgUndelegate = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgUndelegate { + + decode(input: Reader | Uint8Array, length?: number): MsgUndelegate { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgUndelegate } as MsgUndelegate; @@ -830,6 +732,7 @@ export const MsgUndelegate = { } return message; }, + fromJSON(object: any): MsgUndelegate { const message = { ...baseMsgUndelegate } as MsgUndelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -849,6 +752,7 @@ export const MsgUndelegate = { } return message; }, + fromPartial(object: DeepPartial): MsgUndelegate { const message = { ...baseMsgUndelegate } as MsgUndelegate; if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { @@ -868,6 +772,7 @@ export const MsgUndelegate = { } return message; }, + toJSON(message: MsgUndelegate): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); @@ -877,6 +782,8 @@ export const MsgUndelegate = { }, }; +const baseMsgUndelegateResponse: object = {}; + export const MsgUndelegateResponse = { encode(message: MsgUndelegateResponse, writer: Writer = Writer.create()): Writer { if (message.completionTime !== undefined && message.completionTime !== undefined) { @@ -884,7 +791,8 @@ export const MsgUndelegateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MsgUndelegateResponse { + + decode(input: Reader | Uint8Array, length?: number): MsgUndelegateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; @@ -901,6 +809,7 @@ export const MsgUndelegateResponse = { } return message; }, + fromJSON(object: any): MsgUndelegateResponse { const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; if (object.completionTime !== undefined && object.completionTime !== null) { @@ -910,6 +819,7 @@ export const MsgUndelegateResponse = { } return message; }, + fromPartial(object: DeepPartial): MsgUndelegateResponse { const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; if (object.completionTime !== undefined && object.completionTime !== null) { @@ -919,6 +829,7 @@ export const MsgUndelegateResponse = { } return message; }, + toJSON(message: MsgUndelegateResponse): unknown { const obj: any = {}; message.completionTime !== undefined && @@ -928,12 +839,70 @@ export const MsgUndelegateResponse = { }, }; -if (util.Long !== (Long as any)) { - util.Long = Long as any; - configure(); +/** Msg defines the staking Msg service. */ +export interface Msg { + /** CreateValidator defines a method for creating a new validator. */ + CreateValidator(request: MsgCreateValidator): Promise; + /** EditValidator defines a method for editing an existing validator. */ + EditValidator(request: MsgEditValidator): Promise; + /** + * Delegate defines a method for performing a delegation of coins + * from a delegator to a validator. + */ + Delegate(request: MsgDelegate): Promise; + /** + * BeginRedelegate defines a method for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ + BeginRedelegate(request: MsgBeginRedelegate): Promise; + /** + * Undelegate defines a method for performing an undelegation from a + * delegate and a validator. + */ + Undelegate(request: MsgUndelegate): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + CreateValidator(request: MsgCreateValidator): Promise { + const data = MsgCreateValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgCreateValidatorResponse.decode(new Reader(data))); + } + + EditValidator(request: MsgEditValidator): Promise { + const data = MsgEditValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgEditValidatorResponse.decode(new Reader(data))); + } + + Delegate(request: MsgDelegate): Promise { + const data = MsgDelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgDelegateResponse.decode(new Reader(data))); + } + + BeginRedelegate(request: MsgBeginRedelegate): Promise { + const data = MsgBeginRedelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgBeginRedelegateResponse.decode(new Reader(data))); + } + + Undelegate(request: MsgUndelegate): Promise { + const data = MsgUndelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data); + return promise.then((data) => MsgUndelegateResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array @@ -943,3 +912,34 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts b/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts index c1c3552c..ae42feb6 100644 --- a/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts @@ -4,112 +4,29 @@ import * as Long from "long"; import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; import { Writer, Reader } from "protobufjs/minimal"; -/** - * SignatureDescriptors wraps multiple SignatureDescriptor's. - */ -export interface SignatureDescriptors { - /** - * signatures are the signature descriptors - */ - signatures: SignatureDescriptor[]; -} - -/** - * 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; -} - -/** - * Data represents signature data - */ -export interface SignatureDescriptor_Data { - /** - * single represents a single signer - */ - single?: SignatureDescriptor_Data_Single | undefined; - /** - * multi represents a multisig signer - */ - multi?: SignatureDescriptor_Data_Multi | undefined; -} - -/** - * 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; -} - -/** - * 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[]; -} - -const baseSignatureDescriptors: object = {}; - -const baseSignatureDescriptor: object = { - sequence: Long.UZERO, -}; - -const baseSignatureDescriptor_Data: object = {}; - -const baseSignatureDescriptor_Data_Single: object = { - mode: 0, -}; - -const baseSignatureDescriptor_Data_Multi: object = {}; - export const protobufPackage = "cosmos.tx.signing.v1beta1"; -/** SignMode represents a signing mode with its own security guarantees. - */ +/** SignMode represents a signing mode with its own security guarantees. */ export enum SignMode { - /** SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected + /** + * 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 - 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 + /** + * 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 */ SIGN_MODE_TEXTUAL = 2, - /** 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 - 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, @@ -151,6 +68,56 @@ export function signModeToJSON(object: SignMode): string { } } +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} + +/** + * 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; +} + +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single | undefined; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi | undefined; +} + +/** 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; +} + +/** 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[]; +} + +const baseSignatureDescriptors: object = {}; + export const SignatureDescriptors = { encode(message: SignatureDescriptors, writer: Writer = Writer.create()): Writer { for (const v of message.signatures) { @@ -158,7 +125,8 @@ export const SignatureDescriptors = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignatureDescriptors { + + decode(input: Reader | Uint8Array, length?: number): SignatureDescriptors { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignatureDescriptors } as SignatureDescriptors; @@ -176,6 +144,7 @@ export const SignatureDescriptors = { } return message; }, + fromJSON(object: any): SignatureDescriptors { const message = { ...baseSignatureDescriptors } as SignatureDescriptors; message.signatures = []; @@ -186,6 +155,7 @@ export const SignatureDescriptors = { } return message; }, + fromPartial(object: DeepPartial): SignatureDescriptors { const message = { ...baseSignatureDescriptors } as SignatureDescriptors; message.signatures = []; @@ -196,6 +166,7 @@ export const SignatureDescriptors = { } return message; }, + toJSON(message: SignatureDescriptors): unknown { const obj: any = {}; if (message.signatures) { @@ -207,6 +178,8 @@ export const SignatureDescriptors = { }, }; +const baseSignatureDescriptor: object = { sequence: Long.UZERO }; + export const SignatureDescriptor = { encode(message: SignatureDescriptor, writer: Writer = Writer.create()): Writer { if (message.publicKey !== undefined && message.publicKey !== undefined) { @@ -218,7 +191,8 @@ export const SignatureDescriptor = { writer.uint32(24).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor { + + decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignatureDescriptor } as SignatureDescriptor; @@ -241,6 +215,7 @@ export const SignatureDescriptor = { } return message; }, + fromJSON(object: any): SignatureDescriptor { const message = { ...baseSignatureDescriptor } as SignatureDescriptor; if (object.publicKey !== undefined && object.publicKey !== null) { @@ -260,6 +235,7 @@ export const SignatureDescriptor = { } return message; }, + fromPartial(object: DeepPartial): SignatureDescriptor { const message = { ...baseSignatureDescriptor } as SignatureDescriptor; if (object.publicKey !== undefined && object.publicKey !== null) { @@ -279,6 +255,7 @@ export const SignatureDescriptor = { } return message; }, + toJSON(message: SignatureDescriptor): unknown { const obj: any = {}; message.publicKey !== undefined && @@ -290,6 +267,8 @@ export const SignatureDescriptor = { }, }; +const baseSignatureDescriptor_Data: object = {}; + export const SignatureDescriptor_Data = { encode(message: SignatureDescriptor_Data, writer: Writer = Writer.create()): Writer { if (message.single !== undefined) { @@ -300,7 +279,8 @@ export const SignatureDescriptor_Data = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data { + + decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; @@ -320,6 +300,7 @@ export const SignatureDescriptor_Data = { } return message; }, + fromJSON(object: any): SignatureDescriptor_Data { const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; if (object.single !== undefined && object.single !== null) { @@ -334,6 +315,7 @@ export const SignatureDescriptor_Data = { } return message; }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data { const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; if (object.single !== undefined && object.single !== null) { @@ -348,6 +330,7 @@ export const SignatureDescriptor_Data = { } return message; }, + toJSON(message: SignatureDescriptor_Data): unknown { const obj: any = {}; message.single !== undefined && @@ -358,13 +341,16 @@ export const SignatureDescriptor_Data = { }, }; +const baseSignatureDescriptor_Data_Single: object = { mode: 0 }; + export const SignatureDescriptor_Data_Single = { encode(message: SignatureDescriptor_Data_Single, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.mode); writer.uint32(18).bytes(message.signature); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Single { + + decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; @@ -384,6 +370,7 @@ export const SignatureDescriptor_Data_Single = { } return message; }, + fromJSON(object: any): SignatureDescriptor_Data_Single { const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; if (object.mode !== undefined && object.mode !== null) { @@ -396,6 +383,7 @@ export const SignatureDescriptor_Data_Single = { } return message; }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; if (object.mode !== undefined && object.mode !== null) { @@ -410,6 +398,7 @@ export const SignatureDescriptor_Data_Single = { } return message; }, + toJSON(message: SignatureDescriptor_Data_Single): unknown { const obj: any = {}; message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); @@ -421,6 +410,8 @@ export const SignatureDescriptor_Data_Single = { }, }; +const baseSignatureDescriptor_Data_Multi: object = {}; + export const SignatureDescriptor_Data_Multi = { encode(message: SignatureDescriptor_Data_Multi, writer: Writer = Writer.create()): Writer { if (message.bitarray !== undefined && message.bitarray !== undefined) { @@ -431,7 +422,8 @@ export const SignatureDescriptor_Data_Multi = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Multi { + + decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; @@ -452,6 +444,7 @@ export const SignatureDescriptor_Data_Multi = { } return message; }, + fromJSON(object: any): SignatureDescriptor_Data_Multi { const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; message.signatures = []; @@ -467,6 +460,7 @@ export const SignatureDescriptor_Data_Multi = { } return message; }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; message.signatures = []; @@ -482,6 +476,7 @@ export const SignatureDescriptor_Data_Multi = { } return message; }, + toJSON(message: SignatureDescriptor_Data_Multi): unknown { const obj: any = {}; message.bitarray !== undefined && @@ -495,15 +490,18 @@ export const SignatureDescriptor_Data_Multi = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -513,6 +511,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -520,7 +520,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts index cd82e4d3..7ac915b2 100644 --- a/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts +++ b/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts @@ -6,267 +6,209 @@ import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisi import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Writer, Reader } from "protobufjs/minimal"; -/** - * Tx is the standard type used for broadcasting transactions. - */ +export const protobufPackage = "cosmos.tx.v1beta1"; + +/** Tx is the standard type used for broadcasting transactions. */ export interface Tx { - /** - * body is the processable content of the transaction - */ + /** 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 + * 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 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[]; } /** - * 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. + * 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. + * 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. + * 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 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[]; } -/** - * SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. - */ +/** 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. + * 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. + * 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 + * 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 - */ + /** account_number is the account number of the account in state */ accountNumber: Long; } -/** - * TxBody is the body of a transaction that all signers sign over. - */ +/** 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 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 memo to be added to the transaction - */ + /** memo is any arbitrary memo to be added to the transaction */ memo: string; /** - * timeout is the block height after which this transaction will not - * be processed by the chain + * 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 + * 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 + * 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[]; } /** - * AuthInfo describes the fee and signer modes that are used to sign a - * transaction. + * 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. + * 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 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; } /** - * SignerInfo describes the public key and signing mode of a single top-level - * signer. + * 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. + * 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 + * 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 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; } -/** - * ModeInfo describes the signing mode of a single or nested multisig signer. - */ +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfo { - /** - * single represents a single signer - */ + /** single represents a single signer */ single?: ModeInfo_Single | undefined; - /** - * multi represents a nested multisig signer - */ + /** multi represents a nested multisig signer */ multi?: ModeInfo_Multi | undefined; } /** - * 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 + * 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 is the signing mode of the single signer */ mode: SignMode; } -/** - * Multi is the mode info for a multisig public key - */ +/** Multi is the mode info for a multisig public key */ export interface ModeInfo_Multi { - /** - * bitarray specifies which keys within the multisig are signing - */ + /** 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 + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys */ modeInfos: ModeInfo[]; } /** - * 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. + * 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 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 + * 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. + * 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 + * 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; } const baseTx: object = {}; -const baseTxRaw: object = {}; - -const baseSignDoc: object = { - chainId: "", - accountNumber: Long.UZERO, -}; - -const baseTxBody: object = { - memo: "", - timeoutHeight: Long.UZERO, -}; - -const baseAuthInfo: object = {}; - -const baseSignerInfo: object = { - sequence: Long.UZERO, -}; - -const baseModeInfo: object = {}; - -const baseModeInfo_Single: object = { - mode: 0, -}; - -const baseModeInfo_Multi: object = {}; - -const baseFee: object = { - gasLimit: Long.UZERO, - payer: "", - granter: "", -}; - -export const protobufPackage = "cosmos.tx.v1beta1"; - export const Tx = { encode(message: Tx, writer: Writer = Writer.create()): Writer { if (message.body !== undefined && message.body !== undefined) { @@ -280,7 +222,8 @@ export const Tx = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Tx { + + decode(input: Reader | Uint8Array, length?: number): Tx { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTx } as Tx; @@ -304,6 +247,7 @@ export const Tx = { } return message; }, + fromJSON(object: any): Tx { const message = { ...baseTx } as Tx; message.signatures = []; @@ -324,6 +268,7 @@ export const Tx = { } return message; }, + fromPartial(object: DeepPartial): Tx { const message = { ...baseTx } as Tx; message.signatures = []; @@ -344,6 +289,7 @@ export const Tx = { } return message; }, + toJSON(message: Tx): unknown { const obj: any = {}; message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); @@ -358,6 +304,8 @@ export const Tx = { }, }; +const baseTxRaw: object = {}; + export const TxRaw = { encode(message: TxRaw, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.bodyBytes); @@ -367,7 +315,8 @@ export const TxRaw = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxRaw { + + decode(input: Reader | Uint8Array, length?: number): TxRaw { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxRaw } as TxRaw; @@ -391,6 +340,7 @@ export const TxRaw = { } return message; }, + fromJSON(object: any): TxRaw { const message = { ...baseTxRaw } as TxRaw; message.signatures = []; @@ -407,6 +357,7 @@ export const TxRaw = { } return message; }, + fromPartial(object: DeepPartial): TxRaw { const message = { ...baseTxRaw } as TxRaw; message.signatures = []; @@ -427,6 +378,7 @@ export const TxRaw = { } return message; }, + toJSON(message: TxRaw): unknown { const obj: any = {}; message.bodyBytes !== undefined && @@ -446,6 +398,8 @@ export const TxRaw = { }, }; +const baseSignDoc: object = { chainId: "", accountNumber: Long.UZERO }; + export const SignDoc = { encode(message: SignDoc, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.bodyBytes); @@ -454,7 +408,8 @@ export const SignDoc = { writer.uint32(32).uint64(message.accountNumber); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignDoc { + + decode(input: Reader | Uint8Array, length?: number): SignDoc { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignDoc } as SignDoc; @@ -480,6 +435,7 @@ export const SignDoc = { } return message; }, + fromJSON(object: any): SignDoc { const message = { ...baseSignDoc } as SignDoc; if (object.bodyBytes !== undefined && object.bodyBytes !== null) { @@ -500,6 +456,7 @@ export const SignDoc = { } return message; }, + fromPartial(object: DeepPartial): SignDoc { const message = { ...baseSignDoc } as SignDoc; if (object.bodyBytes !== undefined && object.bodyBytes !== null) { @@ -524,6 +481,7 @@ export const SignDoc = { } return message; }, + toJSON(message: SignDoc): unknown { const obj: any = {}; message.bodyBytes !== undefined && @@ -541,6 +499,8 @@ export const SignDoc = { }, }; +const baseTxBody: object = { memo: "", timeoutHeight: Long.UZERO }; + export const TxBody = { encode(message: TxBody, writer: Writer = Writer.create()): Writer { for (const v of message.messages) { @@ -556,7 +516,8 @@ export const TxBody = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxBody { + + decode(input: Reader | Uint8Array, length?: number): TxBody { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxBody } as TxBody; @@ -588,6 +549,7 @@ export const TxBody = { } return message; }, + fromJSON(object: any): TxBody { const message = { ...baseTxBody } as TxBody; message.messages = []; @@ -620,6 +582,7 @@ export const TxBody = { } return message; }, + fromPartial(object: DeepPartial): TxBody { const message = { ...baseTxBody } as TxBody; message.messages = []; @@ -652,6 +615,7 @@ export const TxBody = { } return message; }, + toJSON(message: TxBody): unknown { const obj: any = {}; if (message.messages) { @@ -678,6 +642,8 @@ export const TxBody = { }, }; +const baseAuthInfo: object = {}; + export const AuthInfo = { encode(message: AuthInfo, writer: Writer = Writer.create()): Writer { for (const v of message.signerInfos) { @@ -688,7 +654,8 @@ export const AuthInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): AuthInfo { + + decode(input: Reader | Uint8Array, length?: number): AuthInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAuthInfo } as AuthInfo; @@ -709,6 +676,7 @@ export const AuthInfo = { } return message; }, + fromJSON(object: any): AuthInfo { const message = { ...baseAuthInfo } as AuthInfo; message.signerInfos = []; @@ -724,6 +692,7 @@ export const AuthInfo = { } return message; }, + fromPartial(object: DeepPartial): AuthInfo { const message = { ...baseAuthInfo } as AuthInfo; message.signerInfos = []; @@ -739,6 +708,7 @@ export const AuthInfo = { } return message; }, + toJSON(message: AuthInfo): unknown { const obj: any = {}; if (message.signerInfos) { @@ -751,6 +721,8 @@ export const AuthInfo = { }, }; +const baseSignerInfo: object = { sequence: Long.UZERO }; + export const SignerInfo = { encode(message: SignerInfo, writer: Writer = Writer.create()): Writer { if (message.publicKey !== undefined && message.publicKey !== undefined) { @@ -762,7 +734,8 @@ export const SignerInfo = { writer.uint32(24).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignerInfo { + + decode(input: Reader | Uint8Array, length?: number): SignerInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignerInfo } as SignerInfo; @@ -785,6 +758,7 @@ export const SignerInfo = { } return message; }, + fromJSON(object: any): SignerInfo { const message = { ...baseSignerInfo } as SignerInfo; if (object.publicKey !== undefined && object.publicKey !== null) { @@ -804,6 +778,7 @@ export const SignerInfo = { } return message; }, + fromPartial(object: DeepPartial): SignerInfo { const message = { ...baseSignerInfo } as SignerInfo; if (object.publicKey !== undefined && object.publicKey !== null) { @@ -823,6 +798,7 @@ export const SignerInfo = { } return message; }, + toJSON(message: SignerInfo): unknown { const obj: any = {}; message.publicKey !== undefined && @@ -834,6 +810,8 @@ export const SignerInfo = { }, }; +const baseModeInfo: object = {}; + export const ModeInfo = { encode(message: ModeInfo, writer: Writer = Writer.create()): Writer { if (message.single !== undefined) { @@ -844,7 +822,8 @@ export const ModeInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ModeInfo { + + decode(input: Reader | Uint8Array, length?: number): ModeInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseModeInfo } as ModeInfo; @@ -864,6 +843,7 @@ export const ModeInfo = { } return message; }, + fromJSON(object: any): ModeInfo { const message = { ...baseModeInfo } as ModeInfo; if (object.single !== undefined && object.single !== null) { @@ -878,6 +858,7 @@ export const ModeInfo = { } return message; }, + fromPartial(object: DeepPartial): ModeInfo { const message = { ...baseModeInfo } as ModeInfo; if (object.single !== undefined && object.single !== null) { @@ -892,6 +873,7 @@ export const ModeInfo = { } return message; }, + toJSON(message: ModeInfo): unknown { const obj: any = {}; message.single !== undefined && @@ -902,12 +884,15 @@ export const ModeInfo = { }, }; +const baseModeInfo_Single: object = { mode: 0 }; + export const ModeInfo_Single = { encode(message: ModeInfo_Single, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.mode); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ModeInfo_Single { + + decode(input: Reader | Uint8Array, length?: number): ModeInfo_Single { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseModeInfo_Single } as ModeInfo_Single; @@ -924,6 +909,7 @@ export const ModeInfo_Single = { } return message; }, + fromJSON(object: any): ModeInfo_Single { const message = { ...baseModeInfo_Single } as ModeInfo_Single; if (object.mode !== undefined && object.mode !== null) { @@ -933,6 +919,7 @@ export const ModeInfo_Single = { } return message; }, + fromPartial(object: DeepPartial): ModeInfo_Single { const message = { ...baseModeInfo_Single } as ModeInfo_Single; if (object.mode !== undefined && object.mode !== null) { @@ -942,6 +929,7 @@ export const ModeInfo_Single = { } return message; }, + toJSON(message: ModeInfo_Single): unknown { const obj: any = {}; message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); @@ -949,6 +937,8 @@ export const ModeInfo_Single = { }, }; +const baseModeInfo_Multi: object = {}; + export const ModeInfo_Multi = { encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer { if (message.bitarray !== undefined && message.bitarray !== undefined) { @@ -959,7 +949,8 @@ export const ModeInfo_Multi = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ModeInfo_Multi { + + decode(input: Reader | Uint8Array, length?: number): ModeInfo_Multi { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; @@ -980,6 +971,7 @@ export const ModeInfo_Multi = { } return message; }, + fromJSON(object: any): ModeInfo_Multi { const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; message.modeInfos = []; @@ -995,6 +987,7 @@ export const ModeInfo_Multi = { } return message; }, + fromPartial(object: DeepPartial): ModeInfo_Multi { const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; message.modeInfos = []; @@ -1010,6 +1003,7 @@ export const ModeInfo_Multi = { } return message; }, + toJSON(message: ModeInfo_Multi): unknown { const obj: any = {}; message.bitarray !== undefined && @@ -1023,6 +1017,8 @@ export const ModeInfo_Multi = { }, }; +const baseFee: object = { gasLimit: Long.UZERO, payer: "", granter: "" }; + export const Fee = { encode(message: Fee, writer: Writer = Writer.create()): Writer { for (const v of message.amount) { @@ -1033,7 +1029,8 @@ export const Fee = { writer.uint32(34).string(message.granter); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Fee { + + decode(input: Reader | Uint8Array, length?: number): Fee { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFee } as Fee; @@ -1060,6 +1057,7 @@ export const Fee = { } return message; }, + fromJSON(object: any): Fee { const message = { ...baseFee } as Fee; message.amount = []; @@ -1085,6 +1083,7 @@ export const Fee = { } return message; }, + fromPartial(object: DeepPartial): Fee { const message = { ...baseFee } as Fee; message.amount = []; @@ -1110,6 +1109,7 @@ export const Fee = { } return message; }, + toJSON(message: Fee): unknown { const obj: any = {}; if (message.amount) { @@ -1124,15 +1124,18 @@ export const Fee = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -1142,6 +1145,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -1149,7 +1154,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/cosmos_proto/cosmos.ts b/packages/stargate/src/codec/cosmos_proto/cosmos.ts index 1ef6995b..9ec67a12 100644 --- a/packages/stargate/src/codec/cosmos_proto/cosmos.ts +++ b/packages/stargate/src/codec/cosmos_proto/cosmos.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - export const protobufPackage = "cosmos_proto"; diff --git a/packages/stargate/src/codec/gogoproto/gogo.ts b/packages/stargate/src/codec/gogoproto/gogo.ts index ecf800e0..3f41a047 100644 --- a/packages/stargate/src/codec/gogoproto/gogo.ts +++ b/packages/stargate/src/codec/gogoproto/gogo.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - export const protobufPackage = "gogoproto"; diff --git a/packages/stargate/src/codec/google/api/annotations.ts b/packages/stargate/src/codec/google/api/annotations.ts index c2161053..aace4787 100644 --- a/packages/stargate/src/codec/google/api/annotations.ts +++ b/packages/stargate/src/codec/google/api/annotations.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - export const protobufPackage = "google.api"; diff --git a/packages/stargate/src/codec/google/api/http.ts b/packages/stargate/src/codec/google/api/http.ts index d051d088..4fa790ae 100644 --- a/packages/stargate/src/codec/google/api/http.ts +++ b/packages/stargate/src/codec/google/api/http.ts @@ -1,333 +1,305 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "google.api"; /** - * 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. + * 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. + * A list of HTTP configuration rules that apply to individual API methods. * - * **NOTE:** All service configuration rules follow "last one wins" order. + * **NOTE:** All service configuration rules follow "last one wins" order. */ rules: HttpRule[]; /** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where "%2F" will be - * left encoded. + * When set to true, URL path parmeters 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. + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. */ fullyDecodeReservedExpansion: boolean; } /** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP - * REST API methods. The mapping specifies how different portions of the RPC - * request message are mapped to URL path, URL query parameters, and - * HTTP request body. The mapping is typically specified as an - * `google.api.http` annotation on the RPC method, - * see "google/api/annotations.proto" for details. + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. * - * The mapping consists of a field specifying the path template and - * method kind. The path template can refer to fields in the request - * message, as in the example below which describes a REST GET - * operation on a resource collection of messages: + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: * * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; - * } - * } - * message GetMessageRequest { - * message SubMessage { - * string subfield = 1; - * } - * string message_id = 1; // mapped to the URL - * SubMessage sub = 2; // `sub.subfield` is url-mapped - * } - * message Message { - * string text = 1; // content of the resource - * } + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } * - * The same http annotation can alternatively be expressed inside the - * `GRPC API Configuration` YAML file. + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. * - * http: - * rules: - * - selector: .Messaging.GetMessage - * get: /v1/messages/{message_id}/{sub.subfield} + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} * - * This definition enables an automatic, bidrectional mapping of HTTP - * JSON to RPC. Example: + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` * - * In general, not only fields but also field paths can be referenced - * from a path pattern. Fields mapped to the path pattern cannot be - * repeated and must have a primitive (non-message) type. + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. * - * Any fields in the request message which are not bound by the path - * pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: * * - * 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 the URL - * int64 revision = 2; // becomes a parameter - * SubMessage sub = 3; // `sub.subfield` becomes a parameter - * } + * 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 the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } * * - * This enables a HTTP JSON to RPC mapping as below: + * This enables a HTTP JSON to RPC mapping as below: * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * HTTP | RPC + * -----|----- + * `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 HTTP parameters must have a - * primitive type or a repeated primitive type. Message types are not - * allowed. In the case of a repeated type, the parameter can be - * repeated in the URL, as in `...?param=A¶m=B`. + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. * - * For HTTP method kinds which allow a request body, the `body` field - * specifies the mapping. Consider a REST update method on the - * message resource collection: + * For HTTP method kinds which 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) = { - * put: "/v1/messages/{message_id}" - * body: "message" - * }; - * } - * } - * message UpdateMessageRequest { - * string message_id = 1; // mapped to the URL - * Message message = 2; // mapped to the body - * } + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/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: + * 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 | RPC - * -----|----- - * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * HTTP | RPC + * -----|----- + * `PUT /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: + * 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) = { - * put: "/v1/messages/{message_id}" - * body: "*" - * }; - * } - * } - * message Message { - * string message_id = 1; - * string text = 2; - * } + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } * * - * The following HTTP JSON to RPC mapping is enabled: + * The following HTTP JSON to RPC mapping is enabled: * - * HTTP | RPC - * -----|----- - * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * HTTP | RPC + * -----|----- + * `PUT /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 of - * defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. + * 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 of + * 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: + * 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; - * } + * 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: + * This enables the following two alternative HTTP JSON to RPC + * mappings: * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * HTTP | RPC + * -----|----- + * `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 + * # Rules for HTTP mapping * - * The rules for mapping HTTP path, query parameters, and body fields - * to the request message are as follows: + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: * - * 1. The `body` field specifies either `*` or a field path, or is - * omitted. If omitted, it indicates there is no HTTP request body. - * 2. Leaf fields (recursive expansion of nested messages in the - * request) can be classified into three types: - * (a) Matched in the URL template. - * (b) Covered by body (if body is `*`, everything except (a) fields; - * else everything under the body field) - * (c) All other fields. - * 3. URL query parameters found in the HTTP request are mapped to (c) fields. - * 4. Any body sent with an HTTP request can contain only (b) fields. + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. * - * The syntax of the path template is as follows: + * The syntax of the path template is as follows: * - * Template = "/" Segments [ Verb ] ; - * Segments = Segment { "/" Segment } ; - * Segment = "*" | "**" | LITERAL | Variable ; - * Variable = "{" FieldPath [ "=" Segments ] "}" ; - * FieldPath = IDENT { "." IDENT } ; - * Verb = ":" LITERAL ; + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; * - * The syntax `*` matches a single path segment. The syntax `**` matches zero - * or more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. * - * 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 `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=*}`. * - * If a variable contains exactly one path segment, such as `"{var}"` or - * `"{var=*}"`, when such a variable is expanded into a URL path, all characters - * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the - * Discovery Document as `{var}`. + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. * - * If a variable contains one or more path segments, such as `"{var=foo/*}"` - * or `"{var=**}"`, when such a variable is expanded into a URL path, all - * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables - * show up in the Discovery Document as `{+var}`. + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. * - * NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 - * Simple String Expansion, the multi segment variable **does not** match - * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion - * does not expand special characters like `?` and `#`, which would lead - * to invalid URLs. + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. * - * NOTE: the field paths in variables and in the `body` must not refer to - * repeated fields or map fields. + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. */ export interface HttpRule { /** - * Selects methods to which this rule applies. + * Selects methods to which this rule applies. * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. */ selector: string; - /** - * Used for listing and getting information about resources. - */ + /** Used for listing and getting information about resources. */ get: string | undefined; - /** - * Used for updating a resource. - */ + /** Used for updating a resource. */ put: string | undefined; - /** - * Used for creating a resource. - */ + /** Used for creating a resource. */ post: string | undefined; - /** - * Used for deleting a resource. - */ + /** Used for deleting a resource. */ delete: string | undefined; - /** - * Used for updating a resource. - */ + /** Used for updating a resource. */ patch: string | undefined; /** - * 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. + * 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 | undefined; /** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. */ body: string; /** - * Optional. The name of the response field whose value is mapped to the HTTP - * body of response. Other response fields are ignored. When - * not set, the response message will be used as HTTP body of response. + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. */ 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). + * 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[]; } -/** - * A custom pattern is used for defining custom HTTP verb. - */ +/** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPattern { - /** - * The name of this custom HTTP verb. - */ + /** The name of this custom HTTP verb. */ kind: string; - /** - * The path matched by this custom verb. - */ + /** The path matched by this custom verb. */ path: string; } -const baseHttp: object = { - fullyDecodeReservedExpansion: false, -}; - -const baseHttpRule: object = { - selector: "", - body: "", - responseBody: "", -}; - -const baseCustomHttpPattern: object = { - kind: "", - path: "", -}; - -export const protobufPackage = "google.api"; +const baseHttp: object = { fullyDecodeReservedExpansion: false }; export const Http = { encode(message: Http, writer: Writer = Writer.create()): Writer { @@ -337,7 +309,8 @@ export const Http = { writer.uint32(16).bool(message.fullyDecodeReservedExpansion); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Http { + + decode(input: Reader | Uint8Array, length?: number): Http { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHttp } as Http; @@ -358,6 +331,7 @@ export const Http = { } return message; }, + fromJSON(object: any): Http { const message = { ...baseHttp } as Http; message.rules = []; @@ -373,6 +347,7 @@ export const Http = { } return message; }, + fromPartial(object: DeepPartial): Http { const message = { ...baseHttp } as Http; message.rules = []; @@ -388,6 +363,7 @@ export const Http = { } return message; }, + toJSON(message: Http): unknown { const obj: any = {}; if (message.rules) { @@ -401,6 +377,8 @@ export const Http = { }, }; +const baseHttpRule: object = { selector: "", body: "", responseBody: "" }; + export const HttpRule = { encode(message: HttpRule, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.selector); @@ -429,7 +407,8 @@ export const HttpRule = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): HttpRule { + + decode(input: Reader | Uint8Array, length?: number): HttpRule { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHttpRule } as HttpRule; @@ -474,6 +453,7 @@ export const HttpRule = { } return message; }, + fromJSON(object: any): HttpRule { const message = { ...baseHttpRule } as HttpRule; message.additionalBindings = []; @@ -529,6 +509,7 @@ export const HttpRule = { } return message; }, + fromPartial(object: DeepPartial): HttpRule { const message = { ...baseHttpRule } as HttpRule; message.additionalBindings = []; @@ -584,6 +565,7 @@ export const HttpRule = { } return message; }, + toJSON(message: HttpRule): unknown { const obj: any = {}; message.selector !== undefined && (obj.selector = message.selector); @@ -605,13 +587,16 @@ export const HttpRule = { }, }; +const baseCustomHttpPattern: object = { kind: "", path: "" }; + export const CustomHttpPattern = { encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.kind); writer.uint32(18).string(message.path); return writer; }, - decode(input: Uint8Array | Reader, length?: number): CustomHttpPattern { + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCustomHttpPattern } as CustomHttpPattern; @@ -631,6 +616,7 @@ export const CustomHttpPattern = { } return message; }, + fromJSON(object: any): CustomHttpPattern { const message = { ...baseCustomHttpPattern } as CustomHttpPattern; if (object.kind !== undefined && object.kind !== null) { @@ -645,6 +631,7 @@ export const CustomHttpPattern = { } return message; }, + fromPartial(object: DeepPartial): CustomHttpPattern { const message = { ...baseCustomHttpPattern } as CustomHttpPattern; if (object.kind !== undefined && object.kind !== null) { @@ -659,6 +646,7 @@ export const CustomHttpPattern = { } return message; }, + toJSON(message: CustomHttpPattern): unknown { const obj: any = {}; message.kind !== undefined && (obj.kind = message.kind); @@ -667,7 +655,7 @@ export const CustomHttpPattern = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/google/protobuf/any.ts b/packages/stargate/src/codec/google/protobuf/any.ts index 8b24c81b..21674e20 100644 --- a/packages/stargate/src/codec/google/protobuf/any.ts +++ b/packages/stargate/src/codec/google/protobuf/any.ts @@ -1,131 +1,126 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "google.protobuf"; /** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. + * `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. + * 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++. + * 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 foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&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". + * 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); + * } * - * 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: + * Example 3: Pack and unpack a message in Python. * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; + * 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 { + * ... * } * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } + * 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". * - * 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" - * } + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } */ export interface Any { /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). + * 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: + * 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.) + * * 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. + * 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. - */ + /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { - typeUrl: "", -}; - -export const protobufPackage = "google.protobuf"; +const baseAny: object = { typeUrl: "" }; export const Any = { encode(message: Any, writer: Writer = Writer.create()): Writer { @@ -133,7 +128,8 @@ export const Any = { writer.uint32(18).bytes(message.value); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Any { + + decode(input: Reader | Uint8Array, length?: number): Any { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAny } as Any; @@ -153,6 +149,7 @@ export const Any = { } return message; }, + fromJSON(object: any): Any { const message = { ...baseAny } as Any; if (object.typeUrl !== undefined && object.typeUrl !== null) { @@ -165,6 +162,7 @@ export const Any = { } return message; }, + fromPartial(object: DeepPartial): Any { const message = { ...baseAny } as Any; if (object.typeUrl !== undefined && object.typeUrl !== null) { @@ -179,6 +177,7 @@ export const Any = { } return message; }, + toJSON(message: Any): unknown { const obj: any = {}; message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); @@ -188,15 +187,18 @@ export const Any = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -206,6 +208,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -213,7 +217,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/google/protobuf/descriptor.ts b/packages/stargate/src/codec/google/protobuf/descriptor.ts index 0ff4add2..3b16ece1 100644 --- a/packages/stargate/src/codec/google/protobuf/descriptor.ts +++ b/packages/stargate/src/codec/google/protobuf/descriptor.ts @@ -2,64 +2,52 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "google.protobuf"; + /** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. */ export interface FileDescriptorSet { file: FileDescriptorProto[]; } -/** - * Describes a complete .proto file. - */ +/** Describes a complete .proto file. */ export interface FileDescriptorProto { - /** - * file name, relative to root of source tree - */ + /** file name, relative to root of source tree */ name: string; - /** - * e.g. "foo", "foo.bar", etc. - */ + /** e.g. "foo", "foo.bar", etc. */ package: string; - /** - * Names of files imported by this file. - */ + /** Names of files imported by this file. */ dependency: string[]; - /** - * Indexes of the public imported files in the dependency list above. - */ + /** 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. + * 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. - */ + /** 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. + * 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". + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". */ syntax: string; } -/** - * Describes a message type. - */ +/** Describes a message type. */ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; @@ -71,956 +59,147 @@ export interface DescriptorProto { 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. + * 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 DescriptorProto_ExtensionRange { - /** - * Inclusive. - */ + /** Inclusive. */ start: number; - /** - * Exclusive. - */ + /** Exclusive. */ end: number; options?: ExtensionRangeOptions; } /** - * 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. + * 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. - */ + /** Inclusive. */ start: number; - /** - * Exclusive. - */ + /** Exclusive. */ end: number; } export interface ExtensionRangeOptions { - /** - * The parser stores options it doesn't recognize here. See above. - */ + /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } -/** - * Describes a field within a message. - */ +/** 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. + * 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). + * 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. + * 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? + * 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. + * 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. + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. */ jsonName: string; options?: FieldOptions; /** - * If true, this is a proto3 "optional". When a proto3 field is optional, it - * tracks presence regardless of field type. + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. * - * When proto3_optional is true, this field must be belong to a oneof to - * signal to old proto3 clients that presence is tracked for this field. This - * oneof is known as a "synthetic" oneof, and this field must be its sole - * member (each proto3 optional field gets its own synthetic oneof). Synthetic - * oneofs exist in the descriptor only, and do not generate any API. Synthetic - * oneofs must be ordered after all "real" oneofs. + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. * - * For message fields, proto3_optional doesn't create any semantic change, - * since non-repeated message fields always track presence. However it still - * indicates the semantic detail of whether the user wrote "optional" or not. - * This can be useful for round-tripping the .proto file. For consistency we - * give message fields a synthetic oneof also, even though it is not required - * to track presence. This is especially important because the parser can't - * tell if a field is a message or an enum, so it must always create a - * synthetic oneof. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. * - * Proto2 optional fields do not set this flag, because they already indicate - * optional with `LABEL_OPTIONAL`. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. */ proto3Optional: boolean; } -/** - * Describes a oneof. - */ -export interface OneofDescriptorProto { - name: string; - options?: OneofOptions; -} - -/** - * 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[]; -} - -/** - * 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; -} - -/** - * Describes a value within an enum. - */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options?: EnumValueOptions; -} - -/** - * Describes a service. - */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options?: ServiceOptions; -} - -/** - * 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 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. - */ - 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 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 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 OneofOptions { - /** - * The parser stores options it doesn't recognize here. See above. - */ - uninterpretedOption: UninterpretedOption[]; -} - -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 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 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 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[]; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * 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 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[]; -} - -/** - * 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 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; -} - -const baseFileDescriptorSet: object = {}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - publicDependency: 0, - weakDependency: 0, - syntax: "", -}; - -const baseDescriptorProto: object = { - name: "", - reservedName: "", -}; - -const baseDescriptorProto_ExtensionRange: object = { - start: 0, - end: 0, -}; - -const baseDescriptorProto_ReservedRange: object = { - start: 0, - end: 0, -}; - -const baseExtensionRangeOptions: object = {}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - typeName: "", - extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - proto3Optional: false, -}; - -const baseOneofDescriptorProto: object = { - name: "", -}; - -const baseEnumDescriptorProto: object = { - name: "", - reservedName: "", -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { - start: 0, - end: 0, -}; - -const baseEnumValueDescriptorProto: object = { - name: "", - number: 0, -}; - -const baseServiceDescriptorProto: object = { - name: "", -}; - -const baseMethodDescriptorProto: object = { - name: "", - inputType: "", - outputType: "", - clientStreaming: false, - serverStreaming: false, -}; - -const baseFileOptions: object = { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - phpGenericServices: false, - deprecated: false, - ccEnableArenas: false, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", -}; - -const baseMessageOptions: object = { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, - deprecated: false, - mapEntry: false, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -const baseOneofOptions: object = {}; - -const baseEnumOptions: object = { - allowAlias: false, - deprecated: false, -}; - -const baseEnumValueOptions: object = { - deprecated: false, -}; - -const baseServiceOptions: object = { - deprecated: false, -}; - -const baseMethodOptions: object = { - deprecated: false, - idempotencyLevel: 0, -}; - -const baseUninterpretedOption: object = { - identifierValue: "", - positiveIntValue: Long.UZERO, - negativeIntValue: Long.ZERO, - doubleValue: 0, - aggregateValue: "", -}; - -const baseUninterpretedOption_NamePart: object = { - namePart: "", - isExtension: false, -}; - -const baseSourceCodeInfo: object = {}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leadingComments: "", - trailingComments: "", - leadingDetachedComments: "", -}; - -const baseGeneratedCodeInfo: object = {}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - sourceFile: "", - begin: 0, - end: 0, -}; - -export const protobufPackage = "google.protobuf"; - export enum FieldDescriptorProto_Type { - /** TYPE_DOUBLE - 0 is reserved for errors. - Order is weird for historical reasons. + /** + * 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 - 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 - 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 - 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 - Length-delimited aggregate. - */ + /** TYPE_MESSAGE - Length-delimited aggregate. */ TYPE_MESSAGE = 11, - /** TYPE_BYTES - New in version 2. - */ + /** 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 - Uses ZigZag encoding. */ TYPE_SINT32 = 17, - /** TYPE_SINT64 - Uses ZigZag encoding. - */ + /** TYPE_SINT64 - Uses ZigZag encoding. */ TYPE_SINT64 = 18, UNRECOGNIZED = -1, } @@ -1132,8 +311,7 @@ export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Typ } export enum FieldDescriptorProto_Label { - /** LABEL_OPTIONAL - 0 is reserved for errors - */ + /** LABEL_OPTIONAL - 0 is reserved for errors */ LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, LABEL_REPEATED = 3, @@ -1171,17 +349,203 @@ export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_La } } -/** Generated classes can be optimized for speed or code size. +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} + +/** 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[]; +} + +/** + * 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; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} + +/** 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 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[]; +} + +/** Generated classes can be optimized for speed or code size. */ export enum FileOptions_OptimizeMode { - /** SPEED - Generate complete code for parsing, serialization, - */ + /** SPEED - Generate complete code for parsing, serialization, */ SPEED = 1, - /** CODE_SIZE - etc. - */ + /** CODE_SIZE - etc. */ CODE_SIZE = 2, - /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. - */ + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ LITE_RUNTIME = 3, UNRECOGNIZED = -1, } @@ -1217,9 +581,145 @@ export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode) } } -export enum FieldOptions_CType { - /** STRING - Default mode. +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 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 enum FieldOptions_CType { + /** STRING - Default mode. */ STRING = 0, CORD = 1, STRING_PIECE = 2, @@ -1258,14 +758,11 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { } export enum FieldOptions_JSType { - /** JS_NORMAL - Use the default type. - */ + /** JS_NORMAL - Use the default type. */ JS_NORMAL = 0, - /** JS_STRING - Use JavaScript strings. - */ + /** JS_STRING - Use JavaScript strings. */ JS_STRING = 1, - /** JS_NUMBER - Use JavaScript numbers. - */ + /** JS_NUMBER - Use JavaScript numbers. */ JS_NUMBER = 2, UNRECOGNIZED = -1, } @@ -1301,17 +798,75 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { } } -/** 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 interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +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 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 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 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[]; +} + +/** + * 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 - implies idempotent */ NO_SIDE_EFFECTS = 1, - /** IDEMPOTENT - idempotent, but may have side effects - */ + /** IDEMPOTENT - idempotent, but may have side effects */ IDEMPOTENT = 2, UNRECOGNIZED = -1, } @@ -1347,6 +902,218 @@ export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_Idemp } } +/** + * 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; +} + +/** + * 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; +} + +/** + * 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 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[]; +} + +/** + * 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 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; +} + +const baseFileDescriptorSet: object = {}; + export const FileDescriptorSet = { encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { for (const v of message.file) { @@ -1354,7 +1121,8 @@ export const FileDescriptorSet = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): FileDescriptorSet { + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFileDescriptorSet } as FileDescriptorSet; @@ -1372,6 +1140,7 @@ export const FileDescriptorSet = { } return message; }, + fromJSON(object: any): FileDescriptorSet { const message = { ...baseFileDescriptorSet } as FileDescriptorSet; message.file = []; @@ -1382,6 +1151,7 @@ export const FileDescriptorSet = { } return message; }, + fromPartial(object: DeepPartial): FileDescriptorSet { const message = { ...baseFileDescriptorSet } as FileDescriptorSet; message.file = []; @@ -1392,6 +1162,7 @@ export const FileDescriptorSet = { } return message; }, + toJSON(message: FileDescriptorSet): unknown { const obj: any = {}; if (message.file) { @@ -1403,6 +1174,15 @@ export const FileDescriptorSet = { }, }; +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + publicDependency: 0, + weakDependency: 0, + syntax: "", +}; + export const FileDescriptorProto = { encode(message: FileDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -1441,7 +1221,8 @@ export const FileDescriptorProto = { writer.uint32(98).string(message.syntax); return writer; }, - decode(input: Uint8Array | Reader, length?: number): FileDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFileDescriptorProto } as FileDescriptorProto; @@ -1512,6 +1293,7 @@ export const FileDescriptorProto = { } return message; }, + fromJSON(object: any): FileDescriptorProto { const message = { ...baseFileDescriptorProto } as FileDescriptorProto; message.dependency = []; @@ -1583,6 +1365,7 @@ export const FileDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): FileDescriptorProto { const message = { ...baseFileDescriptorProto } as FileDescriptorProto; message.dependency = []; @@ -1654,6 +1437,7 @@ export const FileDescriptorProto = { } return message; }, + toJSON(message: FileDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -1704,6 +1488,8 @@ export const FileDescriptorProto = { }, }; +const baseDescriptorProto: object = { name: "", reservedName: "" }; + export const DescriptorProto = { encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -1736,7 +1522,8 @@ export const DescriptorProto = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDescriptorProto } as DescriptorProto; @@ -1788,6 +1575,7 @@ export const DescriptorProto = { } return message; }, + fromJSON(object: any): DescriptorProto { const message = { ...baseDescriptorProto } as DescriptorProto; message.field = []; @@ -1850,6 +1638,7 @@ export const DescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): DescriptorProto { const message = { ...baseDescriptorProto } as DescriptorProto; message.field = []; @@ -1912,6 +1701,7 @@ export const DescriptorProto = { } return message; }, + toJSON(message: DescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -1965,6 +1755,8 @@ export const DescriptorProto = { }, }; +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + export const DescriptorProto_ExtensionRange = { encode(message: DescriptorProto_ExtensionRange, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.start); @@ -1974,7 +1766,8 @@ export const DescriptorProto_ExtensionRange = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): DescriptorProto_ExtensionRange { + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; @@ -1997,6 +1790,7 @@ export const DescriptorProto_ExtensionRange = { } return message; }, + fromJSON(object: any): DescriptorProto_ExtensionRange { const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; if (object.start !== undefined && object.start !== null) { @@ -2016,6 +1810,7 @@ export const DescriptorProto_ExtensionRange = { } return message; }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; if (object.start !== undefined && object.start !== null) { @@ -2035,6 +1830,7 @@ export const DescriptorProto_ExtensionRange = { } return message; }, + toJSON(message: DescriptorProto_ExtensionRange): unknown { const obj: any = {}; message.start !== undefined && (obj.start = message.start); @@ -2045,13 +1841,16 @@ export const DescriptorProto_ExtensionRange = { }, }; +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + export const DescriptorProto_ReservedRange = { encode(message: DescriptorProto_ReservedRange, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.start); writer.uint32(16).int32(message.end); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DescriptorProto_ReservedRange { + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; @@ -2071,6 +1870,7 @@ export const DescriptorProto_ReservedRange = { } return message; }, + fromJSON(object: any): DescriptorProto_ReservedRange { const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; if (object.start !== undefined && object.start !== null) { @@ -2085,6 +1885,7 @@ export const DescriptorProto_ReservedRange = { } return message; }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; if (object.start !== undefined && object.start !== null) { @@ -2099,6 +1900,7 @@ export const DescriptorProto_ReservedRange = { } return message; }, + toJSON(message: DescriptorProto_ReservedRange): unknown { const obj: any = {}; message.start !== undefined && (obj.start = message.start); @@ -2107,6 +1909,8 @@ export const DescriptorProto_ReservedRange = { }, }; +const baseExtensionRangeOptions: object = {}; + export const ExtensionRangeOptions = { encode(message: ExtensionRangeOptions, writer: Writer = Writer.create()): Writer { for (const v of message.uninterpretedOption) { @@ -2114,7 +1918,8 @@ export const ExtensionRangeOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ExtensionRangeOptions { + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; @@ -2132,6 +1937,7 @@ export const ExtensionRangeOptions = { } return message; }, + fromJSON(object: any): ExtensionRangeOptions { const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; message.uninterpretedOption = []; @@ -2142,6 +1948,7 @@ export const ExtensionRangeOptions = { } return message; }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; message.uninterpretedOption = []; @@ -2152,6 +1959,7 @@ export const ExtensionRangeOptions = { } return message; }, + toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; if (message.uninterpretedOption) { @@ -2165,6 +1973,19 @@ export const ExtensionRangeOptions = { }, }; +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, +}; + export const FieldDescriptorProto = { encode(message: FieldDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2182,7 +2003,8 @@ export const FieldDescriptorProto = { writer.uint32(136).bool(message.proto3Optional); return writer; }, - decode(input: Uint8Array | Reader, length?: number): FieldDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; @@ -2229,6 +2051,7 @@ export const FieldDescriptorProto = { } return message; }, + fromJSON(object: any): FieldDescriptorProto { const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2288,6 +2111,7 @@ export const FieldDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): FieldDescriptorProto { const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2347,6 +2171,7 @@ export const FieldDescriptorProto = { } return message; }, + toJSON(message: FieldDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2365,6 +2190,8 @@ export const FieldDescriptorProto = { }, }; +const baseOneofDescriptorProto: object = { name: "" }; + export const OneofDescriptorProto = { encode(message: OneofDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2373,7 +2200,8 @@ export const OneofDescriptorProto = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): OneofDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; @@ -2393,6 +2221,7 @@ export const OneofDescriptorProto = { } return message; }, + fromJSON(object: any): OneofDescriptorProto { const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2407,6 +2236,7 @@ export const OneofDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): OneofDescriptorProto { const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2421,6 +2251,7 @@ export const OneofDescriptorProto = { } return message; }, + toJSON(message: OneofDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2430,6 +2261,8 @@ export const OneofDescriptorProto = { }, }; +const baseEnumDescriptorProto: object = { name: "", reservedName: "" }; + export const EnumDescriptorProto = { encode(message: EnumDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2447,7 +2280,8 @@ export const EnumDescriptorProto = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): EnumDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; @@ -2479,6 +2313,7 @@ export const EnumDescriptorProto = { } return message; }, + fromJSON(object: any): EnumDescriptorProto { const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; message.value = []; @@ -2511,6 +2346,7 @@ export const EnumDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): EnumDescriptorProto { const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; message.value = []; @@ -2543,6 +2379,7 @@ export const EnumDescriptorProto = { } return message; }, + toJSON(message: EnumDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2569,13 +2406,16 @@ export const EnumDescriptorProto = { }, }; +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + export const EnumDescriptorProto_EnumReservedRange = { encode(message: EnumDescriptorProto_EnumReservedRange, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.start); writer.uint32(16).int32(message.end); return writer; }, - decode(input: Uint8Array | Reader, length?: number): EnumDescriptorProto_EnumReservedRange { + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; @@ -2595,6 +2435,7 @@ export const EnumDescriptorProto_EnumReservedRange = { } return message; }, + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; if (object.start !== undefined && object.start !== null) { @@ -2609,6 +2450,7 @@ export const EnumDescriptorProto_EnumReservedRange = { } return message; }, + fromPartial( object: DeepPartial, ): EnumDescriptorProto_EnumReservedRange { @@ -2625,6 +2467,7 @@ export const EnumDescriptorProto_EnumReservedRange = { } return message; }, + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { const obj: any = {}; message.start !== undefined && (obj.start = message.start); @@ -2633,6 +2476,8 @@ export const EnumDescriptorProto_EnumReservedRange = { }, }; +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + export const EnumValueDescriptorProto = { encode(message: EnumValueDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2642,7 +2487,8 @@ export const EnumValueDescriptorProto = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): EnumValueDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): EnumValueDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; @@ -2665,6 +2511,7 @@ export const EnumValueDescriptorProto = { } return message; }, + fromJSON(object: any): EnumValueDescriptorProto { const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2684,6 +2531,7 @@ export const EnumValueDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2703,6 +2551,7 @@ export const EnumValueDescriptorProto = { } return message; }, + toJSON(message: EnumValueDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2713,6 +2562,8 @@ export const EnumValueDescriptorProto = { }, }; +const baseServiceDescriptorProto: object = { name: "" }; + export const ServiceDescriptorProto = { encode(message: ServiceDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2724,7 +2575,8 @@ export const ServiceDescriptorProto = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ServiceDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; @@ -2748,6 +2600,7 @@ export const ServiceDescriptorProto = { } return message; }, + fromJSON(object: any): ServiceDescriptorProto { const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; message.method = []; @@ -2768,6 +2621,7 @@ export const ServiceDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; message.method = []; @@ -2788,6 +2642,7 @@ export const ServiceDescriptorProto = { } return message; }, + toJSON(message: ServiceDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2802,6 +2657,14 @@ export const ServiceDescriptorProto = { }, }; +const baseMethodDescriptorProto: object = { + name: "", + inputType: "", + outputType: "", + clientStreaming: false, + serverStreaming: false, +}; + export const MethodDescriptorProto = { encode(message: MethodDescriptorProto, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.name); @@ -2814,7 +2677,8 @@ export const MethodDescriptorProto = { writer.uint32(48).bool(message.serverStreaming); return writer; }, - decode(input: Uint8Array | Reader, length?: number): MethodDescriptorProto { + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; @@ -2846,6 +2710,7 @@ export const MethodDescriptorProto = { } return message; }, + fromJSON(object: any): MethodDescriptorProto { const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2880,6 +2745,7 @@ export const MethodDescriptorProto = { } return message; }, + fromPartial(object: DeepPartial): MethodDescriptorProto { const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; if (object.name !== undefined && object.name !== null) { @@ -2914,6 +2780,7 @@ export const MethodDescriptorProto = { } return message; }, + toJSON(message: MethodDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); @@ -2927,6 +2794,29 @@ export const MethodDescriptorProto = { }, }; +const baseFileOptions: object = { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", +}; + export const FileOptions = { encode(message: FileOptions, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.javaPackage); @@ -2954,7 +2844,8 @@ export const FileOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): FileOptions { + + decode(input: Reader | Uint8Array, length?: number): FileOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFileOptions } as FileOptions; @@ -3032,6 +2923,7 @@ export const FileOptions = { } return message; }, + fromJSON(object: any): FileOptions { const message = { ...baseFileOptions } as FileOptions; message.uninterpretedOption = []; @@ -3142,6 +3034,7 @@ export const FileOptions = { } return message; }, + fromPartial(object: DeepPartial): FileOptions { const message = { ...baseFileOptions } as FileOptions; message.uninterpretedOption = []; @@ -3252,6 +3145,7 @@ export const FileOptions = { } return message; }, + toJSON(message: FileOptions): unknown { const obj: any = {}; message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); @@ -3287,6 +3181,13 @@ export const FileOptions = { }, }; +const baseMessageOptions: object = { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, +}; + export const MessageOptions = { encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { writer.uint32(8).bool(message.messageSetWireFormat); @@ -3298,7 +3199,8 @@ export const MessageOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MessageOptions { + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMessageOptions } as MessageOptions; @@ -3328,6 +3230,7 @@ export const MessageOptions = { } return message; }, + fromJSON(object: any): MessageOptions { const message = { ...baseMessageOptions } as MessageOptions; message.uninterpretedOption = []; @@ -3358,6 +3261,7 @@ export const MessageOptions = { } return message; }, + fromPartial(object: DeepPartial): MessageOptions { const message = { ...baseMessageOptions } as MessageOptions; message.uninterpretedOption = []; @@ -3388,6 +3292,7 @@ export const MessageOptions = { } return message; }, + toJSON(message: MessageOptions): unknown { const obj: any = {}; message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); @@ -3406,6 +3311,15 @@ export const MessageOptions = { }, }; +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + export const FieldOptions = { encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.ctype); @@ -3419,7 +3333,8 @@ export const FieldOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): FieldOptions { + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFieldOptions } as FieldOptions; @@ -3455,6 +3370,7 @@ export const FieldOptions = { } return message; }, + fromJSON(object: any): FieldOptions { const message = { ...baseFieldOptions } as FieldOptions; message.uninterpretedOption = []; @@ -3495,6 +3411,7 @@ export const FieldOptions = { } return message; }, + fromPartial(object: DeepPartial): FieldOptions { const message = { ...baseFieldOptions } as FieldOptions; message.uninterpretedOption = []; @@ -3535,6 +3452,7 @@ export const FieldOptions = { } return message; }, + toJSON(message: FieldOptions): unknown { const obj: any = {}; message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); @@ -3554,6 +3472,8 @@ export const FieldOptions = { }, }; +const baseOneofOptions: object = {}; + export const OneofOptions = { encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { for (const v of message.uninterpretedOption) { @@ -3561,7 +3481,8 @@ export const OneofOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): OneofOptions { + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseOneofOptions } as OneofOptions; @@ -3579,6 +3500,7 @@ export const OneofOptions = { } return message; }, + fromJSON(object: any): OneofOptions { const message = { ...baseOneofOptions } as OneofOptions; message.uninterpretedOption = []; @@ -3589,6 +3511,7 @@ export const OneofOptions = { } return message; }, + fromPartial(object: DeepPartial): OneofOptions { const message = { ...baseOneofOptions } as OneofOptions; message.uninterpretedOption = []; @@ -3599,6 +3522,7 @@ export const OneofOptions = { } return message; }, + toJSON(message: OneofOptions): unknown { const obj: any = {}; if (message.uninterpretedOption) { @@ -3612,6 +3536,8 @@ export const OneofOptions = { }, }; +const baseEnumOptions: object = { allowAlias: false, deprecated: false }; + export const EnumOptions = { encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { writer.uint32(16).bool(message.allowAlias); @@ -3621,7 +3547,8 @@ export const EnumOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): EnumOptions { + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumOptions } as EnumOptions; @@ -3645,6 +3572,7 @@ export const EnumOptions = { } return message; }, + fromJSON(object: any): EnumOptions { const message = { ...baseEnumOptions } as EnumOptions; message.uninterpretedOption = []; @@ -3665,6 +3593,7 @@ export const EnumOptions = { } return message; }, + fromPartial(object: DeepPartial): EnumOptions { const message = { ...baseEnumOptions } as EnumOptions; message.uninterpretedOption = []; @@ -3685,6 +3614,7 @@ export const EnumOptions = { } return message; }, + toJSON(message: EnumOptions): unknown { const obj: any = {}; message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); @@ -3700,6 +3630,8 @@ export const EnumOptions = { }, }; +const baseEnumValueOptions: object = { deprecated: false }; + export const EnumValueOptions = { encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { writer.uint32(8).bool(message.deprecated); @@ -3708,7 +3640,8 @@ export const EnumValueOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): EnumValueOptions { + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumValueOptions } as EnumValueOptions; @@ -3729,6 +3662,7 @@ export const EnumValueOptions = { } return message; }, + fromJSON(object: any): EnumValueOptions { const message = { ...baseEnumValueOptions } as EnumValueOptions; message.uninterpretedOption = []; @@ -3744,6 +3678,7 @@ export const EnumValueOptions = { } return message; }, + fromPartial(object: DeepPartial): EnumValueOptions { const message = { ...baseEnumValueOptions } as EnumValueOptions; message.uninterpretedOption = []; @@ -3759,6 +3694,7 @@ export const EnumValueOptions = { } return message; }, + toJSON(message: EnumValueOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); @@ -3773,6 +3709,8 @@ export const EnumValueOptions = { }, }; +const baseServiceOptions: object = { deprecated: false }; + export const ServiceOptions = { encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { writer.uint32(264).bool(message.deprecated); @@ -3781,7 +3719,8 @@ export const ServiceOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ServiceOptions { + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseServiceOptions } as ServiceOptions; @@ -3802,6 +3741,7 @@ export const ServiceOptions = { } return message; }, + fromJSON(object: any): ServiceOptions { const message = { ...baseServiceOptions } as ServiceOptions; message.uninterpretedOption = []; @@ -3817,6 +3757,7 @@ export const ServiceOptions = { } return message; }, + fromPartial(object: DeepPartial): ServiceOptions { const message = { ...baseServiceOptions } as ServiceOptions; message.uninterpretedOption = []; @@ -3832,6 +3773,7 @@ export const ServiceOptions = { } return message; }, + toJSON(message: ServiceOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); @@ -3846,6 +3788,8 @@ export const ServiceOptions = { }, }; +const baseMethodOptions: object = { deprecated: false, idempotencyLevel: 0 }; + export const MethodOptions = { encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { writer.uint32(264).bool(message.deprecated); @@ -3855,7 +3799,8 @@ export const MethodOptions = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MethodOptions { + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMethodOptions } as MethodOptions; @@ -3879,6 +3824,7 @@ export const MethodOptions = { } return message; }, + fromJSON(object: any): MethodOptions { const message = { ...baseMethodOptions } as MethodOptions; message.uninterpretedOption = []; @@ -3899,6 +3845,7 @@ export const MethodOptions = { } return message; }, + fromPartial(object: DeepPartial): MethodOptions { const message = { ...baseMethodOptions } as MethodOptions; message.uninterpretedOption = []; @@ -3919,6 +3866,7 @@ export const MethodOptions = { } return message; }, + toJSON(message: MethodOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); @@ -3935,6 +3883,14 @@ export const MethodOptions = { }, }; +const baseUninterpretedOption: object = { + identifierValue: "", + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + aggregateValue: "", +}; + export const UninterpretedOption = { encode(message: UninterpretedOption, writer: Writer = Writer.create()): Writer { for (const v of message.name) { @@ -3948,7 +3904,8 @@ export const UninterpretedOption = { writer.uint32(66).string(message.aggregateValue); return writer; }, - decode(input: Uint8Array | Reader, length?: number): UninterpretedOption { + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUninterpretedOption } as UninterpretedOption; @@ -3984,6 +3941,7 @@ export const UninterpretedOption = { } return message; }, + fromJSON(object: any): UninterpretedOption { const message = { ...baseUninterpretedOption } as UninterpretedOption; message.name = []; @@ -4022,6 +3980,7 @@ export const UninterpretedOption = { } return message; }, + fromPartial(object: DeepPartial): UninterpretedOption { const message = { ...baseUninterpretedOption } as UninterpretedOption; message.name = []; @@ -4062,6 +4021,7 @@ export const UninterpretedOption = { } return message; }, + toJSON(message: UninterpretedOption): unknown { const obj: any = {}; if (message.name) { @@ -4084,13 +4044,16 @@ export const UninterpretedOption = { }, }; +const baseUninterpretedOption_NamePart: object = { namePart: "", isExtension: false }; + export const UninterpretedOption_NamePart = { encode(message: UninterpretedOption_NamePart, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.namePart); writer.uint32(16).bool(message.isExtension); return writer; }, - decode(input: Uint8Array | Reader, length?: number): UninterpretedOption_NamePart { + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; @@ -4110,6 +4073,7 @@ export const UninterpretedOption_NamePart = { } return message; }, + fromJSON(object: any): UninterpretedOption_NamePart { const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; if (object.namePart !== undefined && object.namePart !== null) { @@ -4124,6 +4088,7 @@ export const UninterpretedOption_NamePart = { } return message; }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; if (object.namePart !== undefined && object.namePart !== null) { @@ -4138,6 +4103,7 @@ export const UninterpretedOption_NamePart = { } return message; }, + toJSON(message: UninterpretedOption_NamePart): unknown { const obj: any = {}; message.namePart !== undefined && (obj.namePart = message.namePart); @@ -4146,6 +4112,8 @@ export const UninterpretedOption_NamePart = { }, }; +const baseSourceCodeInfo: object = {}; + export const SourceCodeInfo = { encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { for (const v of message.location) { @@ -4153,7 +4121,8 @@ export const SourceCodeInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SourceCodeInfo { + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSourceCodeInfo } as SourceCodeInfo; @@ -4171,6 +4140,7 @@ export const SourceCodeInfo = { } return message; }, + fromJSON(object: any): SourceCodeInfo { const message = { ...baseSourceCodeInfo } as SourceCodeInfo; message.location = []; @@ -4181,6 +4151,7 @@ export const SourceCodeInfo = { } return message; }, + fromPartial(object: DeepPartial): SourceCodeInfo { const message = { ...baseSourceCodeInfo } as SourceCodeInfo; message.location = []; @@ -4191,6 +4162,7 @@ export const SourceCodeInfo = { } return message; }, + toJSON(message: SourceCodeInfo): unknown { const obj: any = {}; if (message.location) { @@ -4202,6 +4174,14 @@ export const SourceCodeInfo = { }, }; +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leadingComments: "", + trailingComments: "", + leadingDetachedComments: "", +}; + export const SourceCodeInfo_Location = { encode(message: SourceCodeInfo_Location, writer: Writer = Writer.create()): Writer { writer.uint32(10).fork(); @@ -4221,7 +4201,8 @@ export const SourceCodeInfo_Location = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SourceCodeInfo_Location { + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; @@ -4267,6 +4248,7 @@ export const SourceCodeInfo_Location = { } return message; }, + fromJSON(object: any): SourceCodeInfo_Location { const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; message.path = []; @@ -4299,6 +4281,7 @@ export const SourceCodeInfo_Location = { } return message; }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; message.path = []; @@ -4331,6 +4314,7 @@ export const SourceCodeInfo_Location = { } return message; }, + toJSON(message: SourceCodeInfo_Location): unknown { const obj: any = {}; if (message.path) { @@ -4354,6 +4338,8 @@ export const SourceCodeInfo_Location = { }, }; +const baseGeneratedCodeInfo: object = {}; + export const GeneratedCodeInfo = { encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { for (const v of message.annotation) { @@ -4361,7 +4347,8 @@ export const GeneratedCodeInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): GeneratedCodeInfo { + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; @@ -4379,6 +4366,7 @@ export const GeneratedCodeInfo = { } return message; }, + fromJSON(object: any): GeneratedCodeInfo { const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; message.annotation = []; @@ -4389,6 +4377,7 @@ export const GeneratedCodeInfo = { } return message; }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; message.annotation = []; @@ -4399,6 +4388,7 @@ export const GeneratedCodeInfo = { } return message; }, + toJSON(message: GeneratedCodeInfo): unknown { const obj: any = {}; if (message.annotation) { @@ -4412,6 +4402,8 @@ export const GeneratedCodeInfo = { }, }; +const baseGeneratedCodeInfo_Annotation: object = { path: 0, sourceFile: "", begin: 0, end: 0 }; + export const GeneratedCodeInfo_Annotation = { encode(message: GeneratedCodeInfo_Annotation, writer: Writer = Writer.create()): Writer { writer.uint32(10).fork(); @@ -4424,7 +4416,8 @@ export const GeneratedCodeInfo_Annotation = { writer.uint32(32).int32(message.end); return writer; }, - decode(input: Uint8Array | Reader, length?: number): GeneratedCodeInfo_Annotation { + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; @@ -4458,6 +4451,7 @@ export const GeneratedCodeInfo_Annotation = { } return message; }, + fromJSON(object: any): GeneratedCodeInfo_Annotation { const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; message.path = []; @@ -4483,6 +4477,7 @@ export const GeneratedCodeInfo_Annotation = { } return message; }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; message.path = []; @@ -4508,6 +4503,7 @@ export const GeneratedCodeInfo_Annotation = { } return message; }, + toJSON(message: GeneratedCodeInfo_Annotation): unknown { const obj: any = {}; if (message.path) { @@ -4522,15 +4518,18 @@ export const GeneratedCodeInfo_Annotation = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -4540,6 +4539,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -4547,7 +4548,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/google/protobuf/duration.ts b/packages/stargate/src/codec/google/protobuf/duration.ts index 4d558132..c006fe2a 100644 --- a/packages/stargate/src/codec/google/protobuf/duration.ts +++ b/packages/stargate/src/codec/google/protobuf/duration.ts @@ -2,92 +2,87 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "google.protobuf"; + /** - * 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. + * 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 + * # Examples * - * Example 1: Compute Duration from two Timestamps in pseudo code. + * Example 1: Compute Duration from two Timestamps in pseudo code. * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; + * 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; - * } + * 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. + * 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". + * 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 + * 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. + * 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; } -const baseDuration: object = { - seconds: Long.ZERO, - nanos: 0, -}; - -export const protobufPackage = "google.protobuf"; +const baseDuration: object = { seconds: Long.ZERO, nanos: 0 }; export const Duration = { encode(message: Duration, writer: Writer = Writer.create()): Writer { @@ -95,7 +90,8 @@ export const Duration = { writer.uint32(16).int32(message.nanos); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Duration { + + decode(input: Reader | Uint8Array, length?: number): Duration { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDuration } as Duration; @@ -115,6 +111,7 @@ export const Duration = { } return message; }, + fromJSON(object: any): Duration { const message = { ...baseDuration } as Duration; if (object.seconds !== undefined && object.seconds !== null) { @@ -129,6 +126,7 @@ export const Duration = { } return message; }, + fromPartial(object: DeepPartial): Duration { const message = { ...baseDuration } as Duration; if (object.seconds !== undefined && object.seconds !== null) { @@ -143,6 +141,7 @@ export const Duration = { } return message; }, + toJSON(message: Duration): unknown { const obj: any = {}; message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); @@ -151,7 +150,7 @@ export const Duration = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/google/protobuf/timestamp.ts b/packages/stargate/src/codec/google/protobuf/timestamp.ts index 37c5f345..9368ddde 100644 --- a/packages/stargate/src/codec/google/protobuf/timestamp.ts +++ b/packages/stargate/src/codec/google/protobuf/timestamp.ts @@ -2,114 +2,118 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "google.protobuf"; + /** - * 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. + * 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). + * 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. + * 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 + * # Examples * - * Example 1: Compute Timestamp from POSIX `time()`. + * Example 1: Compute Timestamp from POSIX `time()`. * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. * - * struct timeval tv; - * gettimeofday(&tv, NULL); + * struct timeval tv; + * gettimeofday(&tv, NULL); * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * 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)); + * // 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()`. + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. * - * long millis = System.currentTimeMillis(); + * long millis = System.currentTimeMillis(); * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() + * Instant now = Instant.now(); * - * # 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. + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); * * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://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. + * 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. + * 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; } -const baseTimestamp: object = { - seconds: Long.ZERO, - nanos: 0, -}; - -export const protobufPackage = "google.protobuf"; +const baseTimestamp: object = { seconds: Long.ZERO, nanos: 0 }; export const Timestamp = { encode(message: Timestamp, writer: Writer = Writer.create()): Writer { @@ -117,7 +121,8 @@ export const Timestamp = { writer.uint32(16).int32(message.nanos); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Timestamp { + + decode(input: Reader | Uint8Array, length?: number): Timestamp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTimestamp } as Timestamp; @@ -137,6 +142,7 @@ export const Timestamp = { } return message; }, + fromJSON(object: any): Timestamp { const message = { ...baseTimestamp } as Timestamp; if (object.seconds !== undefined && object.seconds !== null) { @@ -151,6 +157,7 @@ export const Timestamp = { } return message; }, + fromPartial(object: DeepPartial): Timestamp { const message = { ...baseTimestamp } as Timestamp; if (object.seconds !== undefined && object.seconds !== null) { @@ -165,6 +172,7 @@ export const Timestamp = { } return message; }, + toJSON(message: Timestamp): unknown { const obj: any = {}; message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); @@ -173,7 +181,7 @@ export const Timestamp = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts b/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts index 532d8432..708b939c 100644 --- a/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts +++ b/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts @@ -3,223 +3,27 @@ import * as Long from "long"; import { Height } from "../../../../ibc/core/client/v1/client"; import { Writer, Reader } from "protobufjs/minimal"; -/** - * 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; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * 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/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope - */ -export interface Acknowledgement { - result: Uint8Array | undefined; - error: string | undefined; -} - -const baseChannel: object = { - state: 0, - ordering: 0, - connectionHops: "", - version: "", -}; - -const baseIdentifiedChannel: object = { - state: 0, - ordering: 0, - connectionHops: "", - version: "", - portId: "", - channelId: "", -}; - -const baseCounterparty: object = { - portId: "", - channelId: "", -}; - -const basePacket: object = { - sequence: Long.UZERO, - sourcePort: "", - sourceChannel: "", - destinationPort: "", - destinationChannel: "", - timeoutTimestamp: Long.UZERO, -}; - -const basePacketState: object = { - portId: "", - channelId: "", - sequence: Long.UZERO, -}; - -const baseAcknowledgement: object = {}; - export const protobufPackage = "ibc.core.channel.v1"; -/** State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +/** + * 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 - Default State */ STATE_UNINITIALIZED_UNSPECIFIED = 0, - /** STATE_INIT - A channel has just started the opening handshake. - */ + /** 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 - 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 - 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 - A channel has been closed and can no longer be used to send or receive + * packets. */ STATE_CLOSED = 4, UNRECOGNIZED = -1, @@ -266,18 +70,16 @@ export function stateToJSON(object: State): string { } } -/** Order defines if a channel is ORDERED or UNORDERED - */ +/** Order defines if a channel is ORDERED or UNORDERED */ export enum Order { - /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering - */ + /** 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 - 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 - packets are delivered exactly in the order which they were sent */ ORDER_ORDERED = 2, UNRECOGNIZED = -1, } @@ -313,6 +115,116 @@ export function orderToJSON(object: Order): string { } } +/** + * 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; +} + +/** + * 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; +} + +/** 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; +} + +/** 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; +} + +/** + * 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; +} + +/** + * 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/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result: Uint8Array | undefined; + error: string | undefined; +} + +const baseChannel: object = { state: 0, ordering: 0, connectionHops: "", version: "" }; + export const Channel = { encode(message: Channel, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.state); @@ -326,7 +238,8 @@ export const Channel = { writer.uint32(42).string(message.version); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Channel { + + decode(input: Reader | Uint8Array, length?: number): Channel { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseChannel } as Channel; @@ -356,6 +269,7 @@ export const Channel = { } return message; }, + fromJSON(object: any): Channel { const message = { ...baseChannel } as Channel; message.connectionHops = []; @@ -386,6 +300,7 @@ export const Channel = { } return message; }, + fromPartial(object: DeepPartial): Channel { const message = { ...baseChannel } as Channel; message.connectionHops = []; @@ -416,6 +331,7 @@ export const Channel = { } return message; }, + toJSON(message: Channel): unknown { const obj: any = {}; message.state !== undefined && (obj.state = stateToJSON(message.state)); @@ -432,6 +348,15 @@ export const Channel = { }, }; +const baseIdentifiedChannel: object = { + state: 0, + ordering: 0, + connectionHops: "", + version: "", + portId: "", + channelId: "", +}; + export const IdentifiedChannel = { encode(message: IdentifiedChannel, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.state); @@ -447,7 +372,8 @@ export const IdentifiedChannel = { writer.uint32(58).string(message.channelId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): IdentifiedChannel { + + decode(input: Reader | Uint8Array, length?: number): IdentifiedChannel { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseIdentifiedChannel } as IdentifiedChannel; @@ -483,6 +409,7 @@ export const IdentifiedChannel = { } return message; }, + fromJSON(object: any): IdentifiedChannel { const message = { ...baseIdentifiedChannel } as IdentifiedChannel; message.connectionHops = []; @@ -523,6 +450,7 @@ export const IdentifiedChannel = { } return message; }, + fromPartial(object: DeepPartial): IdentifiedChannel { const message = { ...baseIdentifiedChannel } as IdentifiedChannel; message.connectionHops = []; @@ -563,6 +491,7 @@ export const IdentifiedChannel = { } return message; }, + toJSON(message: IdentifiedChannel): unknown { const obj: any = {}; message.state !== undefined && (obj.state = stateToJSON(message.state)); @@ -581,13 +510,16 @@ export const IdentifiedChannel = { }, }; +const baseCounterparty: object = { portId: "", channelId: "" }; + export const Counterparty = { encode(message: Counterparty, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); writer.uint32(18).string(message.channelId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Counterparty { + + decode(input: Reader | Uint8Array, length?: number): Counterparty { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCounterparty } as Counterparty; @@ -607,6 +539,7 @@ export const Counterparty = { } return message; }, + fromJSON(object: any): Counterparty { const message = { ...baseCounterparty } as Counterparty; if (object.portId !== undefined && object.portId !== null) { @@ -621,6 +554,7 @@ export const Counterparty = { } return message; }, + fromPartial(object: DeepPartial): Counterparty { const message = { ...baseCounterparty } as Counterparty; if (object.portId !== undefined && object.portId !== null) { @@ -635,6 +569,7 @@ export const Counterparty = { } return message; }, + toJSON(message: Counterparty): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -643,6 +578,15 @@ export const Counterparty = { }, }; +const basePacket: object = { + sequence: Long.UZERO, + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + timeoutTimestamp: Long.UZERO, +}; + export const Packet = { encode(message: Packet, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.sequence); @@ -657,7 +601,8 @@ export const Packet = { writer.uint32(64).uint64(message.timeoutTimestamp); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Packet { + + decode(input: Reader | Uint8Array, length?: number): Packet { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePacket } as Packet; @@ -695,6 +640,7 @@ export const Packet = { } return message; }, + fromJSON(object: any): Packet { const message = { ...basePacket } as Packet; if (object.sequence !== undefined && object.sequence !== null) { @@ -737,6 +683,7 @@ export const Packet = { } return message; }, + fromPartial(object: DeepPartial): Packet { const message = { ...basePacket } as Packet; if (object.sequence !== undefined && object.sequence !== null) { @@ -781,6 +728,7 @@ export const Packet = { } return message; }, + toJSON(message: Packet): unknown { const obj: any = {}; message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); @@ -798,6 +746,8 @@ export const Packet = { }, }; +const basePacketState: object = { portId: "", channelId: "", sequence: Long.UZERO }; + export const PacketState = { encode(message: PacketState, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -806,7 +756,8 @@ export const PacketState = { writer.uint32(34).bytes(message.data); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PacketState { + + decode(input: Reader | Uint8Array, length?: number): PacketState { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePacketState } as PacketState; @@ -832,6 +783,7 @@ export const PacketState = { } return message; }, + fromJSON(object: any): PacketState { const message = { ...basePacketState } as PacketState; if (object.portId !== undefined && object.portId !== null) { @@ -854,6 +806,7 @@ export const PacketState = { } return message; }, + fromPartial(object: DeepPartial): PacketState { const message = { ...basePacketState } as PacketState; if (object.portId !== undefined && object.portId !== null) { @@ -878,6 +831,7 @@ export const PacketState = { } return message; }, + toJSON(message: PacketState): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -889,6 +843,8 @@ export const PacketState = { }, }; +const baseAcknowledgement: object = {}; + export const Acknowledgement = { encode(message: Acknowledgement, writer: Writer = Writer.create()): Writer { if (message.result !== undefined) { @@ -899,7 +855,8 @@ export const Acknowledgement = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Acknowledgement { + + decode(input: Reader | Uint8Array, length?: number): Acknowledgement { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAcknowledgement } as Acknowledgement; @@ -919,6 +876,7 @@ export const Acknowledgement = { } return message; }, + fromJSON(object: any): Acknowledgement { const message = { ...baseAcknowledgement } as Acknowledgement; if (object.result !== undefined && object.result !== null) { @@ -931,6 +889,7 @@ export const Acknowledgement = { } return message; }, + fromPartial(object: DeepPartial): Acknowledgement { const message = { ...baseAcknowledgement } as Acknowledgement; if (object.result !== undefined && object.result !== null) { @@ -945,6 +904,7 @@ export const Acknowledgement = { } return message; }, + toJSON(message: Acknowledgement): unknown { const obj: any = {}; message.result !== undefined && @@ -954,15 +914,18 @@ export const Acknowledgement = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -972,6 +935,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -979,7 +944,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/channel/v1/query.ts b/packages/stargate/src/codec/ibc/core/channel/v1/query.ts index 4e37d4cf..ec9d7b1f 100644 --- a/packages/stargate/src/codec/ibc/core/channel/v1/query.ts +++ b/packages/stargate/src/codec/ibc/core/channel/v1/query.ts @@ -6,755 +6,328 @@ import * as Long from "long"; import { Any } from "../../../../google/protobuf/any"; import { Reader, Writer } from "protobufjs/minimal"; -/** - * QueryChannelRequest is the request type for the Query/Channel RPC method - */ +export const protobufPackage = "ibc.core.channel.v1"; + +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; } /** - * QueryChannelResponse is the response type for the Query/Channel RPC method. - * Besides the Channel end, it includes a proof and the height from which the - * proof was retrieved. + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. */ export interface QueryChannelResponse { - /** - * channel associated with the request identifiers - */ + /** channel associated with the request identifiers */ channel?: Channel; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } -/** - * QueryChannelsRequest is the request type for the Query/Channels RPC method - */ +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequest { - /** - * pagination request - */ + /** pagination request */ pagination?: PageRequest; } -/** - * QueryChannelsResponse is the response type for the Query/Channels RPC method. - */ +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponse { - /** - * list of stored channels of the chain. - */ + /** list of stored channels of the chain. */ channels: IdentifiedChannel[]; - /** - * pagination response - */ + /** pagination response */ pagination?: PageResponse; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryConnectionChannelsRequest is the request type for the - * Query/QueryConnectionChannels RPC method + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method */ export interface QueryConnectionChannelsRequest { - /** - * connection unique identifier - */ + /** connection unique identifier */ connection: string; - /** - * pagination request - */ + /** pagination request */ pagination?: PageRequest; } /** - * QueryConnectionChannelsResponse is the Response type for the - * Query/QueryConnectionChannels RPC method + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method */ export interface QueryConnectionChannelsResponse { - /** - * list of channels associated with a connection. - */ + /** list of channels associated with a connection. */ channels: IdentifiedChannel[]; - /** - * pagination response - */ + /** pagination response */ pagination?: PageResponse; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryChannelClientStateRequest is the request type for the Query/ClientState - * RPC method + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method */ export interface QueryChannelClientStateRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; } /** - * QueryChannelClientStateResponse is the Response type for the - * Query/QueryChannelClientState RPC method + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method */ export interface QueryChannelClientStateResponse { - /** - * client state associated with the channel - */ + /** client state associated with the channel */ identifiedClientState?: IdentifiedClientState; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryChannelConsensusStateRequest is the request type for the - * Query/ConsensusState RPC method + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method */ export interface QueryChannelConsensusStateRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * revision number of the consensus state - */ + /** revision number of the consensus state */ revisionNumber: Long; - /** - * revision height of the consensus state - */ + /** revision height of the consensus state */ revisionHeight: Long; } /** - * QueryChannelClientStateResponse is the Response type for the - * Query/QueryChannelClientState RPC method + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method */ export interface QueryChannelConsensusStateResponse { - /** - * consensus state associated with the channel - */ + /** consensus state associated with the channel */ consensusState?: Any; - /** - * client ID associated with the consensus state - */ + /** client ID associated with the consensus state */ clientId: string; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryPacketCommitmentRequest is the request type for the - * Query/PacketCommitment RPC method + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method */ export interface QueryPacketCommitmentRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * packet sequence - */ + /** packet sequence */ sequence: Long; } /** - * QueryPacketCommitmentResponse defines the client query response for a packet - * which also includes a proof and the height from which the proof was - * retrieved + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved */ export interface QueryPacketCommitmentResponse { - /** - * packet associated with the request fields - */ + /** packet associated with the request fields */ commitment: Uint8Array; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryPacketCommitmentsRequest is the request type for the - * Query/QueryPacketCommitments RPC method + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method */ export interface QueryPacketCommitmentsRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * pagination request - */ + /** pagination request */ pagination?: PageRequest; } /** - * QueryPacketCommitmentsResponse is the request type for the - * Query/QueryPacketCommitments RPC method + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method */ export interface QueryPacketCommitmentsResponse { commitments: PacketState[]; - /** - * pagination response - */ + /** pagination response */ pagination?: PageResponse; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryPacketReceiptRequest is the request type for the - * Query/PacketReceipt RPC method + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method */ export interface QueryPacketReceiptRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * packet sequence - */ + /** packet sequence */ sequence: Long; } /** - * QueryPacketReceiptResponse defines the client query response for a packet receipt - * which also includes a proof, and the height from which the proof was - * retrieved + * QueryPacketReceiptResponse defines the client query response for a packet receipt + * which also includes a proof, and the height from which the proof was + * retrieved */ export interface QueryPacketReceiptResponse { - /** - * success flag for if receipt exists - */ + /** success flag for if receipt exists */ received: boolean; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryPacketAcknowledgementRequest is the request type for the - * Query/PacketAcknowledgement RPC method + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method */ export interface QueryPacketAcknowledgementRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * packet sequence - */ + /** packet sequence */ sequence: Long; } /** - * QueryPacketAcknowledgementResponse defines the client query response for a - * packet which also includes a proof and the height from which the - * proof was retrieved + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved */ export interface QueryPacketAcknowledgementResponse { - /** - * packet associated with the request fields - */ + /** packet associated with the request fields */ acknowledgement: Uint8Array; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryPacketAcknowledgementsRequest is the request type for the - * Query/QueryPacketCommitments RPC method + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method */ export interface QueryPacketAcknowledgementsRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * pagination request - */ + /** pagination request */ pagination?: PageRequest; } /** - * QueryPacketAcknowledgemetsResponse is the request type for the - * Query/QueryPacketAcknowledgements RPC method + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method */ export interface QueryPacketAcknowledgementsResponse { acknowledgements: PacketState[]; - /** - * pagination response - */ + /** pagination response */ pagination?: PageResponse; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryUnreceivedPacketsRequest is the request type for the - * Query/UnreceivedPackets RPC method + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method */ export interface QueryUnreceivedPacketsRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * list of packet sequences - */ + /** list of packet sequences */ packetCommitmentSequences: Long[]; } /** - * QueryUnreceivedPacketsResponse is the response type for the - * Query/UnreceivedPacketCommitments RPC method + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method */ export interface QueryUnreceivedPacketsResponse { - /** - * list of unreceived packet sequences - */ + /** list of unreceived packet sequences */ sequences: Long[]; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryUnreceivedAcks is the request type for the - * Query/UnreceivedAcks RPC method + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method */ export interface QueryUnreceivedAcksRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; - /** - * list of acknowledgement sequences - */ + /** list of acknowledgement sequences */ packetAckSequences: Long[]; } /** - * QueryUnreceivedAcksResponse is the response type for the - * Query/UnreceivedAcks RPC method + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method */ export interface QueryUnreceivedAcksResponse { - /** - * list of unreceived acknowledgement sequences - */ + /** list of unreceived acknowledgement sequences */ sequences: Long[]; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryNextSequenceReceiveRequest is the request type for the - * Query/QueryNextSequenceReceiveRequest RPC method + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method */ export interface QueryNextSequenceReceiveRequest { - /** - * port unique identifier - */ + /** port unique identifier */ portId: string; - /** - * channel unique identifier - */ + /** channel unique identifier */ channelId: string; } /** - * QuerySequenceResponse is the request type for the - * Query/QueryNextSequenceReceiveResponse RPC method + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponse { - /** - * next sequence receive number - */ + /** next sequence receive number */ nextSequenceReceive: Long; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } -const baseQueryChannelRequest: object = { - portId: "", - channelId: "", -}; - -const baseQueryChannelResponse: object = {}; - -const baseQueryChannelsRequest: object = {}; - -const baseQueryChannelsResponse: object = {}; - -const baseQueryConnectionChannelsRequest: object = { - connection: "", -}; - -const baseQueryConnectionChannelsResponse: object = {}; - -const baseQueryChannelClientStateRequest: object = { - portId: "", - channelId: "", -}; - -const baseQueryChannelClientStateResponse: object = {}; - -const baseQueryChannelConsensusStateRequest: object = { - portId: "", - channelId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, -}; - -const baseQueryChannelConsensusStateResponse: object = { - clientId: "", -}; - -const baseQueryPacketCommitmentRequest: object = { - portId: "", - channelId: "", - sequence: Long.UZERO, -}; - -const baseQueryPacketCommitmentResponse: object = {}; - -const baseQueryPacketCommitmentsRequest: object = { - portId: "", - channelId: "", -}; - -const baseQueryPacketCommitmentsResponse: object = {}; - -const baseQueryPacketReceiptRequest: object = { - portId: "", - channelId: "", - sequence: Long.UZERO, -}; - -const baseQueryPacketReceiptResponse: object = { - received: false, -}; - -const baseQueryPacketAcknowledgementRequest: object = { - portId: "", - channelId: "", - sequence: Long.UZERO, -}; - -const baseQueryPacketAcknowledgementResponse: object = {}; - -const baseQueryPacketAcknowledgementsRequest: object = { - portId: "", - channelId: "", -}; - -const baseQueryPacketAcknowledgementsResponse: object = {}; - -const baseQueryUnreceivedPacketsRequest: object = { - portId: "", - channelId: "", - packetCommitmentSequences: Long.UZERO, -}; - -const baseQueryUnreceivedPacketsResponse: object = { - sequences: Long.UZERO, -}; - -const baseQueryUnreceivedAcksRequest: object = { - portId: "", - channelId: "", - packetAckSequences: Long.UZERO, -}; - -const baseQueryUnreceivedAcksResponse: object = { - sequences: Long.UZERO, -}; - -const baseQueryNextSequenceReceiveRequest: object = { - portId: "", - channelId: "", -}; - -const baseQueryNextSequenceReceiveResponse: object = { - nextSequenceReceive: Long.UZERO, -}; - -/** - * Query provides defines the gRPC querier service - */ -export interface Query { - /** - * Channel queries an IBC Channel. - */ - Channel(request: QueryChannelRequest): Promise; - - /** - * Channels queries all the IBC channels of a chain. - */ - Channels(request: QueryChannelsRequest): Promise; - - /** - * ConnectionChannels queries all the channels associated with a connection - * end. - */ - ConnectionChannels(request: QueryConnectionChannelsRequest): Promise; - - /** - * ChannelClientState queries for the client state for the channel associated - * with the provided channel identifiers. - */ - ChannelClientState(request: QueryChannelClientStateRequest): Promise; - - /** - * ChannelConsensusState queries for the consensus state for the channel - * associated with the provided channel identifiers. - */ - ChannelConsensusState( - request: QueryChannelConsensusStateRequest, - ): Promise; - - /** - * PacketCommitment queries a stored packet commitment hash. - */ - PacketCommitment(request: QueryPacketCommitmentRequest): Promise; - - /** - * PacketCommitments returns all the packet commitments hashes associated - * with a channel. - */ - PacketCommitments(request: QueryPacketCommitmentsRequest): Promise; - - /** - * PacketReceipt queries if a given packet sequence has been received on the queried chain - */ - PacketReceipt(request: QueryPacketReceiptRequest): Promise; - - /** - * PacketAcknowledgement queries a stored packet acknowledgement hash. - */ - PacketAcknowledgement( - request: QueryPacketAcknowledgementRequest, - ): Promise; - - /** - * PacketAcknowledgements returns all the packet acknowledgements associated - * with a channel. - */ - PacketAcknowledgements( - request: QueryPacketAcknowledgementsRequest, - ): Promise; - - /** - * UnreceivedPackets returns all the unreceived IBC packets associated with a - * channel and sequences. - */ - UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; - - /** - * UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a - * channel and sequences. - */ - UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; - - /** - * NextSequenceReceive returns the next receive sequence for a given channel. - */ - NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Channel(request: QueryChannelRequest): Promise { - const data = QueryChannelRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channel", data); - return promise.then((data) => QueryChannelResponse.decode(new Reader(data))); - } - - Channels(request: QueryChannelsRequest): Promise { - const data = QueryChannelsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channels", data); - return promise.then((data) => QueryChannelsResponse.decode(new Reader(data))); - } - - ConnectionChannels(request: QueryConnectionChannelsRequest): Promise { - const data = QueryConnectionChannelsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "ConnectionChannels", data); - return promise.then((data) => QueryConnectionChannelsResponse.decode(new Reader(data))); - } - - ChannelClientState(request: QueryChannelClientStateRequest): Promise { - const data = QueryChannelClientStateRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelClientState", data); - return promise.then((data) => QueryChannelClientStateResponse.decode(new Reader(data))); - } - - ChannelConsensusState( - request: QueryChannelConsensusStateRequest, - ): Promise { - const data = QueryChannelConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelConsensusState", data); - return promise.then((data) => QueryChannelConsensusStateResponse.decode(new Reader(data))); - } - - PacketCommitment(request: QueryPacketCommitmentRequest): Promise { - const data = QueryPacketCommitmentRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitment", data); - return promise.then((data) => QueryPacketCommitmentResponse.decode(new Reader(data))); - } - - PacketCommitments(request: QueryPacketCommitmentsRequest): Promise { - const data = QueryPacketCommitmentsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitments", data); - return promise.then((data) => QueryPacketCommitmentsResponse.decode(new Reader(data))); - } - - PacketReceipt(request: QueryPacketReceiptRequest): Promise { - const data = QueryPacketReceiptRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketReceipt", data); - return promise.then((data) => QueryPacketReceiptResponse.decode(new Reader(data))); - } - - PacketAcknowledgement( - request: QueryPacketAcknowledgementRequest, - ): Promise { - const data = QueryPacketAcknowledgementRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgement", data); - return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new Reader(data))); - } - - PacketAcknowledgements( - request: QueryPacketAcknowledgementsRequest, - ): Promise { - const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgements", data); - return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new Reader(data))); - } - - UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { - const data = QueryUnreceivedPacketsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedPackets", data); - return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new Reader(data))); - } - - UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { - const data = QueryUnreceivedAcksRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedAcks", data); - return promise.then((data) => QueryUnreceivedAcksResponse.decode(new Reader(data))); - } - - NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { - const data = QueryNextSequenceReceiveRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); - return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -export const protobufPackage = "ibc.core.channel.v1"; +const baseQueryChannelRequest: object = { portId: "", channelId: "" }; export const QueryChannelRequest = { encode(message: QueryChannelRequest, writer: Writer = Writer.create()): Writer { @@ -762,7 +335,8 @@ export const QueryChannelRequest = { writer.uint32(18).string(message.channelId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelRequest } as QueryChannelRequest; @@ -782,6 +356,7 @@ export const QueryChannelRequest = { } return message; }, + fromJSON(object: any): QueryChannelRequest { const message = { ...baseQueryChannelRequest } as QueryChannelRequest; if (object.portId !== undefined && object.portId !== null) { @@ -796,6 +371,7 @@ export const QueryChannelRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelRequest { const message = { ...baseQueryChannelRequest } as QueryChannelRequest; if (object.portId !== undefined && object.portId !== null) { @@ -810,6 +386,7 @@ export const QueryChannelRequest = { } return message; }, + toJSON(message: QueryChannelRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -818,6 +395,8 @@ export const QueryChannelRequest = { }, }; +const baseQueryChannelResponse: object = {}; + export const QueryChannelResponse = { encode(message: QueryChannelResponse, writer: Writer = Writer.create()): Writer { if (message.channel !== undefined && message.channel !== undefined) { @@ -829,7 +408,8 @@ export const QueryChannelResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelResponse } as QueryChannelResponse; @@ -852,6 +432,7 @@ export const QueryChannelResponse = { } return message; }, + fromJSON(object: any): QueryChannelResponse { const message = { ...baseQueryChannelResponse } as QueryChannelResponse; if (object.channel !== undefined && object.channel !== null) { @@ -869,6 +450,7 @@ export const QueryChannelResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelResponse { const message = { ...baseQueryChannelResponse } as QueryChannelResponse; if (object.channel !== undefined && object.channel !== null) { @@ -888,6 +470,7 @@ export const QueryChannelResponse = { } return message; }, + toJSON(message: QueryChannelResponse): unknown { const obj: any = {}; message.channel !== undefined && @@ -900,6 +483,8 @@ export const QueryChannelResponse = { }, }; +const baseQueryChannelsRequest: object = {}; + export const QueryChannelsRequest = { encode(message: QueryChannelsRequest, writer: Writer = Writer.create()): Writer { if (message.pagination !== undefined && message.pagination !== undefined) { @@ -907,7 +492,8 @@ export const QueryChannelsRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; @@ -924,6 +510,7 @@ export const QueryChannelsRequest = { } return message; }, + fromJSON(object: any): QueryChannelsRequest { const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; if (object.pagination !== undefined && object.pagination !== null) { @@ -933,6 +520,7 @@ export const QueryChannelsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelsRequest { const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; if (object.pagination !== undefined && object.pagination !== null) { @@ -942,6 +530,7 @@ export const QueryChannelsRequest = { } return message; }, + toJSON(message: QueryChannelsRequest): unknown { const obj: any = {}; message.pagination !== undefined && @@ -950,6 +539,8 @@ export const QueryChannelsRequest = { }, }; +const baseQueryChannelsResponse: object = {}; + export const QueryChannelsResponse = { encode(message: QueryChannelsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.channels) { @@ -963,7 +554,8 @@ export const QueryChannelsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; @@ -987,6 +579,7 @@ export const QueryChannelsResponse = { } return message; }, + fromJSON(object: any): QueryChannelsResponse { const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; message.channels = []; @@ -1007,6 +600,7 @@ export const QueryChannelsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelsResponse { const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; message.channels = []; @@ -1027,6 +621,7 @@ export const QueryChannelsResponse = { } return message; }, + toJSON(message: QueryChannelsResponse): unknown { const obj: any = {}; if (message.channels) { @@ -1041,6 +636,8 @@ export const QueryChannelsResponse = { }, }; +const baseQueryConnectionChannelsRequest: object = { connection: "" }; + export const QueryConnectionChannelsRequest = { encode(message: QueryConnectionChannelsRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.connection); @@ -1049,7 +646,8 @@ export const QueryConnectionChannelsRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionChannelsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionChannelsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; @@ -1069,6 +667,7 @@ export const QueryConnectionChannelsRequest = { } return message; }, + fromJSON(object: any): QueryConnectionChannelsRequest { const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; if (object.connection !== undefined && object.connection !== null) { @@ -1083,6 +682,7 @@ export const QueryConnectionChannelsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionChannelsRequest { const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; if (object.connection !== undefined && object.connection !== null) { @@ -1097,6 +697,7 @@ export const QueryConnectionChannelsRequest = { } return message; }, + toJSON(message: QueryConnectionChannelsRequest): unknown { const obj: any = {}; message.connection !== undefined && (obj.connection = message.connection); @@ -1106,6 +707,8 @@ export const QueryConnectionChannelsRequest = { }, }; +const baseQueryConnectionChannelsResponse: object = {}; + export const QueryConnectionChannelsResponse = { encode(message: QueryConnectionChannelsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.channels) { @@ -1119,7 +722,8 @@ export const QueryConnectionChannelsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionChannelsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionChannelsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; @@ -1143,6 +747,7 @@ export const QueryConnectionChannelsResponse = { } return message; }, + fromJSON(object: any): QueryConnectionChannelsResponse { const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; message.channels = []; @@ -1163,6 +768,7 @@ export const QueryConnectionChannelsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionChannelsResponse { const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; message.channels = []; @@ -1183,6 +789,7 @@ export const QueryConnectionChannelsResponse = { } return message; }, + toJSON(message: QueryConnectionChannelsResponse): unknown { const obj: any = {}; if (message.channels) { @@ -1197,13 +804,16 @@ export const QueryConnectionChannelsResponse = { }, }; +const baseQueryChannelClientStateRequest: object = { portId: "", channelId: "" }; + export const QueryChannelClientStateRequest = { encode(message: QueryChannelClientStateRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); writer.uint32(18).string(message.channelId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelClientStateRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelClientStateRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; @@ -1223,6 +833,7 @@ export const QueryChannelClientStateRequest = { } return message; }, + fromJSON(object: any): QueryChannelClientStateRequest { const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1237,6 +848,7 @@ export const QueryChannelClientStateRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelClientStateRequest { const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1251,6 +863,7 @@ export const QueryChannelClientStateRequest = { } return message; }, + toJSON(message: QueryChannelClientStateRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -1259,6 +872,8 @@ export const QueryChannelClientStateRequest = { }, }; +const baseQueryChannelClientStateResponse: object = {}; + export const QueryChannelClientStateResponse = { encode(message: QueryChannelClientStateResponse, writer: Writer = Writer.create()): Writer { if (message.identifiedClientState !== undefined && message.identifiedClientState !== undefined) { @@ -1270,7 +885,8 @@ export const QueryChannelClientStateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelClientStateResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelClientStateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; @@ -1293,6 +909,7 @@ export const QueryChannelClientStateResponse = { } return message; }, + fromJSON(object: any): QueryChannelClientStateResponse { const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { @@ -1310,6 +927,7 @@ export const QueryChannelClientStateResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelClientStateResponse { const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { @@ -1329,6 +947,7 @@ export const QueryChannelClientStateResponse = { } return message; }, + toJSON(message: QueryChannelClientStateResponse): unknown { const obj: any = {}; message.identifiedClientState !== undefined && @@ -1343,6 +962,13 @@ export const QueryChannelClientStateResponse = { }, }; +const baseQueryChannelConsensusStateRequest: object = { + portId: "", + channelId: "", + revisionNumber: Long.UZERO, + revisionHeight: Long.UZERO, +}; + export const QueryChannelConsensusStateRequest = { encode(message: QueryChannelConsensusStateRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -1351,7 +977,8 @@ export const QueryChannelConsensusStateRequest = { writer.uint32(32).uint64(message.revisionHeight); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelConsensusStateRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; @@ -1377,6 +1004,7 @@ export const QueryChannelConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryChannelConsensusStateRequest { const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1401,6 +1029,7 @@ export const QueryChannelConsensusStateRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelConsensusStateRequest { const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1425,6 +1054,7 @@ export const QueryChannelConsensusStateRequest = { } return message; }, + toJSON(message: QueryChannelConsensusStateRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -1437,6 +1067,8 @@ export const QueryChannelConsensusStateRequest = { }, }; +const baseQueryChannelConsensusStateResponse: object = { clientId: "" }; + export const QueryChannelConsensusStateResponse = { encode(message: QueryChannelConsensusStateResponse, writer: Writer = Writer.create()): Writer { if (message.consensusState !== undefined && message.consensusState !== undefined) { @@ -1449,7 +1081,8 @@ export const QueryChannelConsensusStateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryChannelConsensusStateResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; @@ -1475,6 +1108,7 @@ export const QueryChannelConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryChannelConsensusStateResponse { const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; if (object.consensusState !== undefined && object.consensusState !== null) { @@ -1497,6 +1131,7 @@ export const QueryChannelConsensusStateResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryChannelConsensusStateResponse { const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; if (object.consensusState !== undefined && object.consensusState !== null) { @@ -1521,6 +1156,7 @@ export const QueryChannelConsensusStateResponse = { } return message; }, + toJSON(message: QueryChannelConsensusStateResponse): unknown { const obj: any = {}; message.consensusState !== undefined && @@ -1534,6 +1170,8 @@ export const QueryChannelConsensusStateResponse = { }, }; +const baseQueryPacketCommitmentRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + export const QueryPacketCommitmentRequest = { encode(message: QueryPacketCommitmentRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -1541,7 +1179,8 @@ export const QueryPacketCommitmentRequest = { writer.uint32(24).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketCommitmentRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketCommitmentRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; @@ -1564,6 +1203,7 @@ export const QueryPacketCommitmentRequest = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentRequest { const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1583,6 +1223,7 @@ export const QueryPacketCommitmentRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketCommitmentRequest { const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1602,6 +1243,7 @@ export const QueryPacketCommitmentRequest = { } return message; }, + toJSON(message: QueryPacketCommitmentRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -1611,6 +1253,8 @@ export const QueryPacketCommitmentRequest = { }, }; +const baseQueryPacketCommitmentResponse: object = {}; + export const QueryPacketCommitmentResponse = { encode(message: QueryPacketCommitmentResponse, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.commitment); @@ -1620,7 +1264,8 @@ export const QueryPacketCommitmentResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketCommitmentResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketCommitmentResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; @@ -1643,6 +1288,7 @@ export const QueryPacketCommitmentResponse = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentResponse { const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; if (object.commitment !== undefined && object.commitment !== null) { @@ -1658,6 +1304,7 @@ export const QueryPacketCommitmentResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketCommitmentResponse { const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; if (object.commitment !== undefined && object.commitment !== null) { @@ -1677,6 +1324,7 @@ export const QueryPacketCommitmentResponse = { } return message; }, + toJSON(message: QueryPacketCommitmentResponse): unknown { const obj: any = {}; message.commitment !== undefined && @@ -1691,6 +1339,8 @@ export const QueryPacketCommitmentResponse = { }, }; +const baseQueryPacketCommitmentsRequest: object = { portId: "", channelId: "" }; + export const QueryPacketCommitmentsRequest = { encode(message: QueryPacketCommitmentsRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -1700,7 +1350,8 @@ export const QueryPacketCommitmentsRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketCommitmentsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; @@ -1723,6 +1374,7 @@ export const QueryPacketCommitmentsRequest = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentsRequest { const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1742,6 +1394,7 @@ export const QueryPacketCommitmentsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketCommitmentsRequest { const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1761,6 +1414,7 @@ export const QueryPacketCommitmentsRequest = { } return message; }, + toJSON(message: QueryPacketCommitmentsRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -1771,6 +1425,8 @@ export const QueryPacketCommitmentsRequest = { }, }; +const baseQueryPacketCommitmentsResponse: object = {}; + export const QueryPacketCommitmentsResponse = { encode(message: QueryPacketCommitmentsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.commitments) { @@ -1784,7 +1440,8 @@ export const QueryPacketCommitmentsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketCommitmentsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; @@ -1808,6 +1465,7 @@ export const QueryPacketCommitmentsResponse = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentsResponse { const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; message.commitments = []; @@ -1828,6 +1486,7 @@ export const QueryPacketCommitmentsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketCommitmentsResponse { const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; message.commitments = []; @@ -1848,6 +1507,7 @@ export const QueryPacketCommitmentsResponse = { } return message; }, + toJSON(message: QueryPacketCommitmentsResponse): unknown { const obj: any = {}; if (message.commitments) { @@ -1862,6 +1522,8 @@ export const QueryPacketCommitmentsResponse = { }, }; +const baseQueryPacketReceiptRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + export const QueryPacketReceiptRequest = { encode(message: QueryPacketReceiptRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -1869,7 +1531,8 @@ export const QueryPacketReceiptRequest = { writer.uint32(24).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketReceiptRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketReceiptRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; @@ -1892,6 +1555,7 @@ export const QueryPacketReceiptRequest = { } return message; }, + fromJSON(object: any): QueryPacketReceiptRequest { const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1911,6 +1575,7 @@ export const QueryPacketReceiptRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketReceiptRequest { const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; if (object.portId !== undefined && object.portId !== null) { @@ -1930,6 +1595,7 @@ export const QueryPacketReceiptRequest = { } return message; }, + toJSON(message: QueryPacketReceiptRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -1939,6 +1605,8 @@ export const QueryPacketReceiptRequest = { }, }; +const baseQueryPacketReceiptResponse: object = { received: false }; + export const QueryPacketReceiptResponse = { encode(message: QueryPacketReceiptResponse, writer: Writer = Writer.create()): Writer { writer.uint32(16).bool(message.received); @@ -1948,7 +1616,8 @@ export const QueryPacketReceiptResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketReceiptResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketReceiptResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; @@ -1971,6 +1640,7 @@ export const QueryPacketReceiptResponse = { } return message; }, + fromJSON(object: any): QueryPacketReceiptResponse { const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; if (object.received !== undefined && object.received !== null) { @@ -1988,6 +1658,7 @@ export const QueryPacketReceiptResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketReceiptResponse { const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; if (object.received !== undefined && object.received !== null) { @@ -2007,6 +1678,7 @@ export const QueryPacketReceiptResponse = { } return message; }, + toJSON(message: QueryPacketReceiptResponse): unknown { const obj: any = {}; message.received !== undefined && (obj.received = message.received); @@ -2018,6 +1690,8 @@ export const QueryPacketReceiptResponse = { }, }; +const baseQueryPacketAcknowledgementRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + export const QueryPacketAcknowledgementRequest = { encode(message: QueryPacketAcknowledgementRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -2025,7 +1699,8 @@ export const QueryPacketAcknowledgementRequest = { writer.uint32(24).uint64(message.sequence); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketAcknowledgementRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; @@ -2048,6 +1723,7 @@ export const QueryPacketAcknowledgementRequest = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementRequest { const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2067,6 +1743,7 @@ export const QueryPacketAcknowledgementRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementRequest { const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2086,6 +1763,7 @@ export const QueryPacketAcknowledgementRequest = { } return message; }, + toJSON(message: QueryPacketAcknowledgementRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -2095,6 +1773,8 @@ export const QueryPacketAcknowledgementRequest = { }, }; +const baseQueryPacketAcknowledgementResponse: object = {}; + export const QueryPacketAcknowledgementResponse = { encode(message: QueryPacketAcknowledgementResponse, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.acknowledgement); @@ -2104,7 +1784,8 @@ export const QueryPacketAcknowledgementResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketAcknowledgementResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; @@ -2127,6 +1808,7 @@ export const QueryPacketAcknowledgementResponse = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementResponse { const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; if (object.acknowledgement !== undefined && object.acknowledgement !== null) { @@ -2142,6 +1824,7 @@ export const QueryPacketAcknowledgementResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementResponse { const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; if (object.acknowledgement !== undefined && object.acknowledgement !== null) { @@ -2161,6 +1844,7 @@ export const QueryPacketAcknowledgementResponse = { } return message; }, + toJSON(message: QueryPacketAcknowledgementResponse): unknown { const obj: any = {}; message.acknowledgement !== undefined && @@ -2175,6 +1859,8 @@ export const QueryPacketAcknowledgementResponse = { }, }; +const baseQueryPacketAcknowledgementsRequest: object = { portId: "", channelId: "" }; + export const QueryPacketAcknowledgementsRequest = { encode(message: QueryPacketAcknowledgementsRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -2184,7 +1870,8 @@ export const QueryPacketAcknowledgementsRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketAcknowledgementsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; @@ -2207,6 +1894,7 @@ export const QueryPacketAcknowledgementsRequest = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementsRequest { const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2226,6 +1914,7 @@ export const QueryPacketAcknowledgementsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsRequest { const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2245,6 +1934,7 @@ export const QueryPacketAcknowledgementsRequest = { } return message; }, + toJSON(message: QueryPacketAcknowledgementsRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -2255,6 +1945,8 @@ export const QueryPacketAcknowledgementsRequest = { }, }; +const baseQueryPacketAcknowledgementsResponse: object = {}; + export const QueryPacketAcknowledgementsResponse = { encode(message: QueryPacketAcknowledgementsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.acknowledgements) { @@ -2268,7 +1960,8 @@ export const QueryPacketAcknowledgementsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryPacketAcknowledgementsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; @@ -2292,6 +1985,7 @@ export const QueryPacketAcknowledgementsResponse = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementsResponse { const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; message.acknowledgements = []; @@ -2312,6 +2006,7 @@ export const QueryPacketAcknowledgementsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsResponse { const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; message.acknowledgements = []; @@ -2332,6 +2027,7 @@ export const QueryPacketAcknowledgementsResponse = { } return message; }, + toJSON(message: QueryPacketAcknowledgementsResponse): unknown { const obj: any = {}; if (message.acknowledgements) { @@ -2346,6 +2042,12 @@ export const QueryPacketAcknowledgementsResponse = { }, }; +const baseQueryUnreceivedPacketsRequest: object = { + portId: "", + channelId: "", + packetCommitmentSequences: Long.UZERO, +}; + export const QueryUnreceivedPacketsRequest = { encode(message: QueryUnreceivedPacketsRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -2357,7 +2059,8 @@ export const QueryUnreceivedPacketsRequest = { writer.ldelim(); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryUnreceivedPacketsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; @@ -2388,6 +2091,7 @@ export const QueryUnreceivedPacketsRequest = { } return message; }, + fromJSON(object: any): QueryUnreceivedPacketsRequest { const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; message.packetCommitmentSequences = []; @@ -2408,6 +2112,7 @@ export const QueryUnreceivedPacketsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryUnreceivedPacketsRequest { const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; message.packetCommitmentSequences = []; @@ -2428,6 +2133,7 @@ export const QueryUnreceivedPacketsRequest = { } return message; }, + toJSON(message: QueryUnreceivedPacketsRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -2443,6 +2149,8 @@ export const QueryUnreceivedPacketsRequest = { }, }; +const baseQueryUnreceivedPacketsResponse: object = { sequences: Long.UZERO }; + export const QueryUnreceivedPacketsResponse = { encode(message: QueryUnreceivedPacketsResponse, writer: Writer = Writer.create()): Writer { writer.uint32(10).fork(); @@ -2455,7 +2163,8 @@ export const QueryUnreceivedPacketsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryUnreceivedPacketsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; @@ -2483,6 +2192,7 @@ export const QueryUnreceivedPacketsResponse = { } return message; }, + fromJSON(object: any): QueryUnreceivedPacketsResponse { const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; message.sequences = []; @@ -2498,6 +2208,7 @@ export const QueryUnreceivedPacketsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryUnreceivedPacketsResponse { const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; message.sequences = []; @@ -2513,6 +2224,7 @@ export const QueryUnreceivedPacketsResponse = { } return message; }, + toJSON(message: QueryUnreceivedPacketsResponse): unknown { const obj: any = {}; if (message.sequences) { @@ -2525,6 +2237,8 @@ export const QueryUnreceivedPacketsResponse = { }, }; +const baseQueryUnreceivedAcksRequest: object = { portId: "", channelId: "", packetAckSequences: Long.UZERO }; + export const QueryUnreceivedAcksRequest = { encode(message: QueryUnreceivedAcksRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); @@ -2536,7 +2250,8 @@ export const QueryUnreceivedAcksRequest = { writer.ldelim(); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryUnreceivedAcksRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; @@ -2567,6 +2282,7 @@ export const QueryUnreceivedAcksRequest = { } return message; }, + fromJSON(object: any): QueryUnreceivedAcksRequest { const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; message.packetAckSequences = []; @@ -2587,6 +2303,7 @@ export const QueryUnreceivedAcksRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryUnreceivedAcksRequest { const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; message.packetAckSequences = []; @@ -2607,6 +2324,7 @@ export const QueryUnreceivedAcksRequest = { } return message; }, + toJSON(message: QueryUnreceivedAcksRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -2620,6 +2338,8 @@ export const QueryUnreceivedAcksRequest = { }, }; +const baseQueryUnreceivedAcksResponse: object = { sequences: Long.UZERO }; + export const QueryUnreceivedAcksResponse = { encode(message: QueryUnreceivedAcksResponse, writer: Writer = Writer.create()): Writer { writer.uint32(10).fork(); @@ -2632,7 +2352,8 @@ export const QueryUnreceivedAcksResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryUnreceivedAcksResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; @@ -2660,6 +2381,7 @@ export const QueryUnreceivedAcksResponse = { } return message; }, + fromJSON(object: any): QueryUnreceivedAcksResponse { const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; message.sequences = []; @@ -2675,6 +2397,7 @@ export const QueryUnreceivedAcksResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryUnreceivedAcksResponse { const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; message.sequences = []; @@ -2690,6 +2413,7 @@ export const QueryUnreceivedAcksResponse = { } return message; }, + toJSON(message: QueryUnreceivedAcksResponse): unknown { const obj: any = {}; if (message.sequences) { @@ -2702,13 +2426,16 @@ export const QueryUnreceivedAcksResponse = { }, }; +const baseQueryNextSequenceReceiveRequest: object = { portId: "", channelId: "" }; + export const QueryNextSequenceReceiveRequest = { encode(message: QueryNextSequenceReceiveRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.portId); writer.uint32(18).string(message.channelId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryNextSequenceReceiveRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; @@ -2728,6 +2455,7 @@ export const QueryNextSequenceReceiveRequest = { } return message; }, + fromJSON(object: any): QueryNextSequenceReceiveRequest { const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2742,6 +2470,7 @@ export const QueryNextSequenceReceiveRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryNextSequenceReceiveRequest { const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; if (object.portId !== undefined && object.portId !== null) { @@ -2756,6 +2485,7 @@ export const QueryNextSequenceReceiveRequest = { } return message; }, + toJSON(message: QueryNextSequenceReceiveRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); @@ -2764,6 +2494,8 @@ export const QueryNextSequenceReceiveRequest = { }, }; +const baseQueryNextSequenceReceiveResponse: object = { nextSequenceReceive: Long.UZERO }; + export const QueryNextSequenceReceiveResponse = { encode(message: QueryNextSequenceReceiveResponse, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.nextSequenceReceive); @@ -2773,7 +2505,8 @@ export const QueryNextSequenceReceiveResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryNextSequenceReceiveResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; @@ -2796,6 +2529,7 @@ export const QueryNextSequenceReceiveResponse = { } return message; }, + fromJSON(object: any): QueryNextSequenceReceiveResponse { const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { @@ -2813,6 +2547,7 @@ export const QueryNextSequenceReceiveResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryNextSequenceReceiveResponse { const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { @@ -2832,6 +2567,7 @@ export const QueryNextSequenceReceiveResponse = { } return message; }, + toJSON(message: QueryNextSequenceReceiveResponse): unknown { const obj: any = {}; message.nextSequenceReceive !== undefined && @@ -2844,15 +2580,169 @@ export const QueryNextSequenceReceiveResponse = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Channel queries an IBC Channel. */ + Channel(request: QueryChannelRequest): Promise; + /** Channels queries all the IBC channels of a chain. */ + Channels(request: QueryChannelsRequest): Promise; + /** + * ConnectionChannels queries all the channels associated with a connection + * end. + */ + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise; + /** + * ChannelClientState queries for the client state for the channel associated + * with the provided channel identifiers. + */ + ChannelClientState(request: QueryChannelClientStateRequest): Promise; + /** + * ChannelConsensusState queries for the consensus state for the channel + * associated with the provided channel identifiers. + */ + ChannelConsensusState( + request: QueryChannelConsensusStateRequest, + ): Promise; + /** PacketCommitment queries a stored packet commitment hash. */ + PacketCommitment(request: QueryPacketCommitmentRequest): Promise; + /** + * PacketCommitments returns all the packet commitments hashes associated + * with a channel. + */ + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise; + /** PacketReceipt queries if a given packet sequence has been received on the queried chain */ + PacketReceipt(request: QueryPacketReceiptRequest): Promise; + /** PacketAcknowledgement queries a stored packet acknowledgement hash. */ + PacketAcknowledgement( + request: QueryPacketAcknowledgementRequest, + ): Promise; + /** + * PacketAcknowledgements returns all the packet acknowledgements associated + * with a channel. + */ + PacketAcknowledgements( + request: QueryPacketAcknowledgementsRequest, + ): Promise; + /** + * UnreceivedPackets returns all the unreceived IBC packets associated with a + * channel and sequences. + */ + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; + /** + * UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a + * channel and sequences. + */ + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; + /** NextSequenceReceive returns the next receive sequence for a given channel. */ + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; } -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Channel(request: QueryChannelRequest): Promise { + const data = QueryChannelRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryChannelResponse.decode(new Reader(data))); + } + Channels(request: QueryChannelsRequest): Promise { + const data = QueryChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryChannelsResponse.decode(new Reader(data))); + } + + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise { + const data = QueryConnectionChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryConnectionChannelsResponse.decode(new Reader(data))); + } + + ChannelClientState(request: QueryChannelClientStateRequest): Promise { + const data = QueryChannelClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryChannelClientStateResponse.decode(new Reader(data))); + } + + ChannelConsensusState( + request: QueryChannelConsensusStateRequest, + ): Promise { + const data = QueryChannelConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryChannelConsensusStateResponse.decode(new Reader(data))); + } + + PacketCommitment(request: QueryPacketCommitmentRequest): Promise { + const data = QueryPacketCommitmentRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryPacketCommitmentResponse.decode(new Reader(data))); + } + + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise { + const data = QueryPacketCommitmentsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryPacketCommitmentsResponse.decode(new Reader(data))); + } + + PacketReceipt(request: QueryPacketReceiptRequest): Promise { + const data = QueryPacketReceiptRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryPacketReceiptResponse.decode(new Reader(data))); + } + + PacketAcknowledgement( + request: QueryPacketAcknowledgementRequest, + ): Promise { + const data = QueryPacketAcknowledgementRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new Reader(data))); + } + + PacketAcknowledgements( + request: QueryPacketAcknowledgementsRequest, + ): Promise { + const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new Reader(data))); + } + + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { + const data = QueryUnreceivedPacketsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new Reader(data))); + } + + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { + const data = QueryUnreceivedAcksRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryUnreceivedAcksResponse.decode(new Reader(data))); + } + + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { + const data = QueryNextSequenceReceiveRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -2862,6 +2752,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -2869,7 +2761,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/client/v1/client.ts b/packages/stargate/src/codec/ibc/core/client/v1/client.ts index c04caa73..840abe40 100644 --- a/packages/stargate/src/codec/ibc/core/client/v1/client.ts +++ b/packages/stargate/src/codec/ibc/core/client/v1/client.ts @@ -3,132 +3,79 @@ import { Any } from "../../../../google/protobuf/any"; import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "ibc.core.client.v1"; + /** - * IdentifiedClientState defines a client state with an additional client - * identifier field. + * IdentifiedClientState defines a client state with an additional client + * identifier field. */ export interface IdentifiedClientState { - /** - * client identifier - */ + /** client identifier */ clientId: string; - /** - * client state - */ + /** client state */ clientState?: Any; } -/** - * ConsensusStateWithHeight defines a consensus state with an additional height field. - */ +/** ConsensusStateWithHeight defines a consensus state with an additional height field. */ export interface ConsensusStateWithHeight { - /** - * consensus state height - */ + /** consensus state height */ height?: Height; - /** - * consensus state - */ + /** consensus state */ consensusState?: Any; } /** - * ClientConsensusStates defines all the stored consensus states for a given - * client. + * ClientConsensusStates defines all the stored consensus states for a given + * client. */ export interface ClientConsensusStates { - /** - * client identifier - */ + /** client identifier */ clientId: string; - /** - * consensus states and their heights associated with the client - */ + /** consensus states and their heights associated with the client */ consensusStates: ConsensusStateWithHeight[]; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the client is - * updated with the provided header. The update may fail if the header is not - * valid given certain conditions specified by the client implementation. + * ClientUpdateProposal is a governance proposal. If it passes, the client is + * updated with the provided header. The update may fail if the header is not + * valid given certain conditions specified by the client implementation. */ export interface ClientUpdateProposal { - /** - * the title of the update proposal - */ + /** the title of the update proposal */ title: string; - /** - * the description of the proposal - */ + /** the description of the proposal */ description: string; - /** - * the client identifier for the client to be updated if the proposal passes - */ + /** the client identifier for the client to be updated if the proposal passes */ clientId: string; - /** - * the header used to update the client if the proposal passes - */ + /** the header used to update the client if the proposal passes */ header?: Any; } /** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients + * 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 + * 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 - */ + /** the revision that the client is currently on */ revisionNumber: Long; - /** - * the height within the given revision - */ + /** the height within the given revision */ revisionHeight: Long; } -/** - * Params defines the set of IBC light client parameters. - */ +/** Params defines the set of IBC light client parameters. */ export interface Params { - /** - * allowed_clients defines the list of allowed client state types. - */ + /** allowed_clients defines the list of allowed client state types. */ allowedClients: string[]; } -const baseIdentifiedClientState: object = { - clientId: "", -}; - -const baseConsensusStateWithHeight: object = {}; - -const baseClientConsensusStates: object = { - clientId: "", -}; - -const baseClientUpdateProposal: object = { - title: "", - description: "", - clientId: "", -}; - -const baseHeight: object = { - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, -}; - -const baseParams: object = { - allowedClients: "", -}; - -export const protobufPackage = "ibc.core.client.v1"; +const baseIdentifiedClientState: object = { clientId: "" }; export const IdentifiedClientState = { encode(message: IdentifiedClientState, writer: Writer = Writer.create()): Writer { @@ -138,7 +85,8 @@ export const IdentifiedClientState = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): IdentifiedClientState { + + decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseIdentifiedClientState } as IdentifiedClientState; @@ -158,6 +106,7 @@ export const IdentifiedClientState = { } return message; }, + fromJSON(object: any): IdentifiedClientState { const message = { ...baseIdentifiedClientState } as IdentifiedClientState; if (object.clientId !== undefined && object.clientId !== null) { @@ -172,6 +121,7 @@ export const IdentifiedClientState = { } return message; }, + fromPartial(object: DeepPartial): IdentifiedClientState { const message = { ...baseIdentifiedClientState } as IdentifiedClientState; if (object.clientId !== undefined && object.clientId !== null) { @@ -186,6 +136,7 @@ export const IdentifiedClientState = { } return message; }, + toJSON(message: IdentifiedClientState): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -195,6 +146,8 @@ export const IdentifiedClientState = { }, }; +const baseConsensusStateWithHeight: object = {}; + export const ConsensusStateWithHeight = { encode(message: ConsensusStateWithHeight, writer: Writer = Writer.create()): Writer { if (message.height !== undefined && message.height !== undefined) { @@ -205,7 +158,8 @@ export const ConsensusStateWithHeight = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ConsensusStateWithHeight { + + decode(input: Reader | Uint8Array, length?: number): ConsensusStateWithHeight { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; @@ -225,6 +179,7 @@ export const ConsensusStateWithHeight = { } return message; }, + fromJSON(object: any): ConsensusStateWithHeight { const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; if (object.height !== undefined && object.height !== null) { @@ -239,6 +194,7 @@ export const ConsensusStateWithHeight = { } return message; }, + fromPartial(object: DeepPartial): ConsensusStateWithHeight { const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; if (object.height !== undefined && object.height !== null) { @@ -253,6 +209,7 @@ export const ConsensusStateWithHeight = { } return message; }, + toJSON(message: ConsensusStateWithHeight): unknown { const obj: any = {}; message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); @@ -262,6 +219,8 @@ export const ConsensusStateWithHeight = { }, }; +const baseClientConsensusStates: object = { clientId: "" }; + export const ClientConsensusStates = { encode(message: ClientConsensusStates, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.clientId); @@ -270,7 +229,8 @@ export const ClientConsensusStates = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ClientConsensusStates { + + decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseClientConsensusStates } as ClientConsensusStates; @@ -291,6 +251,7 @@ export const ClientConsensusStates = { } return message; }, + fromJSON(object: any): ClientConsensusStates { const message = { ...baseClientConsensusStates } as ClientConsensusStates; message.consensusStates = []; @@ -306,6 +267,7 @@ export const ClientConsensusStates = { } return message; }, + fromPartial(object: DeepPartial): ClientConsensusStates { const message = { ...baseClientConsensusStates } as ClientConsensusStates; message.consensusStates = []; @@ -321,6 +283,7 @@ export const ClientConsensusStates = { } return message; }, + toJSON(message: ClientConsensusStates): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -335,6 +298,8 @@ export const ClientConsensusStates = { }, }; +const baseClientUpdateProposal: object = { title: "", description: "", clientId: "" }; + export const ClientUpdateProposal = { encode(message: ClientUpdateProposal, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.title); @@ -345,7 +310,8 @@ export const ClientUpdateProposal = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ClientUpdateProposal { + + decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; @@ -371,6 +337,7 @@ export const ClientUpdateProposal = { } return message; }, + fromJSON(object: any): ClientUpdateProposal { const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; if (object.title !== undefined && object.title !== null) { @@ -395,6 +362,7 @@ export const ClientUpdateProposal = { } return message; }, + fromPartial(object: DeepPartial): ClientUpdateProposal { const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; if (object.title !== undefined && object.title !== null) { @@ -419,6 +387,7 @@ export const ClientUpdateProposal = { } return message; }, + toJSON(message: ClientUpdateProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); @@ -429,13 +398,16 @@ export const ClientUpdateProposal = { }, }; +const baseHeight: object = { revisionNumber: Long.UZERO, revisionHeight: Long.UZERO }; + export const Height = { encode(message: Height, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.revisionNumber); writer.uint32(16).uint64(message.revisionHeight); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Height { + + decode(input: Reader | Uint8Array, length?: number): Height { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHeight } as Height; @@ -455,6 +427,7 @@ export const Height = { } return message; }, + fromJSON(object: any): Height { const message = { ...baseHeight } as Height; if (object.revisionNumber !== undefined && object.revisionNumber !== null) { @@ -469,6 +442,7 @@ export const Height = { } return message; }, + fromPartial(object: DeepPartial): Height { const message = { ...baseHeight } as Height; if (object.revisionNumber !== undefined && object.revisionNumber !== null) { @@ -483,6 +457,7 @@ export const Height = { } return message; }, + toJSON(message: Height): unknown { const obj: any = {}; message.revisionNumber !== undefined && @@ -493,6 +468,8 @@ export const Height = { }, }; +const baseParams: object = { allowedClients: "" }; + export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { for (const v of message.allowedClients) { @@ -500,7 +477,8 @@ export const Params = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Params { + + decode(input: Reader | Uint8Array, length?: number): Params { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseParams } as Params; @@ -518,6 +496,7 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { const message = { ...baseParams } as Params; message.allowedClients = []; @@ -528,6 +507,7 @@ export const Params = { } return message; }, + fromPartial(object: DeepPartial): Params { const message = { ...baseParams } as Params; message.allowedClients = []; @@ -538,6 +518,7 @@ export const Params = { } return message; }, + toJSON(message: Params): unknown { const obj: any = {}; if (message.allowedClients) { @@ -549,7 +530,7 @@ export const Params = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts b/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts index c3f923c7..6f033fb2 100644 --- a/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts +++ b/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts @@ -1,39 +1,42 @@ /* eslint-disable */ import { CommitmentProof } from "../../../../confio/proofs"; import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "ibc.core.commitment.v1"; /** - * MerkleRoot defines a merkle root hash. - * In the Cosmos SDK, the AppHash of a block header becomes the root. + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. */ export interface MerkleRoot { 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...)) + * 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; } /** - * 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 + * 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[]; } /** - * 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 + * 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[]; @@ -41,22 +44,13 @@ export interface MerkleProof { const baseMerkleRoot: object = {}; -const baseMerklePrefix: object = {}; - -const baseMerklePath: object = { - keyPath: "", -}; - -const baseMerkleProof: object = {}; - -export const protobufPackage = "ibc.core.commitment.v1"; - export const MerkleRoot = { encode(message: MerkleRoot, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.hash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): MerkleRoot { + + decode(input: Reader | Uint8Array, length?: number): MerkleRoot { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMerkleRoot } as MerkleRoot; @@ -73,6 +67,7 @@ export const MerkleRoot = { } return message; }, + fromJSON(object: any): MerkleRoot { const message = { ...baseMerkleRoot } as MerkleRoot; if (object.hash !== undefined && object.hash !== null) { @@ -80,6 +75,7 @@ export const MerkleRoot = { } return message; }, + fromPartial(object: DeepPartial): MerkleRoot { const message = { ...baseMerkleRoot } as MerkleRoot; if (object.hash !== undefined && object.hash !== null) { @@ -89,6 +85,7 @@ export const MerkleRoot = { } return message; }, + toJSON(message: MerkleRoot): unknown { const obj: any = {}; message.hash !== undefined && @@ -97,12 +94,15 @@ export const MerkleRoot = { }, }; +const baseMerklePrefix: object = {}; + export const MerklePrefix = { encode(message: MerklePrefix, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.keyPrefix); return writer; }, - decode(input: Uint8Array | Reader, length?: number): MerklePrefix { + + decode(input: Reader | Uint8Array, length?: number): MerklePrefix { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMerklePrefix } as MerklePrefix; @@ -119,6 +119,7 @@ export const MerklePrefix = { } return message; }, + fromJSON(object: any): MerklePrefix { const message = { ...baseMerklePrefix } as MerklePrefix; if (object.keyPrefix !== undefined && object.keyPrefix !== null) { @@ -126,6 +127,7 @@ export const MerklePrefix = { } return message; }, + fromPartial(object: DeepPartial): MerklePrefix { const message = { ...baseMerklePrefix } as MerklePrefix; if (object.keyPrefix !== undefined && object.keyPrefix !== null) { @@ -135,6 +137,7 @@ export const MerklePrefix = { } return message; }, + toJSON(message: MerklePrefix): unknown { const obj: any = {}; message.keyPrefix !== undefined && @@ -145,6 +148,8 @@ export const MerklePrefix = { }, }; +const baseMerklePath: object = { keyPath: "" }; + export const MerklePath = { encode(message: MerklePath, writer: Writer = Writer.create()): Writer { for (const v of message.keyPath) { @@ -152,7 +157,8 @@ export const MerklePath = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MerklePath { + + decode(input: Reader | Uint8Array, length?: number): MerklePath { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMerklePath } as MerklePath; @@ -170,6 +176,7 @@ export const MerklePath = { } return message; }, + fromJSON(object: any): MerklePath { const message = { ...baseMerklePath } as MerklePath; message.keyPath = []; @@ -180,6 +187,7 @@ export const MerklePath = { } return message; }, + fromPartial(object: DeepPartial): MerklePath { const message = { ...baseMerklePath } as MerklePath; message.keyPath = []; @@ -190,6 +198,7 @@ export const MerklePath = { } return message; }, + toJSON(message: MerklePath): unknown { const obj: any = {}; if (message.keyPath) { @@ -201,6 +210,8 @@ export const MerklePath = { }, }; +const baseMerkleProof: object = {}; + export const MerkleProof = { encode(message: MerkleProof, writer: Writer = Writer.create()): Writer { for (const v of message.proofs) { @@ -208,7 +219,8 @@ export const MerkleProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): MerkleProof { + + decode(input: Reader | Uint8Array, length?: number): MerkleProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMerkleProof } as MerkleProof; @@ -226,6 +238,7 @@ export const MerkleProof = { } return message; }, + fromJSON(object: any): MerkleProof { const message = { ...baseMerkleProof } as MerkleProof; message.proofs = []; @@ -236,6 +249,7 @@ export const MerkleProof = { } return message; }, + fromPartial(object: DeepPartial): MerkleProof { const message = { ...baseMerkleProof } as MerkleProof; message.proofs = []; @@ -246,6 +260,7 @@ export const MerkleProof = { } return message; }, + toJSON(message: MerkleProof): unknown { const obj: any = {}; if (message.proofs) { @@ -257,15 +272,18 @@ export const MerkleProof = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -275,6 +293,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -282,7 +302,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts b/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts index 0b2783c1..324317d2 100644 --- a/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts +++ b/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts @@ -3,178 +3,23 @@ import * as Long from "long"; import { MerklePrefix } from "../../../../ibc/core/commitment/v1/commitment"; import { Writer, Reader } from "protobufjs/minimal"; -/** - * 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; -} - -/** - * 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; -} - -/** - * 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; -} - -/** - * ClientPaths define all the connection paths for a client state. - */ -export interface ClientPaths { - /** - * list of connection paths - */ - 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[]; -} - -/** - * 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[]; -} - -const baseConnectionEnd: object = { - clientId: "", - state: 0, - delayPeriod: Long.UZERO, -}; - -const baseIdentifiedConnection: object = { - id: "", - clientId: "", - state: 0, - delayPeriod: Long.UZERO, -}; - -const baseCounterparty: object = { - clientId: "", - connectionId: "", -}; - -const baseClientPaths: object = { - paths: "", -}; - -const baseConnectionPaths: object = { - clientId: "", - paths: "", -}; - -const baseVersion: object = { - identifier: "", - features: "", -}; - export const protobufPackage = "ibc.core.connection.v1"; -/** State defines if a connection is in one of the following states: - INIT, TRYOPEN, OPEN or UNINITIALIZED. +/** + * 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 - Default State */ STATE_UNINITIALIZED_UNSPECIFIED = 0, - /** STATE_INIT - A connection end has just started the opening handshake. - */ + /** 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 - 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 - A connection end has completed the handshake. */ STATE_OPEN = 3, UNRECOGNIZED = -1, } @@ -215,6 +60,96 @@ export function stateToJSON(object: State): string { } } +/** + * 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; +} + +/** + * 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; +} + +/** 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; +} + +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + 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[]; +} + +/** + * 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[]; +} + +const baseConnectionEnd: object = { clientId: "", state: 0, delayPeriod: Long.UZERO }; + export const ConnectionEnd = { encode(message: ConnectionEnd, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.clientId); @@ -228,7 +163,8 @@ export const ConnectionEnd = { writer.uint32(40).uint64(message.delayPeriod); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ConnectionEnd { + + decode(input: Reader | Uint8Array, length?: number): ConnectionEnd { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConnectionEnd } as ConnectionEnd; @@ -258,6 +194,7 @@ export const ConnectionEnd = { } return message; }, + fromJSON(object: any): ConnectionEnd { const message = { ...baseConnectionEnd } as ConnectionEnd; message.versions = []; @@ -288,6 +225,7 @@ export const ConnectionEnd = { } return message; }, + fromPartial(object: DeepPartial): ConnectionEnd { const message = { ...baseConnectionEnd } as ConnectionEnd; message.versions = []; @@ -318,6 +256,7 @@ export const ConnectionEnd = { } return message; }, + toJSON(message: ConnectionEnd): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -334,6 +273,8 @@ export const ConnectionEnd = { }, }; +const baseIdentifiedConnection: object = { id: "", clientId: "", state: 0, delayPeriod: Long.UZERO }; + export const IdentifiedConnection = { encode(message: IdentifiedConnection, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.id); @@ -348,7 +289,8 @@ export const IdentifiedConnection = { writer.uint32(48).uint64(message.delayPeriod); return writer; }, - decode(input: Uint8Array | Reader, length?: number): IdentifiedConnection { + + decode(input: Reader | Uint8Array, length?: number): IdentifiedConnection { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseIdentifiedConnection } as IdentifiedConnection; @@ -381,6 +323,7 @@ export const IdentifiedConnection = { } return message; }, + fromJSON(object: any): IdentifiedConnection { const message = { ...baseIdentifiedConnection } as IdentifiedConnection; message.versions = []; @@ -416,6 +359,7 @@ export const IdentifiedConnection = { } return message; }, + fromPartial(object: DeepPartial): IdentifiedConnection { const message = { ...baseIdentifiedConnection } as IdentifiedConnection; message.versions = []; @@ -451,6 +395,7 @@ export const IdentifiedConnection = { } return message; }, + toJSON(message: IdentifiedConnection): unknown { const obj: any = {}; message.id !== undefined && (obj.id = message.id); @@ -468,6 +413,8 @@ export const IdentifiedConnection = { }, }; +const baseCounterparty: object = { clientId: "", connectionId: "" }; + export const Counterparty = { encode(message: Counterparty, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.clientId); @@ -477,7 +424,8 @@ export const Counterparty = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Counterparty { + + decode(input: Reader | Uint8Array, length?: number): Counterparty { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCounterparty } as Counterparty; @@ -500,6 +448,7 @@ export const Counterparty = { } return message; }, + fromJSON(object: any): Counterparty { const message = { ...baseCounterparty } as Counterparty; if (object.clientId !== undefined && object.clientId !== null) { @@ -519,6 +468,7 @@ export const Counterparty = { } return message; }, + fromPartial(object: DeepPartial): Counterparty { const message = { ...baseCounterparty } as Counterparty; if (object.clientId !== undefined && object.clientId !== null) { @@ -538,6 +488,7 @@ export const Counterparty = { } return message; }, + toJSON(message: Counterparty): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -548,6 +499,8 @@ export const Counterparty = { }, }; +const baseClientPaths: object = { paths: "" }; + export const ClientPaths = { encode(message: ClientPaths, writer: Writer = Writer.create()): Writer { for (const v of message.paths) { @@ -555,7 +508,8 @@ export const ClientPaths = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ClientPaths { + + decode(input: Reader | Uint8Array, length?: number): ClientPaths { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseClientPaths } as ClientPaths; @@ -573,6 +527,7 @@ export const ClientPaths = { } return message; }, + fromJSON(object: any): ClientPaths { const message = { ...baseClientPaths } as ClientPaths; message.paths = []; @@ -583,6 +538,7 @@ export const ClientPaths = { } return message; }, + fromPartial(object: DeepPartial): ClientPaths { const message = { ...baseClientPaths } as ClientPaths; message.paths = []; @@ -593,6 +549,7 @@ export const ClientPaths = { } return message; }, + toJSON(message: ClientPaths): unknown { const obj: any = {}; if (message.paths) { @@ -604,6 +561,8 @@ export const ClientPaths = { }, }; +const baseConnectionPaths: object = { clientId: "", paths: "" }; + export const ConnectionPaths = { encode(message: ConnectionPaths, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.clientId); @@ -612,7 +571,8 @@ export const ConnectionPaths = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ConnectionPaths { + + decode(input: Reader | Uint8Array, length?: number): ConnectionPaths { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConnectionPaths } as ConnectionPaths; @@ -633,6 +593,7 @@ export const ConnectionPaths = { } return message; }, + fromJSON(object: any): ConnectionPaths { const message = { ...baseConnectionPaths } as ConnectionPaths; message.paths = []; @@ -648,6 +609,7 @@ export const ConnectionPaths = { } return message; }, + fromPartial(object: DeepPartial): ConnectionPaths { const message = { ...baseConnectionPaths } as ConnectionPaths; message.paths = []; @@ -663,6 +625,7 @@ export const ConnectionPaths = { } return message; }, + toJSON(message: ConnectionPaths): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -675,6 +638,8 @@ export const ConnectionPaths = { }, }; +const baseVersion: object = { identifier: "", features: "" }; + export const Version = { encode(message: Version, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.identifier); @@ -683,7 +648,8 @@ export const Version = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Version { + + decode(input: Reader | Uint8Array, length?: number): Version { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseVersion } as Version; @@ -704,6 +670,7 @@ export const Version = { } return message; }, + fromJSON(object: any): Version { const message = { ...baseVersion } as Version; message.features = []; @@ -719,6 +686,7 @@ export const Version = { } return message; }, + fromPartial(object: DeepPartial): Version { const message = { ...baseVersion } as Version; message.features = []; @@ -734,6 +702,7 @@ export const Version = { } return message; }, + toJSON(message: Version): unknown { const obj: any = {}; message.identifier !== undefined && (obj.identifier = message.identifier); @@ -746,7 +715,7 @@ export const Version = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/ibc/core/connection/v1/query.ts b/packages/stargate/src/codec/ibc/core/connection/v1/query.ts index 5565665f..e9d5d3fa 100644 --- a/packages/stargate/src/codec/ibc/core/connection/v1/query.ts +++ b/packages/stargate/src/codec/ibc/core/connection/v1/query.ts @@ -6,285 +6,131 @@ import * as Long from "long"; import { Any } from "../../../../google/protobuf/any"; import { Reader, Writer } from "protobufjs/minimal"; +export const protobufPackage = "ibc.core.connection.v1"; + /** - * QueryConnectionRequest is the request type for the Query/Connection RPC - * method + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method */ export interface QueryConnectionRequest { - /** - * connection unique identifier - */ + /** connection unique identifier */ connectionId: string; } /** - * QueryConnectionResponse is the response type for the Query/Connection RPC - * method. Besides the connection end, it includes a proof and the height from - * which the proof was retrieved. + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. */ export interface QueryConnectionResponse { - /** - * connection associated with the request identifier - */ + /** connection associated with the request identifier */ connection?: ConnectionEnd; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryConnectionsRequest is the request type for the Query/Connections RPC - * method + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method */ export interface QueryConnectionsRequest { pagination?: PageRequest; } /** - * QueryConnectionsResponse is the response type for the Query/Connections RPC - * method. + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. */ export interface QueryConnectionsResponse { - /** - * list of stored connections of the chain. - */ + /** list of stored connections of the chain. */ connections: IdentifiedConnection[]; - /** - * pagination response - */ + /** pagination response */ pagination?: PageResponse; - /** - * query block height - */ + /** query block height */ height?: Height; } /** - * QueryClientConnectionsRequest is the request type for the - * Query/ClientConnections RPC method + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method */ export interface QueryClientConnectionsRequest { - /** - * client identifier associated with a connection - */ + /** client identifier associated with a connection */ clientId: string; } /** - * QueryClientConnectionsResponse is the response type for the - * Query/ClientConnections RPC method + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method */ export interface QueryClientConnectionsResponse { - /** - * slice of all the connection paths associated with a client. - */ + /** slice of all the connection paths associated with a client. */ connectionPaths: string[]; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was generated - */ + /** height at which the proof was generated */ proofHeight?: Height; } /** - * QueryConnectionClientStateRequest is the request type for the - * Query/ConnectionClientState RPC method + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateRequest { - /** - * connection identifier - */ + /** connection identifier */ connectionId: string; } /** - * QueryConnectionClientStateResponse is the response type for the - * Query/ConnectionClientState RPC method + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateResponse { - /** - * client state associated with the channel - */ + /** client state associated with the channel */ identifiedClientState?: IdentifiedClientState; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } /** - * QueryConnectionConsensusStateRequest is the request type for the - * Query/ConnectionConsensusState RPC method + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateRequest { - /** - * connection identifier - */ + /** connection identifier */ connectionId: string; revisionNumber: Long; revisionHeight: Long; } /** - * QueryConnectionConsensusStateResponse is the response type for the - * Query/ConnectionConsensusState RPC method + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateResponse { - /** - * consensus state associated with the channel - */ + /** consensus state associated with the channel */ consensusState?: Any; - /** - * client ID associated with the consensus state - */ + /** client ID associated with the consensus state */ clientId: string; - /** - * merkle proof of existence - */ + /** merkle proof of existence */ proof: Uint8Array; - /** - * height at which the proof was retrieved - */ + /** height at which the proof was retrieved */ proofHeight?: Height; } -const baseQueryConnectionRequest: object = { - connectionId: "", -}; - -const baseQueryConnectionResponse: object = {}; - -const baseQueryConnectionsRequest: object = {}; - -const baseQueryConnectionsResponse: object = {}; - -const baseQueryClientConnectionsRequest: object = { - clientId: "", -}; - -const baseQueryClientConnectionsResponse: object = { - connectionPaths: "", -}; - -const baseQueryConnectionClientStateRequest: object = { - connectionId: "", -}; - -const baseQueryConnectionClientStateResponse: object = {}; - -const baseQueryConnectionConsensusStateRequest: object = { - connectionId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, -}; - -const baseQueryConnectionConsensusStateResponse: object = { - clientId: "", -}; - -/** - * Query provides defines the gRPC querier service - */ -export interface Query { - /** - * Connection queries an IBC connection end. - */ - Connection(request: QueryConnectionRequest): Promise; - - /** - * Connections queries all the IBC connections of a chain. - */ - Connections(request: QueryConnectionsRequest): Promise; - - /** - * ClientConnections queries the connection paths associated with a client - * state. - */ - ClientConnections(request: QueryClientConnectionsRequest): Promise; - - /** - * ConnectionClientState queries the client state associated with the - * connection. - */ - ConnectionClientState( - request: QueryConnectionClientStateRequest, - ): Promise; - - /** - * ConnectionConsensusState queries the consensus state associated with the - * connection. - */ - ConnectionConsensusState( - request: QueryConnectionConsensusStateRequest, - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Connection(request: QueryConnectionRequest): Promise { - const data = QueryConnectionRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); - return promise.then((data) => QueryConnectionResponse.decode(new Reader(data))); - } - - Connections(request: QueryConnectionsRequest): Promise { - const data = QueryConnectionsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); - return promise.then((data) => QueryConnectionsResponse.decode(new Reader(data))); - } - - ClientConnections(request: QueryClientConnectionsRequest): Promise { - const data = QueryClientConnectionsRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); - return promise.then((data) => QueryClientConnectionsResponse.decode(new Reader(data))); - } - - ConnectionClientState( - request: QueryConnectionClientStateRequest, - ): Promise { - const data = QueryConnectionClientStateRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); - return promise.then((data) => QueryConnectionClientStateResponse.decode(new Reader(data))); - } - - ConnectionConsensusState( - request: QueryConnectionConsensusStateRequest, - ): Promise { - const data = QueryConnectionConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); - return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -export const protobufPackage = "ibc.core.connection.v1"; +const baseQueryConnectionRequest: object = { connectionId: "" }; export const QueryConnectionRequest = { encode(message: QueryConnectionRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.connectionId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; @@ -301,6 +147,7 @@ export const QueryConnectionRequest = { } return message; }, + fromJSON(object: any): QueryConnectionRequest { const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; if (object.connectionId !== undefined && object.connectionId !== null) { @@ -310,6 +157,7 @@ export const QueryConnectionRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionRequest { const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; if (object.connectionId !== undefined && object.connectionId !== null) { @@ -319,6 +167,7 @@ export const QueryConnectionRequest = { } return message; }, + toJSON(message: QueryConnectionRequest): unknown { const obj: any = {}; message.connectionId !== undefined && (obj.connectionId = message.connectionId); @@ -326,6 +175,8 @@ export const QueryConnectionRequest = { }, }; +const baseQueryConnectionResponse: object = {}; + export const QueryConnectionResponse = { encode(message: QueryConnectionResponse, writer: Writer = Writer.create()): Writer { if (message.connection !== undefined && message.connection !== undefined) { @@ -337,7 +188,8 @@ export const QueryConnectionResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; @@ -360,6 +212,7 @@ export const QueryConnectionResponse = { } return message; }, + fromJSON(object: any): QueryConnectionResponse { const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; if (object.connection !== undefined && object.connection !== null) { @@ -377,6 +230,7 @@ export const QueryConnectionResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionResponse { const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; if (object.connection !== undefined && object.connection !== null) { @@ -396,6 +250,7 @@ export const QueryConnectionResponse = { } return message; }, + toJSON(message: QueryConnectionResponse): unknown { const obj: any = {}; message.connection !== undefined && @@ -408,6 +263,8 @@ export const QueryConnectionResponse = { }, }; +const baseQueryConnectionsRequest: object = {}; + export const QueryConnectionsRequest = { encode(message: QueryConnectionsRequest, writer: Writer = Writer.create()): Writer { if (message.pagination !== undefined && message.pagination !== undefined) { @@ -415,7 +272,8 @@ export const QueryConnectionsRequest = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; @@ -432,6 +290,7 @@ export const QueryConnectionsRequest = { } return message; }, + fromJSON(object: any): QueryConnectionsRequest { const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; if (object.pagination !== undefined && object.pagination !== null) { @@ -441,6 +300,7 @@ export const QueryConnectionsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionsRequest { const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; if (object.pagination !== undefined && object.pagination !== null) { @@ -450,6 +310,7 @@ export const QueryConnectionsRequest = { } return message; }, + toJSON(message: QueryConnectionsRequest): unknown { const obj: any = {}; message.pagination !== undefined && @@ -458,6 +319,8 @@ export const QueryConnectionsRequest = { }, }; +const baseQueryConnectionsResponse: object = {}; + export const QueryConnectionsResponse = { encode(message: QueryConnectionsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.connections) { @@ -471,7 +334,8 @@ export const QueryConnectionsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; @@ -495,6 +359,7 @@ export const QueryConnectionsResponse = { } return message; }, + fromJSON(object: any): QueryConnectionsResponse { const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; message.connections = []; @@ -515,6 +380,7 @@ export const QueryConnectionsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionsResponse { const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; message.connections = []; @@ -535,6 +401,7 @@ export const QueryConnectionsResponse = { } return message; }, + toJSON(message: QueryConnectionsResponse): unknown { const obj: any = {}; if (message.connections) { @@ -549,12 +416,15 @@ export const QueryConnectionsResponse = { }, }; +const baseQueryClientConnectionsRequest: object = { clientId: "" }; + export const QueryClientConnectionsRequest = { encode(message: QueryClientConnectionsRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.clientId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryClientConnectionsRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryClientConnectionsRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; @@ -571,6 +441,7 @@ export const QueryClientConnectionsRequest = { } return message; }, + fromJSON(object: any): QueryClientConnectionsRequest { const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; if (object.clientId !== undefined && object.clientId !== null) { @@ -580,6 +451,7 @@ export const QueryClientConnectionsRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryClientConnectionsRequest { const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; if (object.clientId !== undefined && object.clientId !== null) { @@ -589,6 +461,7 @@ export const QueryClientConnectionsRequest = { } return message; }, + toJSON(message: QueryClientConnectionsRequest): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); @@ -596,6 +469,8 @@ export const QueryClientConnectionsRequest = { }, }; +const baseQueryClientConnectionsResponse: object = { connectionPaths: "" }; + export const QueryClientConnectionsResponse = { encode(message: QueryClientConnectionsResponse, writer: Writer = Writer.create()): Writer { for (const v of message.connectionPaths) { @@ -607,7 +482,8 @@ export const QueryClientConnectionsResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryClientConnectionsResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryClientConnectionsResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; @@ -631,6 +507,7 @@ export const QueryClientConnectionsResponse = { } return message; }, + fromJSON(object: any): QueryClientConnectionsResponse { const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; message.connectionPaths = []; @@ -649,6 +526,7 @@ export const QueryClientConnectionsResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryClientConnectionsResponse { const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; message.connectionPaths = []; @@ -669,6 +547,7 @@ export const QueryClientConnectionsResponse = { } return message; }, + toJSON(message: QueryClientConnectionsResponse): unknown { const obj: any = {}; if (message.connectionPaths) { @@ -684,12 +563,15 @@ export const QueryClientConnectionsResponse = { }, }; +const baseQueryConnectionClientStateRequest: object = { connectionId: "" }; + export const QueryConnectionClientStateRequest = { encode(message: QueryConnectionClientStateRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.connectionId); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionClientStateRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; @@ -706,6 +588,7 @@ export const QueryConnectionClientStateRequest = { } return message; }, + fromJSON(object: any): QueryConnectionClientStateRequest { const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; if (object.connectionId !== undefined && object.connectionId !== null) { @@ -715,6 +598,7 @@ export const QueryConnectionClientStateRequest = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionClientStateRequest { const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; if (object.connectionId !== undefined && object.connectionId !== null) { @@ -724,6 +608,7 @@ export const QueryConnectionClientStateRequest = { } return message; }, + toJSON(message: QueryConnectionClientStateRequest): unknown { const obj: any = {}; message.connectionId !== undefined && (obj.connectionId = message.connectionId); @@ -731,6 +616,8 @@ export const QueryConnectionClientStateRequest = { }, }; +const baseQueryConnectionClientStateResponse: object = {}; + export const QueryConnectionClientStateResponse = { encode(message: QueryConnectionClientStateResponse, writer: Writer = Writer.create()): Writer { if (message.identifiedClientState !== undefined && message.identifiedClientState !== undefined) { @@ -742,7 +629,8 @@ export const QueryConnectionClientStateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionClientStateResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; @@ -765,6 +653,7 @@ export const QueryConnectionClientStateResponse = { } return message; }, + fromJSON(object: any): QueryConnectionClientStateResponse { const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { @@ -782,6 +671,7 @@ export const QueryConnectionClientStateResponse = { } return message; }, + fromPartial(object: DeepPartial): QueryConnectionClientStateResponse { const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { @@ -801,6 +691,7 @@ export const QueryConnectionClientStateResponse = { } return message; }, + toJSON(message: QueryConnectionClientStateResponse): unknown { const obj: any = {}; message.identifiedClientState !== undefined && @@ -815,6 +706,12 @@ export const QueryConnectionClientStateResponse = { }, }; +const baseQueryConnectionConsensusStateRequest: object = { + connectionId: "", + revisionNumber: Long.UZERO, + revisionHeight: Long.UZERO, +}; + export const QueryConnectionConsensusStateRequest = { encode(message: QueryConnectionConsensusStateRequest, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.connectionId); @@ -822,7 +719,8 @@ export const QueryConnectionConsensusStateRequest = { writer.uint32(24).uint64(message.revisionHeight); return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionConsensusStateRequest { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; @@ -845,6 +743,7 @@ export const QueryConnectionConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryConnectionConsensusStateRequest { const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; if (object.connectionId !== undefined && object.connectionId !== null) { @@ -864,6 +763,7 @@ export const QueryConnectionConsensusStateRequest = { } return message; }, + fromPartial( object: DeepPartial, ): QueryConnectionConsensusStateRequest { @@ -885,6 +785,7 @@ export const QueryConnectionConsensusStateRequest = { } return message; }, + toJSON(message: QueryConnectionConsensusStateRequest): unknown { const obj: any = {}; message.connectionId !== undefined && (obj.connectionId = message.connectionId); @@ -896,6 +797,8 @@ export const QueryConnectionConsensusStateRequest = { }, }; +const baseQueryConnectionConsensusStateResponse: object = { clientId: "" }; + export const QueryConnectionConsensusStateResponse = { encode(message: QueryConnectionConsensusStateResponse, writer: Writer = Writer.create()): Writer { if (message.consensusState !== undefined && message.consensusState !== undefined) { @@ -908,7 +811,8 @@ export const QueryConnectionConsensusStateResponse = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): QueryConnectionConsensusStateResponse { + + decode(input: Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; @@ -934,6 +838,7 @@ export const QueryConnectionConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryConnectionConsensusStateResponse { const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; if (object.consensusState !== undefined && object.consensusState !== null) { @@ -956,6 +861,7 @@ export const QueryConnectionConsensusStateResponse = { } return message; }, + fromPartial( object: DeepPartial, ): QueryConnectionConsensusStateResponse { @@ -982,6 +888,7 @@ export const QueryConnectionConsensusStateResponse = { } return message; }, + toJSON(message: QueryConnectionConsensusStateResponse): unknown { const obj: any = {}; message.consensusState !== undefined && @@ -995,15 +902,89 @@ export const QueryConnectionConsensusStateResponse = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Connection queries an IBC connection end. */ + Connection(request: QueryConnectionRequest): Promise; + /** Connections queries all the IBC connections of a chain. */ + Connections(request: QueryConnectionsRequest): Promise; + /** + * ClientConnections queries the connection paths associated with a client + * state. + */ + ClientConnections(request: QueryClientConnectionsRequest): Promise; + /** + * ConnectionClientState queries the client state associated with the + * connection. + */ + ConnectionClientState( + request: QueryConnectionClientStateRequest, + ): Promise; + /** + * ConnectionConsensusState queries the consensus state associated with the + * connection. + */ + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise; } -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Connection(request: QueryConnectionRequest): Promise { + const data = QueryConnectionRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryConnectionResponse.decode(new Reader(data))); + } + Connections(request: QueryConnectionsRequest): Promise { + const data = QueryConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryConnectionsResponse.decode(new Reader(data))); + } + + ClientConnections(request: QueryClientConnectionsRequest): Promise { + const data = QueryClientConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryClientConnectionsResponse.decode(new Reader(data))); + } + + ConnectionClientState( + request: QueryConnectionClientStateRequest, + ): Promise { + const data = QueryConnectionClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryConnectionClientStateResponse.decode(new Reader(data))); + } + + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise { + const data = QueryConnectionConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data); + return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -1013,6 +994,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -1020,7 +1003,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/abci/types.ts b/packages/stargate/src/codec/tendermint/abci/types.ts index 4fcf594d..388759ba 100644 --- a/packages/stargate/src/codec/tendermint/abci/types.ts +++ b/packages/stargate/src/codec/tendermint/abci/types.ts @@ -4,756 +4,9 @@ import { Header } from "../../tendermint/types/types"; import { ProofOps } from "../../tendermint/crypto/proof"; import { EvidenceParams, ValidatorParams, VersionParams } from "../../tendermint/types/params"; import { PublicKey } from "../../tendermint/crypto/keys"; -import { Reader, Writer, util, configure } from "protobufjs/minimal"; +import { Reader, util, configure, Writer } from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -export interface Request { - echo?: RequestEcho | undefined; - flush?: RequestFlush | undefined; - info?: RequestInfo | undefined; - setOption?: RequestSetOption | undefined; - initChain?: RequestInitChain | undefined; - query?: RequestQuery | undefined; - beginBlock?: RequestBeginBlock | undefined; - checkTx?: RequestCheckTx | undefined; - deliverTx?: RequestDeliverTx | undefined; - endBlock?: RequestEndBlock | undefined; - commit?: RequestCommit | undefined; - listSnapshots?: RequestListSnapshots | undefined; - offerSnapshot?: RequestOfferSnapshot | undefined; - loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined; - applySnapshotChunk?: RequestApplySnapshotChunk | undefined; -} - -export interface RequestEcho { - message: string; -} - -export interface RequestFlush {} - -export interface RequestInfo { - version: string; - blockVersion: Long; - p2pVersion: Long; -} - -/** - * nondeterministic - */ -export interface RequestSetOption { - key: string; - value: string; -} - -export interface RequestInitChain { - time?: Date; - chainId: string; - consensusParams?: ConsensusParams; - validators: ValidatorUpdate[]; - appStateBytes: Uint8Array; - initialHeight: Long; -} - -export interface RequestQuery { - data: Uint8Array; - path: string; - height: Long; - prove: boolean; -} - -export interface RequestBeginBlock { - hash: Uint8Array; - header?: Header; - lastCommitInfo?: LastCommitInfo; - byzantineValidators: Evidence[]; -} - -export interface RequestCheckTx { - tx: Uint8Array; - type: CheckTxType; -} - -export interface RequestDeliverTx { - tx: Uint8Array; -} - -export interface RequestEndBlock { - height: Long; -} - -export interface RequestCommit {} - -/** - * lists available snapshots - */ -export interface RequestListSnapshots {} - -/** - * 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; -} - -/** - * loads a snapshot chunk - */ -export interface RequestLoadSnapshotChunk { - height: Long; - format: number; - chunk: number; -} - -/** - * Applies a snapshot chunk - */ -export interface RequestApplySnapshotChunk { - index: number; - chunk: Uint8Array; - sender: string; -} - -export interface Response { - exception?: ResponseException | undefined; - echo?: ResponseEcho | undefined; - flush?: ResponseFlush | undefined; - info?: ResponseInfo | undefined; - setOption?: ResponseSetOption | undefined; - initChain?: ResponseInitChain | undefined; - query?: ResponseQuery | undefined; - beginBlock?: ResponseBeginBlock | undefined; - checkTx?: ResponseCheckTx | undefined; - deliverTx?: ResponseDeliverTx | undefined; - endBlock?: ResponseEndBlock | undefined; - commit?: ResponseCommit | undefined; - listSnapshots?: ResponseListSnapshots | undefined; - offerSnapshot?: ResponseOfferSnapshot | undefined; - loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined; - applySnapshotChunk?: ResponseApplySnapshotChunk | undefined; -} - -/** - * nondeterministic - */ -export interface ResponseException { - error: string; -} - -export interface ResponseEcho { - message: string; -} - -export interface ResponseFlush {} - -export interface ResponseInfo { - data: string; - version: string; - appVersion: Long; - lastBlockHeight: Long; - lastBlockAppHash: Uint8Array; -} - -/** - * nondeterministic - */ -export interface ResponseSetOption { - code: number; - /** - * bytes data = 2; - */ - log: string; - info: string; -} - -export interface ResponseInitChain { - consensusParams?: ConsensusParams; - validators: ValidatorUpdate[]; - appHash: 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 ResponseBeginBlock { - events: Event[]; -} - -export interface ResponseCheckTx { - code: number; - data: Uint8Array; - /** - * nondeterministic - */ - log: string; - /** - * nondeterministic - */ - info: string; - gasWanted: Long; - gasUsed: Long; - events: Event[]; - 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 ResponseEndBlock { - validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates?: ConsensusParams; - events: Event[]; -} - -export interface ResponseCommit { - /** - * reserve 1 - */ - data: Uint8Array; - retainHeight: Long; -} - -export interface ResponseListSnapshots { - snapshots: Snapshot[]; -} - -export interface ResponseOfferSnapshot { - result: ResponseOfferSnapshot_Result; -} - -export interface ResponseLoadSnapshotChunk { - chunk: Uint8Array; -} - -export interface ResponseApplySnapshotChunk { - result: ResponseApplySnapshotChunk_Result; - /** - * Chunks to refetch and reapply - */ - refetchChunks: number[]; - /** - * Chunk senders to reject and ban - */ - rejectSenders: 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; -} - -/** - * 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 LastCommitInfo { - round: number; - votes: VoteInfo[]; -} - -/** - * 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[]; -} - -/** - * EventAttribute is a single key-value pair, associated with an event. - */ -export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; - /** - * nondeterministic - */ - 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; -} - -/** - * Validator - */ -export interface Validator { - /** - * The first 20 bytes of SHA256(public key) - */ - address: Uint8Array; - /** - * PubKey pub_key = 2 [(gogoproto.nullable)=false]; - */ - power: Long; -} - -/** - * ValidatorUpdate - */ -export interface ValidatorUpdate { - pubKey?: PublicKey; - power: Long; -} - -/** - * VoteInfo - */ -export interface VoteInfo { - validator?: Validator; - signedLastBlock: 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 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; -} - -const baseRequest: object = {}; - -const baseRequestEcho: object = { - message: "", -}; - -const baseRequestFlush: object = {}; - -const baseRequestInfo: object = { - version: "", - blockVersion: Long.UZERO, - p2pVersion: Long.UZERO, -}; - -const baseRequestSetOption: object = { - key: "", - value: "", -}; - -const baseRequestInitChain: object = { - chainId: "", - initialHeight: Long.ZERO, -}; - -const baseRequestQuery: object = { - path: "", - height: Long.ZERO, - prove: false, -}; - -const baseRequestBeginBlock: object = {}; - -const baseRequestCheckTx: object = { - type: 0, -}; - -const baseRequestDeliverTx: object = {}; - -const baseRequestEndBlock: object = { - height: Long.ZERO, -}; - -const baseRequestCommit: object = {}; - -const baseRequestListSnapshots: object = {}; - -const baseRequestOfferSnapshot: object = {}; - -const baseRequestLoadSnapshotChunk: object = { - height: Long.UZERO, - format: 0, - chunk: 0, -}; - -const baseRequestApplySnapshotChunk: object = { - index: 0, - sender: "", -}; - -const baseResponse: object = {}; - -const baseResponseException: object = { - error: "", -}; - -const baseResponseEcho: object = { - message: "", -}; - -const baseResponseFlush: object = {}; - -const baseResponseInfo: object = { - data: "", - version: "", - appVersion: Long.UZERO, - lastBlockHeight: Long.ZERO, -}; - -const baseResponseSetOption: object = { - code: 0, - log: "", - info: "", -}; - -const baseResponseInitChain: object = {}; - -const baseResponseQuery: object = { - code: 0, - log: "", - info: "", - index: Long.ZERO, - height: Long.ZERO, - codespace: "", -}; - -const baseResponseBeginBlock: object = {}; - -const baseResponseCheckTx: object = { - code: 0, - log: "", - info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, - codespace: "", -}; - -const baseResponseDeliverTx: object = { - code: 0, - log: "", - info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, - codespace: "", -}; - -const baseResponseEndBlock: object = {}; - -const baseResponseCommit: object = { - retainHeight: Long.ZERO, -}; - -const baseResponseListSnapshots: object = {}; - -const baseResponseOfferSnapshot: object = { - result: 0, -}; - -const baseResponseLoadSnapshotChunk: object = {}; - -const baseResponseApplySnapshotChunk: object = { - result: 0, - refetchChunks: 0, - rejectSenders: "", -}; - -const baseConsensusParams: object = {}; - -const baseBlockParams: object = { - maxBytes: Long.ZERO, - maxGas: Long.ZERO, -}; - -const baseLastCommitInfo: object = { - round: 0, -}; - -const baseEvent: object = { - type: "", -}; - -const baseEventAttribute: object = { - index: false, -}; - -const baseTxResult: object = { - height: Long.ZERO, - index: 0, -}; - -const baseValidator: object = { - power: Long.ZERO, -}; - -const baseValidatorUpdate: object = { - power: Long.ZERO, -}; - -const baseVoteInfo: object = { - signedLastBlock: false, -}; - -const baseEvidence: object = { - type: 0, - height: Long.ZERO, - totalVotingPower: Long.ZERO, -}; - -const baseSnapshot: object = { - height: Long.UZERO, - format: 0, - chunks: 0, -}; - -export interface ABCIApplication { - Echo(request: RequestEcho): Promise; - - Flush(request: RequestFlush): Promise; - - Info(request: RequestInfo): Promise; - - SetOption(request: RequestSetOption): Promise; - - DeliverTx(request: RequestDeliverTx): Promise; - - CheckTx(request: RequestCheckTx): Promise; - - Query(request: RequestQuery): Promise; - - Commit(request: RequestCommit): Promise; - - InitChain(request: RequestInitChain): Promise; - - BeginBlock(request: RequestBeginBlock): Promise; - - EndBlock(request: RequestEndBlock): Promise; - - ListSnapshots(request: RequestListSnapshots): Promise; - - OfferSnapshot(request: RequestOfferSnapshot): Promise; - - LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; - - ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; -} - -export class ABCIApplicationClientImpl implements ABCIApplication { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - } - - Echo(request: RequestEcho): Promise { - const data = RequestEcho.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); - return promise.then((data) => ResponseEcho.decode(new Reader(data))); - } - - Flush(request: RequestFlush): Promise { - const data = RequestFlush.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); - return promise.then((data) => ResponseFlush.decode(new Reader(data))); - } - - Info(request: RequestInfo): Promise { - const data = RequestInfo.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); - return promise.then((data) => ResponseInfo.decode(new Reader(data))); - } - - SetOption(request: RequestSetOption): Promise { - const data = RequestSetOption.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "SetOption", data); - return promise.then((data) => ResponseSetOption.decode(new Reader(data))); - } - - DeliverTx(request: RequestDeliverTx): Promise { - const data = RequestDeliverTx.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); - return promise.then((data) => ResponseDeliverTx.decode(new Reader(data))); - } - - CheckTx(request: RequestCheckTx): Promise { - const data = RequestCheckTx.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); - return promise.then((data) => ResponseCheckTx.decode(new Reader(data))); - } - - Query(request: RequestQuery): Promise { - const data = RequestQuery.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); - return promise.then((data) => ResponseQuery.decode(new Reader(data))); - } - - Commit(request: RequestCommit): Promise { - const data = RequestCommit.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); - return promise.then((data) => ResponseCommit.decode(new Reader(data))); - } - - InitChain(request: RequestInitChain): Promise { - const data = RequestInitChain.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); - return promise.then((data) => ResponseInitChain.decode(new Reader(data))); - } - - BeginBlock(request: RequestBeginBlock): Promise { - const data = RequestBeginBlock.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); - return promise.then((data) => ResponseBeginBlock.decode(new Reader(data))); - } - - EndBlock(request: RequestEndBlock): Promise { - const data = RequestEndBlock.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); - return promise.then((data) => ResponseEndBlock.decode(new Reader(data))); - } - - ListSnapshots(request: RequestListSnapshots): Promise { - const data = RequestListSnapshots.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); - return promise.then((data) => ResponseListSnapshots.decode(new Reader(data))); - } - - OfferSnapshot(request: RequestOfferSnapshot): Promise { - const data = RequestOfferSnapshot.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); - return promise.then((data) => ResponseOfferSnapshot.decode(new Reader(data))); - } - - LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { - const data = RequestLoadSnapshotChunk.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); - return promise.then((data) => ResponseLoadSnapshotChunk.decode(new Reader(data))); - } - - ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { - const data = RequestApplySnapshotChunk.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); - return promise.then((data) => ResponseApplySnapshotChunk.decode(new Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function numberToLong(number: number) { - return Long.fromNumber(number); -} - export const protobufPackage = "tendermint.abci"; export enum CheckTxType { @@ -826,24 +79,233 @@ export function evidenceTypeToJSON(object: EvidenceType): string { } } +export interface Request { + echo?: RequestEcho | undefined; + flush?: RequestFlush | undefined; + info?: RequestInfo | undefined; + setOption?: RequestSetOption | undefined; + initChain?: RequestInitChain | undefined; + query?: RequestQuery | undefined; + beginBlock?: RequestBeginBlock | undefined; + checkTx?: RequestCheckTx | undefined; + deliverTx?: RequestDeliverTx | undefined; + endBlock?: RequestEndBlock | undefined; + commit?: RequestCommit | undefined; + listSnapshots?: RequestListSnapshots | undefined; + offerSnapshot?: RequestOfferSnapshot | undefined; + loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined; + applySnapshotChunk?: RequestApplySnapshotChunk | undefined; +} + +export interface RequestEcho { + message: string; +} + +export interface RequestFlush {} + +export interface RequestInfo { + version: string; + blockVersion: Long; + p2pVersion: Long; +} + +/** nondeterministic */ +export interface RequestSetOption { + key: string; + value: string; +} + +export interface RequestInitChain { + time?: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: Long; +} + +export interface RequestQuery { + data: Uint8Array; + path: string; + height: Long; + prove: boolean; +} + +export interface RequestBeginBlock { + hash: Uint8Array; + header?: Header; + lastCommitInfo?: LastCommitInfo; + byzantineValidators: Evidence[]; +} + +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} + +export interface RequestDeliverTx { + tx: Uint8Array; +} + +export interface RequestEndBlock { + height: Long; +} + +export interface RequestCommit {} + +/** lists available snapshots */ +export interface RequestListSnapshots {} + +/** 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; +} + +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: Long; + format: number; + chunk: number; +} + +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} + +export interface Response { + exception?: ResponseException | undefined; + echo?: ResponseEcho | undefined; + flush?: ResponseFlush | undefined; + info?: ResponseInfo | undefined; + setOption?: ResponseSetOption | undefined; + initChain?: ResponseInitChain | undefined; + query?: ResponseQuery | undefined; + beginBlock?: ResponseBeginBlock | undefined; + checkTx?: ResponseCheckTx | undefined; + deliverTx?: ResponseDeliverTx | undefined; + endBlock?: ResponseEndBlock | undefined; + commit?: ResponseCommit | undefined; + listSnapshots?: ResponseListSnapshots | undefined; + offerSnapshot?: ResponseOfferSnapshot | undefined; + loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined; + applySnapshotChunk?: ResponseApplySnapshotChunk | undefined; +} + +/** nondeterministic */ +export interface ResponseException { + error: string; +} + +export interface ResponseEcho { + message: string; +} + +export interface ResponseFlush {} + +export interface ResponseInfo { + data: string; + version: string; + appVersion: Long; + lastBlockHeight: Long; + lastBlockAppHash: Uint8Array; +} + +/** nondeterministic */ +export interface ResponseSetOption { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} + +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: 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 ResponseBeginBlock { + events: Event[]; +} + +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + 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 ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates?: ConsensusParams; + events: Event[]; +} + +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: Long; +} + +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} + +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} + export enum ResponseOfferSnapshot_Result { - /** UNKNOWN - Unknown result, abort all snapshot restoration - */ + /** UNKNOWN - Unknown result, abort all snapshot restoration */ UNKNOWN = 0, - /** ACCEPT - Snapshot accepted, apply chunks - */ + /** ACCEPT - Snapshot accepted, apply chunks */ ACCEPT = 1, - /** ABORT - Abort all snapshot restoration - */ + /** ABORT - Abort all snapshot restoration */ ABORT = 2, - /** REJECT - Reject this specific snapshot, try others - */ + /** REJECT - Reject this specific snapshot, try others */ REJECT = 3, - /** REJECT_FORMAT - Reject all snapshots of this format, try others - */ + /** 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 - Reject all snapshots from the sender(s), try others */ REJECT_SENDER = 5, UNRECOGNIZED = -1, } @@ -894,24 +356,30 @@ export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot } } +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} + +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} + export enum ResponseApplySnapshotChunk_Result { - /** UNKNOWN - Unknown result, abort all snapshot restoration - */ + /** UNKNOWN - Unknown result, abort all snapshot restoration */ UNKNOWN = 0, - /** ACCEPT - Chunk successfully accepted - */ + /** ACCEPT - Chunk successfully accepted */ ACCEPT = 1, - /** ABORT - Abort all snapshot restoration - */ + /** ABORT - Abort all snapshot restoration */ ABORT = 2, - /** RETRY - Retry chunk (combine with refetch and reject) - */ + /** RETRY - Retry chunk (combine with refetch and reject) */ RETRY = 3, - /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) - */ + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ RETRY_SNAPSHOT = 4, - /** REJECT_SNAPSHOT - Reject this snapshot, try others - */ + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ REJECT_SNAPSHOT = 5, UNRECOGNIZED = -1, } @@ -962,6 +430,111 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna } } +/** + * 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; +} + +/** 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 LastCommitInfo { + round: number; + votes: VoteInfo[]; +} + +/** + * 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[]; +} + +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: Uint8Array; + value: Uint8Array; + /** nondeterministic */ + 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; +} + +/** Validator */ +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: Long; +} + +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey?: PublicKey; + power: Long; +} + +/** VoteInfo */ +export interface VoteInfo { + validator?: Validator; + signedLastBlock: 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 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; +} + +const baseRequest: object = {}; + export const Request = { encode(message: Request, writer: Writer = Writer.create()): Writer { if (message.echo !== undefined) { @@ -1011,7 +584,8 @@ export const Request = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Request { + + decode(input: Reader | Uint8Array, length?: number): Request { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequest } as Request; @@ -1070,6 +644,7 @@ export const Request = { } return message; }, + fromJSON(object: any): Request { const message = { ...baseRequest } as Request; if (object.echo !== undefined && object.echo !== null) { @@ -1149,6 +724,7 @@ export const Request = { } return message; }, + fromPartial(object: DeepPartial): Request { const message = { ...baseRequest } as Request; if (object.echo !== undefined && object.echo !== null) { @@ -1228,6 +804,7 @@ export const Request = { } return message; }, + toJSON(message: Request): unknown { const obj: any = {}; message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); @@ -1270,12 +847,15 @@ export const Request = { }, }; +const baseRequestEcho: object = { message: "" }; + export const RequestEcho = { encode(message: RequestEcho, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.message); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestEcho { + + decode(input: Reader | Uint8Array, length?: number): RequestEcho { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestEcho } as RequestEcho; @@ -1292,6 +872,7 @@ export const RequestEcho = { } return message; }, + fromJSON(object: any): RequestEcho { const message = { ...baseRequestEcho } as RequestEcho; if (object.message !== undefined && object.message !== null) { @@ -1301,6 +882,7 @@ export const RequestEcho = { } return message; }, + fromPartial(object: DeepPartial): RequestEcho { const message = { ...baseRequestEcho } as RequestEcho; if (object.message !== undefined && object.message !== null) { @@ -1310,6 +892,7 @@ export const RequestEcho = { } return message; }, + toJSON(message: RequestEcho): unknown { const obj: any = {}; message.message !== undefined && (obj.message = message.message); @@ -1317,11 +900,14 @@ export const RequestEcho = { }, }; +const baseRequestFlush: object = {}; + export const RequestFlush = { encode(_: RequestFlush, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestFlush { + + decode(input: Reader | Uint8Array, length?: number): RequestFlush { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestFlush } as RequestFlush; @@ -1335,20 +921,25 @@ export const RequestFlush = { } return message; }, + fromJSON(_: any): RequestFlush { const message = { ...baseRequestFlush } as RequestFlush; return message; }, + fromPartial(_: DeepPartial): RequestFlush { const message = { ...baseRequestFlush } as RequestFlush; return message; }, + toJSON(_: RequestFlush): unknown { const obj: any = {}; return obj; }, }; +const baseRequestInfo: object = { version: "", blockVersion: Long.UZERO, p2pVersion: Long.UZERO }; + export const RequestInfo = { encode(message: RequestInfo, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.version); @@ -1356,7 +947,8 @@ export const RequestInfo = { writer.uint32(24).uint64(message.p2pVersion); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestInfo { + + decode(input: Reader | Uint8Array, length?: number): RequestInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestInfo } as RequestInfo; @@ -1379,6 +971,7 @@ export const RequestInfo = { } return message; }, + fromJSON(object: any): RequestInfo { const message = { ...baseRequestInfo } as RequestInfo; if (object.version !== undefined && object.version !== null) { @@ -1398,6 +991,7 @@ export const RequestInfo = { } return message; }, + fromPartial(object: DeepPartial): RequestInfo { const message = { ...baseRequestInfo } as RequestInfo; if (object.version !== undefined && object.version !== null) { @@ -1417,6 +1011,7 @@ export const RequestInfo = { } return message; }, + toJSON(message: RequestInfo): unknown { const obj: any = {}; message.version !== undefined && (obj.version = message.version); @@ -1427,13 +1022,16 @@ export const RequestInfo = { }, }; +const baseRequestSetOption: object = { key: "", value: "" }; + export const RequestSetOption = { encode(message: RequestSetOption, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.key); writer.uint32(18).string(message.value); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestSetOption { + + decode(input: Reader | Uint8Array, length?: number): RequestSetOption { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestSetOption } as RequestSetOption; @@ -1453,6 +1051,7 @@ export const RequestSetOption = { } return message; }, + fromJSON(object: any): RequestSetOption { const message = { ...baseRequestSetOption } as RequestSetOption; if (object.key !== undefined && object.key !== null) { @@ -1467,6 +1066,7 @@ export const RequestSetOption = { } return message; }, + fromPartial(object: DeepPartial): RequestSetOption { const message = { ...baseRequestSetOption } as RequestSetOption; if (object.key !== undefined && object.key !== null) { @@ -1481,6 +1081,7 @@ export const RequestSetOption = { } return message; }, + toJSON(message: RequestSetOption): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); @@ -1489,6 +1090,8 @@ export const RequestSetOption = { }, }; +const baseRequestInitChain: object = { chainId: "", initialHeight: Long.ZERO }; + export const RequestInitChain = { encode(message: RequestInitChain, writer: Writer = Writer.create()): Writer { if (message.time !== undefined && message.time !== undefined) { @@ -1505,7 +1108,8 @@ export const RequestInitChain = { writer.uint32(48).int64(message.initialHeight); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestInitChain { + + decode(input: Reader | Uint8Array, length?: number): RequestInitChain { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestInitChain } as RequestInitChain; @@ -1538,6 +1142,7 @@ export const RequestInitChain = { } return message; }, + fromJSON(object: any): RequestInitChain { const message = { ...baseRequestInitChain } as RequestInitChain; message.validators = []; @@ -1571,6 +1176,7 @@ export const RequestInitChain = { } return message; }, + fromPartial(object: DeepPartial): RequestInitChain { const message = { ...baseRequestInitChain } as RequestInitChain; message.validators = []; @@ -1606,6 +1212,7 @@ export const RequestInitChain = { } return message; }, + toJSON(message: RequestInitChain): unknown { const obj: any = {}; message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null); @@ -1629,6 +1236,8 @@ export const RequestInitChain = { }, }; +const baseRequestQuery: object = { path: "", height: Long.ZERO, prove: false }; + export const RequestQuery = { encode(message: RequestQuery, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.data); @@ -1637,7 +1246,8 @@ export const RequestQuery = { writer.uint32(32).bool(message.prove); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestQuery { + + decode(input: Reader | Uint8Array, length?: number): RequestQuery { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestQuery } as RequestQuery; @@ -1663,6 +1273,7 @@ export const RequestQuery = { } return message; }, + fromJSON(object: any): RequestQuery { const message = { ...baseRequestQuery } as RequestQuery; if (object.data !== undefined && object.data !== null) { @@ -1685,6 +1296,7 @@ export const RequestQuery = { } return message; }, + fromPartial(object: DeepPartial): RequestQuery { const message = { ...baseRequestQuery } as RequestQuery; if (object.data !== undefined && object.data !== null) { @@ -1709,6 +1321,7 @@ export const RequestQuery = { } return message; }, + toJSON(message: RequestQuery): unknown { const obj: any = {}; message.data !== undefined && @@ -1720,6 +1333,8 @@ export const RequestQuery = { }, }; +const baseRequestBeginBlock: object = {}; + export const RequestBeginBlock = { encode(message: RequestBeginBlock, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.hash); @@ -1734,7 +1349,8 @@ export const RequestBeginBlock = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestBeginBlock { + + decode(input: Reader | Uint8Array, length?: number): RequestBeginBlock { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestBeginBlock } as RequestBeginBlock; @@ -1761,6 +1377,7 @@ export const RequestBeginBlock = { } return message; }, + fromJSON(object: any): RequestBeginBlock { const message = { ...baseRequestBeginBlock } as RequestBeginBlock; message.byzantineValidators = []; @@ -1784,6 +1401,7 @@ export const RequestBeginBlock = { } return message; }, + fromPartial(object: DeepPartial): RequestBeginBlock { const message = { ...baseRequestBeginBlock } as RequestBeginBlock; message.byzantineValidators = []; @@ -1809,6 +1427,7 @@ export const RequestBeginBlock = { } return message; }, + toJSON(message: RequestBeginBlock): unknown { const obj: any = {}; message.hash !== undefined && @@ -1827,13 +1446,16 @@ export const RequestBeginBlock = { }, }; +const baseRequestCheckTx: object = { type: 0 }; + export const RequestCheckTx = { encode(message: RequestCheckTx, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.tx); writer.uint32(16).int32(message.type); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestCheckTx { + + decode(input: Reader | Uint8Array, length?: number): RequestCheckTx { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestCheckTx } as RequestCheckTx; @@ -1853,6 +1475,7 @@ export const RequestCheckTx = { } return message; }, + fromJSON(object: any): RequestCheckTx { const message = { ...baseRequestCheckTx } as RequestCheckTx; if (object.tx !== undefined && object.tx !== null) { @@ -1865,6 +1488,7 @@ export const RequestCheckTx = { } return message; }, + fromPartial(object: DeepPartial): RequestCheckTx { const message = { ...baseRequestCheckTx } as RequestCheckTx; if (object.tx !== undefined && object.tx !== null) { @@ -1879,6 +1503,7 @@ export const RequestCheckTx = { } return message; }, + toJSON(message: RequestCheckTx): unknown { const obj: any = {}; message.tx !== undefined && @@ -1888,12 +1513,15 @@ export const RequestCheckTx = { }, }; +const baseRequestDeliverTx: object = {}; + export const RequestDeliverTx = { encode(message: RequestDeliverTx, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.tx); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestDeliverTx { + + decode(input: Reader | Uint8Array, length?: number): RequestDeliverTx { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestDeliverTx } as RequestDeliverTx; @@ -1910,6 +1538,7 @@ export const RequestDeliverTx = { } return message; }, + fromJSON(object: any): RequestDeliverTx { const message = { ...baseRequestDeliverTx } as RequestDeliverTx; if (object.tx !== undefined && object.tx !== null) { @@ -1917,6 +1546,7 @@ export const RequestDeliverTx = { } return message; }, + fromPartial(object: DeepPartial): RequestDeliverTx { const message = { ...baseRequestDeliverTx } as RequestDeliverTx; if (object.tx !== undefined && object.tx !== null) { @@ -1926,6 +1556,7 @@ export const RequestDeliverTx = { } return message; }, + toJSON(message: RequestDeliverTx): unknown { const obj: any = {}; message.tx !== undefined && @@ -1934,12 +1565,15 @@ export const RequestDeliverTx = { }, }; +const baseRequestEndBlock: object = { height: Long.ZERO }; + export const RequestEndBlock = { encode(message: RequestEndBlock, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.height); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestEndBlock { + + decode(input: Reader | Uint8Array, length?: number): RequestEndBlock { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestEndBlock } as RequestEndBlock; @@ -1956,6 +1590,7 @@ export const RequestEndBlock = { } return message; }, + fromJSON(object: any): RequestEndBlock { const message = { ...baseRequestEndBlock } as RequestEndBlock; if (object.height !== undefined && object.height !== null) { @@ -1965,6 +1600,7 @@ export const RequestEndBlock = { } return message; }, + fromPartial(object: DeepPartial): RequestEndBlock { const message = { ...baseRequestEndBlock } as RequestEndBlock; if (object.height !== undefined && object.height !== null) { @@ -1974,6 +1610,7 @@ export const RequestEndBlock = { } return message; }, + toJSON(message: RequestEndBlock): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); @@ -1981,11 +1618,14 @@ export const RequestEndBlock = { }, }; +const baseRequestCommit: object = {}; + export const RequestCommit = { encode(_: RequestCommit, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestCommit { + + decode(input: Reader | Uint8Array, length?: number): RequestCommit { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestCommit } as RequestCommit; @@ -1999,25 +1639,31 @@ export const RequestCommit = { } return message; }, + fromJSON(_: any): RequestCommit { const message = { ...baseRequestCommit } as RequestCommit; return message; }, + fromPartial(_: DeepPartial): RequestCommit { const message = { ...baseRequestCommit } as RequestCommit; return message; }, + toJSON(_: RequestCommit): unknown { const obj: any = {}; return obj; }, }; +const baseRequestListSnapshots: object = {}; + export const RequestListSnapshots = { encode(_: RequestListSnapshots, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestListSnapshots { + + decode(input: Reader | Uint8Array, length?: number): RequestListSnapshots { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestListSnapshots } as RequestListSnapshots; @@ -2031,20 +1677,25 @@ export const RequestListSnapshots = { } return message; }, + fromJSON(_: any): RequestListSnapshots { const message = { ...baseRequestListSnapshots } as RequestListSnapshots; return message; }, + fromPartial(_: DeepPartial): RequestListSnapshots { const message = { ...baseRequestListSnapshots } as RequestListSnapshots; return message; }, + toJSON(_: RequestListSnapshots): unknown { const obj: any = {}; return obj; }, }; +const baseRequestOfferSnapshot: object = {}; + export const RequestOfferSnapshot = { encode(message: RequestOfferSnapshot, writer: Writer = Writer.create()): Writer { if (message.snapshot !== undefined && message.snapshot !== undefined) { @@ -2053,7 +1704,8 @@ export const RequestOfferSnapshot = { writer.uint32(18).bytes(message.appHash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestOfferSnapshot { + + decode(input: Reader | Uint8Array, length?: number): RequestOfferSnapshot { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; @@ -2073,6 +1725,7 @@ export const RequestOfferSnapshot = { } return message; }, + fromJSON(object: any): RequestOfferSnapshot { const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; if (object.snapshot !== undefined && object.snapshot !== null) { @@ -2085,6 +1738,7 @@ export const RequestOfferSnapshot = { } return message; }, + fromPartial(object: DeepPartial): RequestOfferSnapshot { const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; if (object.snapshot !== undefined && object.snapshot !== null) { @@ -2099,6 +1753,7 @@ export const RequestOfferSnapshot = { } return message; }, + toJSON(message: RequestOfferSnapshot): unknown { const obj: any = {}; message.snapshot !== undefined && @@ -2109,6 +1764,8 @@ export const RequestOfferSnapshot = { }, }; +const baseRequestLoadSnapshotChunk: object = { height: Long.UZERO, format: 0, chunk: 0 }; + export const RequestLoadSnapshotChunk = { encode(message: RequestLoadSnapshotChunk, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.height); @@ -2116,7 +1773,8 @@ export const RequestLoadSnapshotChunk = { writer.uint32(24).uint32(message.chunk); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestLoadSnapshotChunk { + + decode(input: Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; @@ -2139,6 +1797,7 @@ export const RequestLoadSnapshotChunk = { } return message; }, + fromJSON(object: any): RequestLoadSnapshotChunk { const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; if (object.height !== undefined && object.height !== null) { @@ -2158,6 +1817,7 @@ export const RequestLoadSnapshotChunk = { } return message; }, + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; if (object.height !== undefined && object.height !== null) { @@ -2177,6 +1837,7 @@ export const RequestLoadSnapshotChunk = { } return message; }, + toJSON(message: RequestLoadSnapshotChunk): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); @@ -2186,6 +1847,8 @@ export const RequestLoadSnapshotChunk = { }, }; +const baseRequestApplySnapshotChunk: object = { index: 0, sender: "" }; + export const RequestApplySnapshotChunk = { encode(message: RequestApplySnapshotChunk, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.index); @@ -2193,7 +1856,8 @@ export const RequestApplySnapshotChunk = { writer.uint32(26).string(message.sender); return writer; }, - decode(input: Uint8Array | Reader, length?: number): RequestApplySnapshotChunk { + + decode(input: Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; @@ -2216,6 +1880,7 @@ export const RequestApplySnapshotChunk = { } return message; }, + fromJSON(object: any): RequestApplySnapshotChunk { const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; if (object.index !== undefined && object.index !== null) { @@ -2233,6 +1898,7 @@ export const RequestApplySnapshotChunk = { } return message; }, + fromPartial(object: DeepPartial): RequestApplySnapshotChunk { const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; if (object.index !== undefined && object.index !== null) { @@ -2252,6 +1918,7 @@ export const RequestApplySnapshotChunk = { } return message; }, + toJSON(message: RequestApplySnapshotChunk): unknown { const obj: any = {}; message.index !== undefined && (obj.index = message.index); @@ -2262,6 +1929,8 @@ export const RequestApplySnapshotChunk = { }, }; +const baseResponse: object = {}; + export const Response = { encode(message: Response, writer: Writer = Writer.create()): Writer { if (message.exception !== undefined) { @@ -2314,7 +1983,8 @@ export const Response = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Response { + + decode(input: Reader | Uint8Array, length?: number): Response { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponse } as Response; @@ -2376,6 +2046,7 @@ export const Response = { } return message; }, + fromJSON(object: any): Response { const message = { ...baseResponse } as Response; if (object.exception !== undefined && object.exception !== null) { @@ -2460,6 +2131,7 @@ export const Response = { } return message; }, + fromPartial(object: DeepPartial): Response { const message = { ...baseResponse } as Response; if (object.exception !== undefined && object.exception !== null) { @@ -2544,6 +2216,7 @@ export const Response = { } return message; }, + toJSON(message: Response): unknown { const obj: any = {}; message.exception !== undefined && @@ -2588,12 +2261,15 @@ export const Response = { }, }; +const baseResponseException: object = { error: "" }; + export const ResponseException = { encode(message: ResponseException, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.error); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseException { + + decode(input: Reader | Uint8Array, length?: number): ResponseException { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseException } as ResponseException; @@ -2610,6 +2286,7 @@ export const ResponseException = { } return message; }, + fromJSON(object: any): ResponseException { const message = { ...baseResponseException } as ResponseException; if (object.error !== undefined && object.error !== null) { @@ -2619,6 +2296,7 @@ export const ResponseException = { } return message; }, + fromPartial(object: DeepPartial): ResponseException { const message = { ...baseResponseException } as ResponseException; if (object.error !== undefined && object.error !== null) { @@ -2628,6 +2306,7 @@ export const ResponseException = { } return message; }, + toJSON(message: ResponseException): unknown { const obj: any = {}; message.error !== undefined && (obj.error = message.error); @@ -2635,12 +2314,15 @@ export const ResponseException = { }, }; +const baseResponseEcho: object = { message: "" }; + export const ResponseEcho = { encode(message: ResponseEcho, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.message); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseEcho { + + decode(input: Reader | Uint8Array, length?: number): ResponseEcho { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseEcho } as ResponseEcho; @@ -2657,6 +2339,7 @@ export const ResponseEcho = { } return message; }, + fromJSON(object: any): ResponseEcho { const message = { ...baseResponseEcho } as ResponseEcho; if (object.message !== undefined && object.message !== null) { @@ -2666,6 +2349,7 @@ export const ResponseEcho = { } return message; }, + fromPartial(object: DeepPartial): ResponseEcho { const message = { ...baseResponseEcho } as ResponseEcho; if (object.message !== undefined && object.message !== null) { @@ -2675,6 +2359,7 @@ export const ResponseEcho = { } return message; }, + toJSON(message: ResponseEcho): unknown { const obj: any = {}; message.message !== undefined && (obj.message = message.message); @@ -2682,11 +2367,14 @@ export const ResponseEcho = { }, }; +const baseResponseFlush: object = {}; + export const ResponseFlush = { encode(_: ResponseFlush, writer: Writer = Writer.create()): Writer { return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseFlush { + + decode(input: Reader | Uint8Array, length?: number): ResponseFlush { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseFlush } as ResponseFlush; @@ -2700,20 +2388,30 @@ export const ResponseFlush = { } return message; }, + fromJSON(_: any): ResponseFlush { const message = { ...baseResponseFlush } as ResponseFlush; return message; }, + fromPartial(_: DeepPartial): ResponseFlush { const message = { ...baseResponseFlush } as ResponseFlush; return message; }, + toJSON(_: ResponseFlush): unknown { const obj: any = {}; return obj; }, }; +const baseResponseInfo: object = { + data: "", + version: "", + appVersion: Long.UZERO, + lastBlockHeight: Long.ZERO, +}; + export const ResponseInfo = { encode(message: ResponseInfo, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.data); @@ -2723,7 +2421,8 @@ export const ResponseInfo = { writer.uint32(42).bytes(message.lastBlockAppHash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseInfo { + + decode(input: Reader | Uint8Array, length?: number): ResponseInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseInfo } as ResponseInfo; @@ -2752,6 +2451,7 @@ export const ResponseInfo = { } return message; }, + fromJSON(object: any): ResponseInfo { const message = { ...baseResponseInfo } as ResponseInfo; if (object.data !== undefined && object.data !== null) { @@ -2779,6 +2479,7 @@ export const ResponseInfo = { } return message; }, + fromPartial(object: DeepPartial): ResponseInfo { const message = { ...baseResponseInfo } as ResponseInfo; if (object.data !== undefined && object.data !== null) { @@ -2808,6 +2509,7 @@ export const ResponseInfo = { } return message; }, + toJSON(message: ResponseInfo): unknown { const obj: any = {}; message.data !== undefined && (obj.data = message.data); @@ -2823,6 +2525,8 @@ export const ResponseInfo = { }, }; +const baseResponseSetOption: object = { code: 0, log: "", info: "" }; + export const ResponseSetOption = { encode(message: ResponseSetOption, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.code); @@ -2830,7 +2534,8 @@ export const ResponseSetOption = { writer.uint32(34).string(message.info); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseSetOption { + + decode(input: Reader | Uint8Array, length?: number): ResponseSetOption { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseSetOption } as ResponseSetOption; @@ -2853,6 +2558,7 @@ export const ResponseSetOption = { } return message; }, + fromJSON(object: any): ResponseSetOption { const message = { ...baseResponseSetOption } as ResponseSetOption; if (object.code !== undefined && object.code !== null) { @@ -2872,6 +2578,7 @@ export const ResponseSetOption = { } return message; }, + fromPartial(object: DeepPartial): ResponseSetOption { const message = { ...baseResponseSetOption } as ResponseSetOption; if (object.code !== undefined && object.code !== null) { @@ -2891,6 +2598,7 @@ export const ResponseSetOption = { } return message; }, + toJSON(message: ResponseSetOption): unknown { const obj: any = {}; message.code !== undefined && (obj.code = message.code); @@ -2900,6 +2608,8 @@ export const ResponseSetOption = { }, }; +const baseResponseInitChain: object = {}; + export const ResponseInitChain = { encode(message: ResponseInitChain, writer: Writer = Writer.create()): Writer { if (message.consensusParams !== undefined && message.consensusParams !== undefined) { @@ -2911,7 +2621,8 @@ export const ResponseInitChain = { writer.uint32(26).bytes(message.appHash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseInitChain { + + decode(input: Reader | Uint8Array, length?: number): ResponseInitChain { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseInitChain } as ResponseInitChain; @@ -2935,6 +2646,7 @@ export const ResponseInitChain = { } return message; }, + fromJSON(object: any): ResponseInitChain { const message = { ...baseResponseInitChain } as ResponseInitChain; message.validators = []; @@ -2953,6 +2665,7 @@ export const ResponseInitChain = { } return message; }, + fromPartial(object: DeepPartial): ResponseInitChain { const message = { ...baseResponseInitChain } as ResponseInitChain; message.validators = []; @@ -2973,6 +2686,7 @@ export const ResponseInitChain = { } return message; }, + toJSON(message: ResponseInitChain): unknown { const obj: any = {}; message.consensusParams !== undefined && @@ -2990,6 +2704,15 @@ export const ResponseInitChain = { }, }; +const baseResponseQuery: object = { + code: 0, + log: "", + info: "", + index: Long.ZERO, + height: Long.ZERO, + codespace: "", +}; + export const ResponseQuery = { encode(message: ResponseQuery, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.code); @@ -3005,7 +2728,8 @@ export const ResponseQuery = { writer.uint32(82).string(message.codespace); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseQuery { + + decode(input: Reader | Uint8Array, length?: number): ResponseQuery { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseQuery } as ResponseQuery; @@ -3046,6 +2770,7 @@ export const ResponseQuery = { } return message; }, + fromJSON(object: any): ResponseQuery { const message = { ...baseResponseQuery } as ResponseQuery; if (object.code !== undefined && object.code !== null) { @@ -3091,6 +2816,7 @@ export const ResponseQuery = { } return message; }, + fromPartial(object: DeepPartial): ResponseQuery { const message = { ...baseResponseQuery } as ResponseQuery; if (object.code !== undefined && object.code !== null) { @@ -3140,6 +2866,7 @@ export const ResponseQuery = { } return message; }, + toJSON(message: ResponseQuery): unknown { const obj: any = {}; message.code !== undefined && (obj.code = message.code); @@ -3158,6 +2885,8 @@ export const ResponseQuery = { }, }; +const baseResponseBeginBlock: object = {}; + export const ResponseBeginBlock = { encode(message: ResponseBeginBlock, writer: Writer = Writer.create()): Writer { for (const v of message.events) { @@ -3165,7 +2894,8 @@ export const ResponseBeginBlock = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseBeginBlock { + + decode(input: Reader | Uint8Array, length?: number): ResponseBeginBlock { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; @@ -3183,6 +2913,7 @@ export const ResponseBeginBlock = { } return message; }, + fromJSON(object: any): ResponseBeginBlock { const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; message.events = []; @@ -3193,6 +2924,7 @@ export const ResponseBeginBlock = { } return message; }, + fromPartial(object: DeepPartial): ResponseBeginBlock { const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; message.events = []; @@ -3203,6 +2935,7 @@ export const ResponseBeginBlock = { } return message; }, + toJSON(message: ResponseBeginBlock): unknown { const obj: any = {}; if (message.events) { @@ -3214,6 +2947,15 @@ export const ResponseBeginBlock = { }, }; +const baseResponseCheckTx: object = { + code: 0, + log: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + codespace: "", +}; + export const ResponseCheckTx = { encode(message: ResponseCheckTx, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.code); @@ -3228,7 +2970,8 @@ export const ResponseCheckTx = { writer.uint32(66).string(message.codespace); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseCheckTx { + + decode(input: Reader | Uint8Array, length?: number): ResponseCheckTx { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseCheckTx } as ResponseCheckTx; @@ -3267,6 +3010,7 @@ export const ResponseCheckTx = { } return message; }, + fromJSON(object: any): ResponseCheckTx { const message = { ...baseResponseCheckTx } as ResponseCheckTx; message.events = []; @@ -3310,6 +3054,7 @@ export const ResponseCheckTx = { } return message; }, + fromPartial(object: DeepPartial): ResponseCheckTx { const message = { ...baseResponseCheckTx } as ResponseCheckTx; message.events = []; @@ -3355,6 +3100,7 @@ export const ResponseCheckTx = { } return message; }, + toJSON(message: ResponseCheckTx): unknown { const obj: any = {}; message.code !== undefined && (obj.code = message.code); @@ -3374,6 +3120,15 @@ export const ResponseCheckTx = { }, }; +const baseResponseDeliverTx: object = { + code: 0, + log: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + codespace: "", +}; + export const ResponseDeliverTx = { encode(message: ResponseDeliverTx, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.code); @@ -3388,7 +3143,8 @@ export const ResponseDeliverTx = { writer.uint32(66).string(message.codespace); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseDeliverTx { + + decode(input: Reader | Uint8Array, length?: number): ResponseDeliverTx { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; @@ -3427,6 +3183,7 @@ export const ResponseDeliverTx = { } return message; }, + fromJSON(object: any): ResponseDeliverTx { const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; message.events = []; @@ -3470,6 +3227,7 @@ export const ResponseDeliverTx = { } return message; }, + fromPartial(object: DeepPartial): ResponseDeliverTx { const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; message.events = []; @@ -3515,6 +3273,7 @@ export const ResponseDeliverTx = { } return message; }, + toJSON(message: ResponseDeliverTx): unknown { const obj: any = {}; message.code !== undefined && (obj.code = message.code); @@ -3534,6 +3293,8 @@ export const ResponseDeliverTx = { }, }; +const baseResponseEndBlock: object = {}; + export const ResponseEndBlock = { encode(message: ResponseEndBlock, writer: Writer = Writer.create()): Writer { for (const v of message.validatorUpdates) { @@ -3547,7 +3308,8 @@ export const ResponseEndBlock = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseEndBlock { + + decode(input: Reader | Uint8Array, length?: number): ResponseEndBlock { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseEndBlock } as ResponseEndBlock; @@ -3572,6 +3334,7 @@ export const ResponseEndBlock = { } return message; }, + fromJSON(object: any): ResponseEndBlock { const message = { ...baseResponseEndBlock } as ResponseEndBlock; message.validatorUpdates = []; @@ -3593,6 +3356,7 @@ export const ResponseEndBlock = { } return message; }, + fromPartial(object: DeepPartial): ResponseEndBlock { const message = { ...baseResponseEndBlock } as ResponseEndBlock; message.validatorUpdates = []; @@ -3614,6 +3378,7 @@ export const ResponseEndBlock = { } return message; }, + toJSON(message: ResponseEndBlock): unknown { const obj: any = {}; if (message.validatorUpdates) { @@ -3634,13 +3399,16 @@ export const ResponseEndBlock = { }, }; +const baseResponseCommit: object = { retainHeight: Long.ZERO }; + export const ResponseCommit = { encode(message: ResponseCommit, writer: Writer = Writer.create()): Writer { writer.uint32(18).bytes(message.data); writer.uint32(24).int64(message.retainHeight); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseCommit { + + decode(input: Reader | Uint8Array, length?: number): ResponseCommit { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseCommit } as ResponseCommit; @@ -3660,6 +3428,7 @@ export const ResponseCommit = { } return message; }, + fromJSON(object: any): ResponseCommit { const message = { ...baseResponseCommit } as ResponseCommit; if (object.data !== undefined && object.data !== null) { @@ -3672,6 +3441,7 @@ export const ResponseCommit = { } return message; }, + fromPartial(object: DeepPartial): ResponseCommit { const message = { ...baseResponseCommit } as ResponseCommit; if (object.data !== undefined && object.data !== null) { @@ -3686,6 +3456,7 @@ export const ResponseCommit = { } return message; }, + toJSON(message: ResponseCommit): unknown { const obj: any = {}; message.data !== undefined && @@ -3695,6 +3466,8 @@ export const ResponseCommit = { }, }; +const baseResponseListSnapshots: object = {}; + export const ResponseListSnapshots = { encode(message: ResponseListSnapshots, writer: Writer = Writer.create()): Writer { for (const v of message.snapshots) { @@ -3702,7 +3475,8 @@ export const ResponseListSnapshots = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseListSnapshots { + + decode(input: Reader | Uint8Array, length?: number): ResponseListSnapshots { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; @@ -3720,6 +3494,7 @@ export const ResponseListSnapshots = { } return message; }, + fromJSON(object: any): ResponseListSnapshots { const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; message.snapshots = []; @@ -3730,6 +3505,7 @@ export const ResponseListSnapshots = { } return message; }, + fromPartial(object: DeepPartial): ResponseListSnapshots { const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; message.snapshots = []; @@ -3740,6 +3516,7 @@ export const ResponseListSnapshots = { } return message; }, + toJSON(message: ResponseListSnapshots): unknown { const obj: any = {}; if (message.snapshots) { @@ -3751,12 +3528,15 @@ export const ResponseListSnapshots = { }, }; +const baseResponseOfferSnapshot: object = { result: 0 }; + export const ResponseOfferSnapshot = { encode(message: ResponseOfferSnapshot, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.result); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseOfferSnapshot { + + decode(input: Reader | Uint8Array, length?: number): ResponseOfferSnapshot { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; @@ -3773,6 +3553,7 @@ export const ResponseOfferSnapshot = { } return message; }, + fromJSON(object: any): ResponseOfferSnapshot { const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; if (object.result !== undefined && object.result !== null) { @@ -3782,6 +3563,7 @@ export const ResponseOfferSnapshot = { } return message; }, + fromPartial(object: DeepPartial): ResponseOfferSnapshot { const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; if (object.result !== undefined && object.result !== null) { @@ -3791,6 +3573,7 @@ export const ResponseOfferSnapshot = { } return message; }, + toJSON(message: ResponseOfferSnapshot): unknown { const obj: any = {}; message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); @@ -3798,12 +3581,15 @@ export const ResponseOfferSnapshot = { }, }; +const baseResponseLoadSnapshotChunk: object = {}; + export const ResponseLoadSnapshotChunk = { encode(message: ResponseLoadSnapshotChunk, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.chunk); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseLoadSnapshotChunk { + + decode(input: Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; @@ -3820,6 +3606,7 @@ export const ResponseLoadSnapshotChunk = { } return message; }, + fromJSON(object: any): ResponseLoadSnapshotChunk { const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; if (object.chunk !== undefined && object.chunk !== null) { @@ -3827,6 +3614,7 @@ export const ResponseLoadSnapshotChunk = { } return message; }, + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; if (object.chunk !== undefined && object.chunk !== null) { @@ -3836,6 +3624,7 @@ export const ResponseLoadSnapshotChunk = { } return message; }, + toJSON(message: ResponseLoadSnapshotChunk): unknown { const obj: any = {}; message.chunk !== undefined && @@ -3844,6 +3633,8 @@ export const ResponseLoadSnapshotChunk = { }, }; +const baseResponseApplySnapshotChunk: object = { result: 0, refetchChunks: 0, rejectSenders: "" }; + export const ResponseApplySnapshotChunk = { encode(message: ResponseApplySnapshotChunk, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.result); @@ -3857,7 +3648,8 @@ export const ResponseApplySnapshotChunk = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ResponseApplySnapshotChunk { + + decode(input: Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; @@ -3889,6 +3681,7 @@ export const ResponseApplySnapshotChunk = { } return message; }, + fromJSON(object: any): ResponseApplySnapshotChunk { const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; message.refetchChunks = []; @@ -3910,6 +3703,7 @@ export const ResponseApplySnapshotChunk = { } return message; }, + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; message.refetchChunks = []; @@ -3931,6 +3725,7 @@ export const ResponseApplySnapshotChunk = { } return message; }, + toJSON(message: ResponseApplySnapshotChunk): unknown { const obj: any = {}; message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); @@ -3948,6 +3743,8 @@ export const ResponseApplySnapshotChunk = { }, }; +const baseConsensusParams: object = {}; + export const ConsensusParams = { encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { if (message.block !== undefined && message.block !== undefined) { @@ -3964,7 +3761,8 @@ export const ConsensusParams = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ConsensusParams { + + decode(input: Reader | Uint8Array, length?: number): ConsensusParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConsensusParams } as ConsensusParams; @@ -3990,6 +3788,7 @@ export const ConsensusParams = { } return message; }, + fromJSON(object: any): ConsensusParams { const message = { ...baseConsensusParams } as ConsensusParams; if (object.block !== undefined && object.block !== null) { @@ -4014,6 +3813,7 @@ export const ConsensusParams = { } return message; }, + fromPartial(object: DeepPartial): ConsensusParams { const message = { ...baseConsensusParams } as ConsensusParams; if (object.block !== undefined && object.block !== null) { @@ -4038,6 +3838,7 @@ export const ConsensusParams = { } return message; }, + toJSON(message: ConsensusParams): unknown { const obj: any = {}; message.block !== undefined && @@ -4052,13 +3853,16 @@ export const ConsensusParams = { }, }; +const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO }; + export const BlockParams = { encode(message: BlockParams, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.maxBytes); writer.uint32(16).int64(message.maxGas); return writer; }, - decode(input: Uint8Array | Reader, length?: number): BlockParams { + + decode(input: Reader | Uint8Array, length?: number): BlockParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBlockParams } as BlockParams; @@ -4078,6 +3882,7 @@ export const BlockParams = { } return message; }, + fromJSON(object: any): BlockParams { const message = { ...baseBlockParams } as BlockParams; if (object.maxBytes !== undefined && object.maxBytes !== null) { @@ -4092,6 +3897,7 @@ export const BlockParams = { } return message; }, + fromPartial(object: DeepPartial): BlockParams { const message = { ...baseBlockParams } as BlockParams; if (object.maxBytes !== undefined && object.maxBytes !== null) { @@ -4106,6 +3912,7 @@ export const BlockParams = { } return message; }, + toJSON(message: BlockParams): unknown { const obj: any = {}; message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); @@ -4114,6 +3921,8 @@ export const BlockParams = { }, }; +const baseLastCommitInfo: object = { round: 0 }; + export const LastCommitInfo = { encode(message: LastCommitInfo, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.round); @@ -4122,7 +3931,8 @@ export const LastCommitInfo = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): LastCommitInfo { + + decode(input: Reader | Uint8Array, length?: number): LastCommitInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseLastCommitInfo } as LastCommitInfo; @@ -4143,6 +3953,7 @@ export const LastCommitInfo = { } return message; }, + fromJSON(object: any): LastCommitInfo { const message = { ...baseLastCommitInfo } as LastCommitInfo; message.votes = []; @@ -4158,6 +3969,7 @@ export const LastCommitInfo = { } return message; }, + fromPartial(object: DeepPartial): LastCommitInfo { const message = { ...baseLastCommitInfo } as LastCommitInfo; message.votes = []; @@ -4173,6 +3985,7 @@ export const LastCommitInfo = { } return message; }, + toJSON(message: LastCommitInfo): unknown { const obj: any = {}; message.round !== undefined && (obj.round = message.round); @@ -4185,6 +3998,8 @@ export const LastCommitInfo = { }, }; +const baseEvent: object = { type: "" }; + export const Event = { encode(message: Event, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.type); @@ -4193,7 +4008,8 @@ export const Event = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Event { + + decode(input: Reader | Uint8Array, length?: number): Event { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEvent } as Event; @@ -4214,6 +4030,7 @@ export const Event = { } return message; }, + fromJSON(object: any): Event { const message = { ...baseEvent } as Event; message.attributes = []; @@ -4229,6 +4046,7 @@ export const Event = { } return message; }, + fromPartial(object: DeepPartial): Event { const message = { ...baseEvent } as Event; message.attributes = []; @@ -4244,6 +4062,7 @@ export const Event = { } return message; }, + toJSON(message: Event): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); @@ -4256,6 +4075,8 @@ export const Event = { }, }; +const baseEventAttribute: object = { index: false }; + export const EventAttribute = { encode(message: EventAttribute, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -4263,7 +4084,8 @@ export const EventAttribute = { writer.uint32(24).bool(message.index); return writer; }, - decode(input: Uint8Array | Reader, length?: number): EventAttribute { + + decode(input: Reader | Uint8Array, length?: number): EventAttribute { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEventAttribute } as EventAttribute; @@ -4286,6 +4108,7 @@ export const EventAttribute = { } return message; }, + fromJSON(object: any): EventAttribute { const message = { ...baseEventAttribute } as EventAttribute; if (object.key !== undefined && object.key !== null) { @@ -4301,6 +4124,7 @@ export const EventAttribute = { } return message; }, + fromPartial(object: DeepPartial): EventAttribute { const message = { ...baseEventAttribute } as EventAttribute; if (object.key !== undefined && object.key !== null) { @@ -4320,6 +4144,7 @@ export const EventAttribute = { } return message; }, + toJSON(message: EventAttribute): unknown { const obj: any = {}; message.key !== undefined && @@ -4331,6 +4156,8 @@ export const EventAttribute = { }, }; +const baseTxResult: object = { height: Long.ZERO, index: 0 }; + export const TxResult = { encode(message: TxResult, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.height); @@ -4341,7 +4168,8 @@ export const TxResult = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxResult { + + decode(input: Reader | Uint8Array, length?: number): TxResult { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxResult } as TxResult; @@ -4367,6 +4195,7 @@ export const TxResult = { } return message; }, + fromJSON(object: any): TxResult { const message = { ...baseTxResult } as TxResult; if (object.height !== undefined && object.height !== null) { @@ -4389,6 +4218,7 @@ export const TxResult = { } return message; }, + fromPartial(object: DeepPartial): TxResult { const message = { ...baseTxResult } as TxResult; if (object.height !== undefined && object.height !== null) { @@ -4413,6 +4243,7 @@ export const TxResult = { } return message; }, + toJSON(message: TxResult): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); @@ -4425,13 +4256,16 @@ export const TxResult = { }, }; +const baseValidator: object = { power: Long.ZERO }; + export const Validator = { encode(message: Validator, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.address); writer.uint32(24).int64(message.power); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Validator { + + decode(input: Reader | Uint8Array, length?: number): Validator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidator } as Validator; @@ -4451,6 +4285,7 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { @@ -4463,6 +4298,7 @@ export const Validator = { } return message; }, + fromPartial(object: DeepPartial): Validator { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { @@ -4477,6 +4313,7 @@ export const Validator = { } return message; }, + toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && @@ -4486,6 +4323,8 @@ export const Validator = { }, }; +const baseValidatorUpdate: object = { power: Long.ZERO }; + export const ValidatorUpdate = { encode(message: ValidatorUpdate, writer: Writer = Writer.create()): Writer { if (message.pubKey !== undefined && message.pubKey !== undefined) { @@ -4494,7 +4333,8 @@ export const ValidatorUpdate = { writer.uint32(16).int64(message.power); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ValidatorUpdate { + + decode(input: Reader | Uint8Array, length?: number): ValidatorUpdate { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidatorUpdate } as ValidatorUpdate; @@ -4514,6 +4354,7 @@ export const ValidatorUpdate = { } return message; }, + fromJSON(object: any): ValidatorUpdate { const message = { ...baseValidatorUpdate } as ValidatorUpdate; if (object.pubKey !== undefined && object.pubKey !== null) { @@ -4528,6 +4369,7 @@ export const ValidatorUpdate = { } return message; }, + fromPartial(object: DeepPartial): ValidatorUpdate { const message = { ...baseValidatorUpdate } as ValidatorUpdate; if (object.pubKey !== undefined && object.pubKey !== null) { @@ -4542,6 +4384,7 @@ export const ValidatorUpdate = { } return message; }, + toJSON(message: ValidatorUpdate): unknown { const obj: any = {}; message.pubKey !== undefined && @@ -4551,6 +4394,8 @@ export const ValidatorUpdate = { }, }; +const baseVoteInfo: object = { signedLastBlock: false }; + export const VoteInfo = { encode(message: VoteInfo, writer: Writer = Writer.create()): Writer { if (message.validator !== undefined && message.validator !== undefined) { @@ -4559,7 +4404,8 @@ export const VoteInfo = { writer.uint32(16).bool(message.signedLastBlock); return writer; }, - decode(input: Uint8Array | Reader, length?: number): VoteInfo { + + decode(input: Reader | Uint8Array, length?: number): VoteInfo { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseVoteInfo } as VoteInfo; @@ -4579,6 +4425,7 @@ export const VoteInfo = { } return message; }, + fromJSON(object: any): VoteInfo { const message = { ...baseVoteInfo } as VoteInfo; if (object.validator !== undefined && object.validator !== null) { @@ -4593,6 +4440,7 @@ export const VoteInfo = { } return message; }, + fromPartial(object: DeepPartial): VoteInfo { const message = { ...baseVoteInfo } as VoteInfo; if (object.validator !== undefined && object.validator !== null) { @@ -4607,6 +4455,7 @@ export const VoteInfo = { } return message; }, + toJSON(message: VoteInfo): unknown { const obj: any = {}; message.validator !== undefined && @@ -4616,6 +4465,8 @@ export const VoteInfo = { }, }; +const baseEvidence: object = { type: 0, height: Long.ZERO, totalVotingPower: Long.ZERO }; + export const Evidence = { encode(message: Evidence, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.type); @@ -4629,7 +4480,8 @@ export const Evidence = { writer.uint32(40).int64(message.totalVotingPower); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Evidence { + + decode(input: Reader | Uint8Array, length?: number): Evidence { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEvidence } as Evidence; @@ -4658,6 +4510,7 @@ export const Evidence = { } return message; }, + fromJSON(object: any): Evidence { const message = { ...baseEvidence } as Evidence; if (object.type !== undefined && object.type !== null) { @@ -4687,6 +4540,7 @@ export const Evidence = { } return message; }, + fromPartial(object: DeepPartial): Evidence { const message = { ...baseEvidence } as Evidence; if (object.type !== undefined && object.type !== null) { @@ -4716,6 +4570,7 @@ export const Evidence = { } return message; }, + toJSON(message: Evidence): unknown { const obj: any = {}; message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); @@ -4729,6 +4584,8 @@ export const Evidence = { }, }; +const baseSnapshot: object = { height: Long.UZERO, format: 0, chunks: 0 }; + export const Snapshot = { encode(message: Snapshot, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.height); @@ -4738,7 +4595,8 @@ export const Snapshot = { writer.uint32(42).bytes(message.metadata); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Snapshot { + + decode(input: Reader | Uint8Array, length?: number): Snapshot { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSnapshot } as Snapshot; @@ -4767,6 +4625,7 @@ export const Snapshot = { } return message; }, + fromJSON(object: any): Snapshot { const message = { ...baseSnapshot } as Snapshot; if (object.height !== undefined && object.height !== null) { @@ -4792,6 +4651,7 @@ export const Snapshot = { } return message; }, + fromPartial(object: DeepPartial): Snapshot { const message = { ...baseSnapshot } as Snapshot; if (object.height !== undefined && object.height !== null) { @@ -4821,6 +4681,7 @@ export const Snapshot = { } return message; }, + toJSON(message: Snapshot): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); @@ -4834,20 +4695,136 @@ export const Snapshot = { }, }; -if (util.Long !== (Long as any)) { - util.Long = Long as any; - configure(); +export interface ABCIApplication { + Echo(request: RequestEcho): Promise; + Flush(request: RequestFlush): Promise; + Info(request: RequestInfo): Promise; + SetOption(request: RequestSetOption): Promise; + DeliverTx(request: RequestDeliverTx): Promise; + CheckTx(request: RequestCheckTx): Promise; + Query(request: RequestQuery): Promise; + Commit(request: RequestCommit): Promise; + InitChain(request: RequestInitChain): Promise; + BeginBlock(request: RequestBeginBlock): Promise; + EndBlock(request: RequestEndBlock): Promise; + ListSnapshots(request: RequestListSnapshots): Promise; + OfferSnapshot(request: RequestOfferSnapshot): Promise; + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; } -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; +export class ABCIApplicationClientImpl implements ABCIApplication { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Echo(request: RequestEcho): Promise { + const data = RequestEcho.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseEcho.decode(new Reader(data))); + } + + Flush(request: RequestFlush): Promise { + const data = RequestFlush.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseFlush.decode(new Reader(data))); + } + + Info(request: RequestInfo): Promise { + const data = RequestInfo.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseInfo.decode(new Reader(data))); + } + + SetOption(request: RequestSetOption): Promise { + const data = RequestSetOption.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseSetOption.decode(new Reader(data))); + } + + DeliverTx(request: RequestDeliverTx): Promise { + const data = RequestDeliverTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseDeliverTx.decode(new Reader(data))); + } + + CheckTx(request: RequestCheckTx): Promise { + const data = RequestCheckTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseCheckTx.decode(new Reader(data))); + } + + Query(request: RequestQuery): Promise { + const data = RequestQuery.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseQuery.decode(new Reader(data))); + } + + Commit(request: RequestCommit): Promise { + const data = RequestCommit.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseCommit.decode(new Reader(data))); + } + + InitChain(request: RequestInitChain): Promise { + const data = RequestInitChain.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseInitChain.decode(new Reader(data))); + } + + BeginBlock(request: RequestBeginBlock): Promise { + const data = RequestBeginBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseBeginBlock.decode(new Reader(data))); + } + + EndBlock(request: RequestEndBlock): Promise { + const data = RequestEndBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseEndBlock.decode(new Reader(data))); + } + + ListSnapshots(request: RequestListSnapshots): Promise { + const data = RequestListSnapshots.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseListSnapshots.decode(new Reader(data))); + } + + OfferSnapshot(request: RequestOfferSnapshot): Promise { + const data = RequestOfferSnapshot.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseOfferSnapshot.decode(new Reader(data))); + } + + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { + const data = RequestLoadSnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseLoadSnapshotChunk.decode(new Reader(data))); + } + + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { + const data = RequestApplySnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "methodDesc.name", data); + return promise.then((data) => ResponseApplySnapshotChunk.decode(new Reader(data))); + } } -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -4857,6 +4834,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -4864,7 +4843,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array @@ -4874,3 +4854,34 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/packages/stargate/src/codec/tendermint/crypto/keys.ts b/packages/stargate/src/codec/tendermint/crypto/keys.ts index b2a42252..db6739e0 100644 --- a/packages/stargate/src/codec/tendermint/crypto/keys.ts +++ b/packages/stargate/src/codec/tendermint/crypto/keys.ts @@ -1,9 +1,10 @@ /* eslint-disable */ import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; -/** - * PublicKey defines the keys available for use with Tendermint Validators - */ +export const protobufPackage = "tendermint.crypto"; + +/** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; @@ -11,8 +12,6 @@ export interface PublicKey { const basePublicKey: object = {}; -export const protobufPackage = "tendermint.crypto"; - export const PublicKey = { encode(message: PublicKey, writer: Writer = Writer.create()): Writer { if (message.ed25519 !== undefined) { @@ -23,7 +22,8 @@ export const PublicKey = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): PublicKey { + + decode(input: Reader | Uint8Array, length?: number): PublicKey { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePublicKey } as PublicKey; @@ -43,6 +43,7 @@ export const PublicKey = { } return message; }, + fromJSON(object: any): PublicKey { const message = { ...basePublicKey } as PublicKey; if (object.ed25519 !== undefined && object.ed25519 !== null) { @@ -53,6 +54,7 @@ export const PublicKey = { } return message; }, + fromPartial(object: DeepPartial): PublicKey { const message = { ...basePublicKey } as PublicKey; if (object.ed25519 !== undefined && object.ed25519 !== null) { @@ -67,6 +69,7 @@ export const PublicKey = { } return message; }, + toJSON(message: PublicKey): unknown { const obj: any = {}; message.ed25519 !== undefined && @@ -77,15 +80,18 @@ export const PublicKey = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -95,6 +101,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -102,7 +110,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/crypto/proof.ts b/packages/stargate/src/codec/tendermint/crypto/proof.ts index 51747905..52660a8f 100644 --- a/packages/stargate/src/codec/tendermint/crypto/proof.ts +++ b/packages/stargate/src/codec/tendermint/crypto/proof.ts @@ -2,6 +2,8 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "tendermint.crypto"; + export interface Proof { total: Long; index: Long; @@ -10,13 +12,9 @@ export interface Proof { } export interface ValueOp { - /** - * Encoded in ProofOp.Key. - */ + /** Encoded in ProofOp.Key. */ key: Uint8Array; - /** - * To encode in ProofOp.Data - */ + /** To encode in ProofOp.Data */ proof?: Proof; } @@ -27,9 +25,9 @@ export interface DominoOp { } /** - * ProofOp defines an operation used for calculating Merkle root - * The data could be arbitrary format, providing nessecary data - * for example neighbouring node hash + * 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; @@ -37,33 +35,12 @@ export interface ProofOp { data: Uint8Array; } -/** - * ProofOps is Merkle proof defined by the list of ProofOps - */ +/** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOps { ops: ProofOp[]; } -const baseProof: object = { - total: Long.ZERO, - index: Long.ZERO, -}; - -const baseValueOp: object = {}; - -const baseDominoOp: object = { - key: "", - input: "", - output: "", -}; - -const baseProofOp: object = { - type: "", -}; - -const baseProofOps: object = {}; - -export const protobufPackage = "tendermint.crypto"; +const baseProof: object = { total: Long.ZERO, index: Long.ZERO }; export const Proof = { encode(message: Proof, writer: Writer = Writer.create()): Writer { @@ -75,7 +52,8 @@ export const Proof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Proof { + + decode(input: Reader | Uint8Array, length?: number): Proof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseProof } as Proof; @@ -102,6 +80,7 @@ export const Proof = { } return message; }, + fromJSON(object: any): Proof { const message = { ...baseProof } as Proof; message.aunts = []; @@ -125,6 +104,7 @@ export const Proof = { } return message; }, + fromPartial(object: DeepPartial): Proof { const message = { ...baseProof } as Proof; message.aunts = []; @@ -150,6 +130,7 @@ export const Proof = { } return message; }, + toJSON(message: Proof): unknown { const obj: any = {}; message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); @@ -165,6 +146,8 @@ export const Proof = { }, }; +const baseValueOp: object = {}; + export const ValueOp = { encode(message: ValueOp, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.key); @@ -173,7 +156,8 @@ export const ValueOp = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ValueOp { + + decode(input: Reader | Uint8Array, length?: number): ValueOp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValueOp } as ValueOp; @@ -193,6 +177,7 @@ export const ValueOp = { } return message; }, + fromJSON(object: any): ValueOp { const message = { ...baseValueOp } as ValueOp; if (object.key !== undefined && object.key !== null) { @@ -205,6 +190,7 @@ export const ValueOp = { } return message; }, + fromPartial(object: DeepPartial): ValueOp { const message = { ...baseValueOp } as ValueOp; if (object.key !== undefined && object.key !== null) { @@ -219,6 +205,7 @@ export const ValueOp = { } return message; }, + toJSON(message: ValueOp): unknown { const obj: any = {}; message.key !== undefined && @@ -228,6 +215,8 @@ export const ValueOp = { }, }; +const baseDominoOp: object = { key: "", input: "", output: "" }; + export const DominoOp = { encode(message: DominoOp, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.key); @@ -235,7 +224,8 @@ export const DominoOp = { writer.uint32(26).string(message.output); return writer; }, - decode(input: Uint8Array | Reader, length?: number): DominoOp { + + decode(input: Reader | Uint8Array, length?: number): DominoOp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseDominoOp } as DominoOp; @@ -258,6 +248,7 @@ export const DominoOp = { } return message; }, + fromJSON(object: any): DominoOp { const message = { ...baseDominoOp } as DominoOp; if (object.key !== undefined && object.key !== null) { @@ -277,6 +268,7 @@ export const DominoOp = { } return message; }, + fromPartial(object: DeepPartial): DominoOp { const message = { ...baseDominoOp } as DominoOp; if (object.key !== undefined && object.key !== null) { @@ -296,6 +288,7 @@ export const DominoOp = { } return message; }, + toJSON(message: DominoOp): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); @@ -305,6 +298,8 @@ export const DominoOp = { }, }; +const baseProofOp: object = { type: "" }; + export const ProofOp = { encode(message: ProofOp, writer: Writer = Writer.create()): Writer { writer.uint32(10).string(message.type); @@ -312,7 +307,8 @@ export const ProofOp = { writer.uint32(26).bytes(message.data); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ProofOp { + + decode(input: Reader | Uint8Array, length?: number): ProofOp { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseProofOp } as ProofOp; @@ -335,6 +331,7 @@ export const ProofOp = { } return message; }, + fromJSON(object: any): ProofOp { const message = { ...baseProofOp } as ProofOp; if (object.type !== undefined && object.type !== null) { @@ -350,6 +347,7 @@ export const ProofOp = { } return message; }, + fromPartial(object: DeepPartial): ProofOp { const message = { ...baseProofOp } as ProofOp; if (object.type !== undefined && object.type !== null) { @@ -369,6 +367,7 @@ export const ProofOp = { } return message; }, + toJSON(message: ProofOp): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); @@ -380,6 +379,8 @@ export const ProofOp = { }, }; +const baseProofOps: object = {}; + export const ProofOps = { encode(message: ProofOps, writer: Writer = Writer.create()): Writer { for (const v of message.ops) { @@ -387,7 +388,8 @@ export const ProofOps = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ProofOps { + + decode(input: Reader | Uint8Array, length?: number): ProofOps { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseProofOps } as ProofOps; @@ -405,6 +407,7 @@ export const ProofOps = { } return message; }, + fromJSON(object: any): ProofOps { const message = { ...baseProofOps } as ProofOps; message.ops = []; @@ -415,6 +418,7 @@ export const ProofOps = { } return message; }, + fromPartial(object: DeepPartial): ProofOps { const message = { ...baseProofOps } as ProofOps; message.ops = []; @@ -425,6 +429,7 @@ export const ProofOps = { } return message; }, + toJSON(message: ProofOps): unknown { const obj: any = {}; if (message.ops) { @@ -436,15 +441,18 @@ export const ProofOps = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -454,6 +462,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -461,7 +471,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/libs/bits/types.ts b/packages/stargate/src/codec/tendermint/libs/bits/types.ts index fd74ef6c..dc455d2f 100644 --- a/packages/stargate/src/codec/tendermint/libs/bits/types.ts +++ b/packages/stargate/src/codec/tendermint/libs/bits/types.ts @@ -2,17 +2,14 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "tendermint.libs.bits"; + export interface BitArray { bits: Long; elems: Long[]; } -const baseBitArray: object = { - bits: Long.ZERO, - elems: Long.UZERO, -}; - -export const protobufPackage = "tendermint.libs.bits"; +const baseBitArray: object = { bits: Long.ZERO, elems: Long.UZERO }; export const BitArray = { encode(message: BitArray, writer: Writer = Writer.create()): Writer { @@ -24,7 +21,8 @@ export const BitArray = { writer.ldelim(); return writer; }, - decode(input: Uint8Array | Reader, length?: number): BitArray { + + decode(input: Reader | Uint8Array, length?: number): BitArray { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBitArray } as BitArray; @@ -52,6 +50,7 @@ export const BitArray = { } return message; }, + fromJSON(object: any): BitArray { const message = { ...baseBitArray } as BitArray; message.elems = []; @@ -67,6 +66,7 @@ export const BitArray = { } return message; }, + fromPartial(object: DeepPartial): BitArray { const message = { ...baseBitArray } as BitArray; message.elems = []; @@ -82,6 +82,7 @@ export const BitArray = { } return message; }, + toJSON(message: BitArray): unknown { const obj: any = {}; message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString()); @@ -94,7 +95,7 @@ export const BitArray = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/types/params.ts b/packages/stargate/src/codec/tendermint/types/params.ts index 4d23fe25..985ea0f8 100644 --- a/packages/stargate/src/codec/tendermint/types/params.ts +++ b/packages/stargate/src/codec/tendermint/types/params.ts @@ -3,9 +3,11 @@ import * as Long from "long"; import { Duration } from "../../google/protobuf/duration"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "tendermint.types"; + /** - * ConsensusParams contains consensus critical parameters that determine the - * validity of blocks. + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. */ export interface ConsensusParams { block?: BlockParams; @@ -14,75 +16,69 @@ export interface ConsensusParams { version?: VersionParams; } -/** - * BlockParams contains limits on the block size. - */ +/** BlockParams contains limits on the block size. */ export interface BlockParams { /** - * Max block size, in bytes. - * Note: must be greater than 0 + * 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 + * 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. + * 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. + * Not exposed to the application. */ timeIotaMs: Long; } -/** - * EvidenceParams determine how we handle evidence of malfeasance. - */ +/** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { /** - * Max age of evidence, in blocks. + * Max age of evidence, in blocks. * - * The basic formula for calculating this is: MaxAgeDuration / {average block - * time}. + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. */ maxAgeNumBlocks: Long; /** - * Max age of evidence, in time. + * 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). + * 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 + * 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; } /** - * ValidatorParams restrict the public key types validators can use. - * NOTE: uses ABCI pubkey naming, not Amino names. + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParams { pubKeyTypes: string[]; } -/** - * VersionParams contains the ABCI application version. - */ +/** VersionParams contains the ABCI application version. */ export interface VersionParams { appVersion: Long; } /** - * HashedParams is a subset of ConsensusParams. + * HashedParams is a subset of ConsensusParams. * - * It is hashed into the Header.ConsensusHash. + * It is hashed into the Header.ConsensusHash. */ export interface HashedParams { blockMaxBytes: Long; @@ -91,32 +87,6 @@ export interface HashedParams { const baseConsensusParams: object = {}; -const baseBlockParams: object = { - maxBytes: Long.ZERO, - maxGas: Long.ZERO, - timeIotaMs: Long.ZERO, -}; - -const baseEvidenceParams: object = { - maxAgeNumBlocks: Long.ZERO, - maxBytes: Long.ZERO, -}; - -const baseValidatorParams: object = { - pubKeyTypes: "", -}; - -const baseVersionParams: object = { - appVersion: Long.UZERO, -}; - -const baseHashedParams: object = { - blockMaxBytes: Long.ZERO, - blockMaxGas: Long.ZERO, -}; - -export const protobufPackage = "tendermint.types"; - export const ConsensusParams = { encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { if (message.block !== undefined && message.block !== undefined) { @@ -133,7 +103,8 @@ export const ConsensusParams = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ConsensusParams { + + decode(input: Reader | Uint8Array, length?: number): ConsensusParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConsensusParams } as ConsensusParams; @@ -159,6 +130,7 @@ export const ConsensusParams = { } return message; }, + fromJSON(object: any): ConsensusParams { const message = { ...baseConsensusParams } as ConsensusParams; if (object.block !== undefined && object.block !== null) { @@ -183,6 +155,7 @@ export const ConsensusParams = { } return message; }, + fromPartial(object: DeepPartial): ConsensusParams { const message = { ...baseConsensusParams } as ConsensusParams; if (object.block !== undefined && object.block !== null) { @@ -207,6 +180,7 @@ export const ConsensusParams = { } return message; }, + toJSON(message: ConsensusParams): unknown { const obj: any = {}; message.block !== undefined && @@ -221,6 +195,8 @@ export const ConsensusParams = { }, }; +const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO }; + export const BlockParams = { encode(message: BlockParams, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.maxBytes); @@ -228,7 +204,8 @@ export const BlockParams = { writer.uint32(24).int64(message.timeIotaMs); return writer; }, - decode(input: Uint8Array | Reader, length?: number): BlockParams { + + decode(input: Reader | Uint8Array, length?: number): BlockParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBlockParams } as BlockParams; @@ -251,6 +228,7 @@ export const BlockParams = { } return message; }, + fromJSON(object: any): BlockParams { const message = { ...baseBlockParams } as BlockParams; if (object.maxBytes !== undefined && object.maxBytes !== null) { @@ -270,6 +248,7 @@ export const BlockParams = { } return message; }, + fromPartial(object: DeepPartial): BlockParams { const message = { ...baseBlockParams } as BlockParams; if (object.maxBytes !== undefined && object.maxBytes !== null) { @@ -289,6 +268,7 @@ export const BlockParams = { } return message; }, + toJSON(message: BlockParams): unknown { const obj: any = {}; message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); @@ -298,6 +278,8 @@ export const BlockParams = { }, }; +const baseEvidenceParams: object = { maxAgeNumBlocks: Long.ZERO, maxBytes: Long.ZERO }; + export const EvidenceParams = { encode(message: EvidenceParams, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.maxAgeNumBlocks); @@ -307,7 +289,8 @@ export const EvidenceParams = { writer.uint32(24).int64(message.maxBytes); return writer; }, - decode(input: Uint8Array | Reader, length?: number): EvidenceParams { + + decode(input: Reader | Uint8Array, length?: number): EvidenceParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEvidenceParams } as EvidenceParams; @@ -330,6 +313,7 @@ export const EvidenceParams = { } return message; }, + fromJSON(object: any): EvidenceParams { const message = { ...baseEvidenceParams } as EvidenceParams; if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { @@ -349,6 +333,7 @@ export const EvidenceParams = { } return message; }, + fromPartial(object: DeepPartial): EvidenceParams { const message = { ...baseEvidenceParams } as EvidenceParams; if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { @@ -368,6 +353,7 @@ export const EvidenceParams = { } return message; }, + toJSON(message: EvidenceParams): unknown { const obj: any = {}; message.maxAgeNumBlocks !== undefined && @@ -379,6 +365,8 @@ export const EvidenceParams = { }, }; +const baseValidatorParams: object = { pubKeyTypes: "" }; + export const ValidatorParams = { encode(message: ValidatorParams, writer: Writer = Writer.create()): Writer { for (const v of message.pubKeyTypes) { @@ -386,7 +374,8 @@ export const ValidatorParams = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): ValidatorParams { + + decode(input: Reader | Uint8Array, length?: number): ValidatorParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidatorParams } as ValidatorParams; @@ -404,6 +393,7 @@ export const ValidatorParams = { } return message; }, + fromJSON(object: any): ValidatorParams { const message = { ...baseValidatorParams } as ValidatorParams; message.pubKeyTypes = []; @@ -414,6 +404,7 @@ export const ValidatorParams = { } return message; }, + fromPartial(object: DeepPartial): ValidatorParams { const message = { ...baseValidatorParams } as ValidatorParams; message.pubKeyTypes = []; @@ -424,6 +415,7 @@ export const ValidatorParams = { } return message; }, + toJSON(message: ValidatorParams): unknown { const obj: any = {}; if (message.pubKeyTypes) { @@ -435,12 +427,15 @@ export const ValidatorParams = { }, }; +const baseVersionParams: object = { appVersion: Long.UZERO }; + export const VersionParams = { encode(message: VersionParams, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.appVersion); return writer; }, - decode(input: Uint8Array | Reader, length?: number): VersionParams { + + decode(input: Reader | Uint8Array, length?: number): VersionParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseVersionParams } as VersionParams; @@ -457,6 +452,7 @@ export const VersionParams = { } return message; }, + fromJSON(object: any): VersionParams { const message = { ...baseVersionParams } as VersionParams; if (object.appVersion !== undefined && object.appVersion !== null) { @@ -466,6 +462,7 @@ export const VersionParams = { } return message; }, + fromPartial(object: DeepPartial): VersionParams { const message = { ...baseVersionParams } as VersionParams; if (object.appVersion !== undefined && object.appVersion !== null) { @@ -475,6 +472,7 @@ export const VersionParams = { } return message; }, + toJSON(message: VersionParams): unknown { const obj: any = {}; message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); @@ -482,13 +480,16 @@ export const VersionParams = { }, }; +const baseHashedParams: object = { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO }; + export const HashedParams = { encode(message: HashedParams, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.blockMaxBytes); writer.uint32(16).int64(message.blockMaxGas); return writer; }, - decode(input: Uint8Array | Reader, length?: number): HashedParams { + + decode(input: Reader | Uint8Array, length?: number): HashedParams { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHashedParams } as HashedParams; @@ -508,6 +509,7 @@ export const HashedParams = { } return message; }, + fromJSON(object: any): HashedParams { const message = { ...baseHashedParams } as HashedParams; if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { @@ -522,6 +524,7 @@ export const HashedParams = { } return message; }, + fromPartial(object: DeepPartial): HashedParams { const message = { ...baseHashedParams } as HashedParams; if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { @@ -536,6 +539,7 @@ export const HashedParams = { } return message; }, + toJSON(message: HashedParams): unknown { const obj: any = {}; message.blockMaxBytes !== undefined && @@ -545,7 +549,7 @@ export const HashedParams = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/types/types.ts b/packages/stargate/src/codec/tendermint/types/types.ts index 185cce93..f02e93b4 100644 --- a/packages/stargate/src/codec/tendermint/types/types.ts +++ b/packages/stargate/src/codec/tendermint/types/types.ts @@ -4,250 +4,11 @@ import { Consensus } from "../../tendermint/version/types"; import * as Long from "long"; import { ValidatorSet } from "../../tendermint/types/validator"; import { Timestamp } from "../../google/protobuf/timestamp"; -import { Writer, Reader, util, configure } from "protobufjs/minimal"; - -/** - * PartsetHeader - */ -export interface PartSetHeader { - total: number; - hash: Uint8Array; -} - -export interface Part { - index: number; - bytes: Uint8Array; - proof?: Proof; -} - -/** - * BlockID - */ -export interface BlockID { - hash: Uint8Array; - partSetHeader?: PartSetHeader; -} - -/** - * 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; - /** - * transactions - */ - dataHash: Uint8Array; - /** - * hashes from the app output from the prev block - */ - validatorsHash: Uint8Array; - /** - * validators for the next block - */ - nextValidatorsHash: Uint8Array; - /** - * consensus params for current block - */ - consensusHash: Uint8Array; - /** - * state after txs from the previous block - */ - appHash: Uint8Array; - /** - * root hash of all results from the txs from the previous block - */ - lastResultsHash: Uint8Array; - /** - * consensus info - */ - evidenceHash: Uint8Array; - /** - * original proposer of the block - */ - proposerAddress: Uint8Array; -} - -/** - * 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[]; -} - -/** - * 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; -} - -/** - * 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[]; -} - -/** - * CommitSig is a part of the Vote included in a Commit. - */ -export interface CommitSig { - blockIdFlag: BlockIDFlag; - validatorAddress: Uint8Array; - timestamp?: Date; - signature: Uint8Array; -} - -export interface Proposal { - type: SignedMsgType; - height: Long; - round: number; - polRound: number; - blockId?: BlockID; - timestamp?: Date; - signature: Uint8Array; -} - -export interface SignedHeader { - header?: Header; - commit?: Commit; -} - -export interface LightBlock { - signedHeader?: SignedHeader; - validatorSet?: ValidatorSet; -} - -export interface BlockMeta { - blockId?: BlockID; - blockSize: Long; - header?: Header; - numTxs: 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; -} - -const basePartSetHeader: object = { - total: 0, -}; - -const basePart: object = { - index: 0, -}; - -const baseBlockID: object = {}; - -const baseHeader: object = { - chainId: "", - height: Long.ZERO, -}; - -const baseData: object = {}; - -const baseVote: object = { - type: 0, - height: Long.ZERO, - round: 0, - validatorIndex: 0, -}; - -const baseCommit: object = { - height: Long.ZERO, - round: 0, -}; - -const baseCommitSig: object = { - blockIdFlag: 0, -}; - -const baseProposal: object = { - type: 0, - height: Long.ZERO, - round: 0, - polRound: 0, -}; - -const baseSignedHeader: object = {}; - -const baseLightBlock: object = {}; - -const baseBlockMeta: object = { - blockSize: Long.ZERO, - numTxs: Long.ZERO, -}; - -const baseTxProof: object = {}; - -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function numberToLong(number: number) { - return Long.fromNumber(number); -} +import { util, configure, Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "tendermint.types"; -/** BlockIdFlag indicates which BlcokID the signature is for - */ +/** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { BLOCK_ID_FLAG_UNKNOWN = 0, BLOCK_ID_FLAG_ABSENT = 1, @@ -292,16 +53,13 @@ export function blockIDFlagToJSON(object: BlockIDFlag): string { } } -/** SignedMsgType is a type of signed message in the consensus. - */ +/** 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 - Votes */ SIGNED_MSG_TYPE_PREVOTE = 1, SIGNED_MSG_TYPE_PRECOMMIT = 2, - /** SIGNED_MSG_TYPE_PROPOSAL - Proposals - */ + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ SIGNED_MSG_TYPE_PROPOSAL = 32, UNRECOGNIZED = -1, } @@ -342,13 +100,139 @@ export function signedMsgTypeToJSON(object: SignedMsgType): string { } } +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} + +export interface Part { + index: number; + bytes: Uint8Array; + proof?: Proof; +} + +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader?: PartSetHeader; +} + +/** 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; + /** transactions */ + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} + +/** 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[]; +} + +/** + * 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; +} + +/** 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[]; +} + +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp?: Date; + signature: Uint8Array; +} + +export interface Proposal { + type: SignedMsgType; + height: Long; + round: number; + polRound: number; + blockId?: BlockID; + timestamp?: Date; + signature: Uint8Array; +} + +export interface SignedHeader { + header?: Header; + commit?: Commit; +} + +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} + +export interface BlockMeta { + blockId?: BlockID; + blockSize: Long; + header?: Header; + numTxs: 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; +} + +const basePartSetHeader: object = { total: 0 }; + export const PartSetHeader = { encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.total); writer.uint32(18).bytes(message.hash); return writer; }, - decode(input: Uint8Array | Reader, length?: number): PartSetHeader { + + decode(input: Reader | Uint8Array, length?: number): PartSetHeader { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePartSetHeader } as PartSetHeader; @@ -368,6 +252,7 @@ export const PartSetHeader = { } return message; }, + fromJSON(object: any): PartSetHeader { const message = { ...basePartSetHeader } as PartSetHeader; if (object.total !== undefined && object.total !== null) { @@ -380,6 +265,7 @@ export const PartSetHeader = { } return message; }, + fromPartial(object: DeepPartial): PartSetHeader { const message = { ...basePartSetHeader } as PartSetHeader; if (object.total !== undefined && object.total !== null) { @@ -394,6 +280,7 @@ export const PartSetHeader = { } return message; }, + toJSON(message: PartSetHeader): unknown { const obj: any = {}; message.total !== undefined && (obj.total = message.total); @@ -403,6 +290,8 @@ export const PartSetHeader = { }, }; +const basePart: object = { index: 0 }; + export const Part = { encode(message: Part, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint32(message.index); @@ -412,7 +301,8 @@ export const Part = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Part { + + decode(input: Reader | Uint8Array, length?: number): Part { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePart } as Part; @@ -435,6 +325,7 @@ export const Part = { } return message; }, + fromJSON(object: any): Part { const message = { ...basePart } as Part; if (object.index !== undefined && object.index !== null) { @@ -452,6 +343,7 @@ export const Part = { } return message; }, + fromPartial(object: DeepPartial): Part { const message = { ...basePart } as Part; if (object.index !== undefined && object.index !== null) { @@ -471,6 +363,7 @@ export const Part = { } return message; }, + toJSON(message: Part): unknown { const obj: any = {}; message.index !== undefined && (obj.index = message.index); @@ -481,6 +374,8 @@ export const Part = { }, }; +const baseBlockID: object = {}; + export const BlockID = { encode(message: BlockID, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.hash); @@ -489,7 +384,8 @@ export const BlockID = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): BlockID { + + decode(input: Reader | Uint8Array, length?: number): BlockID { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBlockID } as BlockID; @@ -509,6 +405,7 @@ export const BlockID = { } return message; }, + fromJSON(object: any): BlockID { const message = { ...baseBlockID } as BlockID; if (object.hash !== undefined && object.hash !== null) { @@ -521,6 +418,7 @@ export const BlockID = { } return message; }, + fromPartial(object: DeepPartial): BlockID { const message = { ...baseBlockID } as BlockID; if (object.hash !== undefined && object.hash !== null) { @@ -535,6 +433,7 @@ export const BlockID = { } return message; }, + toJSON(message: BlockID): unknown { const obj: any = {}; message.hash !== undefined && @@ -545,6 +444,8 @@ export const BlockID = { }, }; +const baseHeader: object = { chainId: "", height: Long.ZERO }; + export const Header = { encode(message: Header, writer: Writer = Writer.create()): Writer { if (message.version !== undefined && message.version !== undefined) { @@ -569,7 +470,8 @@ export const Header = { writer.uint32(114).bytes(message.proposerAddress); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Header { + + decode(input: Reader | Uint8Array, length?: number): Header { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHeader } as Header; @@ -625,6 +527,7 @@ export const Header = { } return message; }, + fromJSON(object: any): Header { const message = { ...baseHeader } as Header; if (object.version !== undefined && object.version !== null) { @@ -681,6 +584,7 @@ export const Header = { } return message; }, + fromPartial(object: DeepPartial
): Header { const message = { ...baseHeader } as Header; if (object.version !== undefined && object.version !== null) { @@ -755,6 +659,7 @@ export const Header = { } return message; }, + toJSON(message: Header): unknown { const obj: any = {}; message.version !== undefined && @@ -800,6 +705,8 @@ export const Header = { }, }; +const baseData: object = {}; + export const Data = { encode(message: Data, writer: Writer = Writer.create()): Writer { for (const v of message.txs) { @@ -807,7 +714,8 @@ export const Data = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Data { + + decode(input: Reader | Uint8Array, length?: number): Data { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseData } as Data; @@ -825,6 +733,7 @@ export const Data = { } return message; }, + fromJSON(object: any): Data { const message = { ...baseData } as Data; message.txs = []; @@ -835,6 +744,7 @@ export const Data = { } return message; }, + fromPartial(object: DeepPartial): Data { const message = { ...baseData } as Data; message.txs = []; @@ -845,6 +755,7 @@ export const Data = { } return message; }, + toJSON(message: Data): unknown { const obj: any = {}; if (message.txs) { @@ -856,6 +767,8 @@ export const Data = { }, }; +const baseVote: object = { type: 0, height: Long.ZERO, round: 0, validatorIndex: 0 }; + export const Vote = { encode(message: Vote, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.type); @@ -872,7 +785,8 @@ export const Vote = { writer.uint32(66).bytes(message.signature); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Vote { + + decode(input: Reader | Uint8Array, length?: number): Vote { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseVote } as Vote; @@ -910,6 +824,7 @@ export const Vote = { } return message; }, + fromJSON(object: any): Vote { const message = { ...baseVote } as Vote; if (object.type !== undefined && object.type !== null) { @@ -950,6 +865,7 @@ export const Vote = { } return message; }, + fromPartial(object: DeepPartial): Vote { const message = { ...baseVote } as Vote; if (object.type !== undefined && object.type !== null) { @@ -994,6 +910,7 @@ export const Vote = { } return message; }, + toJSON(message: Vote): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); @@ -1016,6 +933,8 @@ export const Vote = { }, }; +const baseCommit: object = { height: Long.ZERO, round: 0 }; + export const Commit = { encode(message: Commit, writer: Writer = Writer.create()): Writer { writer.uint32(8).int64(message.height); @@ -1028,7 +947,8 @@ export const Commit = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): Commit { + + decode(input: Reader | Uint8Array, length?: number): Commit { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCommit } as Commit; @@ -1055,6 +975,7 @@ export const Commit = { } return message; }, + fromJSON(object: any): Commit { const message = { ...baseCommit } as Commit; message.signatures = []; @@ -1080,6 +1001,7 @@ export const Commit = { } return message; }, + fromPartial(object: DeepPartial): Commit { const message = { ...baseCommit } as Commit; message.signatures = []; @@ -1105,6 +1027,7 @@ export const Commit = { } return message; }, + toJSON(message: Commit): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); @@ -1120,6 +1043,8 @@ export const Commit = { }, }; +const baseCommitSig: object = { blockIdFlag: 0 }; + export const CommitSig = { encode(message: CommitSig, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.blockIdFlag); @@ -1130,7 +1055,8 @@ export const CommitSig = { writer.uint32(34).bytes(message.signature); return writer; }, - decode(input: Uint8Array | Reader, length?: number): CommitSig { + + decode(input: Reader | Uint8Array, length?: number): CommitSig { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCommitSig } as CommitSig; @@ -1156,6 +1082,7 @@ export const CommitSig = { } return message; }, + fromJSON(object: any): CommitSig { const message = { ...baseCommitSig } as CommitSig; if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { @@ -1176,6 +1103,7 @@ export const CommitSig = { } return message; }, + fromPartial(object: DeepPartial): CommitSig { const message = { ...baseCommitSig } as CommitSig; if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { @@ -1200,6 +1128,7 @@ export const CommitSig = { } return message; }, + toJSON(message: CommitSig): unknown { const obj: any = {}; message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); @@ -1217,6 +1146,8 @@ export const CommitSig = { }, }; +const baseProposal: object = { type: 0, height: Long.ZERO, round: 0, polRound: 0 }; + export const Proposal = { encode(message: Proposal, writer: Writer = Writer.create()): Writer { writer.uint32(8).int32(message.type); @@ -1232,7 +1163,8 @@ export const Proposal = { writer.uint32(58).bytes(message.signature); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Proposal { + + decode(input: Reader | Uint8Array, length?: number): Proposal { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseProposal } as Proposal; @@ -1267,6 +1199,7 @@ export const Proposal = { } return message; }, + fromJSON(object: any): Proposal { const message = { ...baseProposal } as Proposal; if (object.type !== undefined && object.type !== null) { @@ -1304,6 +1237,7 @@ export const Proposal = { } return message; }, + fromPartial(object: DeepPartial): Proposal { const message = { ...baseProposal } as Proposal; if (object.type !== undefined && object.type !== null) { @@ -1343,6 +1277,7 @@ export const Proposal = { } return message; }, + toJSON(message: Proposal): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); @@ -1361,6 +1296,8 @@ export const Proposal = { }, }; +const baseSignedHeader: object = {}; + export const SignedHeader = { encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { if (message.header !== undefined && message.header !== undefined) { @@ -1371,7 +1308,8 @@ export const SignedHeader = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): SignedHeader { + + decode(input: Reader | Uint8Array, length?: number): SignedHeader { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSignedHeader } as SignedHeader; @@ -1391,6 +1329,7 @@ export const SignedHeader = { } return message; }, + fromJSON(object: any): SignedHeader { const message = { ...baseSignedHeader } as SignedHeader; if (object.header !== undefined && object.header !== null) { @@ -1405,6 +1344,7 @@ export const SignedHeader = { } return message; }, + fromPartial(object: DeepPartial): SignedHeader { const message = { ...baseSignedHeader } as SignedHeader; if (object.header !== undefined && object.header !== null) { @@ -1419,6 +1359,7 @@ export const SignedHeader = { } return message; }, + toJSON(message: SignedHeader): unknown { const obj: any = {}; message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); @@ -1427,6 +1368,8 @@ export const SignedHeader = { }, }; +const baseLightBlock: object = {}; + export const LightBlock = { encode(message: LightBlock, writer: Writer = Writer.create()): Writer { if (message.signedHeader !== undefined && message.signedHeader !== undefined) { @@ -1437,7 +1380,8 @@ export const LightBlock = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): LightBlock { + + decode(input: Reader | Uint8Array, length?: number): LightBlock { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseLightBlock } as LightBlock; @@ -1457,6 +1401,7 @@ export const LightBlock = { } return message; }, + fromJSON(object: any): LightBlock { const message = { ...baseLightBlock } as LightBlock; if (object.signedHeader !== undefined && object.signedHeader !== null) { @@ -1471,6 +1416,7 @@ export const LightBlock = { } return message; }, + fromPartial(object: DeepPartial): LightBlock { const message = { ...baseLightBlock } as LightBlock; if (object.signedHeader !== undefined && object.signedHeader !== null) { @@ -1485,6 +1431,7 @@ export const LightBlock = { } return message; }, + toJSON(message: LightBlock): unknown { const obj: any = {}; message.signedHeader !== undefined && @@ -1495,6 +1442,8 @@ export const LightBlock = { }, }; +const baseBlockMeta: object = { blockSize: Long.ZERO, numTxs: Long.ZERO }; + export const BlockMeta = { encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { if (message.blockId !== undefined && message.blockId !== undefined) { @@ -1507,7 +1456,8 @@ export const BlockMeta = { writer.uint32(32).int64(message.numTxs); return writer; }, - decode(input: Uint8Array | Reader, length?: number): BlockMeta { + + decode(input: Reader | Uint8Array, length?: number): BlockMeta { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseBlockMeta } as BlockMeta; @@ -1533,6 +1483,7 @@ export const BlockMeta = { } return message; }, + fromJSON(object: any): BlockMeta { const message = { ...baseBlockMeta } as BlockMeta; if (object.blockId !== undefined && object.blockId !== null) { @@ -1557,6 +1508,7 @@ export const BlockMeta = { } return message; }, + fromPartial(object: DeepPartial): BlockMeta { const message = { ...baseBlockMeta } as BlockMeta; if (object.blockId !== undefined && object.blockId !== null) { @@ -1581,6 +1533,7 @@ export const BlockMeta = { } return message; }, + toJSON(message: BlockMeta): unknown { const obj: any = {}; message.blockId !== undefined && @@ -1592,6 +1545,8 @@ export const BlockMeta = { }, }; +const baseTxProof: object = {}; + export const TxProof = { encode(message: TxProof, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.rootHash); @@ -1601,7 +1556,8 @@ export const TxProof = { } return writer; }, - decode(input: Uint8Array | Reader, length?: number): TxProof { + + decode(input: Reader | Uint8Array, length?: number): TxProof { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseTxProof } as TxProof; @@ -1624,6 +1580,7 @@ export const TxProof = { } return message; }, + fromJSON(object: any): TxProof { const message = { ...baseTxProof } as TxProof; if (object.rootHash !== undefined && object.rootHash !== null) { @@ -1639,6 +1596,7 @@ export const TxProof = { } return message; }, + fromPartial(object: DeepPartial): TxProof { const message = { ...baseTxProof } as TxProof; if (object.rootHash !== undefined && object.rootHash !== null) { @@ -1658,6 +1616,7 @@ export const TxProof = { } return message; }, + toJSON(message: TxProof): unknown { const obj: any = {}; message.rootHash !== undefined && @@ -1669,20 +1628,18 @@ export const TxProof = { }, }; -if (util.Long !== (Long as any)) { - util.Long = Long as any; - configure(); -} - -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -1692,6 +1649,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -1699,7 +1658,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array @@ -1709,3 +1669,34 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/packages/stargate/src/codec/tendermint/types/validator.ts b/packages/stargate/src/codec/tendermint/types/validator.ts index fc4533fc..7038d595 100644 --- a/packages/stargate/src/codec/tendermint/types/validator.ts +++ b/packages/stargate/src/codec/tendermint/types/validator.ts @@ -3,6 +3,8 @@ import * as Long from "long"; import { PublicKey } from "../../tendermint/crypto/keys"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "tendermint.types"; + export interface ValidatorSet { validators: Validator[]; proposer?: Validator; @@ -21,20 +23,7 @@ export interface SimpleValidator { votingPower: Long; } -const baseValidatorSet: object = { - totalVotingPower: Long.ZERO, -}; - -const baseValidator: object = { - votingPower: Long.ZERO, - proposerPriority: Long.ZERO, -}; - -const baseSimpleValidator: object = { - votingPower: Long.ZERO, -}; - -export const protobufPackage = "tendermint.types"; +const baseValidatorSet: object = { totalVotingPower: Long.ZERO }; export const ValidatorSet = { encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { @@ -47,7 +36,8 @@ export const ValidatorSet = { writer.uint32(24).int64(message.totalVotingPower); return writer; }, - decode(input: Uint8Array | Reader, length?: number): ValidatorSet { + + decode(input: Reader | Uint8Array, length?: number): ValidatorSet { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidatorSet } as ValidatorSet; @@ -71,6 +61,7 @@ export const ValidatorSet = { } return message; }, + fromJSON(object: any): ValidatorSet { const message = { ...baseValidatorSet } as ValidatorSet; message.validators = []; @@ -91,6 +82,7 @@ export const ValidatorSet = { } return message; }, + fromPartial(object: DeepPartial): ValidatorSet { const message = { ...baseValidatorSet } as ValidatorSet; message.validators = []; @@ -111,6 +103,7 @@ export const ValidatorSet = { } return message; }, + toJSON(message: ValidatorSet): unknown { const obj: any = {}; if (message.validators) { @@ -126,6 +119,8 @@ export const ValidatorSet = { }, }; +const baseValidator: object = { votingPower: Long.ZERO, proposerPriority: Long.ZERO }; + export const Validator = { encode(message: Validator, writer: Writer = Writer.create()): Writer { writer.uint32(10).bytes(message.address); @@ -136,7 +131,8 @@ export const Validator = { writer.uint32(32).int64(message.proposerPriority); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Validator { + + decode(input: Reader | Uint8Array, length?: number): Validator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseValidator } as Validator; @@ -162,6 +158,7 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { @@ -184,6 +181,7 @@ export const Validator = { } return message; }, + fromPartial(object: DeepPartial): Validator { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { @@ -208,6 +206,7 @@ export const Validator = { } return message; }, + toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && @@ -221,6 +220,8 @@ export const Validator = { }, }; +const baseSimpleValidator: object = { votingPower: Long.ZERO }; + export const SimpleValidator = { encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { if (message.pubKey !== undefined && message.pubKey !== undefined) { @@ -229,7 +230,8 @@ export const SimpleValidator = { writer.uint32(16).int64(message.votingPower); return writer; }, - decode(input: Uint8Array | Reader, length?: number): SimpleValidator { + + decode(input: Reader | Uint8Array, length?: number): SimpleValidator { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseSimpleValidator } as SimpleValidator; @@ -249,6 +251,7 @@ export const SimpleValidator = { } return message; }, + fromJSON(object: any): SimpleValidator { const message = { ...baseSimpleValidator } as SimpleValidator; if (object.pubKey !== undefined && object.pubKey !== null) { @@ -263,6 +266,7 @@ export const SimpleValidator = { } return message; }, + fromPartial(object: DeepPartial): SimpleValidator { const message = { ...baseSimpleValidator } as SimpleValidator; if (object.pubKey !== undefined && object.pubKey !== null) { @@ -277,6 +281,7 @@ export const SimpleValidator = { } return message; }, + toJSON(message: SimpleValidator): unknown { const obj: any = {}; message.pubKey !== undefined && @@ -286,15 +291,18 @@ export const SimpleValidator = { }, }; -interface WindowBase64 { - atob(b64: string): string; - btoa(bin: string): string; -} - -const windowBase64 = (globalThis as unknown) as WindowBase64; -const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); -const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); +declare var self: any | undefined; +declare var window: 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 new Error("Unable to locate global object"); +})(); +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); const arr = new Uint8Array(bin.length); @@ -304,6 +312,8 @@ function bytesFromBase64(b64: string): Uint8Array { return arr; } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; for (let i = 0; i < arr.byteLength; ++i) { @@ -311,7 +321,8 @@ function base64FromBytes(arr: Uint8Array): string { } return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; + +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/src/codec/tendermint/version/types.ts b/packages/stargate/src/codec/tendermint/version/types.ts index 01439a65..092109ea 100644 --- a/packages/stargate/src/codec/tendermint/version/types.ts +++ b/packages/stargate/src/codec/tendermint/version/types.ts @@ -2,10 +2,12 @@ import * as Long from "long"; import { Writer, Reader } from "protobufjs/minimal"; +export const protobufPackage = "tendermint.version"; + /** - * App includes the protocol and software version for the application. - * This information is included in ResponseInfo. The App.Protocol can be - * updated in ResponseEndBlock. + * 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; @@ -13,26 +15,16 @@ export interface App { } /** - * 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. + * 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; } -const baseApp: object = { - protocol: Long.UZERO, - software: "", -}; - -const baseConsensus: object = { - block: Long.UZERO, - app: Long.UZERO, -}; - -export const protobufPackage = "tendermint.version"; +const baseApp: object = { protocol: Long.UZERO, software: "" }; export const App = { encode(message: App, writer: Writer = Writer.create()): Writer { @@ -40,7 +32,8 @@ export const App = { writer.uint32(18).string(message.software); return writer; }, - decode(input: Uint8Array | Reader, length?: number): App { + + decode(input: Reader | Uint8Array, length?: number): App { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseApp } as App; @@ -60,6 +53,7 @@ export const App = { } return message; }, + fromJSON(object: any): App { const message = { ...baseApp } as App; if (object.protocol !== undefined && object.protocol !== null) { @@ -74,6 +68,7 @@ export const App = { } return message; }, + fromPartial(object: DeepPartial): App { const message = { ...baseApp } as App; if (object.protocol !== undefined && object.protocol !== null) { @@ -88,6 +83,7 @@ export const App = { } return message; }, + toJSON(message: App): unknown { const obj: any = {}; message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); @@ -96,13 +92,16 @@ export const App = { }, }; +const baseConsensus: object = { block: Long.UZERO, app: Long.UZERO }; + export const Consensus = { encode(message: Consensus, writer: Writer = Writer.create()): Writer { writer.uint32(8).uint64(message.block); writer.uint32(16).uint64(message.app); return writer; }, - decode(input: Uint8Array | Reader, length?: number): Consensus { + + decode(input: Reader | Uint8Array, length?: number): Consensus { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseConsensus } as Consensus; @@ -122,6 +121,7 @@ export const Consensus = { } return message; }, + fromJSON(object: any): Consensus { const message = { ...baseConsensus } as Consensus; if (object.block !== undefined && object.block !== null) { @@ -136,6 +136,7 @@ export const Consensus = { } return message; }, + fromPartial(object: DeepPartial): Consensus { const message = { ...baseConsensus } as Consensus; if (object.block !== undefined && object.block !== null) { @@ -150,6 +151,7 @@ export const Consensus = { } return message; }, + toJSON(message: Consensus): unknown { const obj: any = {}; message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); @@ -158,7 +160,7 @@ export const Consensus = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; +type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/packages/stargate/types/codec/generated/codecimpl.d.ts b/packages/stargate/types/codec/generated/codecimpl.d.ts deleted file mode 100644 index ec980e21..00000000 --- a/packages/stargate/types/codec/generated/codecimpl.d.ts +++ /dev/null @@ -1,22173 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace cosmos. */ -export namespace cosmos { - /** Namespace auth. */ - namespace auth { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a BaseAccount. */ - interface IBaseAccount { - /** BaseAccount address */ - address?: string | null; - - /** BaseAccount pubKey */ - pubKey?: google.protobuf.IAny | null; - - /** BaseAccount accountNumber */ - accountNumber?: Long | null; - - /** BaseAccount sequence */ - sequence?: Long | null; - } - - /** Represents a BaseAccount. */ - class BaseAccount implements IBaseAccount { - /** - * Constructs a new BaseAccount. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IBaseAccount); - - /** BaseAccount address. */ - public address: string; - - /** BaseAccount pubKey. */ - public pubKey?: google.protobuf.IAny | null; - - /** BaseAccount accountNumber. */ - public accountNumber: Long; - - /** BaseAccount sequence. */ - public sequence: Long; - - /** - * Creates a new BaseAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns BaseAccount instance - */ - public static create(properties?: cosmos.auth.v1beta1.IBaseAccount): cosmos.auth.v1beta1.BaseAccount; - - /** - * Encodes the specified BaseAccount message. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @param m BaseAccount message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.auth.v1beta1.IBaseAccount, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BaseAccount message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.auth.v1beta1.BaseAccount; - } - - /** Properties of a ModuleAccount. */ - interface IModuleAccount { - /** ModuleAccount baseAccount */ - baseAccount?: cosmos.auth.v1beta1.IBaseAccount | null; - - /** ModuleAccount name */ - name?: string | null; - - /** ModuleAccount permissions */ - permissions?: string[] | null; - } - - /** Represents a ModuleAccount. */ - class ModuleAccount implements IModuleAccount { - /** - * Constructs a new ModuleAccount. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IModuleAccount); - - /** ModuleAccount baseAccount. */ - public baseAccount?: cosmos.auth.v1beta1.IBaseAccount | null; - - /** ModuleAccount name. */ - public name: string; - - /** ModuleAccount permissions. */ - public permissions: string[]; - - /** - * Creates a new ModuleAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ModuleAccount instance - */ - public static create( - properties?: cosmos.auth.v1beta1.IModuleAccount, - ): cosmos.auth.v1beta1.ModuleAccount; - - /** - * Encodes the specified ModuleAccount message. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @param m ModuleAccount message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.auth.v1beta1.IModuleAccount, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.auth.v1beta1.ModuleAccount; - } - - /** Properties of a Params. */ - interface IParams { - /** Params maxMemoCharacters */ - maxMemoCharacters?: Long | null; - - /** Params txSigLimit */ - txSigLimit?: Long | null; - - /** Params txSizeCostPerByte */ - txSizeCostPerByte?: Long | null; - - /** Params sigVerifyCostEd25519 */ - sigVerifyCostEd25519?: Long | null; - - /** Params sigVerifyCostSecp256k1 */ - sigVerifyCostSecp256k1?: Long | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IParams); - - /** Params maxMemoCharacters. */ - public maxMemoCharacters: Long; - - /** Params txSigLimit. */ - public txSigLimit: Long; - - /** Params txSizeCostPerByte. */ - public txSizeCostPerByte: Long; - - /** Params sigVerifyCostEd25519. */ - public sigVerifyCostEd25519: Long; - - /** Params sigVerifyCostSecp256k1. */ - public sigVerifyCostSecp256k1: Long; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: cosmos.auth.v1beta1.IParams): cosmos.auth.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.auth.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.auth.v1beta1.Params; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Account. - * @param request QueryAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryAccountResponse - */ - public account( - request: cosmos.auth.v1beta1.IQueryAccountRequest, - callback: cosmos.auth.v1beta1.Query.AccountCallback, - ): void; - - /** - * Calls Account. - * @param request QueryAccountRequest message or plain object - * @returns Promise - */ - public account( - request: cosmos.auth.v1beta1.IQueryAccountRequest, - ): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params( - request: cosmos.auth.v1beta1.IQueryParamsRequest, - callback: cosmos.auth.v1beta1.Query.ParamsCallback, - ): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params( - request: cosmos.auth.v1beta1.IQueryParamsRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link cosmos.auth.v1beta1.Query#account}. - * @param error Error, if any - * @param [response] QueryAccountResponse - */ - type AccountCallback = ( - error: Error | null, - response?: cosmos.auth.v1beta1.QueryAccountResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.auth.v1beta1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = ( - error: Error | null, - response?: cosmos.auth.v1beta1.QueryParamsResponse, - ) => void; - } - - /** Properties of a QueryAccountRequest. */ - interface IQueryAccountRequest { - /** QueryAccountRequest address */ - address?: string | null; - } - - /** Represents a QueryAccountRequest. */ - class QueryAccountRequest implements IQueryAccountRequest { - /** - * Constructs a new QueryAccountRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IQueryAccountRequest); - - /** QueryAccountRequest address. */ - public address: string; - - /** - * Creates a new QueryAccountRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAccountRequest instance - */ - public static create( - properties?: cosmos.auth.v1beta1.IQueryAccountRequest, - ): cosmos.auth.v1beta1.QueryAccountRequest; - - /** - * Encodes the specified QueryAccountRequest message. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountRequest.verify|verify} messages. - * @param m QueryAccountRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.auth.v1beta1.IQueryAccountRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryAccountRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.auth.v1beta1.QueryAccountRequest; - } - - /** Properties of a QueryAccountResponse. */ - interface IQueryAccountResponse { - /** QueryAccountResponse account */ - account?: google.protobuf.IAny | null; - } - - /** Represents a QueryAccountResponse. */ - class QueryAccountResponse implements IQueryAccountResponse { - /** - * Constructs a new QueryAccountResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IQueryAccountResponse); - - /** QueryAccountResponse account. */ - public account?: google.protobuf.IAny | null; - - /** - * Creates a new QueryAccountResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAccountResponse instance - */ - public static create( - properties?: cosmos.auth.v1beta1.IQueryAccountResponse, - ): cosmos.auth.v1beta1.QueryAccountResponse; - - /** - * Encodes the specified QueryAccountResponse message. Does not implicitly {@link cosmos.auth.v1beta1.QueryAccountResponse.verify|verify} messages. - * @param m QueryAccountResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.auth.v1beta1.IQueryAccountResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryAccountResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.auth.v1beta1.QueryAccountResponse; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest {} - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - /** - * Constructs a new QueryParamsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IQueryParamsRequest); - - /** - * Creates a new QueryParamsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsRequest instance - */ - public static create( - properties?: cosmos.auth.v1beta1.IQueryParamsRequest, - ): cosmos.auth.v1beta1.QueryParamsRequest; - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param m QueryParamsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.auth.v1beta1.IQueryParamsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.auth.v1beta1.QueryParamsRequest; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - /** QueryParamsResponse params */ - params?: cosmos.auth.v1beta1.IParams | null; - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - /** - * Constructs a new QueryParamsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.auth.v1beta1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: cosmos.auth.v1beta1.IParams | null; - - /** - * Creates a new QueryParamsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsResponse instance - */ - public static create( - properties?: cosmos.auth.v1beta1.IQueryParamsResponse, - ): cosmos.auth.v1beta1.QueryParamsResponse; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.auth.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param m QueryParamsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.auth.v1beta1.IQueryParamsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.auth.v1beta1.QueryParamsResponse; - } - } - } - - /** Namespace bank. */ - namespace bank { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Params. */ - interface IParams { - /** Params sendEnabled */ - sendEnabled?: cosmos.bank.v1beta1.ISendEnabled[] | null; - - /** Params defaultSendEnabled */ - defaultSendEnabled?: boolean | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IParams); - - /** Params sendEnabled. */ - public sendEnabled: cosmos.bank.v1beta1.ISendEnabled[]; - - /** Params defaultSendEnabled. */ - public defaultSendEnabled: boolean; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: cosmos.bank.v1beta1.IParams): cosmos.bank.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Params; - } - - /** Properties of a SendEnabled. */ - interface ISendEnabled { - /** SendEnabled denom */ - denom?: string | null; - - /** SendEnabled enabled */ - enabled?: boolean | null; - } - - /** Represents a SendEnabled. */ - class SendEnabled implements ISendEnabled { - /** - * Constructs a new SendEnabled. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISendEnabled); - - /** SendEnabled denom. */ - public denom: string; - - /** SendEnabled enabled. */ - public enabled: boolean; - - /** - * Creates a new SendEnabled instance using the specified properties. - * @param [properties] Properties to set - * @returns SendEnabled instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISendEnabled): cosmos.bank.v1beta1.SendEnabled; - - /** - * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. - * @param m SendEnabled message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISendEnabled, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SendEnabled message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SendEnabled - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.SendEnabled; - } - - /** Properties of an Input. */ - interface IInput { - /** Input address */ - address?: string | null; - - /** Input coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Input. */ - class Input implements IInput { - /** - * Constructs a new Input. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IInput); - - /** Input address. */ - public address: string; - - /** Input coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Input instance using the specified properties. - * @param [properties] Properties to set - * @returns Input instance - */ - public static create(properties?: cosmos.bank.v1beta1.IInput): cosmos.bank.v1beta1.Input; - - /** - * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. - * @param m Input message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IInput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Input message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Input - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Input; - } - - /** Properties of an Output. */ - interface IOutput { - /** Output address */ - address?: string | null; - - /** Output coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Output. */ - class Output implements IOutput { - /** - * Constructs a new Output. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IOutput); - - /** Output address. */ - public address: string; - - /** Output coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Output instance using the specified properties. - * @param [properties] Properties to set - * @returns Output instance - */ - public static create(properties?: cosmos.bank.v1beta1.IOutput): cosmos.bank.v1beta1.Output; - - /** - * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. - * @param m Output message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IOutput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Output message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Output - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Output; - } - - /** Properties of a Supply. */ - interface ISupply { - /** Supply total */ - total?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a Supply. */ - class Supply implements ISupply { - /** - * Constructs a new Supply. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISupply); - - /** Supply total. */ - public total: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Supply instance using the specified properties. - * @param [properties] Properties to set - * @returns Supply instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISupply): cosmos.bank.v1beta1.Supply; - - /** - * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. - * @param m Supply message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISupply, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Supply message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Supply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Supply; - } - - /** Properties of a DenomUnit. */ - interface IDenomUnit { - /** DenomUnit denom */ - denom?: string | null; - - /** DenomUnit exponent */ - exponent?: number | null; - - /** DenomUnit aliases */ - aliases?: string[] | null; - } - - /** Represents a DenomUnit. */ - class DenomUnit implements IDenomUnit { - /** - * Constructs a new DenomUnit. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IDenomUnit); - - /** DenomUnit denom. */ - public denom: string; - - /** DenomUnit exponent. */ - public exponent: number; - - /** DenomUnit aliases. */ - public aliases: string[]; - - /** - * Creates a new DenomUnit instance using the specified properties. - * @param [properties] Properties to set - * @returns DenomUnit instance - */ - public static create(properties?: cosmos.bank.v1beta1.IDenomUnit): cosmos.bank.v1beta1.DenomUnit; - - /** - * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. - * @param m DenomUnit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IDenomUnit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomUnit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DenomUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.DenomUnit; - } - - /** Properties of a Metadata. */ - interface IMetadata { - /** Metadata description */ - description?: string | null; - - /** Metadata denomUnits */ - denomUnits?: cosmos.bank.v1beta1.IDenomUnit[] | null; - - /** Metadata base */ - base?: string | null; - - /** Metadata display */ - display?: string | null; - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - /** - * Constructs a new Metadata. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMetadata); - - /** Metadata description. */ - public description: string; - - /** Metadata denomUnits. */ - public denomUnits: cosmos.bank.v1beta1.IDenomUnit[]; - - /** Metadata base. */ - public base: string; - - /** Metadata display. */ - public display: string; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMetadata): cosmos.bank.v1beta1.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. - * @param m Metadata message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMetadata, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Metadata; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Balance. - * @param request QueryBalanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryBalanceResponse - */ - public balance( - request: cosmos.bank.v1beta1.IQueryBalanceRequest, - callback: cosmos.bank.v1beta1.Query.BalanceCallback, - ): void; - - /** - * Calls Balance. - * @param request QueryBalanceRequest message or plain object - * @returns Promise - */ - public balance( - request: cosmos.bank.v1beta1.IQueryBalanceRequest, - ): Promise; - - /** - * Calls AllBalances. - * @param request QueryAllBalancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryAllBalancesResponse - */ - public allBalances( - request: cosmos.bank.v1beta1.IQueryAllBalancesRequest, - callback: cosmos.bank.v1beta1.Query.AllBalancesCallback, - ): void; - - /** - * Calls AllBalances. - * @param request QueryAllBalancesRequest message or plain object - * @returns Promise - */ - public allBalances( - request: cosmos.bank.v1beta1.IQueryAllBalancesRequest, - ): Promise; - - /** - * Calls TotalSupply. - * @param request QueryTotalSupplyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryTotalSupplyResponse - */ - public totalSupply( - request: cosmos.bank.v1beta1.IQueryTotalSupplyRequest, - callback: cosmos.bank.v1beta1.Query.TotalSupplyCallback, - ): void; - - /** - * Calls TotalSupply. - * @param request QueryTotalSupplyRequest message or plain object - * @returns Promise - */ - public totalSupply( - request: cosmos.bank.v1beta1.IQueryTotalSupplyRequest, - ): Promise; - - /** - * Calls SupplyOf. - * @param request QuerySupplyOfRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QuerySupplyOfResponse - */ - public supplyOf( - request: cosmos.bank.v1beta1.IQuerySupplyOfRequest, - callback: cosmos.bank.v1beta1.Query.SupplyOfCallback, - ): void; - - /** - * Calls SupplyOf. - * @param request QuerySupplyOfRequest message or plain object - * @returns Promise - */ - public supplyOf( - request: cosmos.bank.v1beta1.IQuerySupplyOfRequest, - ): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params( - request: cosmos.bank.v1beta1.IQueryParamsRequest, - callback: cosmos.bank.v1beta1.Query.ParamsCallback, - ): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params( - request: cosmos.bank.v1beta1.IQueryParamsRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link cosmos.bank.v1beta1.Query#balance}. - * @param error Error, if any - * @param [response] QueryBalanceResponse - */ - type BalanceCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.QueryBalanceResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Query#allBalances}. - * @param error Error, if any - * @param [response] QueryAllBalancesResponse - */ - type AllBalancesCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.QueryAllBalancesResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Query#totalSupply}. - * @param error Error, if any - * @param [response] QueryTotalSupplyResponse - */ - type TotalSupplyCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.QueryTotalSupplyResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Query#supplyOf}. - * @param error Error, if any - * @param [response] QuerySupplyOfResponse - */ - type SupplyOfCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.QuerySupplyOfResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.QueryParamsResponse, - ) => void; - } - - /** Properties of a QueryBalanceRequest. */ - interface IQueryBalanceRequest { - /** QueryBalanceRequest address */ - address?: string | null; - - /** QueryBalanceRequest denom */ - denom?: string | null; - } - - /** Represents a QueryBalanceRequest. */ - class QueryBalanceRequest implements IQueryBalanceRequest { - /** - * Constructs a new QueryBalanceRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryBalanceRequest); - - /** QueryBalanceRequest address. */ - public address: string; - - /** QueryBalanceRequest denom. */ - public denom: string; - - /** - * Creates a new QueryBalanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryBalanceRequest instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryBalanceRequest, - ): cosmos.bank.v1beta1.QueryBalanceRequest; - - /** - * Encodes the specified QueryBalanceRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceRequest.verify|verify} messages. - * @param m QueryBalanceRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryBalanceRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryBalanceRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryBalanceRequest; - } - - /** Properties of a QueryBalanceResponse. */ - interface IQueryBalanceResponse { - /** QueryBalanceResponse balance */ - balance?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a QueryBalanceResponse. */ - class QueryBalanceResponse implements IQueryBalanceResponse { - /** - * Constructs a new QueryBalanceResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryBalanceResponse); - - /** QueryBalanceResponse balance. */ - public balance?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new QueryBalanceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryBalanceResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryBalanceResponse, - ): cosmos.bank.v1beta1.QueryBalanceResponse; - - /** - * Encodes the specified QueryBalanceResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryBalanceResponse.verify|verify} messages. - * @param m QueryBalanceResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryBalanceResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryBalanceResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryBalanceResponse; - } - - /** Properties of a QueryAllBalancesRequest. */ - interface IQueryAllBalancesRequest { - /** QueryAllBalancesRequest address */ - address?: string | null; - - /** QueryAllBalancesRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryAllBalancesRequest. */ - class QueryAllBalancesRequest implements IQueryAllBalancesRequest { - /** - * Constructs a new QueryAllBalancesRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryAllBalancesRequest); - - /** QueryAllBalancesRequest address. */ - public address: string; - - /** QueryAllBalancesRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryAllBalancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAllBalancesRequest instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryAllBalancesRequest, - ): cosmos.bank.v1beta1.QueryAllBalancesRequest; - - /** - * Encodes the specified QueryAllBalancesRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesRequest.verify|verify} messages. - * @param m QueryAllBalancesRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryAllBalancesRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryAllBalancesRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryAllBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryAllBalancesRequest; - } - - /** Properties of a QueryAllBalancesResponse. */ - interface IQueryAllBalancesResponse { - /** QueryAllBalancesResponse balances */ - balances?: cosmos.base.v1beta1.ICoin[] | null; - - /** QueryAllBalancesResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryAllBalancesResponse. */ - class QueryAllBalancesResponse implements IQueryAllBalancesResponse { - /** - * Constructs a new QueryAllBalancesResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryAllBalancesResponse); - - /** QueryAllBalancesResponse balances. */ - public balances: cosmos.base.v1beta1.ICoin[]; - - /** QueryAllBalancesResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryAllBalancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAllBalancesResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryAllBalancesResponse, - ): cosmos.bank.v1beta1.QueryAllBalancesResponse; - - /** - * Encodes the specified QueryAllBalancesResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryAllBalancesResponse.verify|verify} messages. - * @param m QueryAllBalancesResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryAllBalancesResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryAllBalancesResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryAllBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryAllBalancesResponse; - } - - /** Properties of a QueryTotalSupplyRequest. */ - interface IQueryTotalSupplyRequest {} - - /** Represents a QueryTotalSupplyRequest. */ - class QueryTotalSupplyRequest implements IQueryTotalSupplyRequest { - /** - * Constructs a new QueryTotalSupplyRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryTotalSupplyRequest); - - /** - * Creates a new QueryTotalSupplyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryTotalSupplyRequest instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryTotalSupplyRequest, - ): cosmos.bank.v1beta1.QueryTotalSupplyRequest; - - /** - * Encodes the specified QueryTotalSupplyRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyRequest.verify|verify} messages. - * @param m QueryTotalSupplyRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryTotalSupplyRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryTotalSupplyRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryTotalSupplyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryTotalSupplyRequest; - } - - /** Properties of a QueryTotalSupplyResponse. */ - interface IQueryTotalSupplyResponse { - /** QueryTotalSupplyResponse supply */ - supply?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a QueryTotalSupplyResponse. */ - class QueryTotalSupplyResponse implements IQueryTotalSupplyResponse { - /** - * Constructs a new QueryTotalSupplyResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryTotalSupplyResponse); - - /** QueryTotalSupplyResponse supply. */ - public supply: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new QueryTotalSupplyResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryTotalSupplyResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryTotalSupplyResponse, - ): cosmos.bank.v1beta1.QueryTotalSupplyResponse; - - /** - * Encodes the specified QueryTotalSupplyResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryTotalSupplyResponse.verify|verify} messages. - * @param m QueryTotalSupplyResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryTotalSupplyResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryTotalSupplyResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryTotalSupplyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryTotalSupplyResponse; - } - - /** Properties of a QuerySupplyOfRequest. */ - interface IQuerySupplyOfRequest { - /** QuerySupplyOfRequest denom */ - denom?: string | null; - } - - /** Represents a QuerySupplyOfRequest. */ - class QuerySupplyOfRequest implements IQuerySupplyOfRequest { - /** - * Constructs a new QuerySupplyOfRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQuerySupplyOfRequest); - - /** QuerySupplyOfRequest denom. */ - public denom: string; - - /** - * Creates a new QuerySupplyOfRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QuerySupplyOfRequest instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQuerySupplyOfRequest, - ): cosmos.bank.v1beta1.QuerySupplyOfRequest; - - /** - * Encodes the specified QuerySupplyOfRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfRequest.verify|verify} messages. - * @param m QuerySupplyOfRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQuerySupplyOfRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QuerySupplyOfRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QuerySupplyOfRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QuerySupplyOfRequest; - } - - /** Properties of a QuerySupplyOfResponse. */ - interface IQuerySupplyOfResponse { - /** QuerySupplyOfResponse amount */ - amount?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a QuerySupplyOfResponse. */ - class QuerySupplyOfResponse implements IQuerySupplyOfResponse { - /** - * Constructs a new QuerySupplyOfResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQuerySupplyOfResponse); - - /** QuerySupplyOfResponse amount. */ - public amount?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new QuerySupplyOfResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QuerySupplyOfResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQuerySupplyOfResponse, - ): cosmos.bank.v1beta1.QuerySupplyOfResponse; - - /** - * Encodes the specified QuerySupplyOfResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QuerySupplyOfResponse.verify|verify} messages. - * @param m QuerySupplyOfResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQuerySupplyOfResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QuerySupplyOfResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QuerySupplyOfResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QuerySupplyOfResponse; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest {} - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - /** - * Constructs a new QueryParamsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryParamsRequest); - - /** - * Creates a new QueryParamsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsRequest instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryParamsRequest, - ): cosmos.bank.v1beta1.QueryParamsRequest; - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param m QueryParamsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryParamsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryParamsRequest; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - /** QueryParamsResponse params */ - params?: cosmos.bank.v1beta1.IParams | null; - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - /** - * Constructs a new QueryParamsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: cosmos.bank.v1beta1.IParams | null; - - /** - * Creates a new QueryParamsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IQueryParamsResponse, - ): cosmos.bank.v1beta1.QueryParamsResponse; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.bank.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param m QueryParamsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IQueryParamsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.QueryParamsResponse; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Msg service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Msg; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSendResponse - */ - public send( - request: cosmos.bank.v1beta1.IMsgSend, - callback: cosmos.bank.v1beta1.Msg.SendCallback, - ): void; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @returns Promise - */ - public send(request: cosmos.bank.v1beta1.IMsgSend): Promise; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgMultiSendResponse - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - callback: cosmos.bank.v1beta1.Msg.MultiSendCallback, - ): void; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @returns Promise - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - ): Promise; - } - - namespace Msg { - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. - * @param error Error, if any - * @param [response] MsgSendResponse - */ - type SendCallback = (error: Error | null, response?: cosmos.bank.v1beta1.MsgSendResponse) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. - * @param error Error, if any - * @param [response] MsgMultiSendResponse - */ - type MultiSendCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.MsgMultiSendResponse, - ) => void; - } - - /** Properties of a MsgSend. */ - interface IMsgSend { - /** MsgSend fromAddress */ - fromAddress?: string | null; - - /** MsgSend toAddress */ - toAddress?: string | null; - - /** MsgSend amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a MsgSend. */ - class MsgSend implements IMsgSend { - /** - * Constructs a new MsgSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSend); - - /** MsgSend fromAddress. */ - public fromAddress: string; - - /** MsgSend toAddress. */ - public toAddress: string; - - /** MsgSend amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new MsgSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSend instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMsgSend): cosmos.bank.v1beta1.MsgSend; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. - * @param m MsgSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgSend; - } - - /** Properties of a MsgSendResponse. */ - interface IMsgSendResponse {} - - /** Represents a MsgSendResponse. */ - class MsgSendResponse implements IMsgSendResponse { - /** - * Constructs a new MsgSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSendResponse); - - /** - * Creates a new MsgSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgSendResponse, - ): cosmos.bank.v1beta1.MsgSendResponse; - - /** - * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. - * @param m MsgSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSendResponse, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgSendResponse; - } - - /** Properties of a MsgMultiSend. */ - interface IMsgMultiSend { - /** MsgMultiSend inputs */ - inputs?: cosmos.bank.v1beta1.IInput[] | null; - - /** MsgMultiSend outputs */ - outputs?: cosmos.bank.v1beta1.IOutput[] | null; - } - - /** Represents a MsgMultiSend. */ - class MsgMultiSend implements IMsgMultiSend { - /** - * Constructs a new MsgMultiSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSend); - - /** MsgMultiSend inputs. */ - public inputs: cosmos.bank.v1beta1.IInput[]; - - /** MsgMultiSend outputs. */ - public outputs: cosmos.bank.v1beta1.IOutput[]; - - /** - * Creates a new MsgMultiSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSend instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSend, - ): cosmos.bank.v1beta1.MsgMultiSend; - - /** - * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. - * @param m MsgMultiSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgMultiSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgMultiSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgMultiSend; - } - - /** Properties of a MsgMultiSendResponse. */ - interface IMsgMultiSendResponse {} - - /** Represents a MsgMultiSendResponse. */ - class MsgMultiSendResponse implements IMsgMultiSendResponse { - /** - * Constructs a new MsgMultiSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSendResponse); - - /** - * Creates a new MsgMultiSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSendResponse, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - - /** - * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. - * @param m MsgMultiSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IMsgMultiSendResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgMultiSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - } - } - } - - /** Namespace base. */ - namespace base { - /** Namespace abci. */ - namespace abci { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a TxResponse. */ - interface ITxResponse { - /** TxResponse height */ - height?: Long | null; - - /** TxResponse txhash */ - txhash?: string | null; - - /** TxResponse codespace */ - codespace?: string | null; - - /** TxResponse code */ - code?: number | null; - - /** TxResponse data */ - data?: string | null; - - /** TxResponse rawLog */ - rawLog?: string | null; - - /** TxResponse logs */ - logs?: cosmos.base.abci.v1beta1.IABCIMessageLog[] | null; - - /** TxResponse info */ - info?: string | null; - - /** TxResponse gasWanted */ - gasWanted?: Long | null; - - /** TxResponse gasUsed */ - gasUsed?: Long | null; - - /** TxResponse tx */ - tx?: google.protobuf.IAny | null; - - /** TxResponse timestamp */ - timestamp?: string | null; - } - - /** Represents a TxResponse. */ - class TxResponse implements ITxResponse { - /** - * Constructs a new TxResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.ITxResponse); - - /** TxResponse height. */ - public height: Long; - - /** TxResponse txhash. */ - public txhash: string; - - /** TxResponse codespace. */ - public codespace: string; - - /** TxResponse code. */ - public code: number; - - /** TxResponse data. */ - public data: string; - - /** TxResponse rawLog. */ - public rawLog: string; - - /** TxResponse logs. */ - public logs: cosmos.base.abci.v1beta1.IABCIMessageLog[]; - - /** TxResponse info. */ - public info: string; - - /** TxResponse gasWanted. */ - public gasWanted: Long; - - /** TxResponse gasUsed. */ - public gasUsed: Long; - - /** TxResponse tx. */ - public tx?: google.protobuf.IAny | null; - - /** TxResponse timestamp. */ - public timestamp: string; - - /** - * Creates a new TxResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TxResponse instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.ITxResponse, - ): cosmos.base.abci.v1beta1.TxResponse; - - /** - * Encodes the specified TxResponse message. Does not implicitly {@link cosmos.base.abci.v1beta1.TxResponse.verify|verify} messages. - * @param m TxResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.ITxResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a TxResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.TxResponse; - } - - /** Properties of a ABCIMessageLog. */ - interface IABCIMessageLog { - /** ABCIMessageLog msgIndex */ - msgIndex?: number | null; - - /** ABCIMessageLog log */ - log?: string | null; - - /** ABCIMessageLog events */ - events?: cosmos.base.abci.v1beta1.IStringEvent[] | null; - } - - /** Represents a ABCIMessageLog. */ - class ABCIMessageLog implements IABCIMessageLog { - /** - * Constructs a new ABCIMessageLog. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IABCIMessageLog); - - /** ABCIMessageLog msgIndex. */ - public msgIndex: number; - - /** ABCIMessageLog log. */ - public log: string; - - /** ABCIMessageLog events. */ - public events: cosmos.base.abci.v1beta1.IStringEvent[]; - - /** - * Creates a new ABCIMessageLog instance using the specified properties. - * @param [properties] Properties to set - * @returns ABCIMessageLog instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IABCIMessageLog, - ): cosmos.base.abci.v1beta1.ABCIMessageLog; - - /** - * Encodes the specified ABCIMessageLog message. Does not implicitly {@link cosmos.base.abci.v1beta1.ABCIMessageLog.verify|verify} messages. - * @param m ABCIMessageLog message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.IABCIMessageLog, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ABCIMessageLog message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ABCIMessageLog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.ABCIMessageLog; - } - - /** Properties of a StringEvent. */ - interface IStringEvent { - /** StringEvent type */ - type?: string | null; - - /** StringEvent attributes */ - attributes?: cosmos.base.abci.v1beta1.IAttribute[] | null; - } - - /** Represents a StringEvent. */ - class StringEvent implements IStringEvent { - /** - * Constructs a new StringEvent. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IStringEvent); - - /** StringEvent type. */ - public type: string; - - /** StringEvent attributes. */ - public attributes: cosmos.base.abci.v1beta1.IAttribute[]; - - /** - * Creates a new StringEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns StringEvent instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IStringEvent, - ): cosmos.base.abci.v1beta1.StringEvent; - - /** - * Encodes the specified StringEvent message. Does not implicitly {@link cosmos.base.abci.v1beta1.StringEvent.verify|verify} messages. - * @param m StringEvent message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.IStringEvent, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a StringEvent message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns StringEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.StringEvent; - } - - /** Properties of an Attribute. */ - interface IAttribute { - /** Attribute key */ - key?: string | null; - - /** Attribute value */ - value?: string | null; - } - - /** Represents an Attribute. */ - class Attribute implements IAttribute { - /** - * Constructs a new Attribute. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IAttribute); - - /** Attribute key. */ - public key: string; - - /** Attribute value. */ - public value: string; - - /** - * Creates a new Attribute instance using the specified properties. - * @param [properties] Properties to set - * @returns Attribute instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IAttribute, - ): cosmos.base.abci.v1beta1.Attribute; - - /** - * Encodes the specified Attribute message. Does not implicitly {@link cosmos.base.abci.v1beta1.Attribute.verify|verify} messages. - * @param m Attribute message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.IAttribute, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an Attribute message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Attribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.Attribute; - } - - /** Properties of a GasInfo. */ - interface IGasInfo { - /** GasInfo gasWanted */ - gasWanted?: Long | null; - - /** GasInfo gasUsed */ - gasUsed?: Long | null; - } - - /** Represents a GasInfo. */ - class GasInfo implements IGasInfo { - /** - * Constructs a new GasInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IGasInfo); - - /** GasInfo gasWanted. */ - public gasWanted: Long; - - /** GasInfo gasUsed. */ - public gasUsed: Long; - - /** - * Creates a new GasInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GasInfo instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IGasInfo, - ): cosmos.base.abci.v1beta1.GasInfo; - - /** - * Encodes the specified GasInfo message. Does not implicitly {@link cosmos.base.abci.v1beta1.GasInfo.verify|verify} messages. - * @param m GasInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.abci.v1beta1.IGasInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GasInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns GasInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.GasInfo; - } - - /** Properties of a Result. */ - interface IResult { - /** Result data */ - data?: Uint8Array | null; - - /** Result log */ - log?: string | null; - - /** Result events */ - events?: tendermint.abci.IEvent[] | null; - } - - /** Represents a Result. */ - class Result implements IResult { - /** - * Constructs a new Result. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IResult); - - /** Result data. */ - public data: Uint8Array; - - /** Result log. */ - public log: string; - - /** Result events. */ - public events: tendermint.abci.IEvent[]; - - /** - * Creates a new Result instance using the specified properties. - * @param [properties] Properties to set - * @returns Result instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IResult, - ): cosmos.base.abci.v1beta1.Result; - - /** - * Encodes the specified Result message. Does not implicitly {@link cosmos.base.abci.v1beta1.Result.verify|verify} messages. - * @param m Result message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.abci.v1beta1.IResult, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Result message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Result - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.abci.v1beta1.Result; - } - - /** Properties of a SimulationResponse. */ - interface ISimulationResponse { - /** SimulationResponse gasInfo */ - gasInfo?: cosmos.base.abci.v1beta1.IGasInfo | null; - - /** SimulationResponse result */ - result?: cosmos.base.abci.v1beta1.IResult | null; - } - - /** Represents a SimulationResponse. */ - class SimulationResponse implements ISimulationResponse { - /** - * Constructs a new SimulationResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.ISimulationResponse); - - /** SimulationResponse gasInfo. */ - public gasInfo?: cosmos.base.abci.v1beta1.IGasInfo | null; - - /** SimulationResponse result. */ - public result?: cosmos.base.abci.v1beta1.IResult | null; - - /** - * Creates a new SimulationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SimulationResponse instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.ISimulationResponse, - ): cosmos.base.abci.v1beta1.SimulationResponse; - - /** - * Encodes the specified SimulationResponse message. Does not implicitly {@link cosmos.base.abci.v1beta1.SimulationResponse.verify|verify} messages. - * @param m SimulationResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.ISimulationResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SimulationResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SimulationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.SimulationResponse; - } - - /** Properties of a MsgData. */ - interface IMsgData { - /** MsgData msgType */ - msgType?: string | null; - - /** MsgData data */ - data?: Uint8Array | null; - } - - /** Represents a MsgData. */ - class MsgData implements IMsgData { - /** - * Constructs a new MsgData. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.IMsgData); - - /** MsgData msgType. */ - public msgType: string; - - /** MsgData data. */ - public data: Uint8Array; - - /** - * Creates a new MsgData instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgData instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.IMsgData, - ): cosmos.base.abci.v1beta1.MsgData; - - /** - * Encodes the specified MsgData message. Does not implicitly {@link cosmos.base.abci.v1beta1.MsgData.verify|verify} messages. - * @param m MsgData message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.abci.v1beta1.IMsgData, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgData message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.MsgData; - } - - /** Properties of a TxMsgData. */ - interface ITxMsgData { - /** TxMsgData data */ - data?: cosmos.base.abci.v1beta1.IMsgData[] | null; - } - - /** Represents a TxMsgData. */ - class TxMsgData implements ITxMsgData { - /** - * Constructs a new TxMsgData. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.ITxMsgData); - - /** TxMsgData data. */ - public data: cosmos.base.abci.v1beta1.IMsgData[]; - - /** - * Creates a new TxMsgData instance using the specified properties. - * @param [properties] Properties to set - * @returns TxMsgData instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.ITxMsgData, - ): cosmos.base.abci.v1beta1.TxMsgData; - - /** - * Encodes the specified TxMsgData message. Does not implicitly {@link cosmos.base.abci.v1beta1.TxMsgData.verify|verify} messages. - * @param m TxMsgData message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.ITxMsgData, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a TxMsgData message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxMsgData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.TxMsgData; - } - - /** Properties of a SearchTxsResult. */ - interface ISearchTxsResult { - /** SearchTxsResult totalCount */ - totalCount?: Long | null; - - /** SearchTxsResult count */ - count?: Long | null; - - /** SearchTxsResult pageNumber */ - pageNumber?: Long | null; - - /** SearchTxsResult pageTotal */ - pageTotal?: Long | null; - - /** SearchTxsResult limit */ - limit?: Long | null; - - /** SearchTxsResult txs */ - txs?: cosmos.base.abci.v1beta1.ITxResponse[] | null; - } - - /** Represents a SearchTxsResult. */ - class SearchTxsResult implements ISearchTxsResult { - /** - * Constructs a new SearchTxsResult. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.abci.v1beta1.ISearchTxsResult); - - /** SearchTxsResult totalCount. */ - public totalCount: Long; - - /** SearchTxsResult count. */ - public count: Long; - - /** SearchTxsResult pageNumber. */ - public pageNumber: Long; - - /** SearchTxsResult pageTotal. */ - public pageTotal: Long; - - /** SearchTxsResult limit. */ - public limit: Long; - - /** SearchTxsResult txs. */ - public txs: cosmos.base.abci.v1beta1.ITxResponse[]; - - /** - * Creates a new SearchTxsResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchTxsResult instance - */ - public static create( - properties?: cosmos.base.abci.v1beta1.ISearchTxsResult, - ): cosmos.base.abci.v1beta1.SearchTxsResult; - - /** - * Encodes the specified SearchTxsResult message. Does not implicitly {@link cosmos.base.abci.v1beta1.SearchTxsResult.verify|verify} messages. - * @param m SearchTxsResult message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.abci.v1beta1.ISearchTxsResult, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SearchTxsResult message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SearchTxsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.abci.v1beta1.SearchTxsResult; - } - } - } - - /** Namespace query. */ - namespace query { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a PageRequest. */ - interface IPageRequest { - /** PageRequest key */ - key?: Uint8Array | null; - - /** PageRequest offset */ - offset?: Long | null; - - /** PageRequest limit */ - limit?: Long | null; - - /** PageRequest countTotal */ - countTotal?: boolean | null; - } - - /** Represents a PageRequest. */ - class PageRequest implements IPageRequest { - /** - * Constructs a new PageRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.query.v1beta1.IPageRequest); - - /** PageRequest key. */ - public key: Uint8Array; - - /** PageRequest offset. */ - public offset: Long; - - /** PageRequest limit. */ - public limit: Long; - - /** PageRequest countTotal. */ - public countTotal: boolean; - - /** - * Creates a new PageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PageRequest instance - */ - public static create( - properties?: cosmos.base.query.v1beta1.IPageRequest, - ): cosmos.base.query.v1beta1.PageRequest; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @param m PageRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.query.v1beta1.IPageRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.query.v1beta1.PageRequest; - } - - /** Properties of a PageResponse. */ - interface IPageResponse { - /** PageResponse nextKey */ - nextKey?: Uint8Array | null; - - /** PageResponse total */ - total?: Long | null; - } - - /** Represents a PageResponse. */ - class PageResponse implements IPageResponse { - /** - * Constructs a new PageResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.query.v1beta1.IPageResponse); - - /** PageResponse nextKey. */ - public nextKey: Uint8Array; - - /** PageResponse total. */ - public total: Long; - - /** - * Creates a new PageResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PageResponse instance - */ - public static create( - properties?: cosmos.base.query.v1beta1.IPageResponse, - ): cosmos.base.query.v1beta1.PageResponse; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @param m PageResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.base.query.v1beta1.IPageResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.base.query.v1beta1.PageResponse; - } - } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Coin. */ - interface ICoin { - /** Coin denom */ - denom?: string | null; - - /** Coin amount */ - amount?: string | null; - } - - /** Represents a Coin. */ - class Coin implements ICoin { - /** - * Constructs a new Coin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param m Coin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.ICoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.Coin; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - /** DecCoin denom */ - denom?: string | null; - - /** DecCoin amount */ - amount?: string | null; - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - /** - * Constructs a new DecCoin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param m DecCoin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecCoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecCoin; - } - - /** Properties of an IntProto. */ - interface IIntProto { - /** IntProto int */ - int?: string | null; - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - /** - * Constructs a new IntProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param m IntProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IIntProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.IntProto; - } - - /** Properties of a DecProto. */ - interface IDecProto { - /** DecProto dec */ - dec?: string | null; - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - /** - * Constructs a new DecProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param m DecProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecProto; - } - } - } - - /** Namespace crypto. */ - namespace crypto { - /** Namespace multisig. */ - namespace multisig { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a MultiSignature. */ - interface IMultiSignature { - /** MultiSignature signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a MultiSignature. */ - class MultiSignature implements IMultiSignature { - /** - * Constructs a new MultiSignature. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.IMultiSignature); - - /** MultiSignature signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new MultiSignature instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiSignature instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.IMultiSignature, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - - /** - * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. - * @param m MultiSignature message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.IMultiSignature, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MultiSignature message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MultiSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - } - - /** Properties of a CompactBitArray. */ - interface ICompactBitArray { - /** CompactBitArray extraBitsStored */ - extraBitsStored?: number | null; - - /** CompactBitArray elems */ - elems?: Uint8Array | null; - } - - /** Represents a CompactBitArray. */ - class CompactBitArray implements ICompactBitArray { - /** - * Constructs a new CompactBitArray. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.ICompactBitArray); - - /** CompactBitArray extraBitsStored. */ - public extraBitsStored: number; - - /** CompactBitArray elems. */ - public elems: Uint8Array; - - /** - * Creates a new CompactBitArray instance using the specified properties. - * @param [properties] Properties to set - * @returns CompactBitArray instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - - /** - * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. - * @param m CompactBitArray message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CompactBitArray message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompactBitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - } - } - } - - /** Namespace secp256k1. */ - namespace secp256k1 { - /** Properties of a PubKey. */ - interface IPubKey { - /** PubKey key */ - key?: Uint8Array | null; - } - - /** Represents a PubKey. */ - class PubKey implements IPubKey { - /** - * Constructs a new PubKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPubKey); - - /** PubKey key. */ - public key: Uint8Array; - - /** - * Creates a new PubKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPubKey): cosmos.crypto.secp256k1.PubKey; - - /** - * Encodes the specified PubKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PubKey.verify|verify} messages. - * @param m PubKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPubKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PubKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PubKey; - } - - /** Properties of a PrivKey. */ - interface IPrivKey { - /** PrivKey key */ - key?: Uint8Array | null; - } - - /** Represents a PrivKey. */ - class PrivKey implements IPrivKey { - /** - * Constructs a new PrivKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPrivKey); - - /** PrivKey key. */ - public key: Uint8Array; - - /** - * Creates a new PrivKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PrivKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPrivKey): cosmos.crypto.secp256k1.PrivKey; - - /** - * Encodes the specified PrivKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PrivKey.verify|verify} messages. - * @param m PrivKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPrivKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrivKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PrivKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PrivKey; - } - } - } - - /** Namespace distribution. */ - namespace distribution { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Params. */ - interface IParams { - /** Params communityTax */ - communityTax?: string | null; - - /** Params baseProposerReward */ - baseProposerReward?: string | null; - - /** Params bonusProposerReward */ - bonusProposerReward?: string | null; - - /** Params withdrawAddrEnabled */ - withdrawAddrEnabled?: boolean | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IParams); - - /** Params communityTax. */ - public communityTax: string; - - /** Params baseProposerReward. */ - public baseProposerReward: string; - - /** Params bonusProposerReward. */ - public bonusProposerReward: string; - - /** Params withdrawAddrEnabled. */ - public withdrawAddrEnabled: boolean; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IParams, - ): cosmos.distribution.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.distribution.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.distribution.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.Params; - } - - /** Properties of a ValidatorHistoricalRewards. */ - interface IValidatorHistoricalRewards { - /** ValidatorHistoricalRewards cumulativeRewardRatio */ - cumulativeRewardRatio?: cosmos.base.v1beta1.IDecCoin[] | null; - - /** ValidatorHistoricalRewards referenceCount */ - referenceCount?: number | null; - } - - /** Represents a ValidatorHistoricalRewards. */ - class ValidatorHistoricalRewards implements IValidatorHistoricalRewards { - /** - * Constructs a new ValidatorHistoricalRewards. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorHistoricalRewards); - - /** ValidatorHistoricalRewards cumulativeRewardRatio. */ - public cumulativeRewardRatio: cosmos.base.v1beta1.IDecCoin[]; - - /** ValidatorHistoricalRewards referenceCount. */ - public referenceCount: number; - - /** - * Creates a new ValidatorHistoricalRewards instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorHistoricalRewards instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorHistoricalRewards, - ): cosmos.distribution.v1beta1.ValidatorHistoricalRewards; - - /** - * Encodes the specified ValidatorHistoricalRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorHistoricalRewards.verify|verify} messages. - * @param m ValidatorHistoricalRewards message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorHistoricalRewards, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorHistoricalRewards message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorHistoricalRewards - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorHistoricalRewards; - } - - /** Properties of a ValidatorCurrentRewards. */ - interface IValidatorCurrentRewards { - /** ValidatorCurrentRewards rewards */ - rewards?: cosmos.base.v1beta1.IDecCoin[] | null; - - /** ValidatorCurrentRewards period */ - period?: Long | null; - } - - /** Represents a ValidatorCurrentRewards. */ - class ValidatorCurrentRewards implements IValidatorCurrentRewards { - /** - * Constructs a new ValidatorCurrentRewards. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorCurrentRewards); - - /** ValidatorCurrentRewards rewards. */ - public rewards: cosmos.base.v1beta1.IDecCoin[]; - - /** ValidatorCurrentRewards period. */ - public period: Long; - - /** - * Creates a new ValidatorCurrentRewards instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorCurrentRewards instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorCurrentRewards, - ): cosmos.distribution.v1beta1.ValidatorCurrentRewards; - - /** - * Encodes the specified ValidatorCurrentRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorCurrentRewards.verify|verify} messages. - * @param m ValidatorCurrentRewards message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorCurrentRewards, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorCurrentRewards message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorCurrentRewards - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorCurrentRewards; - } - - /** Properties of a ValidatorAccumulatedCommission. */ - interface IValidatorAccumulatedCommission { - /** ValidatorAccumulatedCommission commission */ - commission?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a ValidatorAccumulatedCommission. */ - class ValidatorAccumulatedCommission implements IValidatorAccumulatedCommission { - /** - * Constructs a new ValidatorAccumulatedCommission. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorAccumulatedCommission); - - /** ValidatorAccumulatedCommission commission. */ - public commission: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new ValidatorAccumulatedCommission instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorAccumulatedCommission instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorAccumulatedCommission, - ): cosmos.distribution.v1beta1.ValidatorAccumulatedCommission; - - /** - * Encodes the specified ValidatorAccumulatedCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.verify|verify} messages. - * @param m ValidatorAccumulatedCommission message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorAccumulatedCommission, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorAccumulatedCommission message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorAccumulatedCommission - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorAccumulatedCommission; - } - - /** Properties of a ValidatorOutstandingRewards. */ - interface IValidatorOutstandingRewards { - /** ValidatorOutstandingRewards rewards */ - rewards?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a ValidatorOutstandingRewards. */ - class ValidatorOutstandingRewards implements IValidatorOutstandingRewards { - /** - * Constructs a new ValidatorOutstandingRewards. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorOutstandingRewards); - - /** ValidatorOutstandingRewards rewards. */ - public rewards: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new ValidatorOutstandingRewards instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorOutstandingRewards instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorOutstandingRewards, - ): cosmos.distribution.v1beta1.ValidatorOutstandingRewards; - - /** - * Encodes the specified ValidatorOutstandingRewards message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorOutstandingRewards.verify|verify} messages. - * @param m ValidatorOutstandingRewards message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorOutstandingRewards, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorOutstandingRewards message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorOutstandingRewards - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorOutstandingRewards; - } - - /** Properties of a ValidatorSlashEvent. */ - interface IValidatorSlashEvent { - /** ValidatorSlashEvent validatorPeriod */ - validatorPeriod?: Long | null; - - /** ValidatorSlashEvent fraction */ - fraction?: string | null; - } - - /** Represents a ValidatorSlashEvent. */ - class ValidatorSlashEvent implements IValidatorSlashEvent { - /** - * Constructs a new ValidatorSlashEvent. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorSlashEvent); - - /** ValidatorSlashEvent validatorPeriod. */ - public validatorPeriod: Long; - - /** ValidatorSlashEvent fraction. */ - public fraction: string; - - /** - * Creates a new ValidatorSlashEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorSlashEvent instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorSlashEvent, - ): cosmos.distribution.v1beta1.ValidatorSlashEvent; - - /** - * Encodes the specified ValidatorSlashEvent message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvent.verify|verify} messages. - * @param m ValidatorSlashEvent message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorSlashEvent, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorSlashEvent message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorSlashEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorSlashEvent; - } - - /** Properties of a ValidatorSlashEvents. */ - interface IValidatorSlashEvents { - /** ValidatorSlashEvents validatorSlashEvents */ - validatorSlashEvents?: cosmos.distribution.v1beta1.IValidatorSlashEvent[] | null; - } - - /** Represents a ValidatorSlashEvents. */ - class ValidatorSlashEvents implements IValidatorSlashEvents { - /** - * Constructs a new ValidatorSlashEvents. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IValidatorSlashEvents); - - /** ValidatorSlashEvents validatorSlashEvents. */ - public validatorSlashEvents: cosmos.distribution.v1beta1.IValidatorSlashEvent[]; - - /** - * Creates a new ValidatorSlashEvents instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorSlashEvents instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IValidatorSlashEvents, - ): cosmos.distribution.v1beta1.ValidatorSlashEvents; - - /** - * Encodes the specified ValidatorSlashEvents message. Does not implicitly {@link cosmos.distribution.v1beta1.ValidatorSlashEvents.verify|verify} messages. - * @param m ValidatorSlashEvents message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IValidatorSlashEvents, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ValidatorSlashEvents message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorSlashEvents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.ValidatorSlashEvents; - } - - /** Properties of a FeePool. */ - interface IFeePool { - /** FeePool communityPool */ - communityPool?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a FeePool. */ - class FeePool implements IFeePool { - /** - * Constructs a new FeePool. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IFeePool); - - /** FeePool communityPool. */ - public communityPool: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new FeePool instance using the specified properties. - * @param [properties] Properties to set - * @returns FeePool instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IFeePool, - ): cosmos.distribution.v1beta1.FeePool; - - /** - * Encodes the specified FeePool message. Does not implicitly {@link cosmos.distribution.v1beta1.FeePool.verify|verify} messages. - * @param m FeePool message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.distribution.v1beta1.IFeePool, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeePool message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FeePool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.FeePool; - } - - /** Properties of a CommunityPoolSpendProposal. */ - interface ICommunityPoolSpendProposal { - /** CommunityPoolSpendProposal title */ - title?: string | null; - - /** CommunityPoolSpendProposal description */ - description?: string | null; - - /** CommunityPoolSpendProposal recipient */ - recipient?: string | null; - - /** CommunityPoolSpendProposal amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a CommunityPoolSpendProposal. */ - class CommunityPoolSpendProposal implements ICommunityPoolSpendProposal { - /** - * Constructs a new CommunityPoolSpendProposal. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.ICommunityPoolSpendProposal); - - /** CommunityPoolSpendProposal title. */ - public title: string; - - /** CommunityPoolSpendProposal description. */ - public description: string; - - /** CommunityPoolSpendProposal recipient. */ - public recipient: string; - - /** CommunityPoolSpendProposal amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new CommunityPoolSpendProposal instance using the specified properties. - * @param [properties] Properties to set - * @returns CommunityPoolSpendProposal instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.ICommunityPoolSpendProposal, - ): cosmos.distribution.v1beta1.CommunityPoolSpendProposal; - - /** - * Encodes the specified CommunityPoolSpendProposal message. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposal.verify|verify} messages. - * @param m CommunityPoolSpendProposal message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.ICommunityPoolSpendProposal, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CommunityPoolSpendProposal message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CommunityPoolSpendProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.CommunityPoolSpendProposal; - } - - /** Properties of a DelegatorStartingInfo. */ - interface IDelegatorStartingInfo { - /** DelegatorStartingInfo previousPeriod */ - previousPeriod?: Long | null; - - /** DelegatorStartingInfo stake */ - stake?: string | null; - - /** DelegatorStartingInfo height */ - height?: Long | null; - } - - /** Represents a DelegatorStartingInfo. */ - class DelegatorStartingInfo implements IDelegatorStartingInfo { - /** - * Constructs a new DelegatorStartingInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IDelegatorStartingInfo); - - /** DelegatorStartingInfo previousPeriod. */ - public previousPeriod: Long; - - /** DelegatorStartingInfo stake. */ - public stake: string; - - /** DelegatorStartingInfo height. */ - public height: Long; - - /** - * Creates a new DelegatorStartingInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DelegatorStartingInfo instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IDelegatorStartingInfo, - ): cosmos.distribution.v1beta1.DelegatorStartingInfo; - - /** - * Encodes the specified DelegatorStartingInfo message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegatorStartingInfo.verify|verify} messages. - * @param m DelegatorStartingInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IDelegatorStartingInfo, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a DelegatorStartingInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DelegatorStartingInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.DelegatorStartingInfo; - } - - /** Properties of a DelegationDelegatorReward. */ - interface IDelegationDelegatorReward { - /** DelegationDelegatorReward validatorAddress */ - validatorAddress?: string | null; - - /** DelegationDelegatorReward reward */ - reward?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a DelegationDelegatorReward. */ - class DelegationDelegatorReward implements IDelegationDelegatorReward { - /** - * Constructs a new DelegationDelegatorReward. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IDelegationDelegatorReward); - - /** DelegationDelegatorReward validatorAddress. */ - public validatorAddress: string; - - /** DelegationDelegatorReward reward. */ - public reward: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new DelegationDelegatorReward instance using the specified properties. - * @param [properties] Properties to set - * @returns DelegationDelegatorReward instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IDelegationDelegatorReward, - ): cosmos.distribution.v1beta1.DelegationDelegatorReward; - - /** - * Encodes the specified DelegationDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.DelegationDelegatorReward.verify|verify} messages. - * @param m DelegationDelegatorReward message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IDelegationDelegatorReward, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a DelegationDelegatorReward message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DelegationDelegatorReward - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.DelegationDelegatorReward; - } - - /** Properties of a CommunityPoolSpendProposalWithDeposit. */ - interface ICommunityPoolSpendProposalWithDeposit { - /** CommunityPoolSpendProposalWithDeposit title */ - title?: string | null; - - /** CommunityPoolSpendProposalWithDeposit description */ - description?: string | null; - - /** CommunityPoolSpendProposalWithDeposit recipient */ - recipient?: string | null; - - /** CommunityPoolSpendProposalWithDeposit amount */ - amount?: string | null; - - /** CommunityPoolSpendProposalWithDeposit deposit */ - deposit?: string | null; - } - - /** Represents a CommunityPoolSpendProposalWithDeposit. */ - class CommunityPoolSpendProposalWithDeposit implements ICommunityPoolSpendProposalWithDeposit { - /** - * Constructs a new CommunityPoolSpendProposalWithDeposit. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit); - - /** CommunityPoolSpendProposalWithDeposit title. */ - public title: string; - - /** CommunityPoolSpendProposalWithDeposit description. */ - public description: string; - - /** CommunityPoolSpendProposalWithDeposit recipient. */ - public recipient: string; - - /** CommunityPoolSpendProposalWithDeposit amount. */ - public amount: string; - - /** CommunityPoolSpendProposalWithDeposit deposit. */ - public deposit: string; - - /** - * Creates a new CommunityPoolSpendProposalWithDeposit instance using the specified properties. - * @param [properties] Properties to set - * @returns CommunityPoolSpendProposalWithDeposit instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit, - ): cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit; - - /** - * Encodes the specified CommunityPoolSpendProposalWithDeposit message. Does not implicitly {@link cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit.verify|verify} messages. - * @param m CommunityPoolSpendProposalWithDeposit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.ICommunityPoolSpendProposalWithDeposit, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CommunityPoolSpendProposalWithDeposit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CommunityPoolSpendProposalWithDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params( - request: cosmos.distribution.v1beta1.IQueryParamsRequest, - callback: cosmos.distribution.v1beta1.Query.ParamsCallback, - ): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params( - request: cosmos.distribution.v1beta1.IQueryParamsRequest, - ): Promise; - - /** - * Calls ValidatorOutstandingRewards. - * @param request QueryValidatorOutstandingRewardsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorOutstandingRewardsResponse - */ - public validatorOutstandingRewards( - request: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest, - callback: cosmos.distribution.v1beta1.Query.ValidatorOutstandingRewardsCallback, - ): void; - - /** - * Calls ValidatorOutstandingRewards. - * @param request QueryValidatorOutstandingRewardsRequest message or plain object - * @returns Promise - */ - public validatorOutstandingRewards( - request: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest, - ): Promise; - - /** - * Calls ValidatorCommission. - * @param request QueryValidatorCommissionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorCommissionResponse - */ - public validatorCommission( - request: cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest, - callback: cosmos.distribution.v1beta1.Query.ValidatorCommissionCallback, - ): void; - - /** - * Calls ValidatorCommission. - * @param request QueryValidatorCommissionRequest message or plain object - * @returns Promise - */ - public validatorCommission( - request: cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest, - ): Promise; - - /** - * Calls ValidatorSlashes. - * @param request QueryValidatorSlashesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorSlashesResponse - */ - public validatorSlashes( - request: cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest, - callback: cosmos.distribution.v1beta1.Query.ValidatorSlashesCallback, - ): void; - - /** - * Calls ValidatorSlashes. - * @param request QueryValidatorSlashesRequest message or plain object - * @returns Promise - */ - public validatorSlashes( - request: cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest, - ): Promise; - - /** - * Calls DelegationRewards. - * @param request QueryDelegationRewardsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegationRewardsResponse - */ - public delegationRewards( - request: cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest, - callback: cosmos.distribution.v1beta1.Query.DelegationRewardsCallback, - ): void; - - /** - * Calls DelegationRewards. - * @param request QueryDelegationRewardsRequest message or plain object - * @returns Promise - */ - public delegationRewards( - request: cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest, - ): Promise; - - /** - * Calls DelegationTotalRewards. - * @param request QueryDelegationTotalRewardsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegationTotalRewardsResponse - */ - public delegationTotalRewards( - request: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest, - callback: cosmos.distribution.v1beta1.Query.DelegationTotalRewardsCallback, - ): void; - - /** - * Calls DelegationTotalRewards. - * @param request QueryDelegationTotalRewardsRequest message or plain object - * @returns Promise - */ - public delegationTotalRewards( - request: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest, - ): Promise; - - /** - * Calls DelegatorValidators. - * @param request QueryDelegatorValidatorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorValidatorsResponse - */ - public delegatorValidators( - request: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest, - callback: cosmos.distribution.v1beta1.Query.DelegatorValidatorsCallback, - ): void; - - /** - * Calls DelegatorValidators. - * @param request QueryDelegatorValidatorsRequest message or plain object - * @returns Promise - */ - public delegatorValidators( - request: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest, - ): Promise; - - /** - * Calls DelegatorWithdrawAddress. - * @param request QueryDelegatorWithdrawAddressRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorWithdrawAddressResponse - */ - public delegatorWithdrawAddress( - request: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest, - callback: cosmos.distribution.v1beta1.Query.DelegatorWithdrawAddressCallback, - ): void; - - /** - * Calls DelegatorWithdrawAddress. - * @param request QueryDelegatorWithdrawAddressRequest message or plain object - * @returns Promise - */ - public delegatorWithdrawAddress( - request: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest, - ): Promise; - - /** - * Calls CommunityPool. - * @param request QueryCommunityPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryCommunityPoolResponse - */ - public communityPool( - request: cosmos.distribution.v1beta1.IQueryCommunityPoolRequest, - callback: cosmos.distribution.v1beta1.Query.CommunityPoolCallback, - ): void; - - /** - * Calls CommunityPool. - * @param request QueryCommunityPoolRequest message or plain object - * @returns Promise - */ - public communityPool( - request: cosmos.distribution.v1beta1.IQueryCommunityPoolRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryParamsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorOutstandingRewards}. - * @param error Error, if any - * @param [response] QueryValidatorOutstandingRewardsResponse - */ - type ValidatorOutstandingRewardsCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorCommission}. - * @param error Error, if any - * @param [response] QueryValidatorCommissionResponse - */ - type ValidatorCommissionCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryValidatorCommissionResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#validatorSlashes}. - * @param error Error, if any - * @param [response] QueryValidatorSlashesResponse - */ - type ValidatorSlashesCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryValidatorSlashesResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegationRewards}. - * @param error Error, if any - * @param [response] QueryDelegationRewardsResponse - */ - type DelegationRewardsCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryDelegationRewardsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegationTotalRewards}. - * @param error Error, if any - * @param [response] QueryDelegationTotalRewardsResponse - */ - type DelegationTotalRewardsCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegatorValidators}. - * @param error Error, if any - * @param [response] QueryDelegatorValidatorsResponse - */ - type DelegatorValidatorsCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#delegatorWithdrawAddress}. - * @param error Error, if any - * @param [response] QueryDelegatorWithdrawAddressResponse - */ - type DelegatorWithdrawAddressCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Query#communityPool}. - * @param error Error, if any - * @param [response] QueryCommunityPoolResponse - */ - type CommunityPoolCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.QueryCommunityPoolResponse, - ) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest {} - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - /** - * Constructs a new QueryParamsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryParamsRequest); - - /** - * Creates a new QueryParamsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryParamsRequest, - ): cosmos.distribution.v1beta1.QueryParamsRequest; - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param m QueryParamsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryParamsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryParamsRequest; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - /** QueryParamsResponse params */ - params?: cosmos.distribution.v1beta1.IParams | null; - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - /** - * Constructs a new QueryParamsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: cosmos.distribution.v1beta1.IParams | null; - - /** - * Creates a new QueryParamsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryParamsResponse, - ): cosmos.distribution.v1beta1.QueryParamsResponse; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param m QueryParamsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryParamsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryParamsResponse; - } - - /** Properties of a QueryValidatorOutstandingRewardsRequest. */ - interface IQueryValidatorOutstandingRewardsRequest { - /** QueryValidatorOutstandingRewardsRequest validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a QueryValidatorOutstandingRewardsRequest. */ - class QueryValidatorOutstandingRewardsRequest implements IQueryValidatorOutstandingRewardsRequest { - /** - * Constructs a new QueryValidatorOutstandingRewardsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest); - - /** QueryValidatorOutstandingRewardsRequest validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new QueryValidatorOutstandingRewardsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorOutstandingRewardsRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest, - ): cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest; - - /** - * Encodes the specified QueryValidatorOutstandingRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest.verify|verify} messages. - * @param m QueryValidatorOutstandingRewardsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorOutstandingRewardsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorOutstandingRewardsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest; - } - - /** Properties of a QueryValidatorOutstandingRewardsResponse. */ - interface IQueryValidatorOutstandingRewardsResponse { - /** QueryValidatorOutstandingRewardsResponse rewards */ - rewards?: cosmos.distribution.v1beta1.IValidatorOutstandingRewards | null; - } - - /** Represents a QueryValidatorOutstandingRewardsResponse. */ - class QueryValidatorOutstandingRewardsResponse implements IQueryValidatorOutstandingRewardsResponse { - /** - * Constructs a new QueryValidatorOutstandingRewardsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse); - - /** QueryValidatorOutstandingRewardsResponse rewards. */ - public rewards?: cosmos.distribution.v1beta1.IValidatorOutstandingRewards | null; - - /** - * Creates a new QueryValidatorOutstandingRewardsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorOutstandingRewardsResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse, - ): cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse; - - /** - * Encodes the specified QueryValidatorOutstandingRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse.verify|verify} messages. - * @param m QueryValidatorOutstandingRewardsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorOutstandingRewardsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorOutstandingRewardsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorOutstandingRewardsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse; - } - - /** Properties of a QueryValidatorCommissionRequest. */ - interface IQueryValidatorCommissionRequest { - /** QueryValidatorCommissionRequest validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a QueryValidatorCommissionRequest. */ - class QueryValidatorCommissionRequest implements IQueryValidatorCommissionRequest { - /** - * Constructs a new QueryValidatorCommissionRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest); - - /** QueryValidatorCommissionRequest validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new QueryValidatorCommissionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorCommissionRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest, - ): cosmos.distribution.v1beta1.QueryValidatorCommissionRequest; - - /** - * Encodes the specified QueryValidatorCommissionRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionRequest.verify|verify} messages. - * @param m QueryValidatorCommissionRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorCommissionRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorCommissionRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorCommissionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorCommissionRequest; - } - - /** Properties of a QueryValidatorCommissionResponse. */ - interface IQueryValidatorCommissionResponse { - /** QueryValidatorCommissionResponse commission */ - commission?: cosmos.distribution.v1beta1.IValidatorAccumulatedCommission | null; - } - - /** Represents a QueryValidatorCommissionResponse. */ - class QueryValidatorCommissionResponse implements IQueryValidatorCommissionResponse { - /** - * Constructs a new QueryValidatorCommissionResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse); - - /** QueryValidatorCommissionResponse commission. */ - public commission?: cosmos.distribution.v1beta1.IValidatorAccumulatedCommission | null; - - /** - * Creates a new QueryValidatorCommissionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorCommissionResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse, - ): cosmos.distribution.v1beta1.QueryValidatorCommissionResponse; - - /** - * Encodes the specified QueryValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorCommissionResponse.verify|verify} messages. - * @param m QueryValidatorCommissionResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorCommissionResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorCommissionResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorCommissionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorCommissionResponse; - } - - /** Properties of a QueryValidatorSlashesRequest. */ - interface IQueryValidatorSlashesRequest { - /** QueryValidatorSlashesRequest validatorAddress */ - validatorAddress?: string | null; - - /** QueryValidatorSlashesRequest startingHeight */ - startingHeight?: Long | null; - - /** QueryValidatorSlashesRequest endingHeight */ - endingHeight?: Long | null; - - /** QueryValidatorSlashesRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryValidatorSlashesRequest. */ - class QueryValidatorSlashesRequest implements IQueryValidatorSlashesRequest { - /** - * Constructs a new QueryValidatorSlashesRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest); - - /** QueryValidatorSlashesRequest validatorAddress. */ - public validatorAddress: string; - - /** QueryValidatorSlashesRequest startingHeight. */ - public startingHeight: Long; - - /** QueryValidatorSlashesRequest endingHeight. */ - public endingHeight: Long; - - /** QueryValidatorSlashesRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryValidatorSlashesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorSlashesRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest, - ): cosmos.distribution.v1beta1.QueryValidatorSlashesRequest; - - /** - * Encodes the specified QueryValidatorSlashesRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesRequest.verify|verify} messages. - * @param m QueryValidatorSlashesRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorSlashesRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorSlashesRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorSlashesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorSlashesRequest; - } - - /** Properties of a QueryValidatorSlashesResponse. */ - interface IQueryValidatorSlashesResponse { - /** QueryValidatorSlashesResponse slashes */ - slashes?: cosmos.distribution.v1beta1.IValidatorSlashEvent[] | null; - - /** QueryValidatorSlashesResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryValidatorSlashesResponse. */ - class QueryValidatorSlashesResponse implements IQueryValidatorSlashesResponse { - /** - * Constructs a new QueryValidatorSlashesResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse); - - /** QueryValidatorSlashesResponse slashes. */ - public slashes: cosmos.distribution.v1beta1.IValidatorSlashEvent[]; - - /** QueryValidatorSlashesResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryValidatorSlashesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorSlashesResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse, - ): cosmos.distribution.v1beta1.QueryValidatorSlashesResponse; - - /** - * Encodes the specified QueryValidatorSlashesResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryValidatorSlashesResponse.verify|verify} messages. - * @param m QueryValidatorSlashesResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryValidatorSlashesResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorSlashesResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorSlashesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryValidatorSlashesResponse; - } - - /** Properties of a QueryDelegationRewardsRequest. */ - interface IQueryDelegationRewardsRequest { - /** QueryDelegationRewardsRequest delegatorAddress */ - delegatorAddress?: string | null; - - /** QueryDelegationRewardsRequest validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a QueryDelegationRewardsRequest. */ - class QueryDelegationRewardsRequest implements IQueryDelegationRewardsRequest { - /** - * Constructs a new QueryDelegationRewardsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest); - - /** QueryDelegationRewardsRequest delegatorAddress. */ - public delegatorAddress: string; - - /** QueryDelegationRewardsRequest validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new QueryDelegationRewardsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationRewardsRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest, - ): cosmos.distribution.v1beta1.QueryDelegationRewardsRequest; - - /** - * Encodes the specified QueryDelegationRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsRequest.verify|verify} messages. - * @param m QueryDelegationRewardsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegationRewardsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationRewardsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationRewardsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegationRewardsRequest; - } - - /** Properties of a QueryDelegationRewardsResponse. */ - interface IQueryDelegationRewardsResponse { - /** QueryDelegationRewardsResponse rewards */ - rewards?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a QueryDelegationRewardsResponse. */ - class QueryDelegationRewardsResponse implements IQueryDelegationRewardsResponse { - /** - * Constructs a new QueryDelegationRewardsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse); - - /** QueryDelegationRewardsResponse rewards. */ - public rewards: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new QueryDelegationRewardsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationRewardsResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse, - ): cosmos.distribution.v1beta1.QueryDelegationRewardsResponse; - - /** - * Encodes the specified QueryDelegationRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationRewardsResponse.verify|verify} messages. - * @param m QueryDelegationRewardsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegationRewardsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationRewardsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationRewardsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegationRewardsResponse; - } - - /** Properties of a QueryDelegationTotalRewardsRequest. */ - interface IQueryDelegationTotalRewardsRequest { - /** QueryDelegationTotalRewardsRequest delegatorAddress */ - delegatorAddress?: string | null; - } - - /** Represents a QueryDelegationTotalRewardsRequest. */ - class QueryDelegationTotalRewardsRequest implements IQueryDelegationTotalRewardsRequest { - /** - * Constructs a new QueryDelegationTotalRewardsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest); - - /** QueryDelegationTotalRewardsRequest delegatorAddress. */ - public delegatorAddress: string; - - /** - * Creates a new QueryDelegationTotalRewardsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationTotalRewardsRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest, - ): cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest; - - /** - * Encodes the specified QueryDelegationTotalRewardsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest.verify|verify} messages. - * @param m QueryDelegationTotalRewardsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationTotalRewardsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationTotalRewardsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest; - } - - /** Properties of a QueryDelegationTotalRewardsResponse. */ - interface IQueryDelegationTotalRewardsResponse { - /** QueryDelegationTotalRewardsResponse rewards */ - rewards?: cosmos.distribution.v1beta1.IDelegationDelegatorReward[] | null; - - /** QueryDelegationTotalRewardsResponse total */ - total?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a QueryDelegationTotalRewardsResponse. */ - class QueryDelegationTotalRewardsResponse implements IQueryDelegationTotalRewardsResponse { - /** - * Constructs a new QueryDelegationTotalRewardsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse); - - /** QueryDelegationTotalRewardsResponse rewards. */ - public rewards: cosmos.distribution.v1beta1.IDelegationDelegatorReward[]; - - /** QueryDelegationTotalRewardsResponse total. */ - public total: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new QueryDelegationTotalRewardsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationTotalRewardsResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse, - ): cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse; - - /** - * Encodes the specified QueryDelegationTotalRewardsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse.verify|verify} messages. - * @param m QueryDelegationTotalRewardsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegationTotalRewardsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationTotalRewardsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationTotalRewardsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse; - } - - /** Properties of a QueryDelegatorValidatorsRequest. */ - interface IQueryDelegatorValidatorsRequest { - /** QueryDelegatorValidatorsRequest delegatorAddress */ - delegatorAddress?: string | null; - } - - /** Represents a QueryDelegatorValidatorsRequest. */ - class QueryDelegatorValidatorsRequest implements IQueryDelegatorValidatorsRequest { - /** - * Constructs a new QueryDelegatorValidatorsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest); - - /** QueryDelegatorValidatorsRequest delegatorAddress. */ - public delegatorAddress: string; - - /** - * Creates a new QueryDelegatorValidatorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorsRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest, - ): cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest; - - /** - * Encodes the specified QueryDelegatorValidatorsRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. - * @param m QueryDelegatorValidatorsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest; - } - - /** Properties of a QueryDelegatorValidatorsResponse. */ - interface IQueryDelegatorValidatorsResponse { - /** QueryDelegatorValidatorsResponse validators */ - validators?: string[] | null; - } - - /** Represents a QueryDelegatorValidatorsResponse. */ - class QueryDelegatorValidatorsResponse implements IQueryDelegatorValidatorsResponse { - /** - * Constructs a new QueryDelegatorValidatorsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse); - - /** QueryDelegatorValidatorsResponse validators. */ - public validators: string[]; - - /** - * Creates a new QueryDelegatorValidatorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorsResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse, - ): cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse; - - /** - * Encodes the specified QueryDelegatorValidatorsResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. - * @param m QueryDelegatorValidatorsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegatorValidatorsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse; - } - - /** Properties of a QueryDelegatorWithdrawAddressRequest. */ - interface IQueryDelegatorWithdrawAddressRequest { - /** QueryDelegatorWithdrawAddressRequest delegatorAddress */ - delegatorAddress?: string | null; - } - - /** Represents a QueryDelegatorWithdrawAddressRequest. */ - class QueryDelegatorWithdrawAddressRequest implements IQueryDelegatorWithdrawAddressRequest { - /** - * Constructs a new QueryDelegatorWithdrawAddressRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest); - - /** QueryDelegatorWithdrawAddressRequest delegatorAddress. */ - public delegatorAddress: string; - - /** - * Creates a new QueryDelegatorWithdrawAddressRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorWithdrawAddressRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest, - ): cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest; - - /** - * Encodes the specified QueryDelegatorWithdrawAddressRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest.verify|verify} messages. - * @param m QueryDelegatorWithdrawAddressRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorWithdrawAddressRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorWithdrawAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest; - } - - /** Properties of a QueryDelegatorWithdrawAddressResponse. */ - interface IQueryDelegatorWithdrawAddressResponse { - /** QueryDelegatorWithdrawAddressResponse withdrawAddress */ - withdrawAddress?: string | null; - } - - /** Represents a QueryDelegatorWithdrawAddressResponse. */ - class QueryDelegatorWithdrawAddressResponse implements IQueryDelegatorWithdrawAddressResponse { - /** - * Constructs a new QueryDelegatorWithdrawAddressResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse); - - /** QueryDelegatorWithdrawAddressResponse withdrawAddress. */ - public withdrawAddress: string; - - /** - * Creates a new QueryDelegatorWithdrawAddressResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorWithdrawAddressResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse, - ): cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse; - - /** - * Encodes the specified QueryDelegatorWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse.verify|verify} messages. - * @param m QueryDelegatorWithdrawAddressResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryDelegatorWithdrawAddressResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorWithdrawAddressResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorWithdrawAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse; - } - - /** Properties of a QueryCommunityPoolRequest. */ - interface IQueryCommunityPoolRequest {} - - /** Represents a QueryCommunityPoolRequest. */ - class QueryCommunityPoolRequest implements IQueryCommunityPoolRequest { - /** - * Constructs a new QueryCommunityPoolRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryCommunityPoolRequest); - - /** - * Creates a new QueryCommunityPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryCommunityPoolRequest instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryCommunityPoolRequest, - ): cosmos.distribution.v1beta1.QueryCommunityPoolRequest; - - /** - * Encodes the specified QueryCommunityPoolRequest message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolRequest.verify|verify} messages. - * @param m QueryCommunityPoolRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryCommunityPoolRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryCommunityPoolRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryCommunityPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryCommunityPoolRequest; - } - - /** Properties of a QueryCommunityPoolResponse. */ - interface IQueryCommunityPoolResponse { - /** QueryCommunityPoolResponse pool */ - pool?: cosmos.base.v1beta1.IDecCoin[] | null; - } - - /** Represents a QueryCommunityPoolResponse. */ - class QueryCommunityPoolResponse implements IQueryCommunityPoolResponse { - /** - * Constructs a new QueryCommunityPoolResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IQueryCommunityPoolResponse); - - /** QueryCommunityPoolResponse pool. */ - public pool: cosmos.base.v1beta1.IDecCoin[]; - - /** - * Creates a new QueryCommunityPoolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryCommunityPoolResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IQueryCommunityPoolResponse, - ): cosmos.distribution.v1beta1.QueryCommunityPoolResponse; - - /** - * Encodes the specified QueryCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.QueryCommunityPoolResponse.verify|verify} messages. - * @param m QueryCommunityPoolResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IQueryCommunityPoolResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryCommunityPoolResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryCommunityPoolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.QueryCommunityPoolResponse; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Msg service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Msg; - - /** - * Calls SetWithdrawAddress. - * @param request MsgSetWithdrawAddress message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSetWithdrawAddressResponse - */ - public setWithdrawAddress( - request: cosmos.distribution.v1beta1.IMsgSetWithdrawAddress, - callback: cosmos.distribution.v1beta1.Msg.SetWithdrawAddressCallback, - ): void; - - /** - * Calls SetWithdrawAddress. - * @param request MsgSetWithdrawAddress message or plain object - * @returns Promise - */ - public setWithdrawAddress( - request: cosmos.distribution.v1beta1.IMsgSetWithdrawAddress, - ): Promise; - - /** - * Calls WithdrawDelegatorReward. - * @param request MsgWithdrawDelegatorReward message or plain object - * @param callback Node-style callback called with the error, if any, and MsgWithdrawDelegatorRewardResponse - */ - public withdrawDelegatorReward( - request: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward, - callback: cosmos.distribution.v1beta1.Msg.WithdrawDelegatorRewardCallback, - ): void; - - /** - * Calls WithdrawDelegatorReward. - * @param request MsgWithdrawDelegatorReward message or plain object - * @returns Promise - */ - public withdrawDelegatorReward( - request: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward, - ): Promise; - - /** - * Calls WithdrawValidatorCommission. - * @param request MsgWithdrawValidatorCommission message or plain object - * @param callback Node-style callback called with the error, if any, and MsgWithdrawValidatorCommissionResponse - */ - public withdrawValidatorCommission( - request: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission, - callback: cosmos.distribution.v1beta1.Msg.WithdrawValidatorCommissionCallback, - ): void; - - /** - * Calls WithdrawValidatorCommission. - * @param request MsgWithdrawValidatorCommission message or plain object - * @returns Promise - */ - public withdrawValidatorCommission( - request: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission, - ): Promise; - - /** - * Calls FundCommunityPool. - * @param request MsgFundCommunityPool message or plain object - * @param callback Node-style callback called with the error, if any, and MsgFundCommunityPoolResponse - */ - public fundCommunityPool( - request: cosmos.distribution.v1beta1.IMsgFundCommunityPool, - callback: cosmos.distribution.v1beta1.Msg.FundCommunityPoolCallback, - ): void; - - /** - * Calls FundCommunityPool. - * @param request MsgFundCommunityPool message or plain object - * @returns Promise - */ - public fundCommunityPool( - request: cosmos.distribution.v1beta1.IMsgFundCommunityPool, - ): Promise; - } - - namespace Msg { - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Msg#setWithdrawAddress}. - * @param error Error, if any - * @param [response] MsgSetWithdrawAddressResponse - */ - type SetWithdrawAddressCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawDelegatorReward}. - * @param error Error, if any - * @param [response] MsgWithdrawDelegatorRewardResponse - */ - type WithdrawDelegatorRewardCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawValidatorCommission}. - * @param error Error, if any - * @param [response] MsgWithdrawValidatorCommissionResponse - */ - type WithdrawValidatorCommissionCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.distribution.v1beta1.Msg#fundCommunityPool}. - * @param error Error, if any - * @param [response] MsgFundCommunityPoolResponse - */ - type FundCommunityPoolCallback = ( - error: Error | null, - response?: cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, - ) => void; - } - - /** Properties of a MsgSetWithdrawAddress. */ - interface IMsgSetWithdrawAddress { - /** MsgSetWithdrawAddress delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgSetWithdrawAddress withdrawAddress */ - withdrawAddress?: string | null; - } - - /** Represents a MsgSetWithdrawAddress. */ - class MsgSetWithdrawAddress implements IMsgSetWithdrawAddress { - /** - * Constructs a new MsgSetWithdrawAddress. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgSetWithdrawAddress); - - /** MsgSetWithdrawAddress delegatorAddress. */ - public delegatorAddress: string; - - /** MsgSetWithdrawAddress withdrawAddress. */ - public withdrawAddress: string; - - /** - * Creates a new MsgSetWithdrawAddress instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSetWithdrawAddress instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgSetWithdrawAddress, - ): cosmos.distribution.v1beta1.MsgSetWithdrawAddress; - - /** - * Encodes the specified MsgSetWithdrawAddress message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages. - * @param m MsgSetWithdrawAddress message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgSetWithdrawAddress, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgSetWithdrawAddress message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSetWithdrawAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgSetWithdrawAddress; - } - - /** Properties of a MsgSetWithdrawAddressResponse. */ - interface IMsgSetWithdrawAddressResponse {} - - /** Represents a MsgSetWithdrawAddressResponse. */ - class MsgSetWithdrawAddressResponse implements IMsgSetWithdrawAddressResponse { - /** - * Constructs a new MsgSetWithdrawAddressResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse); - - /** - * Creates a new MsgSetWithdrawAddressResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSetWithdrawAddressResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse, - ): cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse; - - /** - * Encodes the specified MsgSetWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages. - * @param m MsgSetWithdrawAddressResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSetWithdrawAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse; - } - - /** Properties of a MsgWithdrawDelegatorReward. */ - interface IMsgWithdrawDelegatorReward { - /** MsgWithdrawDelegatorReward delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgWithdrawDelegatorReward validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a MsgWithdrawDelegatorReward. */ - class MsgWithdrawDelegatorReward implements IMsgWithdrawDelegatorReward { - /** - * Constructs a new MsgWithdrawDelegatorReward. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward); - - /** MsgWithdrawDelegatorReward delegatorAddress. */ - public delegatorAddress: string; - - /** MsgWithdrawDelegatorReward validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new MsgWithdrawDelegatorReward instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgWithdrawDelegatorReward instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward, - ): cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward; - - /** - * Encodes the specified MsgWithdrawDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages. - * @param m MsgWithdrawDelegatorReward message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgWithdrawDelegatorReward - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward; - } - - /** Properties of a MsgWithdrawDelegatorRewardResponse. */ - interface IMsgWithdrawDelegatorRewardResponse {} - - /** Represents a MsgWithdrawDelegatorRewardResponse. */ - class MsgWithdrawDelegatorRewardResponse implements IMsgWithdrawDelegatorRewardResponse { - /** - * Constructs a new MsgWithdrawDelegatorRewardResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse); - - /** - * Creates a new MsgWithdrawDelegatorRewardResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgWithdrawDelegatorRewardResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse, - ): cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse; - - /** - * Encodes the specified MsgWithdrawDelegatorRewardResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages. - * @param m MsgWithdrawDelegatorRewardResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgWithdrawDelegatorRewardResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse; - } - - /** Properties of a MsgWithdrawValidatorCommission. */ - interface IMsgWithdrawValidatorCommission { - /** MsgWithdrawValidatorCommission validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a MsgWithdrawValidatorCommission. */ - class MsgWithdrawValidatorCommission implements IMsgWithdrawValidatorCommission { - /** - * Constructs a new MsgWithdrawValidatorCommission. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission); - - /** MsgWithdrawValidatorCommission validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new MsgWithdrawValidatorCommission instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgWithdrawValidatorCommission instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission, - ): cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission; - - /** - * Encodes the specified MsgWithdrawValidatorCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages. - * @param m MsgWithdrawValidatorCommission message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgWithdrawValidatorCommission - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission; - } - - /** Properties of a MsgWithdrawValidatorCommissionResponse. */ - interface IMsgWithdrawValidatorCommissionResponse {} - - /** Represents a MsgWithdrawValidatorCommissionResponse. */ - class MsgWithdrawValidatorCommissionResponse implements IMsgWithdrawValidatorCommissionResponse { - /** - * Constructs a new MsgWithdrawValidatorCommissionResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse); - - /** - * Creates a new MsgWithdrawValidatorCommissionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgWithdrawValidatorCommissionResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse, - ): cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse; - - /** - * Encodes the specified MsgWithdrawValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages. - * @param m MsgWithdrawValidatorCommissionResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgWithdrawValidatorCommissionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse; - } - - /** Properties of a MsgFundCommunityPool. */ - interface IMsgFundCommunityPool { - /** MsgFundCommunityPool amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - - /** MsgFundCommunityPool depositor */ - depositor?: string | null; - } - - /** Represents a MsgFundCommunityPool. */ - class MsgFundCommunityPool implements IMsgFundCommunityPool { - /** - * Constructs a new MsgFundCommunityPool. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgFundCommunityPool); - - /** MsgFundCommunityPool amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** MsgFundCommunityPool depositor. */ - public depositor: string; - - /** - * Creates a new MsgFundCommunityPool instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgFundCommunityPool instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgFundCommunityPool, - ): cosmos.distribution.v1beta1.MsgFundCommunityPool; - - /** - * Encodes the specified MsgFundCommunityPool message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages. - * @param m MsgFundCommunityPool message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgFundCommunityPool, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgFundCommunityPool message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgFundCommunityPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgFundCommunityPool; - } - - /** Properties of a MsgFundCommunityPoolResponse. */ - interface IMsgFundCommunityPoolResponse {} - - /** Represents a MsgFundCommunityPoolResponse. */ - class MsgFundCommunityPoolResponse implements IMsgFundCommunityPoolResponse { - /** - * Constructs a new MsgFundCommunityPoolResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse); - - /** - * Creates a new MsgFundCommunityPoolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgFundCommunityPoolResponse instance - */ - public static create( - properties?: cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse, - ): cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse; - - /** - * Encodes the specified MsgFundCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages. - * @param m MsgFundCommunityPoolResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgFundCommunityPoolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse; - } - } - } - - /** Namespace staking. */ - namespace staking { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Validators. - * @param request QueryValidatorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorsResponse - */ - public validators( - request: cosmos.staking.v1beta1.IQueryValidatorsRequest, - callback: cosmos.staking.v1beta1.Query.ValidatorsCallback, - ): void; - - /** - * Calls Validators. - * @param request QueryValidatorsRequest message or plain object - * @returns Promise - */ - public validators( - request: cosmos.staking.v1beta1.IQueryValidatorsRequest, - ): Promise; - - /** - * Calls Validator. - * @param request QueryValidatorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorResponse - */ - public validator( - request: cosmos.staking.v1beta1.IQueryValidatorRequest, - callback: cosmos.staking.v1beta1.Query.ValidatorCallback, - ): void; - - /** - * Calls Validator. - * @param request QueryValidatorRequest message or plain object - * @returns Promise - */ - public validator( - request: cosmos.staking.v1beta1.IQueryValidatorRequest, - ): Promise; - - /** - * Calls ValidatorDelegations. - * @param request QueryValidatorDelegationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorDelegationsResponse - */ - public validatorDelegations( - request: cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest, - callback: cosmos.staking.v1beta1.Query.ValidatorDelegationsCallback, - ): void; - - /** - * Calls ValidatorDelegations. - * @param request QueryValidatorDelegationsRequest message or plain object - * @returns Promise - */ - public validatorDelegations( - request: cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest, - ): Promise; - - /** - * Calls ValidatorUnbondingDelegations. - * @param request QueryValidatorUnbondingDelegationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryValidatorUnbondingDelegationsResponse - */ - public validatorUnbondingDelegations( - request: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest, - callback: cosmos.staking.v1beta1.Query.ValidatorUnbondingDelegationsCallback, - ): void; - - /** - * Calls ValidatorUnbondingDelegations. - * @param request QueryValidatorUnbondingDelegationsRequest message or plain object - * @returns Promise - */ - public validatorUnbondingDelegations( - request: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest, - ): Promise; - - /** - * Calls Delegation. - * @param request QueryDelegationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegationResponse - */ - public delegation( - request: cosmos.staking.v1beta1.IQueryDelegationRequest, - callback: cosmos.staking.v1beta1.Query.DelegationCallback, - ): void; - - /** - * Calls Delegation. - * @param request QueryDelegationRequest message or plain object - * @returns Promise - */ - public delegation( - request: cosmos.staking.v1beta1.IQueryDelegationRequest, - ): Promise; - - /** - * Calls UnbondingDelegation. - * @param request QueryUnbondingDelegationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUnbondingDelegationResponse - */ - public unbondingDelegation( - request: cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest, - callback: cosmos.staking.v1beta1.Query.UnbondingDelegationCallback, - ): void; - - /** - * Calls UnbondingDelegation. - * @param request QueryUnbondingDelegationRequest message or plain object - * @returns Promise - */ - public unbondingDelegation( - request: cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest, - ): Promise; - - /** - * Calls DelegatorDelegations. - * @param request QueryDelegatorDelegationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorDelegationsResponse - */ - public delegatorDelegations( - request: cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest, - callback: cosmos.staking.v1beta1.Query.DelegatorDelegationsCallback, - ): void; - - /** - * Calls DelegatorDelegations. - * @param request QueryDelegatorDelegationsRequest message or plain object - * @returns Promise - */ - public delegatorDelegations( - request: cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest, - ): Promise; - - /** - * Calls DelegatorUnbondingDelegations. - * @param request QueryDelegatorUnbondingDelegationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorUnbondingDelegationsResponse - */ - public delegatorUnbondingDelegations( - request: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest, - callback: cosmos.staking.v1beta1.Query.DelegatorUnbondingDelegationsCallback, - ): void; - - /** - * Calls DelegatorUnbondingDelegations. - * @param request QueryDelegatorUnbondingDelegationsRequest message or plain object - * @returns Promise - */ - public delegatorUnbondingDelegations( - request: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest, - ): Promise; - - /** - * Calls Redelegations. - * @param request QueryRedelegationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryRedelegationsResponse - */ - public redelegations( - request: cosmos.staking.v1beta1.IQueryRedelegationsRequest, - callback: cosmos.staking.v1beta1.Query.RedelegationsCallback, - ): void; - - /** - * Calls Redelegations. - * @param request QueryRedelegationsRequest message or plain object - * @returns Promise - */ - public redelegations( - request: cosmos.staking.v1beta1.IQueryRedelegationsRequest, - ): Promise; - - /** - * Calls DelegatorValidators. - * @param request QueryDelegatorValidatorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorValidatorsResponse - */ - public delegatorValidators( - request: cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest, - callback: cosmos.staking.v1beta1.Query.DelegatorValidatorsCallback, - ): void; - - /** - * Calls DelegatorValidators. - * @param request QueryDelegatorValidatorsRequest message or plain object - * @returns Promise - */ - public delegatorValidators( - request: cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest, - ): Promise; - - /** - * Calls DelegatorValidator. - * @param request QueryDelegatorValidatorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDelegatorValidatorResponse - */ - public delegatorValidator( - request: cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest, - callback: cosmos.staking.v1beta1.Query.DelegatorValidatorCallback, - ): void; - - /** - * Calls DelegatorValidator. - * @param request QueryDelegatorValidatorRequest message or plain object - * @returns Promise - */ - public delegatorValidator( - request: cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest, - ): Promise; - - /** - * Calls HistoricalInfo. - * @param request QueryHistoricalInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryHistoricalInfoResponse - */ - public historicalInfo( - request: cosmos.staking.v1beta1.IQueryHistoricalInfoRequest, - callback: cosmos.staking.v1beta1.Query.HistoricalInfoCallback, - ): void; - - /** - * Calls HistoricalInfo. - * @param request QueryHistoricalInfoRequest message or plain object - * @returns Promise - */ - public historicalInfo( - request: cosmos.staking.v1beta1.IQueryHistoricalInfoRequest, - ): Promise; - - /** - * Calls Pool. - * @param request QueryPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPoolResponse - */ - public pool( - request: cosmos.staking.v1beta1.IQueryPoolRequest, - callback: cosmos.staking.v1beta1.Query.PoolCallback, - ): void; - - /** - * Calls Pool. - * @param request QueryPoolRequest message or plain object - * @returns Promise - */ - public pool( - request: cosmos.staking.v1beta1.IQueryPoolRequest, - ): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params( - request: cosmos.staking.v1beta1.IQueryParamsRequest, - callback: cosmos.staking.v1beta1.Query.ParamsCallback, - ): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params( - request: cosmos.staking.v1beta1.IQueryParamsRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#validators}. - * @param error Error, if any - * @param [response] QueryValidatorsResponse - */ - type ValidatorsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryValidatorsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#validator}. - * @param error Error, if any - * @param [response] QueryValidatorResponse - */ - type ValidatorCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryValidatorResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#validatorDelegations}. - * @param error Error, if any - * @param [response] QueryValidatorDelegationsResponse - */ - type ValidatorDelegationsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryValidatorDelegationsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#validatorUnbondingDelegations}. - * @param error Error, if any - * @param [response] QueryValidatorUnbondingDelegationsResponse - */ - type ValidatorUnbondingDelegationsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#delegation}. - * @param error Error, if any - * @param [response] QueryDelegationResponse - */ - type DelegationCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryDelegationResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#unbondingDelegation}. - * @param error Error, if any - * @param [response] QueryUnbondingDelegationResponse - */ - type UnbondingDelegationCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryUnbondingDelegationResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorDelegations}. - * @param error Error, if any - * @param [response] QueryDelegatorDelegationsResponse - */ - type DelegatorDelegationsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorUnbondingDelegations}. - * @param error Error, if any - * @param [response] QueryDelegatorUnbondingDelegationsResponse - */ - type DelegatorUnbondingDelegationsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#redelegations}. - * @param error Error, if any - * @param [response] QueryRedelegationsResponse - */ - type RedelegationsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryRedelegationsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorValidators}. - * @param error Error, if any - * @param [response] QueryDelegatorValidatorsResponse - */ - type DelegatorValidatorsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#delegatorValidator}. - * @param error Error, if any - * @param [response] QueryDelegatorValidatorResponse - */ - type DelegatorValidatorCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryDelegatorValidatorResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#historicalInfo}. - * @param error Error, if any - * @param [response] QueryHistoricalInfoResponse - */ - type HistoricalInfoCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryHistoricalInfoResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#pool}. - * @param error Error, if any - * @param [response] QueryPoolResponse - */ - type PoolCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryPoolResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.QueryParamsResponse, - ) => void; - } - - /** Properties of a QueryValidatorsRequest. */ - interface IQueryValidatorsRequest { - /** QueryValidatorsRequest status */ - status?: string | null; - - /** QueryValidatorsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryValidatorsRequest. */ - class QueryValidatorsRequest implements IQueryValidatorsRequest { - /** - * Constructs a new QueryValidatorsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorsRequest); - - /** QueryValidatorsRequest status. */ - public status: string; - - /** QueryValidatorsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryValidatorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorsRequest, - ): cosmos.staking.v1beta1.QueryValidatorsRequest; - - /** - * Encodes the specified QueryValidatorsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsRequest.verify|verify} messages. - * @param m QueryValidatorsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorsRequest; - } - - /** Properties of a QueryValidatorsResponse. */ - interface IQueryValidatorsResponse { - /** QueryValidatorsResponse validators */ - validators?: cosmos.staking.v1beta1.IValidator[] | null; - - /** QueryValidatorsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryValidatorsResponse. */ - class QueryValidatorsResponse implements IQueryValidatorsResponse { - /** - * Constructs a new QueryValidatorsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorsResponse); - - /** QueryValidatorsResponse validators. */ - public validators: cosmos.staking.v1beta1.IValidator[]; - - /** QueryValidatorsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryValidatorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorsResponse, - ): cosmos.staking.v1beta1.QueryValidatorsResponse; - - /** - * Encodes the specified QueryValidatorsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorsResponse.verify|verify} messages. - * @param m QueryValidatorsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorsResponse; - } - - /** Properties of a QueryValidatorRequest. */ - interface IQueryValidatorRequest { - /** QueryValidatorRequest validatorAddr */ - validatorAddr?: string | null; - } - - /** Represents a QueryValidatorRequest. */ - class QueryValidatorRequest implements IQueryValidatorRequest { - /** - * Constructs a new QueryValidatorRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorRequest); - - /** QueryValidatorRequest validatorAddr. */ - public validatorAddr: string; - - /** - * Creates a new QueryValidatorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorRequest, - ): cosmos.staking.v1beta1.QueryValidatorRequest; - - /** - * Encodes the specified QueryValidatorRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorRequest.verify|verify} messages. - * @param m QueryValidatorRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorRequest; - } - - /** Properties of a QueryValidatorResponse. */ - interface IQueryValidatorResponse { - /** QueryValidatorResponse validator */ - validator?: cosmos.staking.v1beta1.IValidator | null; - } - - /** Represents a QueryValidatorResponse. */ - class QueryValidatorResponse implements IQueryValidatorResponse { - /** - * Constructs a new QueryValidatorResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorResponse); - - /** QueryValidatorResponse validator. */ - public validator?: cosmos.staking.v1beta1.IValidator | null; - - /** - * Creates a new QueryValidatorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorResponse, - ): cosmos.staking.v1beta1.QueryValidatorResponse; - - /** - * Encodes the specified QueryValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorResponse.verify|verify} messages. - * @param m QueryValidatorResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorResponse; - } - - /** Properties of a QueryValidatorDelegationsRequest. */ - interface IQueryValidatorDelegationsRequest { - /** QueryValidatorDelegationsRequest validatorAddr */ - validatorAddr?: string | null; - - /** QueryValidatorDelegationsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryValidatorDelegationsRequest. */ - class QueryValidatorDelegationsRequest implements IQueryValidatorDelegationsRequest { - /** - * Constructs a new QueryValidatorDelegationsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest); - - /** QueryValidatorDelegationsRequest validatorAddr. */ - public validatorAddr: string; - - /** QueryValidatorDelegationsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryValidatorDelegationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorDelegationsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest, - ): cosmos.staking.v1beta1.QueryValidatorDelegationsRequest; - - /** - * Encodes the specified QueryValidatorDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsRequest.verify|verify} messages. - * @param m QueryValidatorDelegationsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorDelegationsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorDelegationsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorDelegationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorDelegationsRequest; - } - - /** Properties of a QueryValidatorDelegationsResponse. */ - interface IQueryValidatorDelegationsResponse { - /** QueryValidatorDelegationsResponse delegationResponses */ - delegationResponses?: cosmos.staking.v1beta1.IDelegationResponse[] | null; - - /** QueryValidatorDelegationsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryValidatorDelegationsResponse. */ - class QueryValidatorDelegationsResponse implements IQueryValidatorDelegationsResponse { - /** - * Constructs a new QueryValidatorDelegationsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse); - - /** QueryValidatorDelegationsResponse delegationResponses. */ - public delegationResponses: cosmos.staking.v1beta1.IDelegationResponse[]; - - /** QueryValidatorDelegationsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryValidatorDelegationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorDelegationsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse, - ): cosmos.staking.v1beta1.QueryValidatorDelegationsResponse; - - /** - * Encodes the specified QueryValidatorDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorDelegationsResponse.verify|verify} messages. - * @param m QueryValidatorDelegationsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorDelegationsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorDelegationsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorDelegationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorDelegationsResponse; - } - - /** Properties of a QueryValidatorUnbondingDelegationsRequest. */ - interface IQueryValidatorUnbondingDelegationsRequest { - /** QueryValidatorUnbondingDelegationsRequest validatorAddr */ - validatorAddr?: string | null; - - /** QueryValidatorUnbondingDelegationsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryValidatorUnbondingDelegationsRequest. */ - class QueryValidatorUnbondingDelegationsRequest implements IQueryValidatorUnbondingDelegationsRequest { - /** - * Constructs a new QueryValidatorUnbondingDelegationsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest); - - /** QueryValidatorUnbondingDelegationsRequest validatorAddr. */ - public validatorAddr: string; - - /** QueryValidatorUnbondingDelegationsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryValidatorUnbondingDelegationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorUnbondingDelegationsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest, - ): cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest; - - /** - * Encodes the specified QueryValidatorUnbondingDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest.verify|verify} messages. - * @param m QueryValidatorUnbondingDelegationsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorUnbondingDelegationsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorUnbondingDelegationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest; - } - - /** Properties of a QueryValidatorUnbondingDelegationsResponse. */ - interface IQueryValidatorUnbondingDelegationsResponse { - /** QueryValidatorUnbondingDelegationsResponse unbondingResponses */ - unbondingResponses?: cosmos.staking.v1beta1.IUnbondingDelegation[] | null; - - /** QueryValidatorUnbondingDelegationsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryValidatorUnbondingDelegationsResponse. */ - class QueryValidatorUnbondingDelegationsResponse - implements IQueryValidatorUnbondingDelegationsResponse { - /** - * Constructs a new QueryValidatorUnbondingDelegationsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse); - - /** QueryValidatorUnbondingDelegationsResponse unbondingResponses. */ - public unbondingResponses: cosmos.staking.v1beta1.IUnbondingDelegation[]; - - /** QueryValidatorUnbondingDelegationsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryValidatorUnbondingDelegationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryValidatorUnbondingDelegationsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse, - ): cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse; - - /** - * Encodes the specified QueryValidatorUnbondingDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse.verify|verify} messages. - * @param m QueryValidatorUnbondingDelegationsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryValidatorUnbondingDelegationsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryValidatorUnbondingDelegationsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryValidatorUnbondingDelegationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse; - } - - /** Properties of a QueryDelegationRequest. */ - interface IQueryDelegationRequest { - /** QueryDelegationRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryDelegationRequest validatorAddr */ - validatorAddr?: string | null; - } - - /** Represents a QueryDelegationRequest. */ - class QueryDelegationRequest implements IQueryDelegationRequest { - /** - * Constructs a new QueryDelegationRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegationRequest); - - /** QueryDelegationRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryDelegationRequest validatorAddr. */ - public validatorAddr: string; - - /** - * Creates a new QueryDelegationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegationRequest, - ): cosmos.staking.v1beta1.QueryDelegationRequest; - - /** - * Encodes the specified QueryDelegationRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationRequest.verify|verify} messages. - * @param m QueryDelegationRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegationRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegationRequest; - } - - /** Properties of a QueryDelegationResponse. */ - interface IQueryDelegationResponse { - /** QueryDelegationResponse delegationResponse */ - delegationResponse?: cosmos.staking.v1beta1.IDelegationResponse | null; - } - - /** Represents a QueryDelegationResponse. */ - class QueryDelegationResponse implements IQueryDelegationResponse { - /** - * Constructs a new QueryDelegationResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegationResponse); - - /** QueryDelegationResponse delegationResponse. */ - public delegationResponse?: cosmos.staking.v1beta1.IDelegationResponse | null; - - /** - * Creates a new QueryDelegationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegationResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegationResponse, - ): cosmos.staking.v1beta1.QueryDelegationResponse; - - /** - * Encodes the specified QueryDelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegationResponse.verify|verify} messages. - * @param m QueryDelegationResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegationResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegationResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegationResponse; - } - - /** Properties of a QueryUnbondingDelegationRequest. */ - interface IQueryUnbondingDelegationRequest { - /** QueryUnbondingDelegationRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryUnbondingDelegationRequest validatorAddr */ - validatorAddr?: string | null; - } - - /** Represents a QueryUnbondingDelegationRequest. */ - class QueryUnbondingDelegationRequest implements IQueryUnbondingDelegationRequest { - /** - * Constructs a new QueryUnbondingDelegationRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest); - - /** QueryUnbondingDelegationRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryUnbondingDelegationRequest validatorAddr. */ - public validatorAddr: string; - - /** - * Creates a new QueryUnbondingDelegationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnbondingDelegationRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest, - ): cosmos.staking.v1beta1.QueryUnbondingDelegationRequest; - - /** - * Encodes the specified QueryUnbondingDelegationRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationRequest.verify|verify} messages. - * @param m QueryUnbondingDelegationRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryUnbondingDelegationRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnbondingDelegationRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnbondingDelegationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryUnbondingDelegationRequest; - } - - /** Properties of a QueryUnbondingDelegationResponse. */ - interface IQueryUnbondingDelegationResponse { - /** QueryUnbondingDelegationResponse unbond */ - unbond?: cosmos.staking.v1beta1.IUnbondingDelegation | null; - } - - /** Represents a QueryUnbondingDelegationResponse. */ - class QueryUnbondingDelegationResponse implements IQueryUnbondingDelegationResponse { - /** - * Constructs a new QueryUnbondingDelegationResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse); - - /** QueryUnbondingDelegationResponse unbond. */ - public unbond?: cosmos.staking.v1beta1.IUnbondingDelegation | null; - - /** - * Creates a new QueryUnbondingDelegationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnbondingDelegationResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse, - ): cosmos.staking.v1beta1.QueryUnbondingDelegationResponse; - - /** - * Encodes the specified QueryUnbondingDelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryUnbondingDelegationResponse.verify|verify} messages. - * @param m QueryUnbondingDelegationResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryUnbondingDelegationResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnbondingDelegationResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnbondingDelegationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryUnbondingDelegationResponse; - } - - /** Properties of a QueryDelegatorDelegationsRequest. */ - interface IQueryDelegatorDelegationsRequest { - /** QueryDelegatorDelegationsRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryDelegatorDelegationsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryDelegatorDelegationsRequest. */ - class QueryDelegatorDelegationsRequest implements IQueryDelegatorDelegationsRequest { - /** - * Constructs a new QueryDelegatorDelegationsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest); - - /** QueryDelegatorDelegationsRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryDelegatorDelegationsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryDelegatorDelegationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorDelegationsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest, - ): cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest; - - /** - * Encodes the specified QueryDelegatorDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest.verify|verify} messages. - * @param m QueryDelegatorDelegationsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorDelegationsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorDelegationsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorDelegationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest; - } - - /** Properties of a QueryDelegatorDelegationsResponse. */ - interface IQueryDelegatorDelegationsResponse { - /** QueryDelegatorDelegationsResponse delegationResponses */ - delegationResponses?: cosmos.staking.v1beta1.IDelegationResponse[] | null; - - /** QueryDelegatorDelegationsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryDelegatorDelegationsResponse. */ - class QueryDelegatorDelegationsResponse implements IQueryDelegatorDelegationsResponse { - /** - * Constructs a new QueryDelegatorDelegationsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse); - - /** QueryDelegatorDelegationsResponse delegationResponses. */ - public delegationResponses: cosmos.staking.v1beta1.IDelegationResponse[]; - - /** QueryDelegatorDelegationsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryDelegatorDelegationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorDelegationsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse, - ): cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse; - - /** - * Encodes the specified QueryDelegatorDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse.verify|verify} messages. - * @param m QueryDelegatorDelegationsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorDelegationsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorDelegationsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorDelegationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse; - } - - /** Properties of a QueryDelegatorUnbondingDelegationsRequest. */ - interface IQueryDelegatorUnbondingDelegationsRequest { - /** QueryDelegatorUnbondingDelegationsRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryDelegatorUnbondingDelegationsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryDelegatorUnbondingDelegationsRequest. */ - class QueryDelegatorUnbondingDelegationsRequest implements IQueryDelegatorUnbondingDelegationsRequest { - /** - * Constructs a new QueryDelegatorUnbondingDelegationsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest); - - /** QueryDelegatorUnbondingDelegationsRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryDelegatorUnbondingDelegationsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryDelegatorUnbondingDelegationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorUnbondingDelegationsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest, - ): cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest; - - /** - * Encodes the specified QueryDelegatorUnbondingDelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest.verify|verify} messages. - * @param m QueryDelegatorUnbondingDelegationsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorUnbondingDelegationsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorUnbondingDelegationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest; - } - - /** Properties of a QueryDelegatorUnbondingDelegationsResponse. */ - interface IQueryDelegatorUnbondingDelegationsResponse { - /** QueryDelegatorUnbondingDelegationsResponse unbondingResponses */ - unbondingResponses?: cosmos.staking.v1beta1.IUnbondingDelegation[] | null; - - /** QueryDelegatorUnbondingDelegationsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryDelegatorUnbondingDelegationsResponse. */ - class QueryDelegatorUnbondingDelegationsResponse - implements IQueryDelegatorUnbondingDelegationsResponse { - /** - * Constructs a new QueryDelegatorUnbondingDelegationsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse); - - /** QueryDelegatorUnbondingDelegationsResponse unbondingResponses. */ - public unbondingResponses: cosmos.staking.v1beta1.IUnbondingDelegation[]; - - /** QueryDelegatorUnbondingDelegationsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryDelegatorUnbondingDelegationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorUnbondingDelegationsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse, - ): cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse; - - /** - * Encodes the specified QueryDelegatorUnbondingDelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse.verify|verify} messages. - * @param m QueryDelegatorUnbondingDelegationsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorUnbondingDelegationsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorUnbondingDelegationsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorUnbondingDelegationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse; - } - - /** Properties of a QueryRedelegationsRequest. */ - interface IQueryRedelegationsRequest { - /** QueryRedelegationsRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryRedelegationsRequest srcValidatorAddr */ - srcValidatorAddr?: string | null; - - /** QueryRedelegationsRequest dstValidatorAddr */ - dstValidatorAddr?: string | null; - - /** QueryRedelegationsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryRedelegationsRequest. */ - class QueryRedelegationsRequest implements IQueryRedelegationsRequest { - /** - * Constructs a new QueryRedelegationsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryRedelegationsRequest); - - /** QueryRedelegationsRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryRedelegationsRequest srcValidatorAddr. */ - public srcValidatorAddr: string; - - /** QueryRedelegationsRequest dstValidatorAddr. */ - public dstValidatorAddr: string; - - /** QueryRedelegationsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryRedelegationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryRedelegationsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryRedelegationsRequest, - ): cosmos.staking.v1beta1.QueryRedelegationsRequest; - - /** - * Encodes the specified QueryRedelegationsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsRequest.verify|verify} messages. - * @param m QueryRedelegationsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryRedelegationsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryRedelegationsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryRedelegationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryRedelegationsRequest; - } - - /** Properties of a QueryRedelegationsResponse. */ - interface IQueryRedelegationsResponse { - /** QueryRedelegationsResponse redelegationResponses */ - redelegationResponses?: cosmos.staking.v1beta1.IRedelegationResponse[] | null; - - /** QueryRedelegationsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryRedelegationsResponse. */ - class QueryRedelegationsResponse implements IQueryRedelegationsResponse { - /** - * Constructs a new QueryRedelegationsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryRedelegationsResponse); - - /** QueryRedelegationsResponse redelegationResponses. */ - public redelegationResponses: cosmos.staking.v1beta1.IRedelegationResponse[]; - - /** QueryRedelegationsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryRedelegationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryRedelegationsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryRedelegationsResponse, - ): cosmos.staking.v1beta1.QueryRedelegationsResponse; - - /** - * Encodes the specified QueryRedelegationsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryRedelegationsResponse.verify|verify} messages. - * @param m QueryRedelegationsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryRedelegationsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryRedelegationsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryRedelegationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryRedelegationsResponse; - } - - /** Properties of a QueryDelegatorValidatorsRequest. */ - interface IQueryDelegatorValidatorsRequest { - /** QueryDelegatorValidatorsRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryDelegatorValidatorsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryDelegatorValidatorsRequest. */ - class QueryDelegatorValidatorsRequest implements IQueryDelegatorValidatorsRequest { - /** - * Constructs a new QueryDelegatorValidatorsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest); - - /** QueryDelegatorValidatorsRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryDelegatorValidatorsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryDelegatorValidatorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest; - - /** - * Encodes the specified QueryDelegatorValidatorsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest.verify|verify} messages. - * @param m QueryDelegatorValidatorsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorValidatorsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest; - } - - /** Properties of a QueryDelegatorValidatorsResponse. */ - interface IQueryDelegatorValidatorsResponse { - /** QueryDelegatorValidatorsResponse validators */ - validators?: cosmos.staking.v1beta1.IValidator[] | null; - - /** QueryDelegatorValidatorsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - } - - /** Represents a QueryDelegatorValidatorsResponse. */ - class QueryDelegatorValidatorsResponse implements IQueryDelegatorValidatorsResponse { - /** - * Constructs a new QueryDelegatorValidatorsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse); - - /** QueryDelegatorValidatorsResponse validators. */ - public validators: cosmos.staking.v1beta1.IValidator[]; - - /** QueryDelegatorValidatorsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** - * Creates a new QueryDelegatorValidatorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse; - - /** - * Encodes the specified QueryDelegatorValidatorsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse.verify|verify} messages. - * @param m QueryDelegatorValidatorsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorValidatorsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse; - } - - /** Properties of a QueryDelegatorValidatorRequest. */ - interface IQueryDelegatorValidatorRequest { - /** QueryDelegatorValidatorRequest delegatorAddr */ - delegatorAddr?: string | null; - - /** QueryDelegatorValidatorRequest validatorAddr */ - validatorAddr?: string | null; - } - - /** Represents a QueryDelegatorValidatorRequest. */ - class QueryDelegatorValidatorRequest implements IQueryDelegatorValidatorRequest { - /** - * Constructs a new QueryDelegatorValidatorRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest); - - /** QueryDelegatorValidatorRequest delegatorAddr. */ - public delegatorAddr: string; - - /** QueryDelegatorValidatorRequest validatorAddr. */ - public validatorAddr: string; - - /** - * Creates a new QueryDelegatorValidatorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorRequest; - - /** - * Encodes the specified QueryDelegatorValidatorRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorRequest.verify|verify} messages. - * @param m QueryDelegatorValidatorRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorValidatorRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorRequest; - } - - /** Properties of a QueryDelegatorValidatorResponse. */ - interface IQueryDelegatorValidatorResponse { - /** QueryDelegatorValidatorResponse validator */ - validator?: cosmos.staking.v1beta1.IValidator | null; - } - - /** Represents a QueryDelegatorValidatorResponse. */ - class QueryDelegatorValidatorResponse implements IQueryDelegatorValidatorResponse { - /** - * Constructs a new QueryDelegatorValidatorResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse); - - /** QueryDelegatorValidatorResponse validator. */ - public validator?: cosmos.staking.v1beta1.IValidator | null; - - /** - * Creates a new QueryDelegatorValidatorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryDelegatorValidatorResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorResponse; - - /** - * Encodes the specified QueryDelegatorValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryDelegatorValidatorResponse.verify|verify} messages. - * @param m QueryDelegatorValidatorResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryDelegatorValidatorResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryDelegatorValidatorResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryDelegatorValidatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryDelegatorValidatorResponse; - } - - /** Properties of a QueryHistoricalInfoRequest. */ - interface IQueryHistoricalInfoRequest { - /** QueryHistoricalInfoRequest height */ - height?: Long | null; - } - - /** Represents a QueryHistoricalInfoRequest. */ - class QueryHistoricalInfoRequest implements IQueryHistoricalInfoRequest { - /** - * Constructs a new QueryHistoricalInfoRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryHistoricalInfoRequest); - - /** QueryHistoricalInfoRequest height. */ - public height: Long; - - /** - * Creates a new QueryHistoricalInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryHistoricalInfoRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryHistoricalInfoRequest, - ): cosmos.staking.v1beta1.QueryHistoricalInfoRequest; - - /** - * Encodes the specified QueryHistoricalInfoRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoRequest.verify|verify} messages. - * @param m QueryHistoricalInfoRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryHistoricalInfoRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryHistoricalInfoRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryHistoricalInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryHistoricalInfoRequest; - } - - /** Properties of a QueryHistoricalInfoResponse. */ - interface IQueryHistoricalInfoResponse { - /** QueryHistoricalInfoResponse hist */ - hist?: cosmos.staking.v1beta1.IHistoricalInfo | null; - } - - /** Represents a QueryHistoricalInfoResponse. */ - class QueryHistoricalInfoResponse implements IQueryHistoricalInfoResponse { - /** - * Constructs a new QueryHistoricalInfoResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryHistoricalInfoResponse); - - /** QueryHistoricalInfoResponse hist. */ - public hist?: cosmos.staking.v1beta1.IHistoricalInfo | null; - - /** - * Creates a new QueryHistoricalInfoResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryHistoricalInfoResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryHistoricalInfoResponse, - ): cosmos.staking.v1beta1.QueryHistoricalInfoResponse; - - /** - * Encodes the specified QueryHistoricalInfoResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryHistoricalInfoResponse.verify|verify} messages. - * @param m QueryHistoricalInfoResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryHistoricalInfoResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryHistoricalInfoResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryHistoricalInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryHistoricalInfoResponse; - } - - /** Properties of a QueryPoolRequest. */ - interface IQueryPoolRequest {} - - /** Represents a QueryPoolRequest. */ - class QueryPoolRequest implements IQueryPoolRequest { - /** - * Constructs a new QueryPoolRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryPoolRequest); - - /** - * Creates a new QueryPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPoolRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryPoolRequest, - ): cosmos.staking.v1beta1.QueryPoolRequest; - - /** - * Encodes the specified QueryPoolRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolRequest.verify|verify} messages. - * @param m QueryPoolRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryPoolRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPoolRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryPoolRequest; - } - - /** Properties of a QueryPoolResponse. */ - interface IQueryPoolResponse { - /** QueryPoolResponse pool */ - pool?: cosmos.staking.v1beta1.IPool | null; - } - - /** Represents a QueryPoolResponse. */ - class QueryPoolResponse implements IQueryPoolResponse { - /** - * Constructs a new QueryPoolResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryPoolResponse); - - /** QueryPoolResponse pool. */ - public pool?: cosmos.staking.v1beta1.IPool | null; - - /** - * Creates a new QueryPoolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPoolResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryPoolResponse, - ): cosmos.staking.v1beta1.QueryPoolResponse; - - /** - * Encodes the specified QueryPoolResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryPoolResponse.verify|verify} messages. - * @param m QueryPoolResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryPoolResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPoolResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPoolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryPoolResponse; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest {} - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - /** - * Constructs a new QueryParamsRequest. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryParamsRequest); - - /** - * Creates a new QueryParamsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsRequest instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryParamsRequest, - ): cosmos.staking.v1beta1.QueryParamsRequest; - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param m QueryParamsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryParamsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryParamsRequest; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - /** QueryParamsResponse params */ - params?: cosmos.staking.v1beta1.IParams | null; - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - /** - * Constructs a new QueryParamsResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: cosmos.staking.v1beta1.IParams | null; - - /** - * Creates a new QueryParamsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParamsResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IQueryParamsResponse, - ): cosmos.staking.v1beta1.QueryParamsResponse; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link cosmos.staking.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param m QueryParamsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IQueryParamsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.QueryParamsResponse; - } - - /** Properties of a HistoricalInfo. */ - interface IHistoricalInfo { - /** HistoricalInfo header */ - header?: tendermint.types.IHeader | null; - - /** HistoricalInfo valset */ - valset?: cosmos.staking.v1beta1.IValidator[] | null; - } - - /** Represents a HistoricalInfo. */ - class HistoricalInfo implements IHistoricalInfo { - /** - * Constructs a new HistoricalInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IHistoricalInfo); - - /** HistoricalInfo header. */ - public header?: tendermint.types.IHeader | null; - - /** HistoricalInfo valset. */ - public valset: cosmos.staking.v1beta1.IValidator[]; - - /** - * Creates a new HistoricalInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns HistoricalInfo instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IHistoricalInfo, - ): cosmos.staking.v1beta1.HistoricalInfo; - - /** - * Encodes the specified HistoricalInfo message. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages. - * @param m HistoricalInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IHistoricalInfo, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a HistoricalInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns HistoricalInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.HistoricalInfo; - } - - /** Properties of a CommissionRates. */ - interface ICommissionRates { - /** CommissionRates rate */ - rate?: string | null; - - /** CommissionRates maxRate */ - maxRate?: string | null; - - /** CommissionRates maxChangeRate */ - maxChangeRate?: string | null; - } - - /** Represents a CommissionRates. */ - class CommissionRates implements ICommissionRates { - /** - * Constructs a new CommissionRates. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.ICommissionRates); - - /** CommissionRates rate. */ - public rate: string; - - /** CommissionRates maxRate. */ - public maxRate: string; - - /** CommissionRates maxChangeRate. */ - public maxChangeRate: string; - - /** - * Creates a new CommissionRates instance using the specified properties. - * @param [properties] Properties to set - * @returns CommissionRates instance - */ - public static create( - properties?: cosmos.staking.v1beta1.ICommissionRates, - ): cosmos.staking.v1beta1.CommissionRates; - - /** - * Encodes the specified CommissionRates message. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages. - * @param m CommissionRates message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.ICommissionRates, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CommissionRates message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CommissionRates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.CommissionRates; - } - - /** Properties of a Commission. */ - interface ICommission { - /** Commission commissionRates */ - commissionRates?: cosmos.staking.v1beta1.ICommissionRates | null; - - /** Commission updateTime */ - updateTime?: google.protobuf.ITimestamp | null; - } - - /** Represents a Commission. */ - class Commission implements ICommission { - /** - * Constructs a new Commission. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.ICommission); - - /** Commission commissionRates. */ - public commissionRates?: cosmos.staking.v1beta1.ICommissionRates | null; - - /** Commission updateTime. */ - public updateTime?: google.protobuf.ITimestamp | null; - - /** - * Creates a new Commission instance using the specified properties. - * @param [properties] Properties to set - * @returns Commission instance - */ - public static create( - properties?: cosmos.staking.v1beta1.ICommission, - ): cosmos.staking.v1beta1.Commission; - - /** - * Encodes the specified Commission message. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages. - * @param m Commission message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.ICommission, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Commission message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Commission - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.Commission; - } - - /** Properties of a Description. */ - interface IDescription { - /** Description moniker */ - moniker?: string | null; - - /** Description identity */ - identity?: string | null; - - /** Description website */ - website?: string | null; - - /** Description securityContact */ - securityContact?: string | null; - - /** Description details */ - details?: string | null; - } - - /** Represents a Description. */ - class Description implements IDescription { - /** - * Constructs a new Description. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDescription); - - /** Description moniker. */ - public moniker: string; - - /** Description identity. */ - public identity: string; - - /** Description website. */ - public website: string; - - /** Description securityContact. */ - public securityContact: string; - - /** Description details. */ - public details: string; - - /** - * Creates a new Description instance using the specified properties. - * @param [properties] Properties to set - * @returns Description instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IDescription, - ): cosmos.staking.v1beta1.Description; - - /** - * Encodes the specified Description message. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages. - * @param m Description message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDescription, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Description message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Description - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.Description; - } - - /** Properties of a Validator. */ - interface IValidator { - /** Validator operatorAddress */ - operatorAddress?: string | null; - - /** Validator consensusPubkey */ - consensusPubkey?: google.protobuf.IAny | null; - - /** Validator jailed */ - jailed?: boolean | null; - - /** Validator status */ - status?: cosmos.staking.v1beta1.BondStatus | null; - - /** Validator tokens */ - tokens?: string | null; - - /** Validator delegatorShares */ - delegatorShares?: string | null; - - /** Validator description */ - description?: cosmos.staking.v1beta1.IDescription | null; - - /** Validator unbondingHeight */ - unbondingHeight?: Long | null; - - /** Validator unbondingTime */ - unbondingTime?: google.protobuf.ITimestamp | null; - - /** Validator commission */ - commission?: cosmos.staking.v1beta1.ICommission | null; - - /** Validator minSelfDelegation */ - minSelfDelegation?: string | null; - } - - /** Represents a Validator. */ - class Validator implements IValidator { - /** - * Constructs a new Validator. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IValidator); - - /** Validator operatorAddress. */ - public operatorAddress: string; - - /** Validator consensusPubkey. */ - public consensusPubkey?: google.protobuf.IAny | null; - - /** Validator jailed. */ - public jailed: boolean; - - /** Validator status. */ - public status: cosmos.staking.v1beta1.BondStatus; - - /** Validator tokens. */ - public tokens: string; - - /** Validator delegatorShares. */ - public delegatorShares: string; - - /** Validator description. */ - public description?: cosmos.staking.v1beta1.IDescription | null; - - /** Validator unbondingHeight. */ - public unbondingHeight: Long; - - /** Validator unbondingTime. */ - public unbondingTime?: google.protobuf.ITimestamp | null; - - /** Validator commission. */ - public commission?: cosmos.staking.v1beta1.ICommission | null; - - /** Validator minSelfDelegation. */ - public minSelfDelegation: string; - - /** - * Creates a new Validator instance using the specified properties. - * @param [properties] Properties to set - * @returns Validator instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IValidator, - ): cosmos.staking.v1beta1.Validator; - - /** - * Encodes the specified Validator message. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages. - * @param m Validator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IValidator, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.Validator; - } - - /** BondStatus enum. */ - enum BondStatus { - BOND_STATUS_UNSPECIFIED = 0, - BOND_STATUS_UNBONDED = 1, - BOND_STATUS_UNBONDING = 2, - BOND_STATUS_BONDED = 3, - } - - /** Properties of a ValAddresses. */ - interface IValAddresses { - /** ValAddresses addresses */ - addresses?: string[] | null; - } - - /** Represents a ValAddresses. */ - class ValAddresses implements IValAddresses { - /** - * Constructs a new ValAddresses. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IValAddresses); - - /** ValAddresses addresses. */ - public addresses: string[]; - - /** - * Creates a new ValAddresses instance using the specified properties. - * @param [properties] Properties to set - * @returns ValAddresses instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IValAddresses, - ): cosmos.staking.v1beta1.ValAddresses; - - /** - * Encodes the specified ValAddresses message. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages. - * @param m ValAddresses message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IValAddresses, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValAddresses message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValAddresses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.ValAddresses; - } - - /** Properties of a DVPair. */ - interface IDVPair { - /** DVPair delegatorAddress */ - delegatorAddress?: string | null; - - /** DVPair validatorAddress */ - validatorAddress?: string | null; - } - - /** Represents a DVPair. */ - class DVPair implements IDVPair { - /** - * Constructs a new DVPair. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDVPair); - - /** DVPair delegatorAddress. */ - public delegatorAddress: string; - - /** DVPair validatorAddress. */ - public validatorAddress: string; - - /** - * Creates a new DVPair instance using the specified properties. - * @param [properties] Properties to set - * @returns DVPair instance - */ - public static create(properties?: cosmos.staking.v1beta1.IDVPair): cosmos.staking.v1beta1.DVPair; - - /** - * Encodes the specified DVPair message. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages. - * @param m DVPair message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDVPair, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DVPair message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DVPair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.DVPair; - } - - /** Properties of a DVPairs. */ - interface IDVPairs { - /** DVPairs pairs */ - pairs?: cosmos.staking.v1beta1.IDVPair[] | null; - } - - /** Represents a DVPairs. */ - class DVPairs implements IDVPairs { - /** - * Constructs a new DVPairs. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDVPairs); - - /** DVPairs pairs. */ - public pairs: cosmos.staking.v1beta1.IDVPair[]; - - /** - * Creates a new DVPairs instance using the specified properties. - * @param [properties] Properties to set - * @returns DVPairs instance - */ - public static create(properties?: cosmos.staking.v1beta1.IDVPairs): cosmos.staking.v1beta1.DVPairs; - - /** - * Encodes the specified DVPairs message. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages. - * @param m DVPairs message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDVPairs, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DVPairs message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DVPairs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.DVPairs; - } - - /** Properties of a DVVTriplet. */ - interface IDVVTriplet { - /** DVVTriplet delegatorAddress */ - delegatorAddress?: string | null; - - /** DVVTriplet validatorSrcAddress */ - validatorSrcAddress?: string | null; - - /** DVVTriplet validatorDstAddress */ - validatorDstAddress?: string | null; - } - - /** Represents a DVVTriplet. */ - class DVVTriplet implements IDVVTriplet { - /** - * Constructs a new DVVTriplet. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDVVTriplet); - - /** DVVTriplet delegatorAddress. */ - public delegatorAddress: string; - - /** DVVTriplet validatorSrcAddress. */ - public validatorSrcAddress: string; - - /** DVVTriplet validatorDstAddress. */ - public validatorDstAddress: string; - - /** - * Creates a new DVVTriplet instance using the specified properties. - * @param [properties] Properties to set - * @returns DVVTriplet instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IDVVTriplet, - ): cosmos.staking.v1beta1.DVVTriplet; - - /** - * Encodes the specified DVVTriplet message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages. - * @param m DVVTriplet message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDVVTriplet, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DVVTriplet message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DVVTriplet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.DVVTriplet; - } - - /** Properties of a DVVTriplets. */ - interface IDVVTriplets { - /** DVVTriplets triplets */ - triplets?: cosmos.staking.v1beta1.IDVVTriplet[] | null; - } - - /** Represents a DVVTriplets. */ - class DVVTriplets implements IDVVTriplets { - /** - * Constructs a new DVVTriplets. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDVVTriplets); - - /** DVVTriplets triplets. */ - public triplets: cosmos.staking.v1beta1.IDVVTriplet[]; - - /** - * Creates a new DVVTriplets instance using the specified properties. - * @param [properties] Properties to set - * @returns DVVTriplets instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IDVVTriplets, - ): cosmos.staking.v1beta1.DVVTriplets; - - /** - * Encodes the specified DVVTriplets message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages. - * @param m DVVTriplets message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDVVTriplets, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DVVTriplets message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DVVTriplets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.DVVTriplets; - } - - /** Properties of a Delegation. */ - interface IDelegation { - /** Delegation delegatorAddress */ - delegatorAddress?: string | null; - - /** Delegation validatorAddress */ - validatorAddress?: string | null; - - /** Delegation shares */ - shares?: string | null; - } - - /** Represents a Delegation. */ - class Delegation implements IDelegation { - /** - * Constructs a new Delegation. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDelegation); - - /** Delegation delegatorAddress. */ - public delegatorAddress: string; - - /** Delegation validatorAddress. */ - public validatorAddress: string; - - /** Delegation shares. */ - public shares: string; - - /** - * Creates a new Delegation instance using the specified properties. - * @param [properties] Properties to set - * @returns Delegation instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IDelegation, - ): cosmos.staking.v1beta1.Delegation; - - /** - * Encodes the specified Delegation message. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages. - * @param m Delegation message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IDelegation, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Delegation message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Delegation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.Delegation; - } - - /** Properties of an UnbondingDelegation. */ - interface IUnbondingDelegation { - /** UnbondingDelegation delegatorAddress */ - delegatorAddress?: string | null; - - /** UnbondingDelegation validatorAddress */ - validatorAddress?: string | null; - - /** UnbondingDelegation entries */ - entries?: cosmos.staking.v1beta1.IUnbondingDelegationEntry[] | null; - } - - /** Represents an UnbondingDelegation. */ - class UnbondingDelegation implements IUnbondingDelegation { - /** - * Constructs a new UnbondingDelegation. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IUnbondingDelegation); - - /** UnbondingDelegation delegatorAddress. */ - public delegatorAddress: string; - - /** UnbondingDelegation validatorAddress. */ - public validatorAddress: string; - - /** UnbondingDelegation entries. */ - public entries: cosmos.staking.v1beta1.IUnbondingDelegationEntry[]; - - /** - * Creates a new UnbondingDelegation instance using the specified properties. - * @param [properties] Properties to set - * @returns UnbondingDelegation instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IUnbondingDelegation, - ): cosmos.staking.v1beta1.UnbondingDelegation; - - /** - * Encodes the specified UnbondingDelegation message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages. - * @param m UnbondingDelegation message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IUnbondingDelegation, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an UnbondingDelegation message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns UnbondingDelegation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.UnbondingDelegation; - } - - /** Properties of an UnbondingDelegationEntry. */ - interface IUnbondingDelegationEntry { - /** UnbondingDelegationEntry creationHeight */ - creationHeight?: Long | null; - - /** UnbondingDelegationEntry completionTime */ - completionTime?: google.protobuf.ITimestamp | null; - - /** UnbondingDelegationEntry initialBalance */ - initialBalance?: string | null; - - /** UnbondingDelegationEntry balance */ - balance?: string | null; - } - - /** Represents an UnbondingDelegationEntry. */ - class UnbondingDelegationEntry implements IUnbondingDelegationEntry { - /** - * Constructs a new UnbondingDelegationEntry. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IUnbondingDelegationEntry); - - /** UnbondingDelegationEntry creationHeight. */ - public creationHeight: Long; - - /** UnbondingDelegationEntry completionTime. */ - public completionTime?: google.protobuf.ITimestamp | null; - - /** UnbondingDelegationEntry initialBalance. */ - public initialBalance: string; - - /** UnbondingDelegationEntry balance. */ - public balance: string; - - /** - * Creates a new UnbondingDelegationEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns UnbondingDelegationEntry instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IUnbondingDelegationEntry, - ): cosmos.staking.v1beta1.UnbondingDelegationEntry; - - /** - * Encodes the specified UnbondingDelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages. - * @param m UnbondingDelegationEntry message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IUnbondingDelegationEntry, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an UnbondingDelegationEntry message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns UnbondingDelegationEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.UnbondingDelegationEntry; - } - - /** Properties of a RedelegationEntry. */ - interface IRedelegationEntry { - /** RedelegationEntry creationHeight */ - creationHeight?: Long | null; - - /** RedelegationEntry completionTime */ - completionTime?: google.protobuf.ITimestamp | null; - - /** RedelegationEntry initialBalance */ - initialBalance?: string | null; - - /** RedelegationEntry sharesDst */ - sharesDst?: string | null; - } - - /** Represents a RedelegationEntry. */ - class RedelegationEntry implements IRedelegationEntry { - /** - * Constructs a new RedelegationEntry. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IRedelegationEntry); - - /** RedelegationEntry creationHeight. */ - public creationHeight: Long; - - /** RedelegationEntry completionTime. */ - public completionTime?: google.protobuf.ITimestamp | null; - - /** RedelegationEntry initialBalance. */ - public initialBalance: string; - - /** RedelegationEntry sharesDst. */ - public sharesDst: string; - - /** - * Creates a new RedelegationEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns RedelegationEntry instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IRedelegationEntry, - ): cosmos.staking.v1beta1.RedelegationEntry; - - /** - * Encodes the specified RedelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages. - * @param m RedelegationEntry message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IRedelegationEntry, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a RedelegationEntry message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RedelegationEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.RedelegationEntry; - } - - /** Properties of a Redelegation. */ - interface IRedelegation { - /** Redelegation delegatorAddress */ - delegatorAddress?: string | null; - - /** Redelegation validatorSrcAddress */ - validatorSrcAddress?: string | null; - - /** Redelegation validatorDstAddress */ - validatorDstAddress?: string | null; - - /** Redelegation entries */ - entries?: cosmos.staking.v1beta1.IRedelegationEntry[] | null; - } - - /** Represents a Redelegation. */ - class Redelegation implements IRedelegation { - /** - * Constructs a new Redelegation. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IRedelegation); - - /** Redelegation delegatorAddress. */ - public delegatorAddress: string; - - /** Redelegation validatorSrcAddress. */ - public validatorSrcAddress: string; - - /** Redelegation validatorDstAddress. */ - public validatorDstAddress: string; - - /** Redelegation entries. */ - public entries: cosmos.staking.v1beta1.IRedelegationEntry[]; - - /** - * Creates a new Redelegation instance using the specified properties. - * @param [properties] Properties to set - * @returns Redelegation instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IRedelegation, - ): cosmos.staking.v1beta1.Redelegation; - - /** - * Encodes the specified Redelegation message. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages. - * @param m Redelegation message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IRedelegation, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Redelegation message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Redelegation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.Redelegation; - } - - /** Properties of a Params. */ - interface IParams { - /** Params unbondingTime */ - unbondingTime?: google.protobuf.IDuration | null; - - /** Params maxValidators */ - maxValidators?: number | null; - - /** Params maxEntries */ - maxEntries?: number | null; - - /** Params historicalEntries */ - historicalEntries?: number | null; - - /** Params bondDenom */ - bondDenom?: string | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IParams); - - /** Params unbondingTime. */ - public unbondingTime?: google.protobuf.IDuration | null; - - /** Params maxValidators. */ - public maxValidators: number; - - /** Params maxEntries. */ - public maxEntries: number; - - /** Params historicalEntries. */ - public historicalEntries: number; - - /** Params bondDenom. */ - public bondDenom: string; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: cosmos.staking.v1beta1.IParams): cosmos.staking.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.Params; - } - - /** Properties of a DelegationResponse. */ - interface IDelegationResponse { - /** DelegationResponse delegation */ - delegation?: cosmos.staking.v1beta1.IDelegation | null; - - /** DelegationResponse balance */ - balance?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a DelegationResponse. */ - class DelegationResponse implements IDelegationResponse { - /** - * Constructs a new DelegationResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IDelegationResponse); - - /** DelegationResponse delegation. */ - public delegation?: cosmos.staking.v1beta1.IDelegation | null; - - /** DelegationResponse balance. */ - public balance?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new DelegationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DelegationResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IDelegationResponse, - ): cosmos.staking.v1beta1.DelegationResponse; - - /** - * Encodes the specified DelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages. - * @param m DelegationResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IDelegationResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a DelegationResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DelegationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.DelegationResponse; - } - - /** Properties of a RedelegationEntryResponse. */ - interface IRedelegationEntryResponse { - /** RedelegationEntryResponse redelegationEntry */ - redelegationEntry?: cosmos.staking.v1beta1.IRedelegationEntry | null; - - /** RedelegationEntryResponse balance */ - balance?: string | null; - } - - /** Represents a RedelegationEntryResponse. */ - class RedelegationEntryResponse implements IRedelegationEntryResponse { - /** - * Constructs a new RedelegationEntryResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IRedelegationEntryResponse); - - /** RedelegationEntryResponse redelegationEntry. */ - public redelegationEntry?: cosmos.staking.v1beta1.IRedelegationEntry | null; - - /** RedelegationEntryResponse balance. */ - public balance: string; - - /** - * Creates a new RedelegationEntryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RedelegationEntryResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IRedelegationEntryResponse, - ): cosmos.staking.v1beta1.RedelegationEntryResponse; - - /** - * Encodes the specified RedelegationEntryResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages. - * @param m RedelegationEntryResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IRedelegationEntryResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a RedelegationEntryResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RedelegationEntryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.RedelegationEntryResponse; - } - - /** Properties of a RedelegationResponse. */ - interface IRedelegationResponse { - /** RedelegationResponse redelegation */ - redelegation?: cosmos.staking.v1beta1.IRedelegation | null; - - /** RedelegationResponse entries */ - entries?: cosmos.staking.v1beta1.IRedelegationEntryResponse[] | null; - } - - /** Represents a RedelegationResponse. */ - class RedelegationResponse implements IRedelegationResponse { - /** - * Constructs a new RedelegationResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IRedelegationResponse); - - /** RedelegationResponse redelegation. */ - public redelegation?: cosmos.staking.v1beta1.IRedelegation | null; - - /** RedelegationResponse entries. */ - public entries: cosmos.staking.v1beta1.IRedelegationEntryResponse[]; - - /** - * Creates a new RedelegationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RedelegationResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IRedelegationResponse, - ): cosmos.staking.v1beta1.RedelegationResponse; - - /** - * Encodes the specified RedelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages. - * @param m RedelegationResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IRedelegationResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a RedelegationResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RedelegationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.RedelegationResponse; - } - - /** Properties of a Pool. */ - interface IPool { - /** Pool notBondedTokens */ - notBondedTokens?: string | null; - - /** Pool bondedTokens */ - bondedTokens?: string | null; - } - - /** Represents a Pool. */ - class Pool implements IPool { - /** - * Constructs a new Pool. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IPool); - - /** Pool notBondedTokens. */ - public notBondedTokens: string; - - /** Pool bondedTokens. */ - public bondedTokens: string; - - /** - * Creates a new Pool instance using the specified properties. - * @param [properties] Properties to set - * @returns Pool instance - */ - public static create(properties?: cosmos.staking.v1beta1.IPool): cosmos.staking.v1beta1.Pool; - - /** - * Encodes the specified Pool message. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages. - * @param m Pool message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IPool, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Pool message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Pool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.staking.v1beta1.Pool; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Msg service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Msg; - - /** - * Calls CreateValidator. - * @param request MsgCreateValidator message or plain object - * @param callback Node-style callback called with the error, if any, and MsgCreateValidatorResponse - */ - public createValidator( - request: cosmos.staking.v1beta1.IMsgCreateValidator, - callback: cosmos.staking.v1beta1.Msg.CreateValidatorCallback, - ): void; - - /** - * Calls CreateValidator. - * @param request MsgCreateValidator message or plain object - * @returns Promise - */ - public createValidator( - request: cosmos.staking.v1beta1.IMsgCreateValidator, - ): Promise; - - /** - * Calls EditValidator. - * @param request MsgEditValidator message or plain object - * @param callback Node-style callback called with the error, if any, and MsgEditValidatorResponse - */ - public editValidator( - request: cosmos.staking.v1beta1.IMsgEditValidator, - callback: cosmos.staking.v1beta1.Msg.EditValidatorCallback, - ): void; - - /** - * Calls EditValidator. - * @param request MsgEditValidator message or plain object - * @returns Promise - */ - public editValidator( - request: cosmos.staking.v1beta1.IMsgEditValidator, - ): Promise; - - /** - * Calls Delegate. - * @param request MsgDelegate message or plain object - * @param callback Node-style callback called with the error, if any, and MsgDelegateResponse - */ - public delegate( - request: cosmos.staking.v1beta1.IMsgDelegate, - callback: cosmos.staking.v1beta1.Msg.DelegateCallback, - ): void; - - /** - * Calls Delegate. - * @param request MsgDelegate message or plain object - * @returns Promise - */ - public delegate( - request: cosmos.staking.v1beta1.IMsgDelegate, - ): Promise; - - /** - * Calls BeginRedelegate. - * @param request MsgBeginRedelegate message or plain object - * @param callback Node-style callback called with the error, if any, and MsgBeginRedelegateResponse - */ - public beginRedelegate( - request: cosmos.staking.v1beta1.IMsgBeginRedelegate, - callback: cosmos.staking.v1beta1.Msg.BeginRedelegateCallback, - ): void; - - /** - * Calls BeginRedelegate. - * @param request MsgBeginRedelegate message or plain object - * @returns Promise - */ - public beginRedelegate( - request: cosmos.staking.v1beta1.IMsgBeginRedelegate, - ): Promise; - - /** - * Calls Undelegate. - * @param request MsgUndelegate message or plain object - * @param callback Node-style callback called with the error, if any, and MsgUndelegateResponse - */ - public undelegate( - request: cosmos.staking.v1beta1.IMsgUndelegate, - callback: cosmos.staking.v1beta1.Msg.UndelegateCallback, - ): void; - - /** - * Calls Undelegate. - * @param request MsgUndelegate message or plain object - * @returns Promise - */ - public undelegate( - request: cosmos.staking.v1beta1.IMsgUndelegate, - ): Promise; - } - - namespace Msg { - /** - * Callback as used by {@link cosmos.staking.v1beta1.Msg#createValidator}. - * @param error Error, if any - * @param [response] MsgCreateValidatorResponse - */ - type CreateValidatorCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.MsgCreateValidatorResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Msg#editValidator}. - * @param error Error, if any - * @param [response] MsgEditValidatorResponse - */ - type EditValidatorCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.MsgEditValidatorResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Msg#delegate}. - * @param error Error, if any - * @param [response] MsgDelegateResponse - */ - type DelegateCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.MsgDelegateResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Msg#beginRedelegate}. - * @param error Error, if any - * @param [response] MsgBeginRedelegateResponse - */ - type BeginRedelegateCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.MsgBeginRedelegateResponse, - ) => void; - - /** - * Callback as used by {@link cosmos.staking.v1beta1.Msg#undelegate}. - * @param error Error, if any - * @param [response] MsgUndelegateResponse - */ - type UndelegateCallback = ( - error: Error | null, - response?: cosmos.staking.v1beta1.MsgUndelegateResponse, - ) => void; - } - - /** Properties of a MsgCreateValidator. */ - interface IMsgCreateValidator { - /** MsgCreateValidator description */ - description?: cosmos.staking.v1beta1.IDescription | null; - - /** MsgCreateValidator commission */ - commission?: cosmos.staking.v1beta1.ICommissionRates | null; - - /** MsgCreateValidator minSelfDelegation */ - minSelfDelegation?: string | null; - - /** MsgCreateValidator delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgCreateValidator validatorAddress */ - validatorAddress?: string | null; - - /** MsgCreateValidator pubkey */ - pubkey?: google.protobuf.IAny | null; - - /** MsgCreateValidator value */ - value?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a MsgCreateValidator. */ - class MsgCreateValidator implements IMsgCreateValidator { - /** - * Constructs a new MsgCreateValidator. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgCreateValidator); - - /** MsgCreateValidator description. */ - public description?: cosmos.staking.v1beta1.IDescription | null; - - /** MsgCreateValidator commission. */ - public commission?: cosmos.staking.v1beta1.ICommissionRates | null; - - /** MsgCreateValidator minSelfDelegation. */ - public minSelfDelegation: string; - - /** MsgCreateValidator delegatorAddress. */ - public delegatorAddress: string; - - /** MsgCreateValidator validatorAddress. */ - public validatorAddress: string; - - /** MsgCreateValidator pubkey. */ - public pubkey?: google.protobuf.IAny | null; - - /** MsgCreateValidator value. */ - public value?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new MsgCreateValidator instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgCreateValidator instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgCreateValidator, - ): cosmos.staking.v1beta1.MsgCreateValidator; - - /** - * Encodes the specified MsgCreateValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages. - * @param m MsgCreateValidator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgCreateValidator, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgCreateValidator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgCreateValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgCreateValidator; - } - - /** Properties of a MsgCreateValidatorResponse. */ - interface IMsgCreateValidatorResponse {} - - /** Represents a MsgCreateValidatorResponse. */ - class MsgCreateValidatorResponse implements IMsgCreateValidatorResponse { - /** - * Constructs a new MsgCreateValidatorResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgCreateValidatorResponse); - - /** - * Creates a new MsgCreateValidatorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgCreateValidatorResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgCreateValidatorResponse, - ): cosmos.staking.v1beta1.MsgCreateValidatorResponse; - - /** - * Encodes the specified MsgCreateValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages. - * @param m MsgCreateValidatorResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgCreateValidatorResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgCreateValidatorResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgCreateValidatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgCreateValidatorResponse; - } - - /** Properties of a MsgEditValidator. */ - interface IMsgEditValidator { - /** MsgEditValidator description */ - description?: cosmos.staking.v1beta1.IDescription | null; - - /** MsgEditValidator validatorAddress */ - validatorAddress?: string | null; - - /** MsgEditValidator commissionRate */ - commissionRate?: string | null; - - /** MsgEditValidator minSelfDelegation */ - minSelfDelegation?: string | null; - } - - /** Represents a MsgEditValidator. */ - class MsgEditValidator implements IMsgEditValidator { - /** - * Constructs a new MsgEditValidator. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgEditValidator); - - /** MsgEditValidator description. */ - public description?: cosmos.staking.v1beta1.IDescription | null; - - /** MsgEditValidator validatorAddress. */ - public validatorAddress: string; - - /** MsgEditValidator commissionRate. */ - public commissionRate: string; - - /** MsgEditValidator minSelfDelegation. */ - public minSelfDelegation: string; - - /** - * Creates a new MsgEditValidator instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgEditValidator instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgEditValidator, - ): cosmos.staking.v1beta1.MsgEditValidator; - - /** - * Encodes the specified MsgEditValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages. - * @param m MsgEditValidator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgEditValidator, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgEditValidator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgEditValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgEditValidator; - } - - /** Properties of a MsgEditValidatorResponse. */ - interface IMsgEditValidatorResponse {} - - /** Represents a MsgEditValidatorResponse. */ - class MsgEditValidatorResponse implements IMsgEditValidatorResponse { - /** - * Constructs a new MsgEditValidatorResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgEditValidatorResponse); - - /** - * Creates a new MsgEditValidatorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgEditValidatorResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgEditValidatorResponse, - ): cosmos.staking.v1beta1.MsgEditValidatorResponse; - - /** - * Encodes the specified MsgEditValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages. - * @param m MsgEditValidatorResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgEditValidatorResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgEditValidatorResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgEditValidatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgEditValidatorResponse; - } - - /** Properties of a MsgDelegate. */ - interface IMsgDelegate { - /** MsgDelegate delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgDelegate validatorAddress */ - validatorAddress?: string | null; - - /** MsgDelegate amount */ - amount?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a MsgDelegate. */ - class MsgDelegate implements IMsgDelegate { - /** - * Constructs a new MsgDelegate. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgDelegate); - - /** MsgDelegate delegatorAddress. */ - public delegatorAddress: string; - - /** MsgDelegate validatorAddress. */ - public validatorAddress: string; - - /** MsgDelegate amount. */ - public amount?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new MsgDelegate instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgDelegate instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgDelegate, - ): cosmos.staking.v1beta1.MsgDelegate; - - /** - * Encodes the specified MsgDelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages. - * @param m MsgDelegate message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.staking.v1beta1.IMsgDelegate, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDelegate message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgDelegate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgDelegate; - } - - /** Properties of a MsgDelegateResponse. */ - interface IMsgDelegateResponse {} - - /** Represents a MsgDelegateResponse. */ - class MsgDelegateResponse implements IMsgDelegateResponse { - /** - * Constructs a new MsgDelegateResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgDelegateResponse); - - /** - * Creates a new MsgDelegateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgDelegateResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgDelegateResponse, - ): cosmos.staking.v1beta1.MsgDelegateResponse; - - /** - * Encodes the specified MsgDelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages. - * @param m MsgDelegateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgDelegateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgDelegateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgDelegateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgDelegateResponse; - } - - /** Properties of a MsgBeginRedelegate. */ - interface IMsgBeginRedelegate { - /** MsgBeginRedelegate delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgBeginRedelegate validatorSrcAddress */ - validatorSrcAddress?: string | null; - - /** MsgBeginRedelegate validatorDstAddress */ - validatorDstAddress?: string | null; - - /** MsgBeginRedelegate amount */ - amount?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a MsgBeginRedelegate. */ - class MsgBeginRedelegate implements IMsgBeginRedelegate { - /** - * Constructs a new MsgBeginRedelegate. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgBeginRedelegate); - - /** MsgBeginRedelegate delegatorAddress. */ - public delegatorAddress: string; - - /** MsgBeginRedelegate validatorSrcAddress. */ - public validatorSrcAddress: string; - - /** MsgBeginRedelegate validatorDstAddress. */ - public validatorDstAddress: string; - - /** MsgBeginRedelegate amount. */ - public amount?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new MsgBeginRedelegate instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgBeginRedelegate instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgBeginRedelegate, - ): cosmos.staking.v1beta1.MsgBeginRedelegate; - - /** - * Encodes the specified MsgBeginRedelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages. - * @param m MsgBeginRedelegate message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgBeginRedelegate, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgBeginRedelegate message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgBeginRedelegate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgBeginRedelegate; - } - - /** Properties of a MsgBeginRedelegateResponse. */ - interface IMsgBeginRedelegateResponse { - /** MsgBeginRedelegateResponse completionTime */ - completionTime?: google.protobuf.ITimestamp | null; - } - - /** Represents a MsgBeginRedelegateResponse. */ - class MsgBeginRedelegateResponse implements IMsgBeginRedelegateResponse { - /** - * Constructs a new MsgBeginRedelegateResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgBeginRedelegateResponse); - - /** MsgBeginRedelegateResponse completionTime. */ - public completionTime?: google.protobuf.ITimestamp | null; - - /** - * Creates a new MsgBeginRedelegateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgBeginRedelegateResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgBeginRedelegateResponse, - ): cosmos.staking.v1beta1.MsgBeginRedelegateResponse; - - /** - * Encodes the specified MsgBeginRedelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages. - * @param m MsgBeginRedelegateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgBeginRedelegateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgBeginRedelegateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgBeginRedelegateResponse; - } - - /** Properties of a MsgUndelegate. */ - interface IMsgUndelegate { - /** MsgUndelegate delegatorAddress */ - delegatorAddress?: string | null; - - /** MsgUndelegate validatorAddress */ - validatorAddress?: string | null; - - /** MsgUndelegate amount */ - amount?: cosmos.base.v1beta1.ICoin | null; - } - - /** Represents a MsgUndelegate. */ - class MsgUndelegate implements IMsgUndelegate { - /** - * Constructs a new MsgUndelegate. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgUndelegate); - - /** MsgUndelegate delegatorAddress. */ - public delegatorAddress: string; - - /** MsgUndelegate validatorAddress. */ - public validatorAddress: string; - - /** MsgUndelegate amount. */ - public amount?: cosmos.base.v1beta1.ICoin | null; - - /** - * Creates a new MsgUndelegate instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgUndelegate instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgUndelegate, - ): cosmos.staking.v1beta1.MsgUndelegate; - - /** - * Encodes the specified MsgUndelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages. - * @param m MsgUndelegate message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgUndelegate, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgUndelegate message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgUndelegate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgUndelegate; - } - - /** Properties of a MsgUndelegateResponse. */ - interface IMsgUndelegateResponse { - /** MsgUndelegateResponse completionTime */ - completionTime?: google.protobuf.ITimestamp | null; - } - - /** Represents a MsgUndelegateResponse. */ - class MsgUndelegateResponse implements IMsgUndelegateResponse { - /** - * Constructs a new MsgUndelegateResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.staking.v1beta1.IMsgUndelegateResponse); - - /** MsgUndelegateResponse completionTime. */ - public completionTime?: google.protobuf.ITimestamp | null; - - /** - * Creates a new MsgUndelegateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgUndelegateResponse instance - */ - public static create( - properties?: cosmos.staking.v1beta1.IMsgUndelegateResponse, - ): cosmos.staking.v1beta1.MsgUndelegateResponse; - - /** - * Encodes the specified MsgUndelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages. - * @param m MsgUndelegateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.staking.v1beta1.IMsgUndelegateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgUndelegateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgUndelegateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.staking.v1beta1.MsgUndelegateResponse; - } - } - } - - /** Namespace tx. */ - namespace tx { - /** Namespace signing. */ - namespace signing { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** SignMode enum. */ - enum SignMode { - SIGN_MODE_UNSPECIFIED = 0, - SIGN_MODE_DIRECT = 1, - SIGN_MODE_TEXTUAL = 2, - SIGN_MODE_LEGACY_AMINO_JSON = 127, - } - - /** Properties of a SignatureDescriptors. */ - interface ISignatureDescriptors { - /** SignatureDescriptors signatures */ - signatures?: cosmos.tx.signing.v1beta1.ISignatureDescriptor[] | null; - } - - /** Represents a SignatureDescriptors. */ - class SignatureDescriptors implements ISignatureDescriptors { - /** - * Constructs a new SignatureDescriptors. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptors); - - /** SignatureDescriptors signatures. */ - public signatures: cosmos.tx.signing.v1beta1.ISignatureDescriptor[]; - - /** - * Creates a new SignatureDescriptors instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptors instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - - /** - * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. - * @param m SignatureDescriptors message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptors message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptors - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - } - - /** Properties of a SignatureDescriptor. */ - interface ISignatureDescriptor { - /** SignatureDescriptor publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data */ - data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence */ - sequence?: Long | null; - } - - /** Represents a SignatureDescriptor. */ - class SignatureDescriptor implements ISignatureDescriptor { - /** - * Constructs a new SignatureDescriptor. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptor); - - /** SignatureDescriptor publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data. */ - public data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence. */ - public sequence: Long; - - /** - * Creates a new SignatureDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptor instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - - /** - * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. - * @param m SignatureDescriptor message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptor message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - } - - namespace SignatureDescriptor { - /** Properties of a Data. */ - interface IData { - /** Data single */ - single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi */ - multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - } - - /** Represents a Data. */ - class Data implements IData { - /** - * Constructs a new Data. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData); - - /** Data single. */ - public single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi. */ - public multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - - /** Data sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new Data instance using the specified properties. - * @param [properties] Properties to set - * @returns Data instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - - /** - * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. - * @param m Data message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - } - - namespace Data { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - - /** Single signature */ - signature?: Uint8Array | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** Single signature. */ - public signature: Uint8Array; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures */ - signatures?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures. */ - public signatures: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - } - } - } - } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Tx. */ - interface ITx { - /** Tx body */ - body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo */ - authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a Tx. */ - class Tx implements ITx { - /** - * Constructs a new Tx. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITx); - - /** Tx body. */ - public body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo. */ - public authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITx): cosmos.tx.v1beta1.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. - * @param m Tx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Tx; - } - - /** Properties of a TxRaw. */ - interface ITxRaw { - /** TxRaw bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** TxRaw authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** TxRaw signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a TxRaw. */ - class TxRaw implements ITxRaw { - /** - * Constructs a new TxRaw. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxRaw); - - /** TxRaw bodyBytes. */ - public bodyBytes: Uint8Array; - - /** TxRaw authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** TxRaw signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new TxRaw instance using the specified properties. - * @param [properties] Properties to set - * @returns TxRaw instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxRaw): cosmos.tx.v1beta1.TxRaw; - - /** - * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. - * @param m TxRaw message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxRaw, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxRaw message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxRaw - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxRaw; - } - - /** Properties of a SignDoc. */ - interface ISignDoc { - /** SignDoc bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** SignDoc authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** SignDoc chainId */ - chainId?: string | null; - - /** SignDoc accountNumber */ - accountNumber?: Long | null; - } - - /** Represents a SignDoc. */ - class SignDoc implements ISignDoc { - /** - * Constructs a new SignDoc. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignDoc); - - /** SignDoc bodyBytes. */ - public bodyBytes: Uint8Array; - - /** SignDoc authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** SignDoc chainId. */ - public chainId: string; - - /** SignDoc accountNumber. */ - public accountNumber: Long; - - /** - * Creates a new SignDoc instance using the specified properties. - * @param [properties] Properties to set - * @returns SignDoc instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignDoc): cosmos.tx.v1beta1.SignDoc; - - /** - * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. - * @param m SignDoc message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignDoc, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignDoc message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignDoc - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignDoc; - } - - /** Properties of a TxBody. */ - interface ITxBody { - /** TxBody messages */ - messages?: google.protobuf.IAny[] | null; - - /** TxBody memo */ - memo?: string | null; - - /** TxBody timeoutHeight */ - timeoutHeight?: Long | null; - - /** TxBody extensionOptions */ - extensionOptions?: google.protobuf.IAny[] | null; - - /** TxBody nonCriticalExtensionOptions */ - nonCriticalExtensionOptions?: google.protobuf.IAny[] | null; - } - - /** Represents a TxBody. */ - class TxBody implements ITxBody { - /** - * Constructs a new TxBody. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxBody); - - /** TxBody messages. */ - public messages: google.protobuf.IAny[]; - - /** TxBody memo. */ - public memo: string; - - /** TxBody timeoutHeight. */ - public timeoutHeight: Long; - - /** TxBody extensionOptions. */ - public extensionOptions: google.protobuf.IAny[]; - - /** TxBody nonCriticalExtensionOptions. */ - public nonCriticalExtensionOptions: google.protobuf.IAny[]; - - /** - * Creates a new TxBody instance using the specified properties. - * @param [properties] Properties to set - * @returns TxBody instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxBody): cosmos.tx.v1beta1.TxBody; - - /** - * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. - * @param m TxBody message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxBody, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxBody message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxBody - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxBody; - } - - /** Properties of an AuthInfo. */ - interface IAuthInfo { - /** AuthInfo signerInfos */ - signerInfos?: cosmos.tx.v1beta1.ISignerInfo[] | null; - - /** AuthInfo fee */ - fee?: cosmos.tx.v1beta1.IFee | null; - } - - /** Represents an AuthInfo. */ - class AuthInfo implements IAuthInfo { - /** - * Constructs a new AuthInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IAuthInfo); - - /** AuthInfo signerInfos. */ - public signerInfos: cosmos.tx.v1beta1.ISignerInfo[]; - - /** AuthInfo fee. */ - public fee?: cosmos.tx.v1beta1.IFee | null; - - /** - * Creates a new AuthInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IAuthInfo): cosmos.tx.v1beta1.AuthInfo; - - /** - * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. - * @param m AuthInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IAuthInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns AuthInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.AuthInfo; - } - - /** Properties of a SignerInfo. */ - interface ISignerInfo { - /** SignerInfo publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo */ - modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence */ - sequence?: Long | null; - } - - /** Represents a SignerInfo. */ - class SignerInfo implements ISignerInfo { - /** - * Constructs a new SignerInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignerInfo); - - /** SignerInfo publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo. */ - public modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence. */ - public sequence: Long; - - /** - * Creates a new SignerInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SignerInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignerInfo): cosmos.tx.v1beta1.SignerInfo; - - /** - * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. - * @param m SignerInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignerInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignerInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignerInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignerInfo; - } - - /** Properties of a ModeInfo. */ - interface IModeInfo { - /** ModeInfo single */ - single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi */ - multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - } - - /** Represents a ModeInfo. */ - class ModeInfo implements IModeInfo { - /** - * Constructs a new ModeInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IModeInfo); - - /** ModeInfo single. */ - public single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi. */ - public multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - - /** ModeInfo sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new ModeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ModeInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IModeInfo): cosmos.tx.v1beta1.ModeInfo; - - /** - * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. - * @param m ModeInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IModeInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModeInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ModeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.ModeInfo; - } - - namespace ModeInfo { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.ISingle, - ): cosmos.tx.v1beta1.ModeInfo.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.ISingle, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos */ - modeInfos?: cosmos.tx.v1beta1.IModeInfo[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos. */ - public modeInfos: cosmos.tx.v1beta1.IModeInfo[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.IMulti, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.IMulti, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - } - } - - /** Properties of a Fee. */ - interface IFee { - /** Fee amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - - /** Fee gasLimit */ - gasLimit?: Long | null; - - /** Fee payer */ - payer?: string | null; - - /** Fee granter */ - granter?: string | null; - } - - /** Represents a Fee. */ - class Fee implements IFee { - /** - * Constructs a new Fee. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IFee); - - /** Fee amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** Fee gasLimit. */ - public gasLimit: Long; - - /** Fee payer. */ - public payer: string; - - /** Fee granter. */ - public granter: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: cosmos.tx.v1beta1.IFee): cosmos.tx.v1beta1.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. - * @param m Fee message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IFee, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Fee; - } - } - } -} - -/** Namespace google. */ -export namespace google { - /** Namespace protobuf. */ - namespace protobuf { - /** Properties of an Any. */ - interface IAny { - /** Any type_url */ - type_url?: string | null; - - /** Any value */ - value?: Uint8Array | null; - } - - /** Represents an Any. */ - class Any implements IAny { - /** - * Constructs a new Any. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param m Any message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IAny, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.Any; - } - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - /** FileDescriptorSet file */ - file?: google.protobuf.IFileDescriptorProto[] | null; - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - /** - * Constructs a new FileDescriptorSet. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create( - properties?: google.protobuf.IFileDescriptorSet, - ): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param m FileDescriptorSet message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IFileDescriptorSet, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.FileDescriptorSet; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - /** FileDescriptorProto name */ - name?: string | null; - - /** FileDescriptorProto package */ - package?: string | null; - - /** FileDescriptorProto dependency */ - dependency?: string[] | null; - - /** FileDescriptorProto publicDependency */ - publicDependency?: number[] | null; - - /** FileDescriptorProto weakDependency */ - weakDependency?: number[] | null; - - /** FileDescriptorProto messageType */ - messageType?: google.protobuf.IDescriptorProto[] | null; - - /** FileDescriptorProto enumType */ - enumType?: google.protobuf.IEnumDescriptorProto[] | null; - - /** FileDescriptorProto service */ - service?: google.protobuf.IServiceDescriptorProto[] | null; - - /** FileDescriptorProto extension */ - extension?: google.protobuf.IFieldDescriptorProto[] | null; - - /** FileDescriptorProto options */ - options?: google.protobuf.IFileOptions | null; - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: google.protobuf.ISourceCodeInfo | null; - - /** FileDescriptorProto syntax */ - syntax?: string | null; - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - /** - * Constructs a new FileDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: google.protobuf.IFileOptions | null; - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: google.protobuf.ISourceCodeInfo | null; - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IFileDescriptorProto, - ): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param m FileDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IFileDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.FileDescriptorProto; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - /** DescriptorProto name */ - name?: string | null; - - /** DescriptorProto field */ - field?: google.protobuf.IFieldDescriptorProto[] | null; - - /** DescriptorProto extension */ - extension?: google.protobuf.IFieldDescriptorProto[] | null; - - /** DescriptorProto nestedType */ - nestedType?: google.protobuf.IDescriptorProto[] | null; - - /** DescriptorProto enumType */ - enumType?: google.protobuf.IEnumDescriptorProto[] | null; - - /** DescriptorProto extensionRange */ - extensionRange?: google.protobuf.DescriptorProto.IExtensionRange[] | null; - - /** DescriptorProto oneofDecl */ - oneofDecl?: google.protobuf.IOneofDescriptorProto[] | null; - - /** DescriptorProto options */ - options?: google.protobuf.IMessageOptions | null; - - /** DescriptorProto reservedRange */ - reservedRange?: google.protobuf.DescriptorProto.IReservedRange[] | null; - - /** DescriptorProto reservedName */ - reservedName?: string[] | null; - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - /** - * Constructs a new DescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: google.protobuf.IMessageOptions | null; - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param m DescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.DescriptorProto; - } - - namespace DescriptorProto { - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - /** ExtensionRange start */ - start?: number | null; - - /** ExtensionRange end */ - end?: number | null; - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - /** - * Constructs a new ExtensionRange. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create( - properties?: google.protobuf.DescriptorProto.IExtensionRange, - ): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param m ExtensionRange message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.DescriptorProto.IExtensionRange, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.DescriptorProto.ExtensionRange; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - /** ReservedRange start */ - start?: number | null; - - /** ReservedRange end */ - end?: number | null; - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - /** - * Constructs a new ReservedRange. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create( - properties?: google.protobuf.DescriptorProto.IReservedRange, - ): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param m ReservedRange message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.DescriptorProto.IReservedRange, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.DescriptorProto.ReservedRange; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - /** FieldDescriptorProto name */ - name?: string | null; - - /** FieldDescriptorProto number */ - number?: number | null; - - /** FieldDescriptorProto label */ - label?: google.protobuf.FieldDescriptorProto.Label | null; - - /** FieldDescriptorProto type */ - type?: google.protobuf.FieldDescriptorProto.Type | null; - - /** FieldDescriptorProto typeName */ - typeName?: string | null; - - /** FieldDescriptorProto extendee */ - extendee?: string | null; - - /** FieldDescriptorProto defaultValue */ - defaultValue?: string | null; - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: number | null; - - /** FieldDescriptorProto jsonName */ - jsonName?: string | null; - - /** FieldDescriptorProto options */ - options?: google.protobuf.IFieldOptions | null; - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - /** - * Constructs a new FieldDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: google.protobuf.IFieldOptions | null; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IFieldDescriptorProto, - ): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param m FieldDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IFieldDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.FieldDescriptorProto; - } - - namespace FieldDescriptorProto { - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18, - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - /** OneofDescriptorProto name */ - name?: string | null; - - /** OneofDescriptorProto options */ - options?: google.protobuf.IOneofOptions | null; - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - /** - * Constructs a new OneofDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: google.protobuf.IOneofOptions | null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IOneofDescriptorProto, - ): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param m OneofDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IOneofDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.OneofDescriptorProto; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - /** EnumDescriptorProto name */ - name?: string | null; - - /** EnumDescriptorProto value */ - value?: google.protobuf.IEnumValueDescriptorProto[] | null; - - /** EnumDescriptorProto options */ - options?: google.protobuf.IEnumOptions | null; - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - /** - * Constructs a new EnumDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: google.protobuf.IEnumOptions | null; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IEnumDescriptorProto, - ): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param m EnumDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IEnumDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.EnumDescriptorProto; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - /** EnumValueDescriptorProto name */ - name?: string | null; - - /** EnumValueDescriptorProto number */ - number?: number | null; - - /** EnumValueDescriptorProto options */ - options?: google.protobuf.IEnumValueOptions | null; - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - /** - * Constructs a new EnumValueDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: google.protobuf.IEnumValueOptions | null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IEnumValueDescriptorProto, - ): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param m EnumValueDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.IEnumValueDescriptorProto, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.EnumValueDescriptorProto; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - /** ServiceDescriptorProto name */ - name?: string | null; - - /** ServiceDescriptorProto method */ - method?: google.protobuf.IMethodDescriptorProto[] | null; - - /** ServiceDescriptorProto options */ - options?: google.protobuf.IServiceOptions | null; - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - /** - * Constructs a new ServiceDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: google.protobuf.IServiceOptions | null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IServiceDescriptorProto, - ): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param m ServiceDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.IServiceDescriptorProto, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.ServiceDescriptorProto; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - /** MethodDescriptorProto name */ - name?: string | null; - - /** MethodDescriptorProto inputType */ - inputType?: string | null; - - /** MethodDescriptorProto outputType */ - outputType?: string | null; - - /** MethodDescriptorProto options */ - options?: google.protobuf.IMethodOptions | null; - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: boolean | null; - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: boolean | null; - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - /** - * Constructs a new MethodDescriptorProto. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: google.protobuf.IMethodOptions | null; - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create( - properties?: google.protobuf.IMethodDescriptorProto, - ): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param m MethodDescriptorProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IMethodDescriptorProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.MethodDescriptorProto; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - /** FileOptions javaPackage */ - javaPackage?: string | null; - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: string | null; - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: boolean | null; - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: boolean | null; - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: boolean | null; - - /** FileOptions optimizeFor */ - optimizeFor?: google.protobuf.FileOptions.OptimizeMode | null; - - /** FileOptions goPackage */ - goPackage?: string | null; - - /** FileOptions ccGenericServices */ - ccGenericServices?: boolean | null; - - /** FileOptions javaGenericServices */ - javaGenericServices?: boolean | null; - - /** FileOptions pyGenericServices */ - pyGenericServices?: boolean | null; - - /** FileOptions deprecated */ - deprecated?: boolean | null; - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: boolean | null; - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: string | null; - - /** FileOptions csharpNamespace */ - csharpNamespace?: string | null; - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - /** - * Constructs a new FileOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param m FileOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IFileOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.FileOptions; - } - - namespace FileOptions { - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3, - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: boolean | null; - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: boolean | null; - - /** MessageOptions deprecated */ - deprecated?: boolean | null; - - /** MessageOptions mapEntry */ - mapEntry?: boolean | null; - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - /** - * Constructs a new MessageOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param m MessageOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IMessageOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.MessageOptions; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - /** FieldOptions ctype */ - ctype?: google.protobuf.FieldOptions.CType | null; - - /** FieldOptions packed */ - packed?: boolean | null; - - /** FieldOptions jstype */ - jstype?: google.protobuf.FieldOptions.JSType | null; - - /** FieldOptions lazy */ - lazy?: boolean | null; - - /** FieldOptions deprecated */ - deprecated?: boolean | null; - - /** FieldOptions weak */ - weak?: boolean | null; - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - /** - * Constructs a new FieldOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param m FieldOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IFieldOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.FieldOptions; - } - - namespace FieldOptions { - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2, - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - /** - * Constructs a new OneofOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param m OneofOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IOneofOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.OneofOptions; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - /** EnumOptions allowAlias */ - allowAlias?: boolean | null; - - /** EnumOptions deprecated */ - deprecated?: boolean | null; - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - /** - * Constructs a new EnumOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param m EnumOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IEnumOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.EnumOptions; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - /** EnumValueOptions deprecated */ - deprecated?: boolean | null; - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - /** - * Constructs a new EnumValueOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param m EnumValueOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IEnumValueOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.EnumValueOptions; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - /** ServiceOptions deprecated */ - deprecated?: boolean | null; - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - /** - * Constructs a new ServiceOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param m ServiceOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IServiceOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.ServiceOptions; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - /** MethodOptions deprecated */ - deprecated?: boolean | null; - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: google.protobuf.IUninterpretedOption[] | null; - - /** MethodOptions .google.api.http */ - ".google.api.http"?: google.api.IHttpRule | null; - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - /** - * Constructs a new MethodOptions. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param m MethodOptions message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IMethodOptions, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.MethodOptions; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - /** UninterpretedOption name */ - name?: google.protobuf.UninterpretedOption.INamePart[] | null; - - /** UninterpretedOption identifierValue */ - identifierValue?: string | null; - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: Long | null; - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: Long | null; - - /** UninterpretedOption doubleValue */ - doubleValue?: number | null; - - /** UninterpretedOption stringValue */ - stringValue?: Uint8Array | null; - - /** UninterpretedOption aggregateValue */ - aggregateValue?: string | null; - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - /** - * Constructs a new UninterpretedOption. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: Long; - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: Long; - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create( - properties?: google.protobuf.IUninterpretedOption, - ): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param m UninterpretedOption message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IUninterpretedOption, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.UninterpretedOption; - } - - namespace UninterpretedOption { - /** Properties of a NamePart. */ - interface INamePart { - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - /** - * Constructs a new NamePart. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create( - properties?: google.protobuf.UninterpretedOption.INamePart, - ): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param m NamePart message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.UninterpretedOption.INamePart, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.UninterpretedOption.NamePart; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - /** SourceCodeInfo location */ - location?: google.protobuf.SourceCodeInfo.ILocation[] | null; - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - /** - * Constructs a new SourceCodeInfo. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param m SourceCodeInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.ISourceCodeInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.SourceCodeInfo; - } - - namespace SourceCodeInfo { - /** Properties of a Location. */ - interface ILocation { - /** Location path */ - path?: number[] | null; - - /** Location span */ - span?: number[] | null; - - /** Location leadingComments */ - leadingComments?: string | null; - - /** Location trailingComments */ - trailingComments?: string | null; - - /** Location leadingDetachedComments */ - leadingDetachedComments?: string[] | null; - } - - /** Represents a Location. */ - class Location implements ILocation { - /** - * Constructs a new Location. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create( - properties?: google.protobuf.SourceCodeInfo.ILocation, - ): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param m Location message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.SourceCodeInfo.ILocation, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.SourceCodeInfo.Location; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - /** GeneratedCodeInfo annotation */ - annotation?: google.protobuf.GeneratedCodeInfo.IAnnotation[] | null; - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - /** - * Constructs a new GeneratedCodeInfo. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create( - properties?: google.protobuf.IGeneratedCodeInfo, - ): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param m GeneratedCodeInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IGeneratedCodeInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.GeneratedCodeInfo; - } - - namespace GeneratedCodeInfo { - /** Properties of an Annotation. */ - interface IAnnotation { - /** Annotation path */ - path?: number[] | null; - - /** Annotation sourceFile */ - sourceFile?: string | null; - - /** Annotation begin */ - begin?: number | null; - - /** Annotation end */ - end?: number | null; - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - /** - * Constructs a new Annotation. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create( - properties?: google.protobuf.GeneratedCodeInfo.IAnnotation, - ): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param m Annotation message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: google.protobuf.GeneratedCodeInfo.IAnnotation, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): google.protobuf.GeneratedCodeInfo.Annotation; - } - } - - /** Properties of a Duration. */ - interface IDuration { - /** Duration seconds */ - seconds?: Long | null; - - /** Duration nanos */ - nanos?: number | null; - } - - /** Represents a Duration. */ - class Duration implements IDuration { - /** - * Constructs a new Duration. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: Long; - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param m Duration message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IDuration, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.Duration; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - /** Timestamp seconds */ - seconds?: Long | null; - - /** Timestamp nanos */ - nanos?: number | null; - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - /** - * Constructs a new Timestamp. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: Long; - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param m Timestamp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.Timestamp; - } - } - - /** Namespace api. */ - namespace api { - /** Properties of a Http. */ - interface IHttp { - /** Http rules */ - rules?: google.api.IHttpRule[] | null; - } - - /** Represents a Http. */ - class Http implements IHttp { - /** - * Constructs a new Http. - * @param [p] Properties to set - */ - constructor(p?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param m Http message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.api.IHttp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.api.Http; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - /** HttpRule get */ - get?: string | null; - - /** HttpRule put */ - put?: string | null; - - /** HttpRule post */ - post?: string | null; - - /** HttpRule delete */ - delete?: string | null; - - /** HttpRule patch */ - patch?: string | null; - - /** HttpRule custom */ - custom?: google.api.ICustomHttpPattern | null; - - /** HttpRule selector */ - selector?: string | null; - - /** HttpRule body */ - body?: string | null; - - /** HttpRule additionalBindings */ - additionalBindings?: google.api.IHttpRule[] | null; - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - /** - * Constructs a new HttpRule. - * @param [p] Properties to set - */ - constructor(p?: google.api.IHttpRule); - - /** HttpRule get. */ - public get: string; - - /** HttpRule put. */ - public put: string; - - /** HttpRule post. */ - public post: string; - - /** HttpRule delete. */ - public delete: string; - - /** HttpRule patch. */ - public patch: string; - - /** HttpRule custom. */ - public custom?: google.api.ICustomHttpPattern | null; - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule body. */ - public body: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: "get" | "put" | "post" | "delete" | "patch" | "custom"; - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param m HttpRule message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.api.IHttpRule, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.api.HttpRule; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - /** CustomHttpPattern kind */ - kind?: string | null; - - /** CustomHttpPattern path */ - path?: string | null; - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - /** - * Constructs a new CustomHttpPattern. - * @param [p] Properties to set - */ - constructor(p?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param m CustomHttpPattern message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.api.ICustomHttpPattern, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.api.CustomHttpPattern; - } - } -} - -/** Namespace ibc. */ -export namespace ibc { - /** Namespace core. */ - namespace core { - /** Namespace channel. */ - namespace channel { - /** Namespace v1. */ - namespace v1 { - /** Properties of a Channel. */ - interface IChannel { - /** Channel state */ - state?: ibc.core.channel.v1.State | null; - - /** Channel ordering */ - ordering?: ibc.core.channel.v1.Order | null; - - /** Channel counterparty */ - counterparty?: ibc.core.channel.v1.ICounterparty | null; - - /** Channel connectionHops */ - connectionHops?: string[] | null; - - /** Channel version */ - version?: string | null; - } - - /** Represents a Channel. */ - class Channel implements IChannel { - /** - * Constructs a new Channel. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IChannel); - - /** Channel state. */ - public state: ibc.core.channel.v1.State; - - /** Channel ordering. */ - public ordering: ibc.core.channel.v1.Order; - - /** Channel counterparty. */ - public counterparty?: ibc.core.channel.v1.ICounterparty | null; - - /** Channel connectionHops. */ - public connectionHops: string[]; - - /** Channel version. */ - public version: string; - - /** - * Creates a new Channel instance using the specified properties. - * @param [properties] Properties to set - * @returns Channel instance - */ - public static create(properties?: ibc.core.channel.v1.IChannel): ibc.core.channel.v1.Channel; - - /** - * Encodes the specified Channel message. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @param m Channel message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.channel.v1.IChannel, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.channel.v1.Channel; - } - - /** Properties of an IdentifiedChannel. */ - interface IIdentifiedChannel { - /** IdentifiedChannel state */ - state?: ibc.core.channel.v1.State | null; - - /** IdentifiedChannel ordering */ - ordering?: ibc.core.channel.v1.Order | null; - - /** IdentifiedChannel counterparty */ - counterparty?: ibc.core.channel.v1.ICounterparty | null; - - /** IdentifiedChannel connectionHops */ - connectionHops?: string[] | null; - - /** IdentifiedChannel version */ - version?: string | null; - - /** IdentifiedChannel portId */ - portId?: string | null; - - /** IdentifiedChannel channelId */ - channelId?: string | null; - } - - /** Represents an IdentifiedChannel. */ - class IdentifiedChannel implements IIdentifiedChannel { - /** - * Constructs a new IdentifiedChannel. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IIdentifiedChannel); - - /** IdentifiedChannel state. */ - public state: ibc.core.channel.v1.State; - - /** IdentifiedChannel ordering. */ - public ordering: ibc.core.channel.v1.Order; - - /** IdentifiedChannel counterparty. */ - public counterparty?: ibc.core.channel.v1.ICounterparty | null; - - /** IdentifiedChannel connectionHops. */ - public connectionHops: string[]; - - /** IdentifiedChannel version. */ - public version: string; - - /** IdentifiedChannel portId. */ - public portId: string; - - /** IdentifiedChannel channelId. */ - public channelId: string; - - /** - * Creates a new IdentifiedChannel instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentifiedChannel instance - */ - public static create( - properties?: ibc.core.channel.v1.IIdentifiedChannel, - ): ibc.core.channel.v1.IdentifiedChannel; - - /** - * Encodes the specified IdentifiedChannel message. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @param m IdentifiedChannel message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IIdentifiedChannel, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.IdentifiedChannel; - } - - /** State enum. */ - enum State { - STATE_UNINITIALIZED_UNSPECIFIED = 0, - STATE_INIT = 1, - STATE_TRYOPEN = 2, - STATE_OPEN = 3, - STATE_CLOSED = 4, - } - - /** Order enum. */ - enum Order { - ORDER_NONE_UNSPECIFIED = 0, - ORDER_UNORDERED = 1, - ORDER_ORDERED = 2, - } - - /** Properties of a Counterparty. */ - interface ICounterparty { - /** Counterparty portId */ - portId?: string | null; - - /** Counterparty channelId */ - channelId?: string | null; - } - - /** Represents a Counterparty. */ - class Counterparty implements ICounterparty { - /** - * Constructs a new Counterparty. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.ICounterparty); - - /** Counterparty portId. */ - public portId: string; - - /** Counterparty channelId. */ - public channelId: string; - - /** - * Creates a new Counterparty instance using the specified properties. - * @param [properties] Properties to set - * @returns Counterparty instance - */ - public static create( - properties?: ibc.core.channel.v1.ICounterparty, - ): ibc.core.channel.v1.Counterparty; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @param m Counterparty message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.channel.v1.ICounterparty, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.Counterparty; - } - - /** Properties of a Packet. */ - interface IPacket { - /** Packet sequence */ - sequence?: Long | null; - - /** Packet sourcePort */ - sourcePort?: string | null; - - /** Packet sourceChannel */ - sourceChannel?: string | null; - - /** Packet destinationPort */ - destinationPort?: string | null; - - /** Packet destinationChannel */ - destinationChannel?: string | null; - - /** Packet data */ - data?: Uint8Array | null; - - /** Packet timeoutHeight */ - timeoutHeight?: ibc.core.client.v1.IHeight | null; - - /** Packet timeoutTimestamp */ - timeoutTimestamp?: Long | null; - } - - /** Represents a Packet. */ - class Packet implements IPacket { - /** - * Constructs a new Packet. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IPacket); - - /** Packet sequence. */ - public sequence: Long; - - /** Packet sourcePort. */ - public sourcePort: string; - - /** Packet sourceChannel. */ - public sourceChannel: string; - - /** Packet destinationPort. */ - public destinationPort: string; - - /** Packet destinationChannel. */ - public destinationChannel: string; - - /** Packet data. */ - public data: Uint8Array; - - /** Packet timeoutHeight. */ - public timeoutHeight?: ibc.core.client.v1.IHeight | null; - - /** Packet timeoutTimestamp. */ - public timeoutTimestamp: Long; - - /** - * Creates a new Packet instance using the specified properties. - * @param [properties] Properties to set - * @returns Packet instance - */ - public static create(properties?: ibc.core.channel.v1.IPacket): ibc.core.channel.v1.Packet; - - /** - * Encodes the specified Packet message. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @param m Packet message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.channel.v1.IPacket, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Packet message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.channel.v1.Packet; - } - - /** Properties of a PacketState. */ - interface IPacketState { - /** PacketState portId */ - portId?: string | null; - - /** PacketState channelId */ - channelId?: string | null; - - /** PacketState sequence */ - sequence?: Long | null; - - /** PacketState data */ - data?: Uint8Array | null; - } - - /** Represents a PacketState. */ - class PacketState implements IPacketState { - /** - * Constructs a new PacketState. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IPacketState); - - /** PacketState portId. */ - public portId: string; - - /** PacketState channelId. */ - public channelId: string; - - /** PacketState sequence. */ - public sequence: Long; - - /** PacketState data. */ - public data: Uint8Array; - - /** - * Creates a new PacketState instance using the specified properties. - * @param [properties] Properties to set - * @returns PacketState instance - */ - public static create( - properties?: ibc.core.channel.v1.IPacketState, - ): ibc.core.channel.v1.PacketState; - - /** - * Encodes the specified PacketState message. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @param m PacketState message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.channel.v1.IPacketState, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketState message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.channel.v1.PacketState; - } - - /** Properties of an Acknowledgement. */ - interface IAcknowledgement { - /** Acknowledgement result */ - result?: Uint8Array | null; - - /** Acknowledgement error */ - error?: string | null; - } - - /** Represents an Acknowledgement. */ - class Acknowledgement implements IAcknowledgement { - /** - * Constructs a new Acknowledgement. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IAcknowledgement); - - /** Acknowledgement result. */ - public result: Uint8Array; - - /** Acknowledgement error. */ - public error: string; - - /** Acknowledgement response. */ - public response?: "result" | "error"; - - /** - * Creates a new Acknowledgement instance using the specified properties. - * @param [properties] Properties to set - * @returns Acknowledgement instance - */ - public static create( - properties?: ibc.core.channel.v1.IAcknowledgement, - ): ibc.core.channel.v1.Acknowledgement; - - /** - * Encodes the specified Acknowledgement message. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @param m Acknowledgement message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IAcknowledgement, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.Acknowledgement; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Channel. - * @param request QueryChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelResponse - */ - public channel( - request: ibc.core.channel.v1.IQueryChannelRequest, - callback: ibc.core.channel.v1.Query.ChannelCallback, - ): void; - - /** - * Calls Channel. - * @param request QueryChannelRequest message or plain object - * @returns Promise - */ - public channel( - request: ibc.core.channel.v1.IQueryChannelRequest, - ): Promise; - - /** - * Calls Channels. - * @param request QueryChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelsResponse - */ - public channels( - request: ibc.core.channel.v1.IQueryChannelsRequest, - callback: ibc.core.channel.v1.Query.ChannelsCallback, - ): void; - - /** - * Calls Channels. - * @param request QueryChannelsRequest message or plain object - * @returns Promise - */ - public channels( - request: ibc.core.channel.v1.IQueryChannelsRequest, - ): Promise; - - /** - * Calls ConnectionChannels. - * @param request QueryConnectionChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionChannelsResponse - */ - public connectionChannels( - request: ibc.core.channel.v1.IQueryConnectionChannelsRequest, - callback: ibc.core.channel.v1.Query.ConnectionChannelsCallback, - ): void; - - /** - * Calls ConnectionChannels. - * @param request QueryConnectionChannelsRequest message or plain object - * @returns Promise - */ - public connectionChannels( - request: ibc.core.channel.v1.IQueryConnectionChannelsRequest, - ): Promise; - - /** - * Calls ChannelClientState. - * @param request QueryChannelClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelClientStateResponse - */ - public channelClientState( - request: ibc.core.channel.v1.IQueryChannelClientStateRequest, - callback: ibc.core.channel.v1.Query.ChannelClientStateCallback, - ): void; - - /** - * Calls ChannelClientState. - * @param request QueryChannelClientStateRequest message or plain object - * @returns Promise - */ - public channelClientState( - request: ibc.core.channel.v1.IQueryChannelClientStateRequest, - ): Promise; - - /** - * Calls ChannelConsensusState. - * @param request QueryChannelConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelConsensusStateResponse - */ - public channelConsensusState( - request: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, - callback: ibc.core.channel.v1.Query.ChannelConsensusStateCallback, - ): void; - - /** - * Calls ChannelConsensusState. - * @param request QueryChannelConsensusStateRequest message or plain object - * @returns Promise - */ - public channelConsensusState( - request: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, - ): Promise; - - /** - * Calls PacketCommitment. - * @param request QueryPacketCommitmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketCommitmentResponse - */ - public packetCommitment( - request: ibc.core.channel.v1.IQueryPacketCommitmentRequest, - callback: ibc.core.channel.v1.Query.PacketCommitmentCallback, - ): void; - - /** - * Calls PacketCommitment. - * @param request QueryPacketCommitmentRequest message or plain object - * @returns Promise - */ - public packetCommitment( - request: ibc.core.channel.v1.IQueryPacketCommitmentRequest, - ): Promise; - - /** - * Calls PacketCommitments. - * @param request QueryPacketCommitmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketCommitmentsResponse - */ - public packetCommitments( - request: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, - callback: ibc.core.channel.v1.Query.PacketCommitmentsCallback, - ): void; - - /** - * Calls PacketCommitments. - * @param request QueryPacketCommitmentsRequest message or plain object - * @returns Promise - */ - public packetCommitments( - request: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, - ): Promise; - - /** - * Calls PacketReceipt. - * @param request QueryPacketReceiptRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketReceiptResponse - */ - public packetReceipt( - request: ibc.core.channel.v1.IQueryPacketReceiptRequest, - callback: ibc.core.channel.v1.Query.PacketReceiptCallback, - ): void; - - /** - * Calls PacketReceipt. - * @param request QueryPacketReceiptRequest message or plain object - * @returns Promise - */ - public packetReceipt( - request: ibc.core.channel.v1.IQueryPacketReceiptRequest, - ): Promise; - - /** - * Calls PacketAcknowledgement. - * @param request QueryPacketAcknowledgementRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementResponse - */ - public packetAcknowledgement( - request: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, - callback: ibc.core.channel.v1.Query.PacketAcknowledgementCallback, - ): void; - - /** - * Calls PacketAcknowledgement. - * @param request QueryPacketAcknowledgementRequest message or plain object - * @returns Promise - */ - public packetAcknowledgement( - request: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, - ): Promise; - - /** - * Calls PacketAcknowledgements. - * @param request QueryPacketAcknowledgementsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementsResponse - */ - public packetAcknowledgements( - request: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, - callback: ibc.core.channel.v1.Query.PacketAcknowledgementsCallback, - ): void; - - /** - * Calls PacketAcknowledgements. - * @param request QueryPacketAcknowledgementsRequest message or plain object - * @returns Promise - */ - public packetAcknowledgements( - request: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, - ): Promise; - - /** - * Calls UnreceivedPackets. - * @param request QueryUnreceivedPacketsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUnreceivedPacketsResponse - */ - public unreceivedPackets( - request: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, - callback: ibc.core.channel.v1.Query.UnreceivedPacketsCallback, - ): void; - - /** - * Calls UnreceivedPackets. - * @param request QueryUnreceivedPacketsRequest message or plain object - * @returns Promise - */ - public unreceivedPackets( - request: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, - ): Promise; - - /** - * Calls UnreceivedAcks. - * @param request QueryUnreceivedAcksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUnreceivedAcksResponse - */ - public unreceivedAcks( - request: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, - callback: ibc.core.channel.v1.Query.UnreceivedAcksCallback, - ): void; - - /** - * Calls UnreceivedAcks. - * @param request QueryUnreceivedAcksRequest message or plain object - * @returns Promise - */ - public unreceivedAcks( - request: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, - ): Promise; - - /** - * Calls NextSequenceReceive. - * @param request QueryNextSequenceReceiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryNextSequenceReceiveResponse - */ - public nextSequenceReceive( - request: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, - callback: ibc.core.channel.v1.Query.NextSequenceReceiveCallback, - ): void; - - /** - * Calls NextSequenceReceive. - * @param request QueryNextSequenceReceiveRequest message or plain object - * @returns Promise - */ - public nextSequenceReceive( - request: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channel}. - * @param error Error, if any - * @param [response] QueryChannelResponse - */ - type ChannelCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryChannelResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channels}. - * @param error Error, if any - * @param [response] QueryChannelsResponse - */ - type ChannelsCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryChannelsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#connectionChannels}. - * @param error Error, if any - * @param [response] QueryConnectionChannelsResponse - */ - type ConnectionChannelsCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryConnectionChannelsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelClientState}. - * @param error Error, if any - * @param [response] QueryChannelClientStateResponse - */ - type ChannelClientStateCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryChannelClientStateResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelConsensusState}. - * @param error Error, if any - * @param [response] QueryChannelConsensusStateResponse - */ - type ChannelConsensusStateCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryChannelConsensusStateResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitment}. - * @param error Error, if any - * @param [response] QueryPacketCommitmentResponse - */ - type PacketCommitmentCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryPacketCommitmentResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitments}. - * @param error Error, if any - * @param [response] QueryPacketCommitmentsResponse - */ - type PacketCommitmentsCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryPacketCommitmentsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetReceipt}. - * @param error Error, if any - * @param [response] QueryPacketReceiptResponse - */ - type PacketReceiptCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryPacketReceiptResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgement}. - * @param error Error, if any - * @param [response] QueryPacketAcknowledgementResponse - */ - type PacketAcknowledgementCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryPacketAcknowledgementResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgements}. - * @param error Error, if any - * @param [response] QueryPacketAcknowledgementsResponse - */ - type PacketAcknowledgementsCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedPackets}. - * @param error Error, if any - * @param [response] QueryUnreceivedPacketsResponse - */ - type UnreceivedPacketsCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryUnreceivedPacketsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedAcks}. - * @param error Error, if any - * @param [response] QueryUnreceivedAcksResponse - */ - type UnreceivedAcksCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryUnreceivedAcksResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#nextSequenceReceive}. - * @param error Error, if any - * @param [response] QueryNextSequenceReceiveResponse - */ - type NextSequenceReceiveCallback = ( - error: Error | null, - response?: ibc.core.channel.v1.QueryNextSequenceReceiveResponse, - ) => void; - } - - /** Properties of a QueryChannelRequest. */ - interface IQueryChannelRequest { - /** QueryChannelRequest portId */ - portId?: string | null; - - /** QueryChannelRequest channelId */ - channelId?: string | null; - } - - /** Represents a QueryChannelRequest. */ - class QueryChannelRequest implements IQueryChannelRequest { - /** - * Constructs a new QueryChannelRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelRequest); - - /** QueryChannelRequest portId. */ - public portId: string; - - /** QueryChannelRequest channelId. */ - public channelId: string; - - /** - * Creates a new QueryChannelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelRequest, - ): ibc.core.channel.v1.QueryChannelRequest; - - /** - * Encodes the specified QueryChannelRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @param m QueryChannelRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelRequest; - } - - /** Properties of a QueryChannelResponse. */ - interface IQueryChannelResponse { - /** QueryChannelResponse channel */ - channel?: ibc.core.channel.v1.IChannel | null; - - /** QueryChannelResponse proof */ - proof?: Uint8Array | null; - - /** QueryChannelResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryChannelResponse. */ - class QueryChannelResponse implements IQueryChannelResponse { - /** - * Constructs a new QueryChannelResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelResponse); - - /** QueryChannelResponse channel. */ - public channel?: ibc.core.channel.v1.IChannel | null; - - /** QueryChannelResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryChannelResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelResponse, - ): ibc.core.channel.v1.QueryChannelResponse; - - /** - * Encodes the specified QueryChannelResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @param m QueryChannelResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelResponse; - } - - /** Properties of a QueryChannelsRequest. */ - interface IQueryChannelsRequest { - /** QueryChannelsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryChannelsRequest. */ - class QueryChannelsRequest implements IQueryChannelsRequest { - /** - * Constructs a new QueryChannelsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelsRequest); - - /** QueryChannelsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryChannelsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelsRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelsRequest, - ): ibc.core.channel.v1.QueryChannelsRequest; - - /** - * Encodes the specified QueryChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @param m QueryChannelsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelsRequest; - } - - /** Properties of a QueryChannelsResponse. */ - interface IQueryChannelsResponse { - /** QueryChannelsResponse channels */ - channels?: ibc.core.channel.v1.IIdentifiedChannel[] | null; - - /** QueryChannelsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryChannelsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryChannelsResponse. */ - class QueryChannelsResponse implements IQueryChannelsResponse { - /** - * Constructs a new QueryChannelsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelsResponse); - - /** QueryChannelsResponse channels. */ - public channels: ibc.core.channel.v1.IIdentifiedChannel[]; - - /** QueryChannelsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryChannelsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryChannelsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelsResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelsResponse, - ): ibc.core.channel.v1.QueryChannelsResponse; - - /** - * Encodes the specified QueryChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @param m QueryChannelsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelsResponse; - } - - /** Properties of a QueryConnectionChannelsRequest. */ - interface IQueryConnectionChannelsRequest { - /** QueryConnectionChannelsRequest connection */ - connection?: string | null; - - /** QueryConnectionChannelsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryConnectionChannelsRequest. */ - class QueryConnectionChannelsRequest implements IQueryConnectionChannelsRequest { - /** - * Constructs a new QueryConnectionChannelsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryConnectionChannelsRequest); - - /** QueryConnectionChannelsRequest connection. */ - public connection: string; - - /** QueryConnectionChannelsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryConnectionChannelsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionChannelsRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryConnectionChannelsRequest, - ): ibc.core.channel.v1.QueryConnectionChannelsRequest; - - /** - * Encodes the specified QueryConnectionChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @param m QueryConnectionChannelsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryConnectionChannelsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryConnectionChannelsRequest; - } - - /** Properties of a QueryConnectionChannelsResponse. */ - interface IQueryConnectionChannelsResponse { - /** QueryConnectionChannelsResponse channels */ - channels?: ibc.core.channel.v1.IIdentifiedChannel[] | null; - - /** QueryConnectionChannelsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryConnectionChannelsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryConnectionChannelsResponse. */ - class QueryConnectionChannelsResponse implements IQueryConnectionChannelsResponse { - /** - * Constructs a new QueryConnectionChannelsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryConnectionChannelsResponse); - - /** QueryConnectionChannelsResponse channels. */ - public channels: ibc.core.channel.v1.IIdentifiedChannel[]; - - /** QueryConnectionChannelsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryConnectionChannelsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryConnectionChannelsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionChannelsResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryConnectionChannelsResponse, - ): ibc.core.channel.v1.QueryConnectionChannelsResponse; - - /** - * Encodes the specified QueryConnectionChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @param m QueryConnectionChannelsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryConnectionChannelsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryConnectionChannelsResponse; - } - - /** Properties of a QueryChannelClientStateRequest. */ - interface IQueryChannelClientStateRequest { - /** QueryChannelClientStateRequest portId */ - portId?: string | null; - - /** QueryChannelClientStateRequest channelId */ - channelId?: string | null; - } - - /** Represents a QueryChannelClientStateRequest. */ - class QueryChannelClientStateRequest implements IQueryChannelClientStateRequest { - /** - * Constructs a new QueryChannelClientStateRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelClientStateRequest); - - /** QueryChannelClientStateRequest portId. */ - public portId: string; - - /** QueryChannelClientStateRequest channelId. */ - public channelId: string; - - /** - * Creates a new QueryChannelClientStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelClientStateRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelClientStateRequest, - ): ibc.core.channel.v1.QueryChannelClientStateRequest; - - /** - * Encodes the specified QueryChannelClientStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @param m QueryChannelClientStateRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelClientStateRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelClientStateRequest; - } - - /** Properties of a QueryChannelClientStateResponse. */ - interface IQueryChannelClientStateResponse { - /** QueryChannelClientStateResponse identifiedClientState */ - identifiedClientState?: ibc.core.client.v1.IIdentifiedClientState | null; - - /** QueryChannelClientStateResponse proof */ - proof?: Uint8Array | null; - - /** QueryChannelClientStateResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryChannelClientStateResponse. */ - class QueryChannelClientStateResponse implements IQueryChannelClientStateResponse { - /** - * Constructs a new QueryChannelClientStateResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelClientStateResponse); - - /** QueryChannelClientStateResponse identifiedClientState. */ - public identifiedClientState?: ibc.core.client.v1.IIdentifiedClientState | null; - - /** QueryChannelClientStateResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelClientStateResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryChannelClientStateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelClientStateResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelClientStateResponse, - ): ibc.core.channel.v1.QueryChannelClientStateResponse; - - /** - * Encodes the specified QueryChannelClientStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @param m QueryChannelClientStateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelClientStateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelClientStateResponse; - } - - /** Properties of a QueryChannelConsensusStateRequest. */ - interface IQueryChannelConsensusStateRequest { - /** QueryChannelConsensusStateRequest portId */ - portId?: string | null; - - /** QueryChannelConsensusStateRequest channelId */ - channelId?: string | null; - - /** QueryChannelConsensusStateRequest revisionNumber */ - revisionNumber?: Long | null; - - /** QueryChannelConsensusStateRequest revisionHeight */ - revisionHeight?: Long | null; - } - - /** Represents a QueryChannelConsensusStateRequest. */ - class QueryChannelConsensusStateRequest implements IQueryChannelConsensusStateRequest { - /** - * Constructs a new QueryChannelConsensusStateRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelConsensusStateRequest); - - /** QueryChannelConsensusStateRequest portId. */ - public portId: string; - - /** QueryChannelConsensusStateRequest channelId. */ - public channelId: string; - - /** QueryChannelConsensusStateRequest revisionNumber. */ - public revisionNumber: Long; - - /** QueryChannelConsensusStateRequest revisionHeight. */ - public revisionHeight: Long; - - /** - * Creates a new QueryChannelConsensusStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelConsensusStateRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, - ): ibc.core.channel.v1.QueryChannelConsensusStateRequest; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @param m QueryChannelConsensusStateRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelConsensusStateRequest; - } - - /** Properties of a QueryChannelConsensusStateResponse. */ - interface IQueryChannelConsensusStateResponse { - /** QueryChannelConsensusStateResponse consensusState */ - consensusState?: google.protobuf.IAny | null; - - /** QueryChannelConsensusStateResponse clientId */ - clientId?: string | null; - - /** QueryChannelConsensusStateResponse proof */ - proof?: Uint8Array | null; - - /** QueryChannelConsensusStateResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryChannelConsensusStateResponse. */ - class QueryChannelConsensusStateResponse implements IQueryChannelConsensusStateResponse { - /** - * Constructs a new QueryChannelConsensusStateResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryChannelConsensusStateResponse); - - /** QueryChannelConsensusStateResponse consensusState. */ - public consensusState?: google.protobuf.IAny | null; - - /** QueryChannelConsensusStateResponse clientId. */ - public clientId: string; - - /** QueryChannelConsensusStateResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelConsensusStateResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryChannelConsensusStateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryChannelConsensusStateResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryChannelConsensusStateResponse, - ): ibc.core.channel.v1.QueryChannelConsensusStateResponse; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @param m QueryChannelConsensusStateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryChannelConsensusStateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryChannelConsensusStateResponse; - } - - /** Properties of a QueryPacketCommitmentRequest. */ - interface IQueryPacketCommitmentRequest { - /** QueryPacketCommitmentRequest portId */ - portId?: string | null; - - /** QueryPacketCommitmentRequest channelId */ - channelId?: string | null; - - /** QueryPacketCommitmentRequest sequence */ - sequence?: Long | null; - } - - /** Represents a QueryPacketCommitmentRequest. */ - class QueryPacketCommitmentRequest implements IQueryPacketCommitmentRequest { - /** - * Constructs a new QueryPacketCommitmentRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketCommitmentRequest); - - /** QueryPacketCommitmentRequest portId. */ - public portId: string; - - /** QueryPacketCommitmentRequest channelId. */ - public channelId: string; - - /** QueryPacketCommitmentRequest sequence. */ - public sequence: Long; - - /** - * Creates a new QueryPacketCommitmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketCommitmentRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketCommitmentRequest, - ): ibc.core.channel.v1.QueryPacketCommitmentRequest; - - /** - * Encodes the specified QueryPacketCommitmentRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @param m QueryPacketCommitmentRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketCommitmentRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketCommitmentRequest; - } - - /** Properties of a QueryPacketCommitmentResponse. */ - interface IQueryPacketCommitmentResponse { - /** QueryPacketCommitmentResponse commitment */ - commitment?: Uint8Array | null; - - /** QueryPacketCommitmentResponse proof */ - proof?: Uint8Array | null; - - /** QueryPacketCommitmentResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryPacketCommitmentResponse. */ - class QueryPacketCommitmentResponse implements IQueryPacketCommitmentResponse { - /** - * Constructs a new QueryPacketCommitmentResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketCommitmentResponse); - - /** QueryPacketCommitmentResponse commitment. */ - public commitment: Uint8Array; - - /** QueryPacketCommitmentResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketCommitmentResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryPacketCommitmentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketCommitmentResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketCommitmentResponse, - ): ibc.core.channel.v1.QueryPacketCommitmentResponse; - - /** - * Encodes the specified QueryPacketCommitmentResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @param m QueryPacketCommitmentResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketCommitmentResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketCommitmentResponse; - } - - /** Properties of a QueryPacketCommitmentsRequest. */ - interface IQueryPacketCommitmentsRequest { - /** QueryPacketCommitmentsRequest portId */ - portId?: string | null; - - /** QueryPacketCommitmentsRequest channelId */ - channelId?: string | null; - - /** QueryPacketCommitmentsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryPacketCommitmentsRequest. */ - class QueryPacketCommitmentsRequest implements IQueryPacketCommitmentsRequest { - /** - * Constructs a new QueryPacketCommitmentsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketCommitmentsRequest); - - /** QueryPacketCommitmentsRequest portId. */ - public portId: string; - - /** QueryPacketCommitmentsRequest channelId. */ - public channelId: string; - - /** QueryPacketCommitmentsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryPacketCommitmentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketCommitmentsRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, - ): ibc.core.channel.v1.QueryPacketCommitmentsRequest; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @param m QueryPacketCommitmentsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketCommitmentsRequest; - } - - /** Properties of a QueryPacketCommitmentsResponse. */ - interface IQueryPacketCommitmentsResponse { - /** QueryPacketCommitmentsResponse commitments */ - commitments?: ibc.core.channel.v1.IPacketState[] | null; - - /** QueryPacketCommitmentsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryPacketCommitmentsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryPacketCommitmentsResponse. */ - class QueryPacketCommitmentsResponse implements IQueryPacketCommitmentsResponse { - /** - * Constructs a new QueryPacketCommitmentsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketCommitmentsResponse); - - /** QueryPacketCommitmentsResponse commitments. */ - public commitments: ibc.core.channel.v1.IPacketState[]; - - /** QueryPacketCommitmentsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryPacketCommitmentsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryPacketCommitmentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketCommitmentsResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketCommitmentsResponse, - ): ibc.core.channel.v1.QueryPacketCommitmentsResponse; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @param m QueryPacketCommitmentsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketCommitmentsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketCommitmentsResponse; - } - - /** Properties of a QueryPacketReceiptRequest. */ - interface IQueryPacketReceiptRequest { - /** QueryPacketReceiptRequest portId */ - portId?: string | null; - - /** QueryPacketReceiptRequest channelId */ - channelId?: string | null; - - /** QueryPacketReceiptRequest sequence */ - sequence?: Long | null; - } - - /** Represents a QueryPacketReceiptRequest. */ - class QueryPacketReceiptRequest implements IQueryPacketReceiptRequest { - /** - * Constructs a new QueryPacketReceiptRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketReceiptRequest); - - /** QueryPacketReceiptRequest portId. */ - public portId: string; - - /** QueryPacketReceiptRequest channelId. */ - public channelId: string; - - /** QueryPacketReceiptRequest sequence. */ - public sequence: Long; - - /** - * Creates a new QueryPacketReceiptRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketReceiptRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketReceiptRequest, - ): ibc.core.channel.v1.QueryPacketReceiptRequest; - - /** - * Encodes the specified QueryPacketReceiptRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @param m QueryPacketReceiptRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketReceiptRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketReceiptRequest; - } - - /** Properties of a QueryPacketReceiptResponse. */ - interface IQueryPacketReceiptResponse { - /** QueryPacketReceiptResponse received */ - received?: boolean | null; - - /** QueryPacketReceiptResponse proof */ - proof?: Uint8Array | null; - - /** QueryPacketReceiptResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryPacketReceiptResponse. */ - class QueryPacketReceiptResponse implements IQueryPacketReceiptResponse { - /** - * Constructs a new QueryPacketReceiptResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketReceiptResponse); - - /** QueryPacketReceiptResponse received. */ - public received: boolean; - - /** QueryPacketReceiptResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketReceiptResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryPacketReceiptResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketReceiptResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketReceiptResponse, - ): ibc.core.channel.v1.QueryPacketReceiptResponse; - - /** - * Encodes the specified QueryPacketReceiptResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @param m QueryPacketReceiptResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketReceiptResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketReceiptResponse; - } - - /** Properties of a QueryPacketAcknowledgementRequest. */ - interface IQueryPacketAcknowledgementRequest { - /** QueryPacketAcknowledgementRequest portId */ - portId?: string | null; - - /** QueryPacketAcknowledgementRequest channelId */ - channelId?: string | null; - - /** QueryPacketAcknowledgementRequest sequence */ - sequence?: Long | null; - } - - /** Represents a QueryPacketAcknowledgementRequest. */ - class QueryPacketAcknowledgementRequest implements IQueryPacketAcknowledgementRequest { - /** - * Constructs a new QueryPacketAcknowledgementRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest); - - /** QueryPacketAcknowledgementRequest portId. */ - public portId: string; - - /** QueryPacketAcknowledgementRequest channelId. */ - public channelId: string; - - /** QueryPacketAcknowledgementRequest sequence. */ - public sequence: Long; - - /** - * Creates a new QueryPacketAcknowledgementRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketAcknowledgementRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, - ): ibc.core.channel.v1.QueryPacketAcknowledgementRequest; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @param m QueryPacketAcknowledgementRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketAcknowledgementRequest; - } - - /** Properties of a QueryPacketAcknowledgementResponse. */ - interface IQueryPacketAcknowledgementResponse { - /** QueryPacketAcknowledgementResponse acknowledgement */ - acknowledgement?: Uint8Array | null; - - /** QueryPacketAcknowledgementResponse proof */ - proof?: Uint8Array | null; - - /** QueryPacketAcknowledgementResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryPacketAcknowledgementResponse. */ - class QueryPacketAcknowledgementResponse implements IQueryPacketAcknowledgementResponse { - /** - * Constructs a new QueryPacketAcknowledgementResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse); - - /** QueryPacketAcknowledgementResponse acknowledgement. */ - public acknowledgement: Uint8Array; - - /** QueryPacketAcknowledgementResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketAcknowledgementResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryPacketAcknowledgementResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketAcknowledgementResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse, - ): ibc.core.channel.v1.QueryPacketAcknowledgementResponse; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @param m QueryPacketAcknowledgementResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketAcknowledgementResponse; - } - - /** Properties of a QueryPacketAcknowledgementsRequest. */ - interface IQueryPacketAcknowledgementsRequest { - /** QueryPacketAcknowledgementsRequest portId */ - portId?: string | null; - - /** QueryPacketAcknowledgementsRequest channelId */ - channelId?: string | null; - - /** QueryPacketAcknowledgementsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryPacketAcknowledgementsRequest. */ - class QueryPacketAcknowledgementsRequest implements IQueryPacketAcknowledgementsRequest { - /** - * Constructs a new QueryPacketAcknowledgementsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest); - - /** QueryPacketAcknowledgementsRequest portId. */ - public portId: string; - - /** QueryPacketAcknowledgementsRequest channelId. */ - public channelId: string; - - /** QueryPacketAcknowledgementsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryPacketAcknowledgementsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketAcknowledgementsRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, - ): ibc.core.channel.v1.QueryPacketAcknowledgementsRequest; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @param m QueryPacketAcknowledgementsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketAcknowledgementsRequest; - } - - /** Properties of a QueryPacketAcknowledgementsResponse. */ - interface IQueryPacketAcknowledgementsResponse { - /** QueryPacketAcknowledgementsResponse acknowledgements */ - acknowledgements?: ibc.core.channel.v1.IPacketState[] | null; - - /** QueryPacketAcknowledgementsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryPacketAcknowledgementsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryPacketAcknowledgementsResponse. */ - class QueryPacketAcknowledgementsResponse implements IQueryPacketAcknowledgementsResponse { - /** - * Constructs a new QueryPacketAcknowledgementsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse); - - /** QueryPacketAcknowledgementsResponse acknowledgements. */ - public acknowledgements: ibc.core.channel.v1.IPacketState[]; - - /** QueryPacketAcknowledgementsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryPacketAcknowledgementsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryPacketAcknowledgementsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPacketAcknowledgementsResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse, - ): ibc.core.channel.v1.QueryPacketAcknowledgementsResponse; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @param m QueryPacketAcknowledgementsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryPacketAcknowledgementsResponse; - } - - /** Properties of a QueryUnreceivedPacketsRequest. */ - interface IQueryUnreceivedPacketsRequest { - /** QueryUnreceivedPacketsRequest portId */ - portId?: string | null; - - /** QueryUnreceivedPacketsRequest channelId */ - channelId?: string | null; - - /** QueryUnreceivedPacketsRequest packetCommitmentSequences */ - packetCommitmentSequences?: Long[] | null; - } - - /** Represents a QueryUnreceivedPacketsRequest. */ - class QueryUnreceivedPacketsRequest implements IQueryUnreceivedPacketsRequest { - /** - * Constructs a new QueryUnreceivedPacketsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest); - - /** QueryUnreceivedPacketsRequest portId. */ - public portId: string; - - /** QueryUnreceivedPacketsRequest channelId. */ - public channelId: string; - - /** QueryUnreceivedPacketsRequest packetCommitmentSequences. */ - public packetCommitmentSequences: Long[]; - - /** - * Creates a new QueryUnreceivedPacketsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnreceivedPacketsRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, - ): ibc.core.channel.v1.QueryUnreceivedPacketsRequest; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @param m QueryUnreceivedPacketsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryUnreceivedPacketsRequest; - } - - /** Properties of a QueryUnreceivedPacketsResponse. */ - interface IQueryUnreceivedPacketsResponse { - /** QueryUnreceivedPacketsResponse sequences */ - sequences?: Long[] | null; - - /** QueryUnreceivedPacketsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryUnreceivedPacketsResponse. */ - class QueryUnreceivedPacketsResponse implements IQueryUnreceivedPacketsResponse { - /** - * Constructs a new QueryUnreceivedPacketsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse); - - /** QueryUnreceivedPacketsResponse sequences. */ - public sequences: Long[]; - - /** QueryUnreceivedPacketsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryUnreceivedPacketsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnreceivedPacketsResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse, - ): ibc.core.channel.v1.QueryUnreceivedPacketsResponse; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @param m QueryUnreceivedPacketsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryUnreceivedPacketsResponse; - } - - /** Properties of a QueryUnreceivedAcksRequest. */ - interface IQueryUnreceivedAcksRequest { - /** QueryUnreceivedAcksRequest portId */ - portId?: string | null; - - /** QueryUnreceivedAcksRequest channelId */ - channelId?: string | null; - - /** QueryUnreceivedAcksRequest packetAckSequences */ - packetAckSequences?: Long[] | null; - } - - /** Represents a QueryUnreceivedAcksRequest. */ - class QueryUnreceivedAcksRequest implements IQueryUnreceivedAcksRequest { - /** - * Constructs a new QueryUnreceivedAcksRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryUnreceivedAcksRequest); - - /** QueryUnreceivedAcksRequest portId. */ - public portId: string; - - /** QueryUnreceivedAcksRequest channelId. */ - public channelId: string; - - /** QueryUnreceivedAcksRequest packetAckSequences. */ - public packetAckSequences: Long[]; - - /** - * Creates a new QueryUnreceivedAcksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnreceivedAcksRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, - ): ibc.core.channel.v1.QueryUnreceivedAcksRequest; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @param m QueryUnreceivedAcksRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryUnreceivedAcksRequest; - } - - /** Properties of a QueryUnreceivedAcksResponse. */ - interface IQueryUnreceivedAcksResponse { - /** QueryUnreceivedAcksResponse sequences */ - sequences?: Long[] | null; - - /** QueryUnreceivedAcksResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryUnreceivedAcksResponse. */ - class QueryUnreceivedAcksResponse implements IQueryUnreceivedAcksResponse { - /** - * Constructs a new QueryUnreceivedAcksResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryUnreceivedAcksResponse); - - /** QueryUnreceivedAcksResponse sequences. */ - public sequences: Long[]; - - /** QueryUnreceivedAcksResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryUnreceivedAcksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryUnreceivedAcksResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryUnreceivedAcksResponse, - ): ibc.core.channel.v1.QueryUnreceivedAcksResponse; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @param m QueryUnreceivedAcksResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryUnreceivedAcksResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryUnreceivedAcksResponse; - } - - /** Properties of a QueryNextSequenceReceiveRequest. */ - interface IQueryNextSequenceReceiveRequest { - /** QueryNextSequenceReceiveRequest portId */ - portId?: string | null; - - /** QueryNextSequenceReceiveRequest channelId */ - channelId?: string | null; - } - - /** Represents a QueryNextSequenceReceiveRequest. */ - class QueryNextSequenceReceiveRequest implements IQueryNextSequenceReceiveRequest { - /** - * Constructs a new QueryNextSequenceReceiveRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest); - - /** QueryNextSequenceReceiveRequest portId. */ - public portId: string; - - /** QueryNextSequenceReceiveRequest channelId. */ - public channelId: string; - - /** - * Creates a new QueryNextSequenceReceiveRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryNextSequenceReceiveRequest instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, - ): ibc.core.channel.v1.QueryNextSequenceReceiveRequest; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @param m QueryNextSequenceReceiveRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryNextSequenceReceiveRequest; - } - - /** Properties of a QueryNextSequenceReceiveResponse. */ - interface IQueryNextSequenceReceiveResponse { - /** QueryNextSequenceReceiveResponse nextSequenceReceive */ - nextSequenceReceive?: Long | null; - - /** QueryNextSequenceReceiveResponse proof */ - proof?: Uint8Array | null; - - /** QueryNextSequenceReceiveResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryNextSequenceReceiveResponse. */ - class QueryNextSequenceReceiveResponse implements IQueryNextSequenceReceiveResponse { - /** - * Constructs a new QueryNextSequenceReceiveResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse); - - /** QueryNextSequenceReceiveResponse nextSequenceReceive. */ - public nextSequenceReceive: Long; - - /** QueryNextSequenceReceiveResponse proof. */ - public proof: Uint8Array; - - /** QueryNextSequenceReceiveResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryNextSequenceReceiveResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryNextSequenceReceiveResponse instance - */ - public static create( - properties?: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse, - ): ibc.core.channel.v1.QueryNextSequenceReceiveResponse; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @param m QueryNextSequenceReceiveResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.channel.v1.QueryNextSequenceReceiveResponse; - } - } - } - - /** Namespace client. */ - namespace client { - /** Namespace v1. */ - namespace v1 { - /** Properties of an IdentifiedClientState. */ - interface IIdentifiedClientState { - /** IdentifiedClientState clientId */ - clientId?: string | null; - - /** IdentifiedClientState clientState */ - clientState?: google.protobuf.IAny | null; - } - - /** Represents an IdentifiedClientState. */ - class IdentifiedClientState implements IIdentifiedClientState { - /** - * Constructs a new IdentifiedClientState. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IIdentifiedClientState); - - /** IdentifiedClientState clientId. */ - public clientId: string; - - /** IdentifiedClientState clientState. */ - public clientState?: google.protobuf.IAny | null; - - /** - * Creates a new IdentifiedClientState instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentifiedClientState instance - */ - public static create( - properties?: ibc.core.client.v1.IIdentifiedClientState, - ): ibc.core.client.v1.IdentifiedClientState; - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @param m IdentifiedClientState message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.client.v1.IIdentifiedClientState, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.client.v1.IdentifiedClientState; - } - - /** Properties of a ConsensusStateWithHeight. */ - interface IConsensusStateWithHeight { - /** ConsensusStateWithHeight height */ - height?: ibc.core.client.v1.IHeight | null; - - /** ConsensusStateWithHeight consensusState */ - consensusState?: google.protobuf.IAny | null; - } - - /** Represents a ConsensusStateWithHeight. */ - class ConsensusStateWithHeight implements IConsensusStateWithHeight { - /** - * Constructs a new ConsensusStateWithHeight. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IConsensusStateWithHeight); - - /** ConsensusStateWithHeight height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** ConsensusStateWithHeight consensusState. */ - public consensusState?: google.protobuf.IAny | null; - - /** - * Creates a new ConsensusStateWithHeight instance using the specified properties. - * @param [properties] Properties to set - * @returns ConsensusStateWithHeight instance - */ - public static create( - properties?: ibc.core.client.v1.IConsensusStateWithHeight, - ): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @param m ConsensusStateWithHeight message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.client.v1.IConsensusStateWithHeight, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.client.v1.ConsensusStateWithHeight; - } - - /** Properties of a ClientConsensusStates. */ - interface IClientConsensusStates { - /** ClientConsensusStates clientId */ - clientId?: string | null; - - /** ClientConsensusStates consensusStates */ - consensusStates?: ibc.core.client.v1.IConsensusStateWithHeight[] | null; - } - - /** Represents a ClientConsensusStates. */ - class ClientConsensusStates implements IClientConsensusStates { - /** - * Constructs a new ClientConsensusStates. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IClientConsensusStates); - - /** ClientConsensusStates clientId. */ - public clientId: string; - - /** ClientConsensusStates consensusStates. */ - public consensusStates: ibc.core.client.v1.IConsensusStateWithHeight[]; - - /** - * Creates a new ClientConsensusStates instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientConsensusStates instance - */ - public static create( - properties?: ibc.core.client.v1.IClientConsensusStates, - ): ibc.core.client.v1.ClientConsensusStates; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @param m ClientConsensusStates message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.client.v1.IClientConsensusStates, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.client.v1.ClientConsensusStates; - } - - /** Properties of a ClientUpdateProposal. */ - interface IClientUpdateProposal { - /** ClientUpdateProposal title */ - title?: string | null; - - /** ClientUpdateProposal description */ - description?: string | null; - - /** ClientUpdateProposal clientId */ - clientId?: string | null; - - /** ClientUpdateProposal header */ - header?: google.protobuf.IAny | null; - } - - /** Represents a ClientUpdateProposal. */ - class ClientUpdateProposal implements IClientUpdateProposal { - /** - * Constructs a new ClientUpdateProposal. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IClientUpdateProposal); - - /** ClientUpdateProposal title. */ - public title: string; - - /** ClientUpdateProposal description. */ - public description: string; - - /** ClientUpdateProposal clientId. */ - public clientId: string; - - /** ClientUpdateProposal header. */ - public header?: google.protobuf.IAny | null; - - /** - * Creates a new ClientUpdateProposal instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientUpdateProposal instance - */ - public static create( - properties?: ibc.core.client.v1.IClientUpdateProposal, - ): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @param m ClientUpdateProposal message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.client.v1.IClientUpdateProposal, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.client.v1.ClientUpdateProposal; - } - - /** Properties of an Height. */ - interface IHeight { - /** Height revisionNumber */ - revisionNumber?: Long | null; - - /** Height revisionHeight */ - revisionHeight?: Long | null; - } - - /** Represents an Height. */ - class Height implements IHeight { - /** - * Constructs a new Height. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IHeight); - - /** Height revisionNumber. */ - public revisionNumber: Long; - - /** Height revisionHeight. */ - public revisionHeight: Long; - - /** - * Creates a new Height instance using the specified properties. - * @param [properties] Properties to set - * @returns Height instance - */ - public static create(properties?: ibc.core.client.v1.IHeight): ibc.core.client.v1.Height; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @param m Height message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.client.v1.IHeight, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Height message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.client.v1.Height; - } - - /** Properties of a Params. */ - interface IParams { - /** Params allowedClients */ - allowedClients?: string[] | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.client.v1.IParams); - - /** Params allowedClients. */ - public allowedClients: string[]; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: ibc.core.client.v1.IParams): ibc.core.client.v1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.client.v1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.client.v1.Params; - } - } - } - - /** Namespace commitment. */ - namespace commitment { - /** Namespace v1. */ - namespace v1 { - /** Properties of a MerkleRoot. */ - interface IMerkleRoot { - /** MerkleRoot hash */ - hash?: Uint8Array | null; - } - - /** Represents a MerkleRoot. */ - class MerkleRoot implements IMerkleRoot { - /** - * Constructs a new MerkleRoot. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.commitment.v1.IMerkleRoot); - - /** MerkleRoot hash. */ - public hash: Uint8Array; - - /** - * Creates a new MerkleRoot instance using the specified properties. - * @param [properties] Properties to set - * @returns MerkleRoot instance - */ - public static create( - properties?: ibc.core.commitment.v1.IMerkleRoot, - ): ibc.core.commitment.v1.MerkleRoot; - - /** - * Encodes the specified MerkleRoot message. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @param m MerkleRoot message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.commitment.v1.IMerkleRoot, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.commitment.v1.MerkleRoot; - } - - /** Properties of a MerklePrefix. */ - interface IMerklePrefix { - /** MerklePrefix keyPrefix */ - keyPrefix?: Uint8Array | null; - } - - /** Represents a MerklePrefix. */ - class MerklePrefix implements IMerklePrefix { - /** - * Constructs a new MerklePrefix. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.commitment.v1.IMerklePrefix); - - /** MerklePrefix keyPrefix. */ - public keyPrefix: Uint8Array; - - /** - * Creates a new MerklePrefix instance using the specified properties. - * @param [properties] Properties to set - * @returns MerklePrefix instance - */ - public static create( - properties?: ibc.core.commitment.v1.IMerklePrefix, - ): ibc.core.commitment.v1.MerklePrefix; - - /** - * Encodes the specified MerklePrefix message. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @param m MerklePrefix message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.commitment.v1.IMerklePrefix, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.commitment.v1.MerklePrefix; - } - - /** Properties of a MerklePath. */ - interface IMerklePath { - /** MerklePath keyPath */ - keyPath?: string[] | null; - } - - /** Represents a MerklePath. */ - class MerklePath implements IMerklePath { - /** - * Constructs a new MerklePath. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.commitment.v1.IMerklePath); - - /** MerklePath keyPath. */ - public keyPath: string[]; - - /** - * Creates a new MerklePath instance using the specified properties. - * @param [properties] Properties to set - * @returns MerklePath instance - */ - public static create( - properties?: ibc.core.commitment.v1.IMerklePath, - ): ibc.core.commitment.v1.MerklePath; - - /** - * Encodes the specified MerklePath message. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @param m MerklePath message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.commitment.v1.IMerklePath, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerklePath message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.commitment.v1.MerklePath; - } - - /** Properties of a MerkleProof. */ - interface IMerkleProof { - /** MerkleProof proofs */ - proofs?: ics23.ICommitmentProof[] | null; - } - - /** Represents a MerkleProof. */ - class MerkleProof implements IMerkleProof { - /** - * Constructs a new MerkleProof. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.commitment.v1.IMerkleProof); - - /** MerkleProof proofs. */ - public proofs: ics23.ICommitmentProof[]; - - /** - * Creates a new MerkleProof instance using the specified properties. - * @param [properties] Properties to set - * @returns MerkleProof instance - */ - public static create( - properties?: ibc.core.commitment.v1.IMerkleProof, - ): ibc.core.commitment.v1.MerkleProof; - - /** - * Encodes the specified MerkleProof message. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @param m MerkleProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.commitment.v1.IMerkleProof, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MerkleProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.commitment.v1.MerkleProof; - } - } - } - - /** Namespace connection. */ - namespace connection { - /** Namespace v1. */ - namespace v1 { - /** Properties of a ConnectionEnd. */ - interface IConnectionEnd { - /** ConnectionEnd clientId */ - clientId?: string | null; - - /** ConnectionEnd versions */ - versions?: ibc.core.connection.v1.IVersion[] | null; - - /** ConnectionEnd state */ - state?: ibc.core.connection.v1.State | null; - - /** ConnectionEnd counterparty */ - counterparty?: ibc.core.connection.v1.ICounterparty | null; - - /** ConnectionEnd delayPeriod */ - delayPeriod?: Long | null; - } - - /** Represents a ConnectionEnd. */ - class ConnectionEnd implements IConnectionEnd { - /** - * Constructs a new ConnectionEnd. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IConnectionEnd); - - /** ConnectionEnd clientId. */ - public clientId: string; - - /** ConnectionEnd versions. */ - public versions: ibc.core.connection.v1.IVersion[]; - - /** ConnectionEnd state. */ - public state: ibc.core.connection.v1.State; - - /** ConnectionEnd counterparty. */ - public counterparty?: ibc.core.connection.v1.ICounterparty | null; - - /** ConnectionEnd delayPeriod. */ - public delayPeriod: Long; - - /** - * Creates a new ConnectionEnd instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionEnd instance - */ - public static create( - properties?: ibc.core.connection.v1.IConnectionEnd, - ): ibc.core.connection.v1.ConnectionEnd; - - /** - * Encodes the specified ConnectionEnd message. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @param m ConnectionEnd message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IConnectionEnd, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.ConnectionEnd; - } - - /** Properties of an IdentifiedConnection. */ - interface IIdentifiedConnection { - /** IdentifiedConnection id */ - id?: string | null; - - /** IdentifiedConnection clientId */ - clientId?: string | null; - - /** IdentifiedConnection versions */ - versions?: ibc.core.connection.v1.IVersion[] | null; - - /** IdentifiedConnection state */ - state?: ibc.core.connection.v1.State | null; - - /** IdentifiedConnection counterparty */ - counterparty?: ibc.core.connection.v1.ICounterparty | null; - - /** IdentifiedConnection delayPeriod */ - delayPeriod?: Long | null; - } - - /** Represents an IdentifiedConnection. */ - class IdentifiedConnection implements IIdentifiedConnection { - /** - * Constructs a new IdentifiedConnection. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IIdentifiedConnection); - - /** IdentifiedConnection id. */ - public id: string; - - /** IdentifiedConnection clientId. */ - public clientId: string; - - /** IdentifiedConnection versions. */ - public versions: ibc.core.connection.v1.IVersion[]; - - /** IdentifiedConnection state. */ - public state: ibc.core.connection.v1.State; - - /** IdentifiedConnection counterparty. */ - public counterparty?: ibc.core.connection.v1.ICounterparty | null; - - /** IdentifiedConnection delayPeriod. */ - public delayPeriod: Long; - - /** - * Creates a new IdentifiedConnection instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentifiedConnection instance - */ - public static create( - properties?: ibc.core.connection.v1.IIdentifiedConnection, - ): ibc.core.connection.v1.IdentifiedConnection; - - /** - * Encodes the specified IdentifiedConnection message. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @param m IdentifiedConnection message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IIdentifiedConnection, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.IdentifiedConnection; - } - - /** State enum. */ - enum State { - STATE_UNINITIALIZED_UNSPECIFIED = 0, - STATE_INIT = 1, - STATE_TRYOPEN = 2, - STATE_OPEN = 3, - } - - /** Properties of a Counterparty. */ - interface ICounterparty { - /** Counterparty clientId */ - clientId?: string | null; - - /** Counterparty connectionId */ - connectionId?: string | null; - - /** Counterparty prefix */ - prefix?: ibc.core.commitment.v1.IMerklePrefix | null; - } - - /** Represents a Counterparty. */ - class Counterparty implements ICounterparty { - /** - * Constructs a new Counterparty. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.ICounterparty); - - /** Counterparty clientId. */ - public clientId: string; - - /** Counterparty connectionId. */ - public connectionId: string; - - /** Counterparty prefix. */ - public prefix?: ibc.core.commitment.v1.IMerklePrefix | null; - - /** - * Creates a new Counterparty instance using the specified properties. - * @param [properties] Properties to set - * @returns Counterparty instance - */ - public static create( - properties?: ibc.core.connection.v1.ICounterparty, - ): ibc.core.connection.v1.Counterparty; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @param m Counterparty message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.ICounterparty, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.Counterparty; - } - - /** Properties of a ClientPaths. */ - interface IClientPaths { - /** ClientPaths paths */ - paths?: string[] | null; - } - - /** Represents a ClientPaths. */ - class ClientPaths implements IClientPaths { - /** - * Constructs a new ClientPaths. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IClientPaths); - - /** ClientPaths paths. */ - public paths: string[]; - - /** - * Creates a new ClientPaths instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientPaths instance - */ - public static create( - properties?: ibc.core.connection.v1.IClientPaths, - ): ibc.core.connection.v1.ClientPaths; - - /** - * Encodes the specified ClientPaths message. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @param m ClientPaths message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IClientPaths, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ClientPaths message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.ClientPaths; - } - - /** Properties of a ConnectionPaths. */ - interface IConnectionPaths { - /** ConnectionPaths clientId */ - clientId?: string | null; - - /** ConnectionPaths paths */ - paths?: string[] | null; - } - - /** Represents a ConnectionPaths. */ - class ConnectionPaths implements IConnectionPaths { - /** - * Constructs a new ConnectionPaths. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IConnectionPaths); - - /** ConnectionPaths clientId. */ - public clientId: string; - - /** ConnectionPaths paths. */ - public paths: string[]; - - /** - * Creates a new ConnectionPaths instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionPaths instance - */ - public static create( - properties?: ibc.core.connection.v1.IConnectionPaths, - ): ibc.core.connection.v1.ConnectionPaths; - - /** - * Encodes the specified ConnectionPaths message. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @param m ConnectionPaths message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IConnectionPaths, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.ConnectionPaths; - } - - /** Properties of a Version. */ - interface IVersion { - /** Version identifier */ - identifier?: string | null; - - /** Version features */ - features?: string[] | null; - } - - /** Represents a Version. */ - class Version implements IVersion { - /** - * Constructs a new Version. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IVersion); - - /** Version identifier. */ - public identifier: string; - - /** Version features. */ - public features: string[]; - - /** - * Creates a new Version instance using the specified properties. - * @param [properties] Properties to set - * @returns Version instance - */ - public static create(properties?: ibc.core.connection.v1.IVersion): ibc.core.connection.v1.Version; - - /** - * Encodes the specified Version message. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @param m Version message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ibc.core.connection.v1.IVersion, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Version message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ibc.core.connection.v1.Version; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Query service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Query; - - /** - * Calls Connection. - * @param request QueryConnectionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionResponse - */ - public connection( - request: ibc.core.connection.v1.IQueryConnectionRequest, - callback: ibc.core.connection.v1.Query.ConnectionCallback, - ): void; - - /** - * Calls Connection. - * @param request QueryConnectionRequest message or plain object - * @returns Promise - */ - public connection( - request: ibc.core.connection.v1.IQueryConnectionRequest, - ): Promise; - - /** - * Calls Connections. - * @param request QueryConnectionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionsResponse - */ - public connections( - request: ibc.core.connection.v1.IQueryConnectionsRequest, - callback: ibc.core.connection.v1.Query.ConnectionsCallback, - ): void; - - /** - * Calls Connections. - * @param request QueryConnectionsRequest message or plain object - * @returns Promise - */ - public connections( - request: ibc.core.connection.v1.IQueryConnectionsRequest, - ): Promise; - - /** - * Calls ClientConnections. - * @param request QueryClientConnectionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientConnectionsResponse - */ - public clientConnections( - request: ibc.core.connection.v1.IQueryClientConnectionsRequest, - callback: ibc.core.connection.v1.Query.ClientConnectionsCallback, - ): void; - - /** - * Calls ClientConnections. - * @param request QueryClientConnectionsRequest message or plain object - * @returns Promise - */ - public clientConnections( - request: ibc.core.connection.v1.IQueryClientConnectionsRequest, - ): Promise; - - /** - * Calls ConnectionClientState. - * @param request QueryConnectionClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionClientStateResponse - */ - public connectionClientState( - request: ibc.core.connection.v1.IQueryConnectionClientStateRequest, - callback: ibc.core.connection.v1.Query.ConnectionClientStateCallback, - ): void; - - /** - * Calls ConnectionClientState. - * @param request QueryConnectionClientStateRequest message or plain object - * @returns Promise - */ - public connectionClientState( - request: ibc.core.connection.v1.IQueryConnectionClientStateRequest, - ): Promise; - - /** - * Calls ConnectionConsensusState. - * @param request QueryConnectionConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionConsensusStateResponse - */ - public connectionConsensusState( - request: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, - callback: ibc.core.connection.v1.Query.ConnectionConsensusStateCallback, - ): void; - - /** - * Calls ConnectionConsensusState. - * @param request QueryConnectionConsensusStateRequest message or plain object - * @returns Promise - */ - public connectionConsensusState( - request: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, - ): Promise; - } - - namespace Query { - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connection}. - * @param error Error, if any - * @param [response] QueryConnectionResponse - */ - type ConnectionCallback = ( - error: Error | null, - response?: ibc.core.connection.v1.QueryConnectionResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connections}. - * @param error Error, if any - * @param [response] QueryConnectionsResponse - */ - type ConnectionsCallback = ( - error: Error | null, - response?: ibc.core.connection.v1.QueryConnectionsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#clientConnections}. - * @param error Error, if any - * @param [response] QueryClientConnectionsResponse - */ - type ClientConnectionsCallback = ( - error: Error | null, - response?: ibc.core.connection.v1.QueryClientConnectionsResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionClientState}. - * @param error Error, if any - * @param [response] QueryConnectionClientStateResponse - */ - type ConnectionClientStateCallback = ( - error: Error | null, - response?: ibc.core.connection.v1.QueryConnectionClientStateResponse, - ) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionConsensusState}. - * @param error Error, if any - * @param [response] QueryConnectionConsensusStateResponse - */ - type ConnectionConsensusStateCallback = ( - error: Error | null, - response?: ibc.core.connection.v1.QueryConnectionConsensusStateResponse, - ) => void; - } - - /** Properties of a QueryConnectionRequest. */ - interface IQueryConnectionRequest { - /** QueryConnectionRequest connectionId */ - connectionId?: string | null; - } - - /** Represents a QueryConnectionRequest. */ - class QueryConnectionRequest implements IQueryConnectionRequest { - /** - * Constructs a new QueryConnectionRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionRequest); - - /** QueryConnectionRequest connectionId. */ - public connectionId: string; - - /** - * Creates a new QueryConnectionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionRequest instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionRequest, - ): ibc.core.connection.v1.QueryConnectionRequest; - - /** - * Encodes the specified QueryConnectionRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @param m QueryConnectionRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionRequest; - } - - /** Properties of a QueryConnectionResponse. */ - interface IQueryConnectionResponse { - /** QueryConnectionResponse connection */ - connection?: ibc.core.connection.v1.IConnectionEnd | null; - - /** QueryConnectionResponse proof */ - proof?: Uint8Array | null; - - /** QueryConnectionResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryConnectionResponse. */ - class QueryConnectionResponse implements IQueryConnectionResponse { - /** - * Constructs a new QueryConnectionResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionResponse); - - /** QueryConnectionResponse connection. */ - public connection?: ibc.core.connection.v1.IConnectionEnd | null; - - /** QueryConnectionResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryConnectionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionResponse instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionResponse, - ): ibc.core.connection.v1.QueryConnectionResponse; - - /** - * Encodes the specified QueryConnectionResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @param m QueryConnectionResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionResponse; - } - - /** Properties of a QueryConnectionsRequest. */ - interface IQueryConnectionsRequest { - /** QueryConnectionsRequest pagination */ - pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - } - - /** Represents a QueryConnectionsRequest. */ - class QueryConnectionsRequest implements IQueryConnectionsRequest { - /** - * Constructs a new QueryConnectionsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionsRequest); - - /** QueryConnectionsRequest pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageRequest | null; - - /** - * Creates a new QueryConnectionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionsRequest instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionsRequest, - ): ibc.core.connection.v1.QueryConnectionsRequest; - - /** - * Encodes the specified QueryConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @param m QueryConnectionsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionsRequest; - } - - /** Properties of a QueryConnectionsResponse. */ - interface IQueryConnectionsResponse { - /** QueryConnectionsResponse connections */ - connections?: ibc.core.connection.v1.IIdentifiedConnection[] | null; - - /** QueryConnectionsResponse pagination */ - pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryConnectionsResponse height */ - height?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryConnectionsResponse. */ - class QueryConnectionsResponse implements IQueryConnectionsResponse { - /** - * Constructs a new QueryConnectionsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionsResponse); - - /** QueryConnectionsResponse connections. */ - public connections: ibc.core.connection.v1.IIdentifiedConnection[]; - - /** QueryConnectionsResponse pagination. */ - public pagination?: cosmos.base.query.v1beta1.IPageResponse | null; - - /** QueryConnectionsResponse height. */ - public height?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryConnectionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionsResponse instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionsResponse, - ): ibc.core.connection.v1.QueryConnectionsResponse; - - /** - * Encodes the specified QueryConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @param m QueryConnectionsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionsResponse; - } - - /** Properties of a QueryClientConnectionsRequest. */ - interface IQueryClientConnectionsRequest { - /** QueryClientConnectionsRequest clientId */ - clientId?: string | null; - } - - /** Represents a QueryClientConnectionsRequest. */ - class QueryClientConnectionsRequest implements IQueryClientConnectionsRequest { - /** - * Constructs a new QueryClientConnectionsRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryClientConnectionsRequest); - - /** QueryClientConnectionsRequest clientId. */ - public clientId: string; - - /** - * Creates a new QueryClientConnectionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryClientConnectionsRequest instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryClientConnectionsRequest, - ): ibc.core.connection.v1.QueryClientConnectionsRequest; - - /** - * Encodes the specified QueryClientConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @param m QueryClientConnectionsRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryClientConnectionsRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryClientConnectionsRequest; - } - - /** Properties of a QueryClientConnectionsResponse. */ - interface IQueryClientConnectionsResponse { - /** QueryClientConnectionsResponse connectionPaths */ - connectionPaths?: string[] | null; - - /** QueryClientConnectionsResponse proof */ - proof?: Uint8Array | null; - - /** QueryClientConnectionsResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryClientConnectionsResponse. */ - class QueryClientConnectionsResponse implements IQueryClientConnectionsResponse { - /** - * Constructs a new QueryClientConnectionsResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryClientConnectionsResponse); - - /** QueryClientConnectionsResponse connectionPaths. */ - public connectionPaths: string[]; - - /** QueryClientConnectionsResponse proof. */ - public proof: Uint8Array; - - /** QueryClientConnectionsResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryClientConnectionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryClientConnectionsResponse instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryClientConnectionsResponse, - ): ibc.core.connection.v1.QueryClientConnectionsResponse; - - /** - * Encodes the specified QueryClientConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @param m QueryClientConnectionsResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryClientConnectionsResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryClientConnectionsResponse; - } - - /** Properties of a QueryConnectionClientStateRequest. */ - interface IQueryConnectionClientStateRequest { - /** QueryConnectionClientStateRequest connectionId */ - connectionId?: string | null; - } - - /** Represents a QueryConnectionClientStateRequest. */ - class QueryConnectionClientStateRequest implements IQueryConnectionClientStateRequest { - /** - * Constructs a new QueryConnectionClientStateRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionClientStateRequest); - - /** QueryConnectionClientStateRequest connectionId. */ - public connectionId: string; - - /** - * Creates a new QueryConnectionClientStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionClientStateRequest instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionClientStateRequest, - ): ibc.core.connection.v1.QueryConnectionClientStateRequest; - - /** - * Encodes the specified QueryConnectionClientStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @param m QueryConnectionClientStateRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionClientStateRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionClientStateRequest; - } - - /** Properties of a QueryConnectionClientStateResponse. */ - interface IQueryConnectionClientStateResponse { - /** QueryConnectionClientStateResponse identifiedClientState */ - identifiedClientState?: ibc.core.client.v1.IIdentifiedClientState | null; - - /** QueryConnectionClientStateResponse proof */ - proof?: Uint8Array | null; - - /** QueryConnectionClientStateResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryConnectionClientStateResponse. */ - class QueryConnectionClientStateResponse implements IQueryConnectionClientStateResponse { - /** - * Constructs a new QueryConnectionClientStateResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionClientStateResponse); - - /** QueryConnectionClientStateResponse identifiedClientState. */ - public identifiedClientState?: ibc.core.client.v1.IIdentifiedClientState | null; - - /** QueryConnectionClientStateResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionClientStateResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryConnectionClientStateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionClientStateResponse instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionClientStateResponse, - ): ibc.core.connection.v1.QueryConnectionClientStateResponse; - - /** - * Encodes the specified QueryConnectionClientStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @param m QueryConnectionClientStateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionClientStateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionClientStateResponse; - } - - /** Properties of a QueryConnectionConsensusStateRequest. */ - interface IQueryConnectionConsensusStateRequest { - /** QueryConnectionConsensusStateRequest connectionId */ - connectionId?: string | null; - - /** QueryConnectionConsensusStateRequest revisionNumber */ - revisionNumber?: Long | null; - - /** QueryConnectionConsensusStateRequest revisionHeight */ - revisionHeight?: Long | null; - } - - /** Represents a QueryConnectionConsensusStateRequest. */ - class QueryConnectionConsensusStateRequest implements IQueryConnectionConsensusStateRequest { - /** - * Constructs a new QueryConnectionConsensusStateRequest. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest); - - /** QueryConnectionConsensusStateRequest connectionId. */ - public connectionId: string; - - /** QueryConnectionConsensusStateRequest revisionNumber. */ - public revisionNumber: Long; - - /** QueryConnectionConsensusStateRequest revisionHeight. */ - public revisionHeight: Long; - - /** - * Creates a new QueryConnectionConsensusStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionConsensusStateRequest instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, - ): ibc.core.connection.v1.QueryConnectionConsensusStateRequest; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @param m QueryConnectionConsensusStateRequest message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionConsensusStateRequest; - } - - /** Properties of a QueryConnectionConsensusStateResponse. */ - interface IQueryConnectionConsensusStateResponse { - /** QueryConnectionConsensusStateResponse consensusState */ - consensusState?: google.protobuf.IAny | null; - - /** QueryConnectionConsensusStateResponse clientId */ - clientId?: string | null; - - /** QueryConnectionConsensusStateResponse proof */ - proof?: Uint8Array | null; - - /** QueryConnectionConsensusStateResponse proofHeight */ - proofHeight?: ibc.core.client.v1.IHeight | null; - } - - /** Represents a QueryConnectionConsensusStateResponse. */ - class QueryConnectionConsensusStateResponse implements IQueryConnectionConsensusStateResponse { - /** - * Constructs a new QueryConnectionConsensusStateResponse. - * @param [p] Properties to set - */ - constructor(p?: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse); - - /** QueryConnectionConsensusStateResponse consensusState. */ - public consensusState?: google.protobuf.IAny | null; - - /** QueryConnectionConsensusStateResponse clientId. */ - public clientId: string; - - /** QueryConnectionConsensusStateResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionConsensusStateResponse proofHeight. */ - public proofHeight?: ibc.core.client.v1.IHeight | null; - - /** - * Creates a new QueryConnectionConsensusStateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryConnectionConsensusStateResponse instance - */ - public static create( - properties?: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse, - ): ibc.core.connection.v1.QueryConnectionConsensusStateResponse; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @param m QueryConnectionConsensusStateResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): ibc.core.connection.v1.QueryConnectionConsensusStateResponse; - } - } - } - } -} - -/** Namespace ics23. */ -export namespace ics23 { - /** HashOp enum. */ - enum HashOp { - NO_HASH = 0, - SHA256 = 1, - SHA512 = 2, - KECCAK = 3, - RIPEMD160 = 4, - BITCOIN = 5, - } - - /** - * LengthOp defines how to process the key and value of the LeafOp - * to include length information. After encoding the length with the given - * algorithm, the length will be prepended to the key and value bytes. - * (Each one with it's own encoded length) - */ - enum LengthOp { - NO_PREFIX = 0, - VAR_PROTO = 1, - VAR_RLP = 2, - FIXED32_BIG = 3, - FIXED32_LITTLE = 4, - FIXED64_BIG = 5, - FIXED64_LITTLE = 6, - REQUIRE_32_BYTES = 7, - REQUIRE_64_BYTES = 8, - } - - /** Properties of an ExistenceProof. */ - interface IExistenceProof { - /** ExistenceProof key */ - key?: Uint8Array | null; - - /** ExistenceProof value */ - value?: Uint8Array | null; - - /** ExistenceProof leaf */ - leaf?: ics23.ILeafOp | null; - - /** ExistenceProof path */ - path?: ics23.IInnerOp[] | null; - } - - /** - * 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. - */ - class ExistenceProof implements IExistenceProof { - /** - * Constructs a new ExistenceProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.IExistenceProof); - - /** ExistenceProof key. */ - public key: Uint8Array; - - /** ExistenceProof value. */ - public value: Uint8Array; - - /** ExistenceProof leaf. */ - public leaf?: ics23.ILeafOp | null; - - /** ExistenceProof path. */ - public path: ics23.IInnerOp[]; - - /** - * Creates a new ExistenceProof instance using the specified properties. - * @param [properties] Properties to set - * @returns ExistenceProof instance - */ - public static create(properties?: ics23.IExistenceProof): ics23.ExistenceProof; - - /** - * Encodes the specified ExistenceProof message. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @param m ExistenceProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IExistenceProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.ExistenceProof; - } - - /** Properties of a NonExistenceProof. */ - interface INonExistenceProof { - /** NonExistenceProof key */ - key?: Uint8Array | null; - - /** NonExistenceProof left */ - left?: ics23.IExistenceProof | null; - - /** NonExistenceProof right */ - right?: ics23.IExistenceProof | null; - } - - /** Represents a NonExistenceProof. */ - class NonExistenceProof implements INonExistenceProof { - /** - * Constructs a new NonExistenceProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.INonExistenceProof); - - /** NonExistenceProof key. */ - public key: Uint8Array; - - /** NonExistenceProof left. */ - public left?: ics23.IExistenceProof | null; - - /** NonExistenceProof right. */ - public right?: ics23.IExistenceProof | null; - - /** - * Creates a new NonExistenceProof instance using the specified properties. - * @param [properties] Properties to set - * @returns NonExistenceProof instance - */ - public static create(properties?: ics23.INonExistenceProof): ics23.NonExistenceProof; - - /** - * Encodes the specified NonExistenceProof message. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @param m NonExistenceProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.INonExistenceProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.NonExistenceProof; - } - - /** Properties of a CommitmentProof. */ - interface ICommitmentProof { - /** CommitmentProof exist */ - exist?: ics23.IExistenceProof | null; - - /** CommitmentProof nonexist */ - nonexist?: ics23.INonExistenceProof | null; - - /** CommitmentProof batch */ - batch?: ics23.IBatchProof | null; - - /** CommitmentProof compressed */ - compressed?: ics23.ICompressedBatchProof | null; - } - - /** Represents a CommitmentProof. */ - class CommitmentProof implements ICommitmentProof { - /** - * Constructs a new CommitmentProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.ICommitmentProof); - - /** CommitmentProof exist. */ - public exist?: ics23.IExistenceProof | null; - - /** CommitmentProof nonexist. */ - public nonexist?: ics23.INonExistenceProof | null; - - /** CommitmentProof batch. */ - public batch?: ics23.IBatchProof | null; - - /** CommitmentProof compressed. */ - public compressed?: ics23.ICompressedBatchProof | null; - - /** CommitmentProof proof. */ - public proof?: "exist" | "nonexist" | "batch" | "compressed"; - - /** - * Creates a new CommitmentProof instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitmentProof instance - */ - public static create(properties?: ics23.ICommitmentProof): ics23.CommitmentProof; - - /** - * Encodes the specified CommitmentProof message. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @param m CommitmentProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ICommitmentProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.CommitmentProof; - } - - /** Properties of a LeafOp. */ - interface ILeafOp { - /** LeafOp hash */ - hash?: ics23.HashOp | null; - - /** LeafOp prehashKey */ - prehashKey?: ics23.HashOp | null; - - /** LeafOp prehashValue */ - prehashValue?: ics23.HashOp | null; - - /** LeafOp length */ - length?: ics23.LengthOp | null; - - /** LeafOp prefix */ - prefix?: Uint8Array | null; - } - - /** - * 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) - */ - class LeafOp implements ILeafOp { - /** - * Constructs a new LeafOp. - * @param [p] Properties to set - */ - constructor(p?: ics23.ILeafOp); - - /** LeafOp hash. */ - public hash: ics23.HashOp; - - /** LeafOp prehashKey. */ - public prehashKey: ics23.HashOp; - - /** LeafOp prehashValue. */ - public prehashValue: ics23.HashOp; - - /** LeafOp length. */ - public length: ics23.LengthOp; - - /** LeafOp prefix. */ - public prefix: Uint8Array; - - /** - * Creates a new LeafOp instance using the specified properties. - * @param [properties] Properties to set - * @returns LeafOp instance - */ - public static create(properties?: ics23.ILeafOp): ics23.LeafOp; - - /** - * Encodes the specified LeafOp message. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @param m LeafOp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ILeafOp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LeafOp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.LeafOp; - } - - /** Properties of an InnerOp. */ - interface IInnerOp { - /** InnerOp hash */ - hash?: ics23.HashOp | null; - - /** InnerOp prefix */ - prefix?: Uint8Array | null; - - /** InnerOp suffix */ - suffix?: Uint8Array | null; - } - - /** - * 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 - */ - class InnerOp implements IInnerOp { - /** - * Constructs a new InnerOp. - * @param [p] Properties to set - */ - constructor(p?: ics23.IInnerOp); - - /** InnerOp hash. */ - public hash: ics23.HashOp; - - /** InnerOp prefix. */ - public prefix: Uint8Array; - - /** InnerOp suffix. */ - public suffix: Uint8Array; - - /** - * Creates a new InnerOp instance using the specified properties. - * @param [properties] Properties to set - * @returns InnerOp instance - */ - public static create(properties?: ics23.IInnerOp): ics23.InnerOp; - - /** - * Encodes the specified InnerOp message. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @param m InnerOp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IInnerOp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InnerOp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.InnerOp; - } - - /** Properties of a ProofSpec. */ - interface IProofSpec { - /** ProofSpec leafSpec */ - leafSpec?: ics23.ILeafOp | null; - - /** ProofSpec innerSpec */ - innerSpec?: ics23.IInnerSpec | null; - - /** ProofSpec maxDepth */ - maxDepth?: number | null; - - /** ProofSpec minDepth */ - minDepth?: number | null; - } - - /** - * 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. - */ - class ProofSpec implements IProofSpec { - /** - * Constructs a new ProofSpec. - * @param [p] Properties to set - */ - constructor(p?: ics23.IProofSpec); - - /** ProofSpec leafSpec. */ - public leafSpec?: ics23.ILeafOp | null; - - /** ProofSpec innerSpec. */ - public innerSpec?: ics23.IInnerSpec | null; - - /** ProofSpec maxDepth. */ - public maxDepth: number; - - /** ProofSpec minDepth. */ - public minDepth: number; - - /** - * Creates a new ProofSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ProofSpec instance - */ - public static create(properties?: ics23.IProofSpec): ics23.ProofSpec; - - /** - * Encodes the specified ProofSpec message. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @param m ProofSpec message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IProofSpec, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofSpec message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.ProofSpec; - } - - /** Properties of an InnerSpec. */ - interface IInnerSpec { - /** InnerSpec childOrder */ - childOrder?: number[] | null; - - /** InnerSpec childSize */ - childSize?: number | null; - - /** InnerSpec minPrefixLength */ - minPrefixLength?: number | null; - - /** InnerSpec maxPrefixLength */ - maxPrefixLength?: number | null; - - /** InnerSpec emptyChild */ - emptyChild?: Uint8Array | null; - - /** InnerSpec hash */ - hash?: ics23.HashOp | null; - } - - /** Represents an InnerSpec. */ - class InnerSpec implements IInnerSpec { - /** - * Constructs a new InnerSpec. - * @param [p] Properties to set - */ - constructor(p?: ics23.IInnerSpec); - - /** InnerSpec childOrder. */ - public childOrder: number[]; - - /** InnerSpec childSize. */ - public childSize: number; - - /** InnerSpec minPrefixLength. */ - public minPrefixLength: number; - - /** InnerSpec maxPrefixLength. */ - public maxPrefixLength: number; - - /** InnerSpec emptyChild. */ - public emptyChild: Uint8Array; - - /** InnerSpec hash. */ - public hash: ics23.HashOp; - - /** - * Creates a new InnerSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns InnerSpec instance - */ - public static create(properties?: ics23.IInnerSpec): ics23.InnerSpec; - - /** - * Encodes the specified InnerSpec message. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @param m InnerSpec message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IInnerSpec, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InnerSpec message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.InnerSpec; - } - - /** Properties of a BatchProof. */ - interface IBatchProof { - /** BatchProof entries */ - entries?: ics23.IBatchEntry[] | null; - } - - /** Represents a BatchProof. */ - class BatchProof implements IBatchProof { - /** - * Constructs a new BatchProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.IBatchProof); - - /** BatchProof entries. */ - public entries: ics23.IBatchEntry[]; - - /** - * Creates a new BatchProof instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProof instance - */ - public static create(properties?: ics23.IBatchProof): ics23.BatchProof; - - /** - * Encodes the specified BatchProof message. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @param m BatchProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IBatchProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.BatchProof; - } - - /** Properties of a BatchEntry. */ - interface IBatchEntry { - /** BatchEntry exist */ - exist?: ics23.IExistenceProof | null; - - /** BatchEntry nonexist */ - nonexist?: ics23.INonExistenceProof | null; - } - - /** Represents a BatchEntry. */ - class BatchEntry implements IBatchEntry { - /** - * Constructs a new BatchEntry. - * @param [p] Properties to set - */ - constructor(p?: ics23.IBatchEntry); - - /** BatchEntry exist. */ - public exist?: ics23.IExistenceProof | null; - - /** BatchEntry nonexist. */ - public nonexist?: ics23.INonExistenceProof | null; - - /** BatchEntry proof. */ - public proof?: "exist" | "nonexist"; - - /** - * Creates a new BatchEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchEntry instance - */ - public static create(properties?: ics23.IBatchEntry): ics23.BatchEntry; - - /** - * Encodes the specified BatchEntry message. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @param m BatchEntry message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.IBatchEntry, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchEntry message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.BatchEntry; - } - - /** Properties of a CompressedBatchProof. */ - interface ICompressedBatchProof { - /** CompressedBatchProof entries */ - entries?: ics23.ICompressedBatchEntry[] | null; - - /** CompressedBatchProof lookupInners */ - lookupInners?: ics23.IInnerOp[] | null; - } - - /** Represents a CompressedBatchProof. */ - class CompressedBatchProof implements ICompressedBatchProof { - /** - * Constructs a new CompressedBatchProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.ICompressedBatchProof); - - /** CompressedBatchProof entries. */ - public entries: ics23.ICompressedBatchEntry[]; - - /** CompressedBatchProof lookupInners. */ - public lookupInners: ics23.IInnerOp[]; - - /** - * Creates a new CompressedBatchProof instance using the specified properties. - * @param [properties] Properties to set - * @returns CompressedBatchProof instance - */ - public static create(properties?: ics23.ICompressedBatchProof): ics23.CompressedBatchProof; - - /** - * Encodes the specified CompressedBatchProof message. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @param m CompressedBatchProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ICompressedBatchProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.CompressedBatchProof; - } - - /** Properties of a CompressedBatchEntry. */ - interface ICompressedBatchEntry { - /** CompressedBatchEntry exist */ - exist?: ics23.ICompressedExistenceProof | null; - - /** CompressedBatchEntry nonexist */ - nonexist?: ics23.ICompressedNonExistenceProof | null; - } - - /** Represents a CompressedBatchEntry. */ - class CompressedBatchEntry implements ICompressedBatchEntry { - /** - * Constructs a new CompressedBatchEntry. - * @param [p] Properties to set - */ - constructor(p?: ics23.ICompressedBatchEntry); - - /** CompressedBatchEntry exist. */ - public exist?: ics23.ICompressedExistenceProof | null; - - /** CompressedBatchEntry nonexist. */ - public nonexist?: ics23.ICompressedNonExistenceProof | null; - - /** CompressedBatchEntry proof. */ - public proof?: "exist" | "nonexist"; - - /** - * Creates a new CompressedBatchEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns CompressedBatchEntry instance - */ - public static create(properties?: ics23.ICompressedBatchEntry): ics23.CompressedBatchEntry; - - /** - * Encodes the specified CompressedBatchEntry message. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @param m CompressedBatchEntry message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ICompressedBatchEntry, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.CompressedBatchEntry; - } - - /** Properties of a CompressedExistenceProof. */ - interface ICompressedExistenceProof { - /** CompressedExistenceProof key */ - key?: Uint8Array | null; - - /** CompressedExistenceProof value */ - value?: Uint8Array | null; - - /** CompressedExistenceProof leaf */ - leaf?: ics23.ILeafOp | null; - - /** CompressedExistenceProof path */ - path?: number[] | null; - } - - /** Represents a CompressedExistenceProof. */ - class CompressedExistenceProof implements ICompressedExistenceProof { - /** - * Constructs a new CompressedExistenceProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.ICompressedExistenceProof); - - /** CompressedExistenceProof key. */ - public key: Uint8Array; - - /** CompressedExistenceProof value. */ - public value: Uint8Array; - - /** CompressedExistenceProof leaf. */ - public leaf?: ics23.ILeafOp | null; - - /** CompressedExistenceProof path. */ - public path: number[]; - - /** - * Creates a new CompressedExistenceProof instance using the specified properties. - * @param [properties] Properties to set - * @returns CompressedExistenceProof instance - */ - public static create(properties?: ics23.ICompressedExistenceProof): ics23.CompressedExistenceProof; - - /** - * Encodes the specified CompressedExistenceProof message. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @param m CompressedExistenceProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ICompressedExistenceProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.CompressedExistenceProof; - } - - /** Properties of a CompressedNonExistenceProof. */ - interface ICompressedNonExistenceProof { - /** CompressedNonExistenceProof key */ - key?: Uint8Array | null; - - /** CompressedNonExistenceProof left */ - left?: ics23.ICompressedExistenceProof | null; - - /** CompressedNonExistenceProof right */ - right?: ics23.ICompressedExistenceProof | null; - } - - /** Represents a CompressedNonExistenceProof. */ - class CompressedNonExistenceProof implements ICompressedNonExistenceProof { - /** - * Constructs a new CompressedNonExistenceProof. - * @param [p] Properties to set - */ - constructor(p?: ics23.ICompressedNonExistenceProof); - - /** CompressedNonExistenceProof key. */ - public key: Uint8Array; - - /** CompressedNonExistenceProof left. */ - public left?: ics23.ICompressedExistenceProof | null; - - /** CompressedNonExistenceProof right. */ - public right?: ics23.ICompressedExistenceProof | null; - - /** - * Creates a new CompressedNonExistenceProof instance using the specified properties. - * @param [properties] Properties to set - * @returns CompressedNonExistenceProof instance - */ - public static create(properties?: ics23.ICompressedNonExistenceProof): ics23.CompressedNonExistenceProof; - - /** - * Encodes the specified CompressedNonExistenceProof message. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @param m CompressedNonExistenceProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: ics23.ICompressedNonExistenceProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): ics23.CompressedNonExistenceProof; - } -} - -/** Namespace tendermint. */ -export namespace tendermint { - /** Namespace abci. */ - namespace abci { - /** Properties of a Request. */ - interface IRequest { - /** Request echo */ - echo?: tendermint.abci.IRequestEcho | null; - - /** Request flush */ - flush?: tendermint.abci.IRequestFlush | null; - - /** Request info */ - info?: tendermint.abci.IRequestInfo | null; - - /** Request setOption */ - setOption?: tendermint.abci.IRequestSetOption | null; - - /** Request initChain */ - initChain?: tendermint.abci.IRequestInitChain | null; - - /** Request query */ - query?: tendermint.abci.IRequestQuery | null; - - /** Request beginBlock */ - beginBlock?: tendermint.abci.IRequestBeginBlock | null; - - /** Request checkTx */ - checkTx?: tendermint.abci.IRequestCheckTx | null; - - /** Request deliverTx */ - deliverTx?: tendermint.abci.IRequestDeliverTx | null; - - /** Request endBlock */ - endBlock?: tendermint.abci.IRequestEndBlock | null; - - /** Request commit */ - commit?: tendermint.abci.IRequestCommit | null; - - /** Request listSnapshots */ - listSnapshots?: tendermint.abci.IRequestListSnapshots | null; - - /** Request offerSnapshot */ - offerSnapshot?: tendermint.abci.IRequestOfferSnapshot | null; - - /** Request loadSnapshotChunk */ - loadSnapshotChunk?: tendermint.abci.IRequestLoadSnapshotChunk | null; - - /** Request applySnapshotChunk */ - applySnapshotChunk?: tendermint.abci.IRequestApplySnapshotChunk | null; - } - - /** Represents a Request. */ - class Request implements IRequest { - /** - * Constructs a new Request. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequest); - - /** Request echo. */ - public echo?: tendermint.abci.IRequestEcho | null; - - /** Request flush. */ - public flush?: tendermint.abci.IRequestFlush | null; - - /** Request info. */ - public info?: tendermint.abci.IRequestInfo | null; - - /** Request setOption. */ - public setOption?: tendermint.abci.IRequestSetOption | null; - - /** Request initChain. */ - public initChain?: tendermint.abci.IRequestInitChain | null; - - /** Request query. */ - public query?: tendermint.abci.IRequestQuery | null; - - /** Request beginBlock. */ - public beginBlock?: tendermint.abci.IRequestBeginBlock | null; - - /** Request checkTx. */ - public checkTx?: tendermint.abci.IRequestCheckTx | null; - - /** Request deliverTx. */ - public deliverTx?: tendermint.abci.IRequestDeliverTx | null; - - /** Request endBlock. */ - public endBlock?: tendermint.abci.IRequestEndBlock | null; - - /** Request commit. */ - public commit?: tendermint.abci.IRequestCommit | null; - - /** Request listSnapshots. */ - public listSnapshots?: tendermint.abci.IRequestListSnapshots | null; - - /** Request offerSnapshot. */ - public offerSnapshot?: tendermint.abci.IRequestOfferSnapshot | null; - - /** Request loadSnapshotChunk. */ - public loadSnapshotChunk?: tendermint.abci.IRequestLoadSnapshotChunk | null; - - /** Request applySnapshotChunk. */ - public applySnapshotChunk?: tendermint.abci.IRequestApplySnapshotChunk | null; - - /** Request value. */ - public value?: - | "echo" - | "flush" - | "info" - | "setOption" - | "initChain" - | "query" - | "beginBlock" - | "checkTx" - | "deliverTx" - | "endBlock" - | "commit" - | "listSnapshots" - | "offerSnapshot" - | "loadSnapshotChunk" - | "applySnapshotChunk"; - - /** - * Creates a new Request instance using the specified properties. - * @param [properties] Properties to set - * @returns Request instance - */ - public static create(properties?: tendermint.abci.IRequest): tendermint.abci.Request; - - /** - * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. - * @param m Request message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequest, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Request message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Request - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Request; - } - - /** Properties of a RequestEcho. */ - interface IRequestEcho { - /** RequestEcho message */ - message?: string | null; - } - - /** Represents a RequestEcho. */ - class RequestEcho implements IRequestEcho { - /** - * Constructs a new RequestEcho. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestEcho); - - /** RequestEcho message. */ - public message: string; - - /** - * Creates a new RequestEcho instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestEcho instance - */ - public static create(properties?: tendermint.abci.IRequestEcho): tendermint.abci.RequestEcho; - - /** - * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. - * @param m RequestEcho message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestEcho, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestEcho message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestEcho; - } - - /** Properties of a RequestFlush. */ - interface IRequestFlush {} - - /** Represents a RequestFlush. */ - class RequestFlush implements IRequestFlush { - /** - * Constructs a new RequestFlush. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestFlush); - - /** - * Creates a new RequestFlush instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestFlush instance - */ - public static create(properties?: tendermint.abci.IRequestFlush): tendermint.abci.RequestFlush; - - /** - * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. - * @param m RequestFlush message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestFlush, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestFlush message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestFlush; - } - - /** Properties of a RequestInfo. */ - interface IRequestInfo { - /** RequestInfo version */ - version?: string | null; - - /** RequestInfo blockVersion */ - blockVersion?: Long | null; - - /** RequestInfo p2pVersion */ - p2pVersion?: Long | null; - } - - /** Represents a RequestInfo. */ - class RequestInfo implements IRequestInfo { - /** - * Constructs a new RequestInfo. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestInfo); - - /** RequestInfo version. */ - public version: string; - - /** RequestInfo blockVersion. */ - public blockVersion: Long; - - /** RequestInfo p2pVersion. */ - public p2pVersion: Long; - - /** - * Creates a new RequestInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestInfo instance - */ - public static create(properties?: tendermint.abci.IRequestInfo): tendermint.abci.RequestInfo; - - /** - * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. - * @param m RequestInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestInfo; - } - - /** Properties of a RequestSetOption. */ - interface IRequestSetOption { - /** RequestSetOption key */ - key?: string | null; - - /** RequestSetOption value */ - value?: string | null; - } - - /** Represents a RequestSetOption. */ - class RequestSetOption implements IRequestSetOption { - /** - * Constructs a new RequestSetOption. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestSetOption); - - /** RequestSetOption key. */ - public key: string; - - /** RequestSetOption value. */ - public value: string; - - /** - * Creates a new RequestSetOption instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestSetOption instance - */ - public static create(properties?: tendermint.abci.IRequestSetOption): tendermint.abci.RequestSetOption; - - /** - * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. - * @param m RequestSetOption message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestSetOption, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestSetOption message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestSetOption; - } - - /** Properties of a RequestInitChain. */ - interface IRequestInitChain { - /** RequestInitChain time */ - time?: google.protobuf.ITimestamp | null; - - /** RequestInitChain chainId */ - chainId?: string | null; - - /** RequestInitChain consensusParams */ - consensusParams?: tendermint.abci.IConsensusParams | null; - - /** RequestInitChain validators */ - validators?: tendermint.abci.IValidatorUpdate[] | null; - - /** RequestInitChain appStateBytes */ - appStateBytes?: Uint8Array | null; - - /** RequestInitChain initialHeight */ - initialHeight?: Long | null; - } - - /** Represents a RequestInitChain. */ - class RequestInitChain implements IRequestInitChain { - /** - * Constructs a new RequestInitChain. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestInitChain); - - /** RequestInitChain time. */ - public time?: google.protobuf.ITimestamp | null; - - /** RequestInitChain chainId. */ - public chainId: string; - - /** RequestInitChain consensusParams. */ - public consensusParams?: tendermint.abci.IConsensusParams | null; - - /** RequestInitChain validators. */ - public validators: tendermint.abci.IValidatorUpdate[]; - - /** RequestInitChain appStateBytes. */ - public appStateBytes: Uint8Array; - - /** RequestInitChain initialHeight. */ - public initialHeight: Long; - - /** - * Creates a new RequestInitChain instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestInitChain instance - */ - public static create(properties?: tendermint.abci.IRequestInitChain): tendermint.abci.RequestInitChain; - - /** - * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. - * @param m RequestInitChain message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestInitChain, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestInitChain message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestInitChain; - } - - /** Properties of a RequestQuery. */ - interface IRequestQuery { - /** RequestQuery data */ - data?: Uint8Array | null; - - /** RequestQuery path */ - path?: string | null; - - /** RequestQuery height */ - height?: Long | null; - - /** RequestQuery prove */ - prove?: boolean | null; - } - - /** Represents a RequestQuery. */ - class RequestQuery implements IRequestQuery { - /** - * Constructs a new RequestQuery. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestQuery); - - /** RequestQuery data. */ - public data: Uint8Array; - - /** RequestQuery path. */ - public path: string; - - /** RequestQuery height. */ - public height: Long; - - /** RequestQuery prove. */ - public prove: boolean; - - /** - * Creates a new RequestQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestQuery instance - */ - public static create(properties?: tendermint.abci.IRequestQuery): tendermint.abci.RequestQuery; - - /** - * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. - * @param m RequestQuery message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestQuery, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestQuery message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestQuery; - } - - /** Properties of a RequestBeginBlock. */ - interface IRequestBeginBlock { - /** RequestBeginBlock hash */ - hash?: Uint8Array | null; - - /** RequestBeginBlock header */ - header?: tendermint.types.IHeader | null; - - /** RequestBeginBlock lastCommitInfo */ - lastCommitInfo?: tendermint.abci.ILastCommitInfo | null; - - /** RequestBeginBlock byzantineValidators */ - byzantineValidators?: tendermint.abci.IEvidence[] | null; - } - - /** Represents a RequestBeginBlock. */ - class RequestBeginBlock implements IRequestBeginBlock { - /** - * Constructs a new RequestBeginBlock. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestBeginBlock); - - /** RequestBeginBlock hash. */ - public hash: Uint8Array; - - /** RequestBeginBlock header. */ - public header?: tendermint.types.IHeader | null; - - /** RequestBeginBlock lastCommitInfo. */ - public lastCommitInfo?: tendermint.abci.ILastCommitInfo | null; - - /** RequestBeginBlock byzantineValidators. */ - public byzantineValidators: tendermint.abci.IEvidence[]; - - /** - * Creates a new RequestBeginBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestBeginBlock instance - */ - public static create( - properties?: tendermint.abci.IRequestBeginBlock, - ): tendermint.abci.RequestBeginBlock; - - /** - * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. - * @param m RequestBeginBlock message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestBeginBlock, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestBeginBlock message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestBeginBlock; - } - - /** CheckTxType enum. */ - enum CheckTxType { - NEW = 0, - RECHECK = 1, - } - - /** Properties of a RequestCheckTx. */ - interface IRequestCheckTx { - /** RequestCheckTx tx */ - tx?: Uint8Array | null; - - /** RequestCheckTx type */ - type?: tendermint.abci.CheckTxType | null; - } - - /** Represents a RequestCheckTx. */ - class RequestCheckTx implements IRequestCheckTx { - /** - * Constructs a new RequestCheckTx. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestCheckTx); - - /** RequestCheckTx tx. */ - public tx: Uint8Array; - - /** RequestCheckTx type. */ - public type: tendermint.abci.CheckTxType; - - /** - * Creates a new RequestCheckTx instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestCheckTx instance - */ - public static create(properties?: tendermint.abci.IRequestCheckTx): tendermint.abci.RequestCheckTx; - - /** - * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. - * @param m RequestCheckTx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestCheckTx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestCheckTx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestCheckTx; - } - - /** Properties of a RequestDeliverTx. */ - interface IRequestDeliverTx { - /** RequestDeliverTx tx */ - tx?: Uint8Array | null; - } - - /** Represents a RequestDeliverTx. */ - class RequestDeliverTx implements IRequestDeliverTx { - /** - * Constructs a new RequestDeliverTx. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestDeliverTx); - - /** RequestDeliverTx tx. */ - public tx: Uint8Array; - - /** - * Creates a new RequestDeliverTx instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestDeliverTx instance - */ - public static create(properties?: tendermint.abci.IRequestDeliverTx): tendermint.abci.RequestDeliverTx; - - /** - * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. - * @param m RequestDeliverTx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestDeliverTx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestDeliverTx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestDeliverTx; - } - - /** Properties of a RequestEndBlock. */ - interface IRequestEndBlock { - /** RequestEndBlock height */ - height?: Long | null; - } - - /** Represents a RequestEndBlock. */ - class RequestEndBlock implements IRequestEndBlock { - /** - * Constructs a new RequestEndBlock. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestEndBlock); - - /** RequestEndBlock height. */ - public height: Long; - - /** - * Creates a new RequestEndBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestEndBlock instance - */ - public static create(properties?: tendermint.abci.IRequestEndBlock): tendermint.abci.RequestEndBlock; - - /** - * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. - * @param m RequestEndBlock message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestEndBlock, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestEndBlock message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestEndBlock; - } - - /** Properties of a RequestCommit. */ - interface IRequestCommit {} - - /** Represents a RequestCommit. */ - class RequestCommit implements IRequestCommit { - /** - * Constructs a new RequestCommit. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestCommit); - - /** - * Creates a new RequestCommit instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestCommit instance - */ - public static create(properties?: tendermint.abci.IRequestCommit): tendermint.abci.RequestCommit; - - /** - * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. - * @param m RequestCommit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestCommit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestCommit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.RequestCommit; - } - - /** Properties of a RequestListSnapshots. */ - interface IRequestListSnapshots {} - - /** Represents a RequestListSnapshots. */ - class RequestListSnapshots implements IRequestListSnapshots { - /** - * Constructs a new RequestListSnapshots. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestListSnapshots); - - /** - * Creates a new RequestListSnapshots instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestListSnapshots instance - */ - public static create( - properties?: tendermint.abci.IRequestListSnapshots, - ): tendermint.abci.RequestListSnapshots; - - /** - * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. - * @param m RequestListSnapshots message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestListSnapshots, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestListSnapshots message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.RequestListSnapshots; - } - - /** Properties of a RequestOfferSnapshot. */ - interface IRequestOfferSnapshot { - /** RequestOfferSnapshot snapshot */ - snapshot?: tendermint.abci.ISnapshot | null; - - /** RequestOfferSnapshot appHash */ - appHash?: Uint8Array | null; - } - - /** Represents a RequestOfferSnapshot. */ - class RequestOfferSnapshot implements IRequestOfferSnapshot { - /** - * Constructs a new RequestOfferSnapshot. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestOfferSnapshot); - - /** RequestOfferSnapshot snapshot. */ - public snapshot?: tendermint.abci.ISnapshot | null; - - /** RequestOfferSnapshot appHash. */ - public appHash: Uint8Array; - - /** - * Creates a new RequestOfferSnapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestOfferSnapshot instance - */ - public static create( - properties?: tendermint.abci.IRequestOfferSnapshot, - ): tendermint.abci.RequestOfferSnapshot; - - /** - * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. - * @param m RequestOfferSnapshot message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IRequestOfferSnapshot, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestOfferSnapshot message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.RequestOfferSnapshot; - } - - /** Properties of a RequestLoadSnapshotChunk. */ - interface IRequestLoadSnapshotChunk { - /** RequestLoadSnapshotChunk height */ - height?: Long | null; - - /** RequestLoadSnapshotChunk format */ - format?: number | null; - - /** RequestLoadSnapshotChunk chunk */ - chunk?: number | null; - } - - /** Represents a RequestLoadSnapshotChunk. */ - class RequestLoadSnapshotChunk implements IRequestLoadSnapshotChunk { - /** - * Constructs a new RequestLoadSnapshotChunk. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestLoadSnapshotChunk); - - /** RequestLoadSnapshotChunk height. */ - public height: Long; - - /** RequestLoadSnapshotChunk format. */ - public format: number; - - /** RequestLoadSnapshotChunk chunk. */ - public chunk: number; - - /** - * Creates a new RequestLoadSnapshotChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestLoadSnapshotChunk instance - */ - public static create( - properties?: tendermint.abci.IRequestLoadSnapshotChunk, - ): tendermint.abci.RequestLoadSnapshotChunk; - - /** - * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. - * @param m RequestLoadSnapshotChunk message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: tendermint.abci.IRequestLoadSnapshotChunk, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.RequestLoadSnapshotChunk; - } - - /** Properties of a RequestApplySnapshotChunk. */ - interface IRequestApplySnapshotChunk { - /** RequestApplySnapshotChunk index */ - index?: number | null; - - /** RequestApplySnapshotChunk chunk */ - chunk?: Uint8Array | null; - - /** RequestApplySnapshotChunk sender */ - sender?: string | null; - } - - /** Represents a RequestApplySnapshotChunk. */ - class RequestApplySnapshotChunk implements IRequestApplySnapshotChunk { - /** - * Constructs a new RequestApplySnapshotChunk. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IRequestApplySnapshotChunk); - - /** RequestApplySnapshotChunk index. */ - public index: number; - - /** RequestApplySnapshotChunk chunk. */ - public chunk: Uint8Array; - - /** RequestApplySnapshotChunk sender. */ - public sender: string; - - /** - * Creates a new RequestApplySnapshotChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestApplySnapshotChunk instance - */ - public static create( - properties?: tendermint.abci.IRequestApplySnapshotChunk, - ): tendermint.abci.RequestApplySnapshotChunk; - - /** - * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. - * @param m RequestApplySnapshotChunk message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: tendermint.abci.IRequestApplySnapshotChunk, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns RequestApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.RequestApplySnapshotChunk; - } - - /** Properties of a Response. */ - interface IResponse { - /** Response exception */ - exception?: tendermint.abci.IResponseException | null; - - /** Response echo */ - echo?: tendermint.abci.IResponseEcho | null; - - /** Response flush */ - flush?: tendermint.abci.IResponseFlush | null; - - /** Response info */ - info?: tendermint.abci.IResponseInfo | null; - - /** Response setOption */ - setOption?: tendermint.abci.IResponseSetOption | null; - - /** Response initChain */ - initChain?: tendermint.abci.IResponseInitChain | null; - - /** Response query */ - query?: tendermint.abci.IResponseQuery | null; - - /** Response beginBlock */ - beginBlock?: tendermint.abci.IResponseBeginBlock | null; - - /** Response checkTx */ - checkTx?: tendermint.abci.IResponseCheckTx | null; - - /** Response deliverTx */ - deliverTx?: tendermint.abci.IResponseDeliverTx | null; - - /** Response endBlock */ - endBlock?: tendermint.abci.IResponseEndBlock | null; - - /** Response commit */ - commit?: tendermint.abci.IResponseCommit | null; - - /** Response listSnapshots */ - listSnapshots?: tendermint.abci.IResponseListSnapshots | null; - - /** Response offerSnapshot */ - offerSnapshot?: tendermint.abci.IResponseOfferSnapshot | null; - - /** Response loadSnapshotChunk */ - loadSnapshotChunk?: tendermint.abci.IResponseLoadSnapshotChunk | null; - - /** Response applySnapshotChunk */ - applySnapshotChunk?: tendermint.abci.IResponseApplySnapshotChunk | null; - } - - /** Represents a Response. */ - class Response implements IResponse { - /** - * Constructs a new Response. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponse); - - /** Response exception. */ - public exception?: tendermint.abci.IResponseException | null; - - /** Response echo. */ - public echo?: tendermint.abci.IResponseEcho | null; - - /** Response flush. */ - public flush?: tendermint.abci.IResponseFlush | null; - - /** Response info. */ - public info?: tendermint.abci.IResponseInfo | null; - - /** Response setOption. */ - public setOption?: tendermint.abci.IResponseSetOption | null; - - /** Response initChain. */ - public initChain?: tendermint.abci.IResponseInitChain | null; - - /** Response query. */ - public query?: tendermint.abci.IResponseQuery | null; - - /** Response beginBlock. */ - public beginBlock?: tendermint.abci.IResponseBeginBlock | null; - - /** Response checkTx. */ - public checkTx?: tendermint.abci.IResponseCheckTx | null; - - /** Response deliverTx. */ - public deliverTx?: tendermint.abci.IResponseDeliverTx | null; - - /** Response endBlock. */ - public endBlock?: tendermint.abci.IResponseEndBlock | null; - - /** Response commit. */ - public commit?: tendermint.abci.IResponseCommit | null; - - /** Response listSnapshots. */ - public listSnapshots?: tendermint.abci.IResponseListSnapshots | null; - - /** Response offerSnapshot. */ - public offerSnapshot?: tendermint.abci.IResponseOfferSnapshot | null; - - /** Response loadSnapshotChunk. */ - public loadSnapshotChunk?: tendermint.abci.IResponseLoadSnapshotChunk | null; - - /** Response applySnapshotChunk. */ - public applySnapshotChunk?: tendermint.abci.IResponseApplySnapshotChunk | null; - - /** Response value. */ - public value?: - | "exception" - | "echo" - | "flush" - | "info" - | "setOption" - | "initChain" - | "query" - | "beginBlock" - | "checkTx" - | "deliverTx" - | "endBlock" - | "commit" - | "listSnapshots" - | "offerSnapshot" - | "loadSnapshotChunk" - | "applySnapshotChunk"; - - /** - * Creates a new Response instance using the specified properties. - * @param [properties] Properties to set - * @returns Response instance - */ - public static create(properties?: tendermint.abci.IResponse): tendermint.abci.Response; - - /** - * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. - * @param m Response message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponse, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Response message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Response; - } - - /** Properties of a ResponseException. */ - interface IResponseException { - /** ResponseException error */ - error?: string | null; - } - - /** Represents a ResponseException. */ - class ResponseException implements IResponseException { - /** - * Constructs a new ResponseException. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseException); - - /** ResponseException error. */ - public error: string; - - /** - * Creates a new ResponseException instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseException instance - */ - public static create( - properties?: tendermint.abci.IResponseException, - ): tendermint.abci.ResponseException; - - /** - * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. - * @param m ResponseException message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseException, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseException message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseException - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseException; - } - - /** Properties of a ResponseEcho. */ - interface IResponseEcho { - /** ResponseEcho message */ - message?: string | null; - } - - /** Represents a ResponseEcho. */ - class ResponseEcho implements IResponseEcho { - /** - * Constructs a new ResponseEcho. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseEcho); - - /** ResponseEcho message. */ - public message: string; - - /** - * Creates a new ResponseEcho instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseEcho instance - */ - public static create(properties?: tendermint.abci.IResponseEcho): tendermint.abci.ResponseEcho; - - /** - * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. - * @param m ResponseEcho message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseEcho, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseEcho message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseEcho; - } - - /** Properties of a ResponseFlush. */ - interface IResponseFlush {} - - /** Represents a ResponseFlush. */ - class ResponseFlush implements IResponseFlush { - /** - * Constructs a new ResponseFlush. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseFlush); - - /** - * Creates a new ResponseFlush instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseFlush instance - */ - public static create(properties?: tendermint.abci.IResponseFlush): tendermint.abci.ResponseFlush; - - /** - * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. - * @param m ResponseFlush message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseFlush, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseFlush message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseFlush; - } - - /** Properties of a ResponseInfo. */ - interface IResponseInfo { - /** ResponseInfo data */ - data?: string | null; - - /** ResponseInfo version */ - version?: string | null; - - /** ResponseInfo appVersion */ - appVersion?: Long | null; - - /** ResponseInfo lastBlockHeight */ - lastBlockHeight?: Long | null; - - /** ResponseInfo lastBlockAppHash */ - lastBlockAppHash?: Uint8Array | null; - } - - /** Represents a ResponseInfo. */ - class ResponseInfo implements IResponseInfo { - /** - * Constructs a new ResponseInfo. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseInfo); - - /** ResponseInfo data. */ - public data: string; - - /** ResponseInfo version. */ - public version: string; - - /** ResponseInfo appVersion. */ - public appVersion: Long; - - /** ResponseInfo lastBlockHeight. */ - public lastBlockHeight: Long; - - /** ResponseInfo lastBlockAppHash. */ - public lastBlockAppHash: Uint8Array; - - /** - * Creates a new ResponseInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseInfo instance - */ - public static create(properties?: tendermint.abci.IResponseInfo): tendermint.abci.ResponseInfo; - - /** - * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. - * @param m ResponseInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseInfo; - } - - /** Properties of a ResponseSetOption. */ - interface IResponseSetOption { - /** ResponseSetOption code */ - code?: number | null; - - /** ResponseSetOption log */ - log?: string | null; - - /** ResponseSetOption info */ - info?: string | null; - } - - /** Represents a ResponseSetOption. */ - class ResponseSetOption implements IResponseSetOption { - /** - * Constructs a new ResponseSetOption. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseSetOption); - - /** ResponseSetOption code. */ - public code: number; - - /** ResponseSetOption log. */ - public log: string; - - /** ResponseSetOption info. */ - public info: string; - - /** - * Creates a new ResponseSetOption instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseSetOption instance - */ - public static create( - properties?: tendermint.abci.IResponseSetOption, - ): tendermint.abci.ResponseSetOption; - - /** - * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. - * @param m ResponseSetOption message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseSetOption, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseSetOption message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseSetOption; - } - - /** Properties of a ResponseInitChain. */ - interface IResponseInitChain { - /** ResponseInitChain consensusParams */ - consensusParams?: tendermint.abci.IConsensusParams | null; - - /** ResponseInitChain validators */ - validators?: tendermint.abci.IValidatorUpdate[] | null; - - /** ResponseInitChain appHash */ - appHash?: Uint8Array | null; - } - - /** Represents a ResponseInitChain. */ - class ResponseInitChain implements IResponseInitChain { - /** - * Constructs a new ResponseInitChain. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseInitChain); - - /** ResponseInitChain consensusParams. */ - public consensusParams?: tendermint.abci.IConsensusParams | null; - - /** ResponseInitChain validators. */ - public validators: tendermint.abci.IValidatorUpdate[]; - - /** ResponseInitChain appHash. */ - public appHash: Uint8Array; - - /** - * Creates a new ResponseInitChain instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseInitChain instance - */ - public static create( - properties?: tendermint.abci.IResponseInitChain, - ): tendermint.abci.ResponseInitChain; - - /** - * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. - * @param m ResponseInitChain message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseInitChain, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseInitChain message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseInitChain; - } - - /** Properties of a ResponseQuery. */ - interface IResponseQuery { - /** ResponseQuery code */ - code?: number | null; - - /** ResponseQuery log */ - log?: string | null; - - /** ResponseQuery info */ - info?: string | null; - - /** ResponseQuery index */ - index?: Long | null; - - /** ResponseQuery key */ - key?: Uint8Array | null; - - /** ResponseQuery value */ - value?: Uint8Array | null; - - /** ResponseQuery proofOps */ - proofOps?: tendermint.crypto.IProofOps | null; - - /** ResponseQuery height */ - height?: Long | null; - - /** ResponseQuery codespace */ - codespace?: string | null; - } - - /** Represents a ResponseQuery. */ - class ResponseQuery implements IResponseQuery { - /** - * Constructs a new ResponseQuery. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseQuery); - - /** ResponseQuery code. */ - public code: number; - - /** ResponseQuery log. */ - public log: string; - - /** ResponseQuery info. */ - public info: string; - - /** ResponseQuery index. */ - public index: Long; - - /** ResponseQuery key. */ - public key: Uint8Array; - - /** ResponseQuery value. */ - public value: Uint8Array; - - /** ResponseQuery proofOps. */ - public proofOps?: tendermint.crypto.IProofOps | null; - - /** ResponseQuery height. */ - public height: Long; - - /** ResponseQuery codespace. */ - public codespace: string; - - /** - * Creates a new ResponseQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseQuery instance - */ - public static create(properties?: tendermint.abci.IResponseQuery): tendermint.abci.ResponseQuery; - - /** - * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. - * @param m ResponseQuery message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseQuery, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseQuery message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseQuery; - } - - /** Properties of a ResponseBeginBlock. */ - interface IResponseBeginBlock { - /** ResponseBeginBlock events */ - events?: tendermint.abci.IEvent[] | null; - } - - /** Represents a ResponseBeginBlock. */ - class ResponseBeginBlock implements IResponseBeginBlock { - /** - * Constructs a new ResponseBeginBlock. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseBeginBlock); - - /** ResponseBeginBlock events. */ - public events: tendermint.abci.IEvent[]; - - /** - * Creates a new ResponseBeginBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseBeginBlock instance - */ - public static create( - properties?: tendermint.abci.IResponseBeginBlock, - ): tendermint.abci.ResponseBeginBlock; - - /** - * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. - * @param m ResponseBeginBlock message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseBeginBlock, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseBeginBlock message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseBeginBlock; - } - - /** Properties of a ResponseCheckTx. */ - interface IResponseCheckTx { - /** ResponseCheckTx code */ - code?: number | null; - - /** ResponseCheckTx data */ - data?: Uint8Array | null; - - /** ResponseCheckTx log */ - log?: string | null; - - /** ResponseCheckTx info */ - info?: string | null; - - /** ResponseCheckTx gasWanted */ - gasWanted?: Long | null; - - /** ResponseCheckTx gasUsed */ - gasUsed?: Long | null; - - /** ResponseCheckTx events */ - events?: tendermint.abci.IEvent[] | null; - - /** ResponseCheckTx codespace */ - codespace?: string | null; - } - - /** Represents a ResponseCheckTx. */ - class ResponseCheckTx implements IResponseCheckTx { - /** - * Constructs a new ResponseCheckTx. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseCheckTx); - - /** ResponseCheckTx code. */ - public code: number; - - /** ResponseCheckTx data. */ - public data: Uint8Array; - - /** ResponseCheckTx log. */ - public log: string; - - /** ResponseCheckTx info. */ - public info: string; - - /** ResponseCheckTx gasWanted. */ - public gasWanted: Long; - - /** ResponseCheckTx gasUsed. */ - public gasUsed: Long; - - /** ResponseCheckTx events. */ - public events: tendermint.abci.IEvent[]; - - /** ResponseCheckTx codespace. */ - public codespace: string; - - /** - * Creates a new ResponseCheckTx instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseCheckTx instance - */ - public static create(properties?: tendermint.abci.IResponseCheckTx): tendermint.abci.ResponseCheckTx; - - /** - * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. - * @param m ResponseCheckTx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseCheckTx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseCheckTx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseCheckTx; - } - - /** Properties of a ResponseDeliverTx. */ - interface IResponseDeliverTx { - /** ResponseDeliverTx code */ - code?: number | null; - - /** ResponseDeliverTx data */ - data?: Uint8Array | null; - - /** ResponseDeliverTx log */ - log?: string | null; - - /** ResponseDeliverTx info */ - info?: string | null; - - /** ResponseDeliverTx gasWanted */ - gasWanted?: Long | null; - - /** ResponseDeliverTx gasUsed */ - gasUsed?: Long | null; - - /** ResponseDeliverTx events */ - events?: tendermint.abci.IEvent[] | null; - - /** ResponseDeliverTx codespace */ - codespace?: string | null; - } - - /** Represents a ResponseDeliverTx. */ - class ResponseDeliverTx implements IResponseDeliverTx { - /** - * Constructs a new ResponseDeliverTx. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseDeliverTx); - - /** ResponseDeliverTx code. */ - public code: number; - - /** ResponseDeliverTx data. */ - public data: Uint8Array; - - /** ResponseDeliverTx log. */ - public log: string; - - /** ResponseDeliverTx info. */ - public info: string; - - /** ResponseDeliverTx gasWanted. */ - public gasWanted: Long; - - /** ResponseDeliverTx gasUsed. */ - public gasUsed: Long; - - /** ResponseDeliverTx events. */ - public events: tendermint.abci.IEvent[]; - - /** ResponseDeliverTx codespace. */ - public codespace: string; - - /** - * Creates a new ResponseDeliverTx instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseDeliverTx instance - */ - public static create( - properties?: tendermint.abci.IResponseDeliverTx, - ): tendermint.abci.ResponseDeliverTx; - - /** - * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. - * @param m ResponseDeliverTx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseDeliverTx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseDeliverTx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseDeliverTx; - } - - /** Properties of a ResponseEndBlock. */ - interface IResponseEndBlock { - /** ResponseEndBlock validatorUpdates */ - validatorUpdates?: tendermint.abci.IValidatorUpdate[] | null; - - /** ResponseEndBlock consensusParamUpdates */ - consensusParamUpdates?: tendermint.abci.IConsensusParams | null; - - /** ResponseEndBlock events */ - events?: tendermint.abci.IEvent[] | null; - } - - /** Represents a ResponseEndBlock. */ - class ResponseEndBlock implements IResponseEndBlock { - /** - * Constructs a new ResponseEndBlock. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseEndBlock); - - /** ResponseEndBlock validatorUpdates. */ - public validatorUpdates: tendermint.abci.IValidatorUpdate[]; - - /** ResponseEndBlock consensusParamUpdates. */ - public consensusParamUpdates?: tendermint.abci.IConsensusParams | null; - - /** ResponseEndBlock events. */ - public events: tendermint.abci.IEvent[]; - - /** - * Creates a new ResponseEndBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseEndBlock instance - */ - public static create(properties?: tendermint.abci.IResponseEndBlock): tendermint.abci.ResponseEndBlock; - - /** - * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. - * @param m ResponseEndBlock message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseEndBlock, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseEndBlock message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseEndBlock; - } - - /** Properties of a ResponseCommit. */ - interface IResponseCommit { - /** ResponseCommit data */ - data?: Uint8Array | null; - - /** ResponseCommit retainHeight */ - retainHeight?: Long | null; - } - - /** Represents a ResponseCommit. */ - class ResponseCommit implements IResponseCommit { - /** - * Constructs a new ResponseCommit. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseCommit); - - /** ResponseCommit data. */ - public data: Uint8Array; - - /** ResponseCommit retainHeight. */ - public retainHeight: Long; - - /** - * Creates a new ResponseCommit instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseCommit instance - */ - public static create(properties?: tendermint.abci.IResponseCommit): tendermint.abci.ResponseCommit; - - /** - * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. - * @param m ResponseCommit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseCommit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseCommit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ResponseCommit; - } - - /** Properties of a ResponseListSnapshots. */ - interface IResponseListSnapshots { - /** ResponseListSnapshots snapshots */ - snapshots?: tendermint.abci.ISnapshot[] | null; - } - - /** Represents a ResponseListSnapshots. */ - class ResponseListSnapshots implements IResponseListSnapshots { - /** - * Constructs a new ResponseListSnapshots. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseListSnapshots); - - /** ResponseListSnapshots snapshots. */ - public snapshots: tendermint.abci.ISnapshot[]; - - /** - * Creates a new ResponseListSnapshots instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseListSnapshots instance - */ - public static create( - properties?: tendermint.abci.IResponseListSnapshots, - ): tendermint.abci.ResponseListSnapshots; - - /** - * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. - * @param m ResponseListSnapshots message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseListSnapshots, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseListSnapshots message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.ResponseListSnapshots; - } - - /** Properties of a ResponseOfferSnapshot. */ - interface IResponseOfferSnapshot { - /** ResponseOfferSnapshot result */ - result?: tendermint.abci.ResponseOfferSnapshot.Result | null; - } - - /** Represents a ResponseOfferSnapshot. */ - class ResponseOfferSnapshot implements IResponseOfferSnapshot { - /** - * Constructs a new ResponseOfferSnapshot. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseOfferSnapshot); - - /** ResponseOfferSnapshot result. */ - public result: tendermint.abci.ResponseOfferSnapshot.Result; - - /** - * Creates a new ResponseOfferSnapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseOfferSnapshot instance - */ - public static create( - properties?: tendermint.abci.IResponseOfferSnapshot, - ): tendermint.abci.ResponseOfferSnapshot; - - /** - * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. - * @param m ResponseOfferSnapshot message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IResponseOfferSnapshot, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.ResponseOfferSnapshot; - } - - namespace ResponseOfferSnapshot { - /** Result enum. */ - enum Result { - UNKNOWN = 0, - ACCEPT = 1, - ABORT = 2, - REJECT = 3, - REJECT_FORMAT = 4, - REJECT_SENDER = 5, - } - } - - /** Properties of a ResponseLoadSnapshotChunk. */ - interface IResponseLoadSnapshotChunk { - /** ResponseLoadSnapshotChunk chunk */ - chunk?: Uint8Array | null; - } - - /** Represents a ResponseLoadSnapshotChunk. */ - class ResponseLoadSnapshotChunk implements IResponseLoadSnapshotChunk { - /** - * Constructs a new ResponseLoadSnapshotChunk. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseLoadSnapshotChunk); - - /** ResponseLoadSnapshotChunk chunk. */ - public chunk: Uint8Array; - - /** - * Creates a new ResponseLoadSnapshotChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseLoadSnapshotChunk instance - */ - public static create( - properties?: tendermint.abci.IResponseLoadSnapshotChunk, - ): tendermint.abci.ResponseLoadSnapshotChunk; - - /** - * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. - * @param m ResponseLoadSnapshotChunk message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: tendermint.abci.IResponseLoadSnapshotChunk, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.ResponseLoadSnapshotChunk; - } - - /** Properties of a ResponseApplySnapshotChunk. */ - interface IResponseApplySnapshotChunk { - /** ResponseApplySnapshotChunk result */ - result?: tendermint.abci.ResponseApplySnapshotChunk.Result | null; - - /** ResponseApplySnapshotChunk refetchChunks */ - refetchChunks?: number[] | null; - - /** ResponseApplySnapshotChunk rejectSenders */ - rejectSenders?: string[] | null; - } - - /** Represents a ResponseApplySnapshotChunk. */ - class ResponseApplySnapshotChunk implements IResponseApplySnapshotChunk { - /** - * Constructs a new ResponseApplySnapshotChunk. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IResponseApplySnapshotChunk); - - /** ResponseApplySnapshotChunk result. */ - public result: tendermint.abci.ResponseApplySnapshotChunk.Result; - - /** ResponseApplySnapshotChunk refetchChunks. */ - public refetchChunks: number[]; - - /** ResponseApplySnapshotChunk rejectSenders. */ - public rejectSenders: string[]; - - /** - * Creates a new ResponseApplySnapshotChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseApplySnapshotChunk instance - */ - public static create( - properties?: tendermint.abci.IResponseApplySnapshotChunk, - ): tendermint.abci.ResponseApplySnapshotChunk; - - /** - * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. - * @param m ResponseApplySnapshotChunk message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: tendermint.abci.IResponseApplySnapshotChunk, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ResponseApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): tendermint.abci.ResponseApplySnapshotChunk; - } - - namespace ResponseApplySnapshotChunk { - /** Result enum. */ - enum Result { - UNKNOWN = 0, - ACCEPT = 1, - ABORT = 2, - RETRY = 3, - RETRY_SNAPSHOT = 4, - REJECT_SNAPSHOT = 5, - } - } - - /** Properties of a ConsensusParams. */ - interface IConsensusParams { - /** ConsensusParams block */ - block?: tendermint.abci.IBlockParams | null; - - /** ConsensusParams evidence */ - evidence?: tendermint.types.IEvidenceParams | null; - - /** ConsensusParams validator */ - validator?: tendermint.types.IValidatorParams | null; - - /** ConsensusParams version */ - version?: tendermint.types.IVersionParams | null; - } - - /** Represents a ConsensusParams. */ - class ConsensusParams implements IConsensusParams { - /** - * Constructs a new ConsensusParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IConsensusParams); - - /** ConsensusParams block. */ - public block?: tendermint.abci.IBlockParams | null; - - /** ConsensusParams evidence. */ - public evidence?: tendermint.types.IEvidenceParams | null; - - /** ConsensusParams validator. */ - public validator?: tendermint.types.IValidatorParams | null; - - /** ConsensusParams version. */ - public version?: tendermint.types.IVersionParams | null; - - /** - * Creates a new ConsensusParams instance using the specified properties. - * @param [properties] Properties to set - * @returns ConsensusParams instance - */ - public static create(properties?: tendermint.abci.IConsensusParams): tendermint.abci.ConsensusParams; - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. - * @param m ConsensusParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IConsensusParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ConsensusParams; - } - - /** Properties of a BlockParams. */ - interface IBlockParams { - /** BlockParams maxBytes */ - maxBytes?: Long | null; - - /** BlockParams maxGas */ - maxGas?: Long | null; - } - - /** Represents a BlockParams. */ - class BlockParams implements IBlockParams { - /** - * Constructs a new BlockParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IBlockParams); - - /** BlockParams maxBytes. */ - public maxBytes: Long; - - /** BlockParams maxGas. */ - public maxGas: Long; - - /** - * Creates a new BlockParams instance using the specified properties. - * @param [properties] Properties to set - * @returns BlockParams instance - */ - public static create(properties?: tendermint.abci.IBlockParams): tendermint.abci.BlockParams; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. - * @param m BlockParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IBlockParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.BlockParams; - } - - /** Properties of a LastCommitInfo. */ - interface ILastCommitInfo { - /** LastCommitInfo round */ - round?: number | null; - - /** LastCommitInfo votes */ - votes?: tendermint.abci.IVoteInfo[] | null; - } - - /** Represents a LastCommitInfo. */ - class LastCommitInfo implements ILastCommitInfo { - /** - * Constructs a new LastCommitInfo. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.ILastCommitInfo); - - /** LastCommitInfo round. */ - public round: number; - - /** LastCommitInfo votes. */ - public votes: tendermint.abci.IVoteInfo[]; - - /** - * Creates a new LastCommitInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns LastCommitInfo instance - */ - public static create(properties?: tendermint.abci.ILastCommitInfo): tendermint.abci.LastCommitInfo; - - /** - * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. - * @param m LastCommitInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.ILastCommitInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LastCommitInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns LastCommitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.LastCommitInfo; - } - - /** Properties of an Event. */ - interface IEvent { - /** Event type */ - type?: string | null; - - /** Event attributes */ - attributes?: tendermint.abci.IEventAttribute[] | null; - } - - /** Represents an Event. */ - class Event implements IEvent { - /** - * Constructs a new Event. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IEvent); - - /** Event type. */ - public type: string; - - /** Event attributes. */ - public attributes: tendermint.abci.IEventAttribute[]; - - /** - * Creates a new Event instance using the specified properties. - * @param [properties] Properties to set - * @returns Event instance - */ - public static create(properties?: tendermint.abci.IEvent): tendermint.abci.Event; - - /** - * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. - * @param m Event message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IEvent, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Event message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Event; - } - - /** Properties of an EventAttribute. */ - interface IEventAttribute { - /** EventAttribute key */ - key?: Uint8Array | null; - - /** EventAttribute value */ - value?: Uint8Array | null; - - /** EventAttribute index */ - index?: boolean | null; - } - - /** Represents an EventAttribute. */ - class EventAttribute implements IEventAttribute { - /** - * Constructs a new EventAttribute. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IEventAttribute); - - /** EventAttribute key. */ - public key: Uint8Array; - - /** EventAttribute value. */ - public value: Uint8Array; - - /** EventAttribute index. */ - public index: boolean; - - /** - * Creates a new EventAttribute instance using the specified properties. - * @param [properties] Properties to set - * @returns EventAttribute instance - */ - public static create(properties?: tendermint.abci.IEventAttribute): tendermint.abci.EventAttribute; - - /** - * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. - * @param m EventAttribute message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IEventAttribute, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EventAttribute message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EventAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.EventAttribute; - } - - /** Properties of a TxResult. */ - interface ITxResult { - /** TxResult height */ - height?: Long | null; - - /** TxResult index */ - index?: number | null; - - /** TxResult tx */ - tx?: Uint8Array | null; - - /** TxResult result */ - result?: tendermint.abci.IResponseDeliverTx | null; - } - - /** Represents a TxResult. */ - class TxResult implements ITxResult { - /** - * Constructs a new TxResult. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.ITxResult); - - /** TxResult height. */ - public height: Long; - - /** TxResult index. */ - public index: number; - - /** TxResult tx. */ - public tx: Uint8Array; - - /** TxResult result. */ - public result?: tendermint.abci.IResponseDeliverTx | null; - - /** - * Creates a new TxResult instance using the specified properties. - * @param [properties] Properties to set - * @returns TxResult instance - */ - public static create(properties?: tendermint.abci.ITxResult): tendermint.abci.TxResult; - - /** - * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. - * @param m TxResult message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.ITxResult, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxResult message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.TxResult; - } - - /** Properties of a Validator. */ - interface IValidator { - /** Validator address */ - address?: Uint8Array | null; - - /** Validator power */ - power?: Long | null; - } - - /** Represents a Validator. */ - class Validator implements IValidator { - /** - * Constructs a new Validator. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IValidator); - - /** Validator address. */ - public address: Uint8Array; - - /** Validator power. */ - public power: Long; - - /** - * Creates a new Validator instance using the specified properties. - * @param [properties] Properties to set - * @returns Validator instance - */ - public static create(properties?: tendermint.abci.IValidator): tendermint.abci.Validator; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. - * @param m Validator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IValidator, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Validator; - } - - /** Properties of a ValidatorUpdate. */ - interface IValidatorUpdate { - /** ValidatorUpdate pubKey */ - pubKey?: tendermint.crypto.IPublicKey | null; - - /** ValidatorUpdate power */ - power?: Long | null; - } - - /** Represents a ValidatorUpdate. */ - class ValidatorUpdate implements IValidatorUpdate { - /** - * Constructs a new ValidatorUpdate. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IValidatorUpdate); - - /** ValidatorUpdate pubKey. */ - public pubKey?: tendermint.crypto.IPublicKey | null; - - /** ValidatorUpdate power. */ - public power: Long; - - /** - * Creates a new ValidatorUpdate instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorUpdate instance - */ - public static create(properties?: tendermint.abci.IValidatorUpdate): tendermint.abci.ValidatorUpdate; - - /** - * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. - * @param m ValidatorUpdate message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IValidatorUpdate, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorUpdate message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.ValidatorUpdate; - } - - /** Properties of a VoteInfo. */ - interface IVoteInfo { - /** VoteInfo validator */ - validator?: tendermint.abci.IValidator | null; - - /** VoteInfo signedLastBlock */ - signedLastBlock?: boolean | null; - } - - /** Represents a VoteInfo. */ - class VoteInfo implements IVoteInfo { - /** - * Constructs a new VoteInfo. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IVoteInfo); - - /** VoteInfo validator. */ - public validator?: tendermint.abci.IValidator | null; - - /** VoteInfo signedLastBlock. */ - public signedLastBlock: boolean; - - /** - * Creates a new VoteInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns VoteInfo instance - */ - public static create(properties?: tendermint.abci.IVoteInfo): tendermint.abci.VoteInfo; - - /** - * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. - * @param m VoteInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IVoteInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VoteInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns VoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.VoteInfo; - } - - /** EvidenceType enum. */ - enum EvidenceType { - UNKNOWN = 0, - DUPLICATE_VOTE = 1, - LIGHT_CLIENT_ATTACK = 2, - } - - /** Properties of an Evidence. */ - interface IEvidence { - /** Evidence type */ - type?: tendermint.abci.EvidenceType | null; - - /** Evidence validator */ - validator?: tendermint.abci.IValidator | null; - - /** Evidence height */ - height?: Long | null; - - /** Evidence time */ - time?: google.protobuf.ITimestamp | null; - - /** Evidence totalVotingPower */ - totalVotingPower?: Long | null; - } - - /** Represents an Evidence. */ - class Evidence implements IEvidence { - /** - * Constructs a new Evidence. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.IEvidence); - - /** Evidence type. */ - public type: tendermint.abci.EvidenceType; - - /** Evidence validator. */ - public validator?: tendermint.abci.IValidator | null; - - /** Evidence height. */ - public height: Long; - - /** Evidence time. */ - public time?: google.protobuf.ITimestamp | null; - - /** Evidence totalVotingPower. */ - public totalVotingPower: Long; - - /** - * Creates a new Evidence instance using the specified properties. - * @param [properties] Properties to set - * @returns Evidence instance - */ - public static create(properties?: tendermint.abci.IEvidence): tendermint.abci.Evidence; - - /** - * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. - * @param m Evidence message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.IEvidence, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evidence message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Evidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Evidence; - } - - /** Properties of a Snapshot. */ - interface ISnapshot { - /** Snapshot height */ - height?: Long | null; - - /** Snapshot format */ - format?: number | null; - - /** Snapshot chunks */ - chunks?: number | null; - - /** Snapshot hash */ - hash?: Uint8Array | null; - - /** Snapshot metadata */ - metadata?: Uint8Array | null; - } - - /** Represents a Snapshot. */ - class Snapshot implements ISnapshot { - /** - * Constructs a new Snapshot. - * @param [p] Properties to set - */ - constructor(p?: tendermint.abci.ISnapshot); - - /** Snapshot height. */ - public height: Long; - - /** Snapshot format. */ - public format: number; - - /** Snapshot chunks. */ - public chunks: number; - - /** Snapshot hash. */ - public hash: Uint8Array; - - /** Snapshot metadata. */ - public metadata: Uint8Array; - - /** - * Creates a new Snapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns Snapshot instance - */ - public static create(properties?: tendermint.abci.ISnapshot): tendermint.abci.Snapshot; - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. - * @param m Snapshot message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.abci.ISnapshot, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.abci.Snapshot; - } - - /** Represents a ABCIApplication */ - class ABCIApplication extends $protobuf.rpc.Service { - /** - * Constructs a new ABCIApplication service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new ABCIApplication service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): ABCIApplication; - - /** - * Calls Echo. - * @param request RequestEcho message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseEcho - */ - public echo( - request: tendermint.abci.IRequestEcho, - callback: tendermint.abci.ABCIApplication.EchoCallback, - ): void; - - /** - * Calls Echo. - * @param request RequestEcho message or plain object - * @returns Promise - */ - public echo(request: tendermint.abci.IRequestEcho): Promise; - - /** - * Calls Flush. - * @param request RequestFlush message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseFlush - */ - public flush( - request: tendermint.abci.IRequestFlush, - callback: tendermint.abci.ABCIApplication.FlushCallback, - ): void; - - /** - * Calls Flush. - * @param request RequestFlush message or plain object - * @returns Promise - */ - public flush(request: tendermint.abci.IRequestFlush): Promise; - - /** - * Calls Info. - * @param request RequestInfo message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseInfo - */ - public info( - request: tendermint.abci.IRequestInfo, - callback: tendermint.abci.ABCIApplication.InfoCallback, - ): void; - - /** - * Calls Info. - * @param request RequestInfo message or plain object - * @returns Promise - */ - public info(request: tendermint.abci.IRequestInfo): Promise; - - /** - * Calls SetOption. - * @param request RequestSetOption message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseSetOption - */ - public setOption( - request: tendermint.abci.IRequestSetOption, - callback: tendermint.abci.ABCIApplication.SetOptionCallback, - ): void; - - /** - * Calls SetOption. - * @param request RequestSetOption message or plain object - * @returns Promise - */ - public setOption( - request: tendermint.abci.IRequestSetOption, - ): Promise; - - /** - * Calls DeliverTx. - * @param request RequestDeliverTx message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseDeliverTx - */ - public deliverTx( - request: tendermint.abci.IRequestDeliverTx, - callback: tendermint.abci.ABCIApplication.DeliverTxCallback, - ): void; - - /** - * Calls DeliverTx. - * @param request RequestDeliverTx message or plain object - * @returns Promise - */ - public deliverTx( - request: tendermint.abci.IRequestDeliverTx, - ): Promise; - - /** - * Calls CheckTx. - * @param request RequestCheckTx message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseCheckTx - */ - public checkTx( - request: tendermint.abci.IRequestCheckTx, - callback: tendermint.abci.ABCIApplication.CheckTxCallback, - ): void; - - /** - * Calls CheckTx. - * @param request RequestCheckTx message or plain object - * @returns Promise - */ - public checkTx(request: tendermint.abci.IRequestCheckTx): Promise; - - /** - * Calls Query. - * @param request RequestQuery message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseQuery - */ - public query( - request: tendermint.abci.IRequestQuery, - callback: tendermint.abci.ABCIApplication.QueryCallback, - ): void; - - /** - * Calls Query. - * @param request RequestQuery message or plain object - * @returns Promise - */ - public query(request: tendermint.abci.IRequestQuery): Promise; - - /** - * Calls Commit. - * @param request RequestCommit message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseCommit - */ - public commit( - request: tendermint.abci.IRequestCommit, - callback: tendermint.abci.ABCIApplication.CommitCallback, - ): void; - - /** - * Calls Commit. - * @param request RequestCommit message or plain object - * @returns Promise - */ - public commit(request: tendermint.abci.IRequestCommit): Promise; - - /** - * Calls InitChain. - * @param request RequestInitChain message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseInitChain - */ - public initChain( - request: tendermint.abci.IRequestInitChain, - callback: tendermint.abci.ABCIApplication.InitChainCallback, - ): void; - - /** - * Calls InitChain. - * @param request RequestInitChain message or plain object - * @returns Promise - */ - public initChain( - request: tendermint.abci.IRequestInitChain, - ): Promise; - - /** - * Calls BeginBlock. - * @param request RequestBeginBlock message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseBeginBlock - */ - public beginBlock( - request: tendermint.abci.IRequestBeginBlock, - callback: tendermint.abci.ABCIApplication.BeginBlockCallback, - ): void; - - /** - * Calls BeginBlock. - * @param request RequestBeginBlock message or plain object - * @returns Promise - */ - public beginBlock( - request: tendermint.abci.IRequestBeginBlock, - ): Promise; - - /** - * Calls EndBlock. - * @param request RequestEndBlock message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseEndBlock - */ - public endBlock( - request: tendermint.abci.IRequestEndBlock, - callback: tendermint.abci.ABCIApplication.EndBlockCallback, - ): void; - - /** - * Calls EndBlock. - * @param request RequestEndBlock message or plain object - * @returns Promise - */ - public endBlock(request: tendermint.abci.IRequestEndBlock): Promise; - - /** - * Calls ListSnapshots. - * @param request RequestListSnapshots message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseListSnapshots - */ - public listSnapshots( - request: tendermint.abci.IRequestListSnapshots, - callback: tendermint.abci.ABCIApplication.ListSnapshotsCallback, - ): void; - - /** - * Calls ListSnapshots. - * @param request RequestListSnapshots message or plain object - * @returns Promise - */ - public listSnapshots( - request: tendermint.abci.IRequestListSnapshots, - ): Promise; - - /** - * Calls OfferSnapshot. - * @param request RequestOfferSnapshot message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseOfferSnapshot - */ - public offerSnapshot( - request: tendermint.abci.IRequestOfferSnapshot, - callback: tendermint.abci.ABCIApplication.OfferSnapshotCallback, - ): void; - - /** - * Calls OfferSnapshot. - * @param request RequestOfferSnapshot message or plain object - * @returns Promise - */ - public offerSnapshot( - request: tendermint.abci.IRequestOfferSnapshot, - ): Promise; - - /** - * Calls LoadSnapshotChunk. - * @param request RequestLoadSnapshotChunk message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk - */ - public loadSnapshotChunk( - request: tendermint.abci.IRequestLoadSnapshotChunk, - callback: tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback, - ): void; - - /** - * Calls LoadSnapshotChunk. - * @param request RequestLoadSnapshotChunk message or plain object - * @returns Promise - */ - public loadSnapshotChunk( - request: tendermint.abci.IRequestLoadSnapshotChunk, - ): Promise; - - /** - * Calls ApplySnapshotChunk. - * @param request RequestApplySnapshotChunk message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk - */ - public applySnapshotChunk( - request: tendermint.abci.IRequestApplySnapshotChunk, - callback: tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback, - ): void; - - /** - * Calls ApplySnapshotChunk. - * @param request RequestApplySnapshotChunk message or plain object - * @returns Promise - */ - public applySnapshotChunk( - request: tendermint.abci.IRequestApplySnapshotChunk, - ): Promise; - } - - namespace ABCIApplication { - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. - * @param error Error, if any - * @param [response] ResponseEcho - */ - type EchoCallback = (error: Error | null, response?: tendermint.abci.ResponseEcho) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. - * @param error Error, if any - * @param [response] ResponseFlush - */ - type FlushCallback = (error: Error | null, response?: tendermint.abci.ResponseFlush) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#info}. - * @param error Error, if any - * @param [response] ResponseInfo - */ - type InfoCallback = (error: Error | null, response?: tendermint.abci.ResponseInfo) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. - * @param error Error, if any - * @param [response] ResponseSetOption - */ - type SetOptionCallback = (error: Error | null, response?: tendermint.abci.ResponseSetOption) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. - * @param error Error, if any - * @param [response] ResponseDeliverTx - */ - type DeliverTxCallback = (error: Error | null, response?: tendermint.abci.ResponseDeliverTx) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. - * @param error Error, if any - * @param [response] ResponseCheckTx - */ - type CheckTxCallback = (error: Error | null, response?: tendermint.abci.ResponseCheckTx) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#query}. - * @param error Error, if any - * @param [response] ResponseQuery - */ - type QueryCallback = (error: Error | null, response?: tendermint.abci.ResponseQuery) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. - * @param error Error, if any - * @param [response] ResponseCommit - */ - type CommitCallback = (error: Error | null, response?: tendermint.abci.ResponseCommit) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. - * @param error Error, if any - * @param [response] ResponseInitChain - */ - type InitChainCallback = (error: Error | null, response?: tendermint.abci.ResponseInitChain) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. - * @param error Error, if any - * @param [response] ResponseBeginBlock - */ - type BeginBlockCallback = (error: Error | null, response?: tendermint.abci.ResponseBeginBlock) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. - * @param error Error, if any - * @param [response] ResponseEndBlock - */ - type EndBlockCallback = (error: Error | null, response?: tendermint.abci.ResponseEndBlock) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. - * @param error Error, if any - * @param [response] ResponseListSnapshots - */ - type ListSnapshotsCallback = ( - error: Error | null, - response?: tendermint.abci.ResponseListSnapshots, - ) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. - * @param error Error, if any - * @param [response] ResponseOfferSnapshot - */ - type OfferSnapshotCallback = ( - error: Error | null, - response?: tendermint.abci.ResponseOfferSnapshot, - ) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. - * @param error Error, if any - * @param [response] ResponseLoadSnapshotChunk - */ - type LoadSnapshotChunkCallback = ( - error: Error | null, - response?: tendermint.abci.ResponseLoadSnapshotChunk, - ) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. - * @param error Error, if any - * @param [response] ResponseApplySnapshotChunk - */ - type ApplySnapshotChunkCallback = ( - error: Error | null, - response?: tendermint.abci.ResponseApplySnapshotChunk, - ) => void; - } - } - - /** Namespace crypto. */ - namespace crypto { - /** Properties of a PublicKey. */ - interface IPublicKey { - /** PublicKey ed25519 */ - ed25519?: Uint8Array | null; - - /** PublicKey secp256k1 */ - secp256k1?: Uint8Array | null; - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - /** - * Constructs a new PublicKey. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IPublicKey); - - /** PublicKey ed25519. */ - public ed25519: Uint8Array; - - /** PublicKey secp256k1. */ - public secp256k1: Uint8Array; - - /** PublicKey sum. */ - public sum?: "ed25519" | "secp256k1"; - - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: tendermint.crypto.IPublicKey): tendermint.crypto.PublicKey; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param m PublicKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IPublicKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.PublicKey; - } - - /** Properties of a Proof. */ - interface IProof { - /** Proof total */ - total?: Long | null; - - /** Proof index */ - index?: Long | null; - - /** Proof leafHash */ - leafHash?: Uint8Array | null; - - /** Proof aunts */ - aunts?: Uint8Array[] | null; - } - - /** Represents a Proof. */ - class Proof implements IProof { - /** - * Constructs a new Proof. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IProof); - - /** Proof total. */ - public total: Long; - - /** Proof index. */ - public index: Long; - - /** Proof leafHash. */ - public leafHash: Uint8Array; - - /** Proof aunts. */ - public aunts: Uint8Array[]; - - /** - * Creates a new Proof instance using the specified properties. - * @param [properties] Properties to set - * @returns Proof instance - */ - public static create(properties?: tendermint.crypto.IProof): tendermint.crypto.Proof; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @param m Proof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.Proof; - } - - /** Properties of a ValueOp. */ - interface IValueOp { - /** ValueOp key */ - key?: Uint8Array | null; - - /** ValueOp proof */ - proof?: tendermint.crypto.IProof | null; - } - - /** Represents a ValueOp. */ - class ValueOp implements IValueOp { - /** - * Constructs a new ValueOp. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IValueOp); - - /** ValueOp key. */ - public key: Uint8Array; - - /** ValueOp proof. */ - public proof?: tendermint.crypto.IProof | null; - - /** - * Creates a new ValueOp instance using the specified properties. - * @param [properties] Properties to set - * @returns ValueOp instance - */ - public static create(properties?: tendermint.crypto.IValueOp): tendermint.crypto.ValueOp; - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @param m ValueOp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IValueOp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.ValueOp; - } - - /** Properties of a DominoOp. */ - interface IDominoOp { - /** DominoOp key */ - key?: string | null; - - /** DominoOp input */ - input?: string | null; - - /** DominoOp output */ - output?: string | null; - } - - /** Represents a DominoOp. */ - class DominoOp implements IDominoOp { - /** - * Constructs a new DominoOp. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IDominoOp); - - /** DominoOp key. */ - public key: string; - - /** DominoOp input. */ - public input: string; - - /** DominoOp output. */ - public output: string; - - /** - * Creates a new DominoOp instance using the specified properties. - * @param [properties] Properties to set - * @returns DominoOp instance - */ - public static create(properties?: tendermint.crypto.IDominoOp): tendermint.crypto.DominoOp; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @param m DominoOp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IDominoOp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.DominoOp; - } - - /** Properties of a ProofOp. */ - interface IProofOp { - /** ProofOp type */ - type?: string | null; - - /** ProofOp key */ - key?: Uint8Array | null; - - /** ProofOp data */ - data?: Uint8Array | null; - } - - /** Represents a ProofOp. */ - class ProofOp implements IProofOp { - /** - * Constructs a new ProofOp. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IProofOp); - - /** ProofOp type. */ - public type: string; - - /** ProofOp key. */ - public key: Uint8Array; - - /** ProofOp data. */ - public data: Uint8Array; - - /** - * Creates a new ProofOp instance using the specified properties. - * @param [properties] Properties to set - * @returns ProofOp instance - */ - public static create(properties?: tendermint.crypto.IProofOp): tendermint.crypto.ProofOp; - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @param m ProofOp message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IProofOp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.ProofOp; - } - - /** Properties of a ProofOps. */ - interface IProofOps { - /** ProofOps ops */ - ops?: tendermint.crypto.IProofOp[] | null; - } - - /** Represents a ProofOps. */ - class ProofOps implements IProofOps { - /** - * Constructs a new ProofOps. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IProofOps); - - /** ProofOps ops. */ - public ops: tendermint.crypto.IProofOp[]; - - /** - * Creates a new ProofOps instance using the specified properties. - * @param [properties] Properties to set - * @returns ProofOps instance - */ - public static create(properties?: tendermint.crypto.IProofOps): tendermint.crypto.ProofOps; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @param m ProofOps message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IProofOps, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.ProofOps; - } - } - - /** Namespace libs. */ - namespace libs { - /** Namespace bits. */ - namespace bits { - /** Properties of a BitArray. */ - interface IBitArray { - /** BitArray bits */ - bits?: Long | null; - - /** BitArray elems */ - elems?: Long[] | null; - } - - /** Represents a BitArray. */ - class BitArray implements IBitArray { - /** - * Constructs a new BitArray. - * @param [p] Properties to set - */ - constructor(p?: tendermint.libs.bits.IBitArray); - - /** BitArray bits. */ - public bits: Long; - - /** BitArray elems. */ - public elems: Long[]; - - /** - * Creates a new BitArray instance using the specified properties. - * @param [properties] Properties to set - * @returns BitArray instance - */ - public static create(properties?: tendermint.libs.bits.IBitArray): tendermint.libs.bits.BitArray; - - /** - * Encodes the specified BitArray message. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @param m BitArray message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.libs.bits.IBitArray, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BitArray message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.libs.bits.BitArray; - } - } - } - - /** Namespace types. */ - namespace types { - /** Properties of a ConsensusParams. */ - interface IConsensusParams { - /** ConsensusParams block */ - block?: tendermint.types.IBlockParams | null; - - /** ConsensusParams evidence */ - evidence?: tendermint.types.IEvidenceParams | null; - - /** ConsensusParams validator */ - validator?: tendermint.types.IValidatorParams | null; - - /** ConsensusParams version */ - version?: tendermint.types.IVersionParams | null; - } - - /** Represents a ConsensusParams. */ - class ConsensusParams implements IConsensusParams { - /** - * Constructs a new ConsensusParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IConsensusParams); - - /** ConsensusParams block. */ - public block?: tendermint.types.IBlockParams | null; - - /** ConsensusParams evidence. */ - public evidence?: tendermint.types.IEvidenceParams | null; - - /** ConsensusParams validator. */ - public validator?: tendermint.types.IValidatorParams | null; - - /** ConsensusParams version. */ - public version?: tendermint.types.IVersionParams | null; - - /** - * Creates a new ConsensusParams instance using the specified properties. - * @param [properties] Properties to set - * @returns ConsensusParams instance - */ - public static create(properties?: tendermint.types.IConsensusParams): tendermint.types.ConsensusParams; - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. - * @param m ConsensusParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IConsensusParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.ConsensusParams; - } - - /** Properties of a BlockParams. */ - interface IBlockParams { - /** BlockParams maxBytes */ - maxBytes?: Long | null; - - /** BlockParams maxGas */ - maxGas?: Long | null; - - /** BlockParams timeIotaMs */ - timeIotaMs?: Long | null; - } - - /** Represents a BlockParams. */ - class BlockParams implements IBlockParams { - /** - * Constructs a new BlockParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IBlockParams); - - /** BlockParams maxBytes. */ - public maxBytes: Long; - - /** BlockParams maxGas. */ - public maxGas: Long; - - /** BlockParams timeIotaMs. */ - public timeIotaMs: Long; - - /** - * Creates a new BlockParams instance using the specified properties. - * @param [properties] Properties to set - * @returns BlockParams instance - */ - public static create(properties?: tendermint.types.IBlockParams): tendermint.types.BlockParams; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. - * @param m BlockParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IBlockParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.BlockParams; - } - - /** Properties of an EvidenceParams. */ - interface IEvidenceParams { - /** EvidenceParams maxAgeNumBlocks */ - maxAgeNumBlocks?: Long | null; - - /** EvidenceParams maxAgeDuration */ - maxAgeDuration?: google.protobuf.IDuration | null; - - /** EvidenceParams maxBytes */ - maxBytes?: Long | null; - } - - /** Represents an EvidenceParams. */ - class EvidenceParams implements IEvidenceParams { - /** - * Constructs a new EvidenceParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IEvidenceParams); - - /** EvidenceParams maxAgeNumBlocks. */ - public maxAgeNumBlocks: Long; - - /** EvidenceParams maxAgeDuration. */ - public maxAgeDuration?: google.protobuf.IDuration | null; - - /** EvidenceParams maxBytes. */ - public maxBytes: Long; - - /** - * Creates a new EvidenceParams instance using the specified properties. - * @param [properties] Properties to set - * @returns EvidenceParams instance - */ - public static create(properties?: tendermint.types.IEvidenceParams): tendermint.types.EvidenceParams; - - /** - * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. - * @param m EvidenceParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IEvidenceParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvidenceParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns EvidenceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.EvidenceParams; - } - - /** Properties of a ValidatorParams. */ - interface IValidatorParams { - /** ValidatorParams pubKeyTypes */ - pubKeyTypes?: string[] | null; - } - - /** Represents a ValidatorParams. */ - class ValidatorParams implements IValidatorParams { - /** - * Constructs a new ValidatorParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IValidatorParams); - - /** ValidatorParams pubKeyTypes. */ - public pubKeyTypes: string[]; - - /** - * Creates a new ValidatorParams instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorParams instance - */ - public static create(properties?: tendermint.types.IValidatorParams): tendermint.types.ValidatorParams; - - /** - * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. - * @param m ValidatorParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IValidatorParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.ValidatorParams; - } - - /** Properties of a VersionParams. */ - interface IVersionParams { - /** VersionParams appVersion */ - appVersion?: Long | null; - } - - /** Represents a VersionParams. */ - class VersionParams implements IVersionParams { - /** - * Constructs a new VersionParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IVersionParams); - - /** VersionParams appVersion. */ - public appVersion: Long; - - /** - * Creates a new VersionParams instance using the specified properties. - * @param [properties] Properties to set - * @returns VersionParams instance - */ - public static create(properties?: tendermint.types.IVersionParams): tendermint.types.VersionParams; - - /** - * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. - * @param m VersionParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IVersionParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VersionParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns VersionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.VersionParams; - } - - /** Properties of a HashedParams. */ - interface IHashedParams { - /** HashedParams blockMaxBytes */ - blockMaxBytes?: Long | null; - - /** HashedParams blockMaxGas */ - blockMaxGas?: Long | null; - } - - /** Represents a HashedParams. */ - class HashedParams implements IHashedParams { - /** - * Constructs a new HashedParams. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IHashedParams); - - /** HashedParams blockMaxBytes. */ - public blockMaxBytes: Long; - - /** HashedParams blockMaxGas. */ - public blockMaxGas: Long; - - /** - * Creates a new HashedParams instance using the specified properties. - * @param [properties] Properties to set - * @returns HashedParams instance - */ - public static create(properties?: tendermint.types.IHashedParams): tendermint.types.HashedParams; - - /** - * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. - * @param m HashedParams message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IHashedParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HashedParams message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns HashedParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.HashedParams; - } - - /** BlockIDFlag enum. */ - enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3, - } - - /** SignedMsgType enum. */ - enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - SIGNED_MSG_TYPE_PROPOSAL = 32, - } - - /** Properties of a PartSetHeader. */ - interface IPartSetHeader { - /** PartSetHeader total */ - total?: number | null; - - /** PartSetHeader hash */ - hash?: Uint8Array | null; - } - - /** Represents a PartSetHeader. */ - class PartSetHeader implements IPartSetHeader { - /** - * Constructs a new PartSetHeader. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IPartSetHeader); - - /** PartSetHeader total. */ - public total: number; - - /** PartSetHeader hash. */ - public hash: Uint8Array; - - /** - * Creates a new PartSetHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns PartSetHeader instance - */ - public static create(properties?: tendermint.types.IPartSetHeader): tendermint.types.PartSetHeader; - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @param m PartSetHeader message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IPartSetHeader, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.PartSetHeader; - } - - /** Properties of a Part. */ - interface IPart { - /** Part index */ - index?: number | null; - - /** Part bytes */ - bytes?: Uint8Array | null; - - /** Part proof */ - proof?: tendermint.crypto.IProof | null; - } - - /** Represents a Part. */ - class Part implements IPart { - /** - * Constructs a new Part. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IPart); - - /** Part index. */ - public index: number; - - /** Part bytes. */ - public bytes: Uint8Array; - - /** Part proof. */ - public proof?: tendermint.crypto.IProof | null; - - /** - * Creates a new Part instance using the specified properties. - * @param [properties] Properties to set - * @returns Part instance - */ - public static create(properties?: tendermint.types.IPart): tendermint.types.Part; - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @param m Part message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IPart, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Part; - } - - /** Properties of a BlockID. */ - interface IBlockID { - /** BlockID hash */ - hash?: Uint8Array | null; - - /** BlockID partSetHeader */ - partSetHeader?: tendermint.types.IPartSetHeader | null; - } - - /** Represents a BlockID. */ - class BlockID implements IBlockID { - /** - * Constructs a new BlockID. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IBlockID); - - /** BlockID hash. */ - public hash: Uint8Array; - - /** BlockID partSetHeader. */ - public partSetHeader?: tendermint.types.IPartSetHeader | null; - - /** - * Creates a new BlockID instance using the specified properties. - * @param [properties] Properties to set - * @returns BlockID instance - */ - public static create(properties?: tendermint.types.IBlockID): tendermint.types.BlockID; - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @param m BlockID message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IBlockID, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.BlockID; - } - - /** Properties of a Header. */ - interface IHeader { - /** Header version */ - version?: tendermint.version.IConsensus | null; - - /** Header chainId */ - chainId?: string | null; - - /** Header height */ - height?: Long | null; - - /** Header time */ - time?: google.protobuf.ITimestamp | null; - - /** Header lastBlockId */ - lastBlockId?: tendermint.types.IBlockID | null; - - /** Header lastCommitHash */ - lastCommitHash?: Uint8Array | null; - - /** Header dataHash */ - dataHash?: Uint8Array | null; - - /** Header validatorsHash */ - validatorsHash?: Uint8Array | null; - - /** Header nextValidatorsHash */ - nextValidatorsHash?: Uint8Array | null; - - /** Header consensusHash */ - consensusHash?: Uint8Array | null; - - /** Header appHash */ - appHash?: Uint8Array | null; - - /** Header lastResultsHash */ - lastResultsHash?: Uint8Array | null; - - /** Header evidenceHash */ - evidenceHash?: Uint8Array | null; - - /** Header proposerAddress */ - proposerAddress?: Uint8Array | null; - } - - /** Represents a Header. */ - class Header implements IHeader { - /** - * Constructs a new Header. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IHeader); - - /** Header version. */ - public version?: tendermint.version.IConsensus | null; - - /** Header chainId. */ - public chainId: string; - - /** Header height. */ - public height: Long; - - /** Header time. */ - public time?: google.protobuf.ITimestamp | null; - - /** Header lastBlockId. */ - public lastBlockId?: tendermint.types.IBlockID | null; - - /** Header lastCommitHash. */ - public lastCommitHash: Uint8Array; - - /** Header dataHash. */ - public dataHash: Uint8Array; - - /** Header validatorsHash. */ - public validatorsHash: Uint8Array; - - /** Header nextValidatorsHash. */ - public nextValidatorsHash: Uint8Array; - - /** Header consensusHash. */ - public consensusHash: Uint8Array; - - /** Header appHash. */ - public appHash: Uint8Array; - - /** Header lastResultsHash. */ - public lastResultsHash: Uint8Array; - - /** Header evidenceHash. */ - public evidenceHash: Uint8Array; - - /** Header proposerAddress. */ - public proposerAddress: Uint8Array; - - /** - * Creates a new Header instance using the specified properties. - * @param [properties] Properties to set - * @returns Header instance - */ - public static create(properties?: tendermint.types.IHeader): tendermint.types.Header; - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @param m Header message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IHeader, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Header; - } - - /** Properties of a Data. */ - interface IData { - /** Data txs */ - txs?: Uint8Array[] | null; - } - - /** Represents a Data. */ - class Data implements IData { - /** - * Constructs a new Data. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IData); - - /** Data txs. */ - public txs: Uint8Array[]; - - /** - * Creates a new Data instance using the specified properties. - * @param [properties] Properties to set - * @returns Data instance - */ - public static create(properties?: tendermint.types.IData): tendermint.types.Data; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @param m Data message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IData, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Data; - } - - /** Properties of a Vote. */ - interface IVote { - /** Vote type */ - type?: tendermint.types.SignedMsgType | null; - - /** Vote height */ - height?: Long | null; - - /** Vote round */ - round?: number | null; - - /** Vote blockId */ - blockId?: tendermint.types.IBlockID | null; - - /** Vote timestamp */ - timestamp?: google.protobuf.ITimestamp | null; - - /** Vote validatorAddress */ - validatorAddress?: Uint8Array | null; - - /** Vote validatorIndex */ - validatorIndex?: number | null; - - /** Vote signature */ - signature?: Uint8Array | null; - } - - /** Represents a Vote. */ - class Vote implements IVote { - /** - * Constructs a new Vote. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IVote); - - /** Vote type. */ - public type: tendermint.types.SignedMsgType; - - /** Vote height. */ - public height: Long; - - /** Vote round. */ - public round: number; - - /** Vote blockId. */ - public blockId?: tendermint.types.IBlockID | null; - - /** Vote timestamp. */ - public timestamp?: google.protobuf.ITimestamp | null; - - /** Vote validatorAddress. */ - public validatorAddress: Uint8Array; - - /** Vote validatorIndex. */ - public validatorIndex: number; - - /** Vote signature. */ - public signature: Uint8Array; - - /** - * Creates a new Vote instance using the specified properties. - * @param [properties] Properties to set - * @returns Vote instance - */ - public static create(properties?: tendermint.types.IVote): tendermint.types.Vote; - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @param m Vote message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IVote, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Vote; - } - - /** Properties of a Commit. */ - interface ICommit { - /** Commit height */ - height?: Long | null; - - /** Commit round */ - round?: number | null; - - /** Commit blockId */ - blockId?: tendermint.types.IBlockID | null; - - /** Commit signatures */ - signatures?: tendermint.types.ICommitSig[] | null; - } - - /** Represents a Commit. */ - class Commit implements ICommit { - /** - * Constructs a new Commit. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ICommit); - - /** Commit height. */ - public height: Long; - - /** Commit round. */ - public round: number; - - /** Commit blockId. */ - public blockId?: tendermint.types.IBlockID | null; - - /** Commit signatures. */ - public signatures: tendermint.types.ICommitSig[]; - - /** - * Creates a new Commit instance using the specified properties. - * @param [properties] Properties to set - * @returns Commit instance - */ - public static create(properties?: tendermint.types.ICommit): tendermint.types.Commit; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @param m Commit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ICommit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Commit; - } - - /** Properties of a CommitSig. */ - interface ICommitSig { - /** CommitSig blockIdFlag */ - blockIdFlag?: tendermint.types.BlockIDFlag | null; - - /** CommitSig validatorAddress */ - validatorAddress?: Uint8Array | null; - - /** CommitSig timestamp */ - timestamp?: google.protobuf.ITimestamp | null; - - /** CommitSig signature */ - signature?: Uint8Array | null; - } - - /** Represents a CommitSig. */ - class CommitSig implements ICommitSig { - /** - * Constructs a new CommitSig. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ICommitSig); - - /** CommitSig blockIdFlag. */ - public blockIdFlag: tendermint.types.BlockIDFlag; - - /** CommitSig validatorAddress. */ - public validatorAddress: Uint8Array; - - /** CommitSig timestamp. */ - public timestamp?: google.protobuf.ITimestamp | null; - - /** CommitSig signature. */ - public signature: Uint8Array; - - /** - * Creates a new CommitSig instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitSig instance - */ - public static create(properties?: tendermint.types.ICommitSig): tendermint.types.CommitSig; - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @param m CommitSig message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ICommitSig, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.CommitSig; - } - - /** Properties of a Proposal. */ - interface IProposal { - /** Proposal type */ - type?: tendermint.types.SignedMsgType | null; - - /** Proposal height */ - height?: Long | null; - - /** Proposal round */ - round?: number | null; - - /** Proposal polRound */ - polRound?: number | null; - - /** Proposal blockId */ - blockId?: tendermint.types.IBlockID | null; - - /** Proposal timestamp */ - timestamp?: google.protobuf.ITimestamp | null; - - /** Proposal signature */ - signature?: Uint8Array | null; - } - - /** Represents a Proposal. */ - class Proposal implements IProposal { - /** - * Constructs a new Proposal. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IProposal); - - /** Proposal type. */ - public type: tendermint.types.SignedMsgType; - - /** Proposal height. */ - public height: Long; - - /** Proposal round. */ - public round: number; - - /** Proposal polRound. */ - public polRound: number; - - /** Proposal blockId. */ - public blockId?: tendermint.types.IBlockID | null; - - /** Proposal timestamp. */ - public timestamp?: google.protobuf.ITimestamp | null; - - /** Proposal signature. */ - public signature: Uint8Array; - - /** - * Creates a new Proposal instance using the specified properties. - * @param [properties] Properties to set - * @returns Proposal instance - */ - public static create(properties?: tendermint.types.IProposal): tendermint.types.Proposal; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @param m Proposal message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IProposal, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Proposal; - } - - /** Properties of a SignedHeader. */ - interface ISignedHeader { - /** SignedHeader header */ - header?: tendermint.types.IHeader | null; - - /** SignedHeader commit */ - commit?: tendermint.types.ICommit | null; - } - - /** Represents a SignedHeader. */ - class SignedHeader implements ISignedHeader { - /** - * Constructs a new SignedHeader. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ISignedHeader); - - /** SignedHeader header. */ - public header?: tendermint.types.IHeader | null; - - /** SignedHeader commit. */ - public commit?: tendermint.types.ICommit | null; - - /** - * Creates a new SignedHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns SignedHeader instance - */ - public static create(properties?: tendermint.types.ISignedHeader): tendermint.types.SignedHeader; - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @param m SignedHeader message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ISignedHeader, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.SignedHeader; - } - - /** Properties of a LightBlock. */ - interface ILightBlock { - /** LightBlock signedHeader */ - signedHeader?: tendermint.types.ISignedHeader | null; - - /** LightBlock validatorSet */ - validatorSet?: tendermint.types.IValidatorSet | null; - } - - /** Represents a LightBlock. */ - class LightBlock implements ILightBlock { - /** - * Constructs a new LightBlock. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ILightBlock); - - /** LightBlock signedHeader. */ - public signedHeader?: tendermint.types.ISignedHeader | null; - - /** LightBlock validatorSet. */ - public validatorSet?: tendermint.types.IValidatorSet | null; - - /** - * Creates a new LightBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LightBlock instance - */ - public static create(properties?: tendermint.types.ILightBlock): tendermint.types.LightBlock; - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @param m LightBlock message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ILightBlock, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.LightBlock; - } - - /** Properties of a BlockMeta. */ - interface IBlockMeta { - /** BlockMeta blockId */ - blockId?: tendermint.types.IBlockID | null; - - /** BlockMeta blockSize */ - blockSize?: Long | null; - - /** BlockMeta header */ - header?: tendermint.types.IHeader | null; - - /** BlockMeta numTxs */ - numTxs?: Long | null; - } - - /** Represents a BlockMeta. */ - class BlockMeta implements IBlockMeta { - /** - * Constructs a new BlockMeta. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IBlockMeta); - - /** BlockMeta blockId. */ - public blockId?: tendermint.types.IBlockID | null; - - /** BlockMeta blockSize. */ - public blockSize: Long; - - /** BlockMeta header. */ - public header?: tendermint.types.IHeader | null; - - /** BlockMeta numTxs. */ - public numTxs: Long; - - /** - * Creates a new BlockMeta instance using the specified properties. - * @param [properties] Properties to set - * @returns BlockMeta instance - */ - public static create(properties?: tendermint.types.IBlockMeta): tendermint.types.BlockMeta; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @param m BlockMeta message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IBlockMeta, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.BlockMeta; - } - - /** Properties of a TxProof. */ - interface ITxProof { - /** TxProof rootHash */ - rootHash?: Uint8Array | null; - - /** TxProof data */ - data?: Uint8Array | null; - - /** TxProof proof */ - proof?: tendermint.crypto.IProof | null; - } - - /** Represents a TxProof. */ - class TxProof implements ITxProof { - /** - * Constructs a new TxProof. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ITxProof); - - /** TxProof rootHash. */ - public rootHash: Uint8Array; - - /** TxProof data. */ - public data: Uint8Array; - - /** TxProof proof. */ - public proof?: tendermint.crypto.IProof | null; - - /** - * Creates a new TxProof instance using the specified properties. - * @param [properties] Properties to set - * @returns TxProof instance - */ - public static create(properties?: tendermint.types.ITxProof): tendermint.types.TxProof; - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @param m TxProof message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ITxProof, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.TxProof; - } - - /** Properties of a ValidatorSet. */ - interface IValidatorSet { - /** ValidatorSet validators */ - validators?: tendermint.types.IValidator[] | null; - - /** ValidatorSet proposer */ - proposer?: tendermint.types.IValidator | null; - - /** ValidatorSet totalVotingPower */ - totalVotingPower?: Long | null; - } - - /** Represents a ValidatorSet. */ - class ValidatorSet implements IValidatorSet { - /** - * Constructs a new ValidatorSet. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IValidatorSet); - - /** ValidatorSet validators. */ - public validators: tendermint.types.IValidator[]; - - /** ValidatorSet proposer. */ - public proposer?: tendermint.types.IValidator | null; - - /** ValidatorSet totalVotingPower. */ - public totalVotingPower: Long; - - /** - * Creates a new ValidatorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidatorSet instance - */ - public static create(properties?: tendermint.types.IValidatorSet): tendermint.types.ValidatorSet; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @param m ValidatorSet message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IValidatorSet, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.ValidatorSet; - } - - /** Properties of a Validator. */ - interface IValidator { - /** Validator address */ - address?: Uint8Array | null; - - /** Validator pubKey */ - pubKey?: tendermint.crypto.IPublicKey | null; - - /** Validator votingPower */ - votingPower?: Long | null; - - /** Validator proposerPriority */ - proposerPriority?: Long | null; - } - - /** Represents a Validator. */ - class Validator implements IValidator { - /** - * Constructs a new Validator. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.IValidator); - - /** Validator address. */ - public address: Uint8Array; - - /** Validator pubKey. */ - public pubKey?: tendermint.crypto.IPublicKey | null; - - /** Validator votingPower. */ - public votingPower: Long; - - /** Validator proposerPriority. */ - public proposerPriority: Long; - - /** - * Creates a new Validator instance using the specified properties. - * @param [properties] Properties to set - * @returns Validator instance - */ - public static create(properties?: tendermint.types.IValidator): tendermint.types.Validator; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @param m Validator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.IValidator, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.Validator; - } - - /** Properties of a SimpleValidator. */ - interface ISimpleValidator { - /** SimpleValidator pubKey */ - pubKey?: tendermint.crypto.IPublicKey | null; - - /** SimpleValidator votingPower */ - votingPower?: Long | null; - } - - /** Represents a SimpleValidator. */ - class SimpleValidator implements ISimpleValidator { - /** - * Constructs a new SimpleValidator. - * @param [p] Properties to set - */ - constructor(p?: tendermint.types.ISimpleValidator); - - /** SimpleValidator pubKey. */ - public pubKey?: tendermint.crypto.IPublicKey | null; - - /** SimpleValidator votingPower. */ - public votingPower: Long; - - /** - * Creates a new SimpleValidator instance using the specified properties. - * @param [properties] Properties to set - * @returns SimpleValidator instance - */ - public static create(properties?: tendermint.types.ISimpleValidator): tendermint.types.SimpleValidator; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @param m SimpleValidator message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.types.ISimpleValidator, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.types.SimpleValidator; - } - } - - /** Namespace version. */ - namespace version { - /** Properties of an App. */ - interface IApp { - /** App protocol */ - protocol?: Long | null; - - /** App software */ - software?: string | null; - } - - /** Represents an App. */ - class App implements IApp { - /** - * Constructs a new App. - * @param [p] Properties to set - */ - constructor(p?: tendermint.version.IApp); - - /** App protocol. */ - public protocol: Long; - - /** App software. */ - public software: string; - - /** - * Creates a new App instance using the specified properties. - * @param [properties] Properties to set - * @returns App instance - */ - public static create(properties?: tendermint.version.IApp): tendermint.version.App; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @param m App message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.version.IApp, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an App message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.version.App; - } - - /** Properties of a Consensus. */ - interface IConsensus { - /** Consensus block */ - block?: Long | null; - - /** Consensus app */ - app?: Long | null; - } - - /** Represents a Consensus. */ - class Consensus implements IConsensus { - /** - * Constructs a new Consensus. - * @param [p] Properties to set - */ - constructor(p?: tendermint.version.IConsensus); - - /** Consensus block. */ - public block: Long; - - /** Consensus app. */ - public app: Long; - - /** - * Creates a new Consensus instance using the specified properties. - * @param [properties] Properties to set - * @returns Consensus instance - */ - public static create(properties?: tendermint.version.IConsensus): tendermint.version.Consensus; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @param m Consensus message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.version.IConsensus, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.version.Consensus; - } - } -} diff --git a/packages/stargate/types/codec/index.d.ts b/packages/stargate/types/codec/index.d.ts deleted file mode 100644 index 1244b304..00000000 --- a/packages/stargate/types/codec/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This codec is derived from the Cosmos SDK protocol buffer definitions and can change at any time. - * @packageDocumentation - */ -export * from "./generated/codecimpl";