diff --git a/packages/stargate/build/aminotypes.d.ts b/packages/stargate/build/aminotypes.d.ts new file mode 100644 index 00000000..9654066b --- /dev/null +++ b/packages/stargate/build/aminotypes.d.ts @@ -0,0 +1,22 @@ +import { Msg } from "@cosmjs/launchpad"; +import { EncodeObject } from "@cosmjs/proto-signing"; +export interface AminoConverter { + readonly aminoType: string; + readonly toAmino: (value: any) => any; + readonly fromAmino: (value: any) => any; +} +interface AminoTypesOptions { + readonly additions?: Record; + readonly prefix?: string; +} +/** + * A map from Stargate message types as used in the messages's `Any` type + * to Amino types. + */ +export declare class AminoTypes { + private readonly register; + constructor({ additions, prefix }?: AminoTypesOptions); + toAmino({ typeUrl, value }: EncodeObject): Msg; + fromAmino({ type, value }: Msg): EncodeObject; +} +export {}; diff --git a/packages/stargate/build/codec/confio/proofs.d.ts b/packages/stargate/build/codec/confio/proofs.d.ts new file mode 100644 index 00000000..afa91657 --- /dev/null +++ b/packages/stargate/build/codec/confio/proofs.d.ts @@ -0,0 +1,323 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ics23"; +export declare 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 declare function hashOpFromJSON(object: any): HashOp; +export declare function hashOpToJSON(object: HashOp): string; +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export declare 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 declare function lengthOpFromJSON(object: any): LengthOp; +export declare function lengthOpToJSON(object: LengthOp): string; +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + path: InnerOp[]; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: ExistenceProof; + right?: ExistenceProof; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; + batch?: BatchProof | undefined; + compressed?: CompressedBatchProof | undefined; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec?: LeafOp; + innerSpec?: InnerSpec; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof | undefined; + nonexist?: CompressedNonExistenceProof | undefined; +} +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; +} +export declare const ExistenceProof: { + encode(message: ExistenceProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExistenceProof; + fromJSON(object: any): ExistenceProof; + fromPartial(object: DeepPartial): ExistenceProof; + toJSON(message: ExistenceProof): unknown; +}; +export declare const NonExistenceProof: { + encode(message: NonExistenceProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): NonExistenceProof; + fromJSON(object: any): NonExistenceProof; + fromPartial(object: DeepPartial): NonExistenceProof; + toJSON(message: NonExistenceProof): unknown; +}; +export declare const CommitmentProof: { + encode(message: CommitmentProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CommitmentProof; + fromJSON(object: any): CommitmentProof; + fromPartial(object: DeepPartial): CommitmentProof; + toJSON(message: CommitmentProof): unknown; +}; +export declare const LeafOp: { + encode(message: LeafOp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LeafOp; + fromJSON(object: any): LeafOp; + fromPartial(object: DeepPartial): LeafOp; + toJSON(message: LeafOp): unknown; +}; +export declare const InnerOp: { + encode(message: InnerOp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): InnerOp; + fromJSON(object: any): InnerOp; + fromPartial(object: DeepPartial): InnerOp; + toJSON(message: InnerOp): unknown; +}; +export declare const ProofSpec: { + encode(message: ProofSpec, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ProofSpec; + fromJSON(object: any): ProofSpec; + fromPartial(object: DeepPartial): ProofSpec; + toJSON(message: ProofSpec): unknown; +}; +export declare const InnerSpec: { + encode(message: InnerSpec, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): InnerSpec; + fromJSON(object: any): InnerSpec; + fromPartial(object: DeepPartial): InnerSpec; + toJSON(message: InnerSpec): unknown; +}; +export declare const BatchProof: { + encode(message: BatchProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BatchProof; + fromJSON(object: any): BatchProof; + fromPartial(object: DeepPartial): BatchProof; + toJSON(message: BatchProof): unknown; +}; +export declare const BatchEntry: { + encode(message: BatchEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BatchEntry; + fromJSON(object: any): BatchEntry; + fromPartial(object: DeepPartial): BatchEntry; + toJSON(message: BatchEntry): unknown; +}; +export declare const CompressedBatchProof: { + encode(message: CompressedBatchProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompressedBatchProof; + fromJSON(object: any): CompressedBatchProof; + fromPartial(object: DeepPartial): CompressedBatchProof; + toJSON(message: CompressedBatchProof): unknown; +}; +export declare const CompressedBatchEntry: { + encode(message: CompressedBatchEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompressedBatchEntry; + fromJSON(object: any): CompressedBatchEntry; + fromPartial(object: DeepPartial): CompressedBatchEntry; + toJSON(message: CompressedBatchEntry): unknown; +}; +export declare const CompressedExistenceProof: { + encode(message: CompressedExistenceProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompressedExistenceProof; + fromJSON(object: any): CompressedExistenceProof; + fromPartial(object: DeepPartial): CompressedExistenceProof; + toJSON(message: CompressedExistenceProof): unknown; +}; +export declare const CompressedNonExistenceProof: { + encode(message: CompressedNonExistenceProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompressedNonExistenceProof; + fromJSON(object: any): CompressedNonExistenceProof; + fromPartial(object: DeepPartial): CompressedNonExistenceProof; + toJSON(message: CompressedNonExistenceProof): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/auth/v1beta1/auth.d.ts b/packages/stargate/build/codec/cosmos/auth/v1beta1/auth.d.ts new file mode 100644 index 00000000..1e6128fd --- /dev/null +++ b/packages/stargate/build/codec/cosmos/auth/v1beta1/auth.d.ts @@ -0,0 +1,63 @@ +import { Any } from "../../../google/protobuf/any"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.auth.v1beta1"; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +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; +} +export declare const BaseAccount: { + encode(message: BaseAccount, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BaseAccount; + fromJSON(object: any): BaseAccount; + fromPartial(object: DeepPartial): BaseAccount; + toJSON(message: BaseAccount): unknown; +}; +export declare const ModuleAccount: { + encode(message: ModuleAccount, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ModuleAccount; + fromJSON(object: any): ModuleAccount; + fromPartial(object: DeepPartial): ModuleAccount; + toJSON(message: ModuleAccount): unknown; +}; +export declare const Params: { + encode(message: Params, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/auth/v1beta1/query.d.ts b/packages/stargate/build/codec/cosmos/auth/v1beta1/query.d.ts new file mode 100644 index 00000000..935ed45f --- /dev/null +++ b/packages/stargate/build/codec/cosmos/auth/v1beta1/query.d.ts @@ -0,0 +1,79 @@ +import { Any } from "../../../google/protobuf/any"; +import { Params } from "../../../cosmos/auth/v1beta1/auth"; +import _m0 from "protobufjs/minimal"; +import Long from "long"; +export declare const protobufPackage = "cosmos.auth.v1beta1"; +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + /** address defines the address to query for. */ + address: 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; +} +export declare const QueryAccountRequest: { + encode(message: QueryAccountRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAccountRequest; + fromJSON(object: any): QueryAccountRequest; + fromPartial(object: DeepPartial): QueryAccountRequest; + toJSON(message: QueryAccountRequest): unknown; +}; +export declare const QueryAccountResponse: { + encode(message: QueryAccountResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAccountResponse; + fromJSON(object: any): QueryAccountResponse; + fromPartial(object: DeepPartial): QueryAccountResponse; + toJSON(message: QueryAccountResponse): unknown; +}; +export declare const QueryParamsRequest: { + encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsRequest; + fromJSON(_: any): QueryParamsRequest; + fromPartial(_: DeepPartial): QueryParamsRequest; + toJSON(_: QueryParamsRequest): unknown; +}; +export declare const QueryParamsResponse: { + encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsResponse; + fromJSON(object: any): QueryParamsResponse; + fromPartial(object: DeepPartial): QueryParamsResponse; + toJSON(message: QueryParamsResponse): unknown; +}; +/** 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 declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Account(request: QueryAccountRequest): Promise; + Params(request: QueryParamsRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/bank/v1beta1/bank.d.ts b/packages/stargate/build/codec/cosmos/bank/v1beta1/bank.d.ts new file mode 100644 index 00000000..1bbe838c --- /dev/null +++ b/packages/stargate/build/codec/cosmos/bank/v1beta1/bank.d.ts @@ -0,0 +1,130 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.bank.v1beta1"; +/** Params defines the parameters for the bank module. */ +export interface Params { + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +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; +} +export declare const Params: { + encode(message: Params, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +export declare const SendEnabled: { + encode(message: SendEnabled, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SendEnabled; + fromJSON(object: any): SendEnabled; + fromPartial(object: DeepPartial): SendEnabled; + toJSON(message: SendEnabled): unknown; +}; +export declare const Input: { + encode(message: Input, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Input; + fromJSON(object: any): Input; + fromPartial(object: DeepPartial): Input; + toJSON(message: Input): unknown; +}; +export declare const Output: { + encode(message: Output, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Output; + fromJSON(object: any): Output; + fromPartial(object: DeepPartial): Output; + toJSON(message: Output): unknown; +}; +export declare const Supply: { + encode(message: Supply, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Supply; + fromJSON(object: any): Supply; + fromPartial(object: DeepPartial): Supply; + toJSON(message: Supply): unknown; +}; +export declare const DenomUnit: { + encode(message: DenomUnit, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DenomUnit; + fromJSON(object: any): DenomUnit; + fromPartial(object: DeepPartial): DenomUnit; + toJSON(message: DenomUnit): unknown; +}; +export declare const Metadata: { + encode(message: Metadata, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Metadata; + fromJSON(object: any): Metadata; + fromPartial(object: DeepPartial): Metadata; + toJSON(message: Metadata): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/bank/v1beta1/query.d.ts b/packages/stargate/build/codec/cosmos/bank/v1beta1/query.d.ts new file mode 100644 index 00000000..5d435c9d --- /dev/null +++ b/packages/stargate/build/codec/cosmos/bank/v1beta1/query.d.ts @@ -0,0 +1,172 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Params } from "../../../cosmos/bank/v1beta1/bank"; +import _m0 from "protobufjs/minimal"; +import Long from "long"; +export declare const protobufPackage = "cosmos.bank.v1beta1"; +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequest { + /** address is the address to query balances for. */ + address: 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; +} +export declare const QueryBalanceRequest: { + encode(message: QueryBalanceRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryBalanceRequest; + fromJSON(object: any): QueryBalanceRequest; + fromPartial(object: DeepPartial): QueryBalanceRequest; + toJSON(message: QueryBalanceRequest): unknown; +}; +export declare const QueryBalanceResponse: { + encode(message: QueryBalanceResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryBalanceResponse; + fromJSON(object: any): QueryBalanceResponse; + fromPartial(object: DeepPartial): QueryBalanceResponse; + toJSON(message: QueryBalanceResponse): unknown; +}; +export declare const QueryAllBalancesRequest: { + encode(message: QueryAllBalancesRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllBalancesRequest; + fromJSON(object: any): QueryAllBalancesRequest; + fromPartial(object: DeepPartial): QueryAllBalancesRequest; + toJSON(message: QueryAllBalancesRequest): unknown; +}; +export declare const QueryAllBalancesResponse: { + encode(message: QueryAllBalancesResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllBalancesResponse; + fromJSON(object: any): QueryAllBalancesResponse; + fromPartial(object: DeepPartial): QueryAllBalancesResponse; + toJSON(message: QueryAllBalancesResponse): unknown; +}; +export declare const QueryTotalSupplyRequest: { + encode(_: QueryTotalSupplyRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTotalSupplyRequest; + fromJSON(_: any): QueryTotalSupplyRequest; + fromPartial(_: DeepPartial): QueryTotalSupplyRequest; + toJSON(_: QueryTotalSupplyRequest): unknown; +}; +export declare const QueryTotalSupplyResponse: { + encode(message: QueryTotalSupplyResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTotalSupplyResponse; + fromJSON(object: any): QueryTotalSupplyResponse; + fromPartial(object: DeepPartial): QueryTotalSupplyResponse; + toJSON(message: QueryTotalSupplyResponse): unknown; +}; +export declare const QuerySupplyOfRequest: { + encode(message: QuerySupplyOfRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySupplyOfRequest; + fromJSON(object: any): QuerySupplyOfRequest; + fromPartial(object: DeepPartial): QuerySupplyOfRequest; + toJSON(message: QuerySupplyOfRequest): unknown; +}; +export declare const QuerySupplyOfResponse: { + encode(message: QuerySupplyOfResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySupplyOfResponse; + fromJSON(object: any): QuerySupplyOfResponse; + fromPartial(object: DeepPartial): QuerySupplyOfResponse; + toJSON(message: QuerySupplyOfResponse): unknown; +}; +export declare const QueryParamsRequest: { + encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsRequest; + fromJSON(_: any): QueryParamsRequest; + fromPartial(_: DeepPartial): QueryParamsRequest; + toJSON(_: QueryParamsRequest): unknown; +}; +export declare const QueryParamsResponse: { + encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsResponse; + fromJSON(object: any): QueryParamsResponse; + fromPartial(object: DeepPartial): QueryParamsResponse; + toJSON(message: QueryParamsResponse): unknown; +}; +/** 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 declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Balance(request: QueryBalanceRequest): Promise; + AllBalances(request: QueryAllBalancesRequest): Promise; + TotalSupply(request: QueryTotalSupplyRequest): Promise; + SupplyOf(request: QuerySupplyOfRequest): Promise; + Params(request: QueryParamsRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/bank/v1beta1/tx.d.ts b/packages/stargate/build/codec/cosmos/bank/v1beta1/tx.d.ts new file mode 100644 index 00000000..b6e3e217 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/bank/v1beta1/tx.d.ts @@ -0,0 +1,77 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; +import _m0 from "protobufjs/minimal"; +import Long from "long"; +export declare const protobufPackage = "cosmos.bank.v1beta1"; +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +/** MsgSendResponse defines the Msg/Send response type. */ +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 {} +export declare const MsgSend: { + encode(message: MsgSend, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSend; + fromJSON(object: any): MsgSend; + fromPartial(object: DeepPartial): MsgSend; + toJSON(message: MsgSend): unknown; +}; +export declare const MsgSendResponse: { + encode(_: MsgSendResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSendResponse; + fromJSON(_: any): MsgSendResponse; + fromPartial(_: DeepPartial): MsgSendResponse; + toJSON(_: MsgSendResponse): unknown; +}; +export declare const MsgMultiSend: { + encode(message: MsgMultiSend, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMultiSend; + fromJSON(object: any): MsgMultiSend; + fromPartial(object: DeepPartial): MsgMultiSend; + toJSON(message: MsgMultiSend): unknown; +}; +export declare const MsgMultiSendResponse: { + encode(_: MsgMultiSendResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMultiSendResponse; + fromJSON(_: any): MsgMultiSendResponse; + fromPartial(_: DeepPartial): MsgMultiSendResponse; + toJSON(_: MsgMultiSendResponse): unknown; +}; +/** 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 declare class MsgClientImpl implements Msg { + private readonly rpc; + constructor(rpc: Rpc); + Send(request: MsgSend): Promise; + MultiSend(request: MsgMultiSend): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/base/abci/v1beta1/abci.d.ts b/packages/stargate/build/codec/cosmos/base/abci/v1beta1/abci.d.ts new file mode 100644 index 00000000..cc631cf7 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/base/abci/v1beta1/abci.d.ts @@ -0,0 +1,211 @@ +import Long from "long"; +import { Any } from "../../../../google/protobuf/any"; +import { Event } from "../../../../tendermint/abci/types"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.base.abci.v1beta1"; +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +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[]; +} +export declare const TxResponse: { + encode(message: TxResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxResponse; + fromJSON(object: any): TxResponse; + fromPartial(object: DeepPartial): TxResponse; + toJSON(message: TxResponse): unknown; +}; +export declare const ABCIMessageLog: { + encode(message: ABCIMessageLog, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ABCIMessageLog; + fromJSON(object: any): ABCIMessageLog; + fromPartial(object: DeepPartial): ABCIMessageLog; + toJSON(message: ABCIMessageLog): unknown; +}; +export declare const StringEvent: { + encode(message: StringEvent, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): StringEvent; + fromJSON(object: any): StringEvent; + fromPartial(object: DeepPartial): StringEvent; + toJSON(message: StringEvent): unknown; +}; +export declare const Attribute: { + encode(message: Attribute, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Attribute; + fromJSON(object: any): Attribute; + fromPartial(object: DeepPartial): Attribute; + toJSON(message: Attribute): unknown; +}; +export declare const GasInfo: { + encode(message: GasInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GasInfo; + fromJSON(object: any): GasInfo; + fromPartial(object: DeepPartial): GasInfo; + toJSON(message: GasInfo): unknown; +}; +export declare const Result: { + encode(message: Result, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Result; + fromJSON(object: any): Result; + fromPartial(object: DeepPartial): Result; + toJSON(message: Result): unknown; +}; +export declare const SimulationResponse: { + encode(message: SimulationResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SimulationResponse; + fromJSON(object: any): SimulationResponse; + fromPartial(object: DeepPartial): SimulationResponse; + toJSON(message: SimulationResponse): unknown; +}; +export declare const MsgData: { + encode(message: MsgData, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgData; + fromJSON(object: any): MsgData; + fromPartial(object: DeepPartial): MsgData; + toJSON(message: MsgData): unknown; +}; +export declare const TxMsgData: { + encode(message: TxMsgData, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxMsgData; + fromJSON(object: any): TxMsgData; + fromPartial(object: DeepPartial): TxMsgData; + toJSON(message: TxMsgData): unknown; +}; +export declare const SearchTxsResult: { + encode(message: SearchTxsResult, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SearchTxsResult; + fromJSON(object: any): SearchTxsResult; + fromPartial(object: DeepPartial): SearchTxsResult; + toJSON(message: SearchTxsResult): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/base/query/v1beta1/pagination.d.ts b/packages/stargate/build/codec/cosmos/base/query/v1beta1/pagination.d.ts new file mode 100644 index 00000000..22847422 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/base/query/v1beta1/pagination.d.ts @@ -0,0 +1,86 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.base.query.v1beta1"; +/** + * 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; +} +export declare const PageRequest: { + encode(message: PageRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PageRequest; + fromJSON(object: any): PageRequest; + fromPartial(object: DeepPartial): PageRequest; + toJSON(message: PageRequest): unknown; +}; +export declare const PageResponse: { + encode(message: PageResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PageResponse; + fromJSON(object: any): PageResponse; + fromPartial(object: DeepPartial): PageResponse; + toJSON(message: PageResponse): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/base/v1beta1/coin.d.ts b/packages/stargate/build/codec/cosmos/base/v1beta1/coin.d.ts new file mode 100644 index 00000000..67d31d1c --- /dev/null +++ b/packages/stargate/build/codec/cosmos/base/v1beta1/coin.d.ts @@ -0,0 +1,72 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.base.v1beta1"; +/** + * 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; +} +export declare const Coin: { + encode(message: Coin, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Coin; + fromJSON(object: any): Coin; + fromPartial(object: DeepPartial): Coin; + toJSON(message: Coin): unknown; +}; +export declare const DecCoin: { + encode(message: DecCoin, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecCoin; + fromJSON(object: any): DecCoin; + fromPartial(object: DeepPartial): DecCoin; + toJSON(message: DecCoin): unknown; +}; +export declare const IntProto: { + encode(message: IntProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IntProto; + fromJSON(object: any): IntProto; + fromPartial(object: DeepPartial): IntProto; + toJSON(message: IntProto): unknown; +}; +export declare const DecProto: { + encode(message: DecProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecProto; + fromJSON(object: any): DecProto; + fromPartial(object: DeepPartial): DecProto; + toJSON(message: DecProto): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts b/packages/stargate/build/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts new file mode 100644 index 00000000..d5b079cf --- /dev/null +++ b/packages/stargate/build/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts @@ -0,0 +1,48 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.crypto.multisig.v1beta1"; +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +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; +} +export declare const MultiSignature: { + encode(message: MultiSignature, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MultiSignature; + fromJSON(object: any): MultiSignature; + fromPartial(object: DeepPartial): MultiSignature; + toJSON(message: MultiSignature): unknown; +}; +export declare const CompactBitArray: { + encode(message: CompactBitArray, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompactBitArray; + fromJSON(object: any): CompactBitArray; + fromPartial(object: DeepPartial): CompactBitArray; + toJSON(message: CompactBitArray): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/crypto/secp256k1/keys.d.ts b/packages/stargate/build/codec/cosmos/crypto/secp256k1/keys.d.ts new file mode 100644 index 00000000..35e612d5 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/crypto/secp256k1/keys.d.ts @@ -0,0 +1,44 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.crypto.secp256k1"; +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKey { + key: Uint8Array; +} +export declare const PubKey: { + encode(message: PubKey, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PubKey; + fromJSON(object: any): PubKey; + fromPartial(object: DeepPartial): PubKey; + toJSON(message: PubKey): unknown; +}; +export declare const PrivKey: { + encode(message: PrivKey, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PrivKey; + fromJSON(object: any): PrivKey; + fromPartial(object: DeepPartial): PrivKey; + toJSON(message: PrivKey): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/distribution/v1beta1/distribution.d.ts b/packages/stargate/build/codec/cosmos/distribution/v1beta1/distribution.d.ts new file mode 100644 index 00000000..d836789d --- /dev/null +++ b/packages/stargate/build/codec/cosmos/distribution/v1beta1/distribution.d.ts @@ -0,0 +1,212 @@ +import Long from "long"; +import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.distribution.v1beta1"; +/** Params defines the set of params for the distribution module. */ +export interface Params { + communityTax: string; + baseProposerReward: string; + bonusProposerReward: string; + withdrawAddrEnabled: boolean; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[]; + period: Long; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[]; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[]; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: Long; + fraction: string; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[]; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[]; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposal { + title: string; + description: string; + recipient: string; + amount: Coin[]; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: Long; + stake: string; + height: Long; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string; + reward: DecCoin[]; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export declare const Params: { + encode(message: Params, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +export declare const ValidatorHistoricalRewards: { + encode(message: ValidatorHistoricalRewards, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorHistoricalRewards; + fromJSON(object: any): ValidatorHistoricalRewards; + fromPartial(object: DeepPartial): ValidatorHistoricalRewards; + toJSON(message: ValidatorHistoricalRewards): unknown; +}; +export declare const ValidatorCurrentRewards: { + encode(message: ValidatorCurrentRewards, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorCurrentRewards; + fromJSON(object: any): ValidatorCurrentRewards; + fromPartial(object: DeepPartial): ValidatorCurrentRewards; + toJSON(message: ValidatorCurrentRewards): unknown; +}; +export declare const ValidatorAccumulatedCommission: { + encode(message: ValidatorAccumulatedCommission, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorAccumulatedCommission; + fromJSON(object: any): ValidatorAccumulatedCommission; + fromPartial(object: DeepPartial): ValidatorAccumulatedCommission; + toJSON(message: ValidatorAccumulatedCommission): unknown; +}; +export declare const ValidatorOutstandingRewards: { + encode(message: ValidatorOutstandingRewards, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorOutstandingRewards; + fromJSON(object: any): ValidatorOutstandingRewards; + fromPartial(object: DeepPartial): ValidatorOutstandingRewards; + toJSON(message: ValidatorOutstandingRewards): unknown; +}; +export declare const ValidatorSlashEvent: { + encode(message: ValidatorSlashEvent, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorSlashEvent; + fromJSON(object: any): ValidatorSlashEvent; + fromPartial(object: DeepPartial): ValidatorSlashEvent; + toJSON(message: ValidatorSlashEvent): unknown; +}; +export declare const ValidatorSlashEvents: { + encode(message: ValidatorSlashEvents, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorSlashEvents; + fromJSON(object: any): ValidatorSlashEvents; + fromPartial(object: DeepPartial): ValidatorSlashEvents; + toJSON(message: ValidatorSlashEvents): unknown; +}; +export declare const FeePool: { + encode(message: FeePool, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FeePool; + fromJSON(object: any): FeePool; + fromPartial(object: DeepPartial): FeePool; + toJSON(message: FeePool): unknown; +}; +export declare const CommunityPoolSpendProposal: { + encode(message: CommunityPoolSpendProposal, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CommunityPoolSpendProposal; + fromJSON(object: any): CommunityPoolSpendProposal; + fromPartial(object: DeepPartial): CommunityPoolSpendProposal; + toJSON(message: CommunityPoolSpendProposal): unknown; +}; +export declare const DelegatorStartingInfo: { + encode(message: DelegatorStartingInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DelegatorStartingInfo; + fromJSON(object: any): DelegatorStartingInfo; + fromPartial(object: DeepPartial): DelegatorStartingInfo; + toJSON(message: DelegatorStartingInfo): unknown; +}; +export declare const DelegationDelegatorReward: { + encode(message: DelegationDelegatorReward, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DelegationDelegatorReward; + fromJSON(object: any): DelegationDelegatorReward; + fromPartial(object: DeepPartial): DelegationDelegatorReward; + toJSON(message: DelegationDelegatorReward): unknown; +}; +export declare const CommunityPoolSpendProposalWithDeposit: { + encode(message: CommunityPoolSpendProposalWithDeposit, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CommunityPoolSpendProposalWithDeposit; + fromJSON(object: any): CommunityPoolSpendProposalWithDeposit; + fromPartial( + object: DeepPartial, + ): CommunityPoolSpendProposalWithDeposit; + toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/distribution/v1beta1/query.d.ts b/packages/stargate/build/codec/cosmos/distribution/v1beta1/query.d.ts new file mode 100644 index 00000000..f6fa6bb9 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/distribution/v1beta1/query.d.ts @@ -0,0 +1,360 @@ +import { + Params, + ValidatorOutstandingRewards, + ValidatorAccumulatedCommission, + ValidatorSlashEvent, + DelegationDelegatorReward, +} from "../../../cosmos/distribution/v1beta1/distribution"; +import Long from "long"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.distribution.v1beta1"; +/** 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; +} +/** + * QueryValidatorOutstandingRewardsRequest is the request type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +/** + * QueryValidatorOutstandingRewardsResponse is the response type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsResponse { + rewards?: ValidatorOutstandingRewards; +} +/** + * QueryValidatorCommissionRequest is the request type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +/** + * QueryValidatorCommissionResponse is the response type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionResponse { + /** commission defines the commision the validator received. */ + commission?: ValidatorAccumulatedCommission; +} +/** + * QueryValidatorSlashesRequest is the request type for the + * Query/ValidatorSlashes RPC method + */ +export interface QueryValidatorSlashesRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; + /** starting_height defines the optional starting height to query the slashes. */ + startingHeight: Long; + /** starting_height defines the optional ending height to query the slashes. */ + endingHeight: Long; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryValidatorSlashesResponse is the response type for the + * Query/ValidatorSlashes RPC method. + */ +export interface QueryValidatorSlashesResponse { + /** slashes defines the slashes the validator received. */ + slashes: ValidatorSlashEvent[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryDelegationRewardsRequest is the request type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +/** + * QueryDelegationRewardsResponse is the response type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsResponse { + /** rewards defines the rewards accrued by a delegation. */ + rewards: DecCoin[]; +} +/** + * QueryDelegationTotalRewardsRequest is the request type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +/** + * QueryDelegationTotalRewardsResponse is the response type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsResponse { + /** rewards defines all the rewards accrued by a delegator. */ + rewards: DelegationDelegatorReward[]; + /** total defines the sum of all the rewards. */ + total: DecCoin[]; +} +/** + * QueryDelegatorValidatorsRequest is the request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +/** + * QueryDelegatorValidatorsResponse is the response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the validators a delegator is delegating for. */ + validators: string[]; +} +/** + * QueryDelegatorWithdrawAddressRequest is the request type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +/** + * QueryDelegatorWithdrawAddressResponse is the response type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressResponse { + /** withdraw_address defines the delegator address to query for. */ + withdrawAddress: string; +} +/** + * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + * method. + */ +export interface QueryCommunityPoolRequest {} +/** + * QueryCommunityPoolResponse is the response type for the Query/CommunityPool + * RPC method. + */ +export interface QueryCommunityPoolResponse { + /** pool defines community pool's coins. */ + pool: DecCoin[]; +} +export declare const QueryParamsRequest: { + encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsRequest; + fromJSON(_: any): QueryParamsRequest; + fromPartial(_: DeepPartial): QueryParamsRequest; + toJSON(_: QueryParamsRequest): unknown; +}; +export declare const QueryParamsResponse: { + encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsResponse; + fromJSON(object: any): QueryParamsResponse; + fromPartial(object: DeepPartial): QueryParamsResponse; + toJSON(message: QueryParamsResponse): unknown; +}; +export declare const QueryValidatorOutstandingRewardsRequest: { + encode(message: QueryValidatorOutstandingRewardsRequest, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryValidatorOutstandingRewardsRequest; + fromJSON(object: any): QueryValidatorOutstandingRewardsRequest; + fromPartial( + object: DeepPartial, + ): QueryValidatorOutstandingRewardsRequest; + toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown; +}; +export declare const QueryValidatorOutstandingRewardsResponse: { + encode(message: QueryValidatorOutstandingRewardsResponse, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryValidatorOutstandingRewardsResponse; + fromJSON(object: any): QueryValidatorOutstandingRewardsResponse; + fromPartial( + object: DeepPartial, + ): QueryValidatorOutstandingRewardsResponse; + toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown; +}; +export declare const QueryValidatorCommissionRequest: { + encode(message: QueryValidatorCommissionRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorCommissionRequest; + fromJSON(object: any): QueryValidatorCommissionRequest; + fromPartial(object: DeepPartial): QueryValidatorCommissionRequest; + toJSON(message: QueryValidatorCommissionRequest): unknown; +}; +export declare const QueryValidatorCommissionResponse: { + encode(message: QueryValidatorCommissionResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorCommissionResponse; + fromJSON(object: any): QueryValidatorCommissionResponse; + fromPartial(object: DeepPartial): QueryValidatorCommissionResponse; + toJSON(message: QueryValidatorCommissionResponse): unknown; +}; +export declare const QueryValidatorSlashesRequest: { + encode(message: QueryValidatorSlashesRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorSlashesRequest; + fromJSON(object: any): QueryValidatorSlashesRequest; + fromPartial(object: DeepPartial): QueryValidatorSlashesRequest; + toJSON(message: QueryValidatorSlashesRequest): unknown; +}; +export declare const QueryValidatorSlashesResponse: { + encode(message: QueryValidatorSlashesResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorSlashesResponse; + fromJSON(object: any): QueryValidatorSlashesResponse; + fromPartial(object: DeepPartial): QueryValidatorSlashesResponse; + toJSON(message: QueryValidatorSlashesResponse): unknown; +}; +export declare const QueryDelegationRewardsRequest: { + encode(message: QueryDelegationRewardsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationRewardsRequest; + fromJSON(object: any): QueryDelegationRewardsRequest; + fromPartial(object: DeepPartial): QueryDelegationRewardsRequest; + toJSON(message: QueryDelegationRewardsRequest): unknown; +}; +export declare const QueryDelegationRewardsResponse: { + encode(message: QueryDelegationRewardsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationRewardsResponse; + fromJSON(object: any): QueryDelegationRewardsResponse; + fromPartial(object: DeepPartial): QueryDelegationRewardsResponse; + toJSON(message: QueryDelegationRewardsResponse): unknown; +}; +export declare const QueryDelegationTotalRewardsRequest: { + encode(message: QueryDelegationTotalRewardsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationTotalRewardsRequest; + fromJSON(object: any): QueryDelegationTotalRewardsRequest; + fromPartial(object: DeepPartial): QueryDelegationTotalRewardsRequest; + toJSON(message: QueryDelegationTotalRewardsRequest): unknown; +}; +export declare const QueryDelegationTotalRewardsResponse: { + encode(message: QueryDelegationTotalRewardsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationTotalRewardsResponse; + fromJSON(object: any): QueryDelegationTotalRewardsResponse; + fromPartial(object: DeepPartial): QueryDelegationTotalRewardsResponse; + toJSON(message: QueryDelegationTotalRewardsResponse): unknown; +}; +export declare const QueryDelegatorValidatorsRequest: { + encode(message: QueryDelegatorValidatorsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorsRequest; + fromJSON(object: any): QueryDelegatorValidatorsRequest; + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest; + toJSON(message: QueryDelegatorValidatorsRequest): unknown; +}; +export declare const QueryDelegatorValidatorsResponse: { + encode(message: QueryDelegatorValidatorsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorsResponse; + fromJSON(object: any): QueryDelegatorValidatorsResponse; + fromPartial(object: DeepPartial): QueryDelegatorValidatorsResponse; + toJSON(message: QueryDelegatorValidatorsResponse): unknown; +}; +export declare const QueryDelegatorWithdrawAddressRequest: { + encode(message: QueryDelegatorWithdrawAddressRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorWithdrawAddressRequest; + fromJSON(object: any): QueryDelegatorWithdrawAddressRequest; + fromPartial( + object: DeepPartial, + ): QueryDelegatorWithdrawAddressRequest; + toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown; +}; +export declare const QueryDelegatorWithdrawAddressResponse: { + encode(message: QueryDelegatorWithdrawAddressResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorWithdrawAddressResponse; + fromJSON(object: any): QueryDelegatorWithdrawAddressResponse; + fromPartial( + object: DeepPartial, + ): QueryDelegatorWithdrawAddressResponse; + toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown; +}; +export declare const QueryCommunityPoolRequest: { + encode(_: QueryCommunityPoolRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCommunityPoolRequest; + fromJSON(_: any): QueryCommunityPoolRequest; + fromPartial(_: DeepPartial): QueryCommunityPoolRequest; + toJSON(_: QueryCommunityPoolRequest): unknown; +}; +export declare const QueryCommunityPoolResponse: { + encode(message: QueryCommunityPoolResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCommunityPoolResponse; + fromJSON(object: any): QueryCommunityPoolResponse; + fromPartial(object: DeepPartial): QueryCommunityPoolResponse; + toJSON(message: QueryCommunityPoolResponse): unknown; +}; +/** Query defines the gRPC querier service for distribution module. */ +export interface Query { + /** Params queries params of the distribution module. */ + Params(request: QueryParamsRequest): Promise; + /** ValidatorOutstandingRewards queries rewards of a validator address. */ + ValidatorOutstandingRewards( + request: QueryValidatorOutstandingRewardsRequest, + ): Promise; + /** ValidatorCommission queries accumulated commission for a validator. */ + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise; + /** ValidatorSlashes queries slash events of a validator. */ + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise; + /** DelegationRewards queries the total rewards accrued by a delegation. */ + DelegationRewards(request: QueryDelegationRewardsRequest): Promise; + /** + * DelegationTotalRewards queries the total rewards accrued by a each + * validator. + */ + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise; + /** DelegatorValidators queries the validators of a delegator. */ + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ + DelegatorWithdrawAddress( + request: QueryDelegatorWithdrawAddressRequest, + ): Promise; + /** CommunityPool queries the community pool coins. */ + CommunityPool(request: QueryCommunityPoolRequest): Promise; +} +export declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Params(request: QueryParamsRequest): Promise; + ValidatorOutstandingRewards( + request: QueryValidatorOutstandingRewardsRequest, + ): Promise; + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise; + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise; + DelegationRewards(request: QueryDelegationRewardsRequest): Promise; + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise; + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + DelegatorWithdrawAddress( + request: QueryDelegatorWithdrawAddressRequest, + ): Promise; + CommunityPool(request: QueryCommunityPoolRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/distribution/v1beta1/tx.d.ts b/packages/stargate/build/codec/cosmos/distribution/v1beta1/tx.d.ts new file mode 100644 index 00000000..bb7199f8 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/distribution/v1beta1/tx.d.ts @@ -0,0 +1,150 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +import Long from "long"; +export declare const protobufPackage = "cosmos.distribution.v1beta1"; +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string; + withdrawAddress: string; +} +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponse {} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string; + validatorAddress: string; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponse {} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponse {} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[]; + depositor: string; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} +export declare const MsgSetWithdrawAddress: { + encode(message: MsgSetWithdrawAddress, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSetWithdrawAddress; + fromJSON(object: any): MsgSetWithdrawAddress; + fromPartial(object: DeepPartial): MsgSetWithdrawAddress; + toJSON(message: MsgSetWithdrawAddress): unknown; +}; +export declare const MsgSetWithdrawAddressResponse: { + encode(_: MsgSetWithdrawAddressResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSetWithdrawAddressResponse; + fromJSON(_: any): MsgSetWithdrawAddressResponse; + fromPartial(_: DeepPartial): MsgSetWithdrawAddressResponse; + toJSON(_: MsgSetWithdrawAddressResponse): unknown; +}; +export declare const MsgWithdrawDelegatorReward: { + encode(message: MsgWithdrawDelegatorReward, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgWithdrawDelegatorReward; + fromJSON(object: any): MsgWithdrawDelegatorReward; + fromPartial(object: DeepPartial): MsgWithdrawDelegatorReward; + toJSON(message: MsgWithdrawDelegatorReward): unknown; +}; +export declare const MsgWithdrawDelegatorRewardResponse: { + encode(_: MsgWithdrawDelegatorRewardResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgWithdrawDelegatorRewardResponse; + fromJSON(_: any): MsgWithdrawDelegatorRewardResponse; + fromPartial(_: DeepPartial): MsgWithdrawDelegatorRewardResponse; + toJSON(_: MsgWithdrawDelegatorRewardResponse): unknown; +}; +export declare const MsgWithdrawValidatorCommission: { + encode(message: MsgWithdrawValidatorCommission, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgWithdrawValidatorCommission; + fromJSON(object: any): MsgWithdrawValidatorCommission; + fromPartial(object: DeepPartial): MsgWithdrawValidatorCommission; + toJSON(message: MsgWithdrawValidatorCommission): unknown; +}; +export declare const MsgWithdrawValidatorCommissionResponse: { + encode(_: MsgWithdrawValidatorCommissionResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgWithdrawValidatorCommissionResponse; + fromJSON(_: any): MsgWithdrawValidatorCommissionResponse; + fromPartial(_: DeepPartial): MsgWithdrawValidatorCommissionResponse; + toJSON(_: MsgWithdrawValidatorCommissionResponse): unknown; +}; +export declare const MsgFundCommunityPool: { + encode(message: MsgFundCommunityPool, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgFundCommunityPool; + fromJSON(object: any): MsgFundCommunityPool; + fromPartial(object: DeepPartial): MsgFundCommunityPool; + toJSON(message: MsgFundCommunityPool): unknown; +}; +export declare const MsgFundCommunityPoolResponse: { + encode(_: MsgFundCommunityPoolResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgFundCommunityPoolResponse; + fromJSON(_: any): MsgFundCommunityPoolResponse; + fromPartial(_: DeepPartial): MsgFundCommunityPoolResponse; + toJSON(_: MsgFundCommunityPoolResponse): unknown; +}; +/** Msg defines the distribution Msg service. */ +export interface Msg { + /** + * SetWithdrawAddress defines a method to change the withdraw address + * for a delegator (or validator self-delegation). + */ + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise; + /** + * WithdrawDelegatorReward defines a method to withdraw rewards of delegator + * from a single validator. + */ + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; + /** + * WithdrawValidatorCommission defines a method to withdraw the + * full commission to the validator address. + */ + WithdrawValidatorCommission( + request: MsgWithdrawValidatorCommission, + ): Promise; + /** + * FundCommunityPool defines a method to allow an account to directly + * fund the community pool. + */ + FundCommunityPool(request: MsgFundCommunityPool): Promise; +} +export declare class MsgClientImpl implements Msg { + private readonly rpc; + constructor(rpc: Rpc); + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise; + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; + WithdrawValidatorCommission( + request: MsgWithdrawValidatorCommission, + ): Promise; + FundCommunityPool(request: MsgFundCommunityPool): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/staking/v1beta1/query.d.ts b/packages/stargate/build/codec/cosmos/staking/v1beta1/query.d.ts new file mode 100644 index 00000000..2486de39 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/staking/v1beta1/query.d.ts @@ -0,0 +1,536 @@ +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { + Validator, + DelegationResponse, + UnbondingDelegation, + HistoricalInfo, + Pool, + Params, + RedelegationResponse, +} from "../../../cosmos/staking/v1beta1/staking"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.staking.v1beta1"; +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequest { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponse { + /** validators contains all the queried validators. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponse { + /** validator defines the the validator info. */ + validator?: Validator; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponse { + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponse { + /** delegation_responses defines the delegation info of a delegation. */ + delegationResponse?: DelegationResponse; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponse { + /** unbond defines the unbonding information of a delegation. */ + unbond?: UnbondingDelegation; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponse { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + srcValidatorAddr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dstValidatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponse { + redelegationResponses: RedelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the the validators' info of a delegator. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponse { + /** validator defines the the validator info. */ + validator?: Validator; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequest { + /** height defines at which height to query the historical info. */ + height: Long; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponse { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfo; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequest {} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponse { + /** pool defines the pool info. */ + pool?: Pool; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: Params; +} +export declare const QueryValidatorsRequest: { + encode(message: QueryValidatorsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorsRequest; + fromJSON(object: any): QueryValidatorsRequest; + fromPartial(object: DeepPartial): QueryValidatorsRequest; + toJSON(message: QueryValidatorsRequest): unknown; +}; +export declare const QueryValidatorsResponse: { + encode(message: QueryValidatorsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorsResponse; + fromJSON(object: any): QueryValidatorsResponse; + fromPartial(object: DeepPartial): QueryValidatorsResponse; + toJSON(message: QueryValidatorsResponse): unknown; +}; +export declare const QueryValidatorRequest: { + encode(message: QueryValidatorRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorRequest; + fromJSON(object: any): QueryValidatorRequest; + fromPartial(object: DeepPartial): QueryValidatorRequest; + toJSON(message: QueryValidatorRequest): unknown; +}; +export declare const QueryValidatorResponse: { + encode(message: QueryValidatorResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorResponse; + fromJSON(object: any): QueryValidatorResponse; + fromPartial(object: DeepPartial): QueryValidatorResponse; + toJSON(message: QueryValidatorResponse): unknown; +}; +export declare const QueryValidatorDelegationsRequest: { + encode(message: QueryValidatorDelegationsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorDelegationsRequest; + fromJSON(object: any): QueryValidatorDelegationsRequest; + fromPartial(object: DeepPartial): QueryValidatorDelegationsRequest; + toJSON(message: QueryValidatorDelegationsRequest): unknown; +}; +export declare const QueryValidatorDelegationsResponse: { + encode(message: QueryValidatorDelegationsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryValidatorDelegationsResponse; + fromJSON(object: any): QueryValidatorDelegationsResponse; + fromPartial(object: DeepPartial): QueryValidatorDelegationsResponse; + toJSON(message: QueryValidatorDelegationsResponse): unknown; +}; +export declare const QueryValidatorUnbondingDelegationsRequest: { + encode(message: QueryValidatorUnbondingDelegationsRequest, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryValidatorUnbondingDelegationsRequest; + fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest; + fromPartial( + object: DeepPartial, + ): QueryValidatorUnbondingDelegationsRequest; + toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown; +}; +export declare const QueryValidatorUnbondingDelegationsResponse: { + encode(message: QueryValidatorUnbondingDelegationsResponse, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryValidatorUnbondingDelegationsResponse; + fromJSON(object: any): QueryValidatorUnbondingDelegationsResponse; + fromPartial( + object: DeepPartial, + ): QueryValidatorUnbondingDelegationsResponse; + toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown; +}; +export declare const QueryDelegationRequest: { + encode(message: QueryDelegationRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationRequest; + fromJSON(object: any): QueryDelegationRequest; + fromPartial(object: DeepPartial): QueryDelegationRequest; + toJSON(message: QueryDelegationRequest): unknown; +}; +export declare const QueryDelegationResponse: { + encode(message: QueryDelegationResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegationResponse; + fromJSON(object: any): QueryDelegationResponse; + fromPartial(object: DeepPartial): QueryDelegationResponse; + toJSON(message: QueryDelegationResponse): unknown; +}; +export declare const QueryUnbondingDelegationRequest: { + encode(message: QueryUnbondingDelegationRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnbondingDelegationRequest; + fromJSON(object: any): QueryUnbondingDelegationRequest; + fromPartial(object: DeepPartial): QueryUnbondingDelegationRequest; + toJSON(message: QueryUnbondingDelegationRequest): unknown; +}; +export declare const QueryUnbondingDelegationResponse: { + encode(message: QueryUnbondingDelegationResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnbondingDelegationResponse; + fromJSON(object: any): QueryUnbondingDelegationResponse; + fromPartial(object: DeepPartial): QueryUnbondingDelegationResponse; + toJSON(message: QueryUnbondingDelegationResponse): unknown; +}; +export declare const QueryDelegatorDelegationsRequest: { + encode(message: QueryDelegatorDelegationsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorDelegationsRequest; + fromJSON(object: any): QueryDelegatorDelegationsRequest; + fromPartial(object: DeepPartial): QueryDelegatorDelegationsRequest; + toJSON(message: QueryDelegatorDelegationsRequest): unknown; +}; +export declare const QueryDelegatorDelegationsResponse: { + encode(message: QueryDelegatorDelegationsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorDelegationsResponse; + fromJSON(object: any): QueryDelegatorDelegationsResponse; + fromPartial(object: DeepPartial): QueryDelegatorDelegationsResponse; + toJSON(message: QueryDelegatorDelegationsResponse): unknown; +}; +export declare const QueryDelegatorUnbondingDelegationsRequest: { + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryDelegatorUnbondingDelegationsRequest; + fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest; + fromPartial( + object: DeepPartial, + ): QueryDelegatorUnbondingDelegationsRequest; + toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown; +}; +export declare const QueryDelegatorUnbondingDelegationsResponse: { + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer?: _m0.Writer): _m0.Writer; + decode( + input: _m0.Reader | Uint8Array, + length?: number | undefined, + ): QueryDelegatorUnbondingDelegationsResponse; + fromJSON(object: any): QueryDelegatorUnbondingDelegationsResponse; + fromPartial( + object: DeepPartial, + ): QueryDelegatorUnbondingDelegationsResponse; + toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown; +}; +export declare const QueryRedelegationsRequest: { + encode(message: QueryRedelegationsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRedelegationsRequest; + fromJSON(object: any): QueryRedelegationsRequest; + fromPartial(object: DeepPartial): QueryRedelegationsRequest; + toJSON(message: QueryRedelegationsRequest): unknown; +}; +export declare const QueryRedelegationsResponse: { + encode(message: QueryRedelegationsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRedelegationsResponse; + fromJSON(object: any): QueryRedelegationsResponse; + fromPartial(object: DeepPartial): QueryRedelegationsResponse; + toJSON(message: QueryRedelegationsResponse): unknown; +}; +export declare const QueryDelegatorValidatorsRequest: { + encode(message: QueryDelegatorValidatorsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorsRequest; + fromJSON(object: any): QueryDelegatorValidatorsRequest; + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest; + toJSON(message: QueryDelegatorValidatorsRequest): unknown; +}; +export declare const QueryDelegatorValidatorsResponse: { + encode(message: QueryDelegatorValidatorsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorsResponse; + fromJSON(object: any): QueryDelegatorValidatorsResponse; + fromPartial(object: DeepPartial): QueryDelegatorValidatorsResponse; + toJSON(message: QueryDelegatorValidatorsResponse): unknown; +}; +export declare const QueryDelegatorValidatorRequest: { + encode(message: QueryDelegatorValidatorRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorRequest; + fromJSON(object: any): QueryDelegatorValidatorRequest; + fromPartial(object: DeepPartial): QueryDelegatorValidatorRequest; + toJSON(message: QueryDelegatorValidatorRequest): unknown; +}; +export declare const QueryDelegatorValidatorResponse: { + encode(message: QueryDelegatorValidatorResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryDelegatorValidatorResponse; + fromJSON(object: any): QueryDelegatorValidatorResponse; + fromPartial(object: DeepPartial): QueryDelegatorValidatorResponse; + toJSON(message: QueryDelegatorValidatorResponse): unknown; +}; +export declare const QueryHistoricalInfoRequest: { + encode(message: QueryHistoricalInfoRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryHistoricalInfoRequest; + fromJSON(object: any): QueryHistoricalInfoRequest; + fromPartial(object: DeepPartial): QueryHistoricalInfoRequest; + toJSON(message: QueryHistoricalInfoRequest): unknown; +}; +export declare const QueryHistoricalInfoResponse: { + encode(message: QueryHistoricalInfoResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryHistoricalInfoResponse; + fromJSON(object: any): QueryHistoricalInfoResponse; + fromPartial(object: DeepPartial): QueryHistoricalInfoResponse; + toJSON(message: QueryHistoricalInfoResponse): unknown; +}; +export declare const QueryPoolRequest: { + encode(_: QueryPoolRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPoolRequest; + fromJSON(_: any): QueryPoolRequest; + fromPartial(_: DeepPartial): QueryPoolRequest; + toJSON(_: QueryPoolRequest): unknown; +}; +export declare const QueryPoolResponse: { + encode(message: QueryPoolResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPoolResponse; + fromJSON(object: any): QueryPoolResponse; + fromPartial(object: DeepPartial): QueryPoolResponse; + toJSON(message: QueryPoolResponse): unknown; +}; +export declare const QueryParamsRequest: { + encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsRequest; + fromJSON(_: any): QueryParamsRequest; + fromPartial(_: DeepPartial): QueryParamsRequest; + toJSON(_: QueryParamsRequest): unknown; +}; +export declare const QueryParamsResponse: { + encode(message: QueryParamsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsResponse; + fromJSON(object: any): QueryParamsResponse; + fromPartial(object: DeepPartial): QueryParamsResponse; + toJSON(message: QueryParamsResponse): unknown; +}; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Validators queries all validators that match the given status. */ + Validators(request: QueryValidatorsRequest): Promise; + /** Validator queries validator info for given validator address. */ + Validator(request: QueryValidatorRequest): Promise; + /** ValidatorDelegations queries delegate info for given validator. */ + ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + ValidatorUnbondingDelegations( + request: QueryValidatorUnbondingDelegationsRequest, + ): Promise; + /** Delegation queries delegate info for given validator delegator pair. */ + Delegation(request: QueryDelegationRequest): Promise; + /** + * UnbondingDelegation queries unbonding info for given validator delegator + * pair. + */ + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + /** DelegatorDelegations queries all delegations of a given delegator address. */ + DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; + /** + * DelegatorUnbondingDelegations queries all unbonding delegations of a given + * delegator address. + */ + DelegatorUnbondingDelegations( + request: QueryDelegatorUnbondingDelegationsRequest, + ): Promise; + /** Redelegations queries redelegations of given address. */ + Redelegations(request: QueryRedelegationsRequest): Promise; + /** + * DelegatorValidators queries all validators info for given delegator + * address. + */ + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** + * DelegatorValidator queries validator info for given delegator validator + * pair. + */ + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise; + /** HistoricalInfo queries the historical info for given height. */ + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise; + /** Pool queries the pool info. */ + Pool(request: QueryPoolRequest): Promise; + /** Parameters queries the staking parameters. */ + Params(request: QueryParamsRequest): Promise; +} +export declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Validators(request: QueryValidatorsRequest): Promise; + Validator(request: QueryValidatorRequest): Promise; + ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + ValidatorUnbondingDelegations( + request: QueryValidatorUnbondingDelegationsRequest, + ): Promise; + Delegation(request: QueryDelegationRequest): Promise; + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; + DelegatorUnbondingDelegations( + request: QueryDelegatorUnbondingDelegationsRequest, + ): Promise; + Redelegations(request: QueryRedelegationsRequest): Promise; + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise; + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise; + Pool(request: QueryPoolRequest): Promise; + Params(request: QueryParamsRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/staking/v1beta1/staking.d.ts b/packages/stargate/build/codec/cosmos/staking/v1beta1/staking.d.ts new file mode 100644 index 00000000..b5b1d4e9 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/staking/v1beta1/staking.d.ts @@ -0,0 +1,348 @@ +import { Header } from "../../../tendermint/types/types"; +import { Any } from "../../../google/protobuf/any"; +import Long from "long"; +import { Duration } from "../../../google/protobuf/duration"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.staking.v1beta1"; +/** BondStatus is the status of a validator. */ +export declare 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 declare function bondStatusFromJSON(object: any): BondStatus; +export declare function bondStatusToJSON(object: BondStatus): string; +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header?: Header; + valset: Validator[]; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + rate: string; + maxRate: string; + maxChangeRate: string; +} +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + commissionRates?: CommissionRates; + updateTime?: Date; +} +/** Description defines a validator description. */ +export interface Description { + moniker: string; + identity: string; + website: string; + securityContact: string; + details: string; +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface Validator { + operatorAddress: string; + consensusPubkey?: Any; + jailed: boolean; + status: BondStatus; + tokens: string; + delegatorShares: string; + description?: Description; + unbondingHeight: Long; + unbondingTime?: Date; + commission?: Commission; + minSelfDelegation: string; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + addresses: string[]; +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPair { + delegatorAddress: string; + validatorAddress: string; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface Delegation { + delegatorAddress: string; + validatorAddress: string; + shares: string; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** unbonding delegation entries */ + entries: UnbondingDelegationEntry[]; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + creationHeight: Long; + completionTime?: Date; + initialBalance: string; + balance: string; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + creationHeight: Long; + completionTime?: Date; + initialBalance: string; + sharesDst: string; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + /** redelegation entries */ + entries: RedelegationEntry[]; +} +/** Params defines the parameters for the staking module. */ +export interface Params { + unbondingTime?: Duration; + maxValidators: number; + maxEntries: number; + historicalEntries: number; + bondDenom: string; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation?: Delegation; + balance?: Coin; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry?: RedelegationEntry; + balance: string; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation?: Redelegation; + entries: RedelegationEntryResponse[]; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} +export declare const HistoricalInfo: { + encode(message: HistoricalInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): HistoricalInfo; + fromJSON(object: any): HistoricalInfo; + fromPartial(object: DeepPartial): HistoricalInfo; + toJSON(message: HistoricalInfo): unknown; +}; +export declare const CommissionRates: { + encode(message: CommissionRates, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CommissionRates; + fromJSON(object: any): CommissionRates; + fromPartial(object: DeepPartial): CommissionRates; + toJSON(message: CommissionRates): unknown; +}; +export declare const Commission: { + encode(message: Commission, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Commission; + fromJSON(object: any): Commission; + fromPartial(object: DeepPartial): Commission; + toJSON(message: Commission): unknown; +}; +export declare const Description: { + encode(message: Description, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Description; + fromJSON(object: any): Description; + fromPartial(object: DeepPartial): Description; + toJSON(message: Description): unknown; +}; +export declare const Validator: { + encode(message: Validator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Validator; + fromJSON(object: any): Validator; + fromPartial(object: DeepPartial): Validator; + toJSON(message: Validator): unknown; +}; +export declare const ValAddresses: { + encode(message: ValAddresses, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValAddresses; + fromJSON(object: any): ValAddresses; + fromPartial(object: DeepPartial): ValAddresses; + toJSON(message: ValAddresses): unknown; +}; +export declare const DVPair: { + encode(message: DVPair, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DVPair; + fromJSON(object: any): DVPair; + fromPartial(object: DeepPartial): DVPair; + toJSON(message: DVPair): unknown; +}; +export declare const DVPairs: { + encode(message: DVPairs, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DVPairs; + fromJSON(object: any): DVPairs; + fromPartial(object: DeepPartial): DVPairs; + toJSON(message: DVPairs): unknown; +}; +export declare const DVVTriplet: { + encode(message: DVVTriplet, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DVVTriplet; + fromJSON(object: any): DVVTriplet; + fromPartial(object: DeepPartial): DVVTriplet; + toJSON(message: DVVTriplet): unknown; +}; +export declare const DVVTriplets: { + encode(message: DVVTriplets, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DVVTriplets; + fromJSON(object: any): DVVTriplets; + fromPartial(object: DeepPartial): DVVTriplets; + toJSON(message: DVVTriplets): unknown; +}; +export declare const Delegation: { + encode(message: Delegation, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Delegation; + fromJSON(object: any): Delegation; + fromPartial(object: DeepPartial): Delegation; + toJSON(message: Delegation): unknown; +}; +export declare const UnbondingDelegation: { + encode(message: UnbondingDelegation, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UnbondingDelegation; + fromJSON(object: any): UnbondingDelegation; + fromPartial(object: DeepPartial): UnbondingDelegation; + toJSON(message: UnbondingDelegation): unknown; +}; +export declare const UnbondingDelegationEntry: { + encode(message: UnbondingDelegationEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UnbondingDelegationEntry; + fromJSON(object: any): UnbondingDelegationEntry; + fromPartial(object: DeepPartial): UnbondingDelegationEntry; + toJSON(message: UnbondingDelegationEntry): unknown; +}; +export declare const RedelegationEntry: { + encode(message: RedelegationEntry, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RedelegationEntry; + fromJSON(object: any): RedelegationEntry; + fromPartial(object: DeepPartial): RedelegationEntry; + toJSON(message: RedelegationEntry): unknown; +}; +export declare const Redelegation: { + encode(message: Redelegation, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Redelegation; + fromJSON(object: any): Redelegation; + fromPartial(object: DeepPartial): Redelegation; + toJSON(message: Redelegation): unknown; +}; +export declare const Params: { + encode(message: Params, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +export declare const DelegationResponse: { + encode(message: DelegationResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DelegationResponse; + fromJSON(object: any): DelegationResponse; + fromPartial(object: DeepPartial): DelegationResponse; + toJSON(message: DelegationResponse): unknown; +}; +export declare const RedelegationEntryResponse: { + encode(message: RedelegationEntryResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RedelegationEntryResponse; + fromJSON(object: any): RedelegationEntryResponse; + fromPartial(object: DeepPartial): RedelegationEntryResponse; + toJSON(message: RedelegationEntryResponse): unknown; +}; +export declare const RedelegationResponse: { + encode(message: RedelegationResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RedelegationResponse; + fromJSON(object: any): RedelegationResponse; + fromPartial(object: DeepPartial): RedelegationResponse; + toJSON(message: RedelegationResponse): unknown; +}; +export declare const Pool: { + encode(message: Pool, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Pool; + fromJSON(object: any): Pool; + fromPartial(object: DeepPartial): Pool; + toJSON(message: Pool): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/staking/v1beta1/tx.d.ts b/packages/stargate/build/codec/cosmos/staking/v1beta1/tx.d.ts new file mode 100644 index 00000000..e4864f59 --- /dev/null +++ b/packages/stargate/build/codec/cosmos/staking/v1beta1/tx.d.ts @@ -0,0 +1,188 @@ +import { Description, CommissionRates } from "../../../cosmos/staking/v1beta1/staking"; +import { Any } from "../../../google/protobuf/any"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.staking.v1beta1"; +/** 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; +} +export declare const MsgCreateValidator: { + encode(message: MsgCreateValidator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgCreateValidator; + fromJSON(object: any): MsgCreateValidator; + fromPartial(object: DeepPartial): MsgCreateValidator; + toJSON(message: MsgCreateValidator): unknown; +}; +export declare const MsgCreateValidatorResponse: { + encode(_: MsgCreateValidatorResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgCreateValidatorResponse; + fromJSON(_: any): MsgCreateValidatorResponse; + fromPartial(_: DeepPartial): MsgCreateValidatorResponse; + toJSON(_: MsgCreateValidatorResponse): unknown; +}; +export declare const MsgEditValidator: { + encode(message: MsgEditValidator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgEditValidator; + fromJSON(object: any): MsgEditValidator; + fromPartial(object: DeepPartial): MsgEditValidator; + toJSON(message: MsgEditValidator): unknown; +}; +export declare const MsgEditValidatorResponse: { + encode(_: MsgEditValidatorResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgEditValidatorResponse; + fromJSON(_: any): MsgEditValidatorResponse; + fromPartial(_: DeepPartial): MsgEditValidatorResponse; + toJSON(_: MsgEditValidatorResponse): unknown; +}; +export declare const MsgDelegate: { + encode(message: MsgDelegate, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgDelegate; + fromJSON(object: any): MsgDelegate; + fromPartial(object: DeepPartial): MsgDelegate; + toJSON(message: MsgDelegate): unknown; +}; +export declare const MsgDelegateResponse: { + encode(_: MsgDelegateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgDelegateResponse; + fromJSON(_: any): MsgDelegateResponse; + fromPartial(_: DeepPartial): MsgDelegateResponse; + toJSON(_: MsgDelegateResponse): unknown; +}; +export declare const MsgBeginRedelegate: { + encode(message: MsgBeginRedelegate, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgBeginRedelegate; + fromJSON(object: any): MsgBeginRedelegate; + fromPartial(object: DeepPartial): MsgBeginRedelegate; + toJSON(message: MsgBeginRedelegate): unknown; +}; +export declare const MsgBeginRedelegateResponse: { + encode(message: MsgBeginRedelegateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgBeginRedelegateResponse; + fromJSON(object: any): MsgBeginRedelegateResponse; + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse; + toJSON(message: MsgBeginRedelegateResponse): unknown; +}; +export declare const MsgUndelegate: { + encode(message: MsgUndelegate, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUndelegate; + fromJSON(object: any): MsgUndelegate; + fromPartial(object: DeepPartial): MsgUndelegate; + toJSON(message: MsgUndelegate): unknown; +}; +export declare const MsgUndelegateResponse: { + encode(message: MsgUndelegateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUndelegateResponse; + fromJSON(object: any): MsgUndelegateResponse; + fromPartial(object: DeepPartial): MsgUndelegateResponse; + toJSON(message: MsgUndelegateResponse): unknown; +}; +/** 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 declare class MsgClientImpl implements Msg { + private readonly rpc; + constructor(rpc: Rpc); + CreateValidator(request: MsgCreateValidator): Promise; + EditValidator(request: MsgEditValidator): Promise; + Delegate(request: MsgDelegate): Promise; + BeginRedelegate(request: MsgBeginRedelegate): Promise; + Undelegate(request: MsgUndelegate): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/tx/signing/v1beta1/signing.d.ts b/packages/stargate/build/codec/cosmos/tx/signing/v1beta1/signing.d.ts new file mode 100644 index 00000000..da62633c --- /dev/null +++ b/packages/stargate/build/codec/cosmos/tx/signing/v1beta1/signing.d.ts @@ -0,0 +1,123 @@ +import { Any } from "../../../../google/protobuf/any"; +import Long from "long"; +import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.tx.signing.v1beta1"; +/** SignMode represents a signing mode with its own security guarantees. */ +export declare 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 declare function signModeFromJSON(object: any): SignMode; +export declare function signModeToJSON(object: SignMode): string; +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: Long; +} +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single | undefined; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi | undefined; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: Uint8Array; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[]; +} +export declare const SignatureDescriptors: { + encode(message: SignatureDescriptors, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignatureDescriptors; + fromJSON(object: any): SignatureDescriptors; + fromPartial(object: DeepPartial): SignatureDescriptors; + toJSON(message: SignatureDescriptors): unknown; +}; +export declare const SignatureDescriptor: { + encode(message: SignatureDescriptor, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignatureDescriptor; + fromJSON(object: any): SignatureDescriptor; + fromPartial(object: DeepPartial): SignatureDescriptor; + toJSON(message: SignatureDescriptor): unknown; +}; +export declare const SignatureDescriptor_Data: { + encode(message: SignatureDescriptor_Data, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignatureDescriptor_Data; + fromJSON(object: any): SignatureDescriptor_Data; + fromPartial(object: DeepPartial): SignatureDescriptor_Data; + toJSON(message: SignatureDescriptor_Data): unknown; +}; +export declare const SignatureDescriptor_Data_Single: { + encode(message: SignatureDescriptor_Data_Single, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignatureDescriptor_Data_Single; + fromJSON(object: any): SignatureDescriptor_Data_Single; + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single; + toJSON(message: SignatureDescriptor_Data_Single): unknown; +}; +export declare const SignatureDescriptor_Data_Multi: { + encode(message: SignatureDescriptor_Data_Multi, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignatureDescriptor_Data_Multi; + fromJSON(object: any): SignatureDescriptor_Data_Multi; + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi; + toJSON(message: SignatureDescriptor_Data_Multi): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos/tx/v1beta1/tx.d.ts b/packages/stargate/build/codec/cosmos/tx/v1beta1/tx.d.ts new file mode 100644 index 00000000..9ac578db --- /dev/null +++ b/packages/stargate/build/codec/cosmos/tx/v1beta1/tx.d.ts @@ -0,0 +1,279 @@ +import Long from "long"; +import { Any } from "../../../google/protobuf/any"; +import { SignMode } from "../../../cosmos/tx/signing/v1beta1/signing"; +import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "cosmos.tx.v1beta1"; +/** Tx is the standard type used for broadcasting transactions. */ +export interface Tx { + /** body is the processable content of the transaction */ + body?: 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; +} +export declare const Tx: { + encode(message: Tx, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Tx; + fromJSON(object: any): Tx; + fromPartial(object: DeepPartial): Tx; + toJSON(message: Tx): unknown; +}; +export declare const TxRaw: { + encode(message: TxRaw, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxRaw; + fromJSON(object: any): TxRaw; + fromPartial(object: DeepPartial): TxRaw; + toJSON(message: TxRaw): unknown; +}; +export declare const SignDoc: { + encode(message: SignDoc, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignDoc; + fromJSON(object: any): SignDoc; + fromPartial(object: DeepPartial): SignDoc; + toJSON(message: SignDoc): unknown; +}; +export declare const TxBody: { + encode(message: TxBody, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxBody; + fromJSON(object: any): TxBody; + fromPartial(object: DeepPartial): TxBody; + toJSON(message: TxBody): unknown; +}; +export declare const AuthInfo: { + encode(message: AuthInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AuthInfo; + fromJSON(object: any): AuthInfo; + fromPartial(object: DeepPartial): AuthInfo; + toJSON(message: AuthInfo): unknown; +}; +export declare const SignerInfo: { + encode(message: SignerInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignerInfo; + fromJSON(object: any): SignerInfo; + fromPartial(object: DeepPartial): SignerInfo; + toJSON(message: SignerInfo): unknown; +}; +export declare const ModeInfo: { + encode(message: ModeInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ModeInfo; + fromJSON(object: any): ModeInfo; + fromPartial(object: DeepPartial): ModeInfo; + toJSON(message: ModeInfo): unknown; +}; +export declare const ModeInfo_Single: { + encode(message: ModeInfo_Single, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ModeInfo_Single; + fromJSON(object: any): ModeInfo_Single; + fromPartial(object: DeepPartial): ModeInfo_Single; + toJSON(message: ModeInfo_Single): unknown; +}; +export declare const ModeInfo_Multi: { + encode(message: ModeInfo_Multi, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ModeInfo_Multi; + fromJSON(object: any): ModeInfo_Multi; + fromPartial(object: DeepPartial): ModeInfo_Multi; + toJSON(message: ModeInfo_Multi): unknown; +}; +export declare const Fee: { + encode(message: Fee, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Fee; + fromJSON(object: any): Fee; + fromPartial(object: DeepPartial): Fee; + toJSON(message: Fee): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/cosmos_proto/cosmos.d.ts b/packages/stargate/build/codec/cosmos_proto/cosmos.d.ts new file mode 100644 index 00000000..ac378148 --- /dev/null +++ b/packages/stargate/build/codec/cosmos_proto/cosmos.d.ts @@ -0,0 +1 @@ +export declare const protobufPackage = "cosmos_proto"; diff --git a/packages/stargate/build/codec/gogoproto/gogo.d.ts b/packages/stargate/build/codec/gogoproto/gogo.d.ts new file mode 100644 index 00000000..885d30bd --- /dev/null +++ b/packages/stargate/build/codec/gogoproto/gogo.d.ts @@ -0,0 +1 @@ +export declare const protobufPackage = "gogoproto"; diff --git a/packages/stargate/build/codec/google/api/annotations.d.ts b/packages/stargate/build/codec/google/api/annotations.d.ts new file mode 100644 index 00000000..a64daf07 --- /dev/null +++ b/packages/stargate/build/codec/google/api/annotations.d.ts @@ -0,0 +1 @@ +export declare const protobufPackage = "google.api"; diff --git a/packages/stargate/build/codec/google/api/http.d.ts b/packages/stargate/build/codec/google/api/http.d.ts new file mode 100644 index 00000000..d8a823da --- /dev/null +++ b/packages/stargate/build/codec/google/api/http.d.ts @@ -0,0 +1,329 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "google.api"; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +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; +} +export declare const Http: { + encode(message: Http, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Http; + fromJSON(object: any): Http; + fromPartial(object: DeepPartial): Http; + toJSON(message: Http): unknown; +}; +export declare const HttpRule: { + encode(message: HttpRule, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): HttpRule; + fromJSON(object: any): HttpRule; + fromPartial(object: DeepPartial): HttpRule; + toJSON(message: HttpRule): unknown; +}; +export declare const CustomHttpPattern: { + encode(message: CustomHttpPattern, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CustomHttpPattern; + fromJSON(object: any): CustomHttpPattern; + fromPartial(object: DeepPartial): CustomHttpPattern; + toJSON(message: CustomHttpPattern): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/google/protobuf/any.d.ts b/packages/stargate/build/codec/google/protobuf/any.d.ts new file mode 100644 index 00000000..1b3a977b --- /dev/null +++ b/packages/stargate/build/codec/google/protobuf/any.d.ts @@ -0,0 +1,138 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * `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; +} +export declare const Any: { + encode(message: Any, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Any; + fromJSON(object: any): Any; + fromPartial(object: DeepPartial): Any; + toJSON(message: Any): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/google/protobuf/descriptor.d.ts b/packages/stargate/build/codec/google/protobuf/descriptor.d.ts new file mode 100644 index 00000000..ea558921 --- /dev/null +++ b/packages/stargate/build/codec/google/protobuf/descriptor.d.ts @@ -0,0 +1,1033 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * 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; +} +export declare 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 declare function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type; +export declare function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string; +export declare enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} +export declare function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label; +export declare function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string; +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +/** Generated classes can be optimized for speed or code size. */ +export declare 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 declare function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode; +export declare function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string; +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 declare enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export declare function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType; +export declare function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string; +export declare 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 declare function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType; +export declare function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string; +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export declare 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 declare function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel; +export declare function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string; +/** + * 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; +} +export declare const FileDescriptorSet: { + encode(message: FileDescriptorSet, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FileDescriptorSet; + fromJSON(object: any): FileDescriptorSet; + fromPartial(object: DeepPartial): FileDescriptorSet; + toJSON(message: FileDescriptorSet): unknown; +}; +export declare const FileDescriptorProto: { + encode(message: FileDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FileDescriptorProto; + fromJSON(object: any): FileDescriptorProto; + fromPartial(object: DeepPartial): FileDescriptorProto; + toJSON(message: FileDescriptorProto): unknown; +}; +export declare const DescriptorProto: { + encode(message: DescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DescriptorProto; + fromJSON(object: any): DescriptorProto; + fromPartial(object: DeepPartial): DescriptorProto; + toJSON(message: DescriptorProto): unknown; +}; +export declare const DescriptorProto_ExtensionRange: { + encode(message: DescriptorProto_ExtensionRange, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DescriptorProto_ExtensionRange; + fromJSON(object: any): DescriptorProto_ExtensionRange; + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange; + toJSON(message: DescriptorProto_ExtensionRange): unknown; +}; +export declare const DescriptorProto_ReservedRange: { + encode(message: DescriptorProto_ReservedRange, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DescriptorProto_ReservedRange; + fromJSON(object: any): DescriptorProto_ReservedRange; + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange; + toJSON(message: DescriptorProto_ReservedRange): unknown; +}; +export declare const ExtensionRangeOptions: { + encode(message: ExtensionRangeOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExtensionRangeOptions; + fromJSON(object: any): ExtensionRangeOptions; + fromPartial(object: DeepPartial): ExtensionRangeOptions; + toJSON(message: ExtensionRangeOptions): unknown; +}; +export declare const FieldDescriptorProto: { + encode(message: FieldDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FieldDescriptorProto; + fromJSON(object: any): FieldDescriptorProto; + fromPartial(object: DeepPartial): FieldDescriptorProto; + toJSON(message: FieldDescriptorProto): unknown; +}; +export declare const OneofDescriptorProto: { + encode(message: OneofDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): OneofDescriptorProto; + fromJSON(object: any): OneofDescriptorProto; + fromPartial(object: DeepPartial): OneofDescriptorProto; + toJSON(message: OneofDescriptorProto): unknown; +}; +export declare const EnumDescriptorProto: { + encode(message: EnumDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EnumDescriptorProto; + fromJSON(object: any): EnumDescriptorProto; + fromPartial(object: DeepPartial): EnumDescriptorProto; + toJSON(message: EnumDescriptorProto): unknown; +}; +export declare const EnumDescriptorProto_EnumReservedRange: { + encode(message: EnumDescriptorProto_EnumReservedRange, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EnumDescriptorProto_EnumReservedRange; + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange; + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange; + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown; +}; +export declare const EnumValueDescriptorProto: { + encode(message: EnumValueDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EnumValueDescriptorProto; + fromJSON(object: any): EnumValueDescriptorProto; + fromPartial(object: DeepPartial): EnumValueDescriptorProto; + toJSON(message: EnumValueDescriptorProto): unknown; +}; +export declare const ServiceDescriptorProto: { + encode(message: ServiceDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ServiceDescriptorProto; + fromJSON(object: any): ServiceDescriptorProto; + fromPartial(object: DeepPartial): ServiceDescriptorProto; + toJSON(message: ServiceDescriptorProto): unknown; +}; +export declare const MethodDescriptorProto: { + encode(message: MethodDescriptorProto, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MethodDescriptorProto; + fromJSON(object: any): MethodDescriptorProto; + fromPartial(object: DeepPartial): MethodDescriptorProto; + toJSON(message: MethodDescriptorProto): unknown; +}; +export declare const FileOptions: { + encode(message: FileOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FileOptions; + fromJSON(object: any): FileOptions; + fromPartial(object: DeepPartial): FileOptions; + toJSON(message: FileOptions): unknown; +}; +export declare const MessageOptions: { + encode(message: MessageOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MessageOptions; + fromJSON(object: any): MessageOptions; + fromPartial(object: DeepPartial): MessageOptions; + toJSON(message: MessageOptions): unknown; +}; +export declare const FieldOptions: { + encode(message: FieldOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FieldOptions; + fromJSON(object: any): FieldOptions; + fromPartial(object: DeepPartial): FieldOptions; + toJSON(message: FieldOptions): unknown; +}; +export declare const OneofOptions: { + encode(message: OneofOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): OneofOptions; + fromJSON(object: any): OneofOptions; + fromPartial(object: DeepPartial): OneofOptions; + toJSON(message: OneofOptions): unknown; +}; +export declare const EnumOptions: { + encode(message: EnumOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EnumOptions; + fromJSON(object: any): EnumOptions; + fromPartial(object: DeepPartial): EnumOptions; + toJSON(message: EnumOptions): unknown; +}; +export declare const EnumValueOptions: { + encode(message: EnumValueOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EnumValueOptions; + fromJSON(object: any): EnumValueOptions; + fromPartial(object: DeepPartial): EnumValueOptions; + toJSON(message: EnumValueOptions): unknown; +}; +export declare const ServiceOptions: { + encode(message: ServiceOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ServiceOptions; + fromJSON(object: any): ServiceOptions; + fromPartial(object: DeepPartial): ServiceOptions; + toJSON(message: ServiceOptions): unknown; +}; +export declare const MethodOptions: { + encode(message: MethodOptions, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MethodOptions; + fromJSON(object: any): MethodOptions; + fromPartial(object: DeepPartial): MethodOptions; + toJSON(message: MethodOptions): unknown; +}; +export declare const UninterpretedOption: { + encode(message: UninterpretedOption, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UninterpretedOption; + fromJSON(object: any): UninterpretedOption; + fromPartial(object: DeepPartial): UninterpretedOption; + toJSON(message: UninterpretedOption): unknown; +}; +export declare const UninterpretedOption_NamePart: { + encode(message: UninterpretedOption_NamePart, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UninterpretedOption_NamePart; + fromJSON(object: any): UninterpretedOption_NamePart; + fromPartial(object: DeepPartial): UninterpretedOption_NamePart; + toJSON(message: UninterpretedOption_NamePart): unknown; +}; +export declare const SourceCodeInfo: { + encode(message: SourceCodeInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SourceCodeInfo; + fromJSON(object: any): SourceCodeInfo; + fromPartial(object: DeepPartial): SourceCodeInfo; + toJSON(message: SourceCodeInfo): unknown; +}; +export declare const SourceCodeInfo_Location: { + encode(message: SourceCodeInfo_Location, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SourceCodeInfo_Location; + fromJSON(object: any): SourceCodeInfo_Location; + fromPartial(object: DeepPartial): SourceCodeInfo_Location; + toJSON(message: SourceCodeInfo_Location): unknown; +}; +export declare const GeneratedCodeInfo: { + encode(message: GeneratedCodeInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GeneratedCodeInfo; + fromJSON(object: any): GeneratedCodeInfo; + fromPartial(object: DeepPartial): GeneratedCodeInfo; + toJSON(message: GeneratedCodeInfo): unknown; +}; +export declare const GeneratedCodeInfo_Annotation: { + encode(message: GeneratedCodeInfo_Annotation, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GeneratedCodeInfo_Annotation; + fromJSON(object: any): GeneratedCodeInfo_Annotation; + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation; + toJSON(message: GeneratedCodeInfo_Annotation): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/google/protobuf/duration.d.ts b/packages/stargate/build/codec/google/protobuf/duration.d.ts new file mode 100644 index 00000000..8fb4c4b2 --- /dev/null +++ b/packages/stargate/build/codec/google/protobuf/duration.d.ts @@ -0,0 +1,100 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # 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; +} +export declare const Duration: { + encode(message: Duration, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Duration; + fromJSON(object: any): Duration; + fromPartial(object: DeepPartial): Duration; + toJSON(message: Duration): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/google/protobuf/timestamp.d.ts b/packages/stargate/build/codec/google/protobuf/timestamp.d.ts new file mode 100644 index 00000000..22aac746 --- /dev/null +++ b/packages/stargate/build/codec/google/protobuf/timestamp.d.ts @@ -0,0 +1,131 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "google.protobuf"; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} +export declare const Timestamp: { + encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Timestamp; + fromJSON(object: any): Timestamp; + fromPartial(object: DeepPartial): Timestamp; + toJSON(message: Timestamp): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/channel/v1/channel.d.ts b/packages/stargate/build/codec/ibc/core/channel/v1/channel.d.ts new file mode 100644 index 00000000..a97b3646 --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/channel/v1/channel.d.ts @@ -0,0 +1,201 @@ +import Long from "long"; +import { Height } from "../../../../ibc/core/client/v1/client"; +import _m0 from "protobufjs/minimal"; +export declare 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 declare 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 declare function stateFromJSON(object: any): State; +export declare function stateToJSON(object: State): string; +/** Order defines if a channel is ORDERED or UNORDERED */ +export declare 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 declare function orderFromJSON(object: any): Order; +export declare function orderToJSON(object: Order): string; +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty?: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty?: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + portId: string; + /** channel identifier */ + channelId: string; +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: Long; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight?: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: Long; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: Long; + /** embedded data that represents packet state. */ + data: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result: Uint8Array | undefined; + error: string | undefined; +} +export declare const Channel: { + encode(message: Channel, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Channel; + fromJSON(object: any): Channel; + fromPartial(object: DeepPartial): Channel; + toJSON(message: Channel): unknown; +}; +export declare const IdentifiedChannel: { + encode(message: IdentifiedChannel, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IdentifiedChannel; + fromJSON(object: any): IdentifiedChannel; + fromPartial(object: DeepPartial): IdentifiedChannel; + toJSON(message: IdentifiedChannel): unknown; +}; +export declare const Counterparty: { + encode(message: Counterparty, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Counterparty; + fromJSON(object: any): Counterparty; + fromPartial(object: DeepPartial): Counterparty; + toJSON(message: Counterparty): unknown; +}; +export declare const Packet: { + encode(message: Packet, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Packet; + fromJSON(object: any): Packet; + fromPartial(object: DeepPartial): Packet; + toJSON(message: Packet): unknown; +}; +export declare const PacketState: { + encode(message: PacketState, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PacketState; + fromJSON(object: any): PacketState; + fromPartial(object: DeepPartial): PacketState; + toJSON(message: PacketState): unknown; +}; +export declare const Acknowledgement: { + encode(message: Acknowledgement, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Acknowledgement; + fromJSON(object: any): Acknowledgement; + fromPartial(object: DeepPartial): Acknowledgement; + toJSON(message: Acknowledgement): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/channel/v1/query.d.ts b/packages/stargate/build/codec/ibc/core/channel/v1/query.d.ts new file mode 100644 index 00000000..fd887800 --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/channel/v1/query.d.ts @@ -0,0 +1,577 @@ +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 Long from "long"; +import { Any } from "../../../../google/protobuf/any"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ibc.core.channel.v1"; +/** 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; +} +export declare const QueryChannelRequest: { + encode(message: QueryChannelRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelRequest; + fromJSON(object: any): QueryChannelRequest; + fromPartial(object: DeepPartial): QueryChannelRequest; + toJSON(message: QueryChannelRequest): unknown; +}; +export declare const QueryChannelResponse: { + encode(message: QueryChannelResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelResponse; + fromJSON(object: any): QueryChannelResponse; + fromPartial(object: DeepPartial): QueryChannelResponse; + toJSON(message: QueryChannelResponse): unknown; +}; +export declare const QueryChannelsRequest: { + encode(message: QueryChannelsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelsRequest; + fromJSON(object: any): QueryChannelsRequest; + fromPartial(object: DeepPartial): QueryChannelsRequest; + toJSON(message: QueryChannelsRequest): unknown; +}; +export declare const QueryChannelsResponse: { + encode(message: QueryChannelsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelsResponse; + fromJSON(object: any): QueryChannelsResponse; + fromPartial(object: DeepPartial): QueryChannelsResponse; + toJSON(message: QueryChannelsResponse): unknown; +}; +export declare const QueryConnectionChannelsRequest: { + encode(message: QueryConnectionChannelsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionChannelsRequest; + fromJSON(object: any): QueryConnectionChannelsRequest; + fromPartial(object: DeepPartial): QueryConnectionChannelsRequest; + toJSON(message: QueryConnectionChannelsRequest): unknown; +}; +export declare const QueryConnectionChannelsResponse: { + encode(message: QueryConnectionChannelsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionChannelsResponse; + fromJSON(object: any): QueryConnectionChannelsResponse; + fromPartial(object: DeepPartial): QueryConnectionChannelsResponse; + toJSON(message: QueryConnectionChannelsResponse): unknown; +}; +export declare const QueryChannelClientStateRequest: { + encode(message: QueryChannelClientStateRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelClientStateRequest; + fromJSON(object: any): QueryChannelClientStateRequest; + fromPartial(object: DeepPartial): QueryChannelClientStateRequest; + toJSON(message: QueryChannelClientStateRequest): unknown; +}; +export declare const QueryChannelClientStateResponse: { + encode(message: QueryChannelClientStateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelClientStateResponse; + fromJSON(object: any): QueryChannelClientStateResponse; + fromPartial(object: DeepPartial): QueryChannelClientStateResponse; + toJSON(message: QueryChannelClientStateResponse): unknown; +}; +export declare const QueryChannelConsensusStateRequest: { + encode(message: QueryChannelConsensusStateRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelConsensusStateRequest; + fromJSON(object: any): QueryChannelConsensusStateRequest; + fromPartial(object: DeepPartial): QueryChannelConsensusStateRequest; + toJSON(message: QueryChannelConsensusStateRequest): unknown; +}; +export declare const QueryChannelConsensusStateResponse: { + encode(message: QueryChannelConsensusStateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryChannelConsensusStateResponse; + fromJSON(object: any): QueryChannelConsensusStateResponse; + fromPartial(object: DeepPartial): QueryChannelConsensusStateResponse; + toJSON(message: QueryChannelConsensusStateResponse): unknown; +}; +export declare const QueryPacketCommitmentRequest: { + encode(message: QueryPacketCommitmentRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketCommitmentRequest; + fromJSON(object: any): QueryPacketCommitmentRequest; + fromPartial(object: DeepPartial): QueryPacketCommitmentRequest; + toJSON(message: QueryPacketCommitmentRequest): unknown; +}; +export declare const QueryPacketCommitmentResponse: { + encode(message: QueryPacketCommitmentResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketCommitmentResponse; + fromJSON(object: any): QueryPacketCommitmentResponse; + fromPartial(object: DeepPartial): QueryPacketCommitmentResponse; + toJSON(message: QueryPacketCommitmentResponse): unknown; +}; +export declare const QueryPacketCommitmentsRequest: { + encode(message: QueryPacketCommitmentsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketCommitmentsRequest; + fromJSON(object: any): QueryPacketCommitmentsRequest; + fromPartial(object: DeepPartial): QueryPacketCommitmentsRequest; + toJSON(message: QueryPacketCommitmentsRequest): unknown; +}; +export declare const QueryPacketCommitmentsResponse: { + encode(message: QueryPacketCommitmentsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketCommitmentsResponse; + fromJSON(object: any): QueryPacketCommitmentsResponse; + fromPartial(object: DeepPartial): QueryPacketCommitmentsResponse; + toJSON(message: QueryPacketCommitmentsResponse): unknown; +}; +export declare const QueryPacketReceiptRequest: { + encode(message: QueryPacketReceiptRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketReceiptRequest; + fromJSON(object: any): QueryPacketReceiptRequest; + fromPartial(object: DeepPartial): QueryPacketReceiptRequest; + toJSON(message: QueryPacketReceiptRequest): unknown; +}; +export declare const QueryPacketReceiptResponse: { + encode(message: QueryPacketReceiptResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketReceiptResponse; + fromJSON(object: any): QueryPacketReceiptResponse; + fromPartial(object: DeepPartial): QueryPacketReceiptResponse; + toJSON(message: QueryPacketReceiptResponse): unknown; +}; +export declare const QueryPacketAcknowledgementRequest: { + encode(message: QueryPacketAcknowledgementRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketAcknowledgementRequest; + fromJSON(object: any): QueryPacketAcknowledgementRequest; + fromPartial(object: DeepPartial): QueryPacketAcknowledgementRequest; + toJSON(message: QueryPacketAcknowledgementRequest): unknown; +}; +export declare const QueryPacketAcknowledgementResponse: { + encode(message: QueryPacketAcknowledgementResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketAcknowledgementResponse; + fromJSON(object: any): QueryPacketAcknowledgementResponse; + fromPartial(object: DeepPartial): QueryPacketAcknowledgementResponse; + toJSON(message: QueryPacketAcknowledgementResponse): unknown; +}; +export declare const QueryPacketAcknowledgementsRequest: { + encode(message: QueryPacketAcknowledgementsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketAcknowledgementsRequest; + fromJSON(object: any): QueryPacketAcknowledgementsRequest; + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsRequest; + toJSON(message: QueryPacketAcknowledgementsRequest): unknown; +}; +export declare const QueryPacketAcknowledgementsResponse: { + encode(message: QueryPacketAcknowledgementsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPacketAcknowledgementsResponse; + fromJSON(object: any): QueryPacketAcknowledgementsResponse; + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsResponse; + toJSON(message: QueryPacketAcknowledgementsResponse): unknown; +}; +export declare const QueryUnreceivedPacketsRequest: { + encode(message: QueryUnreceivedPacketsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnreceivedPacketsRequest; + fromJSON(object: any): QueryUnreceivedPacketsRequest; + fromPartial(object: DeepPartial): QueryUnreceivedPacketsRequest; + toJSON(message: QueryUnreceivedPacketsRequest): unknown; +}; +export declare const QueryUnreceivedPacketsResponse: { + encode(message: QueryUnreceivedPacketsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnreceivedPacketsResponse; + fromJSON(object: any): QueryUnreceivedPacketsResponse; + fromPartial(object: DeepPartial): QueryUnreceivedPacketsResponse; + toJSON(message: QueryUnreceivedPacketsResponse): unknown; +}; +export declare const QueryUnreceivedAcksRequest: { + encode(message: QueryUnreceivedAcksRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnreceivedAcksRequest; + fromJSON(object: any): QueryUnreceivedAcksRequest; + fromPartial(object: DeepPartial): QueryUnreceivedAcksRequest; + toJSON(message: QueryUnreceivedAcksRequest): unknown; +}; +export declare const QueryUnreceivedAcksResponse: { + encode(message: QueryUnreceivedAcksResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryUnreceivedAcksResponse; + fromJSON(object: any): QueryUnreceivedAcksResponse; + fromPartial(object: DeepPartial): QueryUnreceivedAcksResponse; + toJSON(message: QueryUnreceivedAcksResponse): unknown; +}; +export declare const QueryNextSequenceReceiveRequest: { + encode(message: QueryNextSequenceReceiveRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryNextSequenceReceiveRequest; + fromJSON(object: any): QueryNextSequenceReceiveRequest; + fromPartial(object: DeepPartial): QueryNextSequenceReceiveRequest; + toJSON(message: QueryNextSequenceReceiveRequest): unknown; +}; +export declare const QueryNextSequenceReceiveResponse: { + encode(message: QueryNextSequenceReceiveResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryNextSequenceReceiveResponse; + fromJSON(object: any): QueryNextSequenceReceiveResponse; + fromPartial(object: DeepPartial): QueryNextSequenceReceiveResponse; + toJSON(message: QueryNextSequenceReceiveResponse): unknown; +}; +/** 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 declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Channel(request: QueryChannelRequest): Promise; + Channels(request: QueryChannelsRequest): Promise; + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise; + ChannelClientState(request: QueryChannelClientStateRequest): Promise; + ChannelConsensusState( + request: QueryChannelConsensusStateRequest, + ): Promise; + PacketCommitment(request: QueryPacketCommitmentRequest): Promise; + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise; + PacketReceipt(request: QueryPacketReceiptRequest): Promise; + PacketAcknowledgement( + request: QueryPacketAcknowledgementRequest, + ): Promise; + PacketAcknowledgements( + request: QueryPacketAcknowledgementsRequest, + ): Promise; + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/client/v1/client.d.ts b/packages/stargate/build/codec/ibc/core/client/v1/client.d.ts new file mode 100644 index 00000000..d391c9d8 --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/client/v1/client.d.ts @@ -0,0 +1,123 @@ +import { Any } from "../../../../google/protobuf/any"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ibc.core.client.v1"; +/** + * 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[]; +} +export declare const IdentifiedClientState: { + encode(message: IdentifiedClientState, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IdentifiedClientState; + fromJSON(object: any): IdentifiedClientState; + fromPartial(object: DeepPartial): IdentifiedClientState; + toJSON(message: IdentifiedClientState): unknown; +}; +export declare const ConsensusStateWithHeight: { + encode(message: ConsensusStateWithHeight, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConsensusStateWithHeight; + fromJSON(object: any): ConsensusStateWithHeight; + fromPartial(object: DeepPartial): ConsensusStateWithHeight; + toJSON(message: ConsensusStateWithHeight): unknown; +}; +export declare const ClientConsensusStates: { + encode(message: ClientConsensusStates, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClientConsensusStates; + fromJSON(object: any): ClientConsensusStates; + fromPartial(object: DeepPartial): ClientConsensusStates; + toJSON(message: ClientConsensusStates): unknown; +}; +export declare const ClientUpdateProposal: { + encode(message: ClientUpdateProposal, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClientUpdateProposal; + fromJSON(object: any): ClientUpdateProposal; + fromPartial(object: DeepPartial): ClientUpdateProposal; + toJSON(message: ClientUpdateProposal): unknown; +}; +export declare const Height: { + encode(message: Height, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Height; + fromJSON(object: any): Height; + fromPartial(object: DeepPartial): Height; + toJSON(message: Height): unknown; +}; +export declare const Params: { + encode(message: Params, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/commitment/v1/commitment.d.ts b/packages/stargate/build/codec/ibc/core/commitment/v1/commitment.d.ts new file mode 100644 index 00000000..6b44306a --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/commitment/v1/commitment.d.ts @@ -0,0 +1,78 @@ +import { CommitmentProof } from "../../../../confio/proofs"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ibc.core.commitment.v1"; +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +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[]; +} +export declare const MerkleRoot: { + encode(message: MerkleRoot, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MerkleRoot; + fromJSON(object: any): MerkleRoot; + fromPartial(object: DeepPartial): MerkleRoot; + toJSON(message: MerkleRoot): unknown; +}; +export declare const MerklePrefix: { + encode(message: MerklePrefix, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MerklePrefix; + fromJSON(object: any): MerklePrefix; + fromPartial(object: DeepPartial): MerklePrefix; + toJSON(message: MerklePrefix): unknown; +}; +export declare const MerklePath: { + encode(message: MerklePath, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MerklePath; + fromJSON(object: any): MerklePath; + fromPartial(object: DeepPartial): MerklePath; + toJSON(message: MerklePath): unknown; +}; +export declare const MerkleProof: { + encode(message: MerkleProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MerkleProof; + fromJSON(object: any): MerkleProof; + fromPartial(object: DeepPartial): MerkleProof; + toJSON(message: MerkleProof): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/connection/v1/connection.d.ts b/packages/stargate/build/codec/ibc/core/connection/v1/connection.d.ts new file mode 100644 index 00000000..e90e3755 --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/connection/v1/connection.d.ts @@ -0,0 +1,161 @@ +import Long from "long"; +import { MerklePrefix } from "../../../../ibc/core/commitment/v1/commitment"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ibc.core.connection.v1"; +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export declare 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 declare function stateFromJSON(object: any): State; +export declare function stateToJSON(object: State): string; +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty?: Counterparty; + /** + * delay period that must pass before a consensus state can be used for packet-verification + * NOTE: delay period logic is only implemented by some clients. + */ + delayPeriod: Long; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty?: Counterparty; + /** delay period associated with this connection. */ + delayPeriod: Long; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix?: MerklePrefix; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export declare const ConnectionEnd: { + encode(message: ConnectionEnd, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConnectionEnd; + fromJSON(object: any): ConnectionEnd; + fromPartial(object: DeepPartial): ConnectionEnd; + toJSON(message: ConnectionEnd): unknown; +}; +export declare const IdentifiedConnection: { + encode(message: IdentifiedConnection, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IdentifiedConnection; + fromJSON(object: any): IdentifiedConnection; + fromPartial(object: DeepPartial): IdentifiedConnection; + toJSON(message: IdentifiedConnection): unknown; +}; +export declare const Counterparty: { + encode(message: Counterparty, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Counterparty; + fromJSON(object: any): Counterparty; + fromPartial(object: DeepPartial): Counterparty; + toJSON(message: Counterparty): unknown; +}; +export declare const ClientPaths: { + encode(message: ClientPaths, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClientPaths; + fromJSON(object: any): ClientPaths; + fromPartial(object: DeepPartial): ClientPaths; + toJSON(message: ClientPaths): unknown; +}; +export declare const ConnectionPaths: { + encode(message: ConnectionPaths, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConnectionPaths; + fromJSON(object: any): ConnectionPaths; + fromPartial(object: DeepPartial): ConnectionPaths; + toJSON(message: ConnectionPaths): unknown; +}; +export declare const Version: { + encode(message: Version, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Version; + fromJSON(object: any): Version; + fromPartial(object: DeepPartial): Version; + toJSON(message: Version): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/ibc/core/connection/v1/query.d.ts b/packages/stargate/build/codec/ibc/core/connection/v1/query.d.ts new file mode 100644 index 00000000..a3df7371 --- /dev/null +++ b/packages/stargate/build/codec/ibc/core/connection/v1/query.d.ts @@ -0,0 +1,240 @@ +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 Long from "long"; +import { Any } from "../../../../google/protobuf/any"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "ibc.core.connection.v1"; +/** + * 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; +} +export declare const QueryConnectionRequest: { + encode(message: QueryConnectionRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionRequest; + fromJSON(object: any): QueryConnectionRequest; + fromPartial(object: DeepPartial): QueryConnectionRequest; + toJSON(message: QueryConnectionRequest): unknown; +}; +export declare const QueryConnectionResponse: { + encode(message: QueryConnectionResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionResponse; + fromJSON(object: any): QueryConnectionResponse; + fromPartial(object: DeepPartial): QueryConnectionResponse; + toJSON(message: QueryConnectionResponse): unknown; +}; +export declare const QueryConnectionsRequest: { + encode(message: QueryConnectionsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionsRequest; + fromJSON(object: any): QueryConnectionsRequest; + fromPartial(object: DeepPartial): QueryConnectionsRequest; + toJSON(message: QueryConnectionsRequest): unknown; +}; +export declare const QueryConnectionsResponse: { + encode(message: QueryConnectionsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionsResponse; + fromJSON(object: any): QueryConnectionsResponse; + fromPartial(object: DeepPartial): QueryConnectionsResponse; + toJSON(message: QueryConnectionsResponse): unknown; +}; +export declare const QueryClientConnectionsRequest: { + encode(message: QueryClientConnectionsRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryClientConnectionsRequest; + fromJSON(object: any): QueryClientConnectionsRequest; + fromPartial(object: DeepPartial): QueryClientConnectionsRequest; + toJSON(message: QueryClientConnectionsRequest): unknown; +}; +export declare const QueryClientConnectionsResponse: { + encode(message: QueryClientConnectionsResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryClientConnectionsResponse; + fromJSON(object: any): QueryClientConnectionsResponse; + fromPartial(object: DeepPartial): QueryClientConnectionsResponse; + toJSON(message: QueryClientConnectionsResponse): unknown; +}; +export declare const QueryConnectionClientStateRequest: { + encode(message: QueryConnectionClientStateRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionClientStateRequest; + fromJSON(object: any): QueryConnectionClientStateRequest; + fromPartial(object: DeepPartial): QueryConnectionClientStateRequest; + toJSON(message: QueryConnectionClientStateRequest): unknown; +}; +export declare const QueryConnectionClientStateResponse: { + encode(message: QueryConnectionClientStateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionClientStateResponse; + fromJSON(object: any): QueryConnectionClientStateResponse; + fromPartial(object: DeepPartial): QueryConnectionClientStateResponse; + toJSON(message: QueryConnectionClientStateResponse): unknown; +}; +export declare const QueryConnectionConsensusStateRequest: { + encode(message: QueryConnectionConsensusStateRequest, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionConsensusStateRequest; + fromJSON(object: any): QueryConnectionConsensusStateRequest; + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateRequest; + toJSON(message: QueryConnectionConsensusStateRequest): unknown; +}; +export declare const QueryConnectionConsensusStateResponse: { + encode(message: QueryConnectionConsensusStateResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryConnectionConsensusStateResponse; + fromJSON(object: any): QueryConnectionConsensusStateResponse; + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateResponse; + toJSON(message: QueryConnectionConsensusStateResponse): unknown; +}; +/** 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 declare class QueryClientImpl implements Query { + private readonly rpc; + constructor(rpc: Rpc); + Connection(request: QueryConnectionRequest): Promise; + Connections(request: QueryConnectionsRequest): Promise; + ClientConnections(request: QueryClientConnectionsRequest): Promise; + ConnectionClientState( + request: QueryConnectionClientStateRequest, + ): Promise; + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/abci/types.d.ts b/packages/stargate/build/codec/tendermint/abci/types.d.ts new file mode 100644 index 00000000..fae53a3b --- /dev/null +++ b/packages/stargate/build/codec/tendermint/abci/types.d.ts @@ -0,0 +1,706 @@ +import 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 _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.abci"; +export declare enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} +export declare function checkTxTypeFromJSON(object: any): CheckTxType; +export declare function checkTxTypeToJSON(object: CheckTxType): string; +export declare enum EvidenceType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} +export declare function evidenceTypeFromJSON(object: any): EvidenceType; +export declare function evidenceTypeToJSON(object: EvidenceType): string; +export interface Request { + echo?: RequestEcho | undefined; + flush?: RequestFlush | undefined; + info?: RequestInfo | undefined; + setOption?: RequestSetOption | undefined; + initChain?: RequestInitChain | undefined; + query?: RequestQuery | undefined; + beginBlock?: RequestBeginBlock | undefined; + checkTx?: RequestCheckTx | undefined; + deliverTx?: RequestDeliverTx | undefined; + endBlock?: RequestEndBlock | undefined; + commit?: RequestCommit | undefined; + listSnapshots?: RequestListSnapshots | undefined; + offerSnapshot?: RequestOfferSnapshot | undefined; + loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined; + applySnapshotChunk?: RequestApplySnapshotChunk | undefined; +} +export interface RequestEcho { + message: string; +} +export interface RequestFlush {} +export interface RequestInfo { + version: string; + blockVersion: Long; + p2pVersion: Long; +} +/** nondeterministic */ +export interface RequestSetOption { + key: string; + value: string; +} +export interface RequestInitChain { + time?: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: Long; +} +export interface RequestQuery { + data: Uint8Array; + path: string; + height: Long; + prove: boolean; +} +export interface RequestBeginBlock { + hash: Uint8Array; + header?: Header; + lastCommitInfo?: LastCommitInfo; + byzantineValidators: Evidence[]; +} +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestDeliverTx { + tx: Uint8Array; +} +export interface RequestEndBlock { + height: Long; +} +export interface RequestCommit {} +/** lists available snapshots */ +export interface RequestListSnapshots {} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: Long; + format: number; + chunk: number; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface Response { + exception?: ResponseException | undefined; + echo?: ResponseEcho | undefined; + flush?: ResponseFlush | undefined; + info?: ResponseInfo | undefined; + setOption?: ResponseSetOption | undefined; + initChain?: ResponseInitChain | undefined; + query?: ResponseQuery | undefined; + beginBlock?: ResponseBeginBlock | undefined; + checkTx?: ResponseCheckTx | undefined; + deliverTx?: ResponseDeliverTx | undefined; + endBlock?: ResponseEndBlock | undefined; + commit?: ResponseCommit | undefined; + listSnapshots?: ResponseListSnapshots | undefined; + offerSnapshot?: ResponseOfferSnapshot | undefined; + loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined; + applySnapshotChunk?: ResponseApplySnapshotChunk | undefined; +} +/** nondeterministic */ +export interface ResponseException { + error: string; +} +export interface ResponseEcho { + message: string; +} +export interface ResponseFlush {} +export interface ResponseInfo { + data: string; + version: string; + appVersion: Long; + lastBlockHeight: Long; + lastBlockAppHash: Uint8Array; +} +/** nondeterministic */ +export interface ResponseSetOption { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: Long; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: Long; + codespace: string; +} +export interface ResponseBeginBlock { + events: Event[]; +} +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} +export interface ResponseDeliverTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates?: ConsensusParams; + events: Event[]; +} +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: Long; +} +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} +export declare 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 declare function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result; +export declare function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string; +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} +export declare 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 declare function responseApplySnapshotChunk_ResultFromJSON( + object: any, +): ResponseApplySnapshotChunk_Result; +export declare function responseApplySnapshotChunk_ResultToJSON( + object: ResponseApplySnapshotChunk_Result, +): 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; +} +export declare const Request: { + encode(message: Request, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Request; + fromJSON(object: any): Request; + fromPartial(object: DeepPartial): Request; + toJSON(message: Request): unknown; +}; +export declare const RequestEcho: { + encode(message: RequestEcho, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestEcho; + fromJSON(object: any): RequestEcho; + fromPartial(object: DeepPartial): RequestEcho; + toJSON(message: RequestEcho): unknown; +}; +export declare const RequestFlush: { + encode(_: RequestFlush, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestFlush; + fromJSON(_: any): RequestFlush; + fromPartial(_: DeepPartial): RequestFlush; + toJSON(_: RequestFlush): unknown; +}; +export declare const RequestInfo: { + encode(message: RequestInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestInfo; + fromJSON(object: any): RequestInfo; + fromPartial(object: DeepPartial): RequestInfo; + toJSON(message: RequestInfo): unknown; +}; +export declare const RequestSetOption: { + encode(message: RequestSetOption, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestSetOption; + fromJSON(object: any): RequestSetOption; + fromPartial(object: DeepPartial): RequestSetOption; + toJSON(message: RequestSetOption): unknown; +}; +export declare const RequestInitChain: { + encode(message: RequestInitChain, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestInitChain; + fromJSON(object: any): RequestInitChain; + fromPartial(object: DeepPartial): RequestInitChain; + toJSON(message: RequestInitChain): unknown; +}; +export declare const RequestQuery: { + encode(message: RequestQuery, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestQuery; + fromJSON(object: any): RequestQuery; + fromPartial(object: DeepPartial): RequestQuery; + toJSON(message: RequestQuery): unknown; +}; +export declare const RequestBeginBlock: { + encode(message: RequestBeginBlock, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestBeginBlock; + fromJSON(object: any): RequestBeginBlock; + fromPartial(object: DeepPartial): RequestBeginBlock; + toJSON(message: RequestBeginBlock): unknown; +}; +export declare const RequestCheckTx: { + encode(message: RequestCheckTx, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestCheckTx; + fromJSON(object: any): RequestCheckTx; + fromPartial(object: DeepPartial): RequestCheckTx; + toJSON(message: RequestCheckTx): unknown; +}; +export declare const RequestDeliverTx: { + encode(message: RequestDeliverTx, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestDeliverTx; + fromJSON(object: any): RequestDeliverTx; + fromPartial(object: DeepPartial): RequestDeliverTx; + toJSON(message: RequestDeliverTx): unknown; +}; +export declare const RequestEndBlock: { + encode(message: RequestEndBlock, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestEndBlock; + fromJSON(object: any): RequestEndBlock; + fromPartial(object: DeepPartial): RequestEndBlock; + toJSON(message: RequestEndBlock): unknown; +}; +export declare const RequestCommit: { + encode(_: RequestCommit, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestCommit; + fromJSON(_: any): RequestCommit; + fromPartial(_: DeepPartial): RequestCommit; + toJSON(_: RequestCommit): unknown; +}; +export declare const RequestListSnapshots: { + encode(_: RequestListSnapshots, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestListSnapshots; + fromJSON(_: any): RequestListSnapshots; + fromPartial(_: DeepPartial): RequestListSnapshots; + toJSON(_: RequestListSnapshots): unknown; +}; +export declare const RequestOfferSnapshot: { + encode(message: RequestOfferSnapshot, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestOfferSnapshot; + fromJSON(object: any): RequestOfferSnapshot; + fromPartial(object: DeepPartial): RequestOfferSnapshot; + toJSON(message: RequestOfferSnapshot): unknown; +}; +export declare const RequestLoadSnapshotChunk: { + encode(message: RequestLoadSnapshotChunk, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestLoadSnapshotChunk; + fromJSON(object: any): RequestLoadSnapshotChunk; + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk; + toJSON(message: RequestLoadSnapshotChunk): unknown; +}; +export declare const RequestApplySnapshotChunk: { + encode(message: RequestApplySnapshotChunk, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RequestApplySnapshotChunk; + fromJSON(object: any): RequestApplySnapshotChunk; + fromPartial(object: DeepPartial): RequestApplySnapshotChunk; + toJSON(message: RequestApplySnapshotChunk): unknown; +}; +export declare const Response: { + encode(message: Response, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Response; + fromJSON(object: any): Response; + fromPartial(object: DeepPartial): Response; + toJSON(message: Response): unknown; +}; +export declare const ResponseException: { + encode(message: ResponseException, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseException; + fromJSON(object: any): ResponseException; + fromPartial(object: DeepPartial): ResponseException; + toJSON(message: ResponseException): unknown; +}; +export declare const ResponseEcho: { + encode(message: ResponseEcho, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseEcho; + fromJSON(object: any): ResponseEcho; + fromPartial(object: DeepPartial): ResponseEcho; + toJSON(message: ResponseEcho): unknown; +}; +export declare const ResponseFlush: { + encode(_: ResponseFlush, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseFlush; + fromJSON(_: any): ResponseFlush; + fromPartial(_: DeepPartial): ResponseFlush; + toJSON(_: ResponseFlush): unknown; +}; +export declare const ResponseInfo: { + encode(message: ResponseInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseInfo; + fromJSON(object: any): ResponseInfo; + fromPartial(object: DeepPartial): ResponseInfo; + toJSON(message: ResponseInfo): unknown; +}; +export declare const ResponseSetOption: { + encode(message: ResponseSetOption, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseSetOption; + fromJSON(object: any): ResponseSetOption; + fromPartial(object: DeepPartial): ResponseSetOption; + toJSON(message: ResponseSetOption): unknown; +}; +export declare const ResponseInitChain: { + encode(message: ResponseInitChain, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseInitChain; + fromJSON(object: any): ResponseInitChain; + fromPartial(object: DeepPartial): ResponseInitChain; + toJSON(message: ResponseInitChain): unknown; +}; +export declare const ResponseQuery: { + encode(message: ResponseQuery, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseQuery; + fromJSON(object: any): ResponseQuery; + fromPartial(object: DeepPartial): ResponseQuery; + toJSON(message: ResponseQuery): unknown; +}; +export declare const ResponseBeginBlock: { + encode(message: ResponseBeginBlock, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseBeginBlock; + fromJSON(object: any): ResponseBeginBlock; + fromPartial(object: DeepPartial): ResponseBeginBlock; + toJSON(message: ResponseBeginBlock): unknown; +}; +export declare const ResponseCheckTx: { + encode(message: ResponseCheckTx, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseCheckTx; + fromJSON(object: any): ResponseCheckTx; + fromPartial(object: DeepPartial): ResponseCheckTx; + toJSON(message: ResponseCheckTx): unknown; +}; +export declare const ResponseDeliverTx: { + encode(message: ResponseDeliverTx, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseDeliverTx; + fromJSON(object: any): ResponseDeliverTx; + fromPartial(object: DeepPartial): ResponseDeliverTx; + toJSON(message: ResponseDeliverTx): unknown; +}; +export declare const ResponseEndBlock: { + encode(message: ResponseEndBlock, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseEndBlock; + fromJSON(object: any): ResponseEndBlock; + fromPartial(object: DeepPartial): ResponseEndBlock; + toJSON(message: ResponseEndBlock): unknown; +}; +export declare const ResponseCommit: { + encode(message: ResponseCommit, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseCommit; + fromJSON(object: any): ResponseCommit; + fromPartial(object: DeepPartial): ResponseCommit; + toJSON(message: ResponseCommit): unknown; +}; +export declare const ResponseListSnapshots: { + encode(message: ResponseListSnapshots, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseListSnapshots; + fromJSON(object: any): ResponseListSnapshots; + fromPartial(object: DeepPartial): ResponseListSnapshots; + toJSON(message: ResponseListSnapshots): unknown; +}; +export declare const ResponseOfferSnapshot: { + encode(message: ResponseOfferSnapshot, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseOfferSnapshot; + fromJSON(object: any): ResponseOfferSnapshot; + fromPartial(object: DeepPartial): ResponseOfferSnapshot; + toJSON(message: ResponseOfferSnapshot): unknown; +}; +export declare const ResponseLoadSnapshotChunk: { + encode(message: ResponseLoadSnapshotChunk, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseLoadSnapshotChunk; + fromJSON(object: any): ResponseLoadSnapshotChunk; + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk; + toJSON(message: ResponseLoadSnapshotChunk): unknown; +}; +export declare const ResponseApplySnapshotChunk: { + encode(message: ResponseApplySnapshotChunk, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ResponseApplySnapshotChunk; + fromJSON(object: any): ResponseApplySnapshotChunk; + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk; + toJSON(message: ResponseApplySnapshotChunk): unknown; +}; +export declare const ConsensusParams: { + encode(message: ConsensusParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConsensusParams; + fromJSON(object: any): ConsensusParams; + fromPartial(object: DeepPartial): ConsensusParams; + toJSON(message: ConsensusParams): unknown; +}; +export declare const BlockParams: { + encode(message: BlockParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BlockParams; + fromJSON(object: any): BlockParams; + fromPartial(object: DeepPartial): BlockParams; + toJSON(message: BlockParams): unknown; +}; +export declare const LastCommitInfo: { + encode(message: LastCommitInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LastCommitInfo; + fromJSON(object: any): LastCommitInfo; + fromPartial(object: DeepPartial): LastCommitInfo; + toJSON(message: LastCommitInfo): unknown; +}; +export declare const Event: { + encode(message: Event, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Event; + fromJSON(object: any): Event; + fromPartial(object: DeepPartial): Event; + toJSON(message: Event): unknown; +}; +export declare const EventAttribute: { + encode(message: EventAttribute, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EventAttribute; + fromJSON(object: any): EventAttribute; + fromPartial(object: DeepPartial): EventAttribute; + toJSON(message: EventAttribute): unknown; +}; +export declare const TxResult: { + encode(message: TxResult, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxResult; + fromJSON(object: any): TxResult; + fromPartial(object: DeepPartial): TxResult; + toJSON(message: TxResult): unknown; +}; +export declare const Validator: { + encode(message: Validator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Validator; + fromJSON(object: any): Validator; + fromPartial(object: DeepPartial): Validator; + toJSON(message: Validator): unknown; +}; +export declare const ValidatorUpdate: { + encode(message: ValidatorUpdate, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorUpdate; + fromJSON(object: any): ValidatorUpdate; + fromPartial(object: DeepPartial): ValidatorUpdate; + toJSON(message: ValidatorUpdate): unknown; +}; +export declare const VoteInfo: { + encode(message: VoteInfo, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): VoteInfo; + fromJSON(object: any): VoteInfo; + fromPartial(object: DeepPartial): VoteInfo; + toJSON(message: VoteInfo): unknown; +}; +export declare const Evidence: { + encode(message: Evidence, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Evidence; + fromJSON(object: any): Evidence; + fromPartial(object: DeepPartial): Evidence; + toJSON(message: Evidence): unknown; +}; +export declare const Snapshot: { + encode(message: Snapshot, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Snapshot; + fromJSON(object: any): Snapshot; + fromPartial(object: DeepPartial): Snapshot; + toJSON(message: Snapshot): unknown; +}; +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 declare class ABCIApplicationClientImpl implements ABCIApplication { + private readonly rpc; + constructor(rpc: Rpc); + Echo(request: RequestEcho): Promise; + Flush(request: RequestFlush): Promise; + Info(request: RequestInfo): Promise; + SetOption(request: RequestSetOption): Promise; + DeliverTx(request: RequestDeliverTx): Promise; + CheckTx(request: RequestCheckTx): Promise; + Query(request: RequestQuery): Promise; + Commit(request: RequestCommit): Promise; + InitChain(request: RequestInitChain): Promise; + BeginBlock(request: RequestBeginBlock): Promise; + EndBlock(request: RequestEndBlock): Promise; + ListSnapshots(request: RequestListSnapshots): Promise; + OfferSnapshot(request: RequestOfferSnapshot): Promise; + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/crypto/keys.d.ts b/packages/stargate/build/codec/tendermint/crypto/keys.d.ts new file mode 100644 index 00000000..8b5b0c59 --- /dev/null +++ b/packages/stargate/build/codec/tendermint/crypto/keys.d.ts @@ -0,0 +1,28 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.crypto"; +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKey { + ed25519: Uint8Array | undefined; + secp256k1: Uint8Array | undefined; +} +export declare const PublicKey: { + encode(message: PublicKey, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PublicKey; + fromJSON(object: any): PublicKey; + fromPartial(object: DeepPartial): PublicKey; + toJSON(message: PublicKey): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/crypto/proof.d.ts b/packages/stargate/build/codec/tendermint/crypto/proof.d.ts new file mode 100644 index 00000000..8e480469 --- /dev/null +++ b/packages/stargate/build/codec/tendermint/crypto/proof.d.ts @@ -0,0 +1,82 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.crypto"; +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[]; +} +export declare const Proof: { + encode(message: Proof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Proof; + fromJSON(object: any): Proof; + fromPartial(object: DeepPartial): Proof; + toJSON(message: Proof): unknown; +}; +export declare const ValueOp: { + encode(message: ValueOp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValueOp; + fromJSON(object: any): ValueOp; + fromPartial(object: DeepPartial): ValueOp; + toJSON(message: ValueOp): unknown; +}; +export declare const DominoOp: { + encode(message: DominoOp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DominoOp; + fromJSON(object: any): DominoOp; + fromPartial(object: DeepPartial): DominoOp; + toJSON(message: DominoOp): unknown; +}; +export declare const ProofOp: { + encode(message: ProofOp, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ProofOp; + fromJSON(object: any): ProofOp; + fromPartial(object: DeepPartial): ProofOp; + toJSON(message: ProofOp): unknown; +}; +export declare const ProofOps: { + encode(message: ProofOps, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ProofOps; + fromJSON(object: any): ProofOps; + fromPartial(object: DeepPartial): ProofOps; + toJSON(message: ProofOps): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/libs/bits/types.d.ts b/packages/stargate/build/codec/tendermint/libs/bits/types.d.ts new file mode 100644 index 00000000..a30ed43b --- /dev/null +++ b/packages/stargate/build/codec/tendermint/libs/bits/types.d.ts @@ -0,0 +1,27 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.libs.bits"; +export interface BitArray { + bits: Long; + elems: Long[]; +} +export declare const BitArray: { + encode(message: BitArray, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BitArray; + fromJSON(object: any): BitArray; + fromPartial(object: DeepPartial): BitArray; + toJSON(message: BitArray): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/types/params.d.ts b/packages/stargate/build/codec/tendermint/types/params.d.ts new file mode 100644 index 00000000..ac8fdb85 --- /dev/null +++ b/packages/stargate/build/codec/tendermint/types/params.d.ts @@ -0,0 +1,133 @@ +import Long from "long"; +import { Duration } from "../../google/protobuf/duration"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.types"; +/** + * 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; +} +export declare const ConsensusParams: { + encode(message: ConsensusParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConsensusParams; + fromJSON(object: any): ConsensusParams; + fromPartial(object: DeepPartial): ConsensusParams; + toJSON(message: ConsensusParams): unknown; +}; +export declare const BlockParams: { + encode(message: BlockParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BlockParams; + fromJSON(object: any): BlockParams; + fromPartial(object: DeepPartial): BlockParams; + toJSON(message: BlockParams): unknown; +}; +export declare const EvidenceParams: { + encode(message: EvidenceParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): EvidenceParams; + fromJSON(object: any): EvidenceParams; + fromPartial(object: DeepPartial): EvidenceParams; + toJSON(message: EvidenceParams): unknown; +}; +export declare const ValidatorParams: { + encode(message: ValidatorParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorParams; + fromJSON(object: any): ValidatorParams; + fromPartial(object: DeepPartial): ValidatorParams; + toJSON(message: ValidatorParams): unknown; +}; +export declare const VersionParams: { + encode(message: VersionParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): VersionParams; + fromJSON(object: any): VersionParams; + fromPartial(object: DeepPartial): VersionParams; + toJSON(message: VersionParams): unknown; +}; +export declare const HashedParams: { + encode(message: HashedParams, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): HashedParams; + fromJSON(object: any): HashedParams; + fromPartial(object: DeepPartial): HashedParams; + toJSON(message: HashedParams): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/types/types.d.ts b/packages/stargate/build/codec/tendermint/types/types.d.ts new file mode 100644 index 00000000..10943817 --- /dev/null +++ b/packages/stargate/build/codec/tendermint/types/types.d.ts @@ -0,0 +1,242 @@ +import { Proof } from "../../tendermint/crypto/proof"; +import { Consensus } from "../../tendermint/version/types"; +import Long from "long"; +import { ValidatorSet } from "../../tendermint/types/validator"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.types"; +/** BlockIdFlag indicates which BlcokID the signature is for */ +export declare 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 declare function blockIDFlagFromJSON(object: any): BlockIDFlag; +export declare function blockIDFlagToJSON(object: BlockIDFlag): string; +/** SignedMsgType is a type of signed message in the consensus. */ +export declare 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 declare function signedMsgTypeFromJSON(object: any): SignedMsgType; +export declare function signedMsgTypeToJSON(object: SignedMsgType): string; +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} +export interface Part { + index: number; + bytes: Uint8Array; + proof?: Proof; +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader?: PartSetHeader; +} +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version?: Consensus; + chainId: string; + height: Long; + time?: Date; + /** prev block info */ + lastBlockId?: BlockID; + /** hashes of block data */ + lastCommitHash: Uint8Array; + /** transactions */ + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: Uint8Array[]; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface Vote { + type: SignedMsgType; + height: Long; + round: number; + /** zero if vote is nil. */ + blockId?: BlockID; + timestamp?: Date; + validatorAddress: Uint8Array; + validatorIndex: number; + signature: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: Long; + round: number; + blockId?: BlockID; + signatures: CommitSig[]; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp?: Date; + signature: Uint8Array; +} +export interface Proposal { + type: SignedMsgType; + height: Long; + round: number; + polRound: number; + blockId?: BlockID; + timestamp?: Date; + signature: Uint8Array; +} +export interface SignedHeader { + header?: Header; + commit?: Commit; +} +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} +export interface BlockMeta { + blockId?: BlockID; + blockSize: Long; + header?: Header; + numTxs: Long; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array; + data: Uint8Array; + proof?: Proof; +} +export declare const PartSetHeader: { + encode(message: PartSetHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PartSetHeader; + fromJSON(object: any): PartSetHeader; + fromPartial(object: DeepPartial): PartSetHeader; + toJSON(message: PartSetHeader): unknown; +}; +export declare const Part: { + encode(message: Part, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Part; + fromJSON(object: any): Part; + fromPartial(object: DeepPartial): Part; + toJSON(message: Part): unknown; +}; +export declare const BlockID: { + encode(message: BlockID, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BlockID; + fromJSON(object: any): BlockID; + fromPartial(object: DeepPartial): BlockID; + toJSON(message: BlockID): unknown; +}; +export declare const Header: { + encode(message: Header, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Header; + fromJSON(object: any): Header; + fromPartial(object: DeepPartial
): Header; + toJSON(message: Header): unknown; +}; +export declare const Data: { + encode(message: Data, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Data; + fromJSON(object: any): Data; + fromPartial(object: DeepPartial): Data; + toJSON(message: Data): unknown; +}; +export declare const Vote: { + encode(message: Vote, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Vote; + fromJSON(object: any): Vote; + fromPartial(object: DeepPartial): Vote; + toJSON(message: Vote): unknown; +}; +export declare const Commit: { + encode(message: Commit, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Commit; + fromJSON(object: any): Commit; + fromPartial(object: DeepPartial): Commit; + toJSON(message: Commit): unknown; +}; +export declare const CommitSig: { + encode(message: CommitSig, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CommitSig; + fromJSON(object: any): CommitSig; + fromPartial(object: DeepPartial): CommitSig; + toJSON(message: CommitSig): unknown; +}; +export declare const Proposal: { + encode(message: Proposal, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Proposal; + fromJSON(object: any): Proposal; + fromPartial(object: DeepPartial): Proposal; + toJSON(message: Proposal): unknown; +}; +export declare const SignedHeader: { + encode(message: SignedHeader, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SignedHeader; + fromJSON(object: any): SignedHeader; + fromPartial(object: DeepPartial): SignedHeader; + toJSON(message: SignedHeader): unknown; +}; +export declare const LightBlock: { + encode(message: LightBlock, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LightBlock; + fromJSON(object: any): LightBlock; + fromPartial(object: DeepPartial): LightBlock; + toJSON(message: LightBlock): unknown; +}; +export declare const BlockMeta: { + encode(message: BlockMeta, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BlockMeta; + fromJSON(object: any): BlockMeta; + fromPartial(object: DeepPartial): BlockMeta; + toJSON(message: BlockMeta): unknown; +}; +export declare const TxProof: { + encode(message: TxProof, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TxProof; + fromJSON(object: any): TxProof; + fromPartial(object: DeepPartial): TxProof; + toJSON(message: TxProof): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/types/validator.d.ts b/packages/stargate/build/codec/tendermint/types/validator.d.ts new file mode 100644 index 00000000..202dbefa --- /dev/null +++ b/packages/stargate/build/codec/tendermint/types/validator.d.ts @@ -0,0 +1,53 @@ +import Long from "long"; +import { PublicKey } from "../../tendermint/crypto/keys"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.types"; +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; +} +export declare const ValidatorSet: { + encode(message: ValidatorSet, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorSet; + fromJSON(object: any): ValidatorSet; + fromPartial(object: DeepPartial): ValidatorSet; + toJSON(message: ValidatorSet): unknown; +}; +export declare const Validator: { + encode(message: Validator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Validator; + fromJSON(object: any): Validator; + fromPartial(object: DeepPartial): Validator; + toJSON(message: Validator): unknown; +}; +export declare const SimpleValidator: { + encode(message: SimpleValidator, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SimpleValidator; + fromJSON(object: any): SimpleValidator; + fromPartial(object: DeepPartial): SimpleValidator; + toJSON(message: SimpleValidator): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/codec/tendermint/version/types.d.ts b/packages/stargate/build/codec/tendermint/version/types.d.ts new file mode 100644 index 00000000..3fde0fbb --- /dev/null +++ b/packages/stargate/build/codec/tendermint/version/types.d.ts @@ -0,0 +1,48 @@ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +export declare const protobufPackage = "tendermint.version"; +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +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; +} +export declare const App: { + encode(message: App, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): App; + fromJSON(object: any): App; + fromPartial(object: DeepPartial): App; + toJSON(message: App): unknown; +}; +export declare const Consensus: { + encode(message: Consensus, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Consensus; + fromJSON(object: any): Consensus; + fromPartial(object: DeepPartial): Consensus; + toJSON(message: Consensus): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/stargate/build/index.d.ts b/packages/stargate/build/index.d.ts new file mode 100644 index 00000000..240d94dd --- /dev/null +++ b/packages/stargate/build/index.d.ts @@ -0,0 +1,30 @@ +export { AminoConverter, AminoTypes } from "./aminotypes"; +export { parseRawLog } from "./logs"; +export { + AuthExtension, + BankExtension, + DistributionExtension, + IbcExtension, + QueryClient, + setupAuthExtension, + setupBankExtension, + setupDistributionExtension, + setupIbcExtension, + setupStakingExtension, + StakingExtension, +} from "./queries"; +export { + Account, + accountFromProto, + assertIsBroadcastTxSuccess, + BroadcastTxFailure, + BroadcastTxResponse, + BroadcastTxSuccess, + coinFromProto, + IndexedTx, + isBroadcastTxFailure, + isBroadcastTxSuccess, + SequenceResponse, + StargateClient, +} from "./stargateclient"; +export { defaultRegistryTypes, SigningStargateClient } from "./signingstargateclient"; diff --git a/packages/stargate/build/logs.d.ts b/packages/stargate/build/logs.d.ts new file mode 100644 index 00000000..258dd322 --- /dev/null +++ b/packages/stargate/build/logs.d.ts @@ -0,0 +1,2 @@ +import { logs } from "@cosmjs/launchpad"; +export declare function parseRawLog(input?: string): readonly logs.Log[]; diff --git a/packages/stargate/build/queries/auth.d.ts b/packages/stargate/build/queries/auth.d.ts new file mode 100644 index 00000000..c81db997 --- /dev/null +++ b/packages/stargate/build/queries/auth.d.ts @@ -0,0 +1,11 @@ +import { BaseAccount } from "../codec/cosmos/auth/v1beta1/auth"; +import { QueryClient } from "./queryclient"; +export interface AuthExtension { + readonly auth: { + readonly account: (address: string) => Promise; + readonly unverified: { + readonly account: (address: string) => Promise; + }; + }; +} +export declare function setupAuthExtension(base: QueryClient): AuthExtension; diff --git a/packages/stargate/build/queries/bank.d.ts b/packages/stargate/build/queries/bank.d.ts new file mode 100644 index 00000000..6aea1a23 --- /dev/null +++ b/packages/stargate/build/queries/bank.d.ts @@ -0,0 +1,14 @@ +import { Coin } from "../codec/cosmos/base/v1beta1/coin"; +import { QueryClient } from "./queryclient"; +export interface BankExtension { + readonly bank: { + readonly balance: (address: string, denom: string) => Promise; + readonly unverified: { + readonly balance: (address: string, denom: string) => Promise; + readonly allBalances: (address: string) => Promise; + readonly totalSupply: () => Promise; + readonly supplyOf: (denom: string) => Promise; + }; + }; +} +export declare function setupBankExtension(base: QueryClient): BankExtension; diff --git a/packages/stargate/build/queries/distribution.d.ts b/packages/stargate/build/queries/distribution.d.ts new file mode 100644 index 00000000..5a214a20 --- /dev/null +++ b/packages/stargate/build/queries/distribution.d.ts @@ -0,0 +1,38 @@ +import { + QueryCommunityPoolResponse, + QueryDelegationRewardsResponse, + QueryDelegationTotalRewardsResponse, + QueryDelegatorValidatorsResponse, + QueryDelegatorWithdrawAddressResponse, + QueryParamsResponse, + QueryValidatorCommissionResponse, + QueryValidatorOutstandingRewardsResponse, + QueryValidatorSlashesResponse, +} from "../codec/cosmos/distribution/v1beta1/query"; +import { QueryClient } from "./queryclient"; +export interface DistributionExtension { + readonly distribution: { + unverified: { + communityPool: () => Promise; + delegationRewards: ( + delegatorAddress: string, + validatorAddress: string, + ) => Promise; + delegationTotalRewards: (delegatorAddress: string) => Promise; + delegatorValidators: (delegatorAddress: string) => Promise; + delegatorWithdrawAddress: (delegatorAddress: string) => Promise; + params: () => Promise; + validatorCommission: (validatorAddress: string) => Promise; + validatorOutstandingRewards: ( + validatorAddress: string, + ) => Promise; + validatorSlashes: ( + validatorAddress: string, + startingHeight: number, + endingHeight: number, + paginationKey?: Uint8Array, + ) => Promise; + }; + }; +} +export declare function setupDistributionExtension(base: QueryClient): DistributionExtension; diff --git a/packages/stargate/build/queries/ibc.d.ts b/packages/stargate/build/queries/ibc.d.ts new file mode 100644 index 00000000..78046243 --- /dev/null +++ b/packages/stargate/build/queries/ibc.d.ts @@ -0,0 +1,77 @@ +import { Channel } from "../codec/ibc/core/channel/v1/channel"; +import { + QueryChannelResponse, + QueryChannelsResponse, + QueryConnectionChannelsResponse, + QueryNextSequenceReceiveResponse, + QueryPacketAcknowledgementResponse, + QueryPacketAcknowledgementsResponse, + QueryPacketCommitmentResponse, + QueryPacketCommitmentsResponse, + QueryUnreceivedAcksResponse, + QueryUnreceivedPacketsResponse, +} from "../codec/ibc/core/channel/v1/query"; +import { + QueryClientConnectionsResponse, + QueryConnectionResponse, + QueryConnectionsResponse, +} from "../codec/ibc/core/connection/v1/query"; +import { QueryClient } from "./queryclient"; +export interface IbcExtension { + readonly ibc: { + readonly channel: (portId: string, channelId: string) => Promise; + readonly packetCommitment: (portId: string, channelId: string, sequence: number) => Promise; + readonly packetAcknowledgement: ( + portId: string, + channelId: string, + sequence: number, + ) => Promise; + readonly nextSequenceReceive: (portId: string, channelId: string) => Promise; + readonly unverified: { + readonly channel: (portId: string, channelId: string) => Promise; + readonly channels: (paginationKey?: Uint8Array) => Promise; + readonly connectionChannels: ( + connection: string, + paginationKey?: Uint8Array, + ) => Promise; + readonly packetCommitment: ( + portId: string, + channelId: string, + sequence: number, + ) => Promise; + readonly packetCommitments: ( + portId: string, + channelId: string, + paginationKey?: Uint8Array, + ) => Promise; + readonly packetAcknowledgement: ( + portId: string, + channelId: string, + sequence: number, + ) => Promise; + readonly packetAcknowledgements: ( + portId: string, + channelId: string, + paginationKey?: Uint8Array, + ) => Promise; + readonly unreceivedPackets: ( + portId: string, + channelId: string, + packetCommitmentSequences: readonly number[], + ) => Promise; + readonly unreceivedAcks: ( + portId: string, + channelId: string, + packetCommitmentSequences: readonly number[], + ) => Promise; + readonly nextSequenceReceive: ( + portId: string, + channelId: string, + ) => Promise; + readonly connection: (connectionId: string) => Promise; + readonly connections: (paginationKey?: Uint8Array) => Promise; + readonly clientConnections: (clientId: string) => Promise; + }; + }; +} +export declare function setupIbcExtension(base: QueryClient): IbcExtension; diff --git a/packages/stargate/build/queries/index.d.ts b/packages/stargate/build/queries/index.d.ts new file mode 100644 index 00000000..1958b382 --- /dev/null +++ b/packages/stargate/build/queries/index.d.ts @@ -0,0 +1,6 @@ +export { QueryClient } from "./queryclient"; +export { AuthExtension, setupAuthExtension } from "./auth"; +export { BankExtension, setupBankExtension } from "./bank"; +export { DistributionExtension, setupDistributionExtension } from "./distribution"; +export { IbcExtension, setupIbcExtension } from "./ibc"; +export { setupStakingExtension, StakingExtension } from "./staking"; diff --git a/packages/stargate/build/queries/queryclient.d.ts b/packages/stargate/build/queries/queryclient.d.ts new file mode 100644 index 00000000..c4af17ee --- /dev/null +++ b/packages/stargate/build/queries/queryclient.d.ts @@ -0,0 +1,110 @@ +import { Client as TendermintClient } from "@cosmjs/tendermint-rpc"; +declare type QueryExtensionSetup

= (base: QueryClient) => P; +export declare class QueryClient { + /** Constructs a QueryClient with 0 extensions */ + static withExtensions(tmClient: TendermintClient): QueryClient; + /** Constructs a QueryClient with 1 extension */ + static withExtensions( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + ): QueryClient & A; + /** Constructs a QueryClient with 2 extensions */ + static withExtensions( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + ): QueryClient & A & B; + /** Constructs a QueryClient with 3 extensions */ + static withExtensions( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + ): QueryClient & A & B & C; + /** Constructs a QueryClient with 4 extensions */ + static withExtensions( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + setupExtensionD: QueryExtensionSetup, + ): QueryClient & A & B & C & D; + /** Constructs a QueryClient with 5 extensions */ + static withExtensions< + A extends object, + B extends object, + C extends object, + D extends object, + E extends object + >( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + setupExtensionD: QueryExtensionSetup, + setupExtensionE: QueryExtensionSetup, + ): QueryClient & A & B & C & D & E; + /** Constructs a QueryClient with 6 extensions */ + static withExtensions< + A extends object, + B extends object, + C extends object, + D extends object, + E extends object, + F extends object + >( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + setupExtensionD: QueryExtensionSetup, + setupExtensionE: QueryExtensionSetup, + setupExtensionF: QueryExtensionSetup, + ): QueryClient & A & B & C & D & E & F; + /** Constructs a QueryClient with 7 extensions */ + static withExtensions< + A extends object, + B extends object, + C extends object, + D extends object, + E extends object, + F extends object, + G extends object + >( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + setupExtensionD: QueryExtensionSetup, + setupExtensionE: QueryExtensionSetup, + setupExtensionF: QueryExtensionSetup, + setupExtensionG: QueryExtensionSetup, + ): QueryClient & A & B & C & D & E & F & G; + /** Constructs a QueryClient with 8 extensions */ + static withExtensions< + A extends object, + B extends object, + C extends object, + D extends object, + E extends object, + F extends object, + G extends object, + H extends object + >( + tmClient: TendermintClient, + setupExtensionA: QueryExtensionSetup, + setupExtensionB: QueryExtensionSetup, + setupExtensionC: QueryExtensionSetup, + setupExtensionD: QueryExtensionSetup, + setupExtensionE: QueryExtensionSetup, + setupExtensionF: QueryExtensionSetup, + setupExtensionG: QueryExtensionSetup, + setupExtensionH: QueryExtensionSetup, + ): QueryClient & A & B & C & D & E & F & G & H; + private readonly tmClient; + constructor(tmClient: TendermintClient); + queryVerified(store: string, key: Uint8Array): Promise; + queryUnverified(path: string, request: Uint8Array): Promise; + private getNextHeader; +} +export {}; diff --git a/packages/stargate/build/queries/staking.d.ts b/packages/stargate/build/queries/staking.d.ts new file mode 100644 index 00000000..1706f751 --- /dev/null +++ b/packages/stargate/build/queries/staking.d.ts @@ -0,0 +1,66 @@ +import { + QueryDelegationResponse, + QueryDelegatorDelegationsResponse, + QueryDelegatorUnbondingDelegationsResponse, + QueryDelegatorValidatorResponse, + QueryDelegatorValidatorsResponse, + QueryHistoricalInfoResponse, + QueryParamsResponse, + QueryPoolResponse, + QueryRedelegationsResponse, + QueryUnbondingDelegationResponse, + QueryValidatorDelegationsResponse, + QueryValidatorResponse, + QueryValidatorsResponse, + QueryValidatorUnbondingDelegationsResponse, +} from "../codec/cosmos/staking/v1beta1/query"; +import { BondStatus } from "../codec/cosmos/staking/v1beta1/staking"; +import { QueryClient } from "./queryclient"; +export declare type BondStatusString = Exclude; +export interface StakingExtension { + readonly staking: { + readonly unverified: { + delegation: (delegatorAddress: string, validatorAddress: string) => Promise; + delegatorDelegations: ( + delegatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + delegatorUnbondingDelegations: ( + delegatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + delegatorValidator: ( + delegatorAddress: string, + validatorAddress: string, + ) => Promise; + delegatorValidators: ( + delegatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + historicalInfo: (height: number) => Promise; + params: () => Promise; + pool: () => Promise; + redelegations: ( + delegatorAddress: string, + sourceValidatorAddress: string, + destinationValidatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + unbondingDelegation: ( + delegatorAddress: string, + validatorAddress: string, + ) => Promise; + validator: (validatorAddress: string) => Promise; + validatorDelegations: ( + validatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + validators: (status: BondStatusString, paginationKey?: Uint8Array) => Promise; + validatorUnbondingDelegations: ( + validatorAddress: string, + paginationKey?: Uint8Array, + ) => Promise; + }; + }; +} +export declare function setupStakingExtension(base: QueryClient): StakingExtension; diff --git a/packages/stargate/build/queries/utils.d.ts b/packages/stargate/build/queries/utils.d.ts new file mode 100644 index 00000000..03fad06f --- /dev/null +++ b/packages/stargate/build/queries/utils.d.ts @@ -0,0 +1,20 @@ +import Long from "long"; +/** + * Takes a bech32 encoded address and returns the data part. The prefix is ignored and discarded. + * This is called AccAddress in Cosmos SDK, which is basically an alias for raw binary data. + * The result is typically 20 bytes long but not restricted to that. + */ +export declare function toAccAddress(address: string): Uint8Array; +/** + * Use this to convert a protobuf.js class to the interface (e.g. Coin to ICoin) + * in a ways that makes Jasmine's toEqual happy. + */ +export declare function toObject(thing: I): Omit; +export declare function createPagination( + paginationKey?: Uint8Array, +): { + readonly key: Uint8Array; + readonly offset: Long; + readonly limit: Long; + readonly countTotal: boolean; +}; diff --git a/packages/stargate/build/signingstargateclient.d.ts b/packages/stargate/build/signingstargateclient.d.ts new file mode 100644 index 00000000..7c5dd76b --- /dev/null +++ b/packages/stargate/build/signingstargateclient.d.ts @@ -0,0 +1,41 @@ +import { Coin, CosmosFeeTable, GasLimits, GasPrice, StdFee } from "@cosmjs/launchpad"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { AminoTypes } from "./aminotypes"; +import { BroadcastTxResponse, StargateClient } from "./stargateclient"; +export declare const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]>; +/** Use for testing only */ +export interface PrivateSigningStargateClient { + readonly fees: CosmosFeeTable; + readonly registry: Registry; +} +export interface SigningStargateClientOptions { + readonly registry?: Registry; + readonly aminoTypes?: AminoTypes; + readonly prefix?: string; + readonly gasPrice?: GasPrice; + readonly gasLimits?: GasLimits; +} +export declare class SigningStargateClient extends StargateClient { + private readonly fees; + private readonly registry; + private readonly signer; + private readonly aminoTypes; + static connectWithSigner( + endpoint: string, + signer: OfflineSigner, + options?: SigningStargateClientOptions, + ): Promise; + private constructor(); + sendTokens( + senderAddress: string, + recipientAddress: string, + transferAmount: readonly Coin[], + memo?: string, + ): Promise; + signAndBroadcast( + signerAddress: string, + messages: readonly EncodeObject[], + fee: StdFee, + memo?: string, + ): Promise; +} diff --git a/packages/stargate/build/stargateclient.d.ts b/packages/stargate/build/stargateclient.d.ts new file mode 100644 index 00000000..26c4a2c7 --- /dev/null +++ b/packages/stargate/build/stargateclient.d.ts @@ -0,0 +1,79 @@ +import { Block, PubKey, SearchTxFilter, SearchTxQuery } from "@cosmjs/launchpad"; +import { Client as TendermintClient } from "@cosmjs/tendermint-rpc"; +import { BaseAccount } from "./codec/cosmos/auth/v1beta1/auth"; +import { MsgData } from "./codec/cosmos/base/abci/v1beta1/abci"; +import { Coin } from "./codec/cosmos/base/v1beta1/coin"; +/** A transaction that is indexed as part of the transaction history */ +export interface IndexedTx { + readonly height: number; + /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ + readonly hash: string; + /** Transaction execution error code. 0 on success. */ + readonly code: number; + readonly rawLog: string; + readonly tx: Uint8Array; +} +export interface Account { + /** Bech32 account address */ + readonly address: string; + readonly pubkey: PubKey | null; + readonly accountNumber: number; + readonly sequence: number; +} +export interface SequenceResponse { + readonly accountNumber: number; + readonly sequence: number; +} +export interface BroadcastTxFailure { + readonly height: number; + readonly code: number; + readonly transactionHash: string; + readonly rawLog?: string; + readonly data?: readonly MsgData[]; +} +export interface BroadcastTxSuccess { + readonly height: number; + readonly transactionHash: string; + readonly rawLog?: string; + readonly data?: readonly MsgData[]; +} +export declare type BroadcastTxResponse = BroadcastTxSuccess | BroadcastTxFailure; +export declare function isBroadcastTxFailure(result: BroadcastTxResponse): result is BroadcastTxFailure; +export declare function isBroadcastTxSuccess(result: BroadcastTxResponse): result is BroadcastTxSuccess; +/** + * Ensures the given result is a success. Throws a detailed error message otherwise. + */ +export declare function assertIsBroadcastTxSuccess( + result: BroadcastTxResponse, +): asserts result is BroadcastTxSuccess; +export declare function accountFromProto(input: BaseAccount): Account; +export declare function coinFromProto(input: Coin): Coin; +/** Use for testing only */ +export interface PrivateStargateClient { + readonly tmClient: TendermintClient; +} +export declare class StargateClient { + private readonly tmClient; + private readonly queryClient; + private chainId; + static connect(endpoint: string): Promise; + protected constructor(tmClient: TendermintClient); + getChainId(): Promise; + getHeight(): Promise; + getAccount(searchAddress: string): Promise; + getSequence(address: string): Promise; + getBlock(height?: number): Promise; + getBalance(address: string, searchDenom: string): Promise; + /** + * Queries all balances for all denoms that belong to this address. + * + * Uses the grpc queries (which iterates over the store internally), and we cannot get + * proofs from such a method. + */ + getAllBalancesUnverified(address: string): Promise; + getTx(id: string): Promise; + searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise; + disconnect(): void; + broadcastTx(tx: Uint8Array): Promise; + private txsQuery; +}