diff --git a/packages/stargate/src/codec/confio/proofs.ts b/packages/stargate/src/codec/confio/proofs.ts new file mode 100644 index 00000000..8af23e82 --- /dev/null +++ b/packages/stargate/src/codec/confio/proofs.ts @@ -0,0 +1,1628 @@ +/* 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 = {}; + +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 = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) + */ + BITCOIN = 5, + UNRECOGNIZED = -1, +} + +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} + +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + default: + return "UNKNOWN"; + } +} + +/** * +LengthOp defines how to process the key and value of the LeafOp +to include length information. After encoding the length with the given +algorithm, the length will be prepended to the key and value bytes. +(Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info + */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length + */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length + */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer + */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer + */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) + */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) + */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} + +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} + +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + default: + return "UNKNOWN"; + } +} + +export const ExistenceProof = { + encode(message: ExistenceProof, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + writer.uint32(18).bytes(message.value); + if (message.leaf !== undefined && message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ExistenceProof { + const message = { ...baseExistenceProof } as ExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromJSON(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(InnerOp.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ExistenceProof { + const message = { ...baseExistenceProof } as ExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromPartial(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(InnerOp.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined)); + } else { + obj.path = []; + } + return obj; + }, +}; + +export const NonExistenceProof = { + encode(message: NonExistenceProof, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + if (message.left !== undefined && message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined && message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): NonExistenceProof { + const message = { ...baseNonExistenceProof } as NonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromJSON(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromJSON(object.right); + } else { + message.right = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): NonExistenceProof { + const message = { ...baseNonExistenceProof } as NonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromPartial(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromPartial(object.right); + } else { + message.right = undefined; + } + return message; + }, + toJSON(message: NonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined && + (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined); + return obj; + }, +}; + +export const CommitmentProof = { + encode(message: CommitmentProof, writer: Writer = Writer.create()): Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CommitmentProof { + const message = { ...baseCommitmentProof } as CommitmentProof; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromJSON(object.batch); + } else { + message.batch = undefined; + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromJSON(object.compressed); + } else { + message.compressed = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): CommitmentProof { + const message = { ...baseCommitmentProof } as CommitmentProof; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromPartial(object.batch); + } else { + message.batch = undefined; + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromPartial(object.compressed); + } else { + message.compressed = undefined; + } + return message; + }, + toJSON(message: CommitmentProof): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined); + message.compressed !== undefined && + (obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined); + return obj; + }, +}; + +export const LeafOp = { + encode(message: LeafOp, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.hash); + writer.uint32(16).int32(message.prehashKey); + writer.uint32(24).int32(message.prehashValue); + writer.uint32(32).int32(message.length); + writer.uint32(42).bytes(message.prefix); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prehashKey = reader.int32() as any; + break; + case 3: + message.prehashValue = reader.int32() as any; + break; + case 4: + message.length = reader.int32() as any; + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): LeafOp { + const message = { ...baseLeafOp } as LeafOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + if (object.prehashKey !== undefined && object.prehashKey !== null) { + message.prehashKey = hashOpFromJSON(object.prehashKey); + } else { + message.prehashKey = 0; + } + if (object.prehashValue !== undefined && object.prehashValue !== null) { + message.prehashValue = hashOpFromJSON(object.prehashValue); + } else { + message.prehashValue = 0; + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } else { + message.length = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + fromPartial(object: DeepPartial): LeafOp { + const message = { ...baseLeafOp } as LeafOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + if (object.prehashKey !== undefined && object.prehashKey !== null) { + message.prehashKey = object.prehashKey; + } else { + message.prehashKey = 0; + } + if (object.prehashValue !== undefined && object.prehashValue !== null) { + message.prehashValue = object.prehashValue; + } else { + message.prehashValue = 0; + } + if (object.length !== undefined && object.length !== null) { + message.length = object.length; + } else { + message.length = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = object.prefix; + } else { + message.prefix = new Uint8Array(); + } + return message; + }, + toJSON(message: LeafOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey)); + message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue)); + message.length !== undefined && (obj.length = lengthOpToJSON(message.length)); + message.prefix !== undefined && + (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + return obj; + }, +}; + +export const InnerOp = { + encode(message: InnerOp, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.hash); + writer.uint32(18).bytes(message.prefix); + writer.uint32(26).bytes(message.suffix); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): InnerOp { + const message = { ...baseInnerOp } as InnerOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; + }, + fromPartial(object: DeepPartial): InnerOp { + const message = { ...baseInnerOp } as InnerOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = object.prefix; + } else { + message.prefix = new Uint8Array(); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = object.suffix; + } else { + message.suffix = new Uint8Array(); + } + return message; + }, + toJSON(message: InnerOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prefix !== undefined && + (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + message.suffix !== undefined && + (obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array())); + return obj; + }, +}; + +export const ProofSpec = { + encode(message: ProofSpec, writer: Writer = Writer.create()): Writer { + if (message.leafSpec !== undefined && message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined && message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int32(message.maxDepth); + writer.uint32(32).int32(message.minDepth); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ProofSpec { + const message = { ...baseProofSpec } as ProofSpec; + if (object.leafSpec !== undefined && object.leafSpec !== null) { + message.leafSpec = LeafOp.fromJSON(object.leafSpec); + } else { + message.leafSpec = undefined; + } + if (object.innerSpec !== undefined && object.innerSpec !== null) { + message.innerSpec = InnerSpec.fromJSON(object.innerSpec); + } else { + message.innerSpec = undefined; + } + if (object.maxDepth !== undefined && object.maxDepth !== null) { + message.maxDepth = Number(object.maxDepth); + } else { + message.maxDepth = 0; + } + if (object.minDepth !== undefined && object.minDepth !== null) { + message.minDepth = Number(object.minDepth); + } else { + message.minDepth = 0; + } + return message; + }, + fromPartial(object: DeepPartial): ProofSpec { + const message = { ...baseProofSpec } as ProofSpec; + if (object.leafSpec !== undefined && object.leafSpec !== null) { + message.leafSpec = LeafOp.fromPartial(object.leafSpec); + } else { + message.leafSpec = undefined; + } + if (object.innerSpec !== undefined && object.innerSpec !== null) { + message.innerSpec = InnerSpec.fromPartial(object.innerSpec); + } else { + message.innerSpec = undefined; + } + if (object.maxDepth !== undefined && object.maxDepth !== null) { + message.maxDepth = object.maxDepth; + } else { + message.maxDepth = 0; + } + if (object.minDepth !== undefined && object.minDepth !== null) { + message.minDepth = object.minDepth; + } else { + message.minDepth = 0; + } + return message; + }, + toJSON(message: ProofSpec): unknown { + const obj: any = {}; + message.leafSpec !== undefined && + (obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined); + message.innerSpec !== undefined && + (obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined); + message.maxDepth !== undefined && (obj.maxDepth = message.maxDepth); + message.minDepth !== undefined && (obj.minDepth = message.minDepth); + return obj; + }, +}; + +export const InnerSpec = { + encode(message: InnerSpec, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(16).int32(message.childSize); + writer.uint32(24).int32(message.minPrefixLength); + writer.uint32(32).int32(message.maxPrefixLength); + writer.uint32(42).bytes(message.emptyChild); + writer.uint32(48).int32(message.hash); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.childOrder = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): InnerSpec { + const message = { ...baseInnerSpec } as InnerSpec; + message.childOrder = []; + if (object.childOrder !== undefined && object.childOrder !== null) { + for (const e of object.childOrder) { + message.childOrder.push(Number(e)); + } + } + if (object.childSize !== undefined && object.childSize !== null) { + message.childSize = Number(object.childSize); + } else { + message.childSize = 0; + } + if (object.minPrefixLength !== undefined && object.minPrefixLength !== null) { + message.minPrefixLength = Number(object.minPrefixLength); + } else { + message.minPrefixLength = 0; + } + if (object.maxPrefixLength !== undefined && object.maxPrefixLength !== null) { + message.maxPrefixLength = Number(object.maxPrefixLength); + } else { + message.maxPrefixLength = 0; + } + if (object.emptyChild !== undefined && object.emptyChild !== null) { + message.emptyChild = bytesFromBase64(object.emptyChild); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + return message; + }, + fromPartial(object: DeepPartial): InnerSpec { + const message = { ...baseInnerSpec } as InnerSpec; + message.childOrder = []; + if (object.childOrder !== undefined && object.childOrder !== null) { + for (const e of object.childOrder) { + message.childOrder.push(e); + } + } + if (object.childSize !== undefined && object.childSize !== null) { + message.childSize = object.childSize; + } else { + message.childSize = 0; + } + if (object.minPrefixLength !== undefined && object.minPrefixLength !== null) { + message.minPrefixLength = object.minPrefixLength; + } else { + message.minPrefixLength = 0; + } + if (object.maxPrefixLength !== undefined && object.maxPrefixLength !== null) { + message.maxPrefixLength = object.maxPrefixLength; + } else { + message.maxPrefixLength = 0; + } + if (object.emptyChild !== undefined && object.emptyChild !== null) { + message.emptyChild = object.emptyChild; + } else { + message.emptyChild = new Uint8Array(); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + return message; + }, + toJSON(message: InnerSpec): unknown { + const obj: any = {}; + if (message.childOrder) { + obj.childOrder = message.childOrder.map((e) => e); + } else { + obj.childOrder = []; + } + message.childSize !== undefined && (obj.childSize = message.childSize); + message.minPrefixLength !== undefined && (obj.minPrefixLength = message.minPrefixLength); + message.maxPrefixLength !== undefined && (obj.maxPrefixLength = message.maxPrefixLength); + message.emptyChild !== undefined && + (obj.emptyChild = base64FromBytes( + message.emptyChild !== undefined ? message.emptyChild : new Uint8Array(), + )); + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + return obj; + }, +}; + +export const BatchProof = { + encode(message: BatchProof, writer: Writer = Writer.create()): Writer { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BatchProof { + const message = { ...baseBatchProof } as BatchProof; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(BatchEntry.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchProof { + const message = { ...baseBatchProof } as BatchProof; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(BatchEntry.fromPartial(e)); + } + } + return message; + }, + toJSON(message: BatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? BatchEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, +}; + +export const BatchEntry = { + encode(message: BatchEntry, writer: Writer = Writer.create()): Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BatchEntry { + const message = { ...baseBatchEntry } as BatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): BatchEntry { + const message = { ...baseBatchEntry } as BatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + toJSON(message: BatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, +}; + +export const CompressedBatchProof = { + encode(message: CompressedBatchProof, writer: Writer = Writer.create()): Writer { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.entries = []; + message.lookupInners = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompressedBatchProof { + const message = { ...baseCompressedBatchProof } as CompressedBatchProof; + message.entries = []; + message.lookupInners = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(CompressedBatchEntry.fromJSON(e)); + } + } + if (object.lookupInners !== undefined && object.lookupInners !== null) { + for (const e of object.lookupInners) { + message.lookupInners.push(InnerOp.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): CompressedBatchProof { + const message = { ...baseCompressedBatchProof } as CompressedBatchProof; + message.entries = []; + message.lookupInners = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(CompressedBatchEntry.fromPartial(e)); + } + } + if (object.lookupInners !== undefined && object.lookupInners !== null) { + for (const e of object.lookupInners) { + message.lookupInners.push(InnerOp.fromPartial(e)); + } + } + return message; + }, + toJSON(message: CompressedBatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? CompressedBatchEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookupInners = message.lookupInners.map((e) => (e ? InnerOp.toJSON(e) : undefined)); + } else { + obj.lookupInners = []; + } + return obj; + }, +}; + +export const CompressedBatchEntry = { + encode(message: CompressedBatchEntry, writer: Writer = Writer.create()): Writer { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompressedBatchEntry { + const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): CompressedBatchEntry { + const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + toJSON(message: CompressedBatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, +}; + +export const CompressedExistenceProof = { + encode(message: CompressedExistenceProof, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + writer.uint32(18).bytes(message.value); + if (message.leaf !== undefined && message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompressedExistenceProof { + const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromJSON(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): CompressedExistenceProof { + const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromPartial(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + return message; + }, + toJSON(message: CompressedExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + return obj; + }, +}; + +export const CompressedNonExistenceProof = { + encode(message: CompressedNonExistenceProof, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + if (message.left !== undefined && message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined && message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompressedNonExistenceProof { + const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromJSON(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromJSON(object.right); + } else { + message.right = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): CompressedNonExistenceProof { + const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromPartial(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromPartial(object.right); + } else { + message.right = undefined; + } + return message; + }, + toJSON(message: CompressedNonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && + (obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined && + (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts b/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..03f9c075 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,363 @@ +/* eslint-disable */ +import { Any } from "../../../google/protobuf/any"; +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + address: string; + pubKey?: Any; + accountNumber: Long; + sequence: Long; +} + +/** + * 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. + */ +export interface Params { + maxMemoCharacters: Long; + txSigLimit: Long; + txSizeCostPerByte: Long; + sigVerifyCostEd25519: Long; + 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"; + +export const BaseAccount = { + encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + if (message.pubKey !== undefined && message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).uint64(message.accountNumber); + writer.uint32(32).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64() as Long; + break; + case 4: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BaseAccount { + const message = { ...baseBaseAccount } as BaseAccount; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = Long.fromString(object.accountNumber); + } else { + message.accountNumber = Long.UZERO; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): BaseAccount { + const message = { ...baseBaseAccount } as BaseAccount; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = object.accountNumber as Long; + } else { + message.accountNumber = Long.UZERO; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: BaseAccount): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const ModuleAccount = { + encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { + if (message.baseAccount !== undefined && message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.name); + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.permissions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModuleAccount { + const message = { ...baseModuleAccount } as ModuleAccount; + message.permissions = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromJSON(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.permissions !== undefined && object.permissions !== null) { + for (const e of object.permissions) { + message.permissions.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleAccount { + const message = { ...baseModuleAccount } as ModuleAccount; + message.permissions = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromPartial(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.permissions !== undefined && object.permissions !== null) { + for (const e of object.permissions) { + message.permissions.push(e); + } + } + return message; + }, + toJSON(message: ModuleAccount): unknown { + const obj: any = {}; + message.baseAccount !== undefined && + (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + message.name !== undefined && (obj.name = message.name); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, +}; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.maxMemoCharacters); + writer.uint32(16).uint64(message.txSigLimit); + writer.uint32(24).uint64(message.txSizeCostPerByte); + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxMemoCharacters = reader.uint64() as Long; + break; + case 2: + message.txSigLimit = reader.uint64() as Long; + break; + case 3: + message.txSizeCostPerByte = reader.uint64() as Long; + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64() as Long; + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { + message.maxMemoCharacters = Long.fromString(object.maxMemoCharacters); + } else { + message.maxMemoCharacters = Long.UZERO; + } + if (object.txSigLimit !== undefined && object.txSigLimit !== null) { + message.txSigLimit = Long.fromString(object.txSigLimit); + } else { + message.txSigLimit = Long.UZERO; + } + if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) { + message.txSizeCostPerByte = Long.fromString(object.txSizeCostPerByte); + } else { + message.txSizeCostPerByte = Long.UZERO; + } + if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) { + message.sigVerifyCostEd25519 = Long.fromString(object.sigVerifyCostEd25519); + } else { + message.sigVerifyCostEd25519 = Long.UZERO; + } + if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) { + message.sigVerifyCostSecp256k1 = Long.fromString(object.sigVerifyCostSecp256k1); + } else { + message.sigVerifyCostSecp256k1 = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { + message.maxMemoCharacters = object.maxMemoCharacters as Long; + } else { + message.maxMemoCharacters = Long.UZERO; + } + if (object.txSigLimit !== undefined && object.txSigLimit !== null) { + message.txSigLimit = object.txSigLimit as Long; + } else { + message.txSigLimit = Long.UZERO; + } + if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) { + message.txSizeCostPerByte = object.txSizeCostPerByte as Long; + } else { + message.txSizeCostPerByte = Long.UZERO; + } + if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) { + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 as Long; + } else { + message.sigVerifyCostEd25519 = Long.UZERO; + } + if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) { + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 as Long; + } else { + message.sigVerifyCostSecp256k1 = Long.UZERO; + } + return message; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.maxMemoCharacters !== undefined && + (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()); + message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()); + message.txSizeCostPerByte !== undefined && + (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()); + message.sigVerifyCostEd25519 !== undefined && + (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString()); + message.sigVerifyCostSecp256k1 !== undefined && + (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString()); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts b/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts new file mode 100644 index 00000000..18f5310d --- /dev/null +++ b/packages/stargate/src/codec/cosmos/auth/v1beta1/query.ts @@ -0,0 +1,279 @@ +/* eslint-disable */ +import { Any } from "../../../google/protobuf/any"; +import { Params } from "../../../cosmos/auth/v1beta1/auth"; +import { Reader, Writer } from "protobufjs/minimal"; + +/** + * QueryAccountRequest is the request type for the Query/Account RPC method. + */ +export interface QueryAccountRequest { + /** + * address defines the address to query for. + */ + address: string; +} + +/** + * QueryAccountResponse is the response type for the Query/Account RPC method. + */ +export interface QueryAccountResponse { + /** + * account defines the account of the corresponding address. + */ + account?: Any; +} + +/** + * 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. + */ +export interface QueryParamsResponse { + /** + * 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"; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountRequest { + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountRequest { + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + return message; + }, + toJSON(message: QueryAccountRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, +}; + +export const QueryAccountResponse = { + encode(message: QueryAccountResponse, writer: Writer = Writer.create()): Writer { + if (message.account !== undefined && message.account !== undefined) { + Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountResponse { + const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + if (object.account !== undefined && object.account !== null) { + message.account = Any.fromJSON(object.account); + } else { + message.account = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountResponse { + const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + if (object.account !== undefined && object.account !== null) { + message.account = Any.fromPartial(object.account); + } else { + message.account = undefined; + } + return message; + }, + toJSON(message: QueryAccountResponse): unknown { + const obj: any = {}; + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined); + return obj; + }, +}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined && message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..afff626e --- /dev/null +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,650 @@ +/* eslint-disable */ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * 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). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} + +/** + * Input models transaction input. + */ +export interface Input { + address: string; + coins: Coin[]; +} + +/** + * 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. + */ +export interface Supply { + total: Coin[]; +} + +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** + * denom represents the string name of the given denom unit (e.g uatom). + */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 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: string[]; +} + +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** + * denom_units represents the list of DenomUnit's for a given coin + */ + denomUnits: DenomUnit[]; + /** + * base represents the base denom (should be the DenomUnit with exponent = 0). + */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; +} + +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"; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).bool(message.defaultSendEnabled); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.sendEnabled = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromJSON(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + } else { + message.defaultSendEnabled = false; + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromPartial(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = object.defaultSendEnabled; + } else { + message.defaultSendEnabled = false; + } + return message; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined)); + } else { + obj.sendEnabled = []; + } + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSendEnabled } as SendEnabled; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = Boolean(object.enabled); + } else { + message.enabled = false; + } + return message; + }, + fromPartial(object: DeepPartial): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } else { + message.enabled = false; + } + return message; + }, + toJSON(message: SendEnabled): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, +}; + +export const Input = { + encode(message: Input, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Input): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, +}; + +export const Output = { + encode(message: Output, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Output): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, +}; + +export const Supply = { + encode(message: Supply, writer: Writer = Writer.create()): Writer { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.total = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Supply): unknown { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.total = []; + } + return obj; + }, +}; + +export const DenomUnit = { + encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.denom); + writer.uint32(16).uint32(message.exponent); + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.aliases = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = Number(object.exponent); + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(e); + } + } + return message; + }, + toJSON(message: DenomUnit): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.exponent !== undefined && (obj.exponent = message.exponent); + if (message.aliases) { + obj.aliases = message.aliases.map((e) => e); + } else { + obj.aliases = []; + } + return obj; + }, +}; + +export const Metadata = { + encode(message: Metadata, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.description); + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.base); + writer.uint32(34).string(message.display); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.denomUnits = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromJSON(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = String(object.base); + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = String(object.display); + } else { + message.display = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromPartial(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } else { + message.display = ""; + } + return message; + }, + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined)); + } else { + obj.denomUnits = []; + } + message.base !== undefined && (obj.base = message.base); + message.display !== undefined && (obj.display = message.display); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts new file mode 100644 index 00000000..4c1fc9a4 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/query.ts @@ -0,0 +1,735 @@ +/* eslint-disable */ +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"; + +/** + * QueryBalanceRequest is the request type for the Query/Balance RPC method. + */ +export interface QueryBalanceRequest { + /** + * address is the address to query balances for. + */ + address: string; + /** + * denom is the coin denom to query balances for. + */ + denom: string; +} + +/** + * QueryBalanceResponse is the response type for the Query/Balance RPC method. + */ +export interface QueryBalanceResponse { + /** + * balance is the balance of the coin. + */ + balance?: Coin; +} + +/** + * QueryBalanceRequest is the request type for the Query/AllBalances RPC method. + */ +export interface QueryAllBalancesRequest { + /** + * address is the address to query balances for. + */ + address: string; + /** + * pagination defines an optional pagination for the request. + */ + pagination?: PageRequest; +} + +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponse { + /** + * balances is the balances of all the coins. + */ + balances: Coin[]; + /** + * pagination defines the pagination in the response. + */ + pagination?: PageResponse; +} + +/** + * 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 + */ +export interface QueryTotalSupplyResponse { + /** + * supply is the supply of the coins + */ + supply: Coin[]; +} + +/** + * QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. + */ +export interface QuerySupplyOfRequest { + /** + * denom is the coin denom to query balances for. + */ + denom: string; +} + +/** + * QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. + */ +export interface QuerySupplyOfResponse { + /** + * amount is the supply of the coin. + */ + amount?: Coin; +} + +/** + * QueryParamsRequest defines the request type for querying x/bank parameters. + */ +export interface QueryParamsRequest {} + +/** + * 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"; + +export const QueryBalanceRequest = { + encode(message: QueryBalanceRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + writer.uint32(18).string(message.denom); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryBalanceRequest { + const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceRequest { + const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, + toJSON(message: QueryBalanceRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, +}; + +export const QueryBalanceResponse = { + encode(message: QueryBalanceResponse, writer: Writer = Writer.create()): Writer { + if (message.balance !== undefined && message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryBalanceResponse { + const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromJSON(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceResponse { + const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromPartial(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + toJSON(message: QueryBalanceResponse): unknown { + const obj: any = {}; + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, +}; + +export const QueryAllBalancesRequest = { + encode(message: QueryAllBalancesRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAllBalancesRequest { + const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryAllBalancesRequest { + const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryAllBalancesRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryAllBalancesResponse = { + encode(message: QueryAllBalancesResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.balances = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAllBalancesResponse { + const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; + message.balances = []; + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Coin.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryAllBalancesResponse { + const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; + message.balances = []; + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Coin.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryAllBalancesResponse): unknown { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.balances = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryTotalSupplyRequest = { + encode(_: QueryTotalSupplyRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const QueryTotalSupplyResponse = { + encode(message: QueryTotalSupplyResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.supply) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.supply = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supply.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryTotalSupplyResponse { + const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; + message.supply = []; + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTotalSupplyResponse { + const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; + message.supply = []; + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: QueryTotalSupplyResponse): unknown { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.supply = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QuerySupplyOfRequest { + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QuerySupplyOfRequest { + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, + toJSON(message: QuerySupplyOfRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, +}; + +export const QuerySupplyOfResponse = { + encode(message: QuerySupplyOfResponse, writer: Writer = Writer.create()): Writer { + if (message.amount !== undefined && message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QuerySupplyOfResponse { + const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QuerySupplyOfResponse { + const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + toJSON(message: QuerySupplyOfResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, +}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined && message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..6a967bfb --- /dev/null +++ b/packages/stargate/src/codec/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,324 @@ +/* eslint-disable */ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; +import { Reader, Writer } from "protobufjs/minimal"; + +/** + * 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. + */ +export interface MsgSendResponse {} + +/** + * MsgMultiSend represents an arbitrary multi-in, multi-out send message. + */ +export interface MsgMultiSend { + inputs: Input[]; + outputs: Output[]; +} + +/** + * 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"; + +export const MsgSend = { + encode(message: MsgSend, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.fromAddress); + writer.uint32(18).string(message.toAddress); + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = String(object.fromAddress); + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = String(object.toAddress); + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = object.fromAddress; + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = object.toAddress; + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MsgSend): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, +}; + +export const MsgSendResponse = { + encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const MsgMultiSend = { + encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.inputs = []; + message.outputs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromJSON(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromPartial(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MsgMultiSend): unknown { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)); + } else { + obj.inputs = []; + } + if (message.outputs) { + obj.outputs = message.outputs.map((e) => (e ? Output.toJSON(e) : undefined)); + } else { + obj.outputs = []; + } + return obj; + }, +}; + +export const MsgMultiSendResponse = { + encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts b/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 00000000..06c4f129 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,1178 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Any } from "../../../../google/protobuf/any"; +import { Event } from "../../../../tendermint/abci/types"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponse { + /** + * The block height + */ + height: Long; + /** + * The transaction hash. + */ + txhash: string; + /** + * Namespace for the Code + */ + codespace: string; + /** + * Response code. + */ + code: number; + /** + * Result bytes, if any. + */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + rawLog: string; + /** + * The output of the application's logger (typed). May be non-deterministic. + */ + logs: ABCIMessageLog[]; + /** + * Additional information. May be non-deterministic. + */ + info: string; + /** + * Amount of gas requested for transaction. + */ + gasWanted: Long; + /** + * Amount of gas consumed by transaction. + */ + gasUsed: Long; + /** + * The request transaction bytes. + */ + tx?: Any; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; +} + +/** + * ABCIMessageLog defines a structure containing an indexed tx ABCI message log. + */ +export interface ABCIMessageLog { + msgIndex: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEvent[]; +} + +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEvent { + type: string; + attributes: Attribute[]; +} + +/** + * 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. + */ +export interface GasInfo { + /** + * GasWanted is the maximum units of work we allow this tx to perform. + */ + gasWanted: Long; + /** + * GasUsed is the amount of gas actually consumed. + */ + gasUsed: Long; +} + +/** + * 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: Uint8Array; + /** + * Log contains the log information from message or handler execution. + */ + log: string; + /** + * Events contains a slice of Event objects that were emitted during message + * or handler execution. + */ + events: Event[]; +} + +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponse { + gasInfo?: GasInfo; + result?: Result; +} + +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +/** + * 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 + */ +export interface SearchTxsResult { + /** + * Count of all txs + */ + totalCount: Long; + /** + * Count of txs in current page + */ + count: Long; + /** + * Index of current page, start from 1 + */ + pageNumber: Long; + /** + * Count of total pages + */ + pageTotal: Long; + /** + * Max count txs per page + */ + limit: Long; + /** + * List of txs in current page + */ + txs: TxResponse[]; +} + +const baseTxResponse: object = { + height: Long.ZERO, + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + 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); + writer.uint32(18).string(message.txhash); + writer.uint32(26).string(message.codespace); + writer.uint32(32).uint32(message.code); + writer.uint32(42).string(message.data); + writer.uint32(50).string(message.rawLog); + for (const v of message.logs) { + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + } + writer.uint32(66).string(message.info); + writer.uint32(72).int64(message.gasWanted); + writer.uint32(80).int64(message.gasUsed); + if (message.tx !== undefined && message.tx !== undefined) { + Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + } + writer.uint32(98).string(message.timestamp); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.logs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64() as Long; + break; + case 10: + message.gasUsed = reader.int64() as Long; + break; + case 11: + message.tx = Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxResponse { + const message = { ...baseTxResponse } as TxResponse; + message.logs = []; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = String(object.txhash); + } else { + message.txhash = ""; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = String(object.data); + } else { + message.data = ""; + } + if (object.rawLog !== undefined && object.rawLog !== null) { + message.rawLog = String(object.rawLog); + } else { + message.rawLog = ""; + } + if (object.logs !== undefined && object.logs !== null) { + for (const e of object.logs) { + message.logs.push(ABCIMessageLog.fromJSON(e)); + } + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromJSON(object.tx); + } else { + message.tx = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = String(object.timestamp); + } else { + message.timestamp = ""; + } + return message; + }, + fromPartial(object: DeepPartial): TxResponse { + const message = { ...baseTxResponse } as TxResponse; + message.logs = []; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } else { + message.txhash = ""; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = ""; + } + if (object.rawLog !== undefined && object.rawLog !== null) { + message.rawLog = object.rawLog; + } else { + message.rawLog = ""; + } + if (object.logs !== undefined && object.logs !== null) { + for (const e of object.logs) { + message.logs.push(ABCIMessageLog.fromPartial(e)); + } + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromPartial(object.tx); + } else { + message.tx = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = ""; + } + return message; + }, + toJSON(message: TxResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.txhash !== undefined && (obj.txhash = message.txhash); + message.codespace !== undefined && (obj.codespace = message.codespace); + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && (obj.data = message.data); + message.rawLog !== undefined && (obj.rawLog = message.rawLog); + if (message.logs) { + obj.logs = message.logs.map((e) => (e ? ABCIMessageLog.toJSON(e) : undefined)); + } else { + obj.logs = []; + } + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp); + return obj; + }, +}; + +export const ABCIMessageLog = { + encode(message: ABCIMessageLog, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.msgIndex); + writer.uint32(18).string(message.log); + for (const v of message.events) { + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ABCIMessageLog { + const message = { ...baseABCIMessageLog } as ABCIMessageLog; + message.events = []; + if (object.msgIndex !== undefined && object.msgIndex !== null) { + message.msgIndex = Number(object.msgIndex); + } else { + message.msgIndex = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(StringEvent.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ABCIMessageLog { + const message = { ...baseABCIMessageLog } as ABCIMessageLog; + message.events = []; + if (object.msgIndex !== undefined && object.msgIndex !== null) { + message.msgIndex = object.msgIndex; + } else { + message.msgIndex = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(StringEvent.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ABCIMessageLog): unknown { + const obj: any = {}; + message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex); + message.log !== undefined && (obj.log = message.log); + if (message.events) { + obj.events = message.events.map((e) => (e ? StringEvent.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, +}; + +export const StringEvent = { + encode(message: StringEvent, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.type); + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.attributes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): StringEvent { + const message = { ...baseStringEvent } as StringEvent; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(Attribute.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): StringEvent { + const message = { ...baseStringEvent } as StringEvent; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(Attribute.fromPartial(e)); + } + } + return message; + }, + toJSON(message: StringEvent): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map((e) => (e ? Attribute.toJSON(e) : undefined)); + } else { + obj.attributes = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAttribute } as Attribute; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Attribute { + const message = { ...baseAttribute } as Attribute; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Attribute { + const message = { ...baseAttribute } as Attribute; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } + return message; + }, + toJSON(message: Attribute): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGasInfo } as GasInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64() as Long; + break; + case 2: + message.gasUsed = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GasInfo { + const message = { ...baseGasInfo } as GasInfo; + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.UZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): GasInfo { + const message = { ...baseGasInfo } as GasInfo; + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.UZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.UZERO; + } + return message; + }, + toJSON(message: GasInfo): unknown { + const obj: any = {}; + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()); + return obj; + }, +}; + +export const Result = { + encode(message: Result, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.data); + writer.uint32(18).string(message.log); + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Result { + const message = { ...baseResult } as Result; + message.events = []; + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Result { + const message = { ...baseResult } as Result; + message.events = []; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Result): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, +}; + +export const SimulationResponse = { + encode(message: SimulationResponse, writer: Writer = Writer.create()): Writer { + if (message.gasInfo !== undefined && message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined && message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SimulationResponse { + const message = { ...baseSimulationResponse } as SimulationResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromJSON(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromJSON(object.result); + } else { + message.result = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): SimulationResponse { + const message = { ...baseSimulationResponse } as SimulationResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromPartial(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromPartial(object.result); + } else { + message.result = undefined; + } + return message; + }, + toJSON(message: SimulationResponse): unknown { + const obj: any = {}; + message.gasInfo !== undefined && + (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); + message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgData } as MsgData; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgData { + const message = { ...baseMsgData } as MsgData; + if (object.msgType !== undefined && object.msgType !== null) { + message.msgType = String(object.msgType); + } else { + message.msgType = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + fromPartial(object: DeepPartial): MsgData { + const message = { ...baseMsgData } as MsgData; + if (object.msgType !== undefined && object.msgType !== null) { + message.msgType = object.msgType; + } else { + message.msgType = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, + toJSON(message: MsgData): unknown { + const obj: any = {}; + message.msgType !== undefined && (obj.msgType = message.msgType); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, +}; + +export const TxMsgData = { + encode(message: TxMsgData, writer: Writer = Writer.create()): Writer { + for (const v of message.data) { + MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.data = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data.push(MsgData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxMsgData { + const message = { ...baseTxMsgData } as TxMsgData; + message.data = []; + if (object.data !== undefined && object.data !== null) { + for (const e of object.data) { + message.data.push(MsgData.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): TxMsgData { + const message = { ...baseTxMsgData } as TxMsgData; + message.data = []; + if (object.data !== undefined && object.data !== null) { + for (const e of object.data) { + message.data.push(MsgData.fromPartial(e)); + } + } + return message; + }, + toJSON(message: TxMsgData): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map((e) => (e ? MsgData.toJSON(e) : undefined)); + } else { + obj.data = []; + } + return obj; + }, +}; + +export const SearchTxsResult = { + encode(message: SearchTxsResult, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.totalCount); + writer.uint32(16).uint64(message.count); + writer.uint32(24).uint64(message.pageNumber); + writer.uint32(32).uint64(message.pageTotal); + writer.uint32(40).uint64(message.limit); + for (const v of message.txs) { + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.txs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64() as Long; + break; + case 2: + message.count = reader.uint64() as Long; + break; + case 3: + message.pageNumber = reader.uint64() as Long; + break; + case 4: + message.pageTotal = reader.uint64() as Long; + break; + case 5: + message.limit = reader.uint64() as Long; + break; + case 6: + message.txs.push(TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SearchTxsResult { + const message = { ...baseSearchTxsResult } as SearchTxsResult; + message.txs = []; + if (object.totalCount !== undefined && object.totalCount !== null) { + message.totalCount = Long.fromString(object.totalCount); + } else { + message.totalCount = Long.UZERO; + } + if (object.count !== undefined && object.count !== null) { + message.count = Long.fromString(object.count); + } else { + message.count = Long.UZERO; + } + if (object.pageNumber !== undefined && object.pageNumber !== null) { + message.pageNumber = Long.fromString(object.pageNumber); + } else { + message.pageNumber = Long.UZERO; + } + if (object.pageTotal !== undefined && object.pageTotal !== null) { + message.pageTotal = Long.fromString(object.pageTotal); + } else { + message.pageTotal = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Long.fromString(object.limit); + } else { + message.limit = Long.UZERO; + } + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(TxResponse.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SearchTxsResult { + const message = { ...baseSearchTxsResult } as SearchTxsResult; + message.txs = []; + if (object.totalCount !== undefined && object.totalCount !== null) { + message.totalCount = object.totalCount as Long; + } else { + message.totalCount = Long.UZERO; + } + if (object.count !== undefined && object.count !== null) { + message.count = object.count as Long; + } else { + message.count = Long.UZERO; + } + if (object.pageNumber !== undefined && object.pageNumber !== null) { + message.pageNumber = object.pageNumber as Long; + } else { + message.pageNumber = Long.UZERO; + } + if (object.pageTotal !== undefined && object.pageTotal !== null) { + message.pageTotal = object.pageTotal as Long; + } else { + message.pageTotal = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit as Long; + } else { + message.limit = Long.UZERO; + } + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(TxResponse.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SearchTxsResult): unknown { + const obj: any = {}; + message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); + message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString()); + message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()); + message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()); + message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + if (message.txs) { + obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)); + } else { + obj.txs = []; + } + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts b/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..0beaa413 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,261 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: Long; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit: Long; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; +} + +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + nextKey: Uint8Array; + /** + * 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"; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + writer.uint32(16).uint64(message.offset); + writer.uint32(24).uint64(message.limit); + writer.uint32(32).bool(message.countTotal); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64() as Long; + break; + case 3: + message.limit = reader.uint64() as Long; + break; + case 4: + message.countTotal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Long.fromString(object.offset); + } else { + message.offset = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Long.fromString(object.limit); + } else { + message.limit = Long.UZERO; + } + if (object.countTotal !== undefined && object.countTotal !== null) { + message.countTotal = Boolean(object.countTotal); + } else { + message.countTotal = false; + } + return message; + }, + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset as Long; + } else { + message.offset = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit as Long; + } else { + message.limit = Long.UZERO; + } + if (object.countTotal !== undefined && object.countTotal !== null) { + message.countTotal = object.countTotal; + } else { + message.countTotal = false; + } + return message; + }, + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); + message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.nextKey !== undefined && object.nextKey !== null) { + message.nextKey = bytesFromBase64(object.nextKey); + } + if (object.total !== undefined && object.total !== null) { + message.total = Long.fromString(object.total); + } else { + message.total = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.nextKey !== undefined && object.nextKey !== null) { + message.nextKey = object.nextKey; + } else { + message.nextKey = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total as Long; + } else { + message.total = Long.UZERO; + } + return message; + }, + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.nextKey !== undefined && + (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts b/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..34f4bad5 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,287 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} + +/** + * IntProto defines a Protobuf wrapper around an Int object. + */ +export interface IntProto { + int: string; +} + +/** + * 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"; + +export const Coin = { + encode(message: Coin, 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): Coin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoin } as Coin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, + toJSON(message: Coin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecCoin } as DecCoin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, + toJSON(message: DecCoin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntProto } as IntProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = String(object.int); + } else { + message.int = ""; + } + return message; + }, + fromPartial(object: DeepPartial): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } else { + message.int = ""; + } + return message; + }, + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecProto } as DecProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = String(object.dec); + } else { + message.dec = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } else { + message.dec = ""; + } + return message; + }, + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..6caa5ba6 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,183 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * 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. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} + +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) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: MultiSignature): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompactBitArray } as CompactBitArray; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = Number(object.extraBitsStored); + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + fromPartial(object: DeepPartial): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = object.extraBitsStored; + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = object.elems; + } else { + message.elems = new Uint8Array(); + } + return message; + }, + toJSON(message: CompactBitArray): unknown { + const obj: any = {}; + message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored); + message.elems !== undefined && + (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts b/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..eb131770 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,154 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * 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. + */ +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePubKey } as PubKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivKey } as PrivKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts b/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 00000000..3dff79c8 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,2099 @@ +/* eslint-disable */ +import { Header } from "../../../tendermint/types/types"; +import { Any } from "../../../google/protobuf/any"; +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); +} + +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** BondStatus is the status of a validator. + */ +export enum BondStatus { + /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. + */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. + */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. + */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. + */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1, +} + +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case "BOND_STATUS_UNSPECIFIED": + return BondStatus.BOND_STATUS_UNSPECIFIED; + case 1: + case "BOND_STATUS_UNBONDED": + return BondStatus.BOND_STATUS_UNBONDED; + case 2: + case "BOND_STATUS_UNBONDING": + return BondStatus.BOND_STATUS_UNBONDING; + case 3: + case "BOND_STATUS_BONDED": + return BondStatus.BOND_STATUS_BONDED; + case -1: + case "UNRECOGNIZED": + default: + return BondStatus.UNRECOGNIZED; + } +} + +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return "BOND_STATUS_UNSPECIFIED"; + case BondStatus.BOND_STATUS_UNBONDED: + return "BOND_STATUS_UNBONDED"; + case BondStatus.BOND_STATUS_UNBONDING: + return "BOND_STATUS_UNBONDING"; + case BondStatus.BOND_STATUS_BONDED: + return "BOND_STATUS_BONDED"; + default: + return "UNKNOWN"; + } +} + +export const HistoricalInfo = { + encode(message: HistoricalInfo, writer: Writer = Writer.create()): Writer { + if (message.header !== undefined && message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.valset = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): HistoricalInfo { + const message = { ...baseHistoricalInfo } as HistoricalInfo; + message.valset = []; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.valset !== undefined && object.valset !== null) { + for (const e of object.valset) { + message.valset.push(Validator.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): HistoricalInfo { + const message = { ...baseHistoricalInfo } as HistoricalInfo; + message.valset = []; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.valset !== undefined && object.valset !== null) { + for (const e of object.valset) { + message.valset.push(Validator.fromPartial(e)); + } + } + return message; + }, + toJSON(message: HistoricalInfo): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + if (message.valset) { + obj.valset = message.valset.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.valset = []; + } + return obj; + }, +}; + +export const CommissionRates = { + encode(message: CommissionRates, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.rate); + writer.uint32(18).string(message.maxRate); + writer.uint32(26).string(message.maxChangeRate); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CommissionRates { + const message = { ...baseCommissionRates } as CommissionRates; + if (object.rate !== undefined && object.rate !== null) { + message.rate = String(object.rate); + } else { + message.rate = ""; + } + if (object.maxRate !== undefined && object.maxRate !== null) { + message.maxRate = String(object.maxRate); + } else { + message.maxRate = ""; + } + if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) { + message.maxChangeRate = String(object.maxChangeRate); + } else { + message.maxChangeRate = ""; + } + return message; + }, + fromPartial(object: DeepPartial): CommissionRates { + const message = { ...baseCommissionRates } as CommissionRates; + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } else { + message.rate = ""; + } + if (object.maxRate !== undefined && object.maxRate !== null) { + message.maxRate = object.maxRate; + } else { + message.maxRate = ""; + } + if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) { + message.maxChangeRate = object.maxChangeRate; + } else { + message.maxChangeRate = ""; + } + return message; + }, + toJSON(message: CommissionRates): unknown { + const obj: any = {}; + message.rate !== undefined && (obj.rate = message.rate); + message.maxRate !== undefined && (obj.maxRate = message.maxRate); + message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate); + return obj; + }, +}; + +export const Commission = { + encode(message: Commission, writer: Writer = Writer.create()): Writer { + if (message.commissionRates !== undefined && message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined && message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Commission { + const message = { ...baseCommission } as Commission; + if (object.commissionRates !== undefined && object.commissionRates !== null) { + message.commissionRates = CommissionRates.fromJSON(object.commissionRates); + } else { + message.commissionRates = undefined; + } + if (object.updateTime !== undefined && object.updateTime !== null) { + message.updateTime = fromJsonTimestamp(object.updateTime); + } else { + message.updateTime = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Commission { + const message = { ...baseCommission } as Commission; + if (object.commissionRates !== undefined && object.commissionRates !== null) { + message.commissionRates = CommissionRates.fromPartial(object.commissionRates); + } else { + message.commissionRates = undefined; + } + if (object.updateTime !== undefined && object.updateTime !== null) { + message.updateTime = object.updateTime; + } else { + message.updateTime = undefined; + } + return message; + }, + toJSON(message: Commission): unknown { + const obj: any = {}; + message.commissionRates !== undefined && + (obj.commissionRates = message.commissionRates + ? CommissionRates.toJSON(message.commissionRates) + : undefined); + message.updateTime !== undefined && + (obj.updateTime = message.updateTime !== undefined ? message.updateTime.toISOString() : null); + return obj; + }, +}; + +export const Description = { + encode(message: Description, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.moniker); + writer.uint32(18).string(message.identity); + writer.uint32(26).string(message.website); + writer.uint32(34).string(message.securityContact); + writer.uint32(42).string(message.details); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Description { + const message = { ...baseDescription } as Description; + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = String(object.moniker); + } else { + message.moniker = ""; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = String(object.identity); + } else { + message.identity = ""; + } + if (object.website !== undefined && object.website !== null) { + message.website = String(object.website); + } else { + message.website = ""; + } + if (object.securityContact !== undefined && object.securityContact !== null) { + message.securityContact = String(object.securityContact); + } else { + message.securityContact = ""; + } + if (object.details !== undefined && object.details !== null) { + message.details = String(object.details); + } else { + message.details = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Description { + const message = { ...baseDescription } as Description; + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } else { + message.moniker = ""; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } else { + message.identity = ""; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } else { + message.website = ""; + } + if (object.securityContact !== undefined && object.securityContact !== null) { + message.securityContact = object.securityContact; + } else { + message.securityContact = ""; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } else { + message.details = ""; + } + return message; + }, + toJSON(message: Description): unknown { + const obj: any = {}; + message.moniker !== undefined && (obj.moniker = message.moniker); + message.identity !== undefined && (obj.identity = message.identity); + message.website !== undefined && (obj.website = message.website); + message.securityContact !== undefined && (obj.securityContact = message.securityContact); + message.details !== undefined && (obj.details = message.details); + return obj; + }, +}; + +export const Validator = { + encode(message: Validator, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.operatorAddress); + if (message.consensusPubkey !== undefined && message.consensusPubkey !== undefined) { + Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).bool(message.jailed); + writer.uint32(32).int32(message.status); + writer.uint32(42).string(message.tokens); + writer.uint32(50).string(message.delegatorShares); + if (message.description !== undefined && message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + } + writer.uint32(64).int64(message.unbondingHeight); + if (message.unbondingTime !== undefined && message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + } + if (message.commission !== undefined && message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + } + writer.uint32(90).string(message.minSelfDelegation); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32() as any; + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64() as Long; + break; + case 9: + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.commission = Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + if (object.operatorAddress !== undefined && object.operatorAddress !== null) { + message.operatorAddress = String(object.operatorAddress); + } else { + message.operatorAddress = ""; + } + if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) { + message.consensusPubkey = Any.fromJSON(object.consensusPubkey); + } else { + message.consensusPubkey = undefined; + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = Boolean(object.jailed); + } else { + message.jailed = false; + } + if (object.status !== undefined && object.status !== null) { + message.status = bondStatusFromJSON(object.status); + } else { + message.status = 0; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = String(object.tokens); + } else { + message.tokens = ""; + } + if (object.delegatorShares !== undefined && object.delegatorShares !== null) { + message.delegatorShares = String(object.delegatorShares); + } else { + message.delegatorShares = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) { + message.unbondingHeight = Long.fromString(object.unbondingHeight); + } else { + message.unbondingHeight = Long.ZERO; + } + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = fromJsonTimestamp(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromJSON(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.operatorAddress !== undefined && object.operatorAddress !== null) { + message.operatorAddress = object.operatorAddress; + } else { + message.operatorAddress = ""; + } + if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) { + message.consensusPubkey = Any.fromPartial(object.consensusPubkey); + } else { + message.consensusPubkey = undefined; + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } else { + message.jailed = false; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } else { + message.status = 0; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } else { + message.tokens = ""; + } + if (object.delegatorShares !== undefined && object.delegatorShares !== null) { + message.delegatorShares = object.delegatorShares; + } else { + message.delegatorShares = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) { + message.unbondingHeight = object.unbondingHeight as Long; + } else { + message.unbondingHeight = Long.ZERO; + } + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = object.unbondingTime; + } else { + message.unbondingTime = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromPartial(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + return message; + }, + toJSON(message: Validator): unknown { + const obj: any = {}; + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + message.consensusPubkey !== undefined && + (obj.consensusPubkey = message.consensusPubkey ? Any.toJSON(message.consensusPubkey) : undefined); + message.jailed !== undefined && (obj.jailed = message.jailed); + message.status !== undefined && (obj.status = bondStatusToJSON(message.status)); + message.tokens !== undefined && (obj.tokens = message.tokens); + message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares); + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.unbondingHeight !== undefined && + (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()); + message.unbondingTime !== undefined && + (obj.unbondingTime = message.unbondingTime !== undefined ? message.unbondingTime.toISOString() : null); + message.commission !== undefined && + (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + return obj; + }, +}; + +export const ValAddresses = { + encode(message: ValAddresses, writer: Writer = Writer.create()): Writer { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.addresses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValAddresses { + const message = { ...baseValAddresses } as ValAddresses; + message.addresses = []; + if (object.addresses !== undefined && object.addresses !== null) { + for (const e of object.addresses) { + message.addresses.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ValAddresses { + const message = { ...baseValAddresses } as ValAddresses; + message.addresses = []; + if (object.addresses !== undefined && object.addresses !== null) { + for (const e of object.addresses) { + message.addresses.push(e); + } + } + return message; + }, + toJSON(message: ValAddresses): unknown { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e); + } else { + obj.addresses = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDVPair } as DVPair; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DVPair { + const message = { ...baseDVPair } as DVPair; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DVPair { + const message = { ...baseDVPair } as DVPair; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, + toJSON(message: DVPair): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, +}; + +export const DVPairs = { + encode(message: DVPairs, writer: Writer = Writer.create()): Writer { + for (const v of message.pairs) { + DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.pairs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DVPairs { + const message = { ...baseDVPairs } as DVPairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(DVPair.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DVPairs { + const message = { ...baseDVPairs } as DVPairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(DVPair.fromPartial(e)); + } + } + return message; + }, + toJSON(message: DVPairs): unknown { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map((e) => (e ? DVPair.toJSON(e) : undefined)); + } else { + obj.pairs = []; + } + return obj; + }, +}; + +export const DVVTriplet = { + encode(message: DVVTriplet, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(26).string(message.validatorDstAddress); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DVVTriplet { + const message = { ...baseDVVTriplet } as DVVTriplet; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplet { + const message = { ...baseDVVTriplet } as DVVTriplet; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + return message; + }, + toJSON(message: DVVTriplet): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + return obj; + }, +}; + +export const DVVTriplets = { + encode(message: DVVTriplets, writer: Writer = Writer.create()): Writer { + for (const v of message.triplets) { + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.triplets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DVVTriplets { + const message = { ...baseDVVTriplets } as DVVTriplets; + message.triplets = []; + if (object.triplets !== undefined && object.triplets !== null) { + for (const e of object.triplets) { + message.triplets.push(DVVTriplet.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplets { + const message = { ...baseDVVTriplets } as DVVTriplets; + message.triplets = []; + if (object.triplets !== undefined && object.triplets !== null) { + for (const e of object.triplets) { + message.triplets.push(DVVTriplet.fromPartial(e)); + } + } + return message; + }, + toJSON(message: DVVTriplets): unknown { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map((e) => (e ? DVVTriplet.toJSON(e) : undefined)); + } else { + obj.triplets = []; + } + return obj; + }, +}; + +export const Delegation = { + encode(message: Delegation, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorAddress); + writer.uint32(26).string(message.shares); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Delegation { + const message = { ...baseDelegation } as Delegation; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = String(object.shares); + } else { + message.shares = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Delegation { + const message = { ...baseDelegation } as Delegation; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } else { + message.shares = ""; + } + return message; + }, + toJSON(message: Delegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.shares !== undefined && (obj.shares = message.shares); + return obj; + }, +}; + +export const UnbondingDelegation = { + encode(message: UnbondingDelegation, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorAddress); + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UnbondingDelegation { + const message = { ...baseUnbondingDelegation } as UnbondingDelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(UnbondingDelegationEntry.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegation { + const message = { ...baseUnbondingDelegation } as UnbondingDelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(UnbondingDelegationEntry.fromPartial(e)); + } + } + return message; + }, + toJSON(message: UnbondingDelegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? UnbondingDelegationEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, +}; + +export const UnbondingDelegationEntry = { + encode(message: UnbondingDelegationEntry, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.creationHeight); + if (message.completionTime !== undefined && message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.initialBalance); + writer.uint32(34).string(message.balance); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() as Long; + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UnbondingDelegationEntry { + const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = Long.fromString(object.creationHeight); + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = String(object.initialBalance); + } else { + message.initialBalance = ""; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = String(object.balance); + } else { + message.balance = ""; + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegationEntry { + const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = object.creationHeight as Long; + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = object.initialBalance; + } else { + message.initialBalance = ""; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } else { + message.balance = ""; + } + return message; + }, + toJSON(message: UnbondingDelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.completionTime !== undefined && + (obj.completionTime = + message.completionTime !== undefined ? message.completionTime.toISOString() : null); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.balance !== undefined && (obj.balance = message.balance); + return obj; + }, +}; + +export const RedelegationEntry = { + encode(message: RedelegationEntry, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.creationHeight); + if (message.completionTime !== undefined && message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.initialBalance); + writer.uint32(34).string(message.sharesDst); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() as Long; + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RedelegationEntry { + const message = { ...baseRedelegationEntry } as RedelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = Long.fromString(object.creationHeight); + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = String(object.initialBalance); + } else { + message.initialBalance = ""; + } + if (object.sharesDst !== undefined && object.sharesDst !== null) { + message.sharesDst = String(object.sharesDst); + } else { + message.sharesDst = ""; + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntry { + const message = { ...baseRedelegationEntry } as RedelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = object.creationHeight as Long; + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = object.initialBalance; + } else { + message.initialBalance = ""; + } + if (object.sharesDst !== undefined && object.sharesDst !== null) { + message.sharesDst = object.sharesDst; + } else { + message.sharesDst = ""; + } + return message; + }, + toJSON(message: RedelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.completionTime !== undefined && + (obj.completionTime = + message.completionTime !== undefined ? message.completionTime.toISOString() : null); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); + return obj; + }, +}; + +export const Redelegation = { + encode(message: Redelegation, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(26).string(message.validatorDstAddress); + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Redelegation { + const message = { ...baseRedelegation } as Redelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntry.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Redelegation { + const message = { ...baseRedelegation } as Redelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntry.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Redelegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? RedelegationEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, +}; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + if (message.unbondingTime !== undefined && message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).uint32(message.maxValidators); + writer.uint32(24).uint32(message.maxEntries); + writer.uint32(32).uint32(message.historicalEntries); + writer.uint32(42).string(message.bondDenom); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = Duration.fromJSON(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.maxValidators !== undefined && object.maxValidators !== null) { + message.maxValidators = Number(object.maxValidators); + } else { + message.maxValidators = 0; + } + if (object.maxEntries !== undefined && object.maxEntries !== null) { + message.maxEntries = Number(object.maxEntries); + } else { + message.maxEntries = 0; + } + if (object.historicalEntries !== undefined && object.historicalEntries !== null) { + message.historicalEntries = Number(object.historicalEntries); + } else { + message.historicalEntries = 0; + } + if (object.bondDenom !== undefined && object.bondDenom !== null) { + message.bondDenom = String(object.bondDenom); + } else { + message.bondDenom = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = Duration.fromPartial(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.maxValidators !== undefined && object.maxValidators !== null) { + message.maxValidators = object.maxValidators; + } else { + message.maxValidators = 0; + } + if (object.maxEntries !== undefined && object.maxEntries !== null) { + message.maxEntries = object.maxEntries; + } else { + message.maxEntries = 0; + } + if (object.historicalEntries !== undefined && object.historicalEntries !== null) { + message.historicalEntries = object.historicalEntries; + } else { + message.historicalEntries = 0; + } + if (object.bondDenom !== undefined && object.bondDenom !== null) { + message.bondDenom = object.bondDenom; + } else { + message.bondDenom = ""; + } + return message; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.unbondingTime !== undefined && + (obj.unbondingTime = message.unbondingTime ? Duration.toJSON(message.unbondingTime) : undefined); + message.maxValidators !== undefined && (obj.maxValidators = message.maxValidators); + message.maxEntries !== undefined && (obj.maxEntries = message.maxEntries); + message.historicalEntries !== undefined && (obj.historicalEntries = message.historicalEntries); + message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom); + return obj; + }, +}; + +export const DelegationResponse = { + encode(message: DelegationResponse, writer: Writer = Writer.create()): Writer { + if (message.delegation !== undefined && message.delegation !== undefined) { + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== undefined && message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DelegationResponse { + const message = { ...baseDelegationResponse } as DelegationResponse; + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromJSON(object.delegation); + } else { + message.delegation = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromJSON(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): DelegationResponse { + const message = { ...baseDelegationResponse } as DelegationResponse; + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromPartial(object.delegation); + } else { + message.delegation = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromPartial(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + toJSON(message: DelegationResponse): unknown { + const obj: any = {}; + message.delegation !== undefined && + (obj.delegation = message.delegation ? Delegation.toJSON(message.delegation) : undefined); + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, +}; + +export const RedelegationEntryResponse = { + encode(message: RedelegationEntryResponse, writer: Writer = Writer.create()): Writer { + if (message.redelegationEntry !== undefined && message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(34).string(message.balance); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RedelegationEntryResponse { + const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; + if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { + message.redelegationEntry = RedelegationEntry.fromJSON(object.redelegationEntry); + } else { + message.redelegationEntry = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = String(object.balance); + } else { + message.balance = ""; + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntryResponse { + const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; + if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { + message.redelegationEntry = RedelegationEntry.fromPartial(object.redelegationEntry); + } else { + message.redelegationEntry = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } else { + message.balance = ""; + } + return message; + }, + toJSON(message: RedelegationEntryResponse): unknown { + const obj: any = {}; + message.redelegationEntry !== undefined && + (obj.redelegationEntry = message.redelegationEntry + ? RedelegationEntry.toJSON(message.redelegationEntry) + : undefined); + message.balance !== undefined && (obj.balance = message.balance); + return obj; + }, +}; + +export const RedelegationResponse = { + encode(message: RedelegationResponse, writer: Writer = Writer.create()): Writer { + if (message.redelegation !== undefined && message.redelegation !== undefined) { + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RedelegationResponse { + const message = { ...baseRedelegationResponse } as RedelegationResponse; + message.entries = []; + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromJSON(object.redelegation); + } else { + message.redelegation = undefined; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntryResponse.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationResponse { + const message = { ...baseRedelegationResponse } as RedelegationResponse; + message.entries = []; + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromPartial(object.redelegation); + } else { + message.redelegation = undefined; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntryResponse.fromPartial(e)); + } + } + return message; + }, + toJSON(message: RedelegationResponse): unknown { + const obj: any = {}; + message.redelegation !== undefined && + (obj.redelegation = message.redelegation ? Redelegation.toJSON(message.redelegation) : undefined); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? RedelegationEntryResponse.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePool } as Pool; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Pool { + const message = { ...basePool } as Pool; + if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { + message.notBondedTokens = String(object.notBondedTokens); + } else { + message.notBondedTokens = ""; + } + if (object.bondedTokens !== undefined && object.bondedTokens !== null) { + message.bondedTokens = String(object.bondedTokens); + } else { + message.bondedTokens = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Pool { + const message = { ...basePool } as Pool; + if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { + message.notBondedTokens = object.notBondedTokens; + } else { + message.notBondedTokens = ""; + } + if (object.bondedTokens !== undefined && object.bondedTokens !== null) { + message.bondedTokens = object.bondedTokens; + } else { + message.bondedTokens = ""; + } + return message; + }, + toJSON(message: Pool): unknown { + const obj: any = {}; + message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens); + message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens); + return obj; + }, +}; + +if (util.Long !== (Long as any)) { + util.Long = Long as any; + configure(); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 00000000..bf05ef5b --- /dev/null +++ b/packages/stargate/src/codec/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,945 @@ +/* eslint-disable */ +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 { Timestamp } from "../../../google/protobuf/timestamp"; +import * as Long from "long"; + +/** + * MsgCreateValidator defines a SDK message for creating a new validator. + */ +export interface MsgCreateValidator { + description?: Description; + commission?: CommissionRates; + minSelfDelegation: string; + delegatorAddress: string; + validatorAddress: string; + pubkey?: Any; + value?: Coin; +} + +/** + * MsgCreateValidatorResponse defines the Msg/CreateValidator response type. + */ +export interface MsgCreateValidatorResponse {} + +/** + * MsgEditValidator defines a SDK message for editing an existing validator. + */ +export interface MsgEditValidator { + description?: Description; + validatorAddress: string; + /** + * We pass a reference to the new commission rate and min self delegation as + * it's not mandatory to update. If not updated, the deserialized rate will be + * zero with no way to distinguish if an update was intended. + * REF: #2373 + */ + commissionRate: string; + minSelfDelegation: string; +} + +/** + * 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. + */ +export interface MsgDelegate { + delegatorAddress: string; + validatorAddress: string; + amount?: Coin; +} + +/** + * 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. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + amount?: Coin; +} + +/** + * 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. + */ +export interface MsgUndelegate { + delegatorAddress: string; + validatorAddress: string; + amount?: Coin; +} + +/** + * 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"; + +export const MsgCreateValidator = { + encode(message: MsgCreateValidator, writer: Writer = Writer.create()): Writer { + if (message.description !== undefined && message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.commission !== undefined && message.commission !== undefined) { + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.minSelfDelegation); + writer.uint32(34).string(message.delegatorAddress); + writer.uint32(42).string(message.validatorAddress); + if (message.pubkey !== undefined && message.pubkey !== undefined) { + Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim(); + } + if (message.value !== undefined && message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = Any.decode(reader, reader.uint32()); + break; + case 7: + message.value = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCreateValidator { + const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromJSON(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = Any.fromJSON(object.pubkey); + } else { + message.pubkey = undefined; + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateValidator { + const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromPartial(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = Any.fromPartial(object.pubkey); + } else { + message.pubkey = undefined; + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromPartial(object.value); + } else { + message.value = undefined; + } + return message; + }, + toJSON(message: MsgCreateValidator): unknown { + const obj: any = {}; + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.commission !== undefined && + (obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); + message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); + return obj; + }, +}; + +export const MsgCreateValidatorResponse = { + encode(_: MsgCreateValidatorResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const MsgEditValidator = { + encode(message: MsgEditValidator, writer: Writer = Writer.create()): Writer { + if (message.description !== undefined && message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.validatorAddress); + writer.uint32(26).string(message.commissionRate); + writer.uint32(34).string(message.minSelfDelegation); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgEditValidator { + const message = { ...baseMsgEditValidator } as MsgEditValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.commissionRate !== undefined && object.commissionRate !== null) { + message.commissionRate = String(object.commissionRate); + } else { + message.commissionRate = ""; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + return message; + }, + fromPartial(object: DeepPartial): MsgEditValidator { + const message = { ...baseMsgEditValidator } as MsgEditValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.commissionRate !== undefined && object.commissionRate !== null) { + message.commissionRate = object.commissionRate; + } else { + message.commissionRate = ""; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + return message; + }, + toJSON(message: MsgEditValidator): unknown { + const obj: any = {}; + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + return obj; + }, +}; + +export const MsgEditValidatorResponse = { + encode(_: MsgEditValidatorResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const MsgDelegate = { + encode(message: MsgDelegate, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorAddress); + if (message.amount !== undefined && message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgDelegate { + const message = { ...baseMsgDelegate } as MsgDelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgDelegate { + const message = { ...baseMsgDelegate } as MsgDelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + toJSON(message: MsgDelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, +}; + +export const MsgDelegateResponse = { + encode(_: MsgDelegateResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const MsgBeginRedelegate = { + encode(message: MsgBeginRedelegate, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(26).string(message.validatorDstAddress); + if (message.amount !== undefined && message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgBeginRedelegate { + const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegate { + const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + toJSON(message: MsgBeginRedelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, +}; + +export const MsgBeginRedelegateResponse = { + encode(message: MsgBeginRedelegateResponse, writer: Writer = Writer.create()): Writer { + if (message.completionTime !== undefined && message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgBeginRedelegateResponse { + const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse { + const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + return message; + }, + toJSON(message: MsgBeginRedelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && + (obj.completionTime = + message.completionTime !== undefined ? message.completionTime.toISOString() : null); + return obj; + }, +}; + +export const MsgUndelegate = { + encode(message: MsgUndelegate, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.delegatorAddress); + writer.uint32(18).string(message.validatorAddress); + if (message.amount !== undefined && message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUndelegate { + const message = { ...baseMsgUndelegate } as MsgUndelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgUndelegate { + const message = { ...baseMsgUndelegate } as MsgUndelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + toJSON(message: MsgUndelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, +}; + +export const MsgUndelegateResponse = { + encode(message: MsgUndelegateResponse, writer: Writer = Writer.create()): Writer { + if (message.completionTime !== undefined && message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUndelegateResponse { + const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): MsgUndelegateResponse { + const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + return message; + }, + toJSON(message: MsgUndelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && + (obj.completionTime = + message.completionTime !== undefined ? message.completionTime.toISOString() : null); + return obj; + }, +}; + +if (util.Long !== (Long as any)) { + util.Long = Long as any; + configure(); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts b/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..c1c3552c --- /dev/null +++ b/packages/stargate/src/codec/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,532 @@ +/* eslint-disable */ +import { Any } from "../../../../google/protobuf/any"; +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. + */ +export enum SignMode { + /** SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected + */ + SIGN_MODE_UNSPECIFIED = 0, + /** SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx + */ + SIGN_MODE_DIRECT = 1, + /** SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT + */ + 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 = 127, + UNRECOGNIZED = -1, +} + +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + case 2: + case "SIGN_MODE_TEXTUAL": + return SignMode.SIGN_MODE_TEXTUAL; + case 127: + case "SIGN_MODE_LEGACY_AMINO_JSON": + return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} + +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + return "SIGN_MODE_DIRECT"; + case SignMode.SIGN_MODE_TEXTUAL: + return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: + return "SIGN_MODE_LEGACY_AMINO_JSON"; + default: + return "UNKNOWN"; + } +} + +export const SignatureDescriptors = { + encode(message: SignatureDescriptors, writer: Writer = Writer.create()): Writer { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SignatureDescriptors): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const SignatureDescriptor = { + encode(message: SignatureDescriptor, writer: Writer = Writer.create()): Writer { + if (message.publicKey !== undefined && message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined && message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromJSON(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromPartial(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: SignatureDescriptor): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.data !== undefined && + (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const SignatureDescriptor_Data = { + encode(message: SignatureDescriptor_Data, writer: Writer = Writer.create()): Writer { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + toJSON(message: SignatureDescriptor_Data): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); + return obj; + }, +}; + +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 { + 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, + toJSON(message: SignatureDescriptor_Data_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, +}; + +export const SignatureDescriptor_Data_Multi = { + encode(message: SignatureDescriptor_Data_Multi, writer: Writer = Writer.create()): Writer { + if (message.bitarray !== undefined && message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SignatureDescriptor_Data_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts b/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..cd82e4d3 --- /dev/null +++ b/packages/stargate/src/codec/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,1161 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Any } from "../../../google/protobuf/any"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../../../cosmos/tx/signing/v1beta1/signing"; +import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Tx is the standard type used for broadcasting transactions. + */ +export interface Tx { + /** + * body is the processable content of the transaction + */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** + * SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. + */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string; + /** + * account_number is the account number of the account in state + */ + accountNumber: Long; +} + +/** + * TxBody is the body of a transaction that all signers sign over. + */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary 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 + */ + timeoutHeight: Long; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} + +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee; +} + +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: Long; +} + +/** + * ModeInfo describes the signing mode of a single or nested multisig signer. + */ +export interface ModeInfo { + /** + * single represents a single signer + */ + single?: ModeInfo_Single | undefined; + /** + * 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 + */ +export interface ModeInfo_Single { + /** + * mode is the signing mode of the single signer + */ + mode: SignMode; +} + +/** + * Multi is the mode info for a multisig public key + */ +export interface ModeInfo_Multi { + /** + * bitarray specifies which keys within the multisig are signing + */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} + +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** + * amount is the amount of coins to be paid as a fee + */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: Long; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string; +} + +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) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined && message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromJSON(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromJSON(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromPartial(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromPartial(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: Tx): unknown { + const obj: any = {}; + message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); + message.authInfo !== undefined && + (obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const TxRaw = { + encode(message: TxRaw, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(18).bytes(message.authInfoBytes); + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: TxRaw): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const SignDoc = { + encode(message: SignDoc, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(18).bytes(message.authInfoBytes); + writer.uint32(26).string(message.chainId); + writer.uint32(32).uint64(message.accountNumber); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = Long.fromString(object.accountNumber); + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = object.accountNumber as Long; + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, + toJSON(message: SignDoc): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + return obj; + }, +}; + +export const TxBody = { + encode(message: TxBody, writer: Writer = Writer.create()): Writer { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.memo); + writer.uint32(24).uint64(message.timeoutHeight); + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64() as Long; + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromJSON(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = String(object.memo); + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Long.fromString(object.timeoutHeight); + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromJSON(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromPartial(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = object.timeoutHeight as Long; + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromPartial(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromPartial(e)); + } + } + return message; + }, + toJSON(message: TxBody): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.messages = []; + } + message.memo !== undefined && (obj.memo = message.memo); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + if (message.extensionOptions) { + obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.extensionOptions = []; + } + if (message.nonCriticalExtensionOptions) { + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => + e ? Any.toJSON(e) : undefined, + ); + } else { + obj.nonCriticalExtensionOptions = []; + } + return obj; + }, +}; + +export const AuthInfo = { + encode(message: AuthInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fee !== undefined && message.fee !== undefined) { + Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signerInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromJSON(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromJSON(object.fee); + } else { + message.fee = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromPartial(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromPartial(object.fee); + } else { + message.fee = undefined; + } + return message; + }, + toJSON(message: AuthInfo): unknown { + const obj: any = {}; + if (message.signerInfos) { + obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined)); + } else { + obj.signerInfos = []; + } + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + return obj; + }, +}; + +export const SignerInfo = { + encode(message: SignerInfo, writer: Writer = Writer.create()): Writer { + if (message.publicKey !== undefined && message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined && message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromJSON(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromPartial(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: SignerInfo): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.modeInfo !== undefined && + (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const ModeInfo = { + encode(message: ModeInfo, writer: Writer = Writer.create()): Writer { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + toJSON(message: ModeInfo): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined); + return obj; + }, +}; + +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 { + 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + return message; + }, + toJSON(message: ModeInfo_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + return obj; + }, +}; + +export const ModeInfo_Multi = { + encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer { + if (message.bitarray !== undefined && message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.modeInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ModeInfo_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.modeInfos) { + obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined)); + } else { + obj.modeInfos = []; + } + return obj; + }, +}; + +export const Fee = { + encode(message: Fee, writer: Writer = Writer.create()): Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).uint64(message.gasLimit); + writer.uint32(26).string(message.payer); + writer.uint32(34).string(message.granter); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64() as Long; + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = Long.fromString(object.gasLimit); + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = String(object.payer); + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = String(object.granter); + } else { + message.granter = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = object.gasLimit as Long; + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } else { + message.granter = ""; + } + return message; + }, + toJSON(message: Fee): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString()); + message.payer !== undefined && (obj.payer = message.payer); + message.granter !== undefined && (obj.granter = message.granter); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/cosmos_proto/cosmos.ts b/packages/stargate/src/codec/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..1ef6995b --- /dev/null +++ b/packages/stargate/src/codec/cosmos_proto/cosmos.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = "cosmos_proto"; diff --git a/packages/stargate/src/codec/generated/codecimpl.d.ts b/packages/stargate/src/codec/generated/codecimpl.d.ts deleted file mode 100644 index ec980e21..00000000 --- a/packages/stargate/src/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/src/codec/generated/codecimpl.js b/packages/stargate/src/codec/generated/codecimpl.js deleted file mode 100644 index 256d09e5..00000000 --- a/packages/stargate/src/codec/generated/codecimpl.js +++ /dev/null @@ -1,17198 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.tendermint = exports.ics23 = exports.ibc = exports.google = exports.cosmos = void 0; -var $protobuf = require("protobufjs/minimal"); -const $Reader = $protobuf.Reader, - $Writer = $protobuf.Writer, - $util = $protobuf.util; -const $root = {}; -exports.cosmos = $root.cosmos = (() => { - const cosmos = {}; - cosmos.auth = (function () { - const auth = {}; - auth.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.BaseAccount = (function () { - function BaseAccount(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BaseAccount.prototype.address = ""; - BaseAccount.prototype.pubKey = null; - BaseAccount.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - BaseAccount.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - BaseAccount.create = function create(properties) { - return new BaseAccount(properties); - }; - BaseAccount.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) - $root.google.protobuf.Any.encode(m.pubKey, w.uint32(18).fork()).ldelim(); - if (m.accountNumber != null && Object.hasOwnProperty.call(m, "accountNumber")) - w.uint32(24).uint64(m.accountNumber); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(32).uint64(m.sequence); - return w; - }; - BaseAccount.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.BaseAccount(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - m.pubKey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 3: - m.accountNumber = r.uint64(); - break; - case 4: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BaseAccount; - })(); - v1beta1.ModuleAccount = (function () { - function ModuleAccount(p) { - this.permissions = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ModuleAccount.prototype.baseAccount = null; - ModuleAccount.prototype.name = ""; - ModuleAccount.prototype.permissions = $util.emptyArray; - ModuleAccount.create = function create(properties) { - return new ModuleAccount(properties); - }; - ModuleAccount.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.baseAccount != null && Object.hasOwnProperty.call(m, "baseAccount")) - $root.cosmos.auth.v1beta1.BaseAccount.encode(m.baseAccount, w.uint32(10).fork()).ldelim(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(18).string(m.name); - if (m.permissions != null && m.permissions.length) { - for (var i = 0; i < m.permissions.length; ++i) w.uint32(26).string(m.permissions[i]); - } - return w; - }; - ModuleAccount.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.ModuleAccount(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.baseAccount = $root.cosmos.auth.v1beta1.BaseAccount.decode(r, r.uint32()); - break; - case 2: - m.name = r.string(); - break; - case 3: - if (!(m.permissions && m.permissions.length)) m.permissions = []; - m.permissions.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ModuleAccount; - })(); - v1beta1.Params = (function () { - function Params(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.maxMemoCharacters = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Params.prototype.txSigLimit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Params.prototype.txSizeCostPerByte = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Params.prototype.sigVerifyCostEd25519 = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Params.prototype.sigVerifyCostSecp256k1 = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.maxMemoCharacters != null && Object.hasOwnProperty.call(m, "maxMemoCharacters")) - w.uint32(8).uint64(m.maxMemoCharacters); - if (m.txSigLimit != null && Object.hasOwnProperty.call(m, "txSigLimit")) - w.uint32(16).uint64(m.txSigLimit); - if (m.txSizeCostPerByte != null && Object.hasOwnProperty.call(m, "txSizeCostPerByte")) - w.uint32(24).uint64(m.txSizeCostPerByte); - if (m.sigVerifyCostEd25519 != null && Object.hasOwnProperty.call(m, "sigVerifyCostEd25519")) - w.uint32(32).uint64(m.sigVerifyCostEd25519); - if (m.sigVerifyCostSecp256k1 != null && Object.hasOwnProperty.call(m, "sigVerifyCostSecp256k1")) - w.uint32(40).uint64(m.sigVerifyCostSecp256k1); - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.maxMemoCharacters = r.uint64(); - break; - case 2: - m.txSigLimit = r.uint64(); - break; - case 3: - m.txSizeCostPerByte = r.uint64(); - break; - case 4: - m.sigVerifyCostEd25519 = r.uint64(); - break; - case 5: - m.sigVerifyCostSecp256k1 = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - v1beta1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.account = function account(request, callback) { - return this.rpcCall( - account, - $root.cosmos.auth.v1beta1.QueryAccountRequest, - $root.cosmos.auth.v1beta1.QueryAccountResponse, - request, - callback, - ); - }), - "name", - { value: "Account" }, - ); - Object.defineProperty( - (Query.prototype.params = function params(request, callback) { - return this.rpcCall( - params, - $root.cosmos.auth.v1beta1.QueryParamsRequest, - $root.cosmos.auth.v1beta1.QueryParamsResponse, - request, - callback, - ); - }), - "name", - { value: "Params" }, - ); - return Query; - })(); - v1beta1.QueryAccountRequest = (function () { - function QueryAccountRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryAccountRequest.prototype.address = ""; - QueryAccountRequest.create = function create(properties) { - return new QueryAccountRequest(properties); - }; - QueryAccountRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - return w; - }; - QueryAccountRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.QueryAccountRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryAccountRequest; - })(); - v1beta1.QueryAccountResponse = (function () { - function QueryAccountResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryAccountResponse.prototype.account = null; - QueryAccountResponse.create = function create(properties) { - return new QueryAccountResponse(properties); - }; - QueryAccountResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.account != null && Object.hasOwnProperty.call(m, "account")) - $root.google.protobuf.Any.encode(m.account, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryAccountResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.QueryAccountResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.account = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryAccountResponse; - })(); - v1beta1.QueryParamsRequest = (function () { - function QueryParamsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsRequest.create = function create(properties) { - return new QueryParamsRequest(properties); - }; - QueryParamsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryParamsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.QueryParamsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsRequest; - })(); - v1beta1.QueryParamsResponse = (function () { - function QueryParamsResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsResponse.prototype.params = null; - QueryParamsResponse.create = function create(properties) { - return new QueryParamsResponse(properties); - }; - QueryParamsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.params != null && Object.hasOwnProperty.call(m, "params")) - $root.cosmos.auth.v1beta1.Params.encode(m.params, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryParamsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.auth.v1beta1.QueryParamsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.params = $root.cosmos.auth.v1beta1.Params.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsResponse; - })(); - return v1beta1; - })(); - return auth; - })(); - cosmos.bank = (function () { - const bank = {}; - bank.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Params = (function () { - function Params(p) { - this.sendEnabled = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.sendEnabled = $util.emptyArray; - Params.prototype.defaultSendEnabled = false; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.sendEnabled != null && m.sendEnabled.length) { - for (var i = 0; i < m.sendEnabled.length; ++i) - $root.cosmos.bank.v1beta1.SendEnabled.encode(m.sendEnabled[i], w.uint32(10).fork()).ldelim(); - } - if (m.defaultSendEnabled != null && Object.hasOwnProperty.call(m, "defaultSendEnabled")) - w.uint32(16).bool(m.defaultSendEnabled); - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.sendEnabled && m.sendEnabled.length)) m.sendEnabled = []; - m.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(r, r.uint32())); - break; - case 2: - m.defaultSendEnabled = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - v1beta1.SendEnabled = (function () { - function SendEnabled(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SendEnabled.prototype.denom = ""; - SendEnabled.prototype.enabled = false; - SendEnabled.create = function create(properties) { - return new SendEnabled(properties); - }; - SendEnabled.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.enabled != null && Object.hasOwnProperty.call(m, "enabled")) w.uint32(16).bool(m.enabled); - return w; - }; - SendEnabled.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.SendEnabled(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.enabled = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SendEnabled; - })(); - v1beta1.Input = (function () { - function Input(p) { - this.coins = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Input.prototype.address = ""; - Input.prototype.coins = $util.emptyArray; - Input.create = function create(properties) { - return new Input(properties); - }; - Input.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.coins != null && m.coins.length) { - for (var i = 0; i < m.coins.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.coins[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Input.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Input(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - if (!(m.coins && m.coins.length)) m.coins = []; - m.coins.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Input; - })(); - v1beta1.Output = (function () { - function Output(p) { - this.coins = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Output.prototype.address = ""; - Output.prototype.coins = $util.emptyArray; - Output.create = function create(properties) { - return new Output(properties); - }; - Output.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.coins != null && m.coins.length) { - for (var i = 0; i < m.coins.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.coins[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Output.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Output(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - if (!(m.coins && m.coins.length)) m.coins = []; - m.coins.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Output; - })(); - v1beta1.Supply = (function () { - function Supply(p) { - this.total = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Supply.prototype.total = $util.emptyArray; - Supply.create = function create(properties) { - return new Supply(properties); - }; - Supply.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.total != null && m.total.length) { - for (var i = 0; i < m.total.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.total[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - Supply.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Supply(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.total && m.total.length)) m.total = []; - m.total.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Supply; - })(); - v1beta1.DenomUnit = (function () { - function DenomUnit(p) { - this.aliases = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DenomUnit.prototype.denom = ""; - DenomUnit.prototype.exponent = 0; - DenomUnit.prototype.aliases = $util.emptyArray; - DenomUnit.create = function create(properties) { - return new DenomUnit(properties); - }; - DenomUnit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.exponent != null && Object.hasOwnProperty.call(m, "exponent")) - w.uint32(16).uint32(m.exponent); - if (m.aliases != null && m.aliases.length) { - for (var i = 0; i < m.aliases.length; ++i) w.uint32(26).string(m.aliases[i]); - } - return w; - }; - DenomUnit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.DenomUnit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.exponent = r.uint32(); - break; - case 3: - if (!(m.aliases && m.aliases.length)) m.aliases = []; - m.aliases.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DenomUnit; - })(); - v1beta1.Metadata = (function () { - function Metadata(p) { - this.denomUnits = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Metadata.prototype.description = ""; - Metadata.prototype.denomUnits = $util.emptyArray; - Metadata.prototype.base = ""; - Metadata.prototype.display = ""; - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - Metadata.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - w.uint32(10).string(m.description); - if (m.denomUnits != null && m.denomUnits.length) { - for (var i = 0; i < m.denomUnits.length; ++i) - $root.cosmos.bank.v1beta1.DenomUnit.encode(m.denomUnits[i], w.uint32(18).fork()).ldelim(); - } - if (m.base != null && Object.hasOwnProperty.call(m, "base")) w.uint32(26).string(m.base); - if (m.display != null && Object.hasOwnProperty.call(m, "display")) w.uint32(34).string(m.display); - return w; - }; - Metadata.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Metadata(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.description = r.string(); - break; - case 2: - if (!(m.denomUnits && m.denomUnits.length)) m.denomUnits = []; - m.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(r, r.uint32())); - break; - case 3: - m.base = r.string(); - break; - case 4: - m.display = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Metadata; - })(); - v1beta1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.balance = function balance(request, callback) { - return this.rpcCall( - balance, - $root.cosmos.bank.v1beta1.QueryBalanceRequest, - $root.cosmos.bank.v1beta1.QueryBalanceResponse, - request, - callback, - ); - }), - "name", - { value: "Balance" }, - ); - Object.defineProperty( - (Query.prototype.allBalances = function allBalances(request, callback) { - return this.rpcCall( - allBalances, - $root.cosmos.bank.v1beta1.QueryAllBalancesRequest, - $root.cosmos.bank.v1beta1.QueryAllBalancesResponse, - request, - callback, - ); - }), - "name", - { value: "AllBalances" }, - ); - Object.defineProperty( - (Query.prototype.totalSupply = function totalSupply(request, callback) { - return this.rpcCall( - totalSupply, - $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest, - $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse, - request, - callback, - ); - }), - "name", - { value: "TotalSupply" }, - ); - Object.defineProperty( - (Query.prototype.supplyOf = function supplyOf(request, callback) { - return this.rpcCall( - supplyOf, - $root.cosmos.bank.v1beta1.QuerySupplyOfRequest, - $root.cosmos.bank.v1beta1.QuerySupplyOfResponse, - request, - callback, - ); - }), - "name", - { value: "SupplyOf" }, - ); - Object.defineProperty( - (Query.prototype.params = function params(request, callback) { - return this.rpcCall( - params, - $root.cosmos.bank.v1beta1.QueryParamsRequest, - $root.cosmos.bank.v1beta1.QueryParamsResponse, - request, - callback, - ); - }), - "name", - { value: "Params" }, - ); - return Query; - })(); - v1beta1.QueryBalanceRequest = (function () { - function QueryBalanceRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryBalanceRequest.prototype.address = ""; - QueryBalanceRequest.prototype.denom = ""; - QueryBalanceRequest.create = function create(properties) { - return new QueryBalanceRequest(properties); - }; - QueryBalanceRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(18).string(m.denom); - return w; - }; - QueryBalanceRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryBalanceRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - m.denom = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryBalanceRequest; - })(); - v1beta1.QueryBalanceResponse = (function () { - function QueryBalanceResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryBalanceResponse.prototype.balance = null; - QueryBalanceResponse.create = function create(properties) { - return new QueryBalanceResponse(properties); - }; - QueryBalanceResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) - $root.cosmos.base.v1beta1.Coin.encode(m.balance, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryBalanceResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryBalanceResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.balance = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryBalanceResponse; - })(); - v1beta1.QueryAllBalancesRequest = (function () { - function QueryAllBalancesRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryAllBalancesRequest.prototype.address = ""; - QueryAllBalancesRequest.prototype.pagination = null; - QueryAllBalancesRequest.create = function create(properties) { - return new QueryAllBalancesRequest(properties); - }; - QueryAllBalancesRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryAllBalancesRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryAllBalancesRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryAllBalancesRequest; - })(); - v1beta1.QueryAllBalancesResponse = (function () { - function QueryAllBalancesResponse(p) { - this.balances = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryAllBalancesResponse.prototype.balances = $util.emptyArray; - QueryAllBalancesResponse.prototype.pagination = null; - QueryAllBalancesResponse.create = function create(properties) { - return new QueryAllBalancesResponse(properties); - }; - QueryAllBalancesResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.balances != null && m.balances.length) { - for (var i = 0; i < m.balances.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.balances[i], w.uint32(10).fork()).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryAllBalancesResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryAllBalancesResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.balances && m.balances.length)) m.balances = []; - m.balances.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryAllBalancesResponse; - })(); - v1beta1.QueryTotalSupplyRequest = (function () { - function QueryTotalSupplyRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryTotalSupplyRequest.create = function create(properties) { - return new QueryTotalSupplyRequest(properties); - }; - QueryTotalSupplyRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryTotalSupplyRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryTotalSupplyRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryTotalSupplyRequest; - })(); - v1beta1.QueryTotalSupplyResponse = (function () { - function QueryTotalSupplyResponse(p) { - this.supply = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryTotalSupplyResponse.prototype.supply = $util.emptyArray; - QueryTotalSupplyResponse.create = function create(properties) { - return new QueryTotalSupplyResponse(properties); - }; - QueryTotalSupplyResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.supply != null && m.supply.length) { - for (var i = 0; i < m.supply.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.supply[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - QueryTotalSupplyResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryTotalSupplyResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.supply && m.supply.length)) m.supply = []; - m.supply.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryTotalSupplyResponse; - })(); - v1beta1.QuerySupplyOfRequest = (function () { - function QuerySupplyOfRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QuerySupplyOfRequest.prototype.denom = ""; - QuerySupplyOfRequest.create = function create(properties) { - return new QuerySupplyOfRequest(properties); - }; - QuerySupplyOfRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - return w; - }; - QuerySupplyOfRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QuerySupplyOfRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QuerySupplyOfRequest; - })(); - v1beta1.QuerySupplyOfResponse = (function () { - function QuerySupplyOfResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QuerySupplyOfResponse.prototype.amount = null; - QuerySupplyOfResponse.create = function create(properties) { - return new QuerySupplyOfResponse(properties); - }; - QuerySupplyOfResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(m.amount, w.uint32(10).fork()).ldelim(); - return w; - }; - QuerySupplyOfResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QuerySupplyOfResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.amount = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QuerySupplyOfResponse; - })(); - v1beta1.QueryParamsRequest = (function () { - function QueryParamsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsRequest.create = function create(properties) { - return new QueryParamsRequest(properties); - }; - QueryParamsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryParamsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryParamsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsRequest; - })(); - v1beta1.QueryParamsResponse = (function () { - function QueryParamsResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsResponse.prototype.params = null; - QueryParamsResponse.create = function create(properties) { - return new QueryParamsResponse(properties); - }; - QueryParamsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.params != null && Object.hasOwnProperty.call(m, "params")) - $root.cosmos.bank.v1beta1.Params.encode(m.params, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryParamsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.QueryParamsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.params = $root.cosmos.bank.v1beta1.Params.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsResponse; - })(); - v1beta1.Msg = (function () { - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Msg.prototype.send = function send(request, callback) { - return this.rpcCall( - send, - $root.cosmos.bank.v1beta1.MsgSend, - $root.cosmos.bank.v1beta1.MsgSendResponse, - request, - callback, - ); - }), - "name", - { value: "Send" }, - ); - Object.defineProperty( - (Msg.prototype.multiSend = function multiSend(request, callback) { - return this.rpcCall( - multiSend, - $root.cosmos.bank.v1beta1.MsgMultiSend, - $root.cosmos.bank.v1beta1.MsgMultiSendResponse, - request, - callback, - ); - }), - "name", - { value: "MultiSend" }, - ); - return Msg; - })(); - v1beta1.MsgSend = (function () { - function MsgSend(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSend.prototype.fromAddress = ""; - MsgSend.prototype.toAddress = ""; - MsgSend.prototype.amount = $util.emptyArray; - MsgSend.create = function create(properties) { - return new MsgSend(properties); - }; - MsgSend.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.fromAddress != null && Object.hasOwnProperty.call(m, "fromAddress")) - w.uint32(10).string(m.fromAddress); - if (m.toAddress != null && Object.hasOwnProperty.call(m, "toAddress")) - w.uint32(18).string(m.toAddress); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(26).fork()).ldelim(); - } - return w; - }; - MsgSend.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgSend(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.fromAddress = r.string(); - break; - case 2: - m.toAddress = r.string(); - break; - case 3: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSend; - })(); - v1beta1.MsgSendResponse = (function () { - function MsgSendResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSendResponse.create = function create(properties) { - return new MsgSendResponse(properties); - }; - MsgSendResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgSendResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgSendResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSendResponse; - })(); - v1beta1.MsgMultiSend = (function () { - function MsgMultiSend(p) { - this.inputs = []; - this.outputs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgMultiSend.prototype.inputs = $util.emptyArray; - MsgMultiSend.prototype.outputs = $util.emptyArray; - MsgMultiSend.create = function create(properties) { - return new MsgMultiSend(properties); - }; - MsgMultiSend.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.inputs != null && m.inputs.length) { - for (var i = 0; i < m.inputs.length; ++i) - $root.cosmos.bank.v1beta1.Input.encode(m.inputs[i], w.uint32(10).fork()).ldelim(); - } - if (m.outputs != null && m.outputs.length) { - for (var i = 0; i < m.outputs.length; ++i) - $root.cosmos.bank.v1beta1.Output.encode(m.outputs[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - MsgMultiSend.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgMultiSend(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.inputs && m.inputs.length)) m.inputs = []; - m.inputs.push($root.cosmos.bank.v1beta1.Input.decode(r, r.uint32())); - break; - case 2: - if (!(m.outputs && m.outputs.length)) m.outputs = []; - m.outputs.push($root.cosmos.bank.v1beta1.Output.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgMultiSend; - })(); - v1beta1.MsgMultiSendResponse = (function () { - function MsgMultiSendResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgMultiSendResponse.create = function create(properties) { - return new MsgMultiSendResponse(properties); - }; - MsgMultiSendResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgMultiSendResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgMultiSendResponse; - })(); - return v1beta1; - })(); - return bank; - })(); - cosmos.base = (function () { - const base = {}; - base.abci = (function () { - const abci = {}; - abci.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.TxResponse = (function () { - function TxResponse(p) { - this.logs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxResponse.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - TxResponse.prototype.txhash = ""; - TxResponse.prototype.codespace = ""; - TxResponse.prototype.code = 0; - TxResponse.prototype.data = ""; - TxResponse.prototype.rawLog = ""; - TxResponse.prototype.logs = $util.emptyArray; - TxResponse.prototype.info = ""; - TxResponse.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - TxResponse.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - TxResponse.prototype.tx = null; - TxResponse.prototype.timestamp = ""; - TxResponse.create = function create(properties) { - return new TxResponse(properties); - }; - TxResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).int64(m.height); - if (m.txhash != null && Object.hasOwnProperty.call(m, "txhash")) w.uint32(18).string(m.txhash); - if (m.codespace != null && Object.hasOwnProperty.call(m, "codespace")) - w.uint32(26).string(m.codespace); - if (m.code != null && Object.hasOwnProperty.call(m, "code")) w.uint32(32).uint32(m.code); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(42).string(m.data); - if (m.rawLog != null && Object.hasOwnProperty.call(m, "rawLog")) w.uint32(50).string(m.rawLog); - if (m.logs != null && m.logs.length) { - for (var i = 0; i < m.logs.length; ++i) - $root.cosmos.base.abci.v1beta1.ABCIMessageLog.encode(m.logs[i], w.uint32(58).fork()).ldelim(); - } - if (m.info != null && Object.hasOwnProperty.call(m, "info")) w.uint32(66).string(m.info); - if (m.gasWanted != null && Object.hasOwnProperty.call(m, "gasWanted")) - w.uint32(72).int64(m.gasWanted); - if (m.gasUsed != null && Object.hasOwnProperty.call(m, "gasUsed")) w.uint32(80).int64(m.gasUsed); - if (m.tx != null && Object.hasOwnProperty.call(m, "tx")) - $root.google.protobuf.Any.encode(m.tx, w.uint32(90).fork()).ldelim(); - if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) - w.uint32(98).string(m.timestamp); - return w; - }; - TxResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.TxResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.int64(); - break; - case 2: - m.txhash = r.string(); - break; - case 3: - m.codespace = r.string(); - break; - case 4: - m.code = r.uint32(); - break; - case 5: - m.data = r.string(); - break; - case 6: - m.rawLog = r.string(); - break; - case 7: - if (!(m.logs && m.logs.length)) m.logs = []; - m.logs.push($root.cosmos.base.abci.v1beta1.ABCIMessageLog.decode(r, r.uint32())); - break; - case 8: - m.info = r.string(); - break; - case 9: - m.gasWanted = r.int64(); - break; - case 10: - m.gasUsed = r.int64(); - break; - case 11: - m.tx = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 12: - m.timestamp = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxResponse; - })(); - v1beta1.ABCIMessageLog = (function () { - function ABCIMessageLog(p) { - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ABCIMessageLog.prototype.msgIndex = 0; - ABCIMessageLog.prototype.log = ""; - ABCIMessageLog.prototype.events = $util.emptyArray; - ABCIMessageLog.create = function create(properties) { - return new ABCIMessageLog(properties); - }; - ABCIMessageLog.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.msgIndex != null && Object.hasOwnProperty.call(m, "msgIndex")) - w.uint32(8).uint32(m.msgIndex); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(18).string(m.log); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.cosmos.base.abci.v1beta1.StringEvent.encode(m.events[i], w.uint32(26).fork()).ldelim(); - } - return w; - }; - ABCIMessageLog.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.ABCIMessageLog(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.msgIndex = r.uint32(); - break; - case 2: - m.log = r.string(); - break; - case 3: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.cosmos.base.abci.v1beta1.StringEvent.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ABCIMessageLog; - })(); - v1beta1.StringEvent = (function () { - function StringEvent(p) { - this.attributes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - StringEvent.prototype.type = ""; - StringEvent.prototype.attributes = $util.emptyArray; - StringEvent.create = function create(properties) { - return new StringEvent(properties); - }; - StringEvent.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(10).string(m.type); - if (m.attributes != null && m.attributes.length) { - for (var i = 0; i < m.attributes.length; ++i) - $root.cosmos.base.abci.v1beta1.Attribute.encode( - m.attributes[i], - w.uint32(18).fork(), - ).ldelim(); - } - return w; - }; - StringEvent.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.StringEvent(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.string(); - break; - case 2: - if (!(m.attributes && m.attributes.length)) m.attributes = []; - m.attributes.push($root.cosmos.base.abci.v1beta1.Attribute.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return StringEvent; - })(); - v1beta1.Attribute = (function () { - function Attribute(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Attribute.prototype.key = ""; - Attribute.prototype.value = ""; - Attribute.create = function create(properties) { - return new Attribute(properties); - }; - Attribute.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).string(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).string(m.value); - return w; - }; - Attribute.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.Attribute(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.string(); - break; - case 2: - m.value = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Attribute; - })(); - v1beta1.GasInfo = (function () { - function GasInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - GasInfo.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - GasInfo.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - GasInfo.create = function create(properties) { - return new GasInfo(properties); - }; - GasInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.gasWanted != null && Object.hasOwnProperty.call(m, "gasWanted")) - w.uint32(8).uint64(m.gasWanted); - if (m.gasUsed != null && Object.hasOwnProperty.call(m, "gasUsed")) w.uint32(16).uint64(m.gasUsed); - return w; - }; - GasInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.GasInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.gasWanted = r.uint64(); - break; - case 2: - m.gasUsed = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return GasInfo; - })(); - v1beta1.Result = (function () { - function Result(p) { - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Result.prototype.data = $util.newBuffer([]); - Result.prototype.log = ""; - Result.prototype.events = $util.emptyArray; - Result.create = function create(properties) { - return new Result(properties); - }; - Result.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(10).bytes(m.data); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(18).string(m.log); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.tendermint.abci.Event.encode(m.events[i], w.uint32(26).fork()).ldelim(); - } - return w; - }; - Result.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.Result(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.data = r.bytes(); - break; - case 2: - m.log = r.string(); - break; - case 3: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.tendermint.abci.Event.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Result; - })(); - v1beta1.SimulationResponse = (function () { - function SimulationResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SimulationResponse.prototype.gasInfo = null; - SimulationResponse.prototype.result = null; - SimulationResponse.create = function create(properties) { - return new SimulationResponse(properties); - }; - SimulationResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.gasInfo != null && Object.hasOwnProperty.call(m, "gasInfo")) - $root.cosmos.base.abci.v1beta1.GasInfo.encode(m.gasInfo, w.uint32(10).fork()).ldelim(); - if (m.result != null && Object.hasOwnProperty.call(m, "result")) - $root.cosmos.base.abci.v1beta1.Result.encode(m.result, w.uint32(18).fork()).ldelim(); - return w; - }; - SimulationResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.SimulationResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.gasInfo = $root.cosmos.base.abci.v1beta1.GasInfo.decode(r, r.uint32()); - break; - case 2: - m.result = $root.cosmos.base.abci.v1beta1.Result.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SimulationResponse; - })(); - v1beta1.MsgData = (function () { - function MsgData(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgData.prototype.msgType = ""; - MsgData.prototype.data = $util.newBuffer([]); - MsgData.create = function create(properties) { - return new MsgData(properties); - }; - MsgData.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.msgType != null && Object.hasOwnProperty.call(m, "msgType")) w.uint32(10).string(m.msgType); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(18).bytes(m.data); - return w; - }; - MsgData.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.MsgData(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.msgType = r.string(); - break; - case 2: - m.data = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgData; - })(); - v1beta1.TxMsgData = (function () { - function TxMsgData(p) { - this.data = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxMsgData.prototype.data = $util.emptyArray; - TxMsgData.create = function create(properties) { - return new TxMsgData(properties); - }; - TxMsgData.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.data != null && m.data.length) { - for (var i = 0; i < m.data.length; ++i) - $root.cosmos.base.abci.v1beta1.MsgData.encode(m.data[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - TxMsgData.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.TxMsgData(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.data && m.data.length)) m.data = []; - m.data.push($root.cosmos.base.abci.v1beta1.MsgData.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxMsgData; - })(); - v1beta1.SearchTxsResult = (function () { - function SearchTxsResult(p) { - this.txs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SearchTxsResult.prototype.totalCount = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SearchTxsResult.prototype.count = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SearchTxsResult.prototype.pageNumber = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SearchTxsResult.prototype.pageTotal = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SearchTxsResult.prototype.limit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SearchTxsResult.prototype.txs = $util.emptyArray; - SearchTxsResult.create = function create(properties) { - return new SearchTxsResult(properties); - }; - SearchTxsResult.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.totalCount != null && Object.hasOwnProperty.call(m, "totalCount")) - w.uint32(8).uint64(m.totalCount); - if (m.count != null && Object.hasOwnProperty.call(m, "count")) w.uint32(16).uint64(m.count); - if (m.pageNumber != null && Object.hasOwnProperty.call(m, "pageNumber")) - w.uint32(24).uint64(m.pageNumber); - if (m.pageTotal != null && Object.hasOwnProperty.call(m, "pageTotal")) - w.uint32(32).uint64(m.pageTotal); - if (m.limit != null && Object.hasOwnProperty.call(m, "limit")) w.uint32(40).uint64(m.limit); - if (m.txs != null && m.txs.length) { - for (var i = 0; i < m.txs.length; ++i) - $root.cosmos.base.abci.v1beta1.TxResponse.encode(m.txs[i], w.uint32(50).fork()).ldelim(); - } - return w; - }; - SearchTxsResult.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.abci.v1beta1.SearchTxsResult(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.totalCount = r.uint64(); - break; - case 2: - m.count = r.uint64(); - break; - case 3: - m.pageNumber = r.uint64(); - break; - case 4: - m.pageTotal = r.uint64(); - break; - case 5: - m.limit = r.uint64(); - break; - case 6: - if (!(m.txs && m.txs.length)) m.txs = []; - m.txs.push($root.cosmos.base.abci.v1beta1.TxResponse.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SearchTxsResult; - })(); - return v1beta1; - })(); - return abci; - })(); - base.query = (function () { - const query = {}; - query.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.PageRequest = (function () { - function PageRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PageRequest.prototype.key = $util.newBuffer([]); - PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - PageRequest.prototype.countTotal = false; - PageRequest.create = function create(properties) { - return new PageRequest(properties); - }; - PageRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.offset != null && Object.hasOwnProperty.call(m, "offset")) w.uint32(16).uint64(m.offset); - if (m.limit != null && Object.hasOwnProperty.call(m, "limit")) w.uint32(24).uint64(m.limit); - if (m.countTotal != null && Object.hasOwnProperty.call(m, "countTotal")) - w.uint32(32).bool(m.countTotal); - return w; - }; - PageRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.query.v1beta1.PageRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.offset = r.uint64(); - break; - case 3: - m.limit = r.uint64(); - break; - case 4: - m.countTotal = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PageRequest; - })(); - v1beta1.PageResponse = (function () { - function PageResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PageResponse.prototype.nextKey = $util.newBuffer([]); - PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - PageResponse.create = function create(properties) { - return new PageResponse(properties); - }; - PageResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.nextKey != null && Object.hasOwnProperty.call(m, "nextKey")) w.uint32(10).bytes(m.nextKey); - if (m.total != null && Object.hasOwnProperty.call(m, "total")) w.uint32(16).uint64(m.total); - return w; - }; - PageResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.query.v1beta1.PageResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.nextKey = r.bytes(); - break; - case 2: - m.total = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PageResponse; - })(); - return v1beta1; - })(); - return query; - })(); - base.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Coin = (function () { - function Coin(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Coin.prototype.denom = ""; - Coin.prototype.amount = ""; - Coin.create = function create(properties) { - return new Coin(properties); - }; - Coin.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(18).string(m.amount); - return w; - }; - Coin.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.Coin(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.amount = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Coin; - })(); - v1beta1.DecCoin = (function () { - function DecCoin(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DecCoin.prototype.denom = ""; - DecCoin.prototype.amount = ""; - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - DecCoin.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(18).string(m.amount); - return w; - }; - DecCoin.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.DecCoin(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.amount = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DecCoin; - })(); - v1beta1.IntProto = (function () { - function IntProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - IntProto.prototype.int = ""; - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - IntProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.int != null && Object.hasOwnProperty.call(m, "int")) w.uint32(10).string(m.int); - return w; - }; - IntProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.IntProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.int = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return IntProto; - })(); - v1beta1.DecProto = (function () { - function DecProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DecProto.prototype.dec = ""; - DecProto.create = function create(properties) { - return new DecProto(properties); - }; - DecProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.dec != null && Object.hasOwnProperty.call(m, "dec")) w.uint32(10).string(m.dec); - return w; - }; - DecProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.DecProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.dec = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DecProto; - })(); - return v1beta1; - })(); - return base; - })(); - cosmos.crypto = (function () { - const crypto = {}; - crypto.multisig = (function () { - const multisig = {}; - multisig.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.MultiSignature = (function () { - function MultiSignature(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MultiSignature.prototype.signatures = $util.emptyArray; - MultiSignature.create = function create(properties) { - return new MultiSignature(properties); - }; - MultiSignature.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(10).bytes(m.signatures[i]); - } - return w; - }; - MultiSignature.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MultiSignature; - })(); - v1beta1.CompactBitArray = (function () { - function CompactBitArray(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompactBitArray.prototype.extraBitsStored = 0; - CompactBitArray.prototype.elems = $util.newBuffer([]); - CompactBitArray.create = function create(properties) { - return new CompactBitArray(properties); - }; - CompactBitArray.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.extraBitsStored != null && Object.hasOwnProperty.call(m, "extraBitsStored")) - w.uint32(8).uint32(m.extraBitsStored); - if (m.elems != null && Object.hasOwnProperty.call(m, "elems")) w.uint32(18).bytes(m.elems); - return w; - }; - CompactBitArray.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.extraBitsStored = r.uint32(); - break; - case 2: - m.elems = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompactBitArray; - })(); - return v1beta1; - })(); - return multisig; - })(); - crypto.secp256k1 = (function () { - const secp256k1 = {}; - secp256k1.PubKey = (function () { - function PubKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PubKey.prototype.key = $util.newBuffer([]); - PubKey.create = function create(properties) { - return new PubKey(properties); - }; - PubKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - return w; - }; - PubKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.secp256k1.PubKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PubKey; - })(); - secp256k1.PrivKey = (function () { - function PrivKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PrivKey.prototype.key = $util.newBuffer([]); - PrivKey.create = function create(properties) { - return new PrivKey(properties); - }; - PrivKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - return w; - }; - PrivKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.secp256k1.PrivKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PrivKey; - })(); - return secp256k1; - })(); - return crypto; - })(); - cosmos.distribution = (function () { - const distribution = {}; - distribution.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Params = (function () { - function Params(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.communityTax = ""; - Params.prototype.baseProposerReward = ""; - Params.prototype.bonusProposerReward = ""; - Params.prototype.withdrawAddrEnabled = false; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.communityTax != null && Object.hasOwnProperty.call(m, "communityTax")) - w.uint32(10).string(m.communityTax); - if (m.baseProposerReward != null && Object.hasOwnProperty.call(m, "baseProposerReward")) - w.uint32(18).string(m.baseProposerReward); - if (m.bonusProposerReward != null && Object.hasOwnProperty.call(m, "bonusProposerReward")) - w.uint32(26).string(m.bonusProposerReward); - if (m.withdrawAddrEnabled != null && Object.hasOwnProperty.call(m, "withdrawAddrEnabled")) - w.uint32(32).bool(m.withdrawAddrEnabled); - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.communityTax = r.string(); - break; - case 2: - m.baseProposerReward = r.string(); - break; - case 3: - m.bonusProposerReward = r.string(); - break; - case 4: - m.withdrawAddrEnabled = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - v1beta1.ValidatorHistoricalRewards = (function () { - function ValidatorHistoricalRewards(p) { - this.cumulativeRewardRatio = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorHistoricalRewards.prototype.cumulativeRewardRatio = $util.emptyArray; - ValidatorHistoricalRewards.prototype.referenceCount = 0; - ValidatorHistoricalRewards.create = function create(properties) { - return new ValidatorHistoricalRewards(properties); - }; - ValidatorHistoricalRewards.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.cumulativeRewardRatio != null && m.cumulativeRewardRatio.length) { - for (var i = 0; i < m.cumulativeRewardRatio.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode( - m.cumulativeRewardRatio[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.referenceCount != null && Object.hasOwnProperty.call(m, "referenceCount")) - w.uint32(16).uint32(m.referenceCount); - return w; - }; - ValidatorHistoricalRewards.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorHistoricalRewards(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.cumulativeRewardRatio && m.cumulativeRewardRatio.length)) - m.cumulativeRewardRatio = []; - m.cumulativeRewardRatio.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - case 2: - m.referenceCount = r.uint32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorHistoricalRewards; - })(); - v1beta1.ValidatorCurrentRewards = (function () { - function ValidatorCurrentRewards(p) { - this.rewards = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorCurrentRewards.prototype.rewards = $util.emptyArray; - ValidatorCurrentRewards.prototype.period = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - ValidatorCurrentRewards.create = function create(properties) { - return new ValidatorCurrentRewards(properties); - }; - ValidatorCurrentRewards.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rewards != null && m.rewards.length) { - for (var i = 0; i < m.rewards.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.rewards[i], w.uint32(10).fork()).ldelim(); - } - if (m.period != null && Object.hasOwnProperty.call(m, "period")) w.uint32(16).uint64(m.period); - return w; - }; - ValidatorCurrentRewards.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorCurrentRewards(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.rewards && m.rewards.length)) m.rewards = []; - m.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - case 2: - m.period = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorCurrentRewards; - })(); - v1beta1.ValidatorAccumulatedCommission = (function () { - function ValidatorAccumulatedCommission(p) { - this.commission = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorAccumulatedCommission.prototype.commission = $util.emptyArray; - ValidatorAccumulatedCommission.create = function create(properties) { - return new ValidatorAccumulatedCommission(properties); - }; - ValidatorAccumulatedCommission.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.commission != null && m.commission.length) { - for (var i = 0; i < m.commission.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.commission[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - ValidatorAccumulatedCommission.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.commission && m.commission.length)) m.commission = []; - m.commission.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorAccumulatedCommission; - })(); - v1beta1.ValidatorOutstandingRewards = (function () { - function ValidatorOutstandingRewards(p) { - this.rewards = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorOutstandingRewards.prototype.rewards = $util.emptyArray; - ValidatorOutstandingRewards.create = function create(properties) { - return new ValidatorOutstandingRewards(properties); - }; - ValidatorOutstandingRewards.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rewards != null && m.rewards.length) { - for (var i = 0; i < m.rewards.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.rewards[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - ValidatorOutstandingRewards.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.rewards && m.rewards.length)) m.rewards = []; - m.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorOutstandingRewards; - })(); - v1beta1.ValidatorSlashEvent = (function () { - function ValidatorSlashEvent(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorSlashEvent.prototype.validatorPeriod = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - ValidatorSlashEvent.prototype.fraction = ""; - ValidatorSlashEvent.create = function create(properties) { - return new ValidatorSlashEvent(properties); - }; - ValidatorSlashEvent.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorPeriod != null && Object.hasOwnProperty.call(m, "validatorPeriod")) - w.uint32(8).uint64(m.validatorPeriod); - if (m.fraction != null && Object.hasOwnProperty.call(m, "fraction")) - w.uint32(18).string(m.fraction); - return w; - }; - ValidatorSlashEvent.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvent(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorPeriod = r.uint64(); - break; - case 2: - m.fraction = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorSlashEvent; - })(); - v1beta1.ValidatorSlashEvents = (function () { - function ValidatorSlashEvents(p) { - this.validatorSlashEvents = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorSlashEvents.prototype.validatorSlashEvents = $util.emptyArray; - ValidatorSlashEvents.create = function create(properties) { - return new ValidatorSlashEvents(properties); - }; - ValidatorSlashEvents.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorSlashEvents != null && m.validatorSlashEvents.length) { - for (var i = 0; i < m.validatorSlashEvents.length; ++i) - $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.encode( - m.validatorSlashEvents[i], - w.uint32(10).fork(), - ).ldelim(); - } - return w; - }; - ValidatorSlashEvents.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.ValidatorSlashEvents(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validatorSlashEvents && m.validatorSlashEvents.length)) m.validatorSlashEvents = []; - m.validatorSlashEvents.push( - $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorSlashEvents; - })(); - v1beta1.FeePool = (function () { - function FeePool(p) { - this.communityPool = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FeePool.prototype.communityPool = $util.emptyArray; - FeePool.create = function create(properties) { - return new FeePool(properties); - }; - FeePool.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.communityPool != null && m.communityPool.length) { - for (var i = 0; i < m.communityPool.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.communityPool[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - FeePool.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.FeePool(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.communityPool && m.communityPool.length)) m.communityPool = []; - m.communityPool.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return FeePool; - })(); - v1beta1.CommunityPoolSpendProposal = (function () { - function CommunityPoolSpendProposal(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CommunityPoolSpendProposal.prototype.title = ""; - CommunityPoolSpendProposal.prototype.description = ""; - CommunityPoolSpendProposal.prototype.recipient = ""; - CommunityPoolSpendProposal.prototype.amount = $util.emptyArray; - CommunityPoolSpendProposal.create = function create(properties) { - return new CommunityPoolSpendProposal(properties); - }; - CommunityPoolSpendProposal.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.title != null && Object.hasOwnProperty.call(m, "title")) w.uint32(10).string(m.title); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - w.uint32(18).string(m.description); - if (m.recipient != null && Object.hasOwnProperty.call(m, "recipient")) - w.uint32(26).string(m.recipient); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(34).fork()).ldelim(); - } - return w; - }; - CommunityPoolSpendProposal.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposal(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.title = r.string(); - break; - case 2: - m.description = r.string(); - break; - case 3: - m.recipient = r.string(); - break; - case 4: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CommunityPoolSpendProposal; - })(); - v1beta1.DelegatorStartingInfo = (function () { - function DelegatorStartingInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DelegatorStartingInfo.prototype.previousPeriod = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - DelegatorStartingInfo.prototype.stake = ""; - DelegatorStartingInfo.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - DelegatorStartingInfo.create = function create(properties) { - return new DelegatorStartingInfo(properties); - }; - DelegatorStartingInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.previousPeriod != null && Object.hasOwnProperty.call(m, "previousPeriod")) - w.uint32(8).uint64(m.previousPeriod); - if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) w.uint32(18).string(m.stake); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(24).uint64(m.height); - return w; - }; - DelegatorStartingInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.DelegatorStartingInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.previousPeriod = r.uint64(); - break; - case 2: - m.stake = r.string(); - break; - case 3: - m.height = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DelegatorStartingInfo; - })(); - v1beta1.DelegationDelegatorReward = (function () { - function DelegationDelegatorReward(p) { - this.reward = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DelegationDelegatorReward.prototype.validatorAddress = ""; - DelegationDelegatorReward.prototype.reward = $util.emptyArray; - DelegationDelegatorReward.create = function create(properties) { - return new DelegationDelegatorReward(properties); - }; - DelegationDelegatorReward.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(10).string(m.validatorAddress); - if (m.reward != null && m.reward.length) { - for (var i = 0; i < m.reward.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.reward[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - DelegationDelegatorReward.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.DelegationDelegatorReward(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddress = r.string(); - break; - case 2: - if (!(m.reward && m.reward.length)) m.reward = []; - m.reward.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DelegationDelegatorReward; - })(); - v1beta1.CommunityPoolSpendProposalWithDeposit = (function () { - function CommunityPoolSpendProposalWithDeposit(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CommunityPoolSpendProposalWithDeposit.prototype.title = ""; - CommunityPoolSpendProposalWithDeposit.prototype.description = ""; - CommunityPoolSpendProposalWithDeposit.prototype.recipient = ""; - CommunityPoolSpendProposalWithDeposit.prototype.amount = ""; - CommunityPoolSpendProposalWithDeposit.prototype.deposit = ""; - CommunityPoolSpendProposalWithDeposit.create = function create(properties) { - return new CommunityPoolSpendProposalWithDeposit(properties); - }; - CommunityPoolSpendProposalWithDeposit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.title != null && Object.hasOwnProperty.call(m, "title")) w.uint32(10).string(m.title); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - w.uint32(18).string(m.description); - if (m.recipient != null && Object.hasOwnProperty.call(m, "recipient")) - w.uint32(26).string(m.recipient); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(34).string(m.amount); - if (m.deposit != null && Object.hasOwnProperty.call(m, "deposit")) w.uint32(42).string(m.deposit); - return w; - }; - CommunityPoolSpendProposalWithDeposit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.title = r.string(); - break; - case 2: - m.description = r.string(); - break; - case 3: - m.recipient = r.string(); - break; - case 4: - m.amount = r.string(); - break; - case 5: - m.deposit = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CommunityPoolSpendProposalWithDeposit; - })(); - v1beta1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.params = function params(request, callback) { - return this.rpcCall( - params, - $root.cosmos.distribution.v1beta1.QueryParamsRequest, - $root.cosmos.distribution.v1beta1.QueryParamsResponse, - request, - callback, - ); - }), - "name", - { value: "Params" }, - ); - Object.defineProperty( - (Query.prototype.validatorOutstandingRewards = function validatorOutstandingRewards( - request, - callback, - ) { - return this.rpcCall( - validatorOutstandingRewards, - $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest, - $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse, - request, - callback, - ); - }), - "name", - { value: "ValidatorOutstandingRewards" }, - ); - Object.defineProperty( - (Query.prototype.validatorCommission = function validatorCommission(request, callback) { - return this.rpcCall( - validatorCommission, - $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest, - $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse, - request, - callback, - ); - }), - "name", - { value: "ValidatorCommission" }, - ); - Object.defineProperty( - (Query.prototype.validatorSlashes = function validatorSlashes(request, callback) { - return this.rpcCall( - validatorSlashes, - $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest, - $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse, - request, - callback, - ); - }), - "name", - { value: "ValidatorSlashes" }, - ); - Object.defineProperty( - (Query.prototype.delegationRewards = function delegationRewards(request, callback) { - return this.rpcCall( - delegationRewards, - $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest, - $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegationRewards" }, - ); - Object.defineProperty( - (Query.prototype.delegationTotalRewards = function delegationTotalRewards(request, callback) { - return this.rpcCall( - delegationTotalRewards, - $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest, - $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegationTotalRewards" }, - ); - Object.defineProperty( - (Query.prototype.delegatorValidators = function delegatorValidators(request, callback) { - return this.rpcCall( - delegatorValidators, - $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest, - $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorValidators" }, - ); - Object.defineProperty( - (Query.prototype.delegatorWithdrawAddress = function delegatorWithdrawAddress(request, callback) { - return this.rpcCall( - delegatorWithdrawAddress, - $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest, - $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorWithdrawAddress" }, - ); - Object.defineProperty( - (Query.prototype.communityPool = function communityPool(request, callback) { - return this.rpcCall( - communityPool, - $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest, - $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse, - request, - callback, - ); - }), - "name", - { value: "CommunityPool" }, - ); - return Query; - })(); - v1beta1.QueryParamsRequest = (function () { - function QueryParamsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsRequest.create = function create(properties) { - return new QueryParamsRequest(properties); - }; - QueryParamsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryParamsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryParamsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsRequest; - })(); - v1beta1.QueryParamsResponse = (function () { - function QueryParamsResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsResponse.prototype.params = null; - QueryParamsResponse.create = function create(properties) { - return new QueryParamsResponse(properties); - }; - QueryParamsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.params != null && Object.hasOwnProperty.call(m, "params")) - $root.cosmos.distribution.v1beta1.Params.encode(m.params, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryParamsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryParamsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.params = $root.cosmos.distribution.v1beta1.Params.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsResponse; - })(); - v1beta1.QueryValidatorOutstandingRewardsRequest = (function () { - function QueryValidatorOutstandingRewardsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorOutstandingRewardsRequest.prototype.validatorAddress = ""; - QueryValidatorOutstandingRewardsRequest.create = function create(properties) { - return new QueryValidatorOutstandingRewardsRequest(properties); - }; - QueryValidatorOutstandingRewardsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(10).string(m.validatorAddress); - return w; - }; - QueryValidatorOutstandingRewardsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorOutstandingRewardsRequest; - })(); - v1beta1.QueryValidatorOutstandingRewardsResponse = (function () { - function QueryValidatorOutstandingRewardsResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorOutstandingRewardsResponse.prototype.rewards = null; - QueryValidatorOutstandingRewardsResponse.create = function create(properties) { - return new QueryValidatorOutstandingRewardsResponse(properties); - }; - QueryValidatorOutstandingRewardsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rewards != null && Object.hasOwnProperty.call(m, "rewards")) - $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.encode( - m.rewards, - w.uint32(10).fork(), - ).ldelim(); - return w; - }; - QueryValidatorOutstandingRewardsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.rewards = $root.cosmos.distribution.v1beta1.ValidatorOutstandingRewards.decode( - r, - r.uint32(), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorOutstandingRewardsResponse; - })(); - v1beta1.QueryValidatorCommissionRequest = (function () { - function QueryValidatorCommissionRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorCommissionRequest.prototype.validatorAddress = ""; - QueryValidatorCommissionRequest.create = function create(properties) { - return new QueryValidatorCommissionRequest(properties); - }; - QueryValidatorCommissionRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(10).string(m.validatorAddress); - return w; - }; - QueryValidatorCommissionRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorCommissionRequest; - })(); - v1beta1.QueryValidatorCommissionResponse = (function () { - function QueryValidatorCommissionResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorCommissionResponse.prototype.commission = null; - QueryValidatorCommissionResponse.create = function create(properties) { - return new QueryValidatorCommissionResponse(properties); - }; - QueryValidatorCommissionResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.commission != null && Object.hasOwnProperty.call(m, "commission")) - $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.encode( - m.commission, - w.uint32(10).fork(), - ).ldelim(); - return w; - }; - QueryValidatorCommissionResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorCommissionResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.commission = $root.cosmos.distribution.v1beta1.ValidatorAccumulatedCommission.decode( - r, - r.uint32(), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorCommissionResponse; - })(); - v1beta1.QueryValidatorSlashesRequest = (function () { - function QueryValidatorSlashesRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorSlashesRequest.prototype.validatorAddress = ""; - QueryValidatorSlashesRequest.prototype.startingHeight = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryValidatorSlashesRequest.prototype.endingHeight = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryValidatorSlashesRequest.prototype.pagination = null; - QueryValidatorSlashesRequest.create = function create(properties) { - return new QueryValidatorSlashesRequest(properties); - }; - QueryValidatorSlashesRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(10).string(m.validatorAddress); - if (m.startingHeight != null && Object.hasOwnProperty.call(m, "startingHeight")) - w.uint32(16).uint64(m.startingHeight); - if (m.endingHeight != null && Object.hasOwnProperty.call(m, "endingHeight")) - w.uint32(24).uint64(m.endingHeight); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(34).fork()).ldelim(); - return w; - }; - QueryValidatorSlashesRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddress = r.string(); - break; - case 2: - m.startingHeight = r.uint64(); - break; - case 3: - m.endingHeight = r.uint64(); - break; - case 4: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorSlashesRequest; - })(); - v1beta1.QueryValidatorSlashesResponse = (function () { - function QueryValidatorSlashesResponse(p) { - this.slashes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorSlashesResponse.prototype.slashes = $util.emptyArray; - QueryValidatorSlashesResponse.prototype.pagination = null; - QueryValidatorSlashesResponse.create = function create(properties) { - return new QueryValidatorSlashesResponse(properties); - }; - QueryValidatorSlashesResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.slashes != null && m.slashes.length) { - for (var i = 0; i < m.slashes.length; ++i) - $root.cosmos.distribution.v1beta1.ValidatorSlashEvent.encode( - m.slashes[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorSlashesResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryValidatorSlashesResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.slashes && m.slashes.length)) m.slashes = []; - m.slashes.push($root.cosmos.distribution.v1beta1.ValidatorSlashEvent.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorSlashesResponse; - })(); - v1beta1.QueryDelegationRewardsRequest = (function () { - function QueryDelegationRewardsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationRewardsRequest.prototype.delegatorAddress = ""; - QueryDelegationRewardsRequest.prototype.validatorAddress = ""; - QueryDelegationRewardsRequest.create = function create(properties) { - return new QueryDelegationRewardsRequest(properties); - }; - QueryDelegationRewardsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - return w; - }; - QueryDelegationRewardsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationRewardsRequest; - })(); - v1beta1.QueryDelegationRewardsResponse = (function () { - function QueryDelegationRewardsResponse(p) { - this.rewards = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationRewardsResponse.prototype.rewards = $util.emptyArray; - QueryDelegationRewardsResponse.create = function create(properties) { - return new QueryDelegationRewardsResponse(properties); - }; - QueryDelegationRewardsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rewards != null && m.rewards.length) { - for (var i = 0; i < m.rewards.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.rewards[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - QueryDelegationRewardsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegationRewardsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.rewards && m.rewards.length)) m.rewards = []; - m.rewards.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationRewardsResponse; - })(); - v1beta1.QueryDelegationTotalRewardsRequest = (function () { - function QueryDelegationTotalRewardsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationTotalRewardsRequest.prototype.delegatorAddress = ""; - QueryDelegationTotalRewardsRequest.create = function create(properties) { - return new QueryDelegationTotalRewardsRequest(properties); - }; - QueryDelegationTotalRewardsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - return w; - }; - QueryDelegationTotalRewardsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationTotalRewardsRequest; - })(); - v1beta1.QueryDelegationTotalRewardsResponse = (function () { - function QueryDelegationTotalRewardsResponse(p) { - this.rewards = []; - this.total = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationTotalRewardsResponse.prototype.rewards = $util.emptyArray; - QueryDelegationTotalRewardsResponse.prototype.total = $util.emptyArray; - QueryDelegationTotalRewardsResponse.create = function create(properties) { - return new QueryDelegationTotalRewardsResponse(properties); - }; - QueryDelegationTotalRewardsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rewards != null && m.rewards.length) { - for (var i = 0; i < m.rewards.length; ++i) - $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.encode( - m.rewards[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.total != null && m.total.length) { - for (var i = 0; i < m.total.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.total[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - QueryDelegationTotalRewardsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.rewards && m.rewards.length)) m.rewards = []; - m.rewards.push( - $root.cosmos.distribution.v1beta1.DelegationDelegatorReward.decode(r, r.uint32()), - ); - break; - case 2: - if (!(m.total && m.total.length)) m.total = []; - m.total.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationTotalRewardsResponse; - })(); - v1beta1.QueryDelegatorValidatorsRequest = (function () { - function QueryDelegatorValidatorsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorsRequest.prototype.delegatorAddress = ""; - QueryDelegatorValidatorsRequest.create = function create(properties) { - return new QueryDelegatorValidatorsRequest(properties); - }; - QueryDelegatorValidatorsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - return w; - }; - QueryDelegatorValidatorsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorsRequest; - })(); - v1beta1.QueryDelegatorValidatorsResponse = (function () { - function QueryDelegatorValidatorsResponse(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorsResponse.prototype.validators = $util.emptyArray; - QueryDelegatorValidatorsResponse.create = function create(properties) { - return new QueryDelegatorValidatorsResponse(properties); - }; - QueryDelegatorValidatorsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) w.uint32(10).string(m.validators[i]); - } - return w; - }; - QueryDelegatorValidatorsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorsResponse; - })(); - v1beta1.QueryDelegatorWithdrawAddressRequest = (function () { - function QueryDelegatorWithdrawAddressRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorWithdrawAddressRequest.prototype.delegatorAddress = ""; - QueryDelegatorWithdrawAddressRequest.create = function create(properties) { - return new QueryDelegatorWithdrawAddressRequest(properties); - }; - QueryDelegatorWithdrawAddressRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - return w; - }; - QueryDelegatorWithdrawAddressRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorWithdrawAddressRequest; - })(); - v1beta1.QueryDelegatorWithdrawAddressResponse = (function () { - function QueryDelegatorWithdrawAddressResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorWithdrawAddressResponse.prototype.withdrawAddress = ""; - QueryDelegatorWithdrawAddressResponse.create = function create(properties) { - return new QueryDelegatorWithdrawAddressResponse(properties); - }; - QueryDelegatorWithdrawAddressResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.withdrawAddress != null && Object.hasOwnProperty.call(m, "withdrawAddress")) - w.uint32(10).string(m.withdrawAddress); - return w; - }; - QueryDelegatorWithdrawAddressResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.withdrawAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorWithdrawAddressResponse; - })(); - v1beta1.QueryCommunityPoolRequest = (function () { - function QueryCommunityPoolRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryCommunityPoolRequest.create = function create(properties) { - return new QueryCommunityPoolRequest(properties); - }; - QueryCommunityPoolRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryCommunityPoolRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryCommunityPoolRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryCommunityPoolRequest; - })(); - v1beta1.QueryCommunityPoolResponse = (function () { - function QueryCommunityPoolResponse(p) { - this.pool = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryCommunityPoolResponse.prototype.pool = $util.emptyArray; - QueryCommunityPoolResponse.create = function create(properties) { - return new QueryCommunityPoolResponse(properties); - }; - QueryCommunityPoolResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pool != null && m.pool.length) { - for (var i = 0; i < m.pool.length; ++i) - $root.cosmos.base.v1beta1.DecCoin.encode(m.pool[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - QueryCommunityPoolResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.QueryCommunityPoolResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.pool && m.pool.length)) m.pool = []; - m.pool.push($root.cosmos.base.v1beta1.DecCoin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryCommunityPoolResponse; - })(); - v1beta1.Msg = (function () { - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Msg.prototype.setWithdrawAddress = function setWithdrawAddress(request, callback) { - return this.rpcCall( - setWithdrawAddress, - $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress, - $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, - request, - callback, - ); - }), - "name", - { value: "SetWithdrawAddress" }, - ); - Object.defineProperty( - (Msg.prototype.withdrawDelegatorReward = function withdrawDelegatorReward(request, callback) { - return this.rpcCall( - withdrawDelegatorReward, - $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward, - $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, - request, - callback, - ); - }), - "name", - { value: "WithdrawDelegatorReward" }, - ); - Object.defineProperty( - (Msg.prototype.withdrawValidatorCommission = function withdrawValidatorCommission( - request, - callback, - ) { - return this.rpcCall( - withdrawValidatorCommission, - $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission, - $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, - request, - callback, - ); - }), - "name", - { value: "WithdrawValidatorCommission" }, - ); - Object.defineProperty( - (Msg.prototype.fundCommunityPool = function fundCommunityPool(request, callback) { - return this.rpcCall( - fundCommunityPool, - $root.cosmos.distribution.v1beta1.MsgFundCommunityPool, - $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, - request, - callback, - ); - }), - "name", - { value: "FundCommunityPool" }, - ); - return Msg; - })(); - v1beta1.MsgSetWithdrawAddress = (function () { - function MsgSetWithdrawAddress(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSetWithdrawAddress.prototype.delegatorAddress = ""; - MsgSetWithdrawAddress.prototype.withdrawAddress = ""; - MsgSetWithdrawAddress.create = function create(properties) { - return new MsgSetWithdrawAddress(properties); - }; - MsgSetWithdrawAddress.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.withdrawAddress != null && Object.hasOwnProperty.call(m, "withdrawAddress")) - w.uint32(18).string(m.withdrawAddress); - return w; - }; - MsgSetWithdrawAddress.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.withdrawAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSetWithdrawAddress; - })(); - v1beta1.MsgSetWithdrawAddressResponse = (function () { - function MsgSetWithdrawAddressResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSetWithdrawAddressResponse.create = function create(properties) { - return new MsgSetWithdrawAddressResponse(properties); - }; - MsgSetWithdrawAddressResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgSetWithdrawAddressResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSetWithdrawAddressResponse; - })(); - v1beta1.MsgWithdrawDelegatorReward = (function () { - function MsgWithdrawDelegatorReward(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgWithdrawDelegatorReward.prototype.delegatorAddress = ""; - MsgWithdrawDelegatorReward.prototype.validatorAddress = ""; - MsgWithdrawDelegatorReward.create = function create(properties) { - return new MsgWithdrawDelegatorReward(properties); - }; - MsgWithdrawDelegatorReward.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - return w; - }; - MsgWithdrawDelegatorReward.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgWithdrawDelegatorReward; - })(); - v1beta1.MsgWithdrawDelegatorRewardResponse = (function () { - function MsgWithdrawDelegatorRewardResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgWithdrawDelegatorRewardResponse.create = function create(properties) { - return new MsgWithdrawDelegatorRewardResponse(properties); - }; - MsgWithdrawDelegatorRewardResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgWithdrawDelegatorRewardResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgWithdrawDelegatorRewardResponse; - })(); - v1beta1.MsgWithdrawValidatorCommission = (function () { - function MsgWithdrawValidatorCommission(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgWithdrawValidatorCommission.prototype.validatorAddress = ""; - MsgWithdrawValidatorCommission.create = function create(properties) { - return new MsgWithdrawValidatorCommission(properties); - }; - MsgWithdrawValidatorCommission.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(10).string(m.validatorAddress); - return w; - }; - MsgWithdrawValidatorCommission.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgWithdrawValidatorCommission; - })(); - v1beta1.MsgWithdrawValidatorCommissionResponse = (function () { - function MsgWithdrawValidatorCommissionResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgWithdrawValidatorCommissionResponse.create = function create(properties) { - return new MsgWithdrawValidatorCommissionResponse(properties); - }; - MsgWithdrawValidatorCommissionResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgWithdrawValidatorCommissionResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgWithdrawValidatorCommissionResponse; - })(); - v1beta1.MsgFundCommunityPool = (function () { - function MsgFundCommunityPool(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgFundCommunityPool.prototype.amount = $util.emptyArray; - MsgFundCommunityPool.prototype.depositor = ""; - MsgFundCommunityPool.create = function create(properties) { - return new MsgFundCommunityPool(properties); - }; - MsgFundCommunityPool.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(10).fork()).ldelim(); - } - if (m.depositor != null && Object.hasOwnProperty.call(m, "depositor")) - w.uint32(18).string(m.depositor); - return w; - }; - MsgFundCommunityPool.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - case 2: - m.depositor = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgFundCommunityPool; - })(); - v1beta1.MsgFundCommunityPoolResponse = (function () { - function MsgFundCommunityPoolResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgFundCommunityPoolResponse.create = function create(properties) { - return new MsgFundCommunityPoolResponse(properties); - }; - MsgFundCommunityPoolResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgFundCommunityPoolResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgFundCommunityPoolResponse; - })(); - return v1beta1; - })(); - return distribution; - })(); - cosmos.staking = (function () { - const staking = {}; - staking.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.validators = function validators(request, callback) { - return this.rpcCall( - validators, - $root.cosmos.staking.v1beta1.QueryValidatorsRequest, - $root.cosmos.staking.v1beta1.QueryValidatorsResponse, - request, - callback, - ); - }), - "name", - { value: "Validators" }, - ); - Object.defineProperty( - (Query.prototype.validator = function validator(request, callback) { - return this.rpcCall( - validator, - $root.cosmos.staking.v1beta1.QueryValidatorRequest, - $root.cosmos.staking.v1beta1.QueryValidatorResponse, - request, - callback, - ); - }), - "name", - { value: "Validator" }, - ); - Object.defineProperty( - (Query.prototype.validatorDelegations = function validatorDelegations(request, callback) { - return this.rpcCall( - validatorDelegations, - $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest, - $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse, - request, - callback, - ); - }), - "name", - { value: "ValidatorDelegations" }, - ); - Object.defineProperty( - (Query.prototype.validatorUnbondingDelegations = function validatorUnbondingDelegations( - request, - callback, - ) { - return this.rpcCall( - validatorUnbondingDelegations, - $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest, - $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse, - request, - callback, - ); - }), - "name", - { value: "ValidatorUnbondingDelegations" }, - ); - Object.defineProperty( - (Query.prototype.delegation = function delegation(request, callback) { - return this.rpcCall( - delegation, - $root.cosmos.staking.v1beta1.QueryDelegationRequest, - $root.cosmos.staking.v1beta1.QueryDelegationResponse, - request, - callback, - ); - }), - "name", - { value: "Delegation" }, - ); - Object.defineProperty( - (Query.prototype.unbondingDelegation = function unbondingDelegation(request, callback) { - return this.rpcCall( - unbondingDelegation, - $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest, - $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse, - request, - callback, - ); - }), - "name", - { value: "UnbondingDelegation" }, - ); - Object.defineProperty( - (Query.prototype.delegatorDelegations = function delegatorDelegations(request, callback) { - return this.rpcCall( - delegatorDelegations, - $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest, - $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorDelegations" }, - ); - Object.defineProperty( - (Query.prototype.delegatorUnbondingDelegations = function delegatorUnbondingDelegations( - request, - callback, - ) { - return this.rpcCall( - delegatorUnbondingDelegations, - $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest, - $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorUnbondingDelegations" }, - ); - Object.defineProperty( - (Query.prototype.redelegations = function redelegations(request, callback) { - return this.rpcCall( - redelegations, - $root.cosmos.staking.v1beta1.QueryRedelegationsRequest, - $root.cosmos.staking.v1beta1.QueryRedelegationsResponse, - request, - callback, - ); - }), - "name", - { value: "Redelegations" }, - ); - Object.defineProperty( - (Query.prototype.delegatorValidators = function delegatorValidators(request, callback) { - return this.rpcCall( - delegatorValidators, - $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest, - $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorValidators" }, - ); - Object.defineProperty( - (Query.prototype.delegatorValidator = function delegatorValidator(request, callback) { - return this.rpcCall( - delegatorValidator, - $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest, - $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse, - request, - callback, - ); - }), - "name", - { value: "DelegatorValidator" }, - ); - Object.defineProperty( - (Query.prototype.historicalInfo = function historicalInfo(request, callback) { - return this.rpcCall( - historicalInfo, - $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest, - $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse, - request, - callback, - ); - }), - "name", - { value: "HistoricalInfo" }, - ); - Object.defineProperty( - (Query.prototype.pool = function pool(request, callback) { - return this.rpcCall( - pool, - $root.cosmos.staking.v1beta1.QueryPoolRequest, - $root.cosmos.staking.v1beta1.QueryPoolResponse, - request, - callback, - ); - }), - "name", - { value: "Pool" }, - ); - Object.defineProperty( - (Query.prototype.params = function params(request, callback) { - return this.rpcCall( - params, - $root.cosmos.staking.v1beta1.QueryParamsRequest, - $root.cosmos.staking.v1beta1.QueryParamsResponse, - request, - callback, - ); - }), - "name", - { value: "Params" }, - ); - return Query; - })(); - v1beta1.QueryValidatorsRequest = (function () { - function QueryValidatorsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorsRequest.prototype.status = ""; - QueryValidatorsRequest.prototype.pagination = null; - QueryValidatorsRequest.create = function create(properties) { - return new QueryValidatorsRequest(properties); - }; - QueryValidatorsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.status != null && Object.hasOwnProperty.call(m, "status")) w.uint32(10).string(m.status); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.status = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorsRequest; - })(); - v1beta1.QueryValidatorsResponse = (function () { - function QueryValidatorsResponse(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorsResponse.prototype.validators = $util.emptyArray; - QueryValidatorsResponse.prototype.pagination = null; - QueryValidatorsResponse.create = function create(properties) { - return new QueryValidatorsResponse(properties); - }; - QueryValidatorsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) - $root.cosmos.staking.v1beta1.Validator.encode(m.validators[i], w.uint32(10).fork()).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push($root.cosmos.staking.v1beta1.Validator.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorsResponse; - })(); - v1beta1.QueryValidatorRequest = (function () { - function QueryValidatorRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorRequest.prototype.validatorAddr = ""; - QueryValidatorRequest.create = function create(properties) { - return new QueryValidatorRequest(properties); - }; - QueryValidatorRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(10).string(m.validatorAddr); - return w; - }; - QueryValidatorRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddr = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorRequest; - })(); - v1beta1.QueryValidatorResponse = (function () { - function QueryValidatorResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorResponse.prototype.validator = null; - QueryValidatorResponse.create = function create(properties) { - return new QueryValidatorResponse(properties); - }; - QueryValidatorResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.cosmos.staking.v1beta1.Validator.encode(m.validator, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryValidatorResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validator = $root.cosmos.staking.v1beta1.Validator.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorResponse; - })(); - v1beta1.QueryValidatorDelegationsRequest = (function () { - function QueryValidatorDelegationsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorDelegationsRequest.prototype.validatorAddr = ""; - QueryValidatorDelegationsRequest.prototype.pagination = null; - QueryValidatorDelegationsRequest.create = function create(properties) { - return new QueryValidatorDelegationsRequest(properties); - }; - QueryValidatorDelegationsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(10).string(m.validatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorDelegationsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddr = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorDelegationsRequest; - })(); - v1beta1.QueryValidatorDelegationsResponse = (function () { - function QueryValidatorDelegationsResponse(p) { - this.delegationResponses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorDelegationsResponse.prototype.delegationResponses = $util.emptyArray; - QueryValidatorDelegationsResponse.prototype.pagination = null; - QueryValidatorDelegationsResponse.create = function create(properties) { - return new QueryValidatorDelegationsResponse(properties); - }; - QueryValidatorDelegationsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegationResponses != null && m.delegationResponses.length) { - for (var i = 0; i < m.delegationResponses.length; ++i) - $root.cosmos.staking.v1beta1.DelegationResponse.encode( - m.delegationResponses[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorDelegationsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorDelegationsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.delegationResponses && m.delegationResponses.length)) m.delegationResponses = []; - m.delegationResponses.push( - $root.cosmos.staking.v1beta1.DelegationResponse.decode(r, r.uint32()), - ); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorDelegationsResponse; - })(); - v1beta1.QueryValidatorUnbondingDelegationsRequest = (function () { - function QueryValidatorUnbondingDelegationsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorUnbondingDelegationsRequest.prototype.validatorAddr = ""; - QueryValidatorUnbondingDelegationsRequest.prototype.pagination = null; - QueryValidatorUnbondingDelegationsRequest.create = function create(properties) { - return new QueryValidatorUnbondingDelegationsRequest(properties); - }; - QueryValidatorUnbondingDelegationsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(10).string(m.validatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorUnbondingDelegationsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validatorAddr = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorUnbondingDelegationsRequest; - })(); - v1beta1.QueryValidatorUnbondingDelegationsResponse = (function () { - function QueryValidatorUnbondingDelegationsResponse(p) { - this.unbondingResponses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryValidatorUnbondingDelegationsResponse.prototype.unbondingResponses = $util.emptyArray; - QueryValidatorUnbondingDelegationsResponse.prototype.pagination = null; - QueryValidatorUnbondingDelegationsResponse.create = function create(properties) { - return new QueryValidatorUnbondingDelegationsResponse(properties); - }; - QueryValidatorUnbondingDelegationsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.unbondingResponses != null && m.unbondingResponses.length) { - for (var i = 0; i < m.unbondingResponses.length; ++i) - $root.cosmos.staking.v1beta1.UnbondingDelegation.encode( - m.unbondingResponses[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryValidatorUnbondingDelegationsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.unbondingResponses && m.unbondingResponses.length)) m.unbondingResponses = []; - m.unbondingResponses.push( - $root.cosmos.staking.v1beta1.UnbondingDelegation.decode(r, r.uint32()), - ); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryValidatorUnbondingDelegationsResponse; - })(); - v1beta1.QueryDelegationRequest = (function () { - function QueryDelegationRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationRequest.prototype.delegatorAddr = ""; - QueryDelegationRequest.prototype.validatorAddr = ""; - QueryDelegationRequest.create = function create(properties) { - return new QueryDelegationRequest(properties); - }; - QueryDelegationRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(18).string(m.validatorAddr); - return w; - }; - QueryDelegationRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegationRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.validatorAddr = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationRequest; - })(); - v1beta1.QueryDelegationResponse = (function () { - function QueryDelegationResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegationResponse.prototype.delegationResponse = null; - QueryDelegationResponse.create = function create(properties) { - return new QueryDelegationResponse(properties); - }; - QueryDelegationResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegationResponse != null && Object.hasOwnProperty.call(m, "delegationResponse")) - $root.cosmos.staking.v1beta1.DelegationResponse.encode( - m.delegationResponse, - w.uint32(10).fork(), - ).ldelim(); - return w; - }; - QueryDelegationResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegationResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegationResponse = $root.cosmos.staking.v1beta1.DelegationResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegationResponse; - })(); - v1beta1.QueryUnbondingDelegationRequest = (function () { - function QueryUnbondingDelegationRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnbondingDelegationRequest.prototype.delegatorAddr = ""; - QueryUnbondingDelegationRequest.prototype.validatorAddr = ""; - QueryUnbondingDelegationRequest.create = function create(properties) { - return new QueryUnbondingDelegationRequest(properties); - }; - QueryUnbondingDelegationRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(18).string(m.validatorAddr); - return w; - }; - QueryUnbondingDelegationRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.validatorAddr = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnbondingDelegationRequest; - })(); - v1beta1.QueryUnbondingDelegationResponse = (function () { - function QueryUnbondingDelegationResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnbondingDelegationResponse.prototype.unbond = null; - QueryUnbondingDelegationResponse.create = function create(properties) { - return new QueryUnbondingDelegationResponse(properties); - }; - QueryUnbondingDelegationResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.unbond != null && Object.hasOwnProperty.call(m, "unbond")) - $root.cosmos.staking.v1beta1.UnbondingDelegation.encode(m.unbond, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryUnbondingDelegationResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryUnbondingDelegationResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.unbond = $root.cosmos.staking.v1beta1.UnbondingDelegation.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnbondingDelegationResponse; - })(); - v1beta1.QueryDelegatorDelegationsRequest = (function () { - function QueryDelegatorDelegationsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorDelegationsRequest.prototype.delegatorAddr = ""; - QueryDelegatorDelegationsRequest.prototype.pagination = null; - QueryDelegatorDelegationsRequest.create = function create(properties) { - return new QueryDelegatorDelegationsRequest(properties); - }; - QueryDelegatorDelegationsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorDelegationsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorDelegationsRequest; - })(); - v1beta1.QueryDelegatorDelegationsResponse = (function () { - function QueryDelegatorDelegationsResponse(p) { - this.delegationResponses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorDelegationsResponse.prototype.delegationResponses = $util.emptyArray; - QueryDelegatorDelegationsResponse.prototype.pagination = null; - QueryDelegatorDelegationsResponse.create = function create(properties) { - return new QueryDelegatorDelegationsResponse(properties); - }; - QueryDelegatorDelegationsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegationResponses != null && m.delegationResponses.length) { - for (var i = 0; i < m.delegationResponses.length; ++i) - $root.cosmos.staking.v1beta1.DelegationResponse.encode( - m.delegationResponses[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorDelegationsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.delegationResponses && m.delegationResponses.length)) m.delegationResponses = []; - m.delegationResponses.push( - $root.cosmos.staking.v1beta1.DelegationResponse.decode(r, r.uint32()), - ); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorDelegationsResponse; - })(); - v1beta1.QueryDelegatorUnbondingDelegationsRequest = (function () { - function QueryDelegatorUnbondingDelegationsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorUnbondingDelegationsRequest.prototype.delegatorAddr = ""; - QueryDelegatorUnbondingDelegationsRequest.prototype.pagination = null; - QueryDelegatorUnbondingDelegationsRequest.create = function create(properties) { - return new QueryDelegatorUnbondingDelegationsRequest(properties); - }; - QueryDelegatorUnbondingDelegationsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorUnbondingDelegationsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorUnbondingDelegationsRequest; - })(); - v1beta1.QueryDelegatorUnbondingDelegationsResponse = (function () { - function QueryDelegatorUnbondingDelegationsResponse(p) { - this.unbondingResponses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorUnbondingDelegationsResponse.prototype.unbondingResponses = $util.emptyArray; - QueryDelegatorUnbondingDelegationsResponse.prototype.pagination = null; - QueryDelegatorUnbondingDelegationsResponse.create = function create(properties) { - return new QueryDelegatorUnbondingDelegationsResponse(properties); - }; - QueryDelegatorUnbondingDelegationsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.unbondingResponses != null && m.unbondingResponses.length) { - for (var i = 0; i < m.unbondingResponses.length; ++i) - $root.cosmos.staking.v1beta1.UnbondingDelegation.encode( - m.unbondingResponses[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorUnbondingDelegationsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.unbondingResponses && m.unbondingResponses.length)) m.unbondingResponses = []; - m.unbondingResponses.push( - $root.cosmos.staking.v1beta1.UnbondingDelegation.decode(r, r.uint32()), - ); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorUnbondingDelegationsResponse; - })(); - v1beta1.QueryRedelegationsRequest = (function () { - function QueryRedelegationsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryRedelegationsRequest.prototype.delegatorAddr = ""; - QueryRedelegationsRequest.prototype.srcValidatorAddr = ""; - QueryRedelegationsRequest.prototype.dstValidatorAddr = ""; - QueryRedelegationsRequest.prototype.pagination = null; - QueryRedelegationsRequest.create = function create(properties) { - return new QueryRedelegationsRequest(properties); - }; - QueryRedelegationsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.srcValidatorAddr != null && Object.hasOwnProperty.call(m, "srcValidatorAddr")) - w.uint32(18).string(m.srcValidatorAddr); - if (m.dstValidatorAddr != null && Object.hasOwnProperty.call(m, "dstValidatorAddr")) - w.uint32(26).string(m.dstValidatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(34).fork()).ldelim(); - return w; - }; - QueryRedelegationsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryRedelegationsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.srcValidatorAddr = r.string(); - break; - case 3: - m.dstValidatorAddr = r.string(); - break; - case 4: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryRedelegationsRequest; - })(); - v1beta1.QueryRedelegationsResponse = (function () { - function QueryRedelegationsResponse(p) { - this.redelegationResponses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryRedelegationsResponse.prototype.redelegationResponses = $util.emptyArray; - QueryRedelegationsResponse.prototype.pagination = null; - QueryRedelegationsResponse.create = function create(properties) { - return new QueryRedelegationsResponse(properties); - }; - QueryRedelegationsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.redelegationResponses != null && m.redelegationResponses.length) { - for (var i = 0; i < m.redelegationResponses.length; ++i) - $root.cosmos.staking.v1beta1.RedelegationResponse.encode( - m.redelegationResponses[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryRedelegationsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryRedelegationsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.redelegationResponses && m.redelegationResponses.length)) - m.redelegationResponses = []; - m.redelegationResponses.push( - $root.cosmos.staking.v1beta1.RedelegationResponse.decode(r, r.uint32()), - ); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryRedelegationsResponse; - })(); - v1beta1.QueryDelegatorValidatorsRequest = (function () { - function QueryDelegatorValidatorsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorsRequest.prototype.delegatorAddr = ""; - QueryDelegatorValidatorsRequest.prototype.pagination = null; - QueryDelegatorValidatorsRequest.create = function create(properties) { - return new QueryDelegatorValidatorsRequest(properties); - }; - QueryDelegatorValidatorsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorValidatorsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorsRequest; - })(); - v1beta1.QueryDelegatorValidatorsResponse = (function () { - function QueryDelegatorValidatorsResponse(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorsResponse.prototype.validators = $util.emptyArray; - QueryDelegatorValidatorsResponse.prototype.pagination = null; - QueryDelegatorValidatorsResponse.create = function create(properties) { - return new QueryDelegatorValidatorsResponse(properties); - }; - QueryDelegatorValidatorsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) - $root.cosmos.staking.v1beta1.Validator.encode(m.validators[i], w.uint32(10).fork()).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryDelegatorValidatorsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push($root.cosmos.staking.v1beta1.Validator.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorsResponse; - })(); - v1beta1.QueryDelegatorValidatorRequest = (function () { - function QueryDelegatorValidatorRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorRequest.prototype.delegatorAddr = ""; - QueryDelegatorValidatorRequest.prototype.validatorAddr = ""; - QueryDelegatorValidatorRequest.create = function create(properties) { - return new QueryDelegatorValidatorRequest(properties); - }; - QueryDelegatorValidatorRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddr != null && Object.hasOwnProperty.call(m, "delegatorAddr")) - w.uint32(10).string(m.delegatorAddr); - if (m.validatorAddr != null && Object.hasOwnProperty.call(m, "validatorAddr")) - w.uint32(18).string(m.validatorAddr); - return w; - }; - QueryDelegatorValidatorRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddr = r.string(); - break; - case 2: - m.validatorAddr = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorRequest; - })(); - v1beta1.QueryDelegatorValidatorResponse = (function () { - function QueryDelegatorValidatorResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryDelegatorValidatorResponse.prototype.validator = null; - QueryDelegatorValidatorResponse.create = function create(properties) { - return new QueryDelegatorValidatorResponse(properties); - }; - QueryDelegatorValidatorResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.cosmos.staking.v1beta1.Validator.encode(m.validator, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryDelegatorValidatorResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryDelegatorValidatorResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validator = $root.cosmos.staking.v1beta1.Validator.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryDelegatorValidatorResponse; - })(); - v1beta1.QueryHistoricalInfoRequest = (function () { - function QueryHistoricalInfoRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryHistoricalInfoRequest.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - QueryHistoricalInfoRequest.create = function create(properties) { - return new QueryHistoricalInfoRequest(properties); - }; - QueryHistoricalInfoRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).int64(m.height); - return w; - }; - QueryHistoricalInfoRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryHistoricalInfoRequest; - })(); - v1beta1.QueryHistoricalInfoResponse = (function () { - function QueryHistoricalInfoResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryHistoricalInfoResponse.prototype.hist = null; - QueryHistoricalInfoResponse.create = function create(properties) { - return new QueryHistoricalInfoResponse(properties); - }; - QueryHistoricalInfoResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hist != null && Object.hasOwnProperty.call(m, "hist")) - $root.cosmos.staking.v1beta1.HistoricalInfo.encode(m.hist, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryHistoricalInfoResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryHistoricalInfoResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hist = $root.cosmos.staking.v1beta1.HistoricalInfo.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryHistoricalInfoResponse; - })(); - v1beta1.QueryPoolRequest = (function () { - function QueryPoolRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPoolRequest.create = function create(properties) { - return new QueryPoolRequest(properties); - }; - QueryPoolRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryPoolRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryPoolRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPoolRequest; - })(); - v1beta1.QueryPoolResponse = (function () { - function QueryPoolResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPoolResponse.prototype.pool = null; - QueryPoolResponse.create = function create(properties) { - return new QueryPoolResponse(properties); - }; - QueryPoolResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pool != null && Object.hasOwnProperty.call(m, "pool")) - $root.cosmos.staking.v1beta1.Pool.encode(m.pool, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryPoolResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryPoolResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.pool = $root.cosmos.staking.v1beta1.Pool.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPoolResponse; - })(); - v1beta1.QueryParamsRequest = (function () { - function QueryParamsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsRequest.create = function create(properties) { - return new QueryParamsRequest(properties); - }; - QueryParamsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - QueryParamsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryParamsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsRequest; - })(); - v1beta1.QueryParamsResponse = (function () { - function QueryParamsResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryParamsResponse.prototype.params = null; - QueryParamsResponse.create = function create(properties) { - return new QueryParamsResponse(properties); - }; - QueryParamsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.params != null && Object.hasOwnProperty.call(m, "params")) - $root.cosmos.staking.v1beta1.Params.encode(m.params, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryParamsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.QueryParamsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.params = $root.cosmos.staking.v1beta1.Params.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryParamsResponse; - })(); - v1beta1.HistoricalInfo = (function () { - function HistoricalInfo(p) { - this.valset = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - HistoricalInfo.prototype.header = null; - HistoricalInfo.prototype.valset = $util.emptyArray; - HistoricalInfo.create = function create(properties) { - return new HistoricalInfo(properties); - }; - HistoricalInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.header != null && Object.hasOwnProperty.call(m, "header")) - $root.tendermint.types.Header.encode(m.header, w.uint32(10).fork()).ldelim(); - if (m.valset != null && m.valset.length) { - for (var i = 0; i < m.valset.length; ++i) - $root.cosmos.staking.v1beta1.Validator.encode(m.valset[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - HistoricalInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.HistoricalInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.header = $root.tendermint.types.Header.decode(r, r.uint32()); - break; - case 2: - if (!(m.valset && m.valset.length)) m.valset = []; - m.valset.push($root.cosmos.staking.v1beta1.Validator.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return HistoricalInfo; - })(); - v1beta1.CommissionRates = (function () { - function CommissionRates(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CommissionRates.prototype.rate = ""; - CommissionRates.prototype.maxRate = ""; - CommissionRates.prototype.maxChangeRate = ""; - CommissionRates.create = function create(properties) { - return new CommissionRates(properties); - }; - CommissionRates.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rate != null && Object.hasOwnProperty.call(m, "rate")) w.uint32(10).string(m.rate); - if (m.maxRate != null && Object.hasOwnProperty.call(m, "maxRate")) w.uint32(18).string(m.maxRate); - if (m.maxChangeRate != null && Object.hasOwnProperty.call(m, "maxChangeRate")) - w.uint32(26).string(m.maxChangeRate); - return w; - }; - CommissionRates.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.CommissionRates(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.rate = r.string(); - break; - case 2: - m.maxRate = r.string(); - break; - case 3: - m.maxChangeRate = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CommissionRates; - })(); - v1beta1.Commission = (function () { - function Commission(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Commission.prototype.commissionRates = null; - Commission.prototype.updateTime = null; - Commission.create = function create(properties) { - return new Commission(properties); - }; - Commission.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.commissionRates != null && Object.hasOwnProperty.call(m, "commissionRates")) - $root.cosmos.staking.v1beta1.CommissionRates.encode( - m.commissionRates, - w.uint32(10).fork(), - ).ldelim(); - if (m.updateTime != null && Object.hasOwnProperty.call(m, "updateTime")) - $root.google.protobuf.Timestamp.encode(m.updateTime, w.uint32(18).fork()).ldelim(); - return w; - }; - Commission.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Commission(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.decode(r, r.uint32()); - break; - case 2: - m.updateTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Commission; - })(); - v1beta1.Description = (function () { - function Description(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Description.prototype.moniker = ""; - Description.prototype.identity = ""; - Description.prototype.website = ""; - Description.prototype.securityContact = ""; - Description.prototype.details = ""; - Description.create = function create(properties) { - return new Description(properties); - }; - Description.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.moniker != null && Object.hasOwnProperty.call(m, "moniker")) w.uint32(10).string(m.moniker); - if (m.identity != null && Object.hasOwnProperty.call(m, "identity")) - w.uint32(18).string(m.identity); - if (m.website != null && Object.hasOwnProperty.call(m, "website")) w.uint32(26).string(m.website); - if (m.securityContact != null && Object.hasOwnProperty.call(m, "securityContact")) - w.uint32(34).string(m.securityContact); - if (m.details != null && Object.hasOwnProperty.call(m, "details")) w.uint32(42).string(m.details); - return w; - }; - Description.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Description(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.moniker = r.string(); - break; - case 2: - m.identity = r.string(); - break; - case 3: - m.website = r.string(); - break; - case 4: - m.securityContact = r.string(); - break; - case 5: - m.details = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Description; - })(); - v1beta1.Validator = (function () { - function Validator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Validator.prototype.operatorAddress = ""; - Validator.prototype.consensusPubkey = null; - Validator.prototype.jailed = false; - Validator.prototype.status = 0; - Validator.prototype.tokens = ""; - Validator.prototype.delegatorShares = ""; - Validator.prototype.description = null; - Validator.prototype.unbondingHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Validator.prototype.unbondingTime = null; - Validator.prototype.commission = null; - Validator.prototype.minSelfDelegation = ""; - Validator.create = function create(properties) { - return new Validator(properties); - }; - Validator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.operatorAddress != null && Object.hasOwnProperty.call(m, "operatorAddress")) - w.uint32(10).string(m.operatorAddress); - if (m.consensusPubkey != null && Object.hasOwnProperty.call(m, "consensusPubkey")) - $root.google.protobuf.Any.encode(m.consensusPubkey, w.uint32(18).fork()).ldelim(); - if (m.jailed != null && Object.hasOwnProperty.call(m, "jailed")) w.uint32(24).bool(m.jailed); - if (m.status != null && Object.hasOwnProperty.call(m, "status")) w.uint32(32).int32(m.status); - if (m.tokens != null && Object.hasOwnProperty.call(m, "tokens")) w.uint32(42).string(m.tokens); - if (m.delegatorShares != null && Object.hasOwnProperty.call(m, "delegatorShares")) - w.uint32(50).string(m.delegatorShares); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - $root.cosmos.staking.v1beta1.Description.encode(m.description, w.uint32(58).fork()).ldelim(); - if (m.unbondingHeight != null && Object.hasOwnProperty.call(m, "unbondingHeight")) - w.uint32(64).int64(m.unbondingHeight); - if (m.unbondingTime != null && Object.hasOwnProperty.call(m, "unbondingTime")) - $root.google.protobuf.Timestamp.encode(m.unbondingTime, w.uint32(74).fork()).ldelim(); - if (m.commission != null && Object.hasOwnProperty.call(m, "commission")) - $root.cosmos.staking.v1beta1.Commission.encode(m.commission, w.uint32(82).fork()).ldelim(); - if (m.minSelfDelegation != null && Object.hasOwnProperty.call(m, "minSelfDelegation")) - w.uint32(90).string(m.minSelfDelegation); - return w; - }; - Validator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Validator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.operatorAddress = r.string(); - break; - case 2: - m.consensusPubkey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 3: - m.jailed = r.bool(); - break; - case 4: - m.status = r.int32(); - break; - case 5: - m.tokens = r.string(); - break; - case 6: - m.delegatorShares = r.string(); - break; - case 7: - m.description = $root.cosmos.staking.v1beta1.Description.decode(r, r.uint32()); - break; - case 8: - m.unbondingHeight = r.int64(); - break; - case 9: - m.unbondingTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 10: - m.commission = $root.cosmos.staking.v1beta1.Commission.decode(r, r.uint32()); - break; - case 11: - m.minSelfDelegation = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Validator; - })(); - v1beta1.BondStatus = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "BOND_STATUS_UNSPECIFIED")] = 0; - values[(valuesById[1] = "BOND_STATUS_UNBONDED")] = 1; - values[(valuesById[2] = "BOND_STATUS_UNBONDING")] = 2; - values[(valuesById[3] = "BOND_STATUS_BONDED")] = 3; - return values; - })(); - v1beta1.ValAddresses = (function () { - function ValAddresses(p) { - this.addresses = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValAddresses.prototype.addresses = $util.emptyArray; - ValAddresses.create = function create(properties) { - return new ValAddresses(properties); - }; - ValAddresses.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.addresses != null && m.addresses.length) { - for (var i = 0; i < m.addresses.length; ++i) w.uint32(10).string(m.addresses[i]); - } - return w; - }; - ValAddresses.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.ValAddresses(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.addresses && m.addresses.length)) m.addresses = []; - m.addresses.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValAddresses; - })(); - v1beta1.DVPair = (function () { - function DVPair(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DVPair.prototype.delegatorAddress = ""; - DVPair.prototype.validatorAddress = ""; - DVPair.create = function create(properties) { - return new DVPair(properties); - }; - DVPair.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - return w; - }; - DVPair.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.DVPair(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DVPair; - })(); - v1beta1.DVPairs = (function () { - function DVPairs(p) { - this.pairs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DVPairs.prototype.pairs = $util.emptyArray; - DVPairs.create = function create(properties) { - return new DVPairs(properties); - }; - DVPairs.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pairs != null && m.pairs.length) { - for (var i = 0; i < m.pairs.length; ++i) - $root.cosmos.staking.v1beta1.DVPair.encode(m.pairs[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - DVPairs.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.DVPairs(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.pairs && m.pairs.length)) m.pairs = []; - m.pairs.push($root.cosmos.staking.v1beta1.DVPair.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DVPairs; - })(); - v1beta1.DVVTriplet = (function () { - function DVVTriplet(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DVVTriplet.prototype.delegatorAddress = ""; - DVVTriplet.prototype.validatorSrcAddress = ""; - DVVTriplet.prototype.validatorDstAddress = ""; - DVVTriplet.create = function create(properties) { - return new DVVTriplet(properties); - }; - DVVTriplet.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorSrcAddress != null && Object.hasOwnProperty.call(m, "validatorSrcAddress")) - w.uint32(18).string(m.validatorSrcAddress); - if (m.validatorDstAddress != null && Object.hasOwnProperty.call(m, "validatorDstAddress")) - w.uint32(26).string(m.validatorDstAddress); - return w; - }; - DVVTriplet.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.DVVTriplet(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorSrcAddress = r.string(); - break; - case 3: - m.validatorDstAddress = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DVVTriplet; - })(); - v1beta1.DVVTriplets = (function () { - function DVVTriplets(p) { - this.triplets = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DVVTriplets.prototype.triplets = $util.emptyArray; - DVVTriplets.create = function create(properties) { - return new DVVTriplets(properties); - }; - DVVTriplets.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.triplets != null && m.triplets.length) { - for (var i = 0; i < m.triplets.length; ++i) - $root.cosmos.staking.v1beta1.DVVTriplet.encode(m.triplets[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - DVVTriplets.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.DVVTriplets(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.triplets && m.triplets.length)) m.triplets = []; - m.triplets.push($root.cosmos.staking.v1beta1.DVVTriplet.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DVVTriplets; - })(); - v1beta1.Delegation = (function () { - function Delegation(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Delegation.prototype.delegatorAddress = ""; - Delegation.prototype.validatorAddress = ""; - Delegation.prototype.shares = ""; - Delegation.create = function create(properties) { - return new Delegation(properties); - }; - Delegation.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - if (m.shares != null && Object.hasOwnProperty.call(m, "shares")) w.uint32(26).string(m.shares); - return w; - }; - Delegation.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Delegation(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - case 3: - m.shares = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Delegation; - })(); - v1beta1.UnbondingDelegation = (function () { - function UnbondingDelegation(p) { - this.entries = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - UnbondingDelegation.prototype.delegatorAddress = ""; - UnbondingDelegation.prototype.validatorAddress = ""; - UnbondingDelegation.prototype.entries = $util.emptyArray; - UnbondingDelegation.create = function create(properties) { - return new UnbondingDelegation(properties); - }; - UnbondingDelegation.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - if (m.entries != null && m.entries.length) { - for (var i = 0; i < m.entries.length; ++i) - $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.encode( - m.entries[i], - w.uint32(26).fork(), - ).ldelim(); - } - return w; - }; - UnbondingDelegation.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.UnbondingDelegation(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - case 3: - if (!(m.entries && m.entries.length)) m.entries = []; - m.entries.push($root.cosmos.staking.v1beta1.UnbondingDelegationEntry.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return UnbondingDelegation; - })(); - v1beta1.UnbondingDelegationEntry = (function () { - function UnbondingDelegationEntry(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - UnbondingDelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - UnbondingDelegationEntry.prototype.completionTime = null; - UnbondingDelegationEntry.prototype.initialBalance = ""; - UnbondingDelegationEntry.prototype.balance = ""; - UnbondingDelegationEntry.create = function create(properties) { - return new UnbondingDelegationEntry(properties); - }; - UnbondingDelegationEntry.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.creationHeight != null && Object.hasOwnProperty.call(m, "creationHeight")) - w.uint32(8).int64(m.creationHeight); - if (m.completionTime != null && Object.hasOwnProperty.call(m, "completionTime")) - $root.google.protobuf.Timestamp.encode(m.completionTime, w.uint32(18).fork()).ldelim(); - if (m.initialBalance != null && Object.hasOwnProperty.call(m, "initialBalance")) - w.uint32(26).string(m.initialBalance); - if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) w.uint32(34).string(m.balance); - return w; - }; - UnbondingDelegationEntry.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.creationHeight = r.int64(); - break; - case 2: - m.completionTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 3: - m.initialBalance = r.string(); - break; - case 4: - m.balance = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return UnbondingDelegationEntry; - })(); - v1beta1.RedelegationEntry = (function () { - function RedelegationEntry(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RedelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - RedelegationEntry.prototype.completionTime = null; - RedelegationEntry.prototype.initialBalance = ""; - RedelegationEntry.prototype.sharesDst = ""; - RedelegationEntry.create = function create(properties) { - return new RedelegationEntry(properties); - }; - RedelegationEntry.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.creationHeight != null && Object.hasOwnProperty.call(m, "creationHeight")) - w.uint32(8).int64(m.creationHeight); - if (m.completionTime != null && Object.hasOwnProperty.call(m, "completionTime")) - $root.google.protobuf.Timestamp.encode(m.completionTime, w.uint32(18).fork()).ldelim(); - if (m.initialBalance != null && Object.hasOwnProperty.call(m, "initialBalance")) - w.uint32(26).string(m.initialBalance); - if (m.sharesDst != null && Object.hasOwnProperty.call(m, "sharesDst")) - w.uint32(34).string(m.sharesDst); - return w; - }; - RedelegationEntry.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.RedelegationEntry(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.creationHeight = r.int64(); - break; - case 2: - m.completionTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 3: - m.initialBalance = r.string(); - break; - case 4: - m.sharesDst = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RedelegationEntry; - })(); - v1beta1.Redelegation = (function () { - function Redelegation(p) { - this.entries = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Redelegation.prototype.delegatorAddress = ""; - Redelegation.prototype.validatorSrcAddress = ""; - Redelegation.prototype.validatorDstAddress = ""; - Redelegation.prototype.entries = $util.emptyArray; - Redelegation.create = function create(properties) { - return new Redelegation(properties); - }; - Redelegation.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorSrcAddress != null && Object.hasOwnProperty.call(m, "validatorSrcAddress")) - w.uint32(18).string(m.validatorSrcAddress); - if (m.validatorDstAddress != null && Object.hasOwnProperty.call(m, "validatorDstAddress")) - w.uint32(26).string(m.validatorDstAddress); - if (m.entries != null && m.entries.length) { - for (var i = 0; i < m.entries.length; ++i) - $root.cosmos.staking.v1beta1.RedelegationEntry.encode( - m.entries[i], - w.uint32(34).fork(), - ).ldelim(); - } - return w; - }; - Redelegation.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Redelegation(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorSrcAddress = r.string(); - break; - case 3: - m.validatorDstAddress = r.string(); - break; - case 4: - if (!(m.entries && m.entries.length)) m.entries = []; - m.entries.push($root.cosmos.staking.v1beta1.RedelegationEntry.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Redelegation; - })(); - v1beta1.Params = (function () { - function Params(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.unbondingTime = null; - Params.prototype.maxValidators = 0; - Params.prototype.maxEntries = 0; - Params.prototype.historicalEntries = 0; - Params.prototype.bondDenom = ""; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.unbondingTime != null && Object.hasOwnProperty.call(m, "unbondingTime")) - $root.google.protobuf.Duration.encode(m.unbondingTime, w.uint32(10).fork()).ldelim(); - if (m.maxValidators != null && Object.hasOwnProperty.call(m, "maxValidators")) - w.uint32(16).uint32(m.maxValidators); - if (m.maxEntries != null && Object.hasOwnProperty.call(m, "maxEntries")) - w.uint32(24).uint32(m.maxEntries); - if (m.historicalEntries != null && Object.hasOwnProperty.call(m, "historicalEntries")) - w.uint32(32).uint32(m.historicalEntries); - if (m.bondDenom != null && Object.hasOwnProperty.call(m, "bondDenom")) - w.uint32(42).string(m.bondDenom); - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.unbondingTime = $root.google.protobuf.Duration.decode(r, r.uint32()); - break; - case 2: - m.maxValidators = r.uint32(); - break; - case 3: - m.maxEntries = r.uint32(); - break; - case 4: - m.historicalEntries = r.uint32(); - break; - case 5: - m.bondDenom = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - v1beta1.DelegationResponse = (function () { - function DelegationResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DelegationResponse.prototype.delegation = null; - DelegationResponse.prototype.balance = null; - DelegationResponse.create = function create(properties) { - return new DelegationResponse(properties); - }; - DelegationResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegation != null && Object.hasOwnProperty.call(m, "delegation")) - $root.cosmos.staking.v1beta1.Delegation.encode(m.delegation, w.uint32(10).fork()).ldelim(); - if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) - $root.cosmos.base.v1beta1.Coin.encode(m.balance, w.uint32(18).fork()).ldelim(); - return w; - }; - DelegationResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.DelegationResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegation = $root.cosmos.staking.v1beta1.Delegation.decode(r, r.uint32()); - break; - case 2: - m.balance = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DelegationResponse; - })(); - v1beta1.RedelegationEntryResponse = (function () { - function RedelegationEntryResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RedelegationEntryResponse.prototype.redelegationEntry = null; - RedelegationEntryResponse.prototype.balance = ""; - RedelegationEntryResponse.create = function create(properties) { - return new RedelegationEntryResponse(properties); - }; - RedelegationEntryResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.redelegationEntry != null && Object.hasOwnProperty.call(m, "redelegationEntry")) - $root.cosmos.staking.v1beta1.RedelegationEntry.encode( - m.redelegationEntry, - w.uint32(10).fork(), - ).ldelim(); - if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) w.uint32(34).string(m.balance); - return w; - }; - RedelegationEntryResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.decode(r, r.uint32()); - break; - case 4: - m.balance = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RedelegationEntryResponse; - })(); - v1beta1.RedelegationResponse = (function () { - function RedelegationResponse(p) { - this.entries = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RedelegationResponse.prototype.redelegation = null; - RedelegationResponse.prototype.entries = $util.emptyArray; - RedelegationResponse.create = function create(properties) { - return new RedelegationResponse(properties); - }; - RedelegationResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.redelegation != null && Object.hasOwnProperty.call(m, "redelegation")) - $root.cosmos.staking.v1beta1.Redelegation.encode(m.redelegation, w.uint32(10).fork()).ldelim(); - if (m.entries != null && m.entries.length) { - for (var i = 0; i < m.entries.length; ++i) - $root.cosmos.staking.v1beta1.RedelegationEntryResponse.encode( - m.entries[i], - w.uint32(18).fork(), - ).ldelim(); - } - return w; - }; - RedelegationResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.RedelegationResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.redelegation = $root.cosmos.staking.v1beta1.Redelegation.decode(r, r.uint32()); - break; - case 2: - if (!(m.entries && m.entries.length)) m.entries = []; - m.entries.push($root.cosmos.staking.v1beta1.RedelegationEntryResponse.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RedelegationResponse; - })(); - v1beta1.Pool = (function () { - function Pool(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Pool.prototype.notBondedTokens = ""; - Pool.prototype.bondedTokens = ""; - Pool.create = function create(properties) { - return new Pool(properties); - }; - Pool.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.notBondedTokens != null && Object.hasOwnProperty.call(m, "notBondedTokens")) - w.uint32(10).string(m.notBondedTokens); - if (m.bondedTokens != null && Object.hasOwnProperty.call(m, "bondedTokens")) - w.uint32(18).string(m.bondedTokens); - return w; - }; - Pool.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.Pool(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.notBondedTokens = r.string(); - break; - case 2: - m.bondedTokens = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Pool; - })(); - v1beta1.Msg = (function () { - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Msg.prototype.createValidator = function createValidator(request, callback) { - return this.rpcCall( - createValidator, - $root.cosmos.staking.v1beta1.MsgCreateValidator, - $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse, - request, - callback, - ); - }), - "name", - { value: "CreateValidator" }, - ); - Object.defineProperty( - (Msg.prototype.editValidator = function editValidator(request, callback) { - return this.rpcCall( - editValidator, - $root.cosmos.staking.v1beta1.MsgEditValidator, - $root.cosmos.staking.v1beta1.MsgEditValidatorResponse, - request, - callback, - ); - }), - "name", - { value: "EditValidator" }, - ); - Object.defineProperty( - (Msg.prototype.delegate = function delegate(request, callback) { - return this.rpcCall( - delegate, - $root.cosmos.staking.v1beta1.MsgDelegate, - $root.cosmos.staking.v1beta1.MsgDelegateResponse, - request, - callback, - ); - }), - "name", - { value: "Delegate" }, - ); - Object.defineProperty( - (Msg.prototype.beginRedelegate = function beginRedelegate(request, callback) { - return this.rpcCall( - beginRedelegate, - $root.cosmos.staking.v1beta1.MsgBeginRedelegate, - $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse, - request, - callback, - ); - }), - "name", - { value: "BeginRedelegate" }, - ); - Object.defineProperty( - (Msg.prototype.undelegate = function undelegate(request, callback) { - return this.rpcCall( - undelegate, - $root.cosmos.staking.v1beta1.MsgUndelegate, - $root.cosmos.staking.v1beta1.MsgUndelegateResponse, - request, - callback, - ); - }), - "name", - { value: "Undelegate" }, - ); - return Msg; - })(); - v1beta1.MsgCreateValidator = (function () { - function MsgCreateValidator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgCreateValidator.prototype.description = null; - MsgCreateValidator.prototype.commission = null; - MsgCreateValidator.prototype.minSelfDelegation = ""; - MsgCreateValidator.prototype.delegatorAddress = ""; - MsgCreateValidator.prototype.validatorAddress = ""; - MsgCreateValidator.prototype.pubkey = null; - MsgCreateValidator.prototype.value = null; - MsgCreateValidator.create = function create(properties) { - return new MsgCreateValidator(properties); - }; - MsgCreateValidator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - $root.cosmos.staking.v1beta1.Description.encode(m.description, w.uint32(10).fork()).ldelim(); - if (m.commission != null && Object.hasOwnProperty.call(m, "commission")) - $root.cosmos.staking.v1beta1.CommissionRates.encode(m.commission, w.uint32(18).fork()).ldelim(); - if (m.minSelfDelegation != null && Object.hasOwnProperty.call(m, "minSelfDelegation")) - w.uint32(26).string(m.minSelfDelegation); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(34).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(42).string(m.validatorAddress); - if (m.pubkey != null && Object.hasOwnProperty.call(m, "pubkey")) - $root.google.protobuf.Any.encode(m.pubkey, w.uint32(50).fork()).ldelim(); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) - $root.cosmos.base.v1beta1.Coin.encode(m.value, w.uint32(58).fork()).ldelim(); - return w; - }; - MsgCreateValidator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgCreateValidator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.description = $root.cosmos.staking.v1beta1.Description.decode(r, r.uint32()); - break; - case 2: - m.commission = $root.cosmos.staking.v1beta1.CommissionRates.decode(r, r.uint32()); - break; - case 3: - m.minSelfDelegation = r.string(); - break; - case 4: - m.delegatorAddress = r.string(); - break; - case 5: - m.validatorAddress = r.string(); - break; - case 6: - m.pubkey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 7: - m.value = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgCreateValidator; - })(); - v1beta1.MsgCreateValidatorResponse = (function () { - function MsgCreateValidatorResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgCreateValidatorResponse.create = function create(properties) { - return new MsgCreateValidatorResponse(properties); - }; - MsgCreateValidatorResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgCreateValidatorResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgCreateValidatorResponse; - })(); - v1beta1.MsgEditValidator = (function () { - function MsgEditValidator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgEditValidator.prototype.description = null; - MsgEditValidator.prototype.validatorAddress = ""; - MsgEditValidator.prototype.commissionRate = ""; - MsgEditValidator.prototype.minSelfDelegation = ""; - MsgEditValidator.create = function create(properties) { - return new MsgEditValidator(properties); - }; - MsgEditValidator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - $root.cosmos.staking.v1beta1.Description.encode(m.description, w.uint32(10).fork()).ldelim(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - if (m.commissionRate != null && Object.hasOwnProperty.call(m, "commissionRate")) - w.uint32(26).string(m.commissionRate); - if (m.minSelfDelegation != null && Object.hasOwnProperty.call(m, "minSelfDelegation")) - w.uint32(34).string(m.minSelfDelegation); - return w; - }; - MsgEditValidator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgEditValidator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.description = $root.cosmos.staking.v1beta1.Description.decode(r, r.uint32()); - break; - case 2: - m.validatorAddress = r.string(); - break; - case 3: - m.commissionRate = r.string(); - break; - case 4: - m.minSelfDelegation = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgEditValidator; - })(); - v1beta1.MsgEditValidatorResponse = (function () { - function MsgEditValidatorResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgEditValidatorResponse.create = function create(properties) { - return new MsgEditValidatorResponse(properties); - }; - MsgEditValidatorResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgEditValidatorResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgEditValidatorResponse; - })(); - v1beta1.MsgDelegate = (function () { - function MsgDelegate(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgDelegate.prototype.delegatorAddress = ""; - MsgDelegate.prototype.validatorAddress = ""; - MsgDelegate.prototype.amount = null; - MsgDelegate.create = function create(properties) { - return new MsgDelegate(properties); - }; - MsgDelegate.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(m.amount, w.uint32(26).fork()).ldelim(); - return w; - }; - MsgDelegate.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgDelegate(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - case 3: - m.amount = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgDelegate; - })(); - v1beta1.MsgDelegateResponse = (function () { - function MsgDelegateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgDelegateResponse.create = function create(properties) { - return new MsgDelegateResponse(properties); - }; - MsgDelegateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgDelegateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgDelegateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgDelegateResponse; - })(); - v1beta1.MsgBeginRedelegate = (function () { - function MsgBeginRedelegate(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgBeginRedelegate.prototype.delegatorAddress = ""; - MsgBeginRedelegate.prototype.validatorSrcAddress = ""; - MsgBeginRedelegate.prototype.validatorDstAddress = ""; - MsgBeginRedelegate.prototype.amount = null; - MsgBeginRedelegate.create = function create(properties) { - return new MsgBeginRedelegate(properties); - }; - MsgBeginRedelegate.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorSrcAddress != null && Object.hasOwnProperty.call(m, "validatorSrcAddress")) - w.uint32(18).string(m.validatorSrcAddress); - if (m.validatorDstAddress != null && Object.hasOwnProperty.call(m, "validatorDstAddress")) - w.uint32(26).string(m.validatorDstAddress); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(m.amount, w.uint32(34).fork()).ldelim(); - return w; - }; - MsgBeginRedelegate.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorSrcAddress = r.string(); - break; - case 3: - m.validatorDstAddress = r.string(); - break; - case 4: - m.amount = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgBeginRedelegate; - })(); - v1beta1.MsgBeginRedelegateResponse = (function () { - function MsgBeginRedelegateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgBeginRedelegateResponse.prototype.completionTime = null; - MsgBeginRedelegateResponse.create = function create(properties) { - return new MsgBeginRedelegateResponse(properties); - }; - MsgBeginRedelegateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.completionTime != null && Object.hasOwnProperty.call(m, "completionTime")) - $root.google.protobuf.Timestamp.encode(m.completionTime, w.uint32(10).fork()).ldelim(); - return w; - }; - MsgBeginRedelegateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.completionTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgBeginRedelegateResponse; - })(); - v1beta1.MsgUndelegate = (function () { - function MsgUndelegate(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgUndelegate.prototype.delegatorAddress = ""; - MsgUndelegate.prototype.validatorAddress = ""; - MsgUndelegate.prototype.amount = null; - MsgUndelegate.create = function create(properties) { - return new MsgUndelegate(properties); - }; - MsgUndelegate.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.delegatorAddress != null && Object.hasOwnProperty.call(m, "delegatorAddress")) - w.uint32(10).string(m.delegatorAddress); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).string(m.validatorAddress); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(m.amount, w.uint32(26).fork()).ldelim(); - return w; - }; - MsgUndelegate.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgUndelegate(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.delegatorAddress = r.string(); - break; - case 2: - m.validatorAddress = r.string(); - break; - case 3: - m.amount = $root.cosmos.base.v1beta1.Coin.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgUndelegate; - })(); - v1beta1.MsgUndelegateResponse = (function () { - function MsgUndelegateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgUndelegateResponse.prototype.completionTime = null; - MsgUndelegateResponse.create = function create(properties) { - return new MsgUndelegateResponse(properties); - }; - MsgUndelegateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.completionTime != null && Object.hasOwnProperty.call(m, "completionTime")) - $root.google.protobuf.Timestamp.encode(m.completionTime, w.uint32(10).fork()).ldelim(); - return w; - }; - MsgUndelegateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.completionTime = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgUndelegateResponse; - })(); - return v1beta1; - })(); - return staking; - })(); - cosmos.tx = (function () { - const tx = {}; - tx.signing = (function () { - const signing = {}; - signing.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.SignMode = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "SIGN_MODE_UNSPECIFIED")] = 0; - values[(valuesById[1] = "SIGN_MODE_DIRECT")] = 1; - values[(valuesById[2] = "SIGN_MODE_TEXTUAL")] = 2; - values[(valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON")] = 127; - return values; - })(); - v1beta1.SignatureDescriptors = (function () { - function SignatureDescriptors(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignatureDescriptors.prototype.signatures = $util.emptyArray; - SignatureDescriptors.create = function create(properties) { - return new SignatureDescriptors(properties); - }; - SignatureDescriptors.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode( - m.signatures[i], - w.uint32(10).fork(), - ).ldelim(); - } - return w; - }; - SignatureDescriptors.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push( - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignatureDescriptors; - })(); - v1beta1.SignatureDescriptor = (function () { - function SignatureDescriptor(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignatureDescriptor.prototype.publicKey = null; - SignatureDescriptor.prototype.data = null; - SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignatureDescriptor.create = function create(properties) { - return new SignatureDescriptor(properties); - }; - SignatureDescriptor.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey")) - $root.google.protobuf.Any.encode(m.publicKey, w.uint32(10).fork()).ldelim(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode( - m.data, - w.uint32(18).fork(), - ).ldelim(); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - SignatureDescriptor.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.publicKey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(r, r.uint32()); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - SignatureDescriptor.Data = (function () { - function Data(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Data.prototype.single = null; - Data.prototype.multi = null; - let $oneOfFields; - Object.defineProperty(Data.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["single", "multi"])), - set: $util.oneOfSetter($oneOfFields), - }); - Data.create = function create(properties) { - return new Data(properties); - }; - Data.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.single != null && Object.hasOwnProperty.call(m, "single")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode( - m.single, - w.uint32(10).fork(), - ).ldelim(); - if (m.multi != null && Object.hasOwnProperty.call(m, "multi")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode( - m.multi, - w.uint32(18).fork(), - ).ldelim(); - return w; - }; - Data.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode( - r, - r.uint32(), - ); - break; - case 2: - m.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode( - r, - r.uint32(), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - Data.Single = (function () { - function Single(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Single.prototype.mode = 0; - Single.prototype.signature = $util.newBuffer([]); - Single.create = function create(properties) { - return new Single(properties); - }; - Single.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) w.uint32(8).int32(m.mode); - if (m.signature != null && Object.hasOwnProperty.call(m, "signature")) - w.uint32(18).bytes(m.signature); - return w; - }; - Single.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.mode = r.int32(); - break; - case 2: - m.signature = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Single; - })(); - Data.Multi = (function () { - function Multi(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Multi.prototype.bitarray = null; - Multi.prototype.signatures = $util.emptyArray; - Multi.create = function create(properties) { - return new Multi(properties); - }; - Multi.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bitarray != null && Object.hasOwnProperty.call(m, "bitarray")) - $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode( - m.bitarray, - w.uint32(10).fork(), - ).ldelim(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode( - m.signatures[i], - w.uint32(18).fork(), - ).ldelim(); - } - return w; - }; - Multi.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(r, r.uint32()); - break; - case 2: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push( - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Multi; - })(); - return Data; - })(); - return SignatureDescriptor; - })(); - return v1beta1; - })(); - return signing; - })(); - tx.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Tx = (function () { - function Tx(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Tx.prototype.body = null; - Tx.prototype.authInfo = null; - Tx.prototype.signatures = $util.emptyArray; - Tx.create = function create(properties) { - return new Tx(properties); - }; - Tx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.body != null && Object.hasOwnProperty.call(m, "body")) - $root.cosmos.tx.v1beta1.TxBody.encode(m.body, w.uint32(10).fork()).ldelim(); - if (m.authInfo != null && Object.hasOwnProperty.call(m, "authInfo")) - $root.cosmos.tx.v1beta1.AuthInfo.encode(m.authInfo, w.uint32(18).fork()).ldelim(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(26).bytes(m.signatures[i]); - } - return w; - }; - Tx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.Tx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.body = $root.cosmos.tx.v1beta1.TxBody.decode(r, r.uint32()); - break; - case 2: - m.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(r, r.uint32()); - break; - case 3: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Tx; - })(); - v1beta1.TxRaw = (function () { - function TxRaw(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxRaw.prototype.bodyBytes = $util.newBuffer([]); - TxRaw.prototype.authInfoBytes = $util.newBuffer([]); - TxRaw.prototype.signatures = $util.emptyArray; - TxRaw.create = function create(properties) { - return new TxRaw(properties); - }; - TxRaw.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) - w.uint32(10).bytes(m.bodyBytes); - if (m.authInfoBytes != null && Object.hasOwnProperty.call(m, "authInfoBytes")) - w.uint32(18).bytes(m.authInfoBytes); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(26).bytes(m.signatures[i]); - } - return w; - }; - TxRaw.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.TxRaw(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bodyBytes = r.bytes(); - break; - case 2: - m.authInfoBytes = r.bytes(); - break; - case 3: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxRaw; - })(); - v1beta1.SignDoc = (function () { - function SignDoc(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignDoc.prototype.bodyBytes = $util.newBuffer([]); - SignDoc.prototype.authInfoBytes = $util.newBuffer([]); - SignDoc.prototype.chainId = ""; - SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignDoc.create = function create(properties) { - return new SignDoc(properties); - }; - SignDoc.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) - w.uint32(10).bytes(m.bodyBytes); - if (m.authInfoBytes != null && Object.hasOwnProperty.call(m, "authInfoBytes")) - w.uint32(18).bytes(m.authInfoBytes); - if (m.chainId != null && Object.hasOwnProperty.call(m, "chainId")) w.uint32(26).string(m.chainId); - if (m.accountNumber != null && Object.hasOwnProperty.call(m, "accountNumber")) - w.uint32(32).uint64(m.accountNumber); - return w; - }; - SignDoc.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.SignDoc(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bodyBytes = r.bytes(); - break; - case 2: - m.authInfoBytes = r.bytes(); - break; - case 3: - m.chainId = r.string(); - break; - case 4: - m.accountNumber = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignDoc; - })(); - v1beta1.TxBody = (function () { - function TxBody(p) { - this.messages = []; - this.extensionOptions = []; - this.nonCriticalExtensionOptions = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxBody.prototype.messages = $util.emptyArray; - TxBody.prototype.memo = ""; - TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - TxBody.prototype.extensionOptions = $util.emptyArray; - TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray; - TxBody.create = function create(properties) { - return new TxBody(properties); - }; - TxBody.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.messages != null && m.messages.length) { - for (var i = 0; i < m.messages.length; ++i) - $root.google.protobuf.Any.encode(m.messages[i], w.uint32(10).fork()).ldelim(); - } - if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) w.uint32(18).string(m.memo); - if (m.timeoutHeight != null && Object.hasOwnProperty.call(m, "timeoutHeight")) - w.uint32(24).uint64(m.timeoutHeight); - if (m.extensionOptions != null && m.extensionOptions.length) { - for (var i = 0; i < m.extensionOptions.length; ++i) - $root.google.protobuf.Any.encode(m.extensionOptions[i], w.uint32(8186).fork()).ldelim(); - } - if (m.nonCriticalExtensionOptions != null && m.nonCriticalExtensionOptions.length) { - for (var i = 0; i < m.nonCriticalExtensionOptions.length; ++i) - $root.google.protobuf.Any.encode( - m.nonCriticalExtensionOptions[i], - w.uint32(16378).fork(), - ).ldelim(); - } - return w; - }; - TxBody.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.TxBody(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.messages && m.messages.length)) m.messages = []; - m.messages.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - case 2: - m.memo = r.string(); - break; - case 3: - m.timeoutHeight = r.uint64(); - break; - case 1023: - if (!(m.extensionOptions && m.extensionOptions.length)) m.extensionOptions = []; - m.extensionOptions.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - case 2047: - if (!(m.nonCriticalExtensionOptions && m.nonCriticalExtensionOptions.length)) - m.nonCriticalExtensionOptions = []; - m.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxBody; - })(); - v1beta1.AuthInfo = (function () { - function AuthInfo(p) { - this.signerInfos = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - AuthInfo.prototype.signerInfos = $util.emptyArray; - AuthInfo.prototype.fee = null; - AuthInfo.create = function create(properties) { - return new AuthInfo(properties); - }; - AuthInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signerInfos != null && m.signerInfos.length) { - for (var i = 0; i < m.signerInfos.length; ++i) - $root.cosmos.tx.v1beta1.SignerInfo.encode(m.signerInfos[i], w.uint32(10).fork()).ldelim(); - } - if (m.fee != null && Object.hasOwnProperty.call(m, "fee")) - $root.cosmos.tx.v1beta1.Fee.encode(m.fee, w.uint32(18).fork()).ldelim(); - return w; - }; - AuthInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.AuthInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signerInfos && m.signerInfos.length)) m.signerInfos = []; - m.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(r, r.uint32())); - break; - case 2: - m.fee = $root.cosmos.tx.v1beta1.Fee.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return AuthInfo; - })(); - v1beta1.SignerInfo = (function () { - function SignerInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignerInfo.prototype.publicKey = null; - SignerInfo.prototype.modeInfo = null; - SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignerInfo.create = function create(properties) { - return new SignerInfo(properties); - }; - SignerInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey")) - $root.google.protobuf.Any.encode(m.publicKey, w.uint32(10).fork()).ldelim(); - if (m.modeInfo != null && Object.hasOwnProperty.call(m, "modeInfo")) - $root.cosmos.tx.v1beta1.ModeInfo.encode(m.modeInfo, w.uint32(18).fork()).ldelim(); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - SignerInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.SignerInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.publicKey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(r, r.uint32()); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignerInfo; - })(); - v1beta1.ModeInfo = (function () { - function ModeInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ModeInfo.prototype.single = null; - ModeInfo.prototype.multi = null; - let $oneOfFields; - Object.defineProperty(ModeInfo.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["single", "multi"])), - set: $util.oneOfSetter($oneOfFields), - }); - ModeInfo.create = function create(properties) { - return new ModeInfo(properties); - }; - ModeInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.single != null && Object.hasOwnProperty.call(m, "single")) - $root.cosmos.tx.v1beta1.ModeInfo.Single.encode(m.single, w.uint32(10).fork()).ldelim(); - if (m.multi != null && Object.hasOwnProperty.call(m, "multi")) - $root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(m.multi, w.uint32(18).fork()).ldelim(); - return w; - }; - ModeInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(r, r.uint32()); - break; - case 2: - m.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - ModeInfo.Single = (function () { - function Single(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Single.prototype.mode = 0; - Single.create = function create(properties) { - return new Single(properties); - }; - Single.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) w.uint32(8).int32(m.mode); - return w; - }; - Single.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.mode = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Single; - })(); - ModeInfo.Multi = (function () { - function Multi(p) { - this.modeInfos = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Multi.prototype.bitarray = null; - Multi.prototype.modeInfos = $util.emptyArray; - Multi.create = function create(properties) { - return new Multi(properties); - }; - Multi.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bitarray != null && Object.hasOwnProperty.call(m, "bitarray")) - $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode( - m.bitarray, - w.uint32(10).fork(), - ).ldelim(); - if (m.modeInfos != null && m.modeInfos.length) { - for (var i = 0; i < m.modeInfos.length; ++i) - $root.cosmos.tx.v1beta1.ModeInfo.encode(m.modeInfos[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Multi.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(r, r.uint32()); - break; - case 2: - if (!(m.modeInfos && m.modeInfos.length)) m.modeInfos = []; - m.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Multi; - })(); - return ModeInfo; - })(); - v1beta1.Fee = (function () { - function Fee(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Fee.prototype.amount = $util.emptyArray; - Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Fee.prototype.payer = ""; - Fee.prototype.granter = ""; - Fee.create = function create(properties) { - return new Fee(properties); - }; - Fee.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(10).fork()).ldelim(); - } - if (m.gasLimit != null && Object.hasOwnProperty.call(m, "gasLimit")) - w.uint32(16).uint64(m.gasLimit); - if (m.payer != null && Object.hasOwnProperty.call(m, "payer")) w.uint32(26).string(m.payer); - if (m.granter != null && Object.hasOwnProperty.call(m, "granter")) w.uint32(34).string(m.granter); - return w; - }; - Fee.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.Fee(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - case 2: - m.gasLimit = r.uint64(); - break; - case 3: - m.payer = r.string(); - break; - case 4: - m.granter = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Fee; - })(); - return v1beta1; - })(); - return tx; - })(); - return cosmos; -})(); -exports.google = $root.google = (() => { - const google = {}; - google.protobuf = (function () { - const protobuf = {}; - protobuf.Any = (function () { - function Any(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Any.prototype.type_url = ""; - Any.prototype.value = $util.newBuffer([]); - Any.create = function create(properties) { - return new Any(properties); - }; - Any.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type_url != null && Object.hasOwnProperty.call(m, "type_url")) w.uint32(10).string(m.type_url); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).bytes(m.value); - return w; - }; - Any.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.Any(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type_url = r.string(); - break; - case 2: - m.value = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Any; - })(); - protobuf.FileDescriptorSet = (function () { - function FileDescriptorSet(p) { - this.file = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FileDescriptorSet.prototype.file = $util.emptyArray; - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - FileDescriptorSet.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.file != null && m.file.length) { - for (var i = 0; i < m.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(m.file[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - FileDescriptorSet.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.FileDescriptorSet(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.file && m.file.length)) m.file = []; - m.file.push($root.google.protobuf.FileDescriptorProto.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return FileDescriptorSet; - })(); - protobuf.FileDescriptorProto = (function () { - function FileDescriptorProto(p) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FileDescriptorProto.prototype.name = ""; - FileDescriptorProto.prototype["package"] = ""; - FileDescriptorProto.prototype.dependency = $util.emptyArray; - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - FileDescriptorProto.prototype.messageType = $util.emptyArray; - FileDescriptorProto.prototype.enumType = $util.emptyArray; - FileDescriptorProto.prototype.service = $util.emptyArray; - FileDescriptorProto.prototype.extension = $util.emptyArray; - FileDescriptorProto.prototype.options = null; - FileDescriptorProto.prototype.sourceCodeInfo = null; - FileDescriptorProto.prototype.syntax = ""; - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - FileDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m["package"] != null && Object.hasOwnProperty.call(m, "package")) - w.uint32(18).string(m["package"]); - if (m.dependency != null && m.dependency.length) { - for (var i = 0; i < m.dependency.length; ++i) w.uint32(26).string(m.dependency[i]); - } - if (m.messageType != null && m.messageType.length) { - for (var i = 0; i < m.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(m.messageType[i], w.uint32(34).fork()).ldelim(); - } - if (m.enumType != null && m.enumType.length) { - for (var i = 0; i < m.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(m.enumType[i], w.uint32(42).fork()).ldelim(); - } - if (m.service != null && m.service.length) { - for (var i = 0; i < m.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(m.service[i], w.uint32(50).fork()).ldelim(); - } - if (m.extension != null && m.extension.length) { - for (var i = 0; i < m.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(m.extension[i], w.uint32(58).fork()).ldelim(); - } - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.FileOptions.encode(m.options, w.uint32(66).fork()).ldelim(); - if (m.sourceCodeInfo != null && Object.hasOwnProperty.call(m, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(m.sourceCodeInfo, w.uint32(74).fork()).ldelim(); - if (m.publicDependency != null && m.publicDependency.length) { - for (var i = 0; i < m.publicDependency.length; ++i) w.uint32(80).int32(m.publicDependency[i]); - } - if (m.weakDependency != null && m.weakDependency.length) { - for (var i = 0; i < m.weakDependency.length; ++i) w.uint32(88).int32(m.weakDependency[i]); - } - if (m.syntax != null && Object.hasOwnProperty.call(m, "syntax")) w.uint32(98).string(m.syntax); - return w; - }; - FileDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.FileDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - m["package"] = r.string(); - break; - case 3: - if (!(m.dependency && m.dependency.length)) m.dependency = []; - m.dependency.push(r.string()); - break; - case 10: - if (!(m.publicDependency && m.publicDependency.length)) m.publicDependency = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.publicDependency.push(r.int32()); - } else m.publicDependency.push(r.int32()); - break; - case 11: - if (!(m.weakDependency && m.weakDependency.length)) m.weakDependency = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.weakDependency.push(r.int32()); - } else m.weakDependency.push(r.int32()); - break; - case 4: - if (!(m.messageType && m.messageType.length)) m.messageType = []; - m.messageType.push($root.google.protobuf.DescriptorProto.decode(r, r.uint32())); - break; - case 5: - if (!(m.enumType && m.enumType.length)) m.enumType = []; - m.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(r, r.uint32())); - break; - case 6: - if (!(m.service && m.service.length)) m.service = []; - m.service.push($root.google.protobuf.ServiceDescriptorProto.decode(r, r.uint32())); - break; - case 7: - if (!(m.extension && m.extension.length)) m.extension = []; - m.extension.push($root.google.protobuf.FieldDescriptorProto.decode(r, r.uint32())); - break; - case 8: - m.options = $root.google.protobuf.FileOptions.decode(r, r.uint32()); - break; - case 9: - m.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(r, r.uint32()); - break; - case 12: - m.syntax = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return FileDescriptorProto; - })(); - protobuf.DescriptorProto = (function () { - function DescriptorProto(p) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DescriptorProto.prototype.name = ""; - DescriptorProto.prototype.field = $util.emptyArray; - DescriptorProto.prototype.extension = $util.emptyArray; - DescriptorProto.prototype.nestedType = $util.emptyArray; - DescriptorProto.prototype.enumType = $util.emptyArray; - DescriptorProto.prototype.extensionRange = $util.emptyArray; - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - DescriptorProto.prototype.options = null; - DescriptorProto.prototype.reservedRange = $util.emptyArray; - DescriptorProto.prototype.reservedName = $util.emptyArray; - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - DescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.field != null && m.field.length) { - for (var i = 0; i < m.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(m.field[i], w.uint32(18).fork()).ldelim(); - } - if (m.nestedType != null && m.nestedType.length) { - for (var i = 0; i < m.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(m.nestedType[i], w.uint32(26).fork()).ldelim(); - } - if (m.enumType != null && m.enumType.length) { - for (var i = 0; i < m.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(m.enumType[i], w.uint32(34).fork()).ldelim(); - } - if (m.extensionRange != null && m.extensionRange.length) { - for (var i = 0; i < m.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode( - m.extensionRange[i], - w.uint32(42).fork(), - ).ldelim(); - } - if (m.extension != null && m.extension.length) { - for (var i = 0; i < m.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(m.extension[i], w.uint32(50).fork()).ldelim(); - } - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.MessageOptions.encode(m.options, w.uint32(58).fork()).ldelim(); - if (m.oneofDecl != null && m.oneofDecl.length) { - for (var i = 0; i < m.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(m.oneofDecl[i], w.uint32(66).fork()).ldelim(); - } - if (m.reservedRange != null && m.reservedRange.length) { - for (var i = 0; i < m.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode( - m.reservedRange[i], - w.uint32(74).fork(), - ).ldelim(); - } - if (m.reservedName != null && m.reservedName.length) { - for (var i = 0; i < m.reservedName.length; ++i) w.uint32(82).string(m.reservedName[i]); - } - return w; - }; - DescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.DescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - if (!(m.field && m.field.length)) m.field = []; - m.field.push($root.google.protobuf.FieldDescriptorProto.decode(r, r.uint32())); - break; - case 6: - if (!(m.extension && m.extension.length)) m.extension = []; - m.extension.push($root.google.protobuf.FieldDescriptorProto.decode(r, r.uint32())); - break; - case 3: - if (!(m.nestedType && m.nestedType.length)) m.nestedType = []; - m.nestedType.push($root.google.protobuf.DescriptorProto.decode(r, r.uint32())); - break; - case 4: - if (!(m.enumType && m.enumType.length)) m.enumType = []; - m.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(r, r.uint32())); - break; - case 5: - if (!(m.extensionRange && m.extensionRange.length)) m.extensionRange = []; - m.extensionRange.push( - $root.google.protobuf.DescriptorProto.ExtensionRange.decode(r, r.uint32()), - ); - break; - case 8: - if (!(m.oneofDecl && m.oneofDecl.length)) m.oneofDecl = []; - m.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(r, r.uint32())); - break; - case 7: - m.options = $root.google.protobuf.MessageOptions.decode(r, r.uint32()); - break; - case 9: - if (!(m.reservedRange && m.reservedRange.length)) m.reservedRange = []; - m.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(r, r.uint32())); - break; - case 10: - if (!(m.reservedName && m.reservedName.length)) m.reservedName = []; - m.reservedName.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - DescriptorProto.ExtensionRange = (function () { - function ExtensionRange(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ExtensionRange.prototype.start = 0; - ExtensionRange.prototype.end = 0; - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - ExtensionRange.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.start != null && Object.hasOwnProperty.call(m, "start")) w.uint32(8).int32(m.start); - if (m.end != null && Object.hasOwnProperty.call(m, "end")) w.uint32(16).int32(m.end); - return w; - }; - ExtensionRange.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.start = r.int32(); - break; - case 2: - m.end = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ExtensionRange; - })(); - DescriptorProto.ReservedRange = (function () { - function ReservedRange(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ReservedRange.prototype.start = 0; - ReservedRange.prototype.end = 0; - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - ReservedRange.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.start != null && Object.hasOwnProperty.call(m, "start")) w.uint32(8).int32(m.start); - if (m.end != null && Object.hasOwnProperty.call(m, "end")) w.uint32(16).int32(m.end); - return w; - }; - ReservedRange.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.start = r.int32(); - break; - case 2: - m.end = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ReservedRange; - })(); - return DescriptorProto; - })(); - protobuf.FieldDescriptorProto = (function () { - function FieldDescriptorProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FieldDescriptorProto.prototype.name = ""; - FieldDescriptorProto.prototype.number = 0; - FieldDescriptorProto.prototype.label = 1; - FieldDescriptorProto.prototype.type = 1; - FieldDescriptorProto.prototype.typeName = ""; - FieldDescriptorProto.prototype.extendee = ""; - FieldDescriptorProto.prototype.defaultValue = ""; - FieldDescriptorProto.prototype.oneofIndex = 0; - FieldDescriptorProto.prototype.jsonName = ""; - FieldDescriptorProto.prototype.options = null; - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - FieldDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.extendee != null && Object.hasOwnProperty.call(m, "extendee")) w.uint32(18).string(m.extendee); - if (m.number != null && Object.hasOwnProperty.call(m, "number")) w.uint32(24).int32(m.number); - if (m.label != null && Object.hasOwnProperty.call(m, "label")) w.uint32(32).int32(m.label); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(40).int32(m.type); - if (m.typeName != null && Object.hasOwnProperty.call(m, "typeName")) w.uint32(50).string(m.typeName); - if (m.defaultValue != null && Object.hasOwnProperty.call(m, "defaultValue")) - w.uint32(58).string(m.defaultValue); - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.FieldOptions.encode(m.options, w.uint32(66).fork()).ldelim(); - if (m.oneofIndex != null && Object.hasOwnProperty.call(m, "oneofIndex")) - w.uint32(72).int32(m.oneofIndex); - if (m.jsonName != null && Object.hasOwnProperty.call(m, "jsonName")) w.uint32(82).string(m.jsonName); - return w; - }; - FieldDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.FieldDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 3: - m.number = r.int32(); - break; - case 4: - m.label = r.int32(); - break; - case 5: - m.type = r.int32(); - break; - case 6: - m.typeName = r.string(); - break; - case 2: - m.extendee = r.string(); - break; - case 7: - m.defaultValue = r.string(); - break; - case 9: - m.oneofIndex = r.int32(); - break; - case 10: - m.jsonName = r.string(); - break; - case 8: - m.options = $root.google.protobuf.FieldOptions.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - FieldDescriptorProto.Type = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[1] = "TYPE_DOUBLE")] = 1; - values[(valuesById[2] = "TYPE_FLOAT")] = 2; - values[(valuesById[3] = "TYPE_INT64")] = 3; - values[(valuesById[4] = "TYPE_UINT64")] = 4; - values[(valuesById[5] = "TYPE_INT32")] = 5; - values[(valuesById[6] = "TYPE_FIXED64")] = 6; - values[(valuesById[7] = "TYPE_FIXED32")] = 7; - values[(valuesById[8] = "TYPE_BOOL")] = 8; - values[(valuesById[9] = "TYPE_STRING")] = 9; - values[(valuesById[10] = "TYPE_GROUP")] = 10; - values[(valuesById[11] = "TYPE_MESSAGE")] = 11; - values[(valuesById[12] = "TYPE_BYTES")] = 12; - values[(valuesById[13] = "TYPE_UINT32")] = 13; - values[(valuesById[14] = "TYPE_ENUM")] = 14; - values[(valuesById[15] = "TYPE_SFIXED32")] = 15; - values[(valuesById[16] = "TYPE_SFIXED64")] = 16; - values[(valuesById[17] = "TYPE_SINT32")] = 17; - values[(valuesById[18] = "TYPE_SINT64")] = 18; - return values; - })(); - FieldDescriptorProto.Label = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[1] = "LABEL_OPTIONAL")] = 1; - values[(valuesById[2] = "LABEL_REQUIRED")] = 2; - values[(valuesById[3] = "LABEL_REPEATED")] = 3; - return values; - })(); - return FieldDescriptorProto; - })(); - protobuf.OneofDescriptorProto = (function () { - function OneofDescriptorProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - OneofDescriptorProto.prototype.name = ""; - OneofDescriptorProto.prototype.options = null; - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - OneofDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.OneofOptions.encode(m.options, w.uint32(18).fork()).ldelim(); - return w; - }; - OneofDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.OneofDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - m.options = $root.google.protobuf.OneofOptions.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return OneofDescriptorProto; - })(); - protobuf.EnumDescriptorProto = (function () { - function EnumDescriptorProto(p) { - this.value = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EnumDescriptorProto.prototype.name = ""; - EnumDescriptorProto.prototype.value = $util.emptyArray; - EnumDescriptorProto.prototype.options = null; - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - EnumDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.value != null && m.value.length) { - for (var i = 0; i < m.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(m.value[i], w.uint32(18).fork()).ldelim(); - } - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.EnumOptions.encode(m.options, w.uint32(26).fork()).ldelim(); - return w; - }; - EnumDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.EnumDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - if (!(m.value && m.value.length)) m.value = []; - m.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(r, r.uint32())); - break; - case 3: - m.options = $root.google.protobuf.EnumOptions.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EnumDescriptorProto; - })(); - protobuf.EnumValueDescriptorProto = (function () { - function EnumValueDescriptorProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EnumValueDescriptorProto.prototype.name = ""; - EnumValueDescriptorProto.prototype.number = 0; - EnumValueDescriptorProto.prototype.options = null; - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - EnumValueDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.number != null && Object.hasOwnProperty.call(m, "number")) w.uint32(16).int32(m.number); - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.EnumValueOptions.encode(m.options, w.uint32(26).fork()).ldelim(); - return w; - }; - EnumValueDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.EnumValueDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - m.number = r.int32(); - break; - case 3: - m.options = $root.google.protobuf.EnumValueOptions.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EnumValueDescriptorProto; - })(); - protobuf.ServiceDescriptorProto = (function () { - function ServiceDescriptorProto(p) { - this.method = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ServiceDescriptorProto.prototype.name = ""; - ServiceDescriptorProto.prototype.method = $util.emptyArray; - ServiceDescriptorProto.prototype.options = null; - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - ServiceDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.method != null && m.method.length) { - for (var i = 0; i < m.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(m.method[i], w.uint32(18).fork()).ldelim(); - } - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.ServiceOptions.encode(m.options, w.uint32(26).fork()).ldelim(); - return w; - }; - ServiceDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.ServiceDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - if (!(m.method && m.method.length)) m.method = []; - m.method.push($root.google.protobuf.MethodDescriptorProto.decode(r, r.uint32())); - break; - case 3: - m.options = $root.google.protobuf.ServiceOptions.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ServiceDescriptorProto; - })(); - protobuf.MethodDescriptorProto = (function () { - function MethodDescriptorProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MethodDescriptorProto.prototype.name = ""; - MethodDescriptorProto.prototype.inputType = ""; - MethodDescriptorProto.prototype.outputType = ""; - MethodDescriptorProto.prototype.options = null; - MethodDescriptorProto.prototype.clientStreaming = false; - MethodDescriptorProto.prototype.serverStreaming = false; - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - MethodDescriptorProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(10).string(m.name); - if (m.inputType != null && Object.hasOwnProperty.call(m, "inputType")) - w.uint32(18).string(m.inputType); - if (m.outputType != null && Object.hasOwnProperty.call(m, "outputType")) - w.uint32(26).string(m.outputType); - if (m.options != null && Object.hasOwnProperty.call(m, "options")) - $root.google.protobuf.MethodOptions.encode(m.options, w.uint32(34).fork()).ldelim(); - if (m.clientStreaming != null && Object.hasOwnProperty.call(m, "clientStreaming")) - w.uint32(40).bool(m.clientStreaming); - if (m.serverStreaming != null && Object.hasOwnProperty.call(m, "serverStreaming")) - w.uint32(48).bool(m.serverStreaming); - return w; - }; - MethodDescriptorProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.MethodDescriptorProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.name = r.string(); - break; - case 2: - m.inputType = r.string(); - break; - case 3: - m.outputType = r.string(); - break; - case 4: - m.options = $root.google.protobuf.MethodOptions.decode(r, r.uint32()); - break; - case 5: - m.clientStreaming = r.bool(); - break; - case 6: - m.serverStreaming = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MethodDescriptorProto; - })(); - protobuf.FileOptions = (function () { - function FileOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FileOptions.prototype.javaPackage = ""; - FileOptions.prototype.javaOuterClassname = ""; - FileOptions.prototype.javaMultipleFiles = false; - FileOptions.prototype.javaGenerateEqualsAndHash = false; - FileOptions.prototype.javaStringCheckUtf8 = false; - FileOptions.prototype.optimizeFor = 1; - FileOptions.prototype.goPackage = ""; - FileOptions.prototype.ccGenericServices = false; - FileOptions.prototype.javaGenericServices = false; - FileOptions.prototype.pyGenericServices = false; - FileOptions.prototype.deprecated = false; - FileOptions.prototype.ccEnableArenas = false; - FileOptions.prototype.objcClassPrefix = ""; - FileOptions.prototype.csharpNamespace = ""; - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - FileOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.javaPackage != null && Object.hasOwnProperty.call(m, "javaPackage")) - w.uint32(10).string(m.javaPackage); - if (m.javaOuterClassname != null && Object.hasOwnProperty.call(m, "javaOuterClassname")) - w.uint32(66).string(m.javaOuterClassname); - if (m.optimizeFor != null && Object.hasOwnProperty.call(m, "optimizeFor")) - w.uint32(72).int32(m.optimizeFor); - if (m.javaMultipleFiles != null && Object.hasOwnProperty.call(m, "javaMultipleFiles")) - w.uint32(80).bool(m.javaMultipleFiles); - if (m.goPackage != null && Object.hasOwnProperty.call(m, "goPackage")) - w.uint32(90).string(m.goPackage); - if (m.ccGenericServices != null && Object.hasOwnProperty.call(m, "ccGenericServices")) - w.uint32(128).bool(m.ccGenericServices); - if (m.javaGenericServices != null && Object.hasOwnProperty.call(m, "javaGenericServices")) - w.uint32(136).bool(m.javaGenericServices); - if (m.pyGenericServices != null && Object.hasOwnProperty.call(m, "pyGenericServices")) - w.uint32(144).bool(m.pyGenericServices); - if (m.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(m, "javaGenerateEqualsAndHash")) - w.uint32(160).bool(m.javaGenerateEqualsAndHash); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(184).bool(m.deprecated); - if (m.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(m, "javaStringCheckUtf8")) - w.uint32(216).bool(m.javaStringCheckUtf8); - if (m.ccEnableArenas != null && Object.hasOwnProperty.call(m, "ccEnableArenas")) - w.uint32(248).bool(m.ccEnableArenas); - if (m.objcClassPrefix != null && Object.hasOwnProperty.call(m, "objcClassPrefix")) - w.uint32(290).string(m.objcClassPrefix); - if (m.csharpNamespace != null && Object.hasOwnProperty.call(m, "csharpNamespace")) - w.uint32(298).string(m.csharpNamespace); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - FileOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.FileOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.javaPackage = r.string(); - break; - case 8: - m.javaOuterClassname = r.string(); - break; - case 10: - m.javaMultipleFiles = r.bool(); - break; - case 20: - m.javaGenerateEqualsAndHash = r.bool(); - break; - case 27: - m.javaStringCheckUtf8 = r.bool(); - break; - case 9: - m.optimizeFor = r.int32(); - break; - case 11: - m.goPackage = r.string(); - break; - case 16: - m.ccGenericServices = r.bool(); - break; - case 17: - m.javaGenericServices = r.bool(); - break; - case 18: - m.pyGenericServices = r.bool(); - break; - case 23: - m.deprecated = r.bool(); - break; - case 31: - m.ccEnableArenas = r.bool(); - break; - case 36: - m.objcClassPrefix = r.string(); - break; - case 37: - m.csharpNamespace = r.string(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - FileOptions.OptimizeMode = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[1] = "SPEED")] = 1; - values[(valuesById[2] = "CODE_SIZE")] = 2; - values[(valuesById[3] = "LITE_RUNTIME")] = 3; - return values; - })(); - return FileOptions; - })(); - protobuf.MessageOptions = (function () { - function MessageOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MessageOptions.prototype.messageSetWireFormat = false; - MessageOptions.prototype.noStandardDescriptorAccessor = false; - MessageOptions.prototype.deprecated = false; - MessageOptions.prototype.mapEntry = false; - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - MessageOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.messageSetWireFormat != null && Object.hasOwnProperty.call(m, "messageSetWireFormat")) - w.uint32(8).bool(m.messageSetWireFormat); - if ( - m.noStandardDescriptorAccessor != null && - Object.hasOwnProperty.call(m, "noStandardDescriptorAccessor") - ) - w.uint32(16).bool(m.noStandardDescriptorAccessor); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(24).bool(m.deprecated); - if (m.mapEntry != null && Object.hasOwnProperty.call(m, "mapEntry")) w.uint32(56).bool(m.mapEntry); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - MessageOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.MessageOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.messageSetWireFormat = r.bool(); - break; - case 2: - m.noStandardDescriptorAccessor = r.bool(); - break; - case 3: - m.deprecated = r.bool(); - break; - case 7: - m.mapEntry = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MessageOptions; - })(); - protobuf.FieldOptions = (function () { - function FieldOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - FieldOptions.prototype.ctype = 0; - FieldOptions.prototype.packed = false; - FieldOptions.prototype.jstype = 0; - FieldOptions.prototype.lazy = false; - FieldOptions.prototype.deprecated = false; - FieldOptions.prototype.weak = false; - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - FieldOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.ctype != null && Object.hasOwnProperty.call(m, "ctype")) w.uint32(8).int32(m.ctype); - if (m.packed != null && Object.hasOwnProperty.call(m, "packed")) w.uint32(16).bool(m.packed); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(24).bool(m.deprecated); - if (m.lazy != null && Object.hasOwnProperty.call(m, "lazy")) w.uint32(40).bool(m.lazy); - if (m.jstype != null && Object.hasOwnProperty.call(m, "jstype")) w.uint32(48).int32(m.jstype); - if (m.weak != null && Object.hasOwnProperty.call(m, "weak")) w.uint32(80).bool(m.weak); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - FieldOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.FieldOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.ctype = r.int32(); - break; - case 2: - m.packed = r.bool(); - break; - case 6: - m.jstype = r.int32(); - break; - case 5: - m.lazy = r.bool(); - break; - case 3: - m.deprecated = r.bool(); - break; - case 10: - m.weak = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - FieldOptions.CType = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "STRING")] = 0; - values[(valuesById[1] = "CORD")] = 1; - values[(valuesById[2] = "STRING_PIECE")] = 2; - return values; - })(); - FieldOptions.JSType = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "JS_NORMAL")] = 0; - values[(valuesById[1] = "JS_STRING")] = 1; - values[(valuesById[2] = "JS_NUMBER")] = 2; - return values; - })(); - return FieldOptions; - })(); - protobuf.OneofOptions = (function () { - function OneofOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - OneofOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - OneofOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.OneofOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return OneofOptions; - })(); - protobuf.EnumOptions = (function () { - function EnumOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EnumOptions.prototype.allowAlias = false; - EnumOptions.prototype.deprecated = false; - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - EnumOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.allowAlias != null && Object.hasOwnProperty.call(m, "allowAlias")) - w.uint32(16).bool(m.allowAlias); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(24).bool(m.deprecated); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - EnumOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.EnumOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 2: - m.allowAlias = r.bool(); - break; - case 3: - m.deprecated = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EnumOptions; - })(); - protobuf.EnumValueOptions = (function () { - function EnumValueOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EnumValueOptions.prototype.deprecated = false; - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - EnumValueOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(8).bool(m.deprecated); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - EnumValueOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.EnumValueOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.deprecated = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EnumValueOptions; - })(); - protobuf.ServiceOptions = (function () { - function ServiceOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ServiceOptions.prototype.deprecated = false; - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - ServiceOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(264).bool(m.deprecated); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - return w; - }; - ServiceOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.ServiceOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 33: - m.deprecated = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ServiceOptions; - })(); - protobuf.MethodOptions = (function () { - function MethodOptions(p) { - this.uninterpretedOption = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MethodOptions.prototype.deprecated = false; - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - MethodOptions.prototype[".google.api.http"] = null; - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - MethodOptions.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.deprecated != null && Object.hasOwnProperty.call(m, "deprecated")) - w.uint32(264).bool(m.deprecated); - if (m.uninterpretedOption != null && m.uninterpretedOption.length) { - for (var i = 0; i < m.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode( - m.uninterpretedOption[i], - w.uint32(7994).fork(), - ).ldelim(); - } - if (m[".google.api.http"] != null && Object.hasOwnProperty.call(m, ".google.api.http")) - $root.google.api.HttpRule.encode(m[".google.api.http"], w.uint32(578365826).fork()).ldelim(); - return w; - }; - MethodOptions.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.MethodOptions(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 33: - m.deprecated = r.bool(); - break; - case 999: - if (!(m.uninterpretedOption && m.uninterpretedOption.length)) m.uninterpretedOption = []; - m.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(r, r.uint32())); - break; - case 72295728: - m[".google.api.http"] = $root.google.api.HttpRule.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MethodOptions; - })(); - protobuf.UninterpretedOption = (function () { - function UninterpretedOption(p) { - this.name = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - UninterpretedOption.prototype.name = $util.emptyArray; - UninterpretedOption.prototype.identifierValue = ""; - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - UninterpretedOption.prototype.doubleValue = 0; - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - UninterpretedOption.prototype.aggregateValue = ""; - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - UninterpretedOption.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.name != null && m.name.length) { - for (var i = 0; i < m.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode( - m.name[i], - w.uint32(18).fork(), - ).ldelim(); - } - if (m.identifierValue != null && Object.hasOwnProperty.call(m, "identifierValue")) - w.uint32(26).string(m.identifierValue); - if (m.positiveIntValue != null && Object.hasOwnProperty.call(m, "positiveIntValue")) - w.uint32(32).uint64(m.positiveIntValue); - if (m.negativeIntValue != null && Object.hasOwnProperty.call(m, "negativeIntValue")) - w.uint32(40).int64(m.negativeIntValue); - if (m.doubleValue != null && Object.hasOwnProperty.call(m, "doubleValue")) - w.uint32(49).double(m.doubleValue); - if (m.stringValue != null && Object.hasOwnProperty.call(m, "stringValue")) - w.uint32(58).bytes(m.stringValue); - if (m.aggregateValue != null && Object.hasOwnProperty.call(m, "aggregateValue")) - w.uint32(66).string(m.aggregateValue); - return w; - }; - UninterpretedOption.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.UninterpretedOption(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 2: - if (!(m.name && m.name.length)) m.name = []; - m.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(r, r.uint32())); - break; - case 3: - m.identifierValue = r.string(); - break; - case 4: - m.positiveIntValue = r.uint64(); - break; - case 5: - m.negativeIntValue = r.int64(); - break; - case 6: - m.doubleValue = r.double(); - break; - case 7: - m.stringValue = r.bytes(); - break; - case 8: - m.aggregateValue = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - UninterpretedOption.NamePart = (function () { - function NamePart(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - NamePart.prototype.namePart = ""; - NamePart.prototype.isExtension = false; - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - NamePart.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - w.uint32(10).string(m.namePart); - w.uint32(16).bool(m.isExtension); - return w; - }; - NamePart.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.namePart = r.string(); - break; - case 2: - m.isExtension = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: m }); - if (!m.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: m }); - return m; - }; - return NamePart; - })(); - return UninterpretedOption; - })(); - protobuf.SourceCodeInfo = (function () { - function SourceCodeInfo(p) { - this.location = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SourceCodeInfo.prototype.location = $util.emptyArray; - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - SourceCodeInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.location != null && m.location.length) { - for (var i = 0; i < m.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(m.location[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - SourceCodeInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.SourceCodeInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.location && m.location.length)) m.location = []; - m.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - SourceCodeInfo.Location = (function () { - function Location(p) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Location.prototype.path = $util.emptyArray; - Location.prototype.span = $util.emptyArray; - Location.prototype.leadingComments = ""; - Location.prototype.trailingComments = ""; - Location.prototype.leadingDetachedComments = $util.emptyArray; - Location.create = function create(properties) { - return new Location(properties); - }; - Location.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.path != null && m.path.length) { - w.uint32(10).fork(); - for (var i = 0; i < m.path.length; ++i) w.int32(m.path[i]); - w.ldelim(); - } - if (m.span != null && m.span.length) { - w.uint32(18).fork(); - for (var i = 0; i < m.span.length; ++i) w.int32(m.span[i]); - w.ldelim(); - } - if (m.leadingComments != null && Object.hasOwnProperty.call(m, "leadingComments")) - w.uint32(26).string(m.leadingComments); - if (m.trailingComments != null && Object.hasOwnProperty.call(m, "trailingComments")) - w.uint32(34).string(m.trailingComments); - if (m.leadingDetachedComments != null && m.leadingDetachedComments.length) { - for (var i = 0; i < m.leadingDetachedComments.length; ++i) - w.uint32(50).string(m.leadingDetachedComments[i]); - } - return w; - }; - Location.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.SourceCodeInfo.Location(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.path && m.path.length)) m.path = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.path.push(r.int32()); - } else m.path.push(r.int32()); - break; - case 2: - if (!(m.span && m.span.length)) m.span = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.span.push(r.int32()); - } else m.span.push(r.int32()); - break; - case 3: - m.leadingComments = r.string(); - break; - case 4: - m.trailingComments = r.string(); - break; - case 6: - if (!(m.leadingDetachedComments && m.leadingDetachedComments.length)) - m.leadingDetachedComments = []; - m.leadingDetachedComments.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Location; - })(); - return SourceCodeInfo; - })(); - protobuf.GeneratedCodeInfo = (function () { - function GeneratedCodeInfo(p) { - this.annotation = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - GeneratedCodeInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.annotation != null && m.annotation.length) { - for (var i = 0; i < m.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode( - m.annotation[i], - w.uint32(10).fork(), - ).ldelim(); - } - return w; - }; - GeneratedCodeInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.GeneratedCodeInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.annotation && m.annotation.length)) m.annotation = []; - m.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - GeneratedCodeInfo.Annotation = (function () { - function Annotation(p) { - this.path = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Annotation.prototype.path = $util.emptyArray; - Annotation.prototype.sourceFile = ""; - Annotation.prototype.begin = 0; - Annotation.prototype.end = 0; - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - Annotation.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.path != null && m.path.length) { - w.uint32(10).fork(); - for (var i = 0; i < m.path.length; ++i) w.int32(m.path[i]); - w.ldelim(); - } - if (m.sourceFile != null && Object.hasOwnProperty.call(m, "sourceFile")) - w.uint32(18).string(m.sourceFile); - if (m.begin != null && Object.hasOwnProperty.call(m, "begin")) w.uint32(24).int32(m.begin); - if (m.end != null && Object.hasOwnProperty.call(m, "end")) w.uint32(32).int32(m.end); - return w; - }; - Annotation.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.path && m.path.length)) m.path = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.path.push(r.int32()); - } else m.path.push(r.int32()); - break; - case 2: - m.sourceFile = r.string(); - break; - case 3: - m.begin = r.int32(); - break; - case 4: - m.end = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Annotation; - })(); - return GeneratedCodeInfo; - })(); - protobuf.Duration = (function () { - function Duration(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Duration.prototype.nanos = 0; - Duration.create = function create(properties) { - return new Duration(properties); - }; - Duration.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) w.uint32(8).int64(m.seconds); - if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) w.uint32(16).int32(m.nanos); - return w; - }; - Duration.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.Duration(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.seconds = r.int64(); - break; - case 2: - m.nanos = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Duration; - })(); - protobuf.Timestamp = (function () { - function Timestamp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Timestamp.prototype.nanos = 0; - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - Timestamp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) w.uint32(8).int64(m.seconds); - if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) w.uint32(16).int32(m.nanos); - return w; - }; - Timestamp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.Timestamp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.seconds = r.int64(); - break; - case 2: - m.nanos = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Timestamp; - })(); - return protobuf; - })(); - google.api = (function () { - const api = {}; - api.Http = (function () { - function Http(p) { - this.rules = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Http.prototype.rules = $util.emptyArray; - Http.create = function create(properties) { - return new Http(properties); - }; - Http.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rules != null && m.rules.length) { - for (var i = 0; i < m.rules.length; ++i) - $root.google.api.HttpRule.encode(m.rules[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - Http.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.api.Http(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.rules && m.rules.length)) m.rules = []; - m.rules.push($root.google.api.HttpRule.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Http; - })(); - api.HttpRule = (function () { - function HttpRule(p) { - this.additionalBindings = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - HttpRule.prototype.get = ""; - HttpRule.prototype.put = ""; - HttpRule.prototype.post = ""; - HttpRule.prototype["delete"] = ""; - HttpRule.prototype.patch = ""; - HttpRule.prototype.custom = null; - HttpRule.prototype.selector = ""; - HttpRule.prototype.body = ""; - HttpRule.prototype.additionalBindings = $util.emptyArray; - let $oneOfFields; - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter(($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"])), - set: $util.oneOfSetter($oneOfFields), - }); - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - HttpRule.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.selector != null && Object.hasOwnProperty.call(m, "selector")) w.uint32(10).string(m.selector); - if (m.get != null && Object.hasOwnProperty.call(m, "get")) w.uint32(18).string(m.get); - if (m.put != null && Object.hasOwnProperty.call(m, "put")) w.uint32(26).string(m.put); - if (m.post != null && Object.hasOwnProperty.call(m, "post")) w.uint32(34).string(m.post); - if (m["delete"] != null && Object.hasOwnProperty.call(m, "delete")) w.uint32(42).string(m["delete"]); - if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) w.uint32(50).string(m.patch); - if (m.body != null && Object.hasOwnProperty.call(m, "body")) w.uint32(58).string(m.body); - if (m.custom != null && Object.hasOwnProperty.call(m, "custom")) - $root.google.api.CustomHttpPattern.encode(m.custom, w.uint32(66).fork()).ldelim(); - if (m.additionalBindings != null && m.additionalBindings.length) { - for (var i = 0; i < m.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(m.additionalBindings[i], w.uint32(90).fork()).ldelim(); - } - return w; - }; - HttpRule.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.api.HttpRule(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 2: - m.get = r.string(); - break; - case 3: - m.put = r.string(); - break; - case 4: - m.post = r.string(); - break; - case 5: - m["delete"] = r.string(); - break; - case 6: - m.patch = r.string(); - break; - case 8: - m.custom = $root.google.api.CustomHttpPattern.decode(r, r.uint32()); - break; - case 1: - m.selector = r.string(); - break; - case 7: - m.body = r.string(); - break; - case 11: - if (!(m.additionalBindings && m.additionalBindings.length)) m.additionalBindings = []; - m.additionalBindings.push($root.google.api.HttpRule.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return HttpRule; - })(); - api.CustomHttpPattern = (function () { - function CustomHttpPattern(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CustomHttpPattern.prototype.kind = ""; - CustomHttpPattern.prototype.path = ""; - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - CustomHttpPattern.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.kind != null && Object.hasOwnProperty.call(m, "kind")) w.uint32(10).string(m.kind); - if (m.path != null && Object.hasOwnProperty.call(m, "path")) w.uint32(18).string(m.path); - return w; - }; - CustomHttpPattern.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.api.CustomHttpPattern(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.kind = r.string(); - break; - case 2: - m.path = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CustomHttpPattern; - })(); - return api; - })(); - return google; -})(); -exports.ibc = $root.ibc = (() => { - const ibc = {}; - ibc.core = (function () { - const core = {}; - core.channel = (function () { - const channel = {}; - channel.v1 = (function () { - const v1 = {}; - v1.Channel = (function () { - function Channel(p) { - this.connectionHops = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Channel.prototype.state = 0; - Channel.prototype.ordering = 0; - Channel.prototype.counterparty = null; - Channel.prototype.connectionHops = $util.emptyArray; - Channel.prototype.version = ""; - Channel.create = function create(properties) { - return new Channel(properties); - }; - Channel.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.state != null && Object.hasOwnProperty.call(m, "state")) w.uint32(8).int32(m.state); - if (m.ordering != null && Object.hasOwnProperty.call(m, "ordering")) - w.uint32(16).int32(m.ordering); - if (m.counterparty != null && Object.hasOwnProperty.call(m, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(m.counterparty, w.uint32(26).fork()).ldelim(); - if (m.connectionHops != null && m.connectionHops.length) { - for (var i = 0; i < m.connectionHops.length; ++i) w.uint32(34).string(m.connectionHops[i]); - } - if (m.version != null && Object.hasOwnProperty.call(m, "version")) w.uint32(42).string(m.version); - return w; - }; - Channel.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.Channel(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.state = r.int32(); - break; - case 2: - m.ordering = r.int32(); - break; - case 3: - m.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(r, r.uint32()); - break; - case 4: - if (!(m.connectionHops && m.connectionHops.length)) m.connectionHops = []; - m.connectionHops.push(r.string()); - break; - case 5: - m.version = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Channel; - })(); - v1.IdentifiedChannel = (function () { - function IdentifiedChannel(p) { - this.connectionHops = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - IdentifiedChannel.prototype.state = 0; - IdentifiedChannel.prototype.ordering = 0; - IdentifiedChannel.prototype.counterparty = null; - IdentifiedChannel.prototype.connectionHops = $util.emptyArray; - IdentifiedChannel.prototype.version = ""; - IdentifiedChannel.prototype.portId = ""; - IdentifiedChannel.prototype.channelId = ""; - IdentifiedChannel.create = function create(properties) { - return new IdentifiedChannel(properties); - }; - IdentifiedChannel.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.state != null && Object.hasOwnProperty.call(m, "state")) w.uint32(8).int32(m.state); - if (m.ordering != null && Object.hasOwnProperty.call(m, "ordering")) - w.uint32(16).int32(m.ordering); - if (m.counterparty != null && Object.hasOwnProperty.call(m, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(m.counterparty, w.uint32(26).fork()).ldelim(); - if (m.connectionHops != null && m.connectionHops.length) { - for (var i = 0; i < m.connectionHops.length; ++i) w.uint32(34).string(m.connectionHops[i]); - } - if (m.version != null && Object.hasOwnProperty.call(m, "version")) w.uint32(42).string(m.version); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(50).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(58).string(m.channelId); - return w; - }; - IdentifiedChannel.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.IdentifiedChannel(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.state = r.int32(); - break; - case 2: - m.ordering = r.int32(); - break; - case 3: - m.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(r, r.uint32()); - break; - case 4: - if (!(m.connectionHops && m.connectionHops.length)) m.connectionHops = []; - m.connectionHops.push(r.string()); - break; - case 5: - m.version = r.string(); - break; - case 6: - m.portId = r.string(); - break; - case 7: - m.channelId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return IdentifiedChannel; - })(); - v1.State = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED")] = 0; - values[(valuesById[1] = "STATE_INIT")] = 1; - values[(valuesById[2] = "STATE_TRYOPEN")] = 2; - values[(valuesById[3] = "STATE_OPEN")] = 3; - values[(valuesById[4] = "STATE_CLOSED")] = 4; - return values; - })(); - v1.Order = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "ORDER_NONE_UNSPECIFIED")] = 0; - values[(valuesById[1] = "ORDER_UNORDERED")] = 1; - values[(valuesById[2] = "ORDER_ORDERED")] = 2; - return values; - })(); - v1.Counterparty = (function () { - function Counterparty(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Counterparty.prototype.portId = ""; - Counterparty.prototype.channelId = ""; - Counterparty.create = function create(properties) { - return new Counterparty(properties); - }; - Counterparty.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - return w; - }; - Counterparty.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.Counterparty(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Counterparty; - })(); - v1.Packet = (function () { - function Packet(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Packet.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Packet.prototype.sourcePort = ""; - Packet.prototype.sourceChannel = ""; - Packet.prototype.destinationPort = ""; - Packet.prototype.destinationChannel = ""; - Packet.prototype.data = $util.newBuffer([]); - Packet.prototype.timeoutHeight = null; - Packet.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Packet.create = function create(properties) { - return new Packet(properties); - }; - Packet.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(8).uint64(m.sequence); - if (m.sourcePort != null && Object.hasOwnProperty.call(m, "sourcePort")) - w.uint32(18).string(m.sourcePort); - if (m.sourceChannel != null && Object.hasOwnProperty.call(m, "sourceChannel")) - w.uint32(26).string(m.sourceChannel); - if (m.destinationPort != null && Object.hasOwnProperty.call(m, "destinationPort")) - w.uint32(34).string(m.destinationPort); - if (m.destinationChannel != null && Object.hasOwnProperty.call(m, "destinationChannel")) - w.uint32(42).string(m.destinationChannel); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(50).bytes(m.data); - if (m.timeoutHeight != null && Object.hasOwnProperty.call(m, "timeoutHeight")) - $root.ibc.core.client.v1.Height.encode(m.timeoutHeight, w.uint32(58).fork()).ldelim(); - if (m.timeoutTimestamp != null && Object.hasOwnProperty.call(m, "timeoutTimestamp")) - w.uint32(64).uint64(m.timeoutTimestamp); - return w; - }; - Packet.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.Packet(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.sequence = r.uint64(); - break; - case 2: - m.sourcePort = r.string(); - break; - case 3: - m.sourceChannel = r.string(); - break; - case 4: - m.destinationPort = r.string(); - break; - case 5: - m.destinationChannel = r.string(); - break; - case 6: - m.data = r.bytes(); - break; - case 7: - m.timeoutHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - case 8: - m.timeoutTimestamp = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Packet; - })(); - v1.PacketState = (function () { - function PacketState(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PacketState.prototype.portId = ""; - PacketState.prototype.channelId = ""; - PacketState.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - PacketState.prototype.data = $util.newBuffer([]); - PacketState.create = function create(properties) { - return new PacketState(properties); - }; - PacketState.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(34).bytes(m.data); - return w; - }; - PacketState.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.PacketState(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.sequence = r.uint64(); - break; - case 4: - m.data = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PacketState; - })(); - v1.Acknowledgement = (function () { - function Acknowledgement(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Acknowledgement.prototype.result = $util.newBuffer([]); - Acknowledgement.prototype.error = ""; - let $oneOfFields; - Object.defineProperty(Acknowledgement.prototype, "response", { - get: $util.oneOfGetter(($oneOfFields = ["result", "error"])), - set: $util.oneOfSetter($oneOfFields), - }); - Acknowledgement.create = function create(properties) { - return new Acknowledgement(properties); - }; - Acknowledgement.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.result != null && Object.hasOwnProperty.call(m, "result")) w.uint32(170).bytes(m.result); - if (m.error != null && Object.hasOwnProperty.call(m, "error")) w.uint32(178).string(m.error); - return w; - }; - Acknowledgement.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.Acknowledgement(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 21: - m.result = r.bytes(); - break; - case 22: - m.error = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Acknowledgement; - })(); - v1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.channel = function channel(request, callback) { - return this.rpcCall( - channel, - $root.ibc.core.channel.v1.QueryChannelRequest, - $root.ibc.core.channel.v1.QueryChannelResponse, - request, - callback, - ); - }), - "name", - { value: "Channel" }, - ); - Object.defineProperty( - (Query.prototype.channels = function channels(request, callback) { - return this.rpcCall( - channels, - $root.ibc.core.channel.v1.QueryChannelsRequest, - $root.ibc.core.channel.v1.QueryChannelsResponse, - request, - callback, - ); - }), - "name", - { value: "Channels" }, - ); - Object.defineProperty( - (Query.prototype.connectionChannels = function connectionChannels(request, callback) { - return this.rpcCall( - connectionChannels, - $root.ibc.core.channel.v1.QueryConnectionChannelsRequest, - $root.ibc.core.channel.v1.QueryConnectionChannelsResponse, - request, - callback, - ); - }), - "name", - { value: "ConnectionChannels" }, - ); - Object.defineProperty( - (Query.prototype.channelClientState = function channelClientState(request, callback) { - return this.rpcCall( - channelClientState, - $root.ibc.core.channel.v1.QueryChannelClientStateRequest, - $root.ibc.core.channel.v1.QueryChannelClientStateResponse, - request, - callback, - ); - }), - "name", - { value: "ChannelClientState" }, - ); - Object.defineProperty( - (Query.prototype.channelConsensusState = function channelConsensusState(request, callback) { - return this.rpcCall( - channelConsensusState, - $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest, - $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse, - request, - callback, - ); - }), - "name", - { value: "ChannelConsensusState" }, - ); - Object.defineProperty( - (Query.prototype.packetCommitment = function packetCommitment(request, callback) { - return this.rpcCall( - packetCommitment, - $root.ibc.core.channel.v1.QueryPacketCommitmentRequest, - $root.ibc.core.channel.v1.QueryPacketCommitmentResponse, - request, - callback, - ); - }), - "name", - { value: "PacketCommitment" }, - ); - Object.defineProperty( - (Query.prototype.packetCommitments = function packetCommitments(request, callback) { - return this.rpcCall( - packetCommitments, - $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest, - $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse, - request, - callback, - ); - }), - "name", - { value: "PacketCommitments" }, - ); - Object.defineProperty( - (Query.prototype.packetReceipt = function packetReceipt(request, callback) { - return this.rpcCall( - packetReceipt, - $root.ibc.core.channel.v1.QueryPacketReceiptRequest, - $root.ibc.core.channel.v1.QueryPacketReceiptResponse, - request, - callback, - ); - }), - "name", - { value: "PacketReceipt" }, - ); - Object.defineProperty( - (Query.prototype.packetAcknowledgement = function packetAcknowledgement(request, callback) { - return this.rpcCall( - packetAcknowledgement, - $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest, - $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse, - request, - callback, - ); - }), - "name", - { value: "PacketAcknowledgement" }, - ); - Object.defineProperty( - (Query.prototype.packetAcknowledgements = function packetAcknowledgements(request, callback) { - return this.rpcCall( - packetAcknowledgements, - $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest, - $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, - request, - callback, - ); - }), - "name", - { value: "PacketAcknowledgements" }, - ); - Object.defineProperty( - (Query.prototype.unreceivedPackets = function unreceivedPackets(request, callback) { - return this.rpcCall( - unreceivedPackets, - $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest, - $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse, - request, - callback, - ); - }), - "name", - { value: "UnreceivedPackets" }, - ); - Object.defineProperty( - (Query.prototype.unreceivedAcks = function unreceivedAcks(request, callback) { - return this.rpcCall( - unreceivedAcks, - $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest, - $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse, - request, - callback, - ); - }), - "name", - { value: "UnreceivedAcks" }, - ); - Object.defineProperty( - (Query.prototype.nextSequenceReceive = function nextSequenceReceive(request, callback) { - return this.rpcCall( - nextSequenceReceive, - $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest, - $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse, - request, - callback, - ); - }), - "name", - { value: "NextSequenceReceive" }, - ); - return Query; - })(); - v1.QueryChannelRequest = (function () { - function QueryChannelRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelRequest.prototype.portId = ""; - QueryChannelRequest.prototype.channelId = ""; - QueryChannelRequest.create = function create(properties) { - return new QueryChannelRequest(properties); - }; - QueryChannelRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - return w; - }; - QueryChannelRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelRequest; - })(); - v1.QueryChannelResponse = (function () { - function QueryChannelResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelResponse.prototype.channel = null; - QueryChannelResponse.prototype.proof = $util.newBuffer([]); - QueryChannelResponse.prototype.proofHeight = null; - QueryChannelResponse.create = function create(properties) { - return new QueryChannelResponse(properties); - }; - QueryChannelResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.channel != null && Object.hasOwnProperty.call(m, "channel")) - $root.ibc.core.channel.v1.Channel.encode(m.channel, w.uint32(10).fork()).ldelim(); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryChannelResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.channel = $root.ibc.core.channel.v1.Channel.decode(r, r.uint32()); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelResponse; - })(); - v1.QueryChannelsRequest = (function () { - function QueryChannelsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelsRequest.prototype.pagination = null; - QueryChannelsRequest.create = function create(properties) { - return new QueryChannelsRequest(properties); - }; - QueryChannelsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryChannelsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelsRequest; - })(); - v1.QueryChannelsResponse = (function () { - function QueryChannelsResponse(p) { - this.channels = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelsResponse.prototype.channels = $util.emptyArray; - QueryChannelsResponse.prototype.pagination = null; - QueryChannelsResponse.prototype.height = null; - QueryChannelsResponse.create = function create(properties) { - return new QueryChannelsResponse(properties); - }; - QueryChannelsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.channels != null && m.channels.length) { - for (var i = 0; i < m.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode( - m.channels[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryChannelsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.channels && m.channels.length)) m.channels = []; - m.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - case 3: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelsResponse; - })(); - v1.QueryConnectionChannelsRequest = (function () { - function QueryConnectionChannelsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionChannelsRequest.prototype.connection = ""; - QueryConnectionChannelsRequest.prototype.pagination = null; - QueryConnectionChannelsRequest.create = function create(properties) { - return new QueryConnectionChannelsRequest(properties); - }; - QueryConnectionChannelsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connection != null && Object.hasOwnProperty.call(m, "connection")) - w.uint32(10).string(m.connection); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryConnectionChannelsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.connection = r.string(); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionChannelsRequest; - })(); - v1.QueryConnectionChannelsResponse = (function () { - function QueryConnectionChannelsResponse(p) { - this.channels = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionChannelsResponse.prototype.channels = $util.emptyArray; - QueryConnectionChannelsResponse.prototype.pagination = null; - QueryConnectionChannelsResponse.prototype.height = null; - QueryConnectionChannelsResponse.create = function create(properties) { - return new QueryConnectionChannelsResponse(properties); - }; - QueryConnectionChannelsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.channels != null && m.channels.length) { - for (var i = 0; i < m.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode( - m.channels[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryConnectionChannelsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.channels && m.channels.length)) m.channels = []; - m.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - case 3: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionChannelsResponse; - })(); - v1.QueryChannelClientStateRequest = (function () { - function QueryChannelClientStateRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelClientStateRequest.prototype.portId = ""; - QueryChannelClientStateRequest.prototype.channelId = ""; - QueryChannelClientStateRequest.create = function create(properties) { - return new QueryChannelClientStateRequest(properties); - }; - QueryChannelClientStateRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - return w; - }; - QueryChannelClientStateRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelClientStateRequest; - })(); - v1.QueryChannelClientStateResponse = (function () { - function QueryChannelClientStateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelClientStateResponse.prototype.identifiedClientState = null; - QueryChannelClientStateResponse.prototype.proof = $util.newBuffer([]); - QueryChannelClientStateResponse.prototype.proofHeight = null; - QueryChannelClientStateResponse.create = function create(properties) { - return new QueryChannelClientStateResponse(properties); - }; - QueryChannelClientStateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.identifiedClientState != null && Object.hasOwnProperty.call(m, "identifiedClientState")) - $root.ibc.core.client.v1.IdentifiedClientState.encode( - m.identifiedClientState, - w.uint32(10).fork(), - ).ldelim(); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryChannelClientStateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.decode( - r, - r.uint32(), - ); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelClientStateResponse; - })(); - v1.QueryChannelConsensusStateRequest = (function () { - function QueryChannelConsensusStateRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelConsensusStateRequest.prototype.portId = ""; - QueryChannelConsensusStateRequest.prototype.channelId = ""; - QueryChannelConsensusStateRequest.prototype.revisionNumber = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryChannelConsensusStateRequest.prototype.revisionHeight = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryChannelConsensusStateRequest.create = function create(properties) { - return new QueryChannelConsensusStateRequest(properties); - }; - QueryChannelConsensusStateRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.revisionNumber != null && Object.hasOwnProperty.call(m, "revisionNumber")) - w.uint32(24).uint64(m.revisionNumber); - if (m.revisionHeight != null && Object.hasOwnProperty.call(m, "revisionHeight")) - w.uint32(32).uint64(m.revisionHeight); - return w; - }; - QueryChannelConsensusStateRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.revisionNumber = r.uint64(); - break; - case 4: - m.revisionHeight = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelConsensusStateRequest; - })(); - v1.QueryChannelConsensusStateResponse = (function () { - function QueryChannelConsensusStateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryChannelConsensusStateResponse.prototype.consensusState = null; - QueryChannelConsensusStateResponse.prototype.clientId = ""; - QueryChannelConsensusStateResponse.prototype.proof = $util.newBuffer([]); - QueryChannelConsensusStateResponse.prototype.proofHeight = null; - QueryChannelConsensusStateResponse.create = function create(properties) { - return new QueryChannelConsensusStateResponse(properties); - }; - QueryChannelConsensusStateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.consensusState != null && Object.hasOwnProperty.call(m, "consensusState")) - $root.google.protobuf.Any.encode(m.consensusState, w.uint32(10).fork()).ldelim(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(18).string(m.clientId); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(26).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(34).fork()).ldelim(); - return w; - }; - QueryChannelConsensusStateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.consensusState = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.clientId = r.string(); - break; - case 3: - m.proof = r.bytes(); - break; - case 4: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryChannelConsensusStateResponse; - })(); - v1.QueryPacketCommitmentRequest = (function () { - function QueryPacketCommitmentRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketCommitmentRequest.prototype.portId = ""; - QueryPacketCommitmentRequest.prototype.channelId = ""; - QueryPacketCommitmentRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - QueryPacketCommitmentRequest.create = function create(properties) { - return new QueryPacketCommitmentRequest(properties); - }; - QueryPacketCommitmentRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - QueryPacketCommitmentRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketCommitmentRequest; - })(); - v1.QueryPacketCommitmentResponse = (function () { - function QueryPacketCommitmentResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketCommitmentResponse.prototype.commitment = $util.newBuffer([]); - QueryPacketCommitmentResponse.prototype.proof = $util.newBuffer([]); - QueryPacketCommitmentResponse.prototype.proofHeight = null; - QueryPacketCommitmentResponse.create = function create(properties) { - return new QueryPacketCommitmentResponse(properties); - }; - QueryPacketCommitmentResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.commitment != null && Object.hasOwnProperty.call(m, "commitment")) - w.uint32(10).bytes(m.commitment); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketCommitmentResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.commitment = r.bytes(); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketCommitmentResponse; - })(); - v1.QueryPacketCommitmentsRequest = (function () { - function QueryPacketCommitmentsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketCommitmentsRequest.prototype.portId = ""; - QueryPacketCommitmentsRequest.prototype.channelId = ""; - QueryPacketCommitmentsRequest.prototype.pagination = null; - QueryPacketCommitmentsRequest.create = function create(properties) { - return new QueryPacketCommitmentsRequest(properties); - }; - QueryPacketCommitmentsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketCommitmentsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketCommitmentsRequest; - })(); - v1.QueryPacketCommitmentsResponse = (function () { - function QueryPacketCommitmentsResponse(p) { - this.commitments = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketCommitmentsResponse.prototype.commitments = $util.emptyArray; - QueryPacketCommitmentsResponse.prototype.pagination = null; - QueryPacketCommitmentsResponse.prototype.height = null; - QueryPacketCommitmentsResponse.create = function create(properties) { - return new QueryPacketCommitmentsResponse(properties); - }; - QueryPacketCommitmentsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.commitments != null && m.commitments.length) { - for (var i = 0; i < m.commitments.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(m.commitments[i], w.uint32(10).fork()).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketCommitmentsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.commitments && m.commitments.length)) m.commitments = []; - m.commitments.push($root.ibc.core.channel.v1.PacketState.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - case 3: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketCommitmentsResponse; - })(); - v1.QueryPacketReceiptRequest = (function () { - function QueryPacketReceiptRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketReceiptRequest.prototype.portId = ""; - QueryPacketReceiptRequest.prototype.channelId = ""; - QueryPacketReceiptRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - QueryPacketReceiptRequest.create = function create(properties) { - return new QueryPacketReceiptRequest(properties); - }; - QueryPacketReceiptRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - QueryPacketReceiptRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketReceiptRequest; - })(); - v1.QueryPacketReceiptResponse = (function () { - function QueryPacketReceiptResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketReceiptResponse.prototype.received = false; - QueryPacketReceiptResponse.prototype.proof = $util.newBuffer([]); - QueryPacketReceiptResponse.prototype.proofHeight = null; - QueryPacketReceiptResponse.create = function create(properties) { - return new QueryPacketReceiptResponse(properties); - }; - QueryPacketReceiptResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.received != null && Object.hasOwnProperty.call(m, "received")) - w.uint32(16).bool(m.received); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(26).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(34).fork()).ldelim(); - return w; - }; - QueryPacketReceiptResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 2: - m.received = r.bool(); - break; - case 3: - m.proof = r.bytes(); - break; - case 4: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketReceiptResponse; - })(); - v1.QueryPacketAcknowledgementRequest = (function () { - function QueryPacketAcknowledgementRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketAcknowledgementRequest.prototype.portId = ""; - QueryPacketAcknowledgementRequest.prototype.channelId = ""; - QueryPacketAcknowledgementRequest.prototype.sequence = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryPacketAcknowledgementRequest.create = function create(properties) { - return new QueryPacketAcknowledgementRequest(properties); - }; - QueryPacketAcknowledgementRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - QueryPacketAcknowledgementRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketAcknowledgementRequest; - })(); - v1.QueryPacketAcknowledgementResponse = (function () { - function QueryPacketAcknowledgementResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketAcknowledgementResponse.prototype.acknowledgement = $util.newBuffer([]); - QueryPacketAcknowledgementResponse.prototype.proof = $util.newBuffer([]); - QueryPacketAcknowledgementResponse.prototype.proofHeight = null; - QueryPacketAcknowledgementResponse.create = function create(properties) { - return new QueryPacketAcknowledgementResponse(properties); - }; - QueryPacketAcknowledgementResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.acknowledgement != null && Object.hasOwnProperty.call(m, "acknowledgement")) - w.uint32(10).bytes(m.acknowledgement); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketAcknowledgementResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.acknowledgement = r.bytes(); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketAcknowledgementResponse; - })(); - v1.QueryPacketAcknowledgementsRequest = (function () { - function QueryPacketAcknowledgementsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketAcknowledgementsRequest.prototype.portId = ""; - QueryPacketAcknowledgementsRequest.prototype.channelId = ""; - QueryPacketAcknowledgementsRequest.prototype.pagination = null; - QueryPacketAcknowledgementsRequest.create = function create(properties) { - return new QueryPacketAcknowledgementsRequest(properties); - }; - QueryPacketAcknowledgementsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketAcknowledgementsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketAcknowledgementsRequest; - })(); - v1.QueryPacketAcknowledgementsResponse = (function () { - function QueryPacketAcknowledgementsResponse(p) { - this.acknowledgements = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryPacketAcknowledgementsResponse.prototype.acknowledgements = $util.emptyArray; - QueryPacketAcknowledgementsResponse.prototype.pagination = null; - QueryPacketAcknowledgementsResponse.prototype.height = null; - QueryPacketAcknowledgementsResponse.create = function create(properties) { - return new QueryPacketAcknowledgementsResponse(properties); - }; - QueryPacketAcknowledgementsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.acknowledgements != null && m.acknowledgements.length) { - for (var i = 0; i < m.acknowledgements.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode( - m.acknowledgements[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryPacketAcknowledgementsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.acknowledgements && m.acknowledgements.length)) m.acknowledgements = []; - m.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - case 3: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryPacketAcknowledgementsResponse; - })(); - v1.QueryUnreceivedPacketsRequest = (function () { - function QueryUnreceivedPacketsRequest(p) { - this.packetCommitmentSequences = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnreceivedPacketsRequest.prototype.portId = ""; - QueryUnreceivedPacketsRequest.prototype.channelId = ""; - QueryUnreceivedPacketsRequest.prototype.packetCommitmentSequences = $util.emptyArray; - QueryUnreceivedPacketsRequest.create = function create(properties) { - return new QueryUnreceivedPacketsRequest(properties); - }; - QueryUnreceivedPacketsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.packetCommitmentSequences != null && m.packetCommitmentSequences.length) { - w.uint32(26).fork(); - for (var i = 0; i < m.packetCommitmentSequences.length; ++i) - w.uint64(m.packetCommitmentSequences[i]); - w.ldelim(); - } - return w; - }; - QueryUnreceivedPacketsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - if (!(m.packetCommitmentSequences && m.packetCommitmentSequences.length)) - m.packetCommitmentSequences = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.packetCommitmentSequences.push(r.uint64()); - } else m.packetCommitmentSequences.push(r.uint64()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnreceivedPacketsRequest; - })(); - v1.QueryUnreceivedPacketsResponse = (function () { - function QueryUnreceivedPacketsResponse(p) { - this.sequences = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnreceivedPacketsResponse.prototype.sequences = $util.emptyArray; - QueryUnreceivedPacketsResponse.prototype.height = null; - QueryUnreceivedPacketsResponse.create = function create(properties) { - return new QueryUnreceivedPacketsResponse(properties); - }; - QueryUnreceivedPacketsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.sequences != null && m.sequences.length) { - w.uint32(10).fork(); - for (var i = 0; i < m.sequences.length; ++i) w.uint64(m.sequences[i]); - w.ldelim(); - } - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryUnreceivedPacketsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.sequences && m.sequences.length)) m.sequences = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.sequences.push(r.uint64()); - } else m.sequences.push(r.uint64()); - break; - case 2: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnreceivedPacketsResponse; - })(); - v1.QueryUnreceivedAcksRequest = (function () { - function QueryUnreceivedAcksRequest(p) { - this.packetAckSequences = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnreceivedAcksRequest.prototype.portId = ""; - QueryUnreceivedAcksRequest.prototype.channelId = ""; - QueryUnreceivedAcksRequest.prototype.packetAckSequences = $util.emptyArray; - QueryUnreceivedAcksRequest.create = function create(properties) { - return new QueryUnreceivedAcksRequest(properties); - }; - QueryUnreceivedAcksRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - if (m.packetAckSequences != null && m.packetAckSequences.length) { - w.uint32(26).fork(); - for (var i = 0; i < m.packetAckSequences.length; ++i) w.uint64(m.packetAckSequences[i]); - w.ldelim(); - } - return w; - }; - QueryUnreceivedAcksRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - case 3: - if (!(m.packetAckSequences && m.packetAckSequences.length)) m.packetAckSequences = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.packetAckSequences.push(r.uint64()); - } else m.packetAckSequences.push(r.uint64()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnreceivedAcksRequest; - })(); - v1.QueryUnreceivedAcksResponse = (function () { - function QueryUnreceivedAcksResponse(p) { - this.sequences = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryUnreceivedAcksResponse.prototype.sequences = $util.emptyArray; - QueryUnreceivedAcksResponse.prototype.height = null; - QueryUnreceivedAcksResponse.create = function create(properties) { - return new QueryUnreceivedAcksResponse(properties); - }; - QueryUnreceivedAcksResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.sequences != null && m.sequences.length) { - w.uint32(10).fork(); - for (var i = 0; i < m.sequences.length; ++i) w.uint64(m.sequences[i]); - w.ldelim(); - } - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(18).fork()).ldelim(); - return w; - }; - QueryUnreceivedAcksResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.sequences && m.sequences.length)) m.sequences = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.sequences.push(r.uint64()); - } else m.sequences.push(r.uint64()); - break; - case 2: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryUnreceivedAcksResponse; - })(); - v1.QueryNextSequenceReceiveRequest = (function () { - function QueryNextSequenceReceiveRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryNextSequenceReceiveRequest.prototype.portId = ""; - QueryNextSequenceReceiveRequest.prototype.channelId = ""; - QueryNextSequenceReceiveRequest.create = function create(properties) { - return new QueryNextSequenceReceiveRequest(properties); - }; - QueryNextSequenceReceiveRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.portId != null && Object.hasOwnProperty.call(m, "portId")) w.uint32(10).string(m.portId); - if (m.channelId != null && Object.hasOwnProperty.call(m, "channelId")) - w.uint32(18).string(m.channelId); - return w; - }; - QueryNextSequenceReceiveRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.portId = r.string(); - break; - case 2: - m.channelId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryNextSequenceReceiveRequest; - })(); - v1.QueryNextSequenceReceiveResponse = (function () { - function QueryNextSequenceReceiveResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryNextSequenceReceiveResponse.prototype.nextSequenceReceive = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryNextSequenceReceiveResponse.prototype.proof = $util.newBuffer([]); - QueryNextSequenceReceiveResponse.prototype.proofHeight = null; - QueryNextSequenceReceiveResponse.create = function create(properties) { - return new QueryNextSequenceReceiveResponse(properties); - }; - QueryNextSequenceReceiveResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.nextSequenceReceive != null && Object.hasOwnProperty.call(m, "nextSequenceReceive")) - w.uint32(8).uint64(m.nextSequenceReceive); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryNextSequenceReceiveResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.nextSequenceReceive = r.uint64(); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryNextSequenceReceiveResponse; - })(); - return v1; - })(); - return channel; - })(); - core.client = (function () { - const client = {}; - client.v1 = (function () { - const v1 = {}; - v1.IdentifiedClientState = (function () { - function IdentifiedClientState(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - IdentifiedClientState.prototype.clientId = ""; - IdentifiedClientState.prototype.clientState = null; - IdentifiedClientState.create = function create(properties) { - return new IdentifiedClientState(properties); - }; - IdentifiedClientState.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - if (m.clientState != null && Object.hasOwnProperty.call(m, "clientState")) - $root.google.protobuf.Any.encode(m.clientState, w.uint32(18).fork()).ldelim(); - return w; - }; - IdentifiedClientState.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.IdentifiedClientState(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - case 2: - m.clientState = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return IdentifiedClientState; - })(); - v1.ConsensusStateWithHeight = (function () { - function ConsensusStateWithHeight(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ConsensusStateWithHeight.prototype.height = null; - ConsensusStateWithHeight.prototype.consensusState = null; - ConsensusStateWithHeight.create = function create(properties) { - return new ConsensusStateWithHeight(properties); - }; - ConsensusStateWithHeight.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(10).fork()).ldelim(); - if (m.consensusState != null && Object.hasOwnProperty.call(m, "consensusState")) - $root.google.protobuf.Any.encode(m.consensusState, w.uint32(18).fork()).ldelim(); - return w; - }; - ConsensusStateWithHeight.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - case 2: - m.consensusState = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ConsensusStateWithHeight; - })(); - v1.ClientConsensusStates = (function () { - function ClientConsensusStates(p) { - this.consensusStates = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ClientConsensusStates.prototype.clientId = ""; - ClientConsensusStates.prototype.consensusStates = $util.emptyArray; - ClientConsensusStates.create = function create(properties) { - return new ClientConsensusStates(properties); - }; - ClientConsensusStates.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - if (m.consensusStates != null && m.consensusStates.length) { - for (var i = 0; i < m.consensusStates.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode( - m.consensusStates[i], - w.uint32(18).fork(), - ).ldelim(); - } - return w; - }; - ClientConsensusStates.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.ClientConsensusStates(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - case 2: - if (!(m.consensusStates && m.consensusStates.length)) m.consensusStates = []; - m.consensusStates.push( - $root.ibc.core.client.v1.ConsensusStateWithHeight.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ClientConsensusStates; - })(); - v1.ClientUpdateProposal = (function () { - function ClientUpdateProposal(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ClientUpdateProposal.prototype.title = ""; - ClientUpdateProposal.prototype.description = ""; - ClientUpdateProposal.prototype.clientId = ""; - ClientUpdateProposal.prototype.header = null; - ClientUpdateProposal.create = function create(properties) { - return new ClientUpdateProposal(properties); - }; - ClientUpdateProposal.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.title != null && Object.hasOwnProperty.call(m, "title")) w.uint32(10).string(m.title); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - w.uint32(18).string(m.description); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(26).string(m.clientId); - if (m.header != null && Object.hasOwnProperty.call(m, "header")) - $root.google.protobuf.Any.encode(m.header, w.uint32(34).fork()).ldelim(); - return w; - }; - ClientUpdateProposal.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.ClientUpdateProposal(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.title = r.string(); - break; - case 2: - m.description = r.string(); - break; - case 3: - m.clientId = r.string(); - break; - case 4: - m.header = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ClientUpdateProposal; - })(); - v1.Height = (function () { - function Height(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Height.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Height.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Height.create = function create(properties) { - return new Height(properties); - }; - Height.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.revisionNumber != null && Object.hasOwnProperty.call(m, "revisionNumber")) - w.uint32(8).uint64(m.revisionNumber); - if (m.revisionHeight != null && Object.hasOwnProperty.call(m, "revisionHeight")) - w.uint32(16).uint64(m.revisionHeight); - return w; - }; - Height.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.Height(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.revisionNumber = r.uint64(); - break; - case 2: - m.revisionHeight = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Height; - })(); - v1.Params = (function () { - function Params(p) { - this.allowedClients = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.allowedClients = $util.emptyArray; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.allowedClients != null && m.allowedClients.length) { - for (var i = 0; i < m.allowedClients.length; ++i) w.uint32(10).string(m.allowedClients[i]); - } - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.client.v1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.allowedClients && m.allowedClients.length)) m.allowedClients = []; - m.allowedClients.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - return v1; - })(); - return client; - })(); - core.commitment = (function () { - const commitment = {}; - commitment.v1 = (function () { - const v1 = {}; - v1.MerkleRoot = (function () { - function MerkleRoot(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MerkleRoot.prototype.hash = $util.newBuffer([]); - MerkleRoot.create = function create(properties) { - return new MerkleRoot(properties); - }; - MerkleRoot.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(10).bytes(m.hash); - return w; - }; - MerkleRoot.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.commitment.v1.MerkleRoot(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hash = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MerkleRoot; - })(); - v1.MerklePrefix = (function () { - function MerklePrefix(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MerklePrefix.prototype.keyPrefix = $util.newBuffer([]); - MerklePrefix.create = function create(properties) { - return new MerklePrefix(properties); - }; - MerklePrefix.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.keyPrefix != null && Object.hasOwnProperty.call(m, "keyPrefix")) - w.uint32(10).bytes(m.keyPrefix); - return w; - }; - MerklePrefix.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.commitment.v1.MerklePrefix(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.keyPrefix = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MerklePrefix; - })(); - v1.MerklePath = (function () { - function MerklePath(p) { - this.keyPath = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MerklePath.prototype.keyPath = $util.emptyArray; - MerklePath.create = function create(properties) { - return new MerklePath(properties); - }; - MerklePath.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.keyPath != null && m.keyPath.length) { - for (var i = 0; i < m.keyPath.length; ++i) w.uint32(10).string(m.keyPath[i]); - } - return w; - }; - MerklePath.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.commitment.v1.MerklePath(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.keyPath && m.keyPath.length)) m.keyPath = []; - m.keyPath.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MerklePath; - })(); - v1.MerkleProof = (function () { - function MerkleProof(p) { - this.proofs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MerkleProof.prototype.proofs = $util.emptyArray; - MerkleProof.create = function create(properties) { - return new MerkleProof(properties); - }; - MerkleProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.proofs != null && m.proofs.length) { - for (var i = 0; i < m.proofs.length; ++i) - $root.ics23.CommitmentProof.encode(m.proofs[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - MerkleProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.commitment.v1.MerkleProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.proofs && m.proofs.length)) m.proofs = []; - m.proofs.push($root.ics23.CommitmentProof.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MerkleProof; - })(); - return v1; - })(); - return commitment; - })(); - core.connection = (function () { - const connection = {}; - connection.v1 = (function () { - const v1 = {}; - v1.ConnectionEnd = (function () { - function ConnectionEnd(p) { - this.versions = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ConnectionEnd.prototype.clientId = ""; - ConnectionEnd.prototype.versions = $util.emptyArray; - ConnectionEnd.prototype.state = 0; - ConnectionEnd.prototype.counterparty = null; - ConnectionEnd.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - ConnectionEnd.create = function create(properties) { - return new ConnectionEnd(properties); - }; - ConnectionEnd.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - if (m.versions != null && m.versions.length) { - for (var i = 0; i < m.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(m.versions[i], w.uint32(18).fork()).ldelim(); - } - if (m.state != null && Object.hasOwnProperty.call(m, "state")) w.uint32(24).int32(m.state); - if (m.counterparty != null && Object.hasOwnProperty.call(m, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(m.counterparty, w.uint32(34).fork()).ldelim(); - if (m.delayPeriod != null && Object.hasOwnProperty.call(m, "delayPeriod")) - w.uint32(40).uint64(m.delayPeriod); - return w; - }; - ConnectionEnd.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.ConnectionEnd(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - case 2: - if (!(m.versions && m.versions.length)) m.versions = []; - m.versions.push($root.ibc.core.connection.v1.Version.decode(r, r.uint32())); - break; - case 3: - m.state = r.int32(); - break; - case 4: - m.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(r, r.uint32()); - break; - case 5: - m.delayPeriod = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ConnectionEnd; - })(); - v1.IdentifiedConnection = (function () { - function IdentifiedConnection(p) { - this.versions = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - IdentifiedConnection.prototype.id = ""; - IdentifiedConnection.prototype.clientId = ""; - IdentifiedConnection.prototype.versions = $util.emptyArray; - IdentifiedConnection.prototype.state = 0; - IdentifiedConnection.prototype.counterparty = null; - IdentifiedConnection.prototype.delayPeriod = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - IdentifiedConnection.create = function create(properties) { - return new IdentifiedConnection(properties); - }; - IdentifiedConnection.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.id != null && Object.hasOwnProperty.call(m, "id")) w.uint32(10).string(m.id); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(18).string(m.clientId); - if (m.versions != null && m.versions.length) { - for (var i = 0; i < m.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(m.versions[i], w.uint32(26).fork()).ldelim(); - } - if (m.state != null && Object.hasOwnProperty.call(m, "state")) w.uint32(32).int32(m.state); - if (m.counterparty != null && Object.hasOwnProperty.call(m, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(m.counterparty, w.uint32(42).fork()).ldelim(); - if (m.delayPeriod != null && Object.hasOwnProperty.call(m, "delayPeriod")) - w.uint32(48).uint64(m.delayPeriod); - return w; - }; - IdentifiedConnection.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.IdentifiedConnection(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.id = r.string(); - break; - case 2: - m.clientId = r.string(); - break; - case 3: - if (!(m.versions && m.versions.length)) m.versions = []; - m.versions.push($root.ibc.core.connection.v1.Version.decode(r, r.uint32())); - break; - case 4: - m.state = r.int32(); - break; - case 5: - m.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(r, r.uint32()); - break; - case 6: - m.delayPeriod = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return IdentifiedConnection; - })(); - v1.State = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED")] = 0; - values[(valuesById[1] = "STATE_INIT")] = 1; - values[(valuesById[2] = "STATE_TRYOPEN")] = 2; - values[(valuesById[3] = "STATE_OPEN")] = 3; - return values; - })(); - v1.Counterparty = (function () { - function Counterparty(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Counterparty.prototype.clientId = ""; - Counterparty.prototype.connectionId = ""; - Counterparty.prototype.prefix = null; - Counterparty.create = function create(properties) { - return new Counterparty(properties); - }; - Counterparty.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - if (m.connectionId != null && Object.hasOwnProperty.call(m, "connectionId")) - w.uint32(18).string(m.connectionId); - if (m.prefix != null && Object.hasOwnProperty.call(m, "prefix")) - $root.ibc.core.commitment.v1.MerklePrefix.encode(m.prefix, w.uint32(26).fork()).ldelim(); - return w; - }; - Counterparty.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.Counterparty(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - case 2: - m.connectionId = r.string(); - break; - case 3: - m.prefix = $root.ibc.core.commitment.v1.MerklePrefix.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Counterparty; - })(); - v1.ClientPaths = (function () { - function ClientPaths(p) { - this.paths = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ClientPaths.prototype.paths = $util.emptyArray; - ClientPaths.create = function create(properties) { - return new ClientPaths(properties); - }; - ClientPaths.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.paths != null && m.paths.length) { - for (var i = 0; i < m.paths.length; ++i) w.uint32(10).string(m.paths[i]); - } - return w; - }; - ClientPaths.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.ClientPaths(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.paths && m.paths.length)) m.paths = []; - m.paths.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ClientPaths; - })(); - v1.ConnectionPaths = (function () { - function ConnectionPaths(p) { - this.paths = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ConnectionPaths.prototype.clientId = ""; - ConnectionPaths.prototype.paths = $util.emptyArray; - ConnectionPaths.create = function create(properties) { - return new ConnectionPaths(properties); - }; - ConnectionPaths.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - if (m.paths != null && m.paths.length) { - for (var i = 0; i < m.paths.length; ++i) w.uint32(18).string(m.paths[i]); - } - return w; - }; - ConnectionPaths.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.ConnectionPaths(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - case 2: - if (!(m.paths && m.paths.length)) m.paths = []; - m.paths.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ConnectionPaths; - })(); - v1.Version = (function () { - function Version(p) { - this.features = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Version.prototype.identifier = ""; - Version.prototype.features = $util.emptyArray; - Version.create = function create(properties) { - return new Version(properties); - }; - Version.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.identifier != null && Object.hasOwnProperty.call(m, "identifier")) - w.uint32(10).string(m.identifier); - if (m.features != null && m.features.length) { - for (var i = 0; i < m.features.length; ++i) w.uint32(18).string(m.features[i]); - } - return w; - }; - Version.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.Version(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.identifier = r.string(); - break; - case 2: - if (!(m.features && m.features.length)) m.features = []; - m.features.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Version; - })(); - v1.Query = (function () { - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - Query.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Query.prototype.connection = function connection(request, callback) { - return this.rpcCall( - connection, - $root.ibc.core.connection.v1.QueryConnectionRequest, - $root.ibc.core.connection.v1.QueryConnectionResponse, - request, - callback, - ); - }), - "name", - { value: "Connection" }, - ); - Object.defineProperty( - (Query.prototype.connections = function connections(request, callback) { - return this.rpcCall( - connections, - $root.ibc.core.connection.v1.QueryConnectionsRequest, - $root.ibc.core.connection.v1.QueryConnectionsResponse, - request, - callback, - ); - }), - "name", - { value: "Connections" }, - ); - Object.defineProperty( - (Query.prototype.clientConnections = function clientConnections(request, callback) { - return this.rpcCall( - clientConnections, - $root.ibc.core.connection.v1.QueryClientConnectionsRequest, - $root.ibc.core.connection.v1.QueryClientConnectionsResponse, - request, - callback, - ); - }), - "name", - { value: "ClientConnections" }, - ); - Object.defineProperty( - (Query.prototype.connectionClientState = function connectionClientState(request, callback) { - return this.rpcCall( - connectionClientState, - $root.ibc.core.connection.v1.QueryConnectionClientStateRequest, - $root.ibc.core.connection.v1.QueryConnectionClientStateResponse, - request, - callback, - ); - }), - "name", - { value: "ConnectionClientState" }, - ); - Object.defineProperty( - (Query.prototype.connectionConsensusState = function connectionConsensusState(request, callback) { - return this.rpcCall( - connectionConsensusState, - $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest, - $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse, - request, - callback, - ); - }), - "name", - { value: "ConnectionConsensusState" }, - ); - return Query; - })(); - v1.QueryConnectionRequest = (function () { - function QueryConnectionRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionRequest.prototype.connectionId = ""; - QueryConnectionRequest.create = function create(properties) { - return new QueryConnectionRequest(properties); - }; - QueryConnectionRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connectionId != null && Object.hasOwnProperty.call(m, "connectionId")) - w.uint32(10).string(m.connectionId); - return w; - }; - QueryConnectionRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.connectionId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionRequest; - })(); - v1.QueryConnectionResponse = (function () { - function QueryConnectionResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionResponse.prototype.connection = null; - QueryConnectionResponse.prototype.proof = $util.newBuffer([]); - QueryConnectionResponse.prototype.proofHeight = null; - QueryConnectionResponse.create = function create(properties) { - return new QueryConnectionResponse(properties); - }; - QueryConnectionResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connection != null && Object.hasOwnProperty.call(m, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(m.connection, w.uint32(10).fork()).ldelim(); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryConnectionResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(r, r.uint32()); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionResponse; - })(); - v1.QueryConnectionsRequest = (function () { - function QueryConnectionsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionsRequest.prototype.pagination = null; - QueryConnectionsRequest.create = function create(properties) { - return new QueryConnectionsRequest(properties); - }; - QueryConnectionsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(m.pagination, w.uint32(10).fork()).ldelim(); - return w; - }; - QueryConnectionsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionsRequest; - })(); - v1.QueryConnectionsResponse = (function () { - function QueryConnectionsResponse(p) { - this.connections = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionsResponse.prototype.connections = $util.emptyArray; - QueryConnectionsResponse.prototype.pagination = null; - QueryConnectionsResponse.prototype.height = null; - QueryConnectionsResponse.create = function create(properties) { - return new QueryConnectionsResponse(properties); - }; - QueryConnectionsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connections != null && m.connections.length) { - for (var i = 0; i < m.connections.length; ++i) - $root.ibc.core.connection.v1.IdentifiedConnection.encode( - m.connections[i], - w.uint32(10).fork(), - ).ldelim(); - } - if (m.pagination != null && Object.hasOwnProperty.call(m, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(m.pagination, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) - $root.ibc.core.client.v1.Height.encode(m.height, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryConnectionsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.connections && m.connections.length)) m.connections = []; - m.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(r, r.uint32())); - break; - case 2: - m.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(r, r.uint32()); - break; - case 3: - m.height = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionsResponse; - })(); - v1.QueryClientConnectionsRequest = (function () { - function QueryClientConnectionsRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryClientConnectionsRequest.prototype.clientId = ""; - QueryClientConnectionsRequest.create = function create(properties) { - return new QueryClientConnectionsRequest(properties); - }; - QueryClientConnectionsRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(10).string(m.clientId); - return w; - }; - QueryClientConnectionsRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.clientId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryClientConnectionsRequest; - })(); - v1.QueryClientConnectionsResponse = (function () { - function QueryClientConnectionsResponse(p) { - this.connectionPaths = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryClientConnectionsResponse.prototype.connectionPaths = $util.emptyArray; - QueryClientConnectionsResponse.prototype.proof = $util.newBuffer([]); - QueryClientConnectionsResponse.prototype.proofHeight = null; - QueryClientConnectionsResponse.create = function create(properties) { - return new QueryClientConnectionsResponse(properties); - }; - QueryClientConnectionsResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connectionPaths != null && m.connectionPaths.length) { - for (var i = 0; i < m.connectionPaths.length; ++i) w.uint32(10).string(m.connectionPaths[i]); - } - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryClientConnectionsResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.connectionPaths && m.connectionPaths.length)) m.connectionPaths = []; - m.connectionPaths.push(r.string()); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryClientConnectionsResponse; - })(); - v1.QueryConnectionClientStateRequest = (function () { - function QueryConnectionClientStateRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionClientStateRequest.prototype.connectionId = ""; - QueryConnectionClientStateRequest.create = function create(properties) { - return new QueryConnectionClientStateRequest(properties); - }; - QueryConnectionClientStateRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connectionId != null && Object.hasOwnProperty.call(m, "connectionId")) - w.uint32(10).string(m.connectionId); - return w; - }; - QueryConnectionClientStateRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.connectionId = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionClientStateRequest; - })(); - v1.QueryConnectionClientStateResponse = (function () { - function QueryConnectionClientStateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionClientStateResponse.prototype.identifiedClientState = null; - QueryConnectionClientStateResponse.prototype.proof = $util.newBuffer([]); - QueryConnectionClientStateResponse.prototype.proofHeight = null; - QueryConnectionClientStateResponse.create = function create(properties) { - return new QueryConnectionClientStateResponse(properties); - }; - QueryConnectionClientStateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.identifiedClientState != null && Object.hasOwnProperty.call(m, "identifiedClientState")) - $root.ibc.core.client.v1.IdentifiedClientState.encode( - m.identifiedClientState, - w.uint32(10).fork(), - ).ldelim(); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(18).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(26).fork()).ldelim(); - return w; - }; - QueryConnectionClientStateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.identifiedClientState = $root.ibc.core.client.v1.IdentifiedClientState.decode( - r, - r.uint32(), - ); - break; - case 2: - m.proof = r.bytes(); - break; - case 3: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionClientStateResponse; - })(); - v1.QueryConnectionConsensusStateRequest = (function () { - function QueryConnectionConsensusStateRequest(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionConsensusStateRequest.prototype.connectionId = ""; - QueryConnectionConsensusStateRequest.prototype.revisionNumber = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryConnectionConsensusStateRequest.prototype.revisionHeight = $util.Long - ? $util.Long.fromBits(0, 0, true) - : 0; - QueryConnectionConsensusStateRequest.create = function create(properties) { - return new QueryConnectionConsensusStateRequest(properties); - }; - QueryConnectionConsensusStateRequest.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.connectionId != null && Object.hasOwnProperty.call(m, "connectionId")) - w.uint32(10).string(m.connectionId); - if (m.revisionNumber != null && Object.hasOwnProperty.call(m, "revisionNumber")) - w.uint32(16).uint64(m.revisionNumber); - if (m.revisionHeight != null && Object.hasOwnProperty.call(m, "revisionHeight")) - w.uint32(24).uint64(m.revisionHeight); - return w; - }; - QueryConnectionConsensusStateRequest.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.connectionId = r.string(); - break; - case 2: - m.revisionNumber = r.uint64(); - break; - case 3: - m.revisionHeight = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionConsensusStateRequest; - })(); - v1.QueryConnectionConsensusStateResponse = (function () { - function QueryConnectionConsensusStateResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - QueryConnectionConsensusStateResponse.prototype.consensusState = null; - QueryConnectionConsensusStateResponse.prototype.clientId = ""; - QueryConnectionConsensusStateResponse.prototype.proof = $util.newBuffer([]); - QueryConnectionConsensusStateResponse.prototype.proofHeight = null; - QueryConnectionConsensusStateResponse.create = function create(properties) { - return new QueryConnectionConsensusStateResponse(properties); - }; - QueryConnectionConsensusStateResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.consensusState != null && Object.hasOwnProperty.call(m, "consensusState")) - $root.google.protobuf.Any.encode(m.consensusState, w.uint32(10).fork()).ldelim(); - if (m.clientId != null && Object.hasOwnProperty.call(m, "clientId")) - w.uint32(18).string(m.clientId); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) w.uint32(26).bytes(m.proof); - if (m.proofHeight != null && Object.hasOwnProperty.call(m, "proofHeight")) - $root.ibc.core.client.v1.Height.encode(m.proofHeight, w.uint32(34).fork()).ldelim(); - return w; - }; - QueryConnectionConsensusStateResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.consensusState = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.clientId = r.string(); - break; - case 3: - m.proof = r.bytes(); - break; - case 4: - m.proofHeight = $root.ibc.core.client.v1.Height.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return QueryConnectionConsensusStateResponse; - })(); - return v1; - })(); - return connection; - })(); - return core; - })(); - return ibc; -})(); -exports.ics23 = $root.ics23 = (() => { - const ics23 = {}; - ics23.HashOp = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "NO_HASH")] = 0; - values[(valuesById[1] = "SHA256")] = 1; - values[(valuesById[2] = "SHA512")] = 2; - values[(valuesById[3] = "KECCAK")] = 3; - values[(valuesById[4] = "RIPEMD160")] = 4; - values[(valuesById[5] = "BITCOIN")] = 5; - return values; - })(); - ics23.LengthOp = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "NO_PREFIX")] = 0; - values[(valuesById[1] = "VAR_PROTO")] = 1; - values[(valuesById[2] = "VAR_RLP")] = 2; - values[(valuesById[3] = "FIXED32_BIG")] = 3; - values[(valuesById[4] = "FIXED32_LITTLE")] = 4; - values[(valuesById[5] = "FIXED64_BIG")] = 5; - values[(valuesById[6] = "FIXED64_LITTLE")] = 6; - values[(valuesById[7] = "REQUIRE_32_BYTES")] = 7; - values[(valuesById[8] = "REQUIRE_64_BYTES")] = 8; - return values; - })(); - ics23.ExistenceProof = (function () { - function ExistenceProof(p) { - this.path = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ExistenceProof.prototype.key = $util.newBuffer([]); - ExistenceProof.prototype.value = $util.newBuffer([]); - ExistenceProof.prototype.leaf = null; - ExistenceProof.prototype.path = $util.emptyArray; - ExistenceProof.create = function create(properties) { - return new ExistenceProof(properties); - }; - ExistenceProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).bytes(m.value); - if (m.leaf != null && Object.hasOwnProperty.call(m, "leaf")) - $root.ics23.LeafOp.encode(m.leaf, w.uint32(26).fork()).ldelim(); - if (m.path != null && m.path.length) { - for (var i = 0; i < m.path.length; ++i) - $root.ics23.InnerOp.encode(m.path[i], w.uint32(34).fork()).ldelim(); - } - return w; - }; - ExistenceProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.ExistenceProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.value = r.bytes(); - break; - case 3: - m.leaf = $root.ics23.LeafOp.decode(r, r.uint32()); - break; - case 4: - if (!(m.path && m.path.length)) m.path = []; - m.path.push($root.ics23.InnerOp.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ExistenceProof; - })(); - ics23.NonExistenceProof = (function () { - function NonExistenceProof(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - NonExistenceProof.prototype.key = $util.newBuffer([]); - NonExistenceProof.prototype.left = null; - NonExistenceProof.prototype.right = null; - NonExistenceProof.create = function create(properties) { - return new NonExistenceProof(properties); - }; - NonExistenceProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.left != null && Object.hasOwnProperty.call(m, "left")) - $root.ics23.ExistenceProof.encode(m.left, w.uint32(18).fork()).ldelim(); - if (m.right != null && Object.hasOwnProperty.call(m, "right")) - $root.ics23.ExistenceProof.encode(m.right, w.uint32(26).fork()).ldelim(); - return w; - }; - NonExistenceProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.NonExistenceProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.left = $root.ics23.ExistenceProof.decode(r, r.uint32()); - break; - case 3: - m.right = $root.ics23.ExistenceProof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return NonExistenceProof; - })(); - ics23.CommitmentProof = (function () { - function CommitmentProof(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CommitmentProof.prototype.exist = null; - CommitmentProof.prototype.nonexist = null; - CommitmentProof.prototype.batch = null; - CommitmentProof.prototype.compressed = null; - let $oneOfFields; - Object.defineProperty(CommitmentProof.prototype, "proof", { - get: $util.oneOfGetter(($oneOfFields = ["exist", "nonexist", "batch", "compressed"])), - set: $util.oneOfSetter($oneOfFields), - }); - CommitmentProof.create = function create(properties) { - return new CommitmentProof(properties); - }; - CommitmentProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.exist != null && Object.hasOwnProperty.call(m, "exist")) - $root.ics23.ExistenceProof.encode(m.exist, w.uint32(10).fork()).ldelim(); - if (m.nonexist != null && Object.hasOwnProperty.call(m, "nonexist")) - $root.ics23.NonExistenceProof.encode(m.nonexist, w.uint32(18).fork()).ldelim(); - if (m.batch != null && Object.hasOwnProperty.call(m, "batch")) - $root.ics23.BatchProof.encode(m.batch, w.uint32(26).fork()).ldelim(); - if (m.compressed != null && Object.hasOwnProperty.call(m, "compressed")) - $root.ics23.CompressedBatchProof.encode(m.compressed, w.uint32(34).fork()).ldelim(); - return w; - }; - CommitmentProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.CommitmentProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.exist = $root.ics23.ExistenceProof.decode(r, r.uint32()); - break; - case 2: - m.nonexist = $root.ics23.NonExistenceProof.decode(r, r.uint32()); - break; - case 3: - m.batch = $root.ics23.BatchProof.decode(r, r.uint32()); - break; - case 4: - m.compressed = $root.ics23.CompressedBatchProof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CommitmentProof; - })(); - ics23.LeafOp = (function () { - function LeafOp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - LeafOp.prototype.hash = 0; - LeafOp.prototype.prehashKey = 0; - LeafOp.prototype.prehashValue = 0; - LeafOp.prototype.length = 0; - LeafOp.prototype.prefix = $util.newBuffer([]); - LeafOp.create = function create(properties) { - return new LeafOp(properties); - }; - LeafOp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(8).int32(m.hash); - if (m.prehashKey != null && Object.hasOwnProperty.call(m, "prehashKey")) - w.uint32(16).int32(m.prehashKey); - if (m.prehashValue != null && Object.hasOwnProperty.call(m, "prehashValue")) - w.uint32(24).int32(m.prehashValue); - if (m.length != null && Object.hasOwnProperty.call(m, "length")) w.uint32(32).int32(m.length); - if (m.prefix != null && Object.hasOwnProperty.call(m, "prefix")) w.uint32(42).bytes(m.prefix); - return w; - }; - LeafOp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.LeafOp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hash = r.int32(); - break; - case 2: - m.prehashKey = r.int32(); - break; - case 3: - m.prehashValue = r.int32(); - break; - case 4: - m.length = r.int32(); - break; - case 5: - m.prefix = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return LeafOp; - })(); - ics23.InnerOp = (function () { - function InnerOp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - InnerOp.prototype.hash = 0; - InnerOp.prototype.prefix = $util.newBuffer([]); - InnerOp.prototype.suffix = $util.newBuffer([]); - InnerOp.create = function create(properties) { - return new InnerOp(properties); - }; - InnerOp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(8).int32(m.hash); - if (m.prefix != null && Object.hasOwnProperty.call(m, "prefix")) w.uint32(18).bytes(m.prefix); - if (m.suffix != null && Object.hasOwnProperty.call(m, "suffix")) w.uint32(26).bytes(m.suffix); - return w; - }; - InnerOp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.InnerOp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hash = r.int32(); - break; - case 2: - m.prefix = r.bytes(); - break; - case 3: - m.suffix = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return InnerOp; - })(); - ics23.ProofSpec = (function () { - function ProofSpec(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ProofSpec.prototype.leafSpec = null; - ProofSpec.prototype.innerSpec = null; - ProofSpec.prototype.maxDepth = 0; - ProofSpec.prototype.minDepth = 0; - ProofSpec.create = function create(properties) { - return new ProofSpec(properties); - }; - ProofSpec.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.leafSpec != null && Object.hasOwnProperty.call(m, "leafSpec")) - $root.ics23.LeafOp.encode(m.leafSpec, w.uint32(10).fork()).ldelim(); - if (m.innerSpec != null && Object.hasOwnProperty.call(m, "innerSpec")) - $root.ics23.InnerSpec.encode(m.innerSpec, w.uint32(18).fork()).ldelim(); - if (m.maxDepth != null && Object.hasOwnProperty.call(m, "maxDepth")) w.uint32(24).int32(m.maxDepth); - if (m.minDepth != null && Object.hasOwnProperty.call(m, "minDepth")) w.uint32(32).int32(m.minDepth); - return w; - }; - ProofSpec.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.ProofSpec(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.leafSpec = $root.ics23.LeafOp.decode(r, r.uint32()); - break; - case 2: - m.innerSpec = $root.ics23.InnerSpec.decode(r, r.uint32()); - break; - case 3: - m.maxDepth = r.int32(); - break; - case 4: - m.minDepth = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ProofSpec; - })(); - ics23.InnerSpec = (function () { - function InnerSpec(p) { - this.childOrder = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - InnerSpec.prototype.childOrder = $util.emptyArray; - InnerSpec.prototype.childSize = 0; - InnerSpec.prototype.minPrefixLength = 0; - InnerSpec.prototype.maxPrefixLength = 0; - InnerSpec.prototype.emptyChild = $util.newBuffer([]); - InnerSpec.prototype.hash = 0; - InnerSpec.create = function create(properties) { - return new InnerSpec(properties); - }; - InnerSpec.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.childOrder != null && m.childOrder.length) { - w.uint32(10).fork(); - for (var i = 0; i < m.childOrder.length; ++i) w.int32(m.childOrder[i]); - w.ldelim(); - } - if (m.childSize != null && Object.hasOwnProperty.call(m, "childSize")) w.uint32(16).int32(m.childSize); - if (m.minPrefixLength != null && Object.hasOwnProperty.call(m, "minPrefixLength")) - w.uint32(24).int32(m.minPrefixLength); - if (m.maxPrefixLength != null && Object.hasOwnProperty.call(m, "maxPrefixLength")) - w.uint32(32).int32(m.maxPrefixLength); - if (m.emptyChild != null && Object.hasOwnProperty.call(m, "emptyChild")) - w.uint32(42).bytes(m.emptyChild); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(48).int32(m.hash); - return w; - }; - InnerSpec.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.InnerSpec(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.childOrder && m.childOrder.length)) m.childOrder = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.childOrder.push(r.int32()); - } else m.childOrder.push(r.int32()); - break; - case 2: - m.childSize = r.int32(); - break; - case 3: - m.minPrefixLength = r.int32(); - break; - case 4: - m.maxPrefixLength = r.int32(); - break; - case 5: - m.emptyChild = r.bytes(); - break; - case 6: - m.hash = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return InnerSpec; - })(); - ics23.BatchProof = (function () { - function BatchProof(p) { - this.entries = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BatchProof.prototype.entries = $util.emptyArray; - BatchProof.create = function create(properties) { - return new BatchProof(properties); - }; - BatchProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.entries != null && m.entries.length) { - for (var i = 0; i < m.entries.length; ++i) - $root.ics23.BatchEntry.encode(m.entries[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - BatchProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.BatchProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.entries && m.entries.length)) m.entries = []; - m.entries.push($root.ics23.BatchEntry.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BatchProof; - })(); - ics23.BatchEntry = (function () { - function BatchEntry(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BatchEntry.prototype.exist = null; - BatchEntry.prototype.nonexist = null; - let $oneOfFields; - Object.defineProperty(BatchEntry.prototype, "proof", { - get: $util.oneOfGetter(($oneOfFields = ["exist", "nonexist"])), - set: $util.oneOfSetter($oneOfFields), - }); - BatchEntry.create = function create(properties) { - return new BatchEntry(properties); - }; - BatchEntry.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.exist != null && Object.hasOwnProperty.call(m, "exist")) - $root.ics23.ExistenceProof.encode(m.exist, w.uint32(10).fork()).ldelim(); - if (m.nonexist != null && Object.hasOwnProperty.call(m, "nonexist")) - $root.ics23.NonExistenceProof.encode(m.nonexist, w.uint32(18).fork()).ldelim(); - return w; - }; - BatchEntry.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.BatchEntry(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.exist = $root.ics23.ExistenceProof.decode(r, r.uint32()); - break; - case 2: - m.nonexist = $root.ics23.NonExistenceProof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BatchEntry; - })(); - ics23.CompressedBatchProof = (function () { - function CompressedBatchProof(p) { - this.entries = []; - this.lookupInners = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompressedBatchProof.prototype.entries = $util.emptyArray; - CompressedBatchProof.prototype.lookupInners = $util.emptyArray; - CompressedBatchProof.create = function create(properties) { - return new CompressedBatchProof(properties); - }; - CompressedBatchProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.entries != null && m.entries.length) { - for (var i = 0; i < m.entries.length; ++i) - $root.ics23.CompressedBatchEntry.encode(m.entries[i], w.uint32(10).fork()).ldelim(); - } - if (m.lookupInners != null && m.lookupInners.length) { - for (var i = 0; i < m.lookupInners.length; ++i) - $root.ics23.InnerOp.encode(m.lookupInners[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - CompressedBatchProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.CompressedBatchProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.entries && m.entries.length)) m.entries = []; - m.entries.push($root.ics23.CompressedBatchEntry.decode(r, r.uint32())); - break; - case 2: - if (!(m.lookupInners && m.lookupInners.length)) m.lookupInners = []; - m.lookupInners.push($root.ics23.InnerOp.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompressedBatchProof; - })(); - ics23.CompressedBatchEntry = (function () { - function CompressedBatchEntry(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompressedBatchEntry.prototype.exist = null; - CompressedBatchEntry.prototype.nonexist = null; - let $oneOfFields; - Object.defineProperty(CompressedBatchEntry.prototype, "proof", { - get: $util.oneOfGetter(($oneOfFields = ["exist", "nonexist"])), - set: $util.oneOfSetter($oneOfFields), - }); - CompressedBatchEntry.create = function create(properties) { - return new CompressedBatchEntry(properties); - }; - CompressedBatchEntry.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.exist != null && Object.hasOwnProperty.call(m, "exist")) - $root.ics23.CompressedExistenceProof.encode(m.exist, w.uint32(10).fork()).ldelim(); - if (m.nonexist != null && Object.hasOwnProperty.call(m, "nonexist")) - $root.ics23.CompressedNonExistenceProof.encode(m.nonexist, w.uint32(18).fork()).ldelim(); - return w; - }; - CompressedBatchEntry.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.CompressedBatchEntry(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.exist = $root.ics23.CompressedExistenceProof.decode(r, r.uint32()); - break; - case 2: - m.nonexist = $root.ics23.CompressedNonExistenceProof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompressedBatchEntry; - })(); - ics23.CompressedExistenceProof = (function () { - function CompressedExistenceProof(p) { - this.path = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompressedExistenceProof.prototype.key = $util.newBuffer([]); - CompressedExistenceProof.prototype.value = $util.newBuffer([]); - CompressedExistenceProof.prototype.leaf = null; - CompressedExistenceProof.prototype.path = $util.emptyArray; - CompressedExistenceProof.create = function create(properties) { - return new CompressedExistenceProof(properties); - }; - CompressedExistenceProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).bytes(m.value); - if (m.leaf != null && Object.hasOwnProperty.call(m, "leaf")) - $root.ics23.LeafOp.encode(m.leaf, w.uint32(26).fork()).ldelim(); - if (m.path != null && m.path.length) { - w.uint32(34).fork(); - for (var i = 0; i < m.path.length; ++i) w.int32(m.path[i]); - w.ldelim(); - } - return w; - }; - CompressedExistenceProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.CompressedExistenceProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.value = r.bytes(); - break; - case 3: - m.leaf = $root.ics23.LeafOp.decode(r, r.uint32()); - break; - case 4: - if (!(m.path && m.path.length)) m.path = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.path.push(r.int32()); - } else m.path.push(r.int32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompressedExistenceProof; - })(); - ics23.CompressedNonExistenceProof = (function () { - function CompressedNonExistenceProof(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompressedNonExistenceProof.prototype.key = $util.newBuffer([]); - CompressedNonExistenceProof.prototype.left = null; - CompressedNonExistenceProof.prototype.right = null; - CompressedNonExistenceProof.create = function create(properties) { - return new CompressedNonExistenceProof(properties); - }; - CompressedNonExistenceProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.left != null && Object.hasOwnProperty.call(m, "left")) - $root.ics23.CompressedExistenceProof.encode(m.left, w.uint32(18).fork()).ldelim(); - if (m.right != null && Object.hasOwnProperty.call(m, "right")) - $root.ics23.CompressedExistenceProof.encode(m.right, w.uint32(26).fork()).ldelim(); - return w; - }; - CompressedNonExistenceProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.ics23.CompressedNonExistenceProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.left = $root.ics23.CompressedExistenceProof.decode(r, r.uint32()); - break; - case 3: - m.right = $root.ics23.CompressedExistenceProof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompressedNonExistenceProof; - })(); - return ics23; -})(); -exports.tendermint = $root.tendermint = (() => { - const tendermint = {}; - tendermint.abci = (function () { - const abci = {}; - abci.Request = (function () { - function Request(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Request.prototype.echo = null; - Request.prototype.flush = null; - Request.prototype.info = null; - Request.prototype.setOption = null; - Request.prototype.initChain = null; - Request.prototype.query = null; - Request.prototype.beginBlock = null; - Request.prototype.checkTx = null; - Request.prototype.deliverTx = null; - Request.prototype.endBlock = null; - Request.prototype.commit = null; - Request.prototype.listSnapshots = null; - Request.prototype.offerSnapshot = null; - Request.prototype.loadSnapshotChunk = null; - Request.prototype.applySnapshotChunk = null; - let $oneOfFields; - Object.defineProperty(Request.prototype, "value", { - get: $util.oneOfGetter( - ($oneOfFields = [ - "echo", - "flush", - "info", - "setOption", - "initChain", - "query", - "beginBlock", - "checkTx", - "deliverTx", - "endBlock", - "commit", - "listSnapshots", - "offerSnapshot", - "loadSnapshotChunk", - "applySnapshotChunk", - ]), - ), - set: $util.oneOfSetter($oneOfFields), - }); - Request.create = function create(properties) { - return new Request(properties); - }; - Request.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.echo != null && Object.hasOwnProperty.call(m, "echo")) - $root.tendermint.abci.RequestEcho.encode(m.echo, w.uint32(10).fork()).ldelim(); - if (m.flush != null && Object.hasOwnProperty.call(m, "flush")) - $root.tendermint.abci.RequestFlush.encode(m.flush, w.uint32(18).fork()).ldelim(); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) - $root.tendermint.abci.RequestInfo.encode(m.info, w.uint32(26).fork()).ldelim(); - if (m.setOption != null && Object.hasOwnProperty.call(m, "setOption")) - $root.tendermint.abci.RequestSetOption.encode(m.setOption, w.uint32(34).fork()).ldelim(); - if (m.initChain != null && Object.hasOwnProperty.call(m, "initChain")) - $root.tendermint.abci.RequestInitChain.encode(m.initChain, w.uint32(42).fork()).ldelim(); - if (m.query != null && Object.hasOwnProperty.call(m, "query")) - $root.tendermint.abci.RequestQuery.encode(m.query, w.uint32(50).fork()).ldelim(); - if (m.beginBlock != null && Object.hasOwnProperty.call(m, "beginBlock")) - $root.tendermint.abci.RequestBeginBlock.encode(m.beginBlock, w.uint32(58).fork()).ldelim(); - if (m.checkTx != null && Object.hasOwnProperty.call(m, "checkTx")) - $root.tendermint.abci.RequestCheckTx.encode(m.checkTx, w.uint32(66).fork()).ldelim(); - if (m.deliverTx != null && Object.hasOwnProperty.call(m, "deliverTx")) - $root.tendermint.abci.RequestDeliverTx.encode(m.deliverTx, w.uint32(74).fork()).ldelim(); - if (m.endBlock != null && Object.hasOwnProperty.call(m, "endBlock")) - $root.tendermint.abci.RequestEndBlock.encode(m.endBlock, w.uint32(82).fork()).ldelim(); - if (m.commit != null && Object.hasOwnProperty.call(m, "commit")) - $root.tendermint.abci.RequestCommit.encode(m.commit, w.uint32(90).fork()).ldelim(); - if (m.listSnapshots != null && Object.hasOwnProperty.call(m, "listSnapshots")) - $root.tendermint.abci.RequestListSnapshots.encode(m.listSnapshots, w.uint32(98).fork()).ldelim(); - if (m.offerSnapshot != null && Object.hasOwnProperty.call(m, "offerSnapshot")) - $root.tendermint.abci.RequestOfferSnapshot.encode(m.offerSnapshot, w.uint32(106).fork()).ldelim(); - if (m.loadSnapshotChunk != null && Object.hasOwnProperty.call(m, "loadSnapshotChunk")) - $root.tendermint.abci.RequestLoadSnapshotChunk.encode( - m.loadSnapshotChunk, - w.uint32(114).fork(), - ).ldelim(); - if (m.applySnapshotChunk != null && Object.hasOwnProperty.call(m, "applySnapshotChunk")) - $root.tendermint.abci.RequestApplySnapshotChunk.encode( - m.applySnapshotChunk, - w.uint32(122).fork(), - ).ldelim(); - return w; - }; - Request.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Request(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.echo = $root.tendermint.abci.RequestEcho.decode(r, r.uint32()); - break; - case 2: - m.flush = $root.tendermint.abci.RequestFlush.decode(r, r.uint32()); - break; - case 3: - m.info = $root.tendermint.abci.RequestInfo.decode(r, r.uint32()); - break; - case 4: - m.setOption = $root.tendermint.abci.RequestSetOption.decode(r, r.uint32()); - break; - case 5: - m.initChain = $root.tendermint.abci.RequestInitChain.decode(r, r.uint32()); - break; - case 6: - m.query = $root.tendermint.abci.RequestQuery.decode(r, r.uint32()); - break; - case 7: - m.beginBlock = $root.tendermint.abci.RequestBeginBlock.decode(r, r.uint32()); - break; - case 8: - m.checkTx = $root.tendermint.abci.RequestCheckTx.decode(r, r.uint32()); - break; - case 9: - m.deliverTx = $root.tendermint.abci.RequestDeliverTx.decode(r, r.uint32()); - break; - case 10: - m.endBlock = $root.tendermint.abci.RequestEndBlock.decode(r, r.uint32()); - break; - case 11: - m.commit = $root.tendermint.abci.RequestCommit.decode(r, r.uint32()); - break; - case 12: - m.listSnapshots = $root.tendermint.abci.RequestListSnapshots.decode(r, r.uint32()); - break; - case 13: - m.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(r, r.uint32()); - break; - case 14: - m.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(r, r.uint32()); - break; - case 15: - m.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Request; - })(); - abci.RequestEcho = (function () { - function RequestEcho(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestEcho.prototype.message = ""; - RequestEcho.create = function create(properties) { - return new RequestEcho(properties); - }; - RequestEcho.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.message != null && Object.hasOwnProperty.call(m, "message")) w.uint32(10).string(m.message); - return w; - }; - RequestEcho.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestEcho(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.message = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestEcho; - })(); - abci.RequestFlush = (function () { - function RequestFlush(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestFlush.create = function create(properties) { - return new RequestFlush(properties); - }; - RequestFlush.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - RequestFlush.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestFlush(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestFlush; - })(); - abci.RequestInfo = (function () { - function RequestInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestInfo.prototype.version = ""; - RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - RequestInfo.create = function create(properties) { - return new RequestInfo(properties); - }; - RequestInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.version != null && Object.hasOwnProperty.call(m, "version")) w.uint32(10).string(m.version); - if (m.blockVersion != null && Object.hasOwnProperty.call(m, "blockVersion")) - w.uint32(16).uint64(m.blockVersion); - if (m.p2pVersion != null && Object.hasOwnProperty.call(m, "p2pVersion")) - w.uint32(24).uint64(m.p2pVersion); - return w; - }; - RequestInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.version = r.string(); - break; - case 2: - m.blockVersion = r.uint64(); - break; - case 3: - m.p2pVersion = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestInfo; - })(); - abci.RequestSetOption = (function () { - function RequestSetOption(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestSetOption.prototype.key = ""; - RequestSetOption.prototype.value = ""; - RequestSetOption.create = function create(properties) { - return new RequestSetOption(properties); - }; - RequestSetOption.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).string(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).string(m.value); - return w; - }; - RequestSetOption.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestSetOption(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.string(); - break; - case 2: - m.value = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestSetOption; - })(); - abci.RequestInitChain = (function () { - function RequestInitChain(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestInitChain.prototype.time = null; - RequestInitChain.prototype.chainId = ""; - RequestInitChain.prototype.consensusParams = null; - RequestInitChain.prototype.validators = $util.emptyArray; - RequestInitChain.prototype.appStateBytes = $util.newBuffer([]); - RequestInitChain.prototype.initialHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - RequestInitChain.create = function create(properties) { - return new RequestInitChain(properties); - }; - RequestInitChain.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.time != null && Object.hasOwnProperty.call(m, "time")) - $root.google.protobuf.Timestamp.encode(m.time, w.uint32(10).fork()).ldelim(); - if (m.chainId != null && Object.hasOwnProperty.call(m, "chainId")) w.uint32(18).string(m.chainId); - if (m.consensusParams != null && Object.hasOwnProperty.call(m, "consensusParams")) - $root.tendermint.abci.ConsensusParams.encode(m.consensusParams, w.uint32(26).fork()).ldelim(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(m.validators[i], w.uint32(34).fork()).ldelim(); - } - if (m.appStateBytes != null && Object.hasOwnProperty.call(m, "appStateBytes")) - w.uint32(42).bytes(m.appStateBytes); - if (m.initialHeight != null && Object.hasOwnProperty.call(m, "initialHeight")) - w.uint32(48).int64(m.initialHeight); - return w; - }; - RequestInitChain.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestInitChain(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.time = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 2: - m.chainId = r.string(); - break; - case 3: - m.consensusParams = $root.tendermint.abci.ConsensusParams.decode(r, r.uint32()); - break; - case 4: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push($root.tendermint.abci.ValidatorUpdate.decode(r, r.uint32())); - break; - case 5: - m.appStateBytes = r.bytes(); - break; - case 6: - m.initialHeight = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestInitChain; - })(); - abci.RequestQuery = (function () { - function RequestQuery(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestQuery.prototype.data = $util.newBuffer([]); - RequestQuery.prototype.path = ""; - RequestQuery.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - RequestQuery.prototype.prove = false; - RequestQuery.create = function create(properties) { - return new RequestQuery(properties); - }; - RequestQuery.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(10).bytes(m.data); - if (m.path != null && Object.hasOwnProperty.call(m, "path")) w.uint32(18).string(m.path); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(24).int64(m.height); - if (m.prove != null && Object.hasOwnProperty.call(m, "prove")) w.uint32(32).bool(m.prove); - return w; - }; - RequestQuery.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestQuery(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.data = r.bytes(); - break; - case 2: - m.path = r.string(); - break; - case 3: - m.height = r.int64(); - break; - case 4: - m.prove = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestQuery; - })(); - abci.RequestBeginBlock = (function () { - function RequestBeginBlock(p) { - this.byzantineValidators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestBeginBlock.prototype.hash = $util.newBuffer([]); - RequestBeginBlock.prototype.header = null; - RequestBeginBlock.prototype.lastCommitInfo = null; - RequestBeginBlock.prototype.byzantineValidators = $util.emptyArray; - RequestBeginBlock.create = function create(properties) { - return new RequestBeginBlock(properties); - }; - RequestBeginBlock.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(10).bytes(m.hash); - if (m.header != null && Object.hasOwnProperty.call(m, "header")) - $root.tendermint.types.Header.encode(m.header, w.uint32(18).fork()).ldelim(); - if (m.lastCommitInfo != null && Object.hasOwnProperty.call(m, "lastCommitInfo")) - $root.tendermint.abci.LastCommitInfo.encode(m.lastCommitInfo, w.uint32(26).fork()).ldelim(); - if (m.byzantineValidators != null && m.byzantineValidators.length) { - for (var i = 0; i < m.byzantineValidators.length; ++i) - $root.tendermint.abci.Evidence.encode(m.byzantineValidators[i], w.uint32(34).fork()).ldelim(); - } - return w; - }; - RequestBeginBlock.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestBeginBlock(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hash = r.bytes(); - break; - case 2: - m.header = $root.tendermint.types.Header.decode(r, r.uint32()); - break; - case 3: - m.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.decode(r, r.uint32()); - break; - case 4: - if (!(m.byzantineValidators && m.byzantineValidators.length)) m.byzantineValidators = []; - m.byzantineValidators.push($root.tendermint.abci.Evidence.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestBeginBlock; - })(); - abci.CheckTxType = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "NEW")] = 0; - values[(valuesById[1] = "RECHECK")] = 1; - return values; - })(); - abci.RequestCheckTx = (function () { - function RequestCheckTx(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestCheckTx.prototype.tx = $util.newBuffer([]); - RequestCheckTx.prototype.type = 0; - RequestCheckTx.create = function create(properties) { - return new RequestCheckTx(properties); - }; - RequestCheckTx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.tx != null && Object.hasOwnProperty.call(m, "tx")) w.uint32(10).bytes(m.tx); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(16).int32(m.type); - return w; - }; - RequestCheckTx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestCheckTx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.tx = r.bytes(); - break; - case 2: - m.type = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestCheckTx; - })(); - abci.RequestDeliverTx = (function () { - function RequestDeliverTx(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestDeliverTx.prototype.tx = $util.newBuffer([]); - RequestDeliverTx.create = function create(properties) { - return new RequestDeliverTx(properties); - }; - RequestDeliverTx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.tx != null && Object.hasOwnProperty.call(m, "tx")) w.uint32(10).bytes(m.tx); - return w; - }; - RequestDeliverTx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestDeliverTx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.tx = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestDeliverTx; - })(); - abci.RequestEndBlock = (function () { - function RequestEndBlock(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - RequestEndBlock.create = function create(properties) { - return new RequestEndBlock(properties); - }; - RequestEndBlock.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).int64(m.height); - return w; - }; - RequestEndBlock.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestEndBlock(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestEndBlock; - })(); - abci.RequestCommit = (function () { - function RequestCommit(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestCommit.create = function create(properties) { - return new RequestCommit(properties); - }; - RequestCommit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - RequestCommit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestCommit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestCommit; - })(); - abci.RequestListSnapshots = (function () { - function RequestListSnapshots(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestListSnapshots.create = function create(properties) { - return new RequestListSnapshots(properties); - }; - RequestListSnapshots.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - RequestListSnapshots.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestListSnapshots(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestListSnapshots; - })(); - abci.RequestOfferSnapshot = (function () { - function RequestOfferSnapshot(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestOfferSnapshot.prototype.snapshot = null; - RequestOfferSnapshot.prototype.appHash = $util.newBuffer([]); - RequestOfferSnapshot.create = function create(properties) { - return new RequestOfferSnapshot(properties); - }; - RequestOfferSnapshot.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.snapshot != null && Object.hasOwnProperty.call(m, "snapshot")) - $root.tendermint.abci.Snapshot.encode(m.snapshot, w.uint32(10).fork()).ldelim(); - if (m.appHash != null && Object.hasOwnProperty.call(m, "appHash")) w.uint32(18).bytes(m.appHash); - return w; - }; - RequestOfferSnapshot.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestOfferSnapshot(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.snapshot = $root.tendermint.abci.Snapshot.decode(r, r.uint32()); - break; - case 2: - m.appHash = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestOfferSnapshot; - })(); - abci.RequestLoadSnapshotChunk = (function () { - function RequestLoadSnapshotChunk(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestLoadSnapshotChunk.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - RequestLoadSnapshotChunk.prototype.format = 0; - RequestLoadSnapshotChunk.prototype.chunk = 0; - RequestLoadSnapshotChunk.create = function create(properties) { - return new RequestLoadSnapshotChunk(properties); - }; - RequestLoadSnapshotChunk.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).uint64(m.height); - if (m.format != null && Object.hasOwnProperty.call(m, "format")) w.uint32(16).uint32(m.format); - if (m.chunk != null && Object.hasOwnProperty.call(m, "chunk")) w.uint32(24).uint32(m.chunk); - return w; - }; - RequestLoadSnapshotChunk.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestLoadSnapshotChunk(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.uint64(); - break; - case 2: - m.format = r.uint32(); - break; - case 3: - m.chunk = r.uint32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestLoadSnapshotChunk; - })(); - abci.RequestApplySnapshotChunk = (function () { - function RequestApplySnapshotChunk(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - RequestApplySnapshotChunk.prototype.index = 0; - RequestApplySnapshotChunk.prototype.chunk = $util.newBuffer([]); - RequestApplySnapshotChunk.prototype.sender = ""; - RequestApplySnapshotChunk.create = function create(properties) { - return new RequestApplySnapshotChunk(properties); - }; - RequestApplySnapshotChunk.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(8).uint32(m.index); - if (m.chunk != null && Object.hasOwnProperty.call(m, "chunk")) w.uint32(18).bytes(m.chunk); - if (m.sender != null && Object.hasOwnProperty.call(m, "sender")) w.uint32(26).string(m.sender); - return w; - }; - RequestApplySnapshotChunk.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.RequestApplySnapshotChunk(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.index = r.uint32(); - break; - case 2: - m.chunk = r.bytes(); - break; - case 3: - m.sender = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return RequestApplySnapshotChunk; - })(); - abci.Response = (function () { - function Response(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Response.prototype.exception = null; - Response.prototype.echo = null; - Response.prototype.flush = null; - Response.prototype.info = null; - Response.prototype.setOption = null; - Response.prototype.initChain = null; - Response.prototype.query = null; - Response.prototype.beginBlock = null; - Response.prototype.checkTx = null; - Response.prototype.deliverTx = null; - Response.prototype.endBlock = null; - Response.prototype.commit = null; - Response.prototype.listSnapshots = null; - Response.prototype.offerSnapshot = null; - Response.prototype.loadSnapshotChunk = null; - Response.prototype.applySnapshotChunk = null; - let $oneOfFields; - Object.defineProperty(Response.prototype, "value", { - get: $util.oneOfGetter( - ($oneOfFields = [ - "exception", - "echo", - "flush", - "info", - "setOption", - "initChain", - "query", - "beginBlock", - "checkTx", - "deliverTx", - "endBlock", - "commit", - "listSnapshots", - "offerSnapshot", - "loadSnapshotChunk", - "applySnapshotChunk", - ]), - ), - set: $util.oneOfSetter($oneOfFields), - }); - Response.create = function create(properties) { - return new Response(properties); - }; - Response.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.exception != null && Object.hasOwnProperty.call(m, "exception")) - $root.tendermint.abci.ResponseException.encode(m.exception, w.uint32(10).fork()).ldelim(); - if (m.echo != null && Object.hasOwnProperty.call(m, "echo")) - $root.tendermint.abci.ResponseEcho.encode(m.echo, w.uint32(18).fork()).ldelim(); - if (m.flush != null && Object.hasOwnProperty.call(m, "flush")) - $root.tendermint.abci.ResponseFlush.encode(m.flush, w.uint32(26).fork()).ldelim(); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) - $root.tendermint.abci.ResponseInfo.encode(m.info, w.uint32(34).fork()).ldelim(); - if (m.setOption != null && Object.hasOwnProperty.call(m, "setOption")) - $root.tendermint.abci.ResponseSetOption.encode(m.setOption, w.uint32(42).fork()).ldelim(); - if (m.initChain != null && Object.hasOwnProperty.call(m, "initChain")) - $root.tendermint.abci.ResponseInitChain.encode(m.initChain, w.uint32(50).fork()).ldelim(); - if (m.query != null && Object.hasOwnProperty.call(m, "query")) - $root.tendermint.abci.ResponseQuery.encode(m.query, w.uint32(58).fork()).ldelim(); - if (m.beginBlock != null && Object.hasOwnProperty.call(m, "beginBlock")) - $root.tendermint.abci.ResponseBeginBlock.encode(m.beginBlock, w.uint32(66).fork()).ldelim(); - if (m.checkTx != null && Object.hasOwnProperty.call(m, "checkTx")) - $root.tendermint.abci.ResponseCheckTx.encode(m.checkTx, w.uint32(74).fork()).ldelim(); - if (m.deliverTx != null && Object.hasOwnProperty.call(m, "deliverTx")) - $root.tendermint.abci.ResponseDeliverTx.encode(m.deliverTx, w.uint32(82).fork()).ldelim(); - if (m.endBlock != null && Object.hasOwnProperty.call(m, "endBlock")) - $root.tendermint.abci.ResponseEndBlock.encode(m.endBlock, w.uint32(90).fork()).ldelim(); - if (m.commit != null && Object.hasOwnProperty.call(m, "commit")) - $root.tendermint.abci.ResponseCommit.encode(m.commit, w.uint32(98).fork()).ldelim(); - if (m.listSnapshots != null && Object.hasOwnProperty.call(m, "listSnapshots")) - $root.tendermint.abci.ResponseListSnapshots.encode(m.listSnapshots, w.uint32(106).fork()).ldelim(); - if (m.offerSnapshot != null && Object.hasOwnProperty.call(m, "offerSnapshot")) - $root.tendermint.abci.ResponseOfferSnapshot.encode(m.offerSnapshot, w.uint32(114).fork()).ldelim(); - if (m.loadSnapshotChunk != null && Object.hasOwnProperty.call(m, "loadSnapshotChunk")) - $root.tendermint.abci.ResponseLoadSnapshotChunk.encode( - m.loadSnapshotChunk, - w.uint32(122).fork(), - ).ldelim(); - if (m.applySnapshotChunk != null && Object.hasOwnProperty.call(m, "applySnapshotChunk")) - $root.tendermint.abci.ResponseApplySnapshotChunk.encode( - m.applySnapshotChunk, - w.uint32(130).fork(), - ).ldelim(); - return w; - }; - Response.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Response(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.exception = $root.tendermint.abci.ResponseException.decode(r, r.uint32()); - break; - case 2: - m.echo = $root.tendermint.abci.ResponseEcho.decode(r, r.uint32()); - break; - case 3: - m.flush = $root.tendermint.abci.ResponseFlush.decode(r, r.uint32()); - break; - case 4: - m.info = $root.tendermint.abci.ResponseInfo.decode(r, r.uint32()); - break; - case 5: - m.setOption = $root.tendermint.abci.ResponseSetOption.decode(r, r.uint32()); - break; - case 6: - m.initChain = $root.tendermint.abci.ResponseInitChain.decode(r, r.uint32()); - break; - case 7: - m.query = $root.tendermint.abci.ResponseQuery.decode(r, r.uint32()); - break; - case 8: - m.beginBlock = $root.tendermint.abci.ResponseBeginBlock.decode(r, r.uint32()); - break; - case 9: - m.checkTx = $root.tendermint.abci.ResponseCheckTx.decode(r, r.uint32()); - break; - case 10: - m.deliverTx = $root.tendermint.abci.ResponseDeliverTx.decode(r, r.uint32()); - break; - case 11: - m.endBlock = $root.tendermint.abci.ResponseEndBlock.decode(r, r.uint32()); - break; - case 12: - m.commit = $root.tendermint.abci.ResponseCommit.decode(r, r.uint32()); - break; - case 13: - m.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.decode(r, r.uint32()); - break; - case 14: - m.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(r, r.uint32()); - break; - case 15: - m.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(r, r.uint32()); - break; - case 16: - m.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Response; - })(); - abci.ResponseException = (function () { - function ResponseException(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseException.prototype.error = ""; - ResponseException.create = function create(properties) { - return new ResponseException(properties); - }; - ResponseException.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.error != null && Object.hasOwnProperty.call(m, "error")) w.uint32(10).string(m.error); - return w; - }; - ResponseException.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseException(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.error = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseException; - })(); - abci.ResponseEcho = (function () { - function ResponseEcho(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseEcho.prototype.message = ""; - ResponseEcho.create = function create(properties) { - return new ResponseEcho(properties); - }; - ResponseEcho.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.message != null && Object.hasOwnProperty.call(m, "message")) w.uint32(10).string(m.message); - return w; - }; - ResponseEcho.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseEcho(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.message = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseEcho; - })(); - abci.ResponseFlush = (function () { - function ResponseFlush(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseFlush.create = function create(properties) { - return new ResponseFlush(properties); - }; - ResponseFlush.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - ResponseFlush.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseFlush(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseFlush; - })(); - abci.ResponseInfo = (function () { - function ResponseInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseInfo.prototype.data = ""; - ResponseInfo.prototype.version = ""; - ResponseInfo.prototype.appVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - ResponseInfo.prototype.lastBlockHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseInfo.prototype.lastBlockAppHash = $util.newBuffer([]); - ResponseInfo.create = function create(properties) { - return new ResponseInfo(properties); - }; - ResponseInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(10).string(m.data); - if (m.version != null && Object.hasOwnProperty.call(m, "version")) w.uint32(18).string(m.version); - if (m.appVersion != null && Object.hasOwnProperty.call(m, "appVersion")) - w.uint32(24).uint64(m.appVersion); - if (m.lastBlockHeight != null && Object.hasOwnProperty.call(m, "lastBlockHeight")) - w.uint32(32).int64(m.lastBlockHeight); - if (m.lastBlockAppHash != null && Object.hasOwnProperty.call(m, "lastBlockAppHash")) - w.uint32(42).bytes(m.lastBlockAppHash); - return w; - }; - ResponseInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.data = r.string(); - break; - case 2: - m.version = r.string(); - break; - case 3: - m.appVersion = r.uint64(); - break; - case 4: - m.lastBlockHeight = r.int64(); - break; - case 5: - m.lastBlockAppHash = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseInfo; - })(); - abci.ResponseSetOption = (function () { - function ResponseSetOption(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseSetOption.prototype.code = 0; - ResponseSetOption.prototype.log = ""; - ResponseSetOption.prototype.info = ""; - ResponseSetOption.create = function create(properties) { - return new ResponseSetOption(properties); - }; - ResponseSetOption.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.code != null && Object.hasOwnProperty.call(m, "code")) w.uint32(8).uint32(m.code); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(26).string(m.log); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) w.uint32(34).string(m.info); - return w; - }; - ResponseSetOption.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseSetOption(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.code = r.uint32(); - break; - case 3: - m.log = r.string(); - break; - case 4: - m.info = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseSetOption; - })(); - abci.ResponseInitChain = (function () { - function ResponseInitChain(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseInitChain.prototype.consensusParams = null; - ResponseInitChain.prototype.validators = $util.emptyArray; - ResponseInitChain.prototype.appHash = $util.newBuffer([]); - ResponseInitChain.create = function create(properties) { - return new ResponseInitChain(properties); - }; - ResponseInitChain.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.consensusParams != null && Object.hasOwnProperty.call(m, "consensusParams")) - $root.tendermint.abci.ConsensusParams.encode(m.consensusParams, w.uint32(10).fork()).ldelim(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(m.validators[i], w.uint32(18).fork()).ldelim(); - } - if (m.appHash != null && Object.hasOwnProperty.call(m, "appHash")) w.uint32(26).bytes(m.appHash); - return w; - }; - ResponseInitChain.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseInitChain(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.consensusParams = $root.tendermint.abci.ConsensusParams.decode(r, r.uint32()); - break; - case 2: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push($root.tendermint.abci.ValidatorUpdate.decode(r, r.uint32())); - break; - case 3: - m.appHash = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseInitChain; - })(); - abci.ResponseQuery = (function () { - function ResponseQuery(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseQuery.prototype.code = 0; - ResponseQuery.prototype.log = ""; - ResponseQuery.prototype.info = ""; - ResponseQuery.prototype.index = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseQuery.prototype.key = $util.newBuffer([]); - ResponseQuery.prototype.value = $util.newBuffer([]); - ResponseQuery.prototype.proofOps = null; - ResponseQuery.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseQuery.prototype.codespace = ""; - ResponseQuery.create = function create(properties) { - return new ResponseQuery(properties); - }; - ResponseQuery.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.code != null && Object.hasOwnProperty.call(m, "code")) w.uint32(8).uint32(m.code); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(26).string(m.log); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) w.uint32(34).string(m.info); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(40).int64(m.index); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(50).bytes(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(58).bytes(m.value); - if (m.proofOps != null && Object.hasOwnProperty.call(m, "proofOps")) - $root.tendermint.crypto.ProofOps.encode(m.proofOps, w.uint32(66).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(72).int64(m.height); - if (m.codespace != null && Object.hasOwnProperty.call(m, "codespace")) - w.uint32(82).string(m.codespace); - return w; - }; - ResponseQuery.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseQuery(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.code = r.uint32(); - break; - case 3: - m.log = r.string(); - break; - case 4: - m.info = r.string(); - break; - case 5: - m.index = r.int64(); - break; - case 6: - m.key = r.bytes(); - break; - case 7: - m.value = r.bytes(); - break; - case 8: - m.proofOps = $root.tendermint.crypto.ProofOps.decode(r, r.uint32()); - break; - case 9: - m.height = r.int64(); - break; - case 10: - m.codespace = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseQuery; - })(); - abci.ResponseBeginBlock = (function () { - function ResponseBeginBlock(p) { - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseBeginBlock.prototype.events = $util.emptyArray; - ResponseBeginBlock.create = function create(properties) { - return new ResponseBeginBlock(properties); - }; - ResponseBeginBlock.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.tendermint.abci.Event.encode(m.events[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - ResponseBeginBlock.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseBeginBlock(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.tendermint.abci.Event.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseBeginBlock; - })(); - abci.ResponseCheckTx = (function () { - function ResponseCheckTx(p) { - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseCheckTx.prototype.code = 0; - ResponseCheckTx.prototype.data = $util.newBuffer([]); - ResponseCheckTx.prototype.log = ""; - ResponseCheckTx.prototype.info = ""; - ResponseCheckTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseCheckTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseCheckTx.prototype.events = $util.emptyArray; - ResponseCheckTx.prototype.codespace = ""; - ResponseCheckTx.create = function create(properties) { - return new ResponseCheckTx(properties); - }; - ResponseCheckTx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.code != null && Object.hasOwnProperty.call(m, "code")) w.uint32(8).uint32(m.code); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(18).bytes(m.data); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(26).string(m.log); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) w.uint32(34).string(m.info); - if (m.gasWanted != null && Object.hasOwnProperty.call(m, "gasWanted")) - w.uint32(40).int64(m.gasWanted); - if (m.gasUsed != null && Object.hasOwnProperty.call(m, "gasUsed")) w.uint32(48).int64(m.gasUsed); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.tendermint.abci.Event.encode(m.events[i], w.uint32(58).fork()).ldelim(); - } - if (m.codespace != null && Object.hasOwnProperty.call(m, "codespace")) - w.uint32(66).string(m.codespace); - return w; - }; - ResponseCheckTx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseCheckTx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.code = r.uint32(); - break; - case 2: - m.data = r.bytes(); - break; - case 3: - m.log = r.string(); - break; - case 4: - m.info = r.string(); - break; - case 5: - m.gasWanted = r.int64(); - break; - case 6: - m.gasUsed = r.int64(); - break; - case 7: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.tendermint.abci.Event.decode(r, r.uint32())); - break; - case 8: - m.codespace = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseCheckTx; - })(); - abci.ResponseDeliverTx = (function () { - function ResponseDeliverTx(p) { - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseDeliverTx.prototype.code = 0; - ResponseDeliverTx.prototype.data = $util.newBuffer([]); - ResponseDeliverTx.prototype.log = ""; - ResponseDeliverTx.prototype.info = ""; - ResponseDeliverTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseDeliverTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseDeliverTx.prototype.events = $util.emptyArray; - ResponseDeliverTx.prototype.codespace = ""; - ResponseDeliverTx.create = function create(properties) { - return new ResponseDeliverTx(properties); - }; - ResponseDeliverTx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.code != null && Object.hasOwnProperty.call(m, "code")) w.uint32(8).uint32(m.code); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(18).bytes(m.data); - if (m.log != null && Object.hasOwnProperty.call(m, "log")) w.uint32(26).string(m.log); - if (m.info != null && Object.hasOwnProperty.call(m, "info")) w.uint32(34).string(m.info); - if (m.gasWanted != null && Object.hasOwnProperty.call(m, "gasWanted")) - w.uint32(40).int64(m.gasWanted); - if (m.gasUsed != null && Object.hasOwnProperty.call(m, "gasUsed")) w.uint32(48).int64(m.gasUsed); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.tendermint.abci.Event.encode(m.events[i], w.uint32(58).fork()).ldelim(); - } - if (m.codespace != null && Object.hasOwnProperty.call(m, "codespace")) - w.uint32(66).string(m.codespace); - return w; - }; - ResponseDeliverTx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseDeliverTx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.code = r.uint32(); - break; - case 2: - m.data = r.bytes(); - break; - case 3: - m.log = r.string(); - break; - case 4: - m.info = r.string(); - break; - case 5: - m.gasWanted = r.int64(); - break; - case 6: - m.gasUsed = r.int64(); - break; - case 7: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.tendermint.abci.Event.decode(r, r.uint32())); - break; - case 8: - m.codespace = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseDeliverTx; - })(); - abci.ResponseEndBlock = (function () { - function ResponseEndBlock(p) { - this.validatorUpdates = []; - this.events = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseEndBlock.prototype.validatorUpdates = $util.emptyArray; - ResponseEndBlock.prototype.consensusParamUpdates = null; - ResponseEndBlock.prototype.events = $util.emptyArray; - ResponseEndBlock.create = function create(properties) { - return new ResponseEndBlock(properties); - }; - ResponseEndBlock.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validatorUpdates != null && m.validatorUpdates.length) { - for (var i = 0; i < m.validatorUpdates.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(m.validatorUpdates[i], w.uint32(10).fork()).ldelim(); - } - if (m.consensusParamUpdates != null && Object.hasOwnProperty.call(m, "consensusParamUpdates")) - $root.tendermint.abci.ConsensusParams.encode(m.consensusParamUpdates, w.uint32(18).fork()).ldelim(); - if (m.events != null && m.events.length) { - for (var i = 0; i < m.events.length; ++i) - $root.tendermint.abci.Event.encode(m.events[i], w.uint32(26).fork()).ldelim(); - } - return w; - }; - ResponseEndBlock.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseEndBlock(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validatorUpdates && m.validatorUpdates.length)) m.validatorUpdates = []; - m.validatorUpdates.push($root.tendermint.abci.ValidatorUpdate.decode(r, r.uint32())); - break; - case 2: - m.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.decode(r, r.uint32()); - break; - case 3: - if (!(m.events && m.events.length)) m.events = []; - m.events.push($root.tendermint.abci.Event.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseEndBlock; - })(); - abci.ResponseCommit = (function () { - function ResponseCommit(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseCommit.prototype.data = $util.newBuffer([]); - ResponseCommit.prototype.retainHeight = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ResponseCommit.create = function create(properties) { - return new ResponseCommit(properties); - }; - ResponseCommit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(18).bytes(m.data); - if (m.retainHeight != null && Object.hasOwnProperty.call(m, "retainHeight")) - w.uint32(24).int64(m.retainHeight); - return w; - }; - ResponseCommit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseCommit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 2: - m.data = r.bytes(); - break; - case 3: - m.retainHeight = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseCommit; - })(); - abci.ResponseListSnapshots = (function () { - function ResponseListSnapshots(p) { - this.snapshots = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseListSnapshots.prototype.snapshots = $util.emptyArray; - ResponseListSnapshots.create = function create(properties) { - return new ResponseListSnapshots(properties); - }; - ResponseListSnapshots.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.snapshots != null && m.snapshots.length) { - for (var i = 0; i < m.snapshots.length; ++i) - $root.tendermint.abci.Snapshot.encode(m.snapshots[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - ResponseListSnapshots.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseListSnapshots(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.snapshots && m.snapshots.length)) m.snapshots = []; - m.snapshots.push($root.tendermint.abci.Snapshot.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseListSnapshots; - })(); - abci.ResponseOfferSnapshot = (function () { - function ResponseOfferSnapshot(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseOfferSnapshot.prototype.result = 0; - ResponseOfferSnapshot.create = function create(properties) { - return new ResponseOfferSnapshot(properties); - }; - ResponseOfferSnapshot.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.result != null && Object.hasOwnProperty.call(m, "result")) w.uint32(8).int32(m.result); - return w; - }; - ResponseOfferSnapshot.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseOfferSnapshot(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.result = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - ResponseOfferSnapshot.Result = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "UNKNOWN")] = 0; - values[(valuesById[1] = "ACCEPT")] = 1; - values[(valuesById[2] = "ABORT")] = 2; - values[(valuesById[3] = "REJECT")] = 3; - values[(valuesById[4] = "REJECT_FORMAT")] = 4; - values[(valuesById[5] = "REJECT_SENDER")] = 5; - return values; - })(); - return ResponseOfferSnapshot; - })(); - abci.ResponseLoadSnapshotChunk = (function () { - function ResponseLoadSnapshotChunk(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseLoadSnapshotChunk.prototype.chunk = $util.newBuffer([]); - ResponseLoadSnapshotChunk.create = function create(properties) { - return new ResponseLoadSnapshotChunk(properties); - }; - ResponseLoadSnapshotChunk.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.chunk != null && Object.hasOwnProperty.call(m, "chunk")) w.uint32(10).bytes(m.chunk); - return w; - }; - ResponseLoadSnapshotChunk.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.chunk = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ResponseLoadSnapshotChunk; - })(); - abci.ResponseApplySnapshotChunk = (function () { - function ResponseApplySnapshotChunk(p) { - this.refetchChunks = []; - this.rejectSenders = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ResponseApplySnapshotChunk.prototype.result = 0; - ResponseApplySnapshotChunk.prototype.refetchChunks = $util.emptyArray; - ResponseApplySnapshotChunk.prototype.rejectSenders = $util.emptyArray; - ResponseApplySnapshotChunk.create = function create(properties) { - return new ResponseApplySnapshotChunk(properties); - }; - ResponseApplySnapshotChunk.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.result != null && Object.hasOwnProperty.call(m, "result")) w.uint32(8).int32(m.result); - if (m.refetchChunks != null && m.refetchChunks.length) { - w.uint32(18).fork(); - for (var i = 0; i < m.refetchChunks.length; ++i) w.uint32(m.refetchChunks[i]); - w.ldelim(); - } - if (m.rejectSenders != null && m.rejectSenders.length) { - for (var i = 0; i < m.rejectSenders.length; ++i) w.uint32(26).string(m.rejectSenders[i]); - } - return w; - }; - ResponseApplySnapshotChunk.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ResponseApplySnapshotChunk(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.result = r.int32(); - break; - case 2: - if (!(m.refetchChunks && m.refetchChunks.length)) m.refetchChunks = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.refetchChunks.push(r.uint32()); - } else m.refetchChunks.push(r.uint32()); - break; - case 3: - if (!(m.rejectSenders && m.rejectSenders.length)) m.rejectSenders = []; - m.rejectSenders.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - ResponseApplySnapshotChunk.Result = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "UNKNOWN")] = 0; - values[(valuesById[1] = "ACCEPT")] = 1; - values[(valuesById[2] = "ABORT")] = 2; - values[(valuesById[3] = "RETRY")] = 3; - values[(valuesById[4] = "RETRY_SNAPSHOT")] = 4; - values[(valuesById[5] = "REJECT_SNAPSHOT")] = 5; - return values; - })(); - return ResponseApplySnapshotChunk; - })(); - abci.ConsensusParams = (function () { - function ConsensusParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ConsensusParams.prototype.block = null; - ConsensusParams.prototype.evidence = null; - ConsensusParams.prototype.validator = null; - ConsensusParams.prototype.version = null; - ConsensusParams.create = function create(properties) { - return new ConsensusParams(properties); - }; - ConsensusParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.block != null && Object.hasOwnProperty.call(m, "block")) - $root.tendermint.abci.BlockParams.encode(m.block, w.uint32(10).fork()).ldelim(); - if (m.evidence != null && Object.hasOwnProperty.call(m, "evidence")) - $root.tendermint.types.EvidenceParams.encode(m.evidence, w.uint32(18).fork()).ldelim(); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.tendermint.types.ValidatorParams.encode(m.validator, w.uint32(26).fork()).ldelim(); - if (m.version != null && Object.hasOwnProperty.call(m, "version")) - $root.tendermint.types.VersionParams.encode(m.version, w.uint32(34).fork()).ldelim(); - return w; - }; - ConsensusParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ConsensusParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.block = $root.tendermint.abci.BlockParams.decode(r, r.uint32()); - break; - case 2: - m.evidence = $root.tendermint.types.EvidenceParams.decode(r, r.uint32()); - break; - case 3: - m.validator = $root.tendermint.types.ValidatorParams.decode(r, r.uint32()); - break; - case 4: - m.version = $root.tendermint.types.VersionParams.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ConsensusParams; - })(); - abci.BlockParams = (function () { - function BlockParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockParams.create = function create(properties) { - return new BlockParams(properties); - }; - BlockParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.maxBytes != null && Object.hasOwnProperty.call(m, "maxBytes")) w.uint32(8).int64(m.maxBytes); - if (m.maxGas != null && Object.hasOwnProperty.call(m, "maxGas")) w.uint32(16).int64(m.maxGas); - return w; - }; - BlockParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.BlockParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.maxBytes = r.int64(); - break; - case 2: - m.maxGas = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BlockParams; - })(); - abci.LastCommitInfo = (function () { - function LastCommitInfo(p) { - this.votes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - LastCommitInfo.prototype.round = 0; - LastCommitInfo.prototype.votes = $util.emptyArray; - LastCommitInfo.create = function create(properties) { - return new LastCommitInfo(properties); - }; - LastCommitInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.round != null && Object.hasOwnProperty.call(m, "round")) w.uint32(8).int32(m.round); - if (m.votes != null && m.votes.length) { - for (var i = 0; i < m.votes.length; ++i) - $root.tendermint.abci.VoteInfo.encode(m.votes[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - LastCommitInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.LastCommitInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.round = r.int32(); - break; - case 2: - if (!(m.votes && m.votes.length)) m.votes = []; - m.votes.push($root.tendermint.abci.VoteInfo.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return LastCommitInfo; - })(); - abci.Event = (function () { - function Event(p) { - this.attributes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Event.prototype.type = ""; - Event.prototype.attributes = $util.emptyArray; - Event.create = function create(properties) { - return new Event(properties); - }; - Event.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(10).string(m.type); - if (m.attributes != null && m.attributes.length) { - for (var i = 0; i < m.attributes.length; ++i) - $root.tendermint.abci.EventAttribute.encode(m.attributes[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Event.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Event(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.string(); - break; - case 2: - if (!(m.attributes && m.attributes.length)) m.attributes = []; - m.attributes.push($root.tendermint.abci.EventAttribute.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Event; - })(); - abci.EventAttribute = (function () { - function EventAttribute(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EventAttribute.prototype.key = $util.newBuffer([]); - EventAttribute.prototype.value = $util.newBuffer([]); - EventAttribute.prototype.index = false; - EventAttribute.create = function create(properties) { - return new EventAttribute(properties); - }; - EventAttribute.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).bytes(m.value); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(24).bool(m.index); - return w; - }; - EventAttribute.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.EventAttribute(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.value = r.bytes(); - break; - case 3: - m.index = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EventAttribute; - })(); - abci.TxResult = (function () { - function TxResult(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxResult.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - TxResult.prototype.index = 0; - TxResult.prototype.tx = $util.newBuffer([]); - TxResult.prototype.result = null; - TxResult.create = function create(properties) { - return new TxResult(properties); - }; - TxResult.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).int64(m.height); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(16).uint32(m.index); - if (m.tx != null && Object.hasOwnProperty.call(m, "tx")) w.uint32(26).bytes(m.tx); - if (m.result != null && Object.hasOwnProperty.call(m, "result")) - $root.tendermint.abci.ResponseDeliverTx.encode(m.result, w.uint32(34).fork()).ldelim(); - return w; - }; - TxResult.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.TxResult(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.int64(); - break; - case 2: - m.index = r.uint32(); - break; - case 3: - m.tx = r.bytes(); - break; - case 4: - m.result = $root.tendermint.abci.ResponseDeliverTx.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxResult; - })(); - abci.Validator = (function () { - function Validator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Validator.prototype.address = $util.newBuffer([]); - Validator.prototype.power = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Validator.create = function create(properties) { - return new Validator(properties); - }; - Validator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).bytes(m.address); - if (m.power != null && Object.hasOwnProperty.call(m, "power")) w.uint32(24).int64(m.power); - return w; - }; - Validator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Validator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.bytes(); - break; - case 3: - m.power = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Validator; - })(); - abci.ValidatorUpdate = (function () { - function ValidatorUpdate(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorUpdate.prototype.pubKey = null; - ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ValidatorUpdate.create = function create(properties) { - return new ValidatorUpdate(properties); - }; - ValidatorUpdate.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) - $root.tendermint.crypto.PublicKey.encode(m.pubKey, w.uint32(10).fork()).ldelim(); - if (m.power != null && Object.hasOwnProperty.call(m, "power")) w.uint32(16).int64(m.power); - return w; - }; - ValidatorUpdate.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.ValidatorUpdate(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.pubKey = $root.tendermint.crypto.PublicKey.decode(r, r.uint32()); - break; - case 2: - m.power = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorUpdate; - })(); - abci.VoteInfo = (function () { - function VoteInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - VoteInfo.prototype.validator = null; - VoteInfo.prototype.signedLastBlock = false; - VoteInfo.create = function create(properties) { - return new VoteInfo(properties); - }; - VoteInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.tendermint.abci.Validator.encode(m.validator, w.uint32(10).fork()).ldelim(); - if (m.signedLastBlock != null && Object.hasOwnProperty.call(m, "signedLastBlock")) - w.uint32(16).bool(m.signedLastBlock); - return w; - }; - VoteInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.VoteInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.validator = $root.tendermint.abci.Validator.decode(r, r.uint32()); - break; - case 2: - m.signedLastBlock = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return VoteInfo; - })(); - abci.EvidenceType = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "UNKNOWN")] = 0; - values[(valuesById[1] = "DUPLICATE_VOTE")] = 1; - values[(valuesById[2] = "LIGHT_CLIENT_ATTACK")] = 2; - return values; - })(); - abci.Evidence = (function () { - function Evidence(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Evidence.prototype.type = 0; - Evidence.prototype.validator = null; - Evidence.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Evidence.prototype.time = null; - Evidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Evidence.create = function create(properties) { - return new Evidence(properties); - }; - Evidence.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(8).int32(m.type); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.tendermint.abci.Validator.encode(m.validator, w.uint32(18).fork()).ldelim(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(24).int64(m.height); - if (m.time != null && Object.hasOwnProperty.call(m, "time")) - $root.google.protobuf.Timestamp.encode(m.time, w.uint32(34).fork()).ldelim(); - if (m.totalVotingPower != null && Object.hasOwnProperty.call(m, "totalVotingPower")) - w.uint32(40).int64(m.totalVotingPower); - return w; - }; - Evidence.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Evidence(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.int32(); - break; - case 2: - m.validator = $root.tendermint.abci.Validator.decode(r, r.uint32()); - break; - case 3: - m.height = r.int64(); - break; - case 4: - m.time = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 5: - m.totalVotingPower = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Evidence; - })(); - abci.Snapshot = (function () { - function Snapshot(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Snapshot.prototype.format = 0; - Snapshot.prototype.chunks = 0; - Snapshot.prototype.hash = $util.newBuffer([]); - Snapshot.prototype.metadata = $util.newBuffer([]); - Snapshot.create = function create(properties) { - return new Snapshot(properties); - }; - Snapshot.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).uint64(m.height); - if (m.format != null && Object.hasOwnProperty.call(m, "format")) w.uint32(16).uint32(m.format); - if (m.chunks != null && Object.hasOwnProperty.call(m, "chunks")) w.uint32(24).uint32(m.chunks); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(34).bytes(m.hash); - if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata")) w.uint32(42).bytes(m.metadata); - return w; - }; - Snapshot.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.abci.Snapshot(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.uint64(); - break; - case 2: - m.format = r.uint32(); - break; - case 3: - m.chunks = r.uint32(); - break; - case 4: - m.hash = r.bytes(); - break; - case 5: - m.metadata = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Snapshot; - })(); - abci.ABCIApplication = (function () { - function ABCIApplication(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (ABCIApplication.prototype = Object.create( - $protobuf.rpc.Service.prototype, - )).constructor = ABCIApplication; - ABCIApplication.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (ABCIApplication.prototype.echo = function echo(request, callback) { - return this.rpcCall( - echo, - $root.tendermint.abci.RequestEcho, - $root.tendermint.abci.ResponseEcho, - request, - callback, - ); - }), - "name", - { value: "Echo" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.flush = function flush(request, callback) { - return this.rpcCall( - flush, - $root.tendermint.abci.RequestFlush, - $root.tendermint.abci.ResponseFlush, - request, - callback, - ); - }), - "name", - { value: "Flush" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.info = function info(request, callback) { - return this.rpcCall( - info, - $root.tendermint.abci.RequestInfo, - $root.tendermint.abci.ResponseInfo, - request, - callback, - ); - }), - "name", - { value: "Info" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.setOption = function setOption(request, callback) { - return this.rpcCall( - setOption, - $root.tendermint.abci.RequestSetOption, - $root.tendermint.abci.ResponseSetOption, - request, - callback, - ); - }), - "name", - { value: "SetOption" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.deliverTx = function deliverTx(request, callback) { - return this.rpcCall( - deliverTx, - $root.tendermint.abci.RequestDeliverTx, - $root.tendermint.abci.ResponseDeliverTx, - request, - callback, - ); - }), - "name", - { value: "DeliverTx" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.checkTx = function checkTx(request, callback) { - return this.rpcCall( - checkTx, - $root.tendermint.abci.RequestCheckTx, - $root.tendermint.abci.ResponseCheckTx, - request, - callback, - ); - }), - "name", - { value: "CheckTx" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.query = function query(request, callback) { - return this.rpcCall( - query, - $root.tendermint.abci.RequestQuery, - $root.tendermint.abci.ResponseQuery, - request, - callback, - ); - }), - "name", - { value: "Query" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.commit = function commit(request, callback) { - return this.rpcCall( - commit, - $root.tendermint.abci.RequestCommit, - $root.tendermint.abci.ResponseCommit, - request, - callback, - ); - }), - "name", - { value: "Commit" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.initChain = function initChain(request, callback) { - return this.rpcCall( - initChain, - $root.tendermint.abci.RequestInitChain, - $root.tendermint.abci.ResponseInitChain, - request, - callback, - ); - }), - "name", - { value: "InitChain" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.beginBlock = function beginBlock(request, callback) { - return this.rpcCall( - beginBlock, - $root.tendermint.abci.RequestBeginBlock, - $root.tendermint.abci.ResponseBeginBlock, - request, - callback, - ); - }), - "name", - { value: "BeginBlock" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.endBlock = function endBlock(request, callback) { - return this.rpcCall( - endBlock, - $root.tendermint.abci.RequestEndBlock, - $root.tendermint.abci.ResponseEndBlock, - request, - callback, - ); - }), - "name", - { value: "EndBlock" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.listSnapshots = function listSnapshots(request, callback) { - return this.rpcCall( - listSnapshots, - $root.tendermint.abci.RequestListSnapshots, - $root.tendermint.abci.ResponseListSnapshots, - request, - callback, - ); - }), - "name", - { value: "ListSnapshots" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.offerSnapshot = function offerSnapshot(request, callback) { - return this.rpcCall( - offerSnapshot, - $root.tendermint.abci.RequestOfferSnapshot, - $root.tendermint.abci.ResponseOfferSnapshot, - request, - callback, - ); - }), - "name", - { value: "OfferSnapshot" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.loadSnapshotChunk = function loadSnapshotChunk(request, callback) { - return this.rpcCall( - loadSnapshotChunk, - $root.tendermint.abci.RequestLoadSnapshotChunk, - $root.tendermint.abci.ResponseLoadSnapshotChunk, - request, - callback, - ); - }), - "name", - { value: "LoadSnapshotChunk" }, - ); - Object.defineProperty( - (ABCIApplication.prototype.applySnapshotChunk = function applySnapshotChunk(request, callback) { - return this.rpcCall( - applySnapshotChunk, - $root.tendermint.abci.RequestApplySnapshotChunk, - $root.tendermint.abci.ResponseApplySnapshotChunk, - request, - callback, - ); - }), - "name", - { value: "ApplySnapshotChunk" }, - ); - return ABCIApplication; - })(); - return abci; - })(); - tendermint.crypto = (function () { - const crypto = {}; - crypto.PublicKey = (function () { - function PublicKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PublicKey.prototype.ed25519 = $util.newBuffer([]); - PublicKey.prototype.secp256k1 = $util.newBuffer([]); - let $oneOfFields; - Object.defineProperty(PublicKey.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["ed25519", "secp256k1"])), - set: $util.oneOfSetter($oneOfFields), - }); - PublicKey.create = function create(properties) { - return new PublicKey(properties); - }; - PublicKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) w.uint32(10).bytes(m.ed25519); - if (m.secp256k1 != null && Object.hasOwnProperty.call(m, "secp256k1")) - w.uint32(18).bytes(m.secp256k1); - return w; - }; - PublicKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.PublicKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.ed25519 = r.bytes(); - break; - case 2: - m.secp256k1 = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PublicKey; - })(); - crypto.Proof = (function () { - function Proof(p) { - this.aunts = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Proof.prototype.total = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Proof.prototype.index = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Proof.prototype.leafHash = $util.newBuffer([]); - Proof.prototype.aunts = $util.emptyArray; - Proof.create = function create(properties) { - return new Proof(properties); - }; - Proof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.total != null && Object.hasOwnProperty.call(m, "total")) w.uint32(8).int64(m.total); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(16).int64(m.index); - if (m.leafHash != null && Object.hasOwnProperty.call(m, "leafHash")) w.uint32(26).bytes(m.leafHash); - if (m.aunts != null && m.aunts.length) { - for (var i = 0; i < m.aunts.length; ++i) w.uint32(34).bytes(m.aunts[i]); - } - return w; - }; - Proof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.Proof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.total = r.int64(); - break; - case 2: - m.index = r.int64(); - break; - case 3: - m.leafHash = r.bytes(); - break; - case 4: - if (!(m.aunts && m.aunts.length)) m.aunts = []; - m.aunts.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Proof; - })(); - crypto.ValueOp = (function () { - function ValueOp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValueOp.prototype.key = $util.newBuffer([]); - ValueOp.prototype.proof = null; - ValueOp.create = function create(properties) { - return new ValueOp(properties); - }; - ValueOp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) - $root.tendermint.crypto.Proof.encode(m.proof, w.uint32(18).fork()).ldelim(); - return w; - }; - ValueOp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.ValueOp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - case 2: - m.proof = $root.tendermint.crypto.Proof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValueOp; - })(); - crypto.DominoOp = (function () { - function DominoOp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DominoOp.prototype.key = ""; - DominoOp.prototype.input = ""; - DominoOp.prototype.output = ""; - DominoOp.create = function create(properties) { - return new DominoOp(properties); - }; - DominoOp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).string(m.key); - if (m.input != null && Object.hasOwnProperty.call(m, "input")) w.uint32(18).string(m.input); - if (m.output != null && Object.hasOwnProperty.call(m, "output")) w.uint32(26).string(m.output); - return w; - }; - DominoOp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.DominoOp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.string(); - break; - case 2: - m.input = r.string(); - break; - case 3: - m.output = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DominoOp; - })(); - crypto.ProofOp = (function () { - function ProofOp(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ProofOp.prototype.type = ""; - ProofOp.prototype.key = $util.newBuffer([]); - ProofOp.prototype.data = $util.newBuffer([]); - ProofOp.create = function create(properties) { - return new ProofOp(properties); - }; - ProofOp.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(10).string(m.type); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(18).bytes(m.key); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(26).bytes(m.data); - return w; - }; - ProofOp.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.ProofOp(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.string(); - break; - case 2: - m.key = r.bytes(); - break; - case 3: - m.data = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ProofOp; - })(); - crypto.ProofOps = (function () { - function ProofOps(p) { - this.ops = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ProofOps.prototype.ops = $util.emptyArray; - ProofOps.create = function create(properties) { - return new ProofOps(properties); - }; - ProofOps.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.ops != null && m.ops.length) { - for (var i = 0; i < m.ops.length; ++i) - $root.tendermint.crypto.ProofOp.encode(m.ops[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - ProofOps.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.ProofOps(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.ops && m.ops.length)) m.ops = []; - m.ops.push($root.tendermint.crypto.ProofOp.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ProofOps; - })(); - return crypto; - })(); - tendermint.libs = (function () { - const libs = {}; - libs.bits = (function () { - const bits = {}; - bits.BitArray = (function () { - function BitArray(p) { - this.elems = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BitArray.prototype.bits = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BitArray.prototype.elems = $util.emptyArray; - BitArray.create = function create(properties) { - return new BitArray(properties); - }; - BitArray.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bits != null && Object.hasOwnProperty.call(m, "bits")) w.uint32(8).int64(m.bits); - if (m.elems != null && m.elems.length) { - w.uint32(18).fork(); - for (var i = 0; i < m.elems.length; ++i) w.uint64(m.elems[i]); - w.ldelim(); - } - return w; - }; - BitArray.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.libs.bits.BitArray(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bits = r.int64(); - break; - case 2: - if (!(m.elems && m.elems.length)) m.elems = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) m.elems.push(r.uint64()); - } else m.elems.push(r.uint64()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BitArray; - })(); - return bits; - })(); - return libs; - })(); - tendermint.types = (function () { - const types = {}; - types.ConsensusParams = (function () { - function ConsensusParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ConsensusParams.prototype.block = null; - ConsensusParams.prototype.evidence = null; - ConsensusParams.prototype.validator = null; - ConsensusParams.prototype.version = null; - ConsensusParams.create = function create(properties) { - return new ConsensusParams(properties); - }; - ConsensusParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.block != null && Object.hasOwnProperty.call(m, "block")) - $root.tendermint.types.BlockParams.encode(m.block, w.uint32(10).fork()).ldelim(); - if (m.evidence != null && Object.hasOwnProperty.call(m, "evidence")) - $root.tendermint.types.EvidenceParams.encode(m.evidence, w.uint32(18).fork()).ldelim(); - if (m.validator != null && Object.hasOwnProperty.call(m, "validator")) - $root.tendermint.types.ValidatorParams.encode(m.validator, w.uint32(26).fork()).ldelim(); - if (m.version != null && Object.hasOwnProperty.call(m, "version")) - $root.tendermint.types.VersionParams.encode(m.version, w.uint32(34).fork()).ldelim(); - return w; - }; - ConsensusParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.ConsensusParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.block = $root.tendermint.types.BlockParams.decode(r, r.uint32()); - break; - case 2: - m.evidence = $root.tendermint.types.EvidenceParams.decode(r, r.uint32()); - break; - case 3: - m.validator = $root.tendermint.types.ValidatorParams.decode(r, r.uint32()); - break; - case 4: - m.version = $root.tendermint.types.VersionParams.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ConsensusParams; - })(); - types.BlockParams = (function () { - function BlockParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockParams.prototype.timeIotaMs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockParams.create = function create(properties) { - return new BlockParams(properties); - }; - BlockParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.maxBytes != null && Object.hasOwnProperty.call(m, "maxBytes")) w.uint32(8).int64(m.maxBytes); - if (m.maxGas != null && Object.hasOwnProperty.call(m, "maxGas")) w.uint32(16).int64(m.maxGas); - if (m.timeIotaMs != null && Object.hasOwnProperty.call(m, "timeIotaMs")) - w.uint32(24).int64(m.timeIotaMs); - return w; - }; - BlockParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.BlockParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.maxBytes = r.int64(); - break; - case 2: - m.maxGas = r.int64(); - break; - case 3: - m.timeIotaMs = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BlockParams; - })(); - types.EvidenceParams = (function () { - function EvidenceParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - EvidenceParams.prototype.maxAgeNumBlocks = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - EvidenceParams.prototype.maxAgeDuration = null; - EvidenceParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - EvidenceParams.create = function create(properties) { - return new EvidenceParams(properties); - }; - EvidenceParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.maxAgeNumBlocks != null && Object.hasOwnProperty.call(m, "maxAgeNumBlocks")) - w.uint32(8).int64(m.maxAgeNumBlocks); - if (m.maxAgeDuration != null && Object.hasOwnProperty.call(m, "maxAgeDuration")) - $root.google.protobuf.Duration.encode(m.maxAgeDuration, w.uint32(18).fork()).ldelim(); - if (m.maxBytes != null && Object.hasOwnProperty.call(m, "maxBytes")) w.uint32(24).int64(m.maxBytes); - return w; - }; - EvidenceParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.EvidenceParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.maxAgeNumBlocks = r.int64(); - break; - case 2: - m.maxAgeDuration = $root.google.protobuf.Duration.decode(r, r.uint32()); - break; - case 3: - m.maxBytes = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return EvidenceParams; - })(); - types.ValidatorParams = (function () { - function ValidatorParams(p) { - this.pubKeyTypes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorParams.prototype.pubKeyTypes = $util.emptyArray; - ValidatorParams.create = function create(properties) { - return new ValidatorParams(properties); - }; - ValidatorParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pubKeyTypes != null && m.pubKeyTypes.length) { - for (var i = 0; i < m.pubKeyTypes.length; ++i) w.uint32(10).string(m.pubKeyTypes[i]); - } - return w; - }; - ValidatorParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.ValidatorParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.pubKeyTypes && m.pubKeyTypes.length)) m.pubKeyTypes = []; - m.pubKeyTypes.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorParams; - })(); - types.VersionParams = (function () { - function VersionParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - VersionParams.prototype.appVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - VersionParams.create = function create(properties) { - return new VersionParams(properties); - }; - VersionParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.appVersion != null && Object.hasOwnProperty.call(m, "appVersion")) - w.uint32(8).uint64(m.appVersion); - return w; - }; - VersionParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.VersionParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.appVersion = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return VersionParams; - })(); - types.HashedParams = (function () { - function HashedParams(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - HashedParams.prototype.blockMaxBytes = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - HashedParams.prototype.blockMaxGas = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - HashedParams.create = function create(properties) { - return new HashedParams(properties); - }; - HashedParams.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.blockMaxBytes != null && Object.hasOwnProperty.call(m, "blockMaxBytes")) - w.uint32(8).int64(m.blockMaxBytes); - if (m.blockMaxGas != null && Object.hasOwnProperty.call(m, "blockMaxGas")) - w.uint32(16).int64(m.blockMaxGas); - return w; - }; - HashedParams.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.HashedParams(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.blockMaxBytes = r.int64(); - break; - case 2: - m.blockMaxGas = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return HashedParams; - })(); - types.BlockIDFlag = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN")] = 0; - values[(valuesById[1] = "BLOCK_ID_FLAG_ABSENT")] = 1; - values[(valuesById[2] = "BLOCK_ID_FLAG_COMMIT")] = 2; - values[(valuesById[3] = "BLOCK_ID_FLAG_NIL")] = 3; - return values; - })(); - types.SignedMsgType = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN")] = 0; - values[(valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE")] = 1; - values[(valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT")] = 2; - values[(valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL")] = 32; - return values; - })(); - types.PartSetHeader = (function () { - function PartSetHeader(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PartSetHeader.prototype.total = 0; - PartSetHeader.prototype.hash = $util.newBuffer([]); - PartSetHeader.create = function create(properties) { - return new PartSetHeader(properties); - }; - PartSetHeader.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.total != null && Object.hasOwnProperty.call(m, "total")) w.uint32(8).uint32(m.total); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(18).bytes(m.hash); - return w; - }; - PartSetHeader.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.PartSetHeader(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.total = r.uint32(); - break; - case 2: - m.hash = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PartSetHeader; - })(); - types.Part = (function () { - function Part(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Part.prototype.index = 0; - Part.prototype.bytes = $util.newBuffer([]); - Part.prototype.proof = null; - Part.create = function create(properties) { - return new Part(properties); - }; - Part.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.index != null && Object.hasOwnProperty.call(m, "index")) w.uint32(8).uint32(m.index); - if (m.bytes != null && Object.hasOwnProperty.call(m, "bytes")) w.uint32(18).bytes(m.bytes); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) - $root.tendermint.crypto.Proof.encode(m.proof, w.uint32(26).fork()).ldelim(); - return w; - }; - Part.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Part(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.index = r.uint32(); - break; - case 2: - m.bytes = r.bytes(); - break; - case 3: - m.proof = $root.tendermint.crypto.Proof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Part; - })(); - types.BlockID = (function () { - function BlockID(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BlockID.prototype.hash = $util.newBuffer([]); - BlockID.prototype.partSetHeader = null; - BlockID.create = function create(properties) { - return new BlockID(properties); - }; - BlockID.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.hash != null && Object.hasOwnProperty.call(m, "hash")) w.uint32(10).bytes(m.hash); - if (m.partSetHeader != null && Object.hasOwnProperty.call(m, "partSetHeader")) - $root.tendermint.types.PartSetHeader.encode(m.partSetHeader, w.uint32(18).fork()).ldelim(); - return w; - }; - BlockID.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.BlockID(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.hash = r.bytes(); - break; - case 2: - m.partSetHeader = $root.tendermint.types.PartSetHeader.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BlockID; - })(); - types.Header = (function () { - function Header(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Header.prototype.version = null; - Header.prototype.chainId = ""; - Header.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Header.prototype.time = null; - Header.prototype.lastBlockId = null; - Header.prototype.lastCommitHash = $util.newBuffer([]); - Header.prototype.dataHash = $util.newBuffer([]); - Header.prototype.validatorsHash = $util.newBuffer([]); - Header.prototype.nextValidatorsHash = $util.newBuffer([]); - Header.prototype.consensusHash = $util.newBuffer([]); - Header.prototype.appHash = $util.newBuffer([]); - Header.prototype.lastResultsHash = $util.newBuffer([]); - Header.prototype.evidenceHash = $util.newBuffer([]); - Header.prototype.proposerAddress = $util.newBuffer([]); - Header.create = function create(properties) { - return new Header(properties); - }; - Header.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.version != null && Object.hasOwnProperty.call(m, "version")) - $root.tendermint.version.Consensus.encode(m.version, w.uint32(10).fork()).ldelim(); - if (m.chainId != null && Object.hasOwnProperty.call(m, "chainId")) w.uint32(18).string(m.chainId); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(24).int64(m.height); - if (m.time != null && Object.hasOwnProperty.call(m, "time")) - $root.google.protobuf.Timestamp.encode(m.time, w.uint32(34).fork()).ldelim(); - if (m.lastBlockId != null && Object.hasOwnProperty.call(m, "lastBlockId")) - $root.tendermint.types.BlockID.encode(m.lastBlockId, w.uint32(42).fork()).ldelim(); - if (m.lastCommitHash != null && Object.hasOwnProperty.call(m, "lastCommitHash")) - w.uint32(50).bytes(m.lastCommitHash); - if (m.dataHash != null && Object.hasOwnProperty.call(m, "dataHash")) w.uint32(58).bytes(m.dataHash); - if (m.validatorsHash != null && Object.hasOwnProperty.call(m, "validatorsHash")) - w.uint32(66).bytes(m.validatorsHash); - if (m.nextValidatorsHash != null && Object.hasOwnProperty.call(m, "nextValidatorsHash")) - w.uint32(74).bytes(m.nextValidatorsHash); - if (m.consensusHash != null && Object.hasOwnProperty.call(m, "consensusHash")) - w.uint32(82).bytes(m.consensusHash); - if (m.appHash != null && Object.hasOwnProperty.call(m, "appHash")) w.uint32(90).bytes(m.appHash); - if (m.lastResultsHash != null && Object.hasOwnProperty.call(m, "lastResultsHash")) - w.uint32(98).bytes(m.lastResultsHash); - if (m.evidenceHash != null && Object.hasOwnProperty.call(m, "evidenceHash")) - w.uint32(106).bytes(m.evidenceHash); - if (m.proposerAddress != null && Object.hasOwnProperty.call(m, "proposerAddress")) - w.uint32(114).bytes(m.proposerAddress); - return w; - }; - Header.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Header(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.version = $root.tendermint.version.Consensus.decode(r, r.uint32()); - break; - case 2: - m.chainId = r.string(); - break; - case 3: - m.height = r.int64(); - break; - case 4: - m.time = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 5: - m.lastBlockId = $root.tendermint.types.BlockID.decode(r, r.uint32()); - break; - case 6: - m.lastCommitHash = r.bytes(); - break; - case 7: - m.dataHash = r.bytes(); - break; - case 8: - m.validatorsHash = r.bytes(); - break; - case 9: - m.nextValidatorsHash = r.bytes(); - break; - case 10: - m.consensusHash = r.bytes(); - break; - case 11: - m.appHash = r.bytes(); - break; - case 12: - m.lastResultsHash = r.bytes(); - break; - case 13: - m.evidenceHash = r.bytes(); - break; - case 14: - m.proposerAddress = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Header; - })(); - types.Data = (function () { - function Data(p) { - this.txs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Data.prototype.txs = $util.emptyArray; - Data.create = function create(properties) { - return new Data(properties); - }; - Data.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.txs != null && m.txs.length) { - for (var i = 0; i < m.txs.length; ++i) w.uint32(10).bytes(m.txs[i]); - } - return w; - }; - Data.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Data(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.txs && m.txs.length)) m.txs = []; - m.txs.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Data; - })(); - types.Vote = (function () { - function Vote(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Vote.prototype.type = 0; - Vote.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Vote.prototype.round = 0; - Vote.prototype.blockId = null; - Vote.prototype.timestamp = null; - Vote.prototype.validatorAddress = $util.newBuffer([]); - Vote.prototype.validatorIndex = 0; - Vote.prototype.signature = $util.newBuffer([]); - Vote.create = function create(properties) { - return new Vote(properties); - }; - Vote.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(8).int32(m.type); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(16).int64(m.height); - if (m.round != null && Object.hasOwnProperty.call(m, "round")) w.uint32(24).int32(m.round); - if (m.blockId != null && Object.hasOwnProperty.call(m, "blockId")) - $root.tendermint.types.BlockID.encode(m.blockId, w.uint32(34).fork()).ldelim(); - if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) - $root.google.protobuf.Timestamp.encode(m.timestamp, w.uint32(42).fork()).ldelim(); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(50).bytes(m.validatorAddress); - if (m.validatorIndex != null && Object.hasOwnProperty.call(m, "validatorIndex")) - w.uint32(56).int32(m.validatorIndex); - if (m.signature != null && Object.hasOwnProperty.call(m, "signature")) - w.uint32(66).bytes(m.signature); - return w; - }; - Vote.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Vote(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.int32(); - break; - case 2: - m.height = r.int64(); - break; - case 3: - m.round = r.int32(); - break; - case 4: - m.blockId = $root.tendermint.types.BlockID.decode(r, r.uint32()); - break; - case 5: - m.timestamp = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 6: - m.validatorAddress = r.bytes(); - break; - case 7: - m.validatorIndex = r.int32(); - break; - case 8: - m.signature = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Vote; - })(); - types.Commit = (function () { - function Commit(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Commit.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Commit.prototype.round = 0; - Commit.prototype.blockId = null; - Commit.prototype.signatures = $util.emptyArray; - Commit.create = function create(properties) { - return new Commit(properties); - }; - Commit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(8).int64(m.height); - if (m.round != null && Object.hasOwnProperty.call(m, "round")) w.uint32(16).int32(m.round); - if (m.blockId != null && Object.hasOwnProperty.call(m, "blockId")) - $root.tendermint.types.BlockID.encode(m.blockId, w.uint32(26).fork()).ldelim(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) - $root.tendermint.types.CommitSig.encode(m.signatures[i], w.uint32(34).fork()).ldelim(); - } - return w; - }; - Commit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Commit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.height = r.int64(); - break; - case 2: - m.round = r.int32(); - break; - case 3: - m.blockId = $root.tendermint.types.BlockID.decode(r, r.uint32()); - break; - case 4: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push($root.tendermint.types.CommitSig.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Commit; - })(); - types.CommitSig = (function () { - function CommitSig(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CommitSig.prototype.blockIdFlag = 0; - CommitSig.prototype.validatorAddress = $util.newBuffer([]); - CommitSig.prototype.timestamp = null; - CommitSig.prototype.signature = $util.newBuffer([]); - CommitSig.create = function create(properties) { - return new CommitSig(properties); - }; - CommitSig.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.blockIdFlag != null && Object.hasOwnProperty.call(m, "blockIdFlag")) - w.uint32(8).int32(m.blockIdFlag); - if (m.validatorAddress != null && Object.hasOwnProperty.call(m, "validatorAddress")) - w.uint32(18).bytes(m.validatorAddress); - if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) - $root.google.protobuf.Timestamp.encode(m.timestamp, w.uint32(26).fork()).ldelim(); - if (m.signature != null && Object.hasOwnProperty.call(m, "signature")) - w.uint32(34).bytes(m.signature); - return w; - }; - CommitSig.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.CommitSig(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.blockIdFlag = r.int32(); - break; - case 2: - m.validatorAddress = r.bytes(); - break; - case 3: - m.timestamp = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 4: - m.signature = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CommitSig; - })(); - types.Proposal = (function () { - function Proposal(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Proposal.prototype.type = 0; - Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Proposal.prototype.round = 0; - Proposal.prototype.polRound = 0; - Proposal.prototype.blockId = null; - Proposal.prototype.timestamp = null; - Proposal.prototype.signature = $util.newBuffer([]); - Proposal.create = function create(properties) { - return new Proposal(properties); - }; - Proposal.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type != null && Object.hasOwnProperty.call(m, "type")) w.uint32(8).int32(m.type); - if (m.height != null && Object.hasOwnProperty.call(m, "height")) w.uint32(16).int64(m.height); - if (m.round != null && Object.hasOwnProperty.call(m, "round")) w.uint32(24).int32(m.round); - if (m.polRound != null && Object.hasOwnProperty.call(m, "polRound")) w.uint32(32).int32(m.polRound); - if (m.blockId != null && Object.hasOwnProperty.call(m, "blockId")) - $root.tendermint.types.BlockID.encode(m.blockId, w.uint32(42).fork()).ldelim(); - if (m.timestamp != null && Object.hasOwnProperty.call(m, "timestamp")) - $root.google.protobuf.Timestamp.encode(m.timestamp, w.uint32(50).fork()).ldelim(); - if (m.signature != null && Object.hasOwnProperty.call(m, "signature")) - w.uint32(58).bytes(m.signature); - return w; - }; - Proposal.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Proposal(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type = r.int32(); - break; - case 2: - m.height = r.int64(); - break; - case 3: - m.round = r.int32(); - break; - case 4: - m.polRound = r.int32(); - break; - case 5: - m.blockId = $root.tendermint.types.BlockID.decode(r, r.uint32()); - break; - case 6: - m.timestamp = $root.google.protobuf.Timestamp.decode(r, r.uint32()); - break; - case 7: - m.signature = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Proposal; - })(); - types.SignedHeader = (function () { - function SignedHeader(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignedHeader.prototype.header = null; - SignedHeader.prototype.commit = null; - SignedHeader.create = function create(properties) { - return new SignedHeader(properties); - }; - SignedHeader.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.header != null && Object.hasOwnProperty.call(m, "header")) - $root.tendermint.types.Header.encode(m.header, w.uint32(10).fork()).ldelim(); - if (m.commit != null && Object.hasOwnProperty.call(m, "commit")) - $root.tendermint.types.Commit.encode(m.commit, w.uint32(18).fork()).ldelim(); - return w; - }; - SignedHeader.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.SignedHeader(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.header = $root.tendermint.types.Header.decode(r, r.uint32()); - break; - case 2: - m.commit = $root.tendermint.types.Commit.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignedHeader; - })(); - types.LightBlock = (function () { - function LightBlock(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - LightBlock.prototype.signedHeader = null; - LightBlock.prototype.validatorSet = null; - LightBlock.create = function create(properties) { - return new LightBlock(properties); - }; - LightBlock.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signedHeader != null && Object.hasOwnProperty.call(m, "signedHeader")) - $root.tendermint.types.SignedHeader.encode(m.signedHeader, w.uint32(10).fork()).ldelim(); - if (m.validatorSet != null && Object.hasOwnProperty.call(m, "validatorSet")) - $root.tendermint.types.ValidatorSet.encode(m.validatorSet, w.uint32(18).fork()).ldelim(); - return w; - }; - LightBlock.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.LightBlock(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.signedHeader = $root.tendermint.types.SignedHeader.decode(r, r.uint32()); - break; - case 2: - m.validatorSet = $root.tendermint.types.ValidatorSet.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return LightBlock; - })(); - types.BlockMeta = (function () { - function BlockMeta(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - BlockMeta.prototype.blockId = null; - BlockMeta.prototype.blockSize = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockMeta.prototype.header = null; - BlockMeta.prototype.numTxs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - BlockMeta.create = function create(properties) { - return new BlockMeta(properties); - }; - BlockMeta.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.blockId != null && Object.hasOwnProperty.call(m, "blockId")) - $root.tendermint.types.BlockID.encode(m.blockId, w.uint32(10).fork()).ldelim(); - if (m.blockSize != null && Object.hasOwnProperty.call(m, "blockSize")) - w.uint32(16).int64(m.blockSize); - if (m.header != null && Object.hasOwnProperty.call(m, "header")) - $root.tendermint.types.Header.encode(m.header, w.uint32(26).fork()).ldelim(); - if (m.numTxs != null && Object.hasOwnProperty.call(m, "numTxs")) w.uint32(32).int64(m.numTxs); - return w; - }; - BlockMeta.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.BlockMeta(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.blockId = $root.tendermint.types.BlockID.decode(r, r.uint32()); - break; - case 2: - m.blockSize = r.int64(); - break; - case 3: - m.header = $root.tendermint.types.Header.decode(r, r.uint32()); - break; - case 4: - m.numTxs = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return BlockMeta; - })(); - types.TxProof = (function () { - function TxProof(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxProof.prototype.rootHash = $util.newBuffer([]); - TxProof.prototype.data = $util.newBuffer([]); - TxProof.prototype.proof = null; - TxProof.create = function create(properties) { - return new TxProof(properties); - }; - TxProof.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.rootHash != null && Object.hasOwnProperty.call(m, "rootHash")) w.uint32(10).bytes(m.rootHash); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) w.uint32(18).bytes(m.data); - if (m.proof != null && Object.hasOwnProperty.call(m, "proof")) - $root.tendermint.crypto.Proof.encode(m.proof, w.uint32(26).fork()).ldelim(); - return w; - }; - TxProof.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.TxProof(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.rootHash = r.bytes(); - break; - case 2: - m.data = r.bytes(); - break; - case 3: - m.proof = $root.tendermint.crypto.Proof.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxProof; - })(); - types.ValidatorSet = (function () { - function ValidatorSet(p) { - this.validators = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ValidatorSet.prototype.validators = $util.emptyArray; - ValidatorSet.prototype.proposer = null; - ValidatorSet.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - ValidatorSet.create = function create(properties) { - return new ValidatorSet(properties); - }; - ValidatorSet.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.validators != null && m.validators.length) { - for (var i = 0; i < m.validators.length; ++i) - $root.tendermint.types.Validator.encode(m.validators[i], w.uint32(10).fork()).ldelim(); - } - if (m.proposer != null && Object.hasOwnProperty.call(m, "proposer")) - $root.tendermint.types.Validator.encode(m.proposer, w.uint32(18).fork()).ldelim(); - if (m.totalVotingPower != null && Object.hasOwnProperty.call(m, "totalVotingPower")) - w.uint32(24).int64(m.totalVotingPower); - return w; - }; - ValidatorSet.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.ValidatorSet(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.validators && m.validators.length)) m.validators = []; - m.validators.push($root.tendermint.types.Validator.decode(r, r.uint32())); - break; - case 2: - m.proposer = $root.tendermint.types.Validator.decode(r, r.uint32()); - break; - case 3: - m.totalVotingPower = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return ValidatorSet; - })(); - types.Validator = (function () { - function Validator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Validator.prototype.address = $util.newBuffer([]); - Validator.prototype.pubKey = null; - Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - Validator.create = function create(properties) { - return new Validator(properties); - }; - Validator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).bytes(m.address); - if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) - $root.tendermint.crypto.PublicKey.encode(m.pubKey, w.uint32(18).fork()).ldelim(); - if (m.votingPower != null && Object.hasOwnProperty.call(m, "votingPower")) - w.uint32(24).int64(m.votingPower); - if (m.proposerPriority != null && Object.hasOwnProperty.call(m, "proposerPriority")) - w.uint32(32).int64(m.proposerPriority); - return w; - }; - Validator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.Validator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.bytes(); - break; - case 2: - m.pubKey = $root.tendermint.crypto.PublicKey.decode(r, r.uint32()); - break; - case 3: - m.votingPower = r.int64(); - break; - case 4: - m.proposerPriority = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Validator; - })(); - types.SimpleValidator = (function () { - function SimpleValidator(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SimpleValidator.prototype.pubKey = null; - SimpleValidator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - SimpleValidator.create = function create(properties) { - return new SimpleValidator(properties); - }; - SimpleValidator.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) - $root.tendermint.crypto.PublicKey.encode(m.pubKey, w.uint32(10).fork()).ldelim(); - if (m.votingPower != null && Object.hasOwnProperty.call(m, "votingPower")) - w.uint32(16).int64(m.votingPower); - return w; - }; - SimpleValidator.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.types.SimpleValidator(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.pubKey = $root.tendermint.crypto.PublicKey.decode(r, r.uint32()); - break; - case 2: - m.votingPower = r.int64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SimpleValidator; - })(); - return types; - })(); - tendermint.version = (function () { - const version = {}; - version.App = (function () { - function App(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - App.prototype.protocol = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - App.prototype.software = ""; - App.create = function create(properties) { - return new App(properties); - }; - App.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.protocol != null && Object.hasOwnProperty.call(m, "protocol")) w.uint32(8).uint64(m.protocol); - if (m.software != null && Object.hasOwnProperty.call(m, "software")) w.uint32(18).string(m.software); - return w; - }; - App.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.version.App(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.protocol = r.uint64(); - break; - case 2: - m.software = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return App; - })(); - version.Consensus = (function () { - function Consensus(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Consensus.create = function create(properties) { - return new Consensus(properties); - }; - Consensus.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.block != null && Object.hasOwnProperty.call(m, "block")) w.uint32(8).uint64(m.block); - if (m.app != null && Object.hasOwnProperty.call(m, "app")) w.uint32(16).uint64(m.app); - return w; - }; - Consensus.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.version.Consensus(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.block = r.uint64(); - break; - case 2: - m.app = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Consensus; - })(); - return version; - })(); - return tendermint; -})(); -module.exports = $root; diff --git a/packages/stargate/src/codec/gogoproto/gogo.ts b/packages/stargate/src/codec/gogoproto/gogo.ts new file mode 100644 index 00000000..ecf800e0 --- /dev/null +++ b/packages/stargate/src/codec/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +/* 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 new file mode 100644 index 00000000..c2161053 --- /dev/null +++ b/packages/stargate/src/codec/google/api/annotations.ts @@ -0,0 +1,3 @@ +/* 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 new file mode 100644 index 00000000..d051d088 --- /dev/null +++ b/packages/stargate/src/codec/google/api/http.ts @@ -0,0 +1,679 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path 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. + */ + 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. + * + * 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 + * } + * + * 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} + * + * 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"))` + * + * 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: + * + * + * 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: + * + * 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`. + * + * 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 + * } + * + * + * 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!" })` + * + * 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; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * 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. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | 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 + * + * 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. + * + * 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 ; + * + * 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=*}`. + * + * 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}`. + * + * 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. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** + * Used for listing and getting information about resources. + */ + get: string | undefined; + /** + * Used for updating a resource. + */ + put: string | undefined; + /** + * Used for creating a resource. + */ + post: string | undefined; + /** + * Used for deleting a resource. + */ + delete: string | undefined; + /** + * 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. + */ + 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. + */ + 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. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} + +/** + * A custom pattern is used for defining custom HTTP verb. + */ +export interface CustomHttpPattern { + /** + * The name of this custom HTTP verb. + */ + kind: string; + /** + * The path matched by this custom verb. + */ + path: string; +} + +const baseHttp: object = { + fullyDecodeReservedExpansion: false, +}; + +const baseHttpRule: object = { + selector: "", + body: "", + responseBody: "", +}; + +const baseCustomHttpPattern: object = { + kind: "", + path: "", +}; + +export const protobufPackage = "google.api"; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if (object.fullyDecodeReservedExpansion !== undefined && object.fullyDecodeReservedExpansion !== null) { + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + } else { + message.fullyDecodeReservedExpansion = false; + } + return message; + }, + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if (object.fullyDecodeReservedExpansion !== undefined && object.fullyDecodeReservedExpansion !== null) { + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion; + } else { + message.fullyDecodeReservedExpansion = false; + } + return message; + }, + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => (e ? HttpRule.toJSON(e) : undefined)); + } else { + obj.rules = []; + } + message.fullyDecodeReservedExpansion !== undefined && + (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); + return obj; + }, +}; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.selector); + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + writer.uint32(58).string(message.body); + writer.uint32(98).string(message.responseBody); + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.additionalBindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = String(object.responseBody); + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = object.responseBody; + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); + message.body !== undefined && (obj.body = message.body); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => (e ? HttpRule.toJSON(e) : undefined)); + } else { + obj.additionalBindings = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/google/protobuf/any.ts b/packages/stargate/src/codec/google/protobuf/any.ts new file mode 100644 index 00000000..8b24c81b --- /dev/null +++ b/packages/stargate/src/codec/google/protobuf/any.ts @@ -0,0 +1,225 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + */ + value: Uint8Array; +} + +const baseAny: object = { + typeUrl: "", +}; + +export const protobufPackage = "google.protobuf"; + +export const Any = { + encode(message: Any, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.typeUrl); + writer.uint32(18).bytes(message.value); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = String(object.typeUrl); + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + fromPartial(object: DeepPartial): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = object.typeUrl; + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/google/protobuf/descriptor.ts b/packages/stargate/src/codec/google/protobuf/descriptor.ts new file mode 100644 index 00000000..0ff4add2 --- /dev/null +++ b/packages/stargate/src/codec/google/protobuf/descriptor.ts @@ -0,0 +1,4559 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** + * Describes a complete .proto file. + */ +export interface FileDescriptorProto { + /** + * file name, relative to root of source tree + */ + name: string; + /** + * e.g. "foo", "foo.bar", etc. + */ + package: string; + /** + * Names of files imported by this file. + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** + * All top-level definitions in this file. + */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** + * Describes a message type. + */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** + * Inclusive. + */ + start: number; + /** + * 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. + */ +export interface DescriptorProto_ReservedRange { + /** + * Inclusive. + */ + start: number; + /** + * Exclusive. + */ + end: number; +} + +export interface ExtensionRangeOptions { + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Describes a field within a message. + */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + 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 = 1, + TYPE_FLOAT = 2, + /** TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** TYPE_GROUP - Tag-delimited aggregate. + Group type is deprecated and not supported in proto3. However, Proto3 + implementations should still be able to parse the group wire format and + treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. + */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. + */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. + */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. + */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors + */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Generated classes can be optimized for speed or code size. + */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, + */ + SPEED = 1, + /** CODE_SIZE - etc. + */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. + */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_CType { + /** STRING - Default mode. + */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. + */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. + */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. + */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +/** Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + or neither? HTTP based RPC implementation may choose GET verb for safe + methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent + */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects + */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => (e ? FileDescriptorProto.toJSON(e) : undefined)); + } else { + obj.file = []; + } + return obj; + }, +}; + +export const FileDescriptorProto = { + encode(message: FileDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(18).string(message.package); + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined && message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + writer.uint32(98).string(message.syntax); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(Number(e)); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(Number(e)); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromJSON(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(e); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(e); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromPartial(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => e); + } else { + obj.publicDependency = []; + } + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => e); + } else { + obj.weakDependency = []; + } + if (message.messageType) { + obj.messageType = message.messageType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.messageType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.service) { + obj.service = message.service.map((e) => (e ? ServiceDescriptorProto.toJSON(e) : undefined)); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); + message.sourceCodeInfo !== undefined && + (obj.sourceCodeInfo = message.sourceCodeInfo + ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, +}; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromJSON(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromPartial(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.nestedType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined, + ); + } else { + obj.extensionRange = []; + } + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => (e ? OneofDescriptorProto.toJSON(e) : undefined)); + } else { + obj.oneofDecl = []; + } + message.options !== undefined && + (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, +}; + +export const DescriptorProto_ExtensionRange = { + encode(message: DescriptorProto_ExtensionRange, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.start); + writer.uint32(16).int32(message.end); + if (message.options !== undefined && message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +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 { + 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +export const ExtensionRangeOptions = { + encode(message: ExtensionRangeOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const FieldDescriptorProto = { + encode(message: FieldDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(24).int32(message.number); + writer.uint32(32).int32(message.label); + writer.uint32(40).int32(message.type); + writer.uint32(50).string(message.typeName); + writer.uint32(18).string(message.extendee); + writer.uint32(58).string(message.defaultValue); + writer.uint32(72).int32(message.oneofIndex); + writer.uint32(82).string(message.jsonName); + if (message.options !== undefined && message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + writer.uint32(136).bool(message.proto3Optional); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = String(object.typeName); + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = String(object.defaultValue); + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = Number(object.oneofIndex); + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = String(object.jsonName); + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = Boolean(object.proto3Optional); + } else { + message.proto3Optional = false; + } + return message; + }, + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = object.typeName; + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = object.defaultValue; + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = object.oneofIndex; + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = object.jsonName; + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = object.proto3Optional; + } else { + message.proto3Optional = false; + } + return message; + }, + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.typeName !== undefined && (obj.typeName = message.typeName); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.defaultValue !== undefined && (obj.defaultValue = message.defaultValue); + message.oneofIndex !== undefined && (obj.oneofIndex = message.oneofIndex); + message.jsonName !== undefined && (obj.jsonName = message.jsonName); + message.options !== undefined && + (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); + message.proto3Optional !== undefined && (obj.proto3Optional = message.proto3Optional); + return obj; + }, +}; + +export const OneofDescriptorProto = { + encode(message: OneofDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + if (message.options !== undefined && message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const EnumDescriptorProto = { + encode(message: EnumDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => (e ? EnumValueDescriptorProto.toJSON(e) : undefined)); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, +}; + +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 { + 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +export const EnumValueDescriptorProto = { + encode(message: EnumValueDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(16).int32(message.number); + if (message.options !== undefined && message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const ServiceDescriptorProto = { + encode(message: ServiceDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => (e ? MethodDescriptorProto.toJSON(e) : undefined)); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const MethodDescriptorProto = { + encode(message: MethodDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(18).string(message.inputType); + writer.uint32(26).string(message.outputType); + if (message.options !== undefined && message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + writer.uint32(40).bool(message.clientStreaming); + writer.uint32(48).bool(message.serverStreaming); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = String(object.inputType); + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = String(object.outputType); + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = Boolean(object.clientStreaming); + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = Boolean(object.serverStreaming); + } else { + message.serverStreaming = false; + } + return message; + }, + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = object.inputType; + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = object.outputType; + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = object.clientStreaming; + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = object.serverStreaming; + } else { + message.serverStreaming = false; + } + return message; + }, + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && + (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); + message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); + message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); + return obj; + }, +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.javaPackage); + writer.uint32(66).string(message.javaOuterClassname); + writer.uint32(80).bool(message.javaMultipleFiles); + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + writer.uint32(216).bool(message.javaStringCheckUtf8); + writer.uint32(72).int32(message.optimizeFor); + writer.uint32(90).string(message.goPackage); + writer.uint32(128).bool(message.ccGenericServices); + writer.uint32(136).bool(message.javaGenericServices); + writer.uint32(144).bool(message.pyGenericServices); + writer.uint32(336).bool(message.phpGenericServices); + writer.uint32(184).bool(message.deprecated); + writer.uint32(248).bool(message.ccEnableArenas); + writer.uint32(290).string(message.objcClassPrefix); + writer.uint32(298).string(message.csharpNamespace); + writer.uint32(314).string(message.swiftPrefix); + writer.uint32(322).string(message.phpClassPrefix); + writer.uint32(330).string(message.phpNamespace); + writer.uint32(354).string(message.phpMetadataNamespace); + writer.uint32(362).string(message.rubyPackage); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = String(object.javaPackage); + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = String(object.javaOuterClassname); + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimizeFor); + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = String(object.goPackage); + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = Boolean(object.ccGenericServices); + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = Boolean(object.javaGenericServices); + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = Boolean(object.pyGenericServices); + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = Boolean(object.phpGenericServices); + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = Boolean(object.ccEnableArenas); + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = String(object.objcClassPrefix); + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = String(object.csharpNamespace); + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = String(object.swiftPrefix); + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = String(object.phpClassPrefix); + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = String(object.phpNamespace); + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = String(object.rubyPackage); + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = object.javaPackage; + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = object.javaOuterClassname; + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = object.javaMultipleFiles; + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash; + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = object.javaStringCheckUtf8; + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = object.optimizeFor; + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = object.goPackage; + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = object.ccGenericServices; + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = object.javaGenericServices; + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = object.pyGenericServices; + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = object.phpGenericServices; + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = object.ccEnableArenas; + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = object.objcClassPrefix; + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = object.csharpNamespace; + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = object.swiftPrefix; + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = object.phpClassPrefix; + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = object.phpNamespace; + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = object.phpMetadataNamespace; + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = object.rubyPackage; + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); + message.javaOuterClassname !== undefined && (obj.javaOuterClassname = message.javaOuterClassname); + message.javaMultipleFiles !== undefined && (obj.javaMultipleFiles = message.javaMultipleFiles); + message.javaGenerateEqualsAndHash !== undefined && + (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); + message.javaStringCheckUtf8 !== undefined && (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); + message.optimizeFor !== undefined && + (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); + message.goPackage !== undefined && (obj.goPackage = message.goPackage); + message.ccGenericServices !== undefined && (obj.ccGenericServices = message.ccGenericServices); + message.javaGenericServices !== undefined && (obj.javaGenericServices = message.javaGenericServices); + message.pyGenericServices !== undefined && (obj.pyGenericServices = message.pyGenericServices); + message.phpGenericServices !== undefined && (obj.phpGenericServices = message.phpGenericServices); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.ccEnableArenas !== undefined && (obj.ccEnableArenas = message.ccEnableArenas); + message.objcClassPrefix !== undefined && (obj.objcClassPrefix = message.objcClassPrefix); + message.csharpNamespace !== undefined && (obj.csharpNamespace = message.csharpNamespace); + message.swiftPrefix !== undefined && (obj.swiftPrefix = message.swiftPrefix); + message.phpClassPrefix !== undefined && (obj.phpClassPrefix = message.phpClassPrefix); + message.phpNamespace !== undefined && (obj.phpNamespace = message.phpNamespace); + message.phpMetadataNamespace !== undefined && (obj.phpMetadataNamespace = message.phpMetadataNamespace); + message.rubyPackage !== undefined && (obj.rubyPackage = message.rubyPackage); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).bool(message.messageSetWireFormat); + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + writer.uint32(24).bool(message.deprecated); + writer.uint32(56).bool(message.mapEntry); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = Boolean(object.mapEntry); + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = object.messageSetWireFormat; + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor; + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = object.mapEntry; + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined && + (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.ctype); + writer.uint32(16).bool(message.packed); + writer.uint32(48).int32(message.jstype); + writer.uint32(40).bool(message.lazy); + writer.uint32(24).bool(message.deprecated); + writer.uint32(80).bool(message.weak); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(16).bool(message.allowAlias); + writer.uint32(24).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = Boolean(object.allowAlias); + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = object.allowAlias; + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(264).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(264).bool(message.deprecated); + writer.uint32(272).int32(message.idempotencyLevel); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel); + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = object.idempotencyLevel; + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotencyLevel !== undefined && + (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const UninterpretedOption = { + encode(message: UninterpretedOption, writer: Writer = Writer.create()): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.identifierValue); + writer.uint32(32).uint64(message.positiveIntValue); + writer.uint32(40).int64(message.negativeIntValue); + writer.uint32(49).double(message.doubleValue); + writer.uint32(58).bytes(message.stringValue); + writer.uint32(66).string(message.aggregateValue); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64() as Long; + break; + case 5: + message.negativeIntValue = reader.int64() as Long; + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = String(object.identifierValue); + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = Long.fromString(object.positiveIntValue); + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = Long.fromString(object.negativeIntValue); + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = Number(object.doubleValue); + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = bytesFromBase64(object.stringValue); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = String(object.aggregateValue); + } else { + message.aggregateValue = ""; + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = object.identifierValue; + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = object.positiveIntValue as Long; + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = object.negativeIntValue as Long; + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = object.doubleValue; + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = object.stringValue; + } else { + message.stringValue = new Uint8Array(); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = object.aggregateValue; + } else { + message.aggregateValue = ""; + } + return message; + }, + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => (e ? UninterpretedOption_NamePart.toJSON(e) : undefined)); + } else { + obj.name = []; + } + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && + (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); + message.negativeIntValue !== undefined && + (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined && + (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), + )); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); + return obj; + }, +}; + +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 { + 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = String(object.namePart); + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = Boolean(object.isExtension); + } else { + message.isExtension = false; + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = object.namePart; + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = object.isExtension; + } else { + message.isExtension = false; + } + return message; + }, + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); + return obj; + }, +}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => (e ? SourceCodeInfo_Location.toJSON(e) : undefined)); + } else { + obj.location = []; + } + return obj; + }, +}; + +export const SourceCodeInfo_Location = { + encode(message: SourceCodeInfo_Location, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(26).string(message.leadingComments); + writer.uint32(34).string(message.trailingComments); + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = String(object.leadingComments); + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = String(object.trailingComments); + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = object.leadingComments; + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = object.trailingComments; + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(e); + } + } + return message; + }, + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); + message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); + if (message.leadingDetachedComments) { + obj.leadingDetachedComments = message.leadingDetachedComments.map((e) => e); + } else { + obj.leadingDetachedComments = []; + } + return obj; + }, +}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined, + ); + } else { + obj.annotation = []; + } + return obj; + }, +}; + +export const GeneratedCodeInfo_Annotation = { + encode(message: GeneratedCodeInfo_Annotation, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).string(message.sourceFile); + writer.uint32(24).int32(message.begin); + writer.uint32(32).int32(message.end); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = String(object.sourceFile); + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = object.sourceFile; + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/google/protobuf/duration.ts b/packages/stargate/src/codec/google/protobuf/duration.ts new file mode 100644 index 00000000..4d558132 --- /dev/null +++ b/packages/stargate/src/codec/google/protobuf/duration.ts @@ -0,0 +1,163 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: Long; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +const baseDuration: object = { + seconds: Long.ZERO, + nanos: 0, +}; + +export const protobufPackage = "google.protobuf"; + +export const Duration = { + encode(message: Duration, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.seconds); + writer.uint32(16).int32(message.nanos); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64() as Long; + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Duration { + const message = { ...baseDuration } as Duration; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = Long.fromString(object.seconds); + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = Number(object.nanos); + } else { + message.nanos = 0; + } + return message; + }, + fromPartial(object: DeepPartial): Duration { + const message = { ...baseDuration } as Duration; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = object.seconds as Long; + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = object.nanos; + } else { + message.nanos = 0; + } + return message; + }, + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = message.nanos); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/google/protobuf/timestamp.ts b/packages/stargate/src/codec/google/protobuf/timestamp.ts new file mode 100644 index 00000000..37c5f345 --- /dev/null +++ b/packages/stargate/src/codec/google/protobuf/timestamp.ts @@ -0,0 +1,185 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + * + * + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +const baseTimestamp: object = { + seconds: Long.ZERO, + nanos: 0, +}; + +export const protobufPackage = "google.protobuf"; + +export const Timestamp = { + encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.seconds); + writer.uint32(16).int32(message.nanos); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64() as Long; + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Timestamp { + const message = { ...baseTimestamp } as Timestamp; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = Long.fromString(object.seconds); + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = Number(object.nanos); + } else { + message.nanos = 0; + } + return message; + }, + fromPartial(object: DeepPartial): Timestamp { + const message = { ...baseTimestamp } as Timestamp; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = object.seconds as Long; + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = object.nanos; + } else { + message.nanos = 0; + } + return message; + }, + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = message.nanos); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts b/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts new file mode 100644 index 00000000..532d8432 --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/channel/v1/channel.ts @@ -0,0 +1,991 @@ +/* eslint-disable */ +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. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State + */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. + */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A channel has completed the handshake. Open channels are + ready to send and receive packets. + */ + STATE_OPEN = 3, + /** STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + packets. + */ + STATE_CLOSED = 4, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case 4: + case "STATE_CLOSED": + return State.STATE_CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.STATE_CLOSED: + return "STATE_CLOSED"; + default: + return "UNKNOWN"; + } +} + +/** Order defines if a channel is ORDERED or UNORDERED + */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering + */ + ORDER_NONE_UNSPECIFIED = 0, + /** ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent + */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} + +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} + +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + default: + return "UNKNOWN"; + } +} + +export const Channel = { + encode(message: Channel, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.state); + writer.uint32(16).int32(message.ordering); + if (message.counterparty !== undefined && message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + writer.uint32(42).string(message.version); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.connectionHops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Channel { + const message = { ...baseChannel } as Channel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(String(e)); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Channel { + const message = { ...baseChannel } as Channel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(e); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + return message; + }, + toJSON(message: Channel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + return obj; + }, +}; + +export const IdentifiedChannel = { + encode(message: IdentifiedChannel, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.state); + writer.uint32(16).int32(message.ordering); + if (message.counterparty !== undefined && message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + writer.uint32(42).string(message.version); + writer.uint32(50).string(message.portId); + writer.uint32(58).string(message.channelId); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.connectionHops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IdentifiedChannel { + const message = { ...baseIdentifiedChannel } as IdentifiedChannel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(String(e)); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedChannel { + const message = { ...baseIdentifiedChannel } as IdentifiedChannel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(e); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, + toJSON(message: IdentifiedChannel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCounterparty } as Counterparty; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, +}; + +export const Packet = { + encode(message: Packet, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.sequence); + writer.uint32(18).string(message.sourcePort); + writer.uint32(26).string(message.sourceChannel); + writer.uint32(34).string(message.destinationPort); + writer.uint32(42).string(message.destinationChannel); + writer.uint32(50).bytes(message.data); + if (message.timeoutHeight !== undefined && message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + writer.uint32(64).uint64(message.timeoutTimestamp); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() as Long; + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Packet { + const message = { ...basePacket } as Packet; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = String(object.sourcePort); + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = String(object.sourceChannel); + } else { + message.sourceChannel = ""; + } + if (object.destinationPort !== undefined && object.destinationPort !== null) { + message.destinationPort = String(object.destinationPort); + } else { + message.destinationPort = ""; + } + if (object.destinationChannel !== undefined && object.destinationChannel !== null) { + message.destinationChannel = String(object.destinationChannel); + } else { + message.destinationChannel = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromJSON(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Packet { + const message = { ...basePacket } as Packet; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = object.sourcePort; + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = object.sourceChannel; + } else { + message.sourceChannel = ""; + } + if (object.destinationPort !== undefined && object.destinationPort !== null) { + message.destinationPort = object.destinationPort; + } else { + message.destinationPort = ""; + } + if (object.destinationChannel !== undefined && object.destinationChannel !== null) { + message.destinationChannel = object.destinationChannel; + } else { + message.destinationChannel = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromPartial(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = object.timeoutTimestamp as Long; + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, + toJSON(message: Packet): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); + message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && + (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + return obj; + }, +}; + +export const PacketState = { + encode(message: PacketState, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(24).uint64(message.sequence); + writer.uint32(34).bytes(message.data); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PacketState { + const message = { ...basePacketState } as PacketState; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + fromPartial(object: DeepPartial): PacketState { + const message = { ...basePacketState } as PacketState; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, + toJSON(message: PacketState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, +}; + +export const Acknowledgement = { + encode(message: Acknowledgement, writer: Writer = Writer.create()): Writer { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Acknowledgement { + const message = { ...baseAcknowledgement } as Acknowledgement; + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = String(object.error); + } else { + message.error = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Acknowledgement { + const message = { ...baseAcknowledgement } as Acknowledgement; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = undefined; + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } else { + message.error = undefined; + } + return message; + }, + toJSON(message: Acknowledgement): unknown { + const obj: any = {}; + message.result !== undefined && + (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined); + message.error !== undefined && (obj.error = message.error); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/channel/v1/query.ts b/packages/stargate/src/codec/ibc/core/channel/v1/query.ts new file mode 100644 index 00000000..4e37d4cf --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/channel/v1/query.ts @@ -0,0 +1,2881 @@ +/* eslint-disable */ +import { Channel, IdentifiedChannel, PacketState } from "../../../../ibc/core/channel/v1/channel"; +import { Height, IdentifiedClientState } from "../../../../ibc/core/client/v1/client"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +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 interface QueryChannelRequest { + /** + * port unique identifier + */ + portId: string; + /** + * 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. + */ +export interface QueryChannelResponse { + /** + * channel associated with the request identifiers + */ + channel?: Channel; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryChannelsRequest is the request type for the Query/Channels RPC method + */ +export interface QueryChannelsRequest { + /** + * pagination request + */ + pagination?: PageRequest; +} + +/** + * QueryChannelsResponse is the response type for the Query/Channels RPC method. + */ +export interface QueryChannelsResponse { + /** + * list of stored channels of the chain. + */ + channels: IdentifiedChannel[]; + /** + * pagination response + */ + pagination?: PageResponse; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequest { + /** + * connection unique identifier + */ + connection: string; + /** + * pagination request + */ + pagination?: PageRequest; +} + +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponse { + /** + * list of channels associated with a connection. + */ + channels: IdentifiedChannel[]; + /** + * pagination response + */ + pagination?: PageResponse; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponse { + /** + * client state associated with the channel + */ + identifiedClientState?: IdentifiedClientState; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * revision number of the consensus state + */ + revisionNumber: Long; + /** + * revision height of the consensus state + */ + revisionHeight: Long; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponse { + /** + * consensus state associated with the channel + */ + consensusState?: Any; + /** + * client ID associated with the consensus state + */ + clientId: string; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * 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 + */ +export interface QueryPacketCommitmentResponse { + /** + * packet associated with the request fields + */ + commitment: Uint8Array; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * pagination request + */ + pagination?: PageRequest; +} + +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponse { + commitments: PacketState[]; + /** + * pagination response + */ + pagination?: PageResponse; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * 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 + */ +export interface QueryPacketReceiptResponse { + /** + * success flag for if receipt exists + */ + received: boolean; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * 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 + */ +export interface QueryPacketAcknowledgementResponse { + /** + * packet associated with the request fields + */ + acknowledgement: Uint8Array; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * pagination request + */ + pagination?: PageRequest; +} + +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponse { + acknowledgements: PacketState[]; + /** + * pagination response + */ + pagination?: PageResponse; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * list of packet sequences + */ + packetCommitmentSequences: Long[]; +} + +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponse { + /** + * list of unreceived packet sequences + */ + sequences: Long[]; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; + /** + * list of acknowledgement sequences + */ + packetAckSequences: Long[]; +} + +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponse { + /** + * list of unreceived acknowledgement sequences + */ + sequences: Long[]; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequest { + /** + * port unique identifier + */ + portId: string; + /** + * channel unique identifier + */ + channelId: string; +} + +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponse { + /** + * next sequence receive number + */ + nextSequenceReceive: Long; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * 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"; + +export const QueryChannelRequest = { + encode(message: QueryChannelRequest, 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): QueryChannelRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelRequest { + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelRequest { + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, + toJSON(message: QueryChannelRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, +}; + +export const QueryChannelResponse = { + encode(message: QueryChannelResponse, writer: Writer = Writer.create()): Writer { + if (message.channel !== undefined && message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelResponse { + const message = { ...baseQueryChannelResponse } as QueryChannelResponse; + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromJSON(object.channel); + } else { + message.channel = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelResponse { + const message = { ...baseQueryChannelResponse } as QueryChannelResponse; + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromPartial(object.channel); + } else { + message.channel = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryChannelResponse): unknown { + const obj: any = {}; + message.channel !== undefined && + (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryChannelsRequest = { + encode(message: QueryChannelsRequest, writer: Writer = Writer.create()): Writer { + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelsRequest { + const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelsRequest { + const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryChannelsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryChannelsResponse = { + encode(message: QueryChannelsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.channels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelsResponse { + const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelsResponse { + const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => (e ? IdentifiedChannel.toJSON(e) : undefined)); + } else { + obj.channels = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +export const QueryConnectionChannelsRequest = { + encode(message: QueryConnectionChannelsRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.connection); + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionChannelsRequest { + const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; + if (object.connection !== undefined && object.connection !== null) { + message.connection = String(object.connection); + } else { + message.connection = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionChannelsRequest { + const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; + if (object.connection !== undefined && object.connection !== null) { + message.connection = object.connection; + } else { + message.connection = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryConnectionChannelsRequest): unknown { + const obj: any = {}; + message.connection !== undefined && (obj.connection = message.connection); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryConnectionChannelsResponse = { + encode(message: QueryConnectionChannelsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.channels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionChannelsResponse { + const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionChannelsResponse { + const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryConnectionChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => (e ? IdentifiedChannel.toJSON(e) : undefined)); + } else { + obj.channels = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelClientStateRequest { + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelClientStateRequest { + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, + toJSON(message: QueryChannelClientStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, +}; + +export const QueryChannelClientStateResponse = { + encode(message: QueryChannelClientStateResponse, writer: Writer = Writer.create()): Writer { + if (message.identifiedClientState !== undefined && message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelClientStateResponse { + const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromJSON(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelClientStateResponse { + const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryChannelClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && + (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryChannelConsensusStateRequest = { + encode(message: QueryChannelConsensusStateRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(24).uint64(message.revisionNumber); + writer.uint32(32).uint64(message.revisionHeight); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.revisionNumber = reader.uint64() as Long; + break; + case 4: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelConsensusStateRequest { + const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelConsensusStateRequest { + const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + toJSON(message: QueryChannelConsensusStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, +}; + +export const QueryChannelConsensusStateResponse = { + encode(message: QueryChannelConsensusStateResponse, writer: Writer = Writer.create()): Writer { + if (message.consensusState !== undefined && message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.clientId); + writer.uint32(26).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelConsensusStateResponse { + const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryChannelConsensusStateResponse { + const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryChannelConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryPacketCommitmentRequest = { + encode(message: QueryPacketCommitmentRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketCommitmentRequest { + const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketCommitmentRequest { + const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: QueryPacketCommitmentRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const QueryPacketCommitmentResponse = { + encode(message: QueryPacketCommitmentResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.commitment); + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitment = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketCommitmentResponse { + const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketCommitmentResponse { + const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = object.commitment; + } else { + message.commitment = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryPacketCommitmentResponse): unknown { + const obj: any = {}; + message.commitment !== undefined && + (obj.commitment = base64FromBytes( + message.commitment !== undefined ? message.commitment : new Uint8Array(), + )); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryPacketCommitmentsRequest = { + encode(message: QueryPacketCommitmentsRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketCommitmentsRequest { + const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketCommitmentsRequest { + const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryPacketCommitmentsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryPacketCommitmentsResponse = { + encode(message: QueryPacketCommitmentsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.commitments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketCommitmentsResponse { + const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; + message.commitments = []; + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketCommitmentsResponse { + const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; + message.commitments = []; + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryPacketCommitmentsResponse): unknown { + const obj: any = {}; + if (message.commitments) { + obj.commitments = message.commitments.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.commitments = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +export const QueryPacketReceiptRequest = { + encode(message: QueryPacketReceiptRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketReceiptRequest { + const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketReceiptRequest { + const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: QueryPacketReceiptRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const QueryPacketReceiptResponse = { + encode(message: QueryPacketReceiptResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(16).bool(message.received); + writer.uint32(26).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.received = reader.bool(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketReceiptResponse { + const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; + if (object.received !== undefined && object.received !== null) { + message.received = Boolean(object.received); + } else { + message.received = false; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketReceiptResponse { + const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; + if (object.received !== undefined && object.received !== null) { + message.received = object.received; + } else { + message.received = false; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryPacketReceiptResponse): unknown { + const obj: any = {}; + message.received !== undefined && (obj.received = message.received); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryPacketAcknowledgementRequest = { + encode(message: QueryPacketAcknowledgementRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketAcknowledgementRequest { + const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementRequest { + const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: QueryPacketAcknowledgementRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const QueryPacketAcknowledgementResponse = { + encode(message: QueryPacketAcknowledgementResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.acknowledgement); + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgement = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketAcknowledgementResponse { + const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementResponse { + const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = object.acknowledgement; + } else { + message.acknowledgement = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryPacketAcknowledgementResponse): unknown { + const obj: any = {}; + message.acknowledgement !== undefined && + (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryPacketAcknowledgementsRequest = { + encode(message: QueryPacketAcknowledgementsRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketAcknowledgementsRequest { + const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsRequest { + const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryPacketAcknowledgementsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryPacketAcknowledgementsResponse = { + encode(message: QueryPacketAcknowledgementsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.acknowledgements = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryPacketAcknowledgementsResponse { + const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; + message.acknowledgements = []; + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsResponse { + const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; + message.acknowledgements = []; + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryPacketAcknowledgementsResponse): unknown { + const obj: any = {}; + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.acknowledgements = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +export const QueryUnreceivedPacketsRequest = { + encode(message: QueryUnreceivedPacketsRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(26).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.packetCommitmentSequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(reader.uint64() as Long); + } + } else { + message.packetCommitmentSequences.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUnreceivedPacketsRequest { + const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; + message.packetCommitmentSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.packetCommitmentSequences !== undefined && object.packetCommitmentSequences !== null) { + for (const e of object.packetCommitmentSequences) { + message.packetCommitmentSequences.push(Long.fromString(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnreceivedPacketsRequest { + const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; + message.packetCommitmentSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.packetCommitmentSequences !== undefined && object.packetCommitmentSequences !== null) { + for (const e of object.packetCommitmentSequences) { + message.packetCommitmentSequences.push(e); + } + } + return message; + }, + toJSON(message: QueryUnreceivedPacketsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => + (e || Long.UZERO).toString(), + ); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, +}; + +export const QueryUnreceivedPacketsResponse = { + encode(message: QueryUnreceivedPacketsResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.sequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64() as Long); + } + } else { + message.sequences.push(reader.uint64() as Long); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUnreceivedPacketsResponse { + const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Long.fromString(e)); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnreceivedPacketsResponse { + const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(e); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryUnreceivedPacketsResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +export const QueryUnreceivedAcksRequest = { + encode(message: QueryUnreceivedAcksRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.portId); + writer.uint32(18).string(message.channelId); + writer.uint32(26).fork(); + for (const v of message.packetAckSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.packetAckSequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetAckSequences.push(reader.uint64() as Long); + } + } else { + message.packetAckSequences.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUnreceivedAcksRequest { + const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; + message.packetAckSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.packetAckSequences !== undefined && object.packetAckSequences !== null) { + for (const e of object.packetAckSequences) { + message.packetAckSequences.push(Long.fromString(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnreceivedAcksRequest { + const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; + message.packetAckSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.packetAckSequences !== undefined && object.packetAckSequences !== null) { + for (const e of object.packetAckSequences) { + message.packetAckSequences.push(e); + } + } + return message; + }, + toJSON(message: QueryUnreceivedAcksRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetAckSequences) { + obj.packetAckSequences = message.packetAckSequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.packetAckSequences = []; + } + return obj; + }, +}; + +export const QueryUnreceivedAcksResponse = { + encode(message: QueryUnreceivedAcksResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.sequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64() as Long); + } + } else { + message.sequences.push(reader.uint64() as Long); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUnreceivedAcksResponse { + const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Long.fromString(e)); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnreceivedAcksResponse { + const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(e); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryUnreceivedAcksResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryNextSequenceReceiveRequest { + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryNextSequenceReceiveRequest { + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, + toJSON(message: QueryNextSequenceReceiveRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, +}; + +export const QueryNextSequenceReceiveResponse = { + encode(message: QueryNextSequenceReceiveResponse, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.nextSequenceReceive); + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceReceive = reader.uint64() as Long; + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryNextSequenceReceiveResponse { + const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; + if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { + message.nextSequenceReceive = Long.fromString(object.nextSequenceReceive); + } else { + message.nextSequenceReceive = Long.UZERO; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryNextSequenceReceiveResponse { + const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; + if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { + message.nextSequenceReceive = object.nextSequenceReceive as Long; + } else { + message.nextSequenceReceive = Long.UZERO; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryNextSequenceReceiveResponse): unknown { + const obj: any = {}; + message.nextSequenceReceive !== undefined && + (obj.nextSequenceReceive = (message.nextSequenceReceive || Long.UZERO).toString()); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/client/v1/client.ts b/packages/stargate/src/codec/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..c04caa73 --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/client/v1/client.ts @@ -0,0 +1,561 @@ +/* eslint-disable */ +import { Any } from "../../../../google/protobuf/any"; +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** + * client identifier + */ + clientId: string; + /** + * client state + */ + clientState?: Any; +} + +/** + * ConsensusStateWithHeight defines a consensus state with an additional height field. + */ +export interface ConsensusStateWithHeight { + /** + * consensus state height + */ + height?: Height; + /** + * consensus state + */ + consensusState?: Any; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** + * client identifier + */ + clientId: string; + /** + * consensus states and their heights associated with the client + */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * 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 + */ + title: string; + /** + * the description of the proposal + */ + description: string; + /** + * 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 + */ + header?: Any; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping RevisionNumber + * the same. However some consensus algorithms may choose to reset the + * height in certain conditions e.g. hard forks, state-machine breaking changes + * In these cases, the RevisionNumber is incremented so that height continues to + * be monitonically increasing even as the RevisionHeight gets reset + */ +export interface Height { + /** + * the revision that the client is currently on + */ + revisionNumber: Long; + /** + * the height within the given revision + */ + revisionHeight: Long; +} + +/** + * Params defines the set of IBC light client parameters. + */ +export interface Params { + /** + * 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"; + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.clientId); + if (message.clientState !== undefined && message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IdentifiedClientState { + const message = { ...baseIdentifiedClientState } as IdentifiedClientState; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedClientState { + const message = { ...baseIdentifiedClientState } as IdentifiedClientState; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, +}; + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: Writer = Writer.create()): Writer { + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined && message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConsensusStateWithHeight { + const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ConsensusStateWithHeight { + const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, +}; + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.clientId); + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.consensusStates = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientConsensusStates { + const message = { ...baseClientConsensusStates } as ClientConsensusStates; + message.consensusStates = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientConsensusStates { + const message = { ...baseClientConsensusStates } as ClientConsensusStates; + message.consensusStates = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => + e ? ConsensusStateWithHeight.toJSON(e) : undefined, + ); + } else { + obj.consensusStates = []; + } + return obj; + }, +}; + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.title); + writer.uint32(18).string(message.description); + writer.uint32(26).string(message.clientId); + if (message.header !== undefined && message.header !== undefined) { + Any.encode(message.header, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.header = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientUpdateProposal { + const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromJSON(object.header); + } else { + message.header = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ClientUpdateProposal { + const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromPartial(object.header); + } else { + message.header = undefined; + } + return message; + }, + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.header !== undefined && (obj.header = message.header ? Any.toJSON(message.header) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeight } as Height; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64() as Long; + break; + case 2: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Height { + const message = { ...baseHeight } as Height; + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Height { + const message = { ...baseHeight } as Height; + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, +}; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.allowedClients = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.allowedClients = []; + if (object.allowedClients !== undefined && object.allowedClients !== null) { + for (const e of object.allowedClients) { + message.allowedClients.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + message.allowedClients = []; + if (object.allowedClients !== undefined && object.allowedClients !== null) { + for (const e of object.allowedClients) { + message.allowedClients.push(e); + } + } + return message; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts b/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 00000000..c3f923c7 --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,294 @@ +/* eslint-disable */ +import { CommitmentProof } from "../../../../confio/proofs"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * 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...)) + */ +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 + */ +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 + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerkleRoot } as MerkleRoot; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MerkleRoot { + const message = { ...baseMerkleRoot } as MerkleRoot; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + fromPartial(object: DeepPartial): MerkleRoot { + const message = { ...baseMerkleRoot } as MerkleRoot; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, + toJSON(message: MerkleRoot): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerklePrefix } as MerklePrefix; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MerklePrefix { + const message = { ...baseMerklePrefix } as MerklePrefix; + if (object.keyPrefix !== undefined && object.keyPrefix !== null) { + message.keyPrefix = bytesFromBase64(object.keyPrefix); + } + return message; + }, + fromPartial(object: DeepPartial): MerklePrefix { + const message = { ...baseMerklePrefix } as MerklePrefix; + if (object.keyPrefix !== undefined && object.keyPrefix !== null) { + message.keyPrefix = object.keyPrefix; + } else { + message.keyPrefix = new Uint8Array(); + } + return message; + }, + toJSON(message: MerklePrefix): unknown { + const obj: any = {}; + message.keyPrefix !== undefined && + (obj.keyPrefix = base64FromBytes( + message.keyPrefix !== undefined ? message.keyPrefix : new Uint8Array(), + )); + return obj; + }, +}; + +export const MerklePath = { + encode(message: MerklePath, writer: Writer = Writer.create()): Writer { + for (const v of message.keyPath) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.keyPath = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MerklePath { + const message = { ...baseMerklePath } as MerklePath; + message.keyPath = []; + if (object.keyPath !== undefined && object.keyPath !== null) { + for (const e of object.keyPath) { + message.keyPath.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MerklePath { + const message = { ...baseMerklePath } as MerklePath; + message.keyPath = []; + if (object.keyPath !== undefined && object.keyPath !== null) { + for (const e of object.keyPath) { + message.keyPath.push(e); + } + } + return message; + }, + toJSON(message: MerklePath): unknown { + const obj: any = {}; + if (message.keyPath) { + obj.keyPath = message.keyPath.map((e) => e); + } else { + obj.keyPath = []; + } + return obj; + }, +}; + +export const MerkleProof = { + encode(message: MerkleProof, writer: Writer = Writer.create()): Writer { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.proofs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MerkleProof { + const message = { ...baseMerkleProof } as MerkleProof; + message.proofs = []; + if (object.proofs !== undefined && object.proofs !== null) { + for (const e of object.proofs) { + message.proofs.push(CommitmentProof.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MerkleProof { + const message = { ...baseMerkleProof } as MerkleProof; + message.proofs = []; + if (object.proofs !== undefined && object.proofs !== null) { + for (const e of object.proofs) { + message.proofs.push(CommitmentProof.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MerkleProof): unknown { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map((e) => (e ? CommitmentProof.toJSON(e) : undefined)); + } else { + obj.proofs = []; + } + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts b/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts new file mode 100644 index 00000000..0b2783c1 --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/connection/v1/connection.ts @@ -0,0 +1,758 @@ +/* eslint-disable */ +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. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State + */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. + */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. + */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + default: + return "UNKNOWN"; + } +} + +export const ConnectionEnd = { + encode(message: ConnectionEnd, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.clientId); + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int32(message.state); + if (message.counterparty !== undefined && message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + writer.uint32(40).uint64(message.delayPeriod); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.versions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = reader.int32() as any; + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConnectionEnd { + const message = { ...baseConnectionEnd } as ConnectionEnd; + message.versions = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromJSON(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionEnd { + const message = { ...baseConnectionEnd } as ConnectionEnd; + message.versions = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromPartial(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + toJSON(message: ConnectionEnd): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined)); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + return obj; + }, +}; + +export const IdentifiedConnection = { + encode(message: IdentifiedConnection, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.id); + writer.uint32(18).string(message.clientId); + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(32).int32(message.state); + if (message.counterparty !== undefined && message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + writer.uint32(48).uint64(message.delayPeriod); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.versions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = reader.int32() as any; + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IdentifiedConnection { + const message = { ...baseIdentifiedConnection } as IdentifiedConnection; + message.versions = []; + if (object.id !== undefined && object.id !== null) { + message.id = String(object.id); + } else { + message.id = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromJSON(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedConnection { + const message = { ...baseIdentifiedConnection } as IdentifiedConnection; + message.versions = []; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromPartial(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + toJSON(message: IdentifiedConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined)); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + return obj; + }, +}; + +export const Counterparty = { + encode(message: Counterparty, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.clientId); + writer.uint32(18).string(message.connectionId); + if (message.prefix !== undefined && message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromJSON(object.prefix); + } else { + message.prefix = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromPartial(object.prefix); + } else { + message.prefix = undefined; + } + return message; + }, + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.prefix !== undefined && + (obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined); + return obj; + }, +}; + +export const ClientPaths = { + encode(message: ClientPaths, writer: Writer = Writer.create()): Writer { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.paths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientPaths { + const message = { ...baseClientPaths } as ClientPaths; + message.paths = []; + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientPaths { + const message = { ...baseClientPaths } as ClientPaths; + message.paths = []; + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(e); + } + } + return message; + }, + toJSON(message: ClientPaths): unknown { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, +}; + +export const ConnectionPaths = { + encode(message: ConnectionPaths, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.clientId); + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.paths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConnectionPaths { + const message = { ...baseConnectionPaths } as ConnectionPaths; + message.paths = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionPaths { + const message = { ...baseConnectionPaths } as ConnectionPaths; + message.paths = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(e); + } + } + return message; + }, + toJSON(message: ConnectionPaths): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, +}; + +export const Version = { + encode(message: Version, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.identifier); + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.features = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Version { + const message = { ...baseVersion } as Version; + message.features = []; + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = String(object.identifier); + } else { + message.identifier = ""; + } + if (object.features !== undefined && object.features !== null) { + for (const e of object.features) { + message.features.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Version { + const message = { ...baseVersion } as Version; + message.features = []; + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } else { + message.identifier = ""; + } + if (object.features !== undefined && object.features !== null) { + for (const e of object.features) { + message.features.push(e); + } + } + return message; + }, + toJSON(message: Version): unknown { + const obj: any = {}; + message.identifier !== undefined && (obj.identifier = message.identifier); + if (message.features) { + obj.features = message.features.map((e) => e); + } else { + obj.features = []; + } + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/ibc/core/connection/v1/query.ts b/packages/stargate/src/codec/ibc/core/connection/v1/query.ts new file mode 100644 index 00000000..5565665f --- /dev/null +++ b/packages/stargate/src/codec/ibc/core/connection/v1/query.ts @@ -0,0 +1,1032 @@ +/* eslint-disable */ +import { ConnectionEnd, IdentifiedConnection } from "../../../../ibc/core/connection/v1/connection"; +import { Height, IdentifiedClientState } from "../../../../ibc/core/client/v1/client"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import * as Long from "long"; +import { Any } from "../../../../google/protobuf/any"; +import { Reader, Writer } from "protobufjs/minimal"; + +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequest { + /** + * 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. + */ +export interface QueryConnectionResponse { + /** + * connection associated with the request identifier + */ + connection?: ConnectionEnd; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * 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. + */ +export interface QueryConnectionsResponse { + /** + * list of stored connections of the chain. + */ + connections: IdentifiedConnection[]; + /** + * pagination response + */ + pagination?: PageResponse; + /** + * query block height + */ + height?: Height; +} + +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequest { + /** + * client identifier associated with a connection + */ + clientId: string; +} + +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponse { + /** + * slice of all the connection paths associated with a client. + */ + connectionPaths: string[]; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was generated + */ + proofHeight?: Height; +} + +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequest { + /** + * connection identifier + */ + connectionId: string; +} + +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponse { + /** + * client state associated with the channel + */ + identifiedClientState?: IdentifiedClientState; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * height at which the proof was retrieved + */ + proofHeight?: Height; +} + +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequest { + /** + * connection identifier + */ + connectionId: string; + revisionNumber: Long; + revisionHeight: Long; +} + +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponse { + /** + * consensus state associated with the channel + */ + consensusState?: Any; + /** + * client ID associated with the consensus state + */ + clientId: string; + /** + * merkle proof of existence + */ + proof: Uint8Array; + /** + * 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"; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionRequest { + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionRequest { + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + return message; + }, + toJSON(message: QueryConnectionRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, +}; + +export const QueryConnectionResponse = { + encode(message: QueryConnectionResponse, writer: Writer = Writer.create()): Writer { + if (message.connection !== undefined && message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionResponse { + const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromJSON(object.connection); + } else { + message.connection = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionResponse { + const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromPartial(object.connection); + } else { + message.connection = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryConnectionResponse): unknown { + const obj: any = {}; + message.connection !== undefined && + (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryConnectionsRequest = { + encode(message: QueryConnectionsRequest, writer: Writer = Writer.create()): Writer { + if (message.pagination !== undefined && message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionsRequest { + const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionsRequest { + const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + toJSON(message: QueryConnectionsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, +}; + +export const QueryConnectionsResponse = { + encode(message: QueryConnectionsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined && message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined && message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.connections = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionsResponse { + const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; + message.connections = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionsResponse { + const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; + message.connections = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, + toJSON(message: QueryConnectionsResponse): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined)); + } else { + obj.connections = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryClientConnectionsRequest { + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryClientConnectionsRequest { + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + return message; + }, + toJSON(message: QueryClientConnectionsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, +}; + +export const QueryClientConnectionsResponse = { + encode(message: QueryClientConnectionsResponse, writer: Writer = Writer.create()): Writer { + for (const v of message.connectionPaths) { + writer.uint32(10).string(v!); + } + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.connectionPaths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryClientConnectionsResponse { + const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; + message.connectionPaths = []; + if (object.connectionPaths !== undefined && object.connectionPaths !== null) { + for (const e of object.connectionPaths) { + message.connectionPaths.push(String(e)); + } + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryClientConnectionsResponse { + const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; + message.connectionPaths = []; + if (object.connectionPaths !== undefined && object.connectionPaths !== null) { + for (const e of object.connectionPaths) { + message.connectionPaths.push(e); + } + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryClientConnectionsResponse): unknown { + const obj: any = {}; + if (message.connectionPaths) { + obj.connectionPaths = message.connectionPaths.map((e) => e); + } else { + obj.connectionPaths = []; + } + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionClientStateRequest { + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionClientStateRequest { + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + return message; + }, + toJSON(message: QueryConnectionClientStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, +}; + +export const QueryConnectionClientStateResponse = { + encode(message: QueryConnectionClientStateResponse, writer: Writer = Writer.create()): Writer { + if (message.identifiedClientState !== undefined && message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionClientStateResponse { + const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromJSON(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): QueryConnectionClientStateResponse { + const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryConnectionClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && + (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +export const QueryConnectionConsensusStateRequest = { + encode(message: QueryConnectionConsensusStateRequest, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.connectionId); + writer.uint32(16).uint64(message.revisionNumber); + writer.uint32(24).uint64(message.revisionHeight); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64() as Long; + break; + case 3: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionConsensusStateRequest { + const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateRequest { + const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + toJSON(message: QueryConnectionConsensusStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, +}; + +export const QueryConnectionConsensusStateResponse = { + encode(message: QueryConnectionConsensusStateResponse, writer: Writer = Writer.create()): Writer { + if (message.consensusState !== undefined && message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.clientId); + writer.uint32(26).bytes(message.proof); + if (message.proofHeight !== undefined && message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryConnectionConsensusStateResponse { + const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateResponse { + const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + toJSON(message: QueryConnectionConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/index.ts b/packages/stargate/src/codec/index.ts deleted file mode 100644 index ccef2d69..00000000 --- a/packages/stargate/src/codec/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This codec is derived from the Cosmos SDK protocol buffer definitions and can change at any time. - * @packageDocumentation - */ - -import Long from "long"; -import protobuf from "protobufjs/minimal"; - -// Ensure the protobuf module has a Long implementation, which otherwise only works -// in Node.js (see https://github.com/protobufjs/protobuf.js/issues/921#issuecomment-334925145) -protobuf.util.Long = Long; -protobuf.configure(); - -export * from "./generated/codecimpl"; diff --git a/packages/stargate/src/codec/tendermint/abci/types.ts b/packages/stargate/src/codec/tendermint/abci/types.ts new file mode 100644 index 00000000..4fcf594d --- /dev/null +++ b/packages/stargate/src/codec/tendermint/abci/types.ts @@ -0,0 +1,4876 @@ +/* eslint-disable */ +import * as Long from "long"; +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 { 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 { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} + +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} + +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + default: + return "UNKNOWN"; + } +} + +export enum EvidenceType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} + +export function evidenceTypeFromJSON(object: any): EvidenceType { + switch (object) { + case 0: + case "UNKNOWN": + return EvidenceType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return EvidenceType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return EvidenceType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return EvidenceType.UNRECOGNIZED; + } +} + +export function evidenceTypeToJSON(object: EvidenceType): string { + switch (object) { + case EvidenceType.UNKNOWN: + return "UNKNOWN"; + case EvidenceType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case EvidenceType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + default: + return "UNKNOWN"; + } +} + +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration + */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks + */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration + */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others + */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others + */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others + */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} + +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} + +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + default: + return "UNKNOWN"; + } +} + +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration + */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted + */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration + */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) + */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) + */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others + */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} + +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} + +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + default: + return "UNKNOWN"; + } +} + +export const Request = { + encode(message: Request, writer: Writer = Writer.create()): Writer { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); + } + if (message.setOption !== undefined) { + RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); + } + if (message.initChain !== undefined) { + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); + } + if (message.query !== undefined) { + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Request { + const message = { ...baseRequest } as Request; + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromJSON(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromJSON(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromJSON(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = RequestSetOption.fromJSON(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = RequestInitChain.fromJSON(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromJSON(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = RequestBeginBlock.fromJSON(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = RequestCheckTx.fromJSON(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = RequestDeliverTx.fromJSON(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = RequestEndBlock.fromJSON(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromJSON(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromJSON(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Request { + const message = { ...baseRequest } as Request; + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromPartial(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromPartial(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromPartial(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = RequestSetOption.fromPartial(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = RequestInitChain.fromPartial(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromPartial(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = RequestBeginBlock.fromPartial(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = RequestCheckTx.fromPartial(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = RequestDeliverTx.fromPartial(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = RequestEndBlock.fromPartial(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromPartial(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromPartial(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + toJSON(message: Request): unknown { + const obj: any = {}; + message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && + (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); + message.setOption !== undefined && + (obj.setOption = message.setOption ? RequestSetOption.toJSON(message.setOption) : undefined); + message.initChain !== undefined && + (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && + (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined && + (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined && + (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined && + (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined && + (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && + (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined && + (obj.listSnapshots = message.listSnapshots + ? RequestListSnapshots.toJSON(message.listSnapshots) + : undefined); + message.offerSnapshot !== undefined && + (obj.offerSnapshot = message.offerSnapshot + ? RequestOfferSnapshot.toJSON(message.offerSnapshot) + : undefined); + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestEcho } as RequestEcho; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestEcho { + const message = { ...baseRequestEcho } as RequestEcho; + if (object.message !== undefined && object.message !== null) { + message.message = String(object.message); + } else { + message.message = ""; + } + return message; + }, + fromPartial(object: DeepPartial): RequestEcho { + const message = { ...baseRequestEcho } as RequestEcho; + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } else { + message.message = ""; + } + return message; + }, + toJSON(message: RequestEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, +}; + +export const RequestFlush = { + encode(_: RequestFlush, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const RequestInfo = { + encode(message: RequestInfo, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.version); + writer.uint32(16).uint64(message.blockVersion); + writer.uint32(24).uint64(message.p2pVersion); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64() as Long; + break; + case 3: + message.p2pVersion = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestInfo { + const message = { ...baseRequestInfo } as RequestInfo; + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.blockVersion !== undefined && object.blockVersion !== null) { + message.blockVersion = Long.fromString(object.blockVersion); + } else { + message.blockVersion = Long.UZERO; + } + if (object.p2pVersion !== undefined && object.p2pVersion !== null) { + message.p2pVersion = Long.fromString(object.p2pVersion); + } else { + message.p2pVersion = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): RequestInfo { + const message = { ...baseRequestInfo } as RequestInfo; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.blockVersion !== undefined && object.blockVersion !== null) { + message.blockVersion = object.blockVersion as Long; + } else { + message.blockVersion = Long.UZERO; + } + if (object.p2pVersion !== undefined && object.p2pVersion !== null) { + message.p2pVersion = object.p2pVersion as Long; + } else { + message.p2pVersion = Long.UZERO; + } + return message; + }, + toJSON(message: RequestInfo): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.blockVersion !== undefined && + (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()); + message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestSetOption } as RequestSetOption; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestSetOption { + const message = { ...baseRequestSetOption } as RequestSetOption; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; + }, + fromPartial(object: DeepPartial): RequestSetOption { + const message = { ...baseRequestSetOption } as RequestSetOption; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } + return message; + }, + toJSON(message: RequestSetOption): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, +}; + +export const RequestInitChain = { + encode(message: RequestInitChain, writer: Writer = Writer.create()): Writer { + if (message.time !== undefined && message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.chainId); + if (message.consensusParams !== undefined && message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + writer.uint32(42).bytes(message.appStateBytes); + writer.uint32(48).int64(message.initialHeight); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestInitChain { + const message = { ...baseRequestInitChain } as RequestInitChain; + message.validators = []; + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromJSON(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.appStateBytes !== undefined && object.appStateBytes !== null) { + message.appStateBytes = bytesFromBase64(object.appStateBytes); + } + if (object.initialHeight !== undefined && object.initialHeight !== null) { + message.initialHeight = Long.fromString(object.initialHeight); + } else { + message.initialHeight = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): RequestInitChain { + const message = { ...baseRequestInitChain } as RequestInitChain; + message.validators = []; + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromPartial(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.appStateBytes !== undefined && object.appStateBytes !== null) { + message.appStateBytes = object.appStateBytes; + } else { + message.appStateBytes = new Uint8Array(); + } + if (object.initialHeight !== undefined && object.initialHeight !== null) { + message.initialHeight = object.initialHeight as Long; + } else { + message.initialHeight = Long.ZERO; + } + return message; + }, + toJSON(message: RequestInitChain): unknown { + const obj: any = {}; + message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.consensusParams !== undefined && + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.appStateBytes !== undefined && + (obj.appStateBytes = base64FromBytes( + message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), + )); + message.initialHeight !== undefined && + (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()); + return obj; + }, +}; + +export const RequestQuery = { + encode(message: RequestQuery, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.data); + writer.uint32(18).string(message.path); + writer.uint32(24).int64(message.height); + writer.uint32(32).bool(message.prove); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestQuery { + const message = { ...baseRequestQuery } as RequestQuery; + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = Boolean(object.prove); + } else { + message.prove = false; + } + return message; + }, + fromPartial(object: DeepPartial): RequestQuery { + const message = { ...baseRequestQuery } as RequestQuery; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } else { + message.prove = false; + } + return message; + }, + toJSON(message: RequestQuery): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.path !== undefined && (obj.path = message.path); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.prove !== undefined && (obj.prove = message.prove); + return obj; + }, +}; + +export const RequestBeginBlock = { + encode(message: RequestBeginBlock, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.hash); + if (message.header !== undefined && message.header !== undefined) { + Header.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.lastCommitInfo !== undefined && message.lastCommitInfo !== undefined) { + LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.byzantineValidators) { + Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.byzantineValidators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestBeginBlock { + const message = { ...baseRequestBeginBlock } as RequestBeginBlock; + message.byzantineValidators = []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) { + message.lastCommitInfo = LastCommitInfo.fromJSON(object.lastCommitInfo); + } else { + message.lastCommitInfo = undefined; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Evidence.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestBeginBlock { + const message = { ...baseRequestBeginBlock } as RequestBeginBlock; + message.byzantineValidators = []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) { + message.lastCommitInfo = LastCommitInfo.fromPartial(object.lastCommitInfo); + } else { + message.lastCommitInfo = undefined; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Evidence.fromPartial(e)); + } + } + return message; + }, + toJSON(message: RequestBeginBlock): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.lastCommitInfo !== undefined && + (obj.lastCommitInfo = message.lastCommitInfo + ? LastCommitInfo.toJSON(message.lastCommitInfo) + : undefined); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => (e ? Evidence.toJSON(e) : undefined)); + } else { + obj.byzantineValidators = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestCheckTx } as RequestCheckTx; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestCheckTx { + const message = { ...baseRequestCheckTx } as RequestCheckTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = checkTxTypeFromJSON(object.type); + } else { + message.type = 0; + } + return message; + }, + fromPartial(object: DeepPartial): RequestCheckTx { + const message = { ...baseRequestCheckTx } as RequestCheckTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + return message; + }, + toJSON(message: RequestCheckTx): unknown { + const obj: any = {}; + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestDeliverTx { + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; + }, + fromPartial(object: DeepPartial): RequestDeliverTx { + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + return message; + }, + toJSON(message: RequestDeliverTx): unknown { + const obj: any = {}; + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestEndBlock } as RequestEndBlock; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestEndBlock { + const message = { ...baseRequestEndBlock } as RequestEndBlock; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): RequestEndBlock { + const message = { ...baseRequestEndBlock } as RequestEndBlock; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + return message; + }, + toJSON(message: RequestEndBlock): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + return obj; + }, +}; + +export const RequestCommit = { + encode(_: RequestCommit, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const RequestListSnapshots = { + encode(_: RequestListSnapshots, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const RequestOfferSnapshot = { + encode(message: RequestOfferSnapshot, writer: Writer = Writer.create()): Writer { + if (message.snapshot !== undefined && message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).bytes(message.appHash); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestOfferSnapshot { + const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromJSON(object.snapshot); + } else { + message.snapshot = undefined; + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + return message; + }, + fromPartial(object: DeepPartial): RequestOfferSnapshot { + const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromPartial(object.snapshot); + } else { + message.snapshot = undefined; + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + return message; + }, + toJSON(message: RequestOfferSnapshot): unknown { + const obj: any = {}; + message.snapshot !== undefined && + (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined); + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, +}; + +export const RequestLoadSnapshotChunk = { + encode(message: RequestLoadSnapshotChunk, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.height); + writer.uint32(16).uint32(message.format); + writer.uint32(24).uint32(message.chunk); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() as Long; + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestLoadSnapshotChunk { + const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = Number(object.format); + } else { + message.format = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = Number(object.chunk); + } else { + message.chunk = 0; + } + return message; + }, + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { + const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = 0; + } + return message; + }, + toJSON(message: RequestLoadSnapshotChunk): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.format !== undefined && (obj.format = message.format); + message.chunk !== undefined && (obj.chunk = message.chunk); + return obj; + }, +}; + +export const RequestApplySnapshotChunk = { + encode(message: RequestApplySnapshotChunk, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.index); + writer.uint32(18).bytes(message.chunk); + writer.uint32(26).string(message.sender); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestApplySnapshotChunk { + const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + return message; + }, + fromPartial(object: DeepPartial): RequestApplySnapshotChunk { + const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = new Uint8Array(); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + return message; + }, + toJSON(message: RequestApplySnapshotChunk): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + message.chunk !== undefined && + (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, +}; + +export const Response = { + encode(message: Response, writer: Writer = Writer.create()): Writer { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); + } + if (message.echo !== undefined) { + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); + } + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + if (message.setOption !== undefined) { + ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); + } + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Response { + const message = { ...baseResponse } as Response; + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromJSON(object.exception); + } else { + message.exception = undefined; + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromJSON(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromJSON(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromJSON(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = ResponseSetOption.fromJSON(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = ResponseInitChain.fromJSON(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromJSON(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = ResponseBeginBlock.fromJSON(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = ResponseCheckTx.fromJSON(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = ResponseDeliverTx.fromJSON(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = ResponseEndBlock.fromJSON(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromJSON(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromJSON(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Response { + const message = { ...baseResponse } as Response; + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromPartial(object.exception); + } else { + message.exception = undefined; + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromPartial(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromPartial(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromPartial(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = ResponseSetOption.fromPartial(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = ResponseInitChain.fromPartial(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromPartial(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = ResponseBeginBlock.fromPartial(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = ResponseCheckTx.fromPartial(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = ResponseDeliverTx.fromPartial(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = ResponseEndBlock.fromPartial(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromPartial(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromPartial(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + toJSON(message: Response): unknown { + const obj: any = {}; + message.exception !== undefined && + (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined); + message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && + (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); + message.setOption !== undefined && + (obj.setOption = message.setOption ? ResponseSetOption.toJSON(message.setOption) : undefined); + message.initChain !== undefined && + (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && + (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined && + (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined && + (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined && + (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined && + (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && + (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined && + (obj.listSnapshots = message.listSnapshots + ? ResponseListSnapshots.toJSON(message.listSnapshots) + : undefined); + message.offerSnapshot !== undefined && + (obj.offerSnapshot = message.offerSnapshot + ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) + : undefined); + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseException } as ResponseException; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseException { + const message = { ...baseResponseException } as ResponseException; + if (object.error !== undefined && object.error !== null) { + message.error = String(object.error); + } else { + message.error = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseException { + const message = { ...baseResponseException } as ResponseException; + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } else { + message.error = ""; + } + return message; + }, + toJSON(message: ResponseException): unknown { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseEcho } as ResponseEcho; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseEcho { + const message = { ...baseResponseEcho } as ResponseEcho; + if (object.message !== undefined && object.message !== null) { + message.message = String(object.message); + } else { + message.message = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseEcho { + const message = { ...baseResponseEcho } as ResponseEcho; + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } else { + message.message = ""; + } + return message; + }, + toJSON(message: ResponseEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, +}; + +export const ResponseFlush = { + encode(_: ResponseFlush, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, +}; + +export const ResponseInfo = { + encode(message: ResponseInfo, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.data); + writer.uint32(18).string(message.version); + writer.uint32(24).uint64(message.appVersion); + writer.uint32(32).int64(message.lastBlockHeight); + writer.uint32(42).bytes(message.lastBlockAppHash); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64() as Long; + break; + case 4: + message.lastBlockHeight = reader.int64() as Long; + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseInfo { + const message = { ...baseResponseInfo } as ResponseInfo; + if (object.data !== undefined && object.data !== null) { + message.data = String(object.data); + } else { + message.data = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = Long.fromString(object.appVersion); + } else { + message.appVersion = Long.UZERO; + } + if (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) { + message.lastBlockHeight = Long.fromString(object.lastBlockHeight); + } else { + message.lastBlockHeight = Long.ZERO; + } + if (object.lastBlockAppHash !== undefined && object.lastBlockAppHash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.lastBlockAppHash); + } + return message; + }, + fromPartial(object: DeepPartial): ResponseInfo { + const message = { ...baseResponseInfo } as ResponseInfo; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion as Long; + } else { + message.appVersion = Long.UZERO; + } + if (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) { + message.lastBlockHeight = object.lastBlockHeight as Long; + } else { + message.lastBlockHeight = Long.ZERO; + } + if (object.lastBlockAppHash !== undefined && object.lastBlockAppHash !== null) { + message.lastBlockAppHash = object.lastBlockAppHash; + } else { + message.lastBlockAppHash = new Uint8Array(); + } + return message; + }, + toJSON(message: ResponseInfo): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = message.data); + message.version !== undefined && (obj.version = message.version); + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); + message.lastBlockHeight !== undefined && + (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()); + message.lastBlockAppHash !== undefined && + (obj.lastBlockAppHash = base64FromBytes( + message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), + )); + return obj; + }, +}; + +export const ResponseSetOption = { + encode(message: ResponseSetOption, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.code); + writer.uint32(26).string(message.log); + writer.uint32(34).string(message.info); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseSetOption { + const message = { ...baseResponseSetOption } as ResponseSetOption; + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseSetOption { + const message = { ...baseResponseSetOption } as ResponseSetOption; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + return message; + }, + toJSON(message: ResponseSetOption): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + return obj; + }, +}; + +export const ResponseInitChain = { + encode(message: ResponseInitChain, writer: Writer = Writer.create()): Writer { + if (message.consensusParams !== undefined && message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).bytes(message.appHash); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseInitChain { + const message = { ...baseResponseInitChain } as ResponseInitChain; + message.validators = []; + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromJSON(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + return message; + }, + fromPartial(object: DeepPartial): ResponseInitChain { + const message = { ...baseResponseInitChain } as ResponseInitChain; + message.validators = []; + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromPartial(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + return message; + }, + toJSON(message: ResponseInitChain): unknown { + const obj: any = {}; + message.consensusParams !== undefined && + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, +}; + +export const ResponseQuery = { + encode(message: ResponseQuery, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.code); + writer.uint32(26).string(message.log); + writer.uint32(34).string(message.info); + writer.uint32(40).int64(message.index); + writer.uint32(50).bytes(message.key); + writer.uint32(58).bytes(message.value); + if (message.proofOps !== undefined && message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + writer.uint32(72).int64(message.height); + writer.uint32(82).string(message.codespace); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64() as Long; + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64() as Long; + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseQuery { + const message = { ...baseResponseQuery } as ResponseQuery; + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.ZERO; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proofOps !== undefined && object.proofOps !== null) { + message.proofOps = ProofOps.fromJSON(object.proofOps); + } else { + message.proofOps = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseQuery { + const message = { ...baseResponseQuery } as ResponseQuery; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.ZERO; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.proofOps !== undefined && object.proofOps !== null) { + message.proofOps = ProofOps.fromPartial(object.proofOps); + } else { + message.proofOps = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, + toJSON(message: ResponseQuery): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.proofOps !== undefined && + (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, +}; + +export const ResponseBeginBlock = { + encode(message: ResponseBeginBlock, writer: Writer = Writer.create()): Writer { + for (const v of message.events) { + Event.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseBeginBlock { + const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseBeginBlock { + const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ResponseBeginBlock): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, +}; + +export const ResponseCheckTx = { + encode(message: ResponseCheckTx, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.code); + writer.uint32(18).bytes(message.data); + writer.uint32(26).string(message.log); + writer.uint32(34).string(message.info); + writer.uint32(40).int64(message.gasWanted); + writer.uint32(48).int64(message.gasUsed); + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + writer.uint32(66).string(message.codespace); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64() as Long; + break; + case 6: + message.gasUsed = reader.int64() as Long; + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseCheckTx { + const message = { ...baseResponseCheckTx } as ResponseCheckTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseCheckTx { + const message = { ...baseResponseCheckTx } as ResponseCheckTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, + toJSON(message: ResponseCheckTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, +}; + +export const ResponseDeliverTx = { + encode(message: ResponseDeliverTx, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.code); + writer.uint32(18).bytes(message.data); + writer.uint32(26).string(message.log); + writer.uint32(34).string(message.info); + writer.uint32(40).int64(message.gasWanted); + writer.uint32(48).int64(message.gasUsed); + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + writer.uint32(66).string(message.codespace); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64() as Long; + break; + case 6: + message.gasUsed = reader.int64() as Long; + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseDeliverTx { + const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseDeliverTx { + const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, + toJSON(message: ResponseDeliverTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, +}; + +export const ResponseEndBlock = { + encode(message: ResponseEndBlock, writer: Writer = Writer.create()): Writer { + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusParamUpdates !== undefined && message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.validatorUpdates = []; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseEndBlock { + const message = { ...baseResponseEndBlock } as ResponseEndBlock; + message.validatorUpdates = []; + message.events = []; + if (object.validatorUpdates !== undefined && object.validatorUpdates !== null) { + for (const e of object.validatorUpdates) { + message.validatorUpdates.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) { + message.consensusParamUpdates = ConsensusParams.fromJSON(object.consensusParamUpdates); + } else { + message.consensusParamUpdates = undefined; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseEndBlock { + const message = { ...baseResponseEndBlock } as ResponseEndBlock; + message.validatorUpdates = []; + message.events = []; + if (object.validatorUpdates !== undefined && object.validatorUpdates !== null) { + for (const e of object.validatorUpdates) { + message.validatorUpdates.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) { + message.consensusParamUpdates = ConsensusParams.fromPartial(object.consensusParamUpdates); + } else { + message.consensusParamUpdates = undefined; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ResponseEndBlock): unknown { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validatorUpdates = message.validatorUpdates.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validatorUpdates = []; + } + message.consensusParamUpdates !== undefined && + (obj.consensusParamUpdates = message.consensusParamUpdates + ? ConsensusParams.toJSON(message.consensusParamUpdates) + : undefined); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseCommit } as ResponseCommit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseCommit { + const message = { ...baseResponseCommit } as ResponseCommit; + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retainHeight !== undefined && object.retainHeight !== null) { + message.retainHeight = Long.fromString(object.retainHeight); + } else { + message.retainHeight = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseCommit { + const message = { ...baseResponseCommit } as ResponseCommit; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.retainHeight !== undefined && object.retainHeight !== null) { + message.retainHeight = object.retainHeight as Long; + } else { + message.retainHeight = Long.ZERO; + } + return message; + }, + toJSON(message: ResponseCommit): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()); + return obj; + }, +}; + +export const ResponseListSnapshots = { + encode(message: ResponseListSnapshots, writer: Writer = Writer.create()): Writer { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.snapshots = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseListSnapshots { + const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; + message.snapshots = []; + if (object.snapshots !== undefined && object.snapshots !== null) { + for (const e of object.snapshots) { + message.snapshots.push(Snapshot.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseListSnapshots { + const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; + message.snapshots = []; + if (object.snapshots !== undefined && object.snapshots !== null) { + for (const e of object.snapshots) { + message.snapshots.push(Snapshot.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ResponseListSnapshots): unknown { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map((e) => (e ? Snapshot.toJSON(e) : undefined)); + } else { + obj.snapshots = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseOfferSnapshot { + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + if (object.result !== undefined && object.result !== null) { + message.result = responseOfferSnapshot_ResultFromJSON(object.result); + } else { + message.result = 0; + } + return message; + }, + fromPartial(object: DeepPartial): ResponseOfferSnapshot { + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = 0; + } + return message; + }, + toJSON(message: ResponseOfferSnapshot): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseLoadSnapshotChunk { + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; + }, + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = new Uint8Array(); + } + return message; + }, + toJSON(message: ResponseLoadSnapshotChunk): unknown { + const obj: any = {}; + message.chunk !== undefined && + (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + return obj; + }, +}; + +export const ResponseApplySnapshotChunk = { + encode(message: ResponseApplySnapshotChunk, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.result); + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.refetchChunks = []; + message.rejectSenders = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ResponseApplySnapshotChunk { + const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; + message.refetchChunks = []; + message.rejectSenders = []; + if (object.result !== undefined && object.result !== null) { + message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); + } else { + message.result = 0; + } + if (object.refetchChunks !== undefined && object.refetchChunks !== null) { + for (const e of object.refetchChunks) { + message.refetchChunks.push(Number(e)); + } + } + if (object.rejectSenders !== undefined && object.rejectSenders !== null) { + for (const e of object.rejectSenders) { + message.rejectSenders.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { + const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; + message.refetchChunks = []; + message.rejectSenders = []; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = 0; + } + if (object.refetchChunks !== undefined && object.refetchChunks !== null) { + for (const e of object.refetchChunks) { + message.refetchChunks.push(e); + } + } + if (object.rejectSenders !== undefined && object.rejectSenders !== null) { + for (const e of object.rejectSenders) { + message.rejectSenders.push(e); + } + } + return message; + }, + toJSON(message: ResponseApplySnapshotChunk): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); + if (message.refetchChunks) { + obj.refetchChunks = message.refetchChunks.map((e) => e); + } else { + obj.refetchChunks = []; + } + if (message.rejectSenders) { + obj.rejectSenders = message.rejectSenders.map((e) => e); + } else { + obj.rejectSenders = []; + } + return obj; + }, +}; + +export const ConsensusParams = { + encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { + if (message.block !== undefined && message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined && message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined && message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined && message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromJSON(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromJSON(object.version); + } else { + message.version = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromPartial(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromPartial(object.version); + } else { + message.version = undefined; + } + return message; + }, + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined && + (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined && + (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined && + (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlockParams } as BlockParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64() as Long; + break; + case 2: + message.maxGas = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = Long.fromString(object.maxGas); + } else { + message.maxGas = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = object.maxGas as Long; + } else { + message.maxGas = Long.ZERO; + } + return message; + }, + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + return obj; + }, +}; + +export const LastCommitInfo = { + encode(message: LastCommitInfo, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.round); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.votes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): LastCommitInfo { + const message = { ...baseLastCommitInfo } as LastCommitInfo; + message.votes = []; + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(VoteInfo.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): LastCommitInfo { + const message = { ...baseLastCommitInfo } as LastCommitInfo; + message.votes = []; + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(VoteInfo.fromPartial(e)); + } + } + return message; + }, + toJSON(message: LastCommitInfo): unknown { + const obj: any = {}; + message.round !== undefined && (obj.round = message.round); + if (message.votes) { + obj.votes = message.votes.map((e) => (e ? VoteInfo.toJSON(e) : undefined)); + } else { + obj.votes = []; + } + return obj; + }, +}; + +export const Event = { + encode(message: Event, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.type); + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.attributes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Event { + const message = { ...baseEvent } as Event; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(EventAttribute.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Event { + const message = { ...baseEvent } as Event; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(EventAttribute.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Event): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map((e) => (e ? EventAttribute.toJSON(e) : undefined)); + } else { + obj.attributes = []; + } + return obj; + }, +}; + +export const EventAttribute = { + encode(message: EventAttribute, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + writer.uint32(18).bytes(message.value); + writer.uint32(24).bool(message.index); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EventAttribute { + const message = { ...baseEventAttribute } as EventAttribute; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.index !== undefined && object.index !== null) { + message.index = Boolean(object.index); + } else { + message.index = false; + } + return message; + }, + fromPartial(object: DeepPartial): EventAttribute { + const message = { ...baseEventAttribute } as EventAttribute; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = false; + } + return message; + }, + toJSON(message: EventAttribute): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.index !== undefined && (obj.index = message.index); + return obj; + }, +}; + +export const TxResult = { + encode(message: TxResult, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.height); + writer.uint32(16).uint32(message.index); + writer.uint32(26).bytes(message.tx); + if (message.result !== undefined && message.result !== undefined) { + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxResult { + const message = { ...baseTxResult } as TxResult; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromJSON(object.result); + } else { + message.result = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): TxResult { + const message = { ...baseTxResult } as TxResult; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromPartial(object.result); + } else { + message.result = undefined; + } + return message; + }, + toJSON(message: TxResult): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.index !== undefined && (obj.index = message.index); + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.result !== undefined && + (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidator } as Validator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = new Uint8Array(); + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + return message; + }, + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && + (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + return obj; + }, +}; + +export const ValidatorUpdate = { + encode(message: ValidatorUpdate, writer: Writer = Writer.create()): Writer { + if (message.pubKey !== undefined && message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).int64(message.power); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValidatorUpdate { + const message = { ...baseValidatorUpdate } as ValidatorUpdate; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorUpdate { + const message = { ...baseValidatorUpdate } as ValidatorUpdate; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + return message; + }, + toJSON(message: ValidatorUpdate): unknown { + const obj: any = {}; + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + return obj; + }, +}; + +export const VoteInfo = { + encode(message: VoteInfo, writer: Writer = Writer.create()): Writer { + if (message.validator !== undefined && message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).bool(message.signedLastBlock); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): VoteInfo { + const message = { ...baseVoteInfo } as VoteInfo; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.signedLastBlock !== undefined && object.signedLastBlock !== null) { + message.signedLastBlock = Boolean(object.signedLastBlock); + } else { + message.signedLastBlock = false; + } + return message; + }, + fromPartial(object: DeepPartial): VoteInfo { + const message = { ...baseVoteInfo } as VoteInfo; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.signedLastBlock !== undefined && object.signedLastBlock !== null) { + message.signedLastBlock = object.signedLastBlock; + } else { + message.signedLastBlock = false; + } + return message; + }, + toJSON(message: VoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + return obj; + }, +}; + +export const Evidence = { + encode(message: Evidence, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.type); + if (message.validator !== undefined && message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int64(message.height); + if (message.time !== undefined && message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + writer.uint32(40).int64(message.totalVotingPower); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.type !== undefined && object.type !== null) { + message.type = evidenceTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + toJSON(message: Evidence): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null); + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + return obj; + }, +}; + +export const Snapshot = { + encode(message: Snapshot, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.height); + writer.uint32(16).uint32(message.format); + writer.uint32(24).uint32(message.chunks); + writer.uint32(34).bytes(message.hash); + writer.uint32(42).bytes(message.metadata); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() as Long; + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = Number(object.format); + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = Number(object.chunks); + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; + }, + fromPartial(object: DeepPartial): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } else { + message.metadata = new Uint8Array(); + } + return message; + }, + toJSON(message: Snapshot): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.format !== undefined && (obj.format = message.format); + message.chunks !== undefined && (obj.chunks = message.chunks); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.metadata !== undefined && + (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/crypto/keys.ts b/packages/stargate/src/codec/tendermint/crypto/keys.ts new file mode 100644 index 00000000..b2a42252 --- /dev/null +++ b/packages/stargate/src/codec/tendermint/crypto/keys.ts @@ -0,0 +1,114 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * PublicKey defines the keys available for use with Tendermint Validators + */ +export interface PublicKey { + ed25519: Uint8Array | undefined; + secp256k1: Uint8Array | undefined; +} + +const basePublicKey: object = {}; + +export const protobufPackage = "tendermint.crypto"; + +export const PublicKey = { + encode(message: PublicKey, writer: Writer = Writer.create()): Writer { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + fromPartial(object: DeepPartial): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = object.ed25519; + } else { + message.ed25519 = undefined; + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = object.secp256k1; + } else { + message.secp256k1 = undefined; + } + return message; + }, + toJSON(message: PublicKey): unknown { + const obj: any = {}; + message.ed25519 !== undefined && + (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined && + (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/crypto/proof.ts b/packages/stargate/src/codec/tendermint/crypto/proof.ts new file mode 100644 index 00000000..51747905 --- /dev/null +++ b/packages/stargate/src/codec/tendermint/crypto/proof.ts @@ -0,0 +1,473 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +export interface Proof { + total: Long; + index: Long; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} + +export interface ValueOp { + /** + * Encoded in ProofOp.Key. + */ + key: Uint8Array; + /** + * To encode in ProofOp.Data + */ + proof?: Proof; +} + +export interface DominoOp { + key: string; + input: string; + output: string; +} + +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} + +/** + * 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"; + +export const Proof = { + encode(message: Proof, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.total); + writer.uint32(16).int64(message.index); + writer.uint32(26).bytes(message.leafHash); + for (const v of message.aunts) { + writer.uint32(34).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.aunts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64() as Long; + break; + case 2: + message.index = reader.int64() as Long; + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Proof { + const message = { ...baseProof } as Proof; + message.aunts = []; + if (object.total !== undefined && object.total !== null) { + message.total = Long.fromString(object.total); + } else { + message.total = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.ZERO; + } + if (object.leafHash !== undefined && object.leafHash !== null) { + message.leafHash = bytesFromBase64(object.leafHash); + } + if (object.aunts !== undefined && object.aunts !== null) { + for (const e of object.aunts) { + message.aunts.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Proof { + const message = { ...baseProof } as Proof; + message.aunts = []; + if (object.total !== undefined && object.total !== null) { + message.total = object.total as Long; + } else { + message.total = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.ZERO; + } + if (object.leafHash !== undefined && object.leafHash !== null) { + message.leafHash = object.leafHash; + } else { + message.leafHash = new Uint8Array(); + } + if (object.aunts !== undefined && object.aunts !== null) { + for (const e of object.aunts) { + message.aunts.push(e); + } + } + return message; + }, + toJSON(message: Proof): unknown { + const obj: any = {}; + message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.leafHash !== undefined && + (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); + if (message.aunts) { + obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.aunts = []; + } + return obj; + }, +}; + +export const ValueOp = { + encode(message: ValueOp, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + if (message.proof !== undefined && message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValueOp { + const message = { ...baseValueOp } as ValueOp; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ValueOp { + const message = { ...baseValueOp } as ValueOp; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + toJSON(message: ValueOp): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, +}; + +export const DominoOp = { + encode(message: DominoOp, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.key); + writer.uint32(18).string(message.input); + writer.uint32(26).string(message.output); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DominoOp { + const message = { ...baseDominoOp } as DominoOp; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.input !== undefined && object.input !== null) { + message.input = String(object.input); + } else { + message.input = ""; + } + if (object.output !== undefined && object.output !== null) { + message.output = String(object.output); + } else { + message.output = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DominoOp { + const message = { ...baseDominoOp } as DominoOp; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } else { + message.input = ""; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } else { + message.output = ""; + } + return message; + }, + toJSON(message: DominoOp): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.input !== undefined && (obj.input = message.input); + message.output !== undefined && (obj.output = message.output); + return obj; + }, +}; + +export const ProofOp = { + encode(message: ProofOp, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.type); + writer.uint32(18).bytes(message.key); + writer.uint32(26).bytes(message.data); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ProofOp { + const message = { ...baseProofOp } as ProofOp; + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + fromPartial(object: DeepPartial): ProofOp { + const message = { ...baseProofOp } as ProofOp; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, + toJSON(message: ProofOp): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, +}; + +export const ProofOps = { + encode(message: ProofOps, writer: Writer = Writer.create()): Writer { + for (const v of message.ops) { + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.ops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ProofOps { + const message = { ...baseProofOps } as ProofOps; + message.ops = []; + if (object.ops !== undefined && object.ops !== null) { + for (const e of object.ops) { + message.ops.push(ProofOp.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ProofOps { + const message = { ...baseProofOps } as ProofOps; + message.ops = []; + if (object.ops !== undefined && object.ops !== null) { + for (const e of object.ops) { + message.ops.push(ProofOp.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ProofOps): unknown { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); + } else { + obj.ops = []; + } + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/libs/bits/types.ts b/packages/stargate/src/codec/tendermint/libs/bits/types.ts new file mode 100644 index 00000000..fd74ef6c --- /dev/null +++ b/packages/stargate/src/codec/tendermint/libs/bits/types.ts @@ -0,0 +1,106 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +export interface BitArray { + bits: Long; + elems: Long[]; +} + +const baseBitArray: object = { + bits: Long.ZERO, + elems: Long.UZERO, +}; + +export const protobufPackage = "tendermint.libs.bits"; + +export const BitArray = { + encode(message: BitArray, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.bits); + writer.uint32(18).fork(); + for (const v of message.elems) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.elems = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bits = reader.int64() as Long; + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.elems.push(reader.uint64() as Long); + } + } else { + message.elems.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BitArray { + const message = { ...baseBitArray } as BitArray; + message.elems = []; + if (object.bits !== undefined && object.bits !== null) { + message.bits = Long.fromString(object.bits); + } else { + message.bits = Long.ZERO; + } + if (object.elems !== undefined && object.elems !== null) { + for (const e of object.elems) { + message.elems.push(Long.fromString(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): BitArray { + const message = { ...baseBitArray } as BitArray; + message.elems = []; + if (object.bits !== undefined && object.bits !== null) { + message.bits = object.bits as Long; + } else { + message.bits = Long.ZERO; + } + if (object.elems !== undefined && object.elems !== null) { + for (const e of object.elems) { + message.elems.push(e); + } + } + return message; + }, + toJSON(message: BitArray): unknown { + const obj: any = {}; + message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString()); + if (message.elems) { + obj.elems = message.elems.map((e) => (e || Long.UZERO).toString()); + } else { + obj.elems = []; + } + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/types/params.ts b/packages/stargate/src/codec/tendermint/types/params.ts new file mode 100644 index 00000000..4d23fe25 --- /dev/null +++ b/packages/stargate/src/codec/tendermint/types/params.ts @@ -0,0 +1,557 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Duration } from "../../google/protobuf/duration"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; +} + +/** + * BlockParams contains limits on the block size. + */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: Long; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: Long; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + timeIotaMs: Long; +} + +/** + * EvidenceParams determine how we handle evidence of malfeasance. + */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: Long; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration?: Duration; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: Long; +} + +/** + * 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. + */ +export interface VersionParams { + appVersion: Long; +} + +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: Long; + blockMaxGas: Long; +} + +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) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined && message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined && message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined && message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromJSON(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromJSON(object.version); + } else { + message.version = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromPartial(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromPartial(object.version); + } else { + message.version = undefined; + } + return message; + }, + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined && + (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined && + (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined && + (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, +}; + +export const BlockParams = { + encode(message: BlockParams, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.maxBytes); + writer.uint32(16).int64(message.maxGas); + writer.uint32(24).int64(message.timeIotaMs); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64() as Long; + break; + case 2: + message.maxGas = reader.int64() as Long; + break; + case 3: + message.timeIotaMs = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = Long.fromString(object.maxGas); + } else { + message.maxGas = Long.ZERO; + } + if (object.timeIotaMs !== undefined && object.timeIotaMs !== null) { + message.timeIotaMs = Long.fromString(object.timeIotaMs); + } else { + message.timeIotaMs = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = object.maxGas as Long; + } else { + message.maxGas = Long.ZERO; + } + if (object.timeIotaMs !== undefined && object.timeIotaMs !== null) { + message.timeIotaMs = object.timeIotaMs as Long; + } else { + message.timeIotaMs = Long.ZERO; + } + return message; + }, + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + message.timeIotaMs !== undefined && (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString()); + return obj; + }, +}; + +export const EvidenceParams = { + encode(message: EvidenceParams, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.maxAgeNumBlocks); + if (message.maxAgeDuration !== undefined && message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int64(message.maxBytes); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64() as Long; + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EvidenceParams { + const message = { ...baseEvidenceParams } as EvidenceParams; + if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { + message.maxAgeNumBlocks = Long.fromString(object.maxAgeNumBlocks); + } else { + message.maxAgeNumBlocks = Long.ZERO; + } + if (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) { + message.maxAgeDuration = Duration.fromJSON(object.maxAgeDuration); + } else { + message.maxAgeDuration = undefined; + } + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): EvidenceParams { + const message = { ...baseEvidenceParams } as EvidenceParams; + if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { + message.maxAgeNumBlocks = object.maxAgeNumBlocks as Long; + } else { + message.maxAgeNumBlocks = Long.ZERO; + } + if (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) { + message.maxAgeDuration = Duration.fromPartial(object.maxAgeDuration); + } else { + message.maxAgeDuration = undefined; + } + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + return message; + }, + toJSON(message: EvidenceParams): unknown { + const obj: any = {}; + message.maxAgeNumBlocks !== undefined && + (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()); + message.maxAgeDuration !== undefined && + (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + return obj; + }, +}; + +export const ValidatorParams = { + encode(message: ValidatorParams, writer: Writer = Writer.create()): Writer { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.pubKeyTypes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValidatorParams { + const message = { ...baseValidatorParams } as ValidatorParams; + message.pubKeyTypes = []; + if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) { + for (const e of object.pubKeyTypes) { + message.pubKeyTypes.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorParams { + const message = { ...baseValidatorParams } as ValidatorParams; + message.pubKeyTypes = []; + if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) { + for (const e of object.pubKeyTypes) { + message.pubKeyTypes.push(e); + } + } + return message; + }, + toJSON(message: ValidatorParams): unknown { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); + } else { + obj.pubKeyTypes = []; + } + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVersionParams } as VersionParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): VersionParams { + const message = { ...baseVersionParams } as VersionParams; + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = Long.fromString(object.appVersion); + } else { + message.appVersion = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): VersionParams { + const message = { ...baseVersionParams } as VersionParams; + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion as Long; + } else { + message.appVersion = Long.UZERO; + } + return message; + }, + toJSON(message: VersionParams): unknown { + const obj: any = {}; + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHashedParams } as HashedParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64() as Long; + break; + case 2: + message.blockMaxGas = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): HashedParams { + const message = { ...baseHashedParams } as HashedParams; + if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { + message.blockMaxBytes = Long.fromString(object.blockMaxBytes); + } else { + message.blockMaxBytes = Long.ZERO; + } + if (object.blockMaxGas !== undefined && object.blockMaxGas !== null) { + message.blockMaxGas = Long.fromString(object.blockMaxGas); + } else { + message.blockMaxGas = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): HashedParams { + const message = { ...baseHashedParams } as HashedParams; + if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { + message.blockMaxBytes = object.blockMaxBytes as Long; + } else { + message.blockMaxBytes = Long.ZERO; + } + if (object.blockMaxGas !== undefined && object.blockMaxGas !== null) { + message.blockMaxGas = object.blockMaxGas as Long; + } else { + message.blockMaxGas = Long.ZERO; + } + return message; + }, + toJSON(message: HashedParams): unknown { + const obj: any = {}; + message.blockMaxBytes !== undefined && + (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()); + message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/types/types.ts b/packages/stargate/src/codec/tendermint/types/types.ts new file mode 100644 index 00000000..185cce93 --- /dev/null +++ b/packages/stargate/src/codec/tendermint/types/types.ts @@ -0,0 +1,1711 @@ +/* eslint-disable */ +import { Proof } from "../../tendermint/crypto/proof"; +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); +} + +export const protobufPackage = "tendermint.types"; + +/** BlockIdFlag indicates which BlcokID the signature is for + */ +export enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0, + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1, +} + +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case "BLOCK_ID_FLAG_UNKNOWN": + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + case 1: + case "BLOCK_ID_FLAG_ABSENT": + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + case 2: + case "BLOCK_ID_FLAG_COMMIT": + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + case 3: + case "BLOCK_ID_FLAG_NIL": + return BlockIDFlag.BLOCK_ID_FLAG_NIL; + case -1: + case "UNRECOGNIZED": + default: + return BlockIDFlag.UNRECOGNIZED; + } +} + +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return "BLOCK_ID_FLAG_UNKNOWN"; + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return "BLOCK_ID_FLAG_ABSENT"; + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return "BLOCK_ID_FLAG_COMMIT"; + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return "BLOCK_ID_FLAG_NIL"; + default: + return "UNKNOWN"; + } +} + +/** SignedMsgType is a type of signed message in the consensus. + */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes + */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals + */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1, +} + +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case "SIGNED_MSG_TYPE_UNKNOWN": + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + case 1: + case "SIGNED_MSG_TYPE_PREVOTE": + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + case 2: + case "SIGNED_MSG_TYPE_PRECOMMIT": + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + case 32: + case "SIGNED_MSG_TYPE_PROPOSAL": + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + case -1: + case "UNRECOGNIZED": + default: + return SignedMsgType.UNRECOGNIZED; + } +} + +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return "SIGNED_MSG_TYPE_UNKNOWN"; + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return "SIGNED_MSG_TYPE_PREVOTE"; + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return "SIGNED_MSG_TYPE_PRECOMMIT"; + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return "SIGNED_MSG_TYPE_PROPOSAL"; + default: + return "UNKNOWN"; + } +} + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePartSetHeader } as PartSetHeader; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PartSetHeader { + const message = { ...basePartSetHeader } as PartSetHeader; + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + fromPartial(object: DeepPartial): PartSetHeader { + const message = { ...basePartSetHeader } as PartSetHeader; + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, + toJSON(message: PartSetHeader): unknown { + const obj: any = {}; + message.total !== undefined && (obj.total = message.total); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, +}; + +export const Part = { + encode(message: Part, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.index); + writer.uint32(18).bytes(message.bytes); + if (message.proof !== undefined && message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Part { + const message = { ...basePart } as Part; + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): Part { + const message = { ...basePart } as Part; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = object.bytes; + } else { + message.bytes = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + toJSON(message: Part): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + message.bytes !== undefined && + (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, +}; + +export const BlockID = { + encode(message: BlockID, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.hash); + if (message.partSetHeader !== undefined && message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BlockID { + const message = { ...baseBlockID } as BlockID; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.partSetHeader !== undefined && object.partSetHeader !== null) { + message.partSetHeader = PartSetHeader.fromJSON(object.partSetHeader); + } else { + message.partSetHeader = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): BlockID { + const message = { ...baseBlockID } as BlockID; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.partSetHeader !== undefined && object.partSetHeader !== null) { + message.partSetHeader = PartSetHeader.fromPartial(object.partSetHeader); + } else { + message.partSetHeader = undefined; + } + return message; + }, + toJSON(message: BlockID): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined && + (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); + return obj; + }, +}; + +export const Header = { + encode(message: Header, writer: Writer = Writer.create()): Writer { + if (message.version !== undefined && message.version !== undefined) { + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.chainId); + writer.uint32(24).int64(message.height); + if (message.time !== undefined && message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.lastBlockId !== undefined && message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + } + writer.uint32(50).bytes(message.lastCommitHash); + writer.uint32(58).bytes(message.dataHash); + writer.uint32(66).bytes(message.validatorsHash); + writer.uint32(74).bytes(message.nextValidatorsHash); + writer.uint32(82).bytes(message.consensusHash); + writer.uint32(90).bytes(message.appHash); + writer.uint32(98).bytes(message.lastResultsHash); + writer.uint32(106).bytes(message.evidenceHash); + writer.uint32(114).bytes(message.proposerAddress); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Header { + const message = { ...baseHeader } as Header; + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromJSON(object.version); + } else { + message.version = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.lastBlockId !== undefined && object.lastBlockId !== null) { + message.lastBlockId = BlockID.fromJSON(object.lastBlockId); + } else { + message.lastBlockId = undefined; + } + if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) { + message.lastCommitHash = bytesFromBase64(object.lastCommitHash); + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = bytesFromBase64(object.dataHash); + } + if (object.validatorsHash !== undefined && object.validatorsHash !== null) { + message.validatorsHash = bytesFromBase64(object.validatorsHash); + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash); + } + if (object.consensusHash !== undefined && object.consensusHash !== null) { + message.consensusHash = bytesFromBase64(object.consensusHash); + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) { + message.lastResultsHash = bytesFromBase64(object.lastResultsHash); + } + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = bytesFromBase64(object.evidenceHash); + } + if (object.proposerAddress !== undefined && object.proposerAddress !== null) { + message.proposerAddress = bytesFromBase64(object.proposerAddress); + } + return message; + }, + fromPartial(object: DeepPartial
): Header { + const message = { ...baseHeader } as Header; + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromPartial(object.version); + } else { + message.version = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.lastBlockId !== undefined && object.lastBlockId !== null) { + message.lastBlockId = BlockID.fromPartial(object.lastBlockId); + } else { + message.lastBlockId = undefined; + } + if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) { + message.lastCommitHash = object.lastCommitHash; + } else { + message.lastCommitHash = new Uint8Array(); + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = object.dataHash; + } else { + message.dataHash = new Uint8Array(); + } + if (object.validatorsHash !== undefined && object.validatorsHash !== null) { + message.validatorsHash = object.validatorsHash; + } else { + message.validatorsHash = new Uint8Array(); + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = object.nextValidatorsHash; + } else { + message.nextValidatorsHash = new Uint8Array(); + } + if (object.consensusHash !== undefined && object.consensusHash !== null) { + message.consensusHash = object.consensusHash; + } else { + message.consensusHash = new Uint8Array(); + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) { + message.lastResultsHash = object.lastResultsHash; + } else { + message.lastResultsHash = new Uint8Array(); + } + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = object.evidenceHash; + } else { + message.evidenceHash = new Uint8Array(); + } + if (object.proposerAddress !== undefined && object.proposerAddress !== null) { + message.proposerAddress = object.proposerAddress; + } else { + message.proposerAddress = new Uint8Array(); + } + return message; + }, + toJSON(message: Header): unknown { + const obj: any = {}; + message.version !== undefined && + (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null); + message.lastBlockId !== undefined && + (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined && + (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), + )); + message.dataHash !== undefined && + (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined && + (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), + )); + message.nextValidatorsHash !== undefined && + (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.consensusHash !== undefined && + (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), + )); + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined && + (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), + )); + message.evidenceHash !== undefined && + (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), + )); + message.proposerAddress !== undefined && + (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), + )); + return obj; + }, +}; + +export const Data = { + encode(message: Data, writer: Writer = Writer.create()): Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.txs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Data { + const message = { ...baseData } as Data; + message.txs = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Data { + const message = { ...baseData } as Data; + message.txs = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(e); + } + } + return message; + }, + toJSON(message: Data): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + return obj; + }, +}; + +export const Vote = { + encode(message: Vote, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.type); + writer.uint32(16).int64(message.height); + writer.uint32(24).int32(message.round); + if (message.blockId !== undefined && message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + } + if (message.timestamp !== undefined && message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + writer.uint32(50).bytes(message.validatorAddress); + writer.uint32(56).int32(message.validatorIndex); + writer.uint32(66).bytes(message.signature); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64() as Long; + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Vote { + const message = { ...baseVote } as Vote; + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = bytesFromBase64(object.validatorAddress); + } + if (object.validatorIndex !== undefined && object.validatorIndex !== null) { + message.validatorIndex = Number(object.validatorIndex); + } else { + message.validatorIndex = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + fromPartial(object: DeepPartial): Vote { + const message = { ...baseVote } as Vote; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = new Uint8Array(); + } + if (object.validatorIndex !== undefined && object.validatorIndex !== null) { + message.validatorIndex = object.validatorIndex; + } else { + message.validatorIndex = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, + toJSON(message: Vote): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && + (obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null); + message.validatorAddress !== undefined && + (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), + )); + message.validatorIndex !== undefined && (obj.validatorIndex = message.validatorIndex); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, +}; + +export const Commit = { + encode(message: Commit, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int64(message.height); + writer.uint32(16).int32(message.round); + if (message.blockId !== undefined && message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 4: + message.signatures.push(CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Commit { + const message = { ...baseCommit } as Commit; + message.signatures = []; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(CommitSig.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Commit { + const message = { ...baseCommit } as Commit; + message.signatures = []; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(CommitSig.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Commit): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? CommitSig.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const CommitSig = { + encode(message: CommitSig, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.blockIdFlag); + writer.uint32(18).bytes(message.validatorAddress); + if (message.timestamp !== undefined && message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).bytes(message.signature); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32() as any; + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CommitSig { + const message = { ...baseCommitSig } as CommitSig; + if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { + message.blockIdFlag = blockIDFlagFromJSON(object.blockIdFlag); + } else { + message.blockIdFlag = 0; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = bytesFromBase64(object.validatorAddress); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + fromPartial(object: DeepPartial): CommitSig { + const message = { ...baseCommitSig } as CommitSig; + if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { + message.blockIdFlag = object.blockIdFlag; + } else { + message.blockIdFlag = 0; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = new Uint8Array(); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, + toJSON(message: CommitSig): unknown { + const obj: any = {}; + message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + message.validatorAddress !== undefined && + (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), + )); + message.timestamp !== undefined && + (obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, +}; + +export const Proposal = { + encode(message: Proposal, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.type); + writer.uint32(16).int64(message.height); + writer.uint32(24).int32(message.round); + writer.uint32(32).int32(message.polRound); + if (message.blockId !== undefined && message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + } + if (message.timestamp !== undefined && message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + } + writer.uint32(58).bytes(message.signature); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64() as Long; + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Proposal { + const message = { ...baseProposal } as Proposal; + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.polRound !== undefined && object.polRound !== null) { + message.polRound = Number(object.polRound); + } else { + message.polRound = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + fromPartial(object: DeepPartial): Proposal { + const message = { ...baseProposal } as Proposal; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.polRound !== undefined && object.polRound !== null) { + message.polRound = object.polRound; + } else { + message.polRound = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, + toJSON(message: Proposal): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.polRound !== undefined && (obj.polRound = message.polRound); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && + (obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, +}; + +export const SignedHeader = { + encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { + if (message.header !== undefined && message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.commit !== undefined && message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignedHeader { + const message = { ...baseSignedHeader } as SignedHeader; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): SignedHeader { + const message = { ...baseSignedHeader } as SignedHeader; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + return message; + }, + toJSON(message: SignedHeader): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); + return obj; + }, +}; + +export const LightBlock = { + encode(message: LightBlock, writer: Writer = Writer.create()): Writer { + if (message.signedHeader !== undefined && message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined && message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): LightBlock { + const message = { ...baseLightBlock } as LightBlock; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromJSON(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromJSON(object.validatorSet); + } else { + message.validatorSet = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): LightBlock { + const message = { ...baseLightBlock } as LightBlock; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromPartial(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromPartial(object.validatorSet); + } else { + message.validatorSet = undefined; + } + return message; + }, + toJSON(message: LightBlock): unknown { + const obj: any = {}; + message.signedHeader !== undefined && + (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined && + (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); + return obj; + }, +}; + +export const BlockMeta = { + encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { + if (message.blockId !== undefined && message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).int64(message.blockSize); + if (message.header !== undefined && message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(32).int64(message.numTxs); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64() as Long; + break; + case 3: + message.header = Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BlockMeta { + const message = { ...baseBlockMeta } as BlockMeta; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.blockSize !== undefined && object.blockSize !== null) { + message.blockSize = Long.fromString(object.blockSize); + } else { + message.blockSize = Long.ZERO; + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.numTxs !== undefined && object.numTxs !== null) { + message.numTxs = Long.fromString(object.numTxs); + } else { + message.numTxs = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): BlockMeta { + const message = { ...baseBlockMeta } as BlockMeta; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.blockSize !== undefined && object.blockSize !== null) { + message.blockSize = object.blockSize as Long; + } else { + message.blockSize = Long.ZERO; + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.numTxs !== undefined && object.numTxs !== null) { + message.numTxs = object.numTxs as Long; + } else { + message.numTxs = Long.ZERO; + } + return message; + }, + toJSON(message: BlockMeta): unknown { + const obj: any = {}; + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString()); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString()); + return obj; + }, +}; + +export const TxProof = { + encode(message: TxProof, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.rootHash); + writer.uint32(18).bytes(message.data); + if (message.proof !== undefined && message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxProof { + const message = { ...baseTxProof } as TxProof; + if (object.rootHash !== undefined && object.rootHash !== null) { + message.rootHash = bytesFromBase64(object.rootHash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): TxProof { + const message = { ...baseTxProof } as TxProof; + if (object.rootHash !== undefined && object.rootHash !== null) { + message.rootHash = object.rootHash; + } else { + message.rootHash = new Uint8Array(); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + toJSON(message: TxProof): unknown { + const obj: any = {}; + message.rootHash !== undefined && + (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/types/validator.ts b/packages/stargate/src/codec/tendermint/types/validator.ts new file mode 100644 index 00000000..fc4533fc --- /dev/null +++ b/packages/stargate/src/codec/tendermint/types/validator.ts @@ -0,0 +1,323 @@ +/* eslint-disable */ +import * as Long from "long"; +import { PublicKey } from "../../tendermint/crypto/keys"; +import { Writer, Reader } from "protobufjs/minimal"; + +export interface ValidatorSet { + validators: Validator[]; + proposer?: Validator; + totalVotingPower: Long; +} + +export interface Validator { + address: Uint8Array; + pubKey?: PublicKey; + votingPower: Long; + proposerPriority: Long; +} + +export interface SimpleValidator { + pubKey?: PublicKey; + 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"; + +export const ValidatorSet = { + encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== undefined && message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int64(message.totalVotingPower); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValidatorSet { + const message = { ...baseValidatorSet } as ValidatorSet; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromJSON(object.proposer); + } else { + message.proposer = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSet { + const message = { ...baseValidatorSet } as ValidatorSet; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromPartial(object.proposer); + } else { + message.proposer = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + toJSON(message: ValidatorSet): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.proposer !== undefined && + (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + return obj; + }, +}; + +export const Validator = { + encode(message: Validator, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.address); + if (message.pubKey !== undefined && message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).int64(message.votingPower); + writer.uint32(32).int64(message.proposerPriority); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64() as Long; + break; + case 4: + message.proposerPriority = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = Long.fromString(object.votingPower); + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = Long.fromString(object.proposerPriority); + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = new Uint8Array(); + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = object.votingPower as Long; + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = object.proposerPriority as Long; + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && + (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.proposerPriority !== undefined && + (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + return obj; + }, +}; + +export const SimpleValidator = { + encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { + if (message.pubKey !== undefined && message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).int64(message.votingPower); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SimpleValidator { + const message = { ...baseSimpleValidator } as SimpleValidator; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = Long.fromString(object.votingPower); + } else { + message.votingPower = Long.ZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SimpleValidator { + const message = { ...baseSimpleValidator } as SimpleValidator; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = object.votingPower as Long; + } else { + message.votingPower = Long.ZERO; + } + return message; + }, + toJSON(message: SimpleValidator): unknown { + const obj: any = {}; + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + return obj; + }, +}; + +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")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/stargate/src/codec/tendermint/version/types.ts b/packages/stargate/src/codec/tendermint/version/types.ts new file mode 100644 index 00000000..01439a65 --- /dev/null +++ b/packages/stargate/src/codec/tendermint/version/types.ts @@ -0,0 +1,170 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface App { + protocol: Long; + software: string; +} + +/** + * 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"; + +export const App = { + encode(message: App, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint64(message.protocol); + writer.uint32(18).string(message.software); + return writer; + }, + decode(input: Uint8Array | Reader, 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; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64() as Long; + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): App { + const message = { ...baseApp } as App; + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = Long.fromString(object.protocol); + } else { + message.protocol = Long.UZERO; + } + if (object.software !== undefined && object.software !== null) { + message.software = String(object.software); + } else { + message.software = ""; + } + return message; + }, + fromPartial(object: DeepPartial): App { + const message = { ...baseApp } as App; + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = object.protocol as Long; + } else { + message.protocol = Long.UZERO; + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } else { + message.software = ""; + } + return message; + }, + toJSON(message: App): unknown { + const obj: any = {}; + message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); + message.software !== undefined && (obj.software = message.software); + return obj; + }, +}; + +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 { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensus } as Consensus; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64() as Long; + break; + case 2: + message.app = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Consensus { + const message = { ...baseConsensus } as Consensus; + if (object.block !== undefined && object.block !== null) { + message.block = Long.fromString(object.block); + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = Long.fromString(object.app); + } else { + message.app = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): Consensus { + const message = { ...baseConsensus } as Consensus; + if (object.block !== undefined && object.block !== null) { + message.block = object.block as Long; + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = object.app as Long; + } else { + message.app = Long.UZERO; + } + return message; + }, + toJSON(message: Consensus): unknown { + const obj: any = {}; + message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); + message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial;