diff --git a/packages/stargate/package.json b/packages/stargate/package.json index 26ed5950..d5ae9cf2 100644 --- a/packages/stargate/package.json +++ b/packages/stargate/package.json @@ -29,8 +29,8 @@ "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts && shx rm ./types/**/*.spec.d.ts", "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", "prebuild": "shx rm -rf ./build", - "build": "tsc && shx mkdir -p build/generated && shx cp ./src/generated/*.js ./build/generated && shx mkdir -p ./build/types/generated && shx cp ./src/generated/*.d.ts ./build/types/generated", - "postbuild": "yarn move-types && yarn format-types", + "build": "tsc && shx mkdir -p build/codec/generated && shx cp ./src/codec/generated/*.js ./build/codec/generated", + "postbuild": "shx mkdir -p ./build/types/codec/generated && shx cp ./src/codec/generated/*.d.ts ./build/types/codec/generated && yarn move-types && yarn format-types", "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", "test-node": "node jasmine-testrunner.js", "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox", diff --git a/packages/stargate/scripts/predefine-proto.sh b/packages/stargate/scripts/predefine-proto.sh index 86a1a8de..3bc39794 100755 --- a/packages/stargate/scripts/predefine-proto.sh +++ b/packages/stargate/scripts/predefine-proto.sh @@ -19,6 +19,7 @@ yarn pbjs \ --no-delimited \ --no-verify \ --no-convert \ + --force-long \ "$COSMOS_PROTO_DIR/cosmos.proto" \ "$COSMOS_PROTO_DIR/auth/{auth,query}.proto" \ "$COSMOS_PROTO_DIR/bank/{bank,query}.proto" \ diff --git a/packages/stargate/src/generated/codecimpl.d.ts b/packages/stargate/src/codec/generated/codecimpl.d.ts similarity index 98% rename from packages/stargate/src/generated/codecimpl.d.ts rename to packages/stargate/src/codec/generated/codecimpl.d.ts index 627c179e..43c0b29b 100644 --- a/packages/stargate/src/generated/codecimpl.d.ts +++ b/packages/stargate/src/codec/generated/codecimpl.d.ts @@ -231,10 +231,10 @@ export namespace cosmos { /** Properties of a GasInfo. */ interface IGasInfo { /** GasInfo gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** GasInfo gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; } /** Represents a GasInfo. */ @@ -246,10 +246,10 @@ export namespace cosmos { constructor(p?: cosmos.IGasInfo); /** GasInfo gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** GasInfo gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** * Creates a new GasInfo instance using the specified properties. @@ -476,7 +476,7 @@ export namespace cosmos { /** Properties of a TxResponse. */ interface ITxResponse { /** TxResponse height */ - height?: number | Long | null; + height?: Long | null; /** TxResponse txhash */ txhash?: string | null; @@ -500,10 +500,10 @@ export namespace cosmos { info?: string | null; /** TxResponse gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** TxResponse gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** TxResponse tx */ tx?: google.protobuf.IAny | null; @@ -521,7 +521,7 @@ export namespace cosmos { constructor(p?: cosmos.ITxResponse); /** TxResponse height. */ - public height: number | Long; + public height: Long; /** TxResponse txhash. */ public txhash: string; @@ -545,10 +545,10 @@ export namespace cosmos { public info: string; /** TxResponse gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** TxResponse gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** TxResponse tx. */ public tx?: google.protobuf.IAny | null; @@ -746,10 +746,10 @@ export namespace cosmos { pubKey?: Uint8Array | null; /** BaseAccount accountNumber */ - accountNumber?: number | Long | null; + accountNumber?: Long | null; /** BaseAccount sequence */ - sequence?: number | Long | null; + sequence?: Long | null; } /** Represents a BaseAccount. */ @@ -767,10 +767,10 @@ export namespace cosmos { public pubKey: Uint8Array; /** BaseAccount accountNumber. */ - public accountNumber: number | Long; + public accountNumber: Long; /** BaseAccount sequence. */ - public sequence: number | Long; + public sequence: Long; /** * Creates a new BaseAccount instance using the specified properties. @@ -856,19 +856,19 @@ export namespace cosmos { /** Properties of a Params. */ interface IParams { /** Params maxMemoCharacters */ - maxMemoCharacters?: number | Long | null; + maxMemoCharacters?: Long | null; /** Params txSigLimit */ - txSigLimit?: number | Long | null; + txSigLimit?: Long | null; /** Params txSizeCostPerByte */ - txSizeCostPerByte?: number | Long | null; + txSizeCostPerByte?: Long | null; /** Params sigVerifyCostEd25519 */ - sigVerifyCostEd25519?: number | Long | null; + sigVerifyCostEd25519?: Long | null; /** Params sigVerifyCostSecp256k1 */ - sigVerifyCostSecp256k1?: number | Long | null; + sigVerifyCostSecp256k1?: Long | null; } /** Represents a Params. */ @@ -880,19 +880,19 @@ export namespace cosmos { constructor(p?: cosmos.auth.IParams); /** Params maxMemoCharacters. */ - public maxMemoCharacters: number | Long; + public maxMemoCharacters: Long; /** Params txSigLimit. */ - public txSigLimit: number | Long; + public txSigLimit: Long; /** Params txSizeCostPerByte. */ - public txSizeCostPerByte: number | Long; + public txSizeCostPerByte: Long; /** Params sigVerifyCostEd25519. */ - public sigVerifyCostEd25519: number | Long; + public sigVerifyCostEd25519: Long; /** Params sigVerifyCostSecp256k1. */ - public sigVerifyCostSecp256k1: number | Long; + public sigVerifyCostSecp256k1: Long; /** * Creates a new Params instance using the specified properties. @@ -2360,10 +2360,10 @@ export namespace cosmos { key?: Uint8Array | null; /** PageRequest offset */ - offset?: number | Long | null; + offset?: Long | null; /** PageRequest limit */ - limit?: number | Long | null; + limit?: Long | null; /** PageRequest countTotal */ countTotal?: boolean | null; @@ -2381,10 +2381,10 @@ export namespace cosmos { public key: Uint8Array; /** PageRequest offset. */ - public offset: number | Long; + public offset: Long; /** PageRequest limit. */ - public limit: number | Long; + public limit: Long; /** PageRequest countTotal. */ public countTotal: boolean; @@ -2421,7 +2421,7 @@ export namespace cosmos { nextKey?: Uint8Array | null; /** PageResponse total */ - total?: number | Long | null; + total?: Long | null; } /** Represents a PageResponse. */ @@ -2436,7 +2436,7 @@ export namespace cosmos { public nextKey: Uint8Array; /** PageResponse total. */ - public total: number | Long; + public total: Long; /** * Creates a new PageResponse instance using the specified properties. @@ -2589,10 +2589,10 @@ export namespace cosmos { chainId?: string | null; /** SignDoc accountNumber */ - accountNumber?: number | Long | null; + accountNumber?: Long | null; /** SignDoc accountSequence */ - accountSequence?: number | Long | null; + accountSequence?: Long | null; } /** Represents a SignDoc. */ @@ -2613,10 +2613,10 @@ export namespace cosmos { public chainId: string; /** SignDoc accountNumber. */ - public accountNumber: number | Long; + public accountNumber: Long; /** SignDoc accountSequence. */ - public accountSequence: number | Long; + public accountSequence: Long; /** * Creates a new SignDoc instance using the specified properties. @@ -2653,7 +2653,7 @@ export namespace cosmos { memo?: string | null; /** TxBody timeoutHeight */ - timeoutHeight?: number | Long | null; + timeoutHeight?: Long | null; /** TxBody extensionOptions */ extensionOptions?: google.protobuf.IAny[] | null; @@ -2677,7 +2677,7 @@ export namespace cosmos { public memo: string; /** TxBody timeoutHeight. */ - public timeoutHeight: number | Long; + public timeoutHeight: Long; /** TxBody extensionOptions. */ public extensionOptions: google.protobuf.IAny[]; @@ -2961,7 +2961,7 @@ export namespace cosmos { amount?: cosmos.ICoin[] | null; /** Fee gasLimit */ - gasLimit?: number | Long | null; + gasLimit?: Long | null; } /** Represents a Fee. */ @@ -2976,7 +2976,7 @@ export namespace cosmos { public amount: cosmos.ICoin[]; /** Fee gasLimit. */ - public gasLimit: number | Long; + public gasLimit: Long; /** * Creates a new Fee instance using the specified properties. @@ -3519,10 +3519,10 @@ export namespace tendermint { version?: string | null; /** RequestInfo blockVersion */ - blockVersion?: number | Long | null; + blockVersion?: Long | null; /** RequestInfo p2pVersion */ - p2pVersion?: number | Long | null; + p2pVersion?: Long | null; } /** Represents a RequestInfo. */ @@ -3537,10 +3537,10 @@ export namespace tendermint { public version: string; /** RequestInfo blockVersion. */ - public blockVersion: number | Long; + public blockVersion: Long; /** RequestInfo p2pVersion. */ - public p2pVersion: number | Long; + public p2pVersion: Long; /** * Creates a new RequestInfo instance using the specified properties. @@ -3711,7 +3711,7 @@ export namespace tendermint { path?: string | null; /** RequestQuery height */ - height?: number | Long | null; + height?: Long | null; /** RequestQuery prove */ prove?: boolean | null; @@ -3732,7 +3732,7 @@ export namespace tendermint { public path: string; /** RequestQuery height. */ - public height: number | Long; + public height: Long; /** RequestQuery prove. */ public prove: boolean; @@ -3954,7 +3954,7 @@ export namespace tendermint { /** Properties of a RequestEndBlock. */ interface IRequestEndBlock { /** RequestEndBlock height */ - height?: number | Long | null; + height?: Long | null; } /** Represents a RequestEndBlock. */ @@ -3966,7 +3966,7 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IRequestEndBlock); /** RequestEndBlock height. */ - public height: number | Long; + public height: Long; /** * Creates a new RequestEndBlock instance using the specified properties. @@ -4318,10 +4318,10 @@ export namespace tendermint { version?: string | null; /** ResponseInfo appVersion */ - appVersion?: number | Long | null; + appVersion?: Long | null; /** ResponseInfo lastBlockHeight */ - lastBlockHeight?: number | Long | null; + lastBlockHeight?: Long | null; /** ResponseInfo lastBlockAppHash */ lastBlockAppHash?: Uint8Array | null; @@ -4342,10 +4342,10 @@ export namespace tendermint { public version: string; /** ResponseInfo appVersion. */ - public appVersion: number | Long; + public appVersion: Long; /** ResponseInfo lastBlockHeight. */ - public lastBlockHeight: number | Long; + public lastBlockHeight: Long; /** ResponseInfo lastBlockAppHash. */ public lastBlockAppHash: Uint8Array; @@ -4513,7 +4513,7 @@ export namespace tendermint { info?: string | null; /** ResponseQuery index */ - index?: number | Long | null; + index?: Long | null; /** ResponseQuery key */ key?: Uint8Array | null; @@ -4525,7 +4525,7 @@ export namespace tendermint { proof?: tendermint.crypto.merkle.IProof | null; /** ResponseQuery height */ - height?: number | Long | null; + height?: Long | null; /** ResponseQuery codespace */ codespace?: string | null; @@ -4549,7 +4549,7 @@ export namespace tendermint { public info: string; /** ResponseQuery index. */ - public index: number | Long; + public index: Long; /** ResponseQuery key. */ public key: Uint8Array; @@ -4561,7 +4561,7 @@ export namespace tendermint { public proof?: tendermint.crypto.merkle.IProof | null; /** ResponseQuery height. */ - public height: number | Long; + public height: Long; /** ResponseQuery codespace. */ public codespace: string; @@ -4663,10 +4663,10 @@ export namespace tendermint { info?: string | null; /** ResponseCheckTx gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** ResponseCheckTx gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** ResponseCheckTx events */ events?: tendermint.abci.types.IEvent[] | null; @@ -4696,10 +4696,10 @@ export namespace tendermint { public info: string; /** ResponseCheckTx gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** ResponseCheckTx gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** ResponseCheckTx events. */ public events: tendermint.abci.types.IEvent[]; @@ -4756,10 +4756,10 @@ export namespace tendermint { info?: string | null; /** ResponseDeliverTx gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** ResponseDeliverTx gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** ResponseDeliverTx events */ events?: tendermint.abci.types.IEvent[] | null; @@ -4789,10 +4789,10 @@ export namespace tendermint { public info: string; /** ResponseDeliverTx gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** ResponseDeliverTx gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** ResponseDeliverTx events. */ public events: tendermint.abci.types.IEvent[]; @@ -5014,10 +5014,10 @@ export namespace tendermint { /** Properties of a BlockParams. */ interface IBlockParams { /** BlockParams maxBytes */ - maxBytes?: number | Long | null; + maxBytes?: Long | null; /** BlockParams maxGas */ - maxGas?: number | Long | null; + maxGas?: Long | null; } /** Represents a BlockParams. */ @@ -5029,10 +5029,10 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IBlockParams); /** BlockParams maxBytes. */ - public maxBytes: number | Long; + public maxBytes: Long; /** BlockParams maxGas. */ - public maxGas: number | Long; + public maxGas: Long; /** * Creates a new BlockParams instance using the specified properties. @@ -5065,7 +5065,7 @@ export namespace tendermint { /** Properties of an EvidenceParams. */ interface IEvidenceParams { /** EvidenceParams maxAgeNumBlocks */ - maxAgeNumBlocks?: number | Long | null; + maxAgeNumBlocks?: Long | null; /** EvidenceParams maxAgeDuration */ maxAgeDuration?: google.protobuf.IDuration | null; @@ -5080,7 +5080,7 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IEvidenceParams); /** EvidenceParams maxAgeNumBlocks. */ - public maxAgeNumBlocks: number | Long; + public maxAgeNumBlocks: Long; /** EvidenceParams maxAgeDuration. */ public maxAgeDuration?: google.protobuf.IDuration | null; @@ -5285,7 +5285,7 @@ export namespace tendermint { chainId?: string | null; /** Header height */ - height?: number | Long | null; + height?: Long | null; /** Header time */ time?: google.protobuf.ITimestamp | null; @@ -5336,7 +5336,7 @@ export namespace tendermint { public chainId: string; /** Header height. */ - public height: number | Long; + public height: Long; /** Header time. */ public time?: google.protobuf.ITimestamp | null; @@ -5400,10 +5400,10 @@ export namespace tendermint { /** Properties of a Version. */ interface IVersion { /** Version Block */ - Block?: number | Long | null; + Block?: Long | null; /** Version App */ - App?: number | Long | null; + App?: Long | null; } /** Represents a Version. */ @@ -5415,10 +5415,10 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IVersion); /** Version Block. */ - public Block: number | Long; + public Block: Long; /** Version App. */ - public App: number | Long; + public App: Long; /** * Creates a new Version instance using the specified properties. @@ -5555,7 +5555,7 @@ export namespace tendermint { address?: Uint8Array | null; /** Validator power */ - power?: number | Long | null; + power?: Long | null; } /** Represents a Validator. */ @@ -5570,7 +5570,7 @@ export namespace tendermint { public address: Uint8Array; /** Validator power. */ - public power: number | Long; + public power: Long; /** * Creates a new Validator instance using the specified properties. @@ -5604,7 +5604,7 @@ export namespace tendermint { pubKey?: tendermint.abci.types.IPubKey | null; /** ValidatorUpdate power */ - power?: number | Long | null; + power?: Long | null; } /** Represents a ValidatorUpdate. */ @@ -5619,7 +5619,7 @@ export namespace tendermint { public pubKey?: tendermint.abci.types.IPubKey | null; /** ValidatorUpdate power. */ - public power: number | Long; + public power: Long; /** * Creates a new ValidatorUpdate instance using the specified properties. @@ -5762,13 +5762,13 @@ export namespace tendermint { validator?: tendermint.abci.types.IValidator | null; /** Evidence height */ - height?: number | Long | null; + height?: Long | null; /** Evidence time */ time?: google.protobuf.ITimestamp | null; /** Evidence totalVotingPower */ - totalVotingPower?: number | Long | null; + totalVotingPower?: Long | null; } /** Represents an Evidence. */ @@ -5786,13 +5786,13 @@ export namespace tendermint { public validator?: tendermint.abci.types.IValidator | null; /** Evidence height. */ - public height: number | Long; + public height: Long; /** Evidence time. */ public time?: google.protobuf.ITimestamp | null; /** Evidence totalVotingPower. */ - public totalVotingPower: number | Long; + public totalVotingPower: Long; /** * Creates a new Evidence instance using the specified properties. @@ -6313,7 +6313,7 @@ export namespace tendermint { key?: Uint8Array | null; /** KI64Pair value */ - value?: number | Long | null; + value?: Long | null; } /** Represents a KI64Pair. */ @@ -6328,7 +6328,7 @@ export namespace tendermint { public key: Uint8Array; /** KI64Pair value. */ - public value: number | Long; + public value: Long; /** * Creates a new KI64Pair instance using the specified properties. @@ -6415,7 +6415,7 @@ export namespace google { /** Properties of a Timestamp. */ interface ITimestamp { /** Timestamp seconds */ - seconds?: number | Long | null; + seconds?: Long | null; /** Timestamp nanos */ nanos?: number | null; @@ -6430,7 +6430,7 @@ export namespace google { constructor(p?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: number | Long; + public seconds: Long; /** Timestamp nanos. */ public nanos: number; @@ -6464,7 +6464,7 @@ export namespace google { /** Properties of a Duration. */ interface IDuration { /** Duration seconds */ - seconds?: number | Long | null; + seconds?: Long | null; /** Duration nanos */ nanos?: number | null; @@ -6479,7 +6479,7 @@ export namespace google { constructor(p?: google.protobuf.IDuration); /** Duration seconds. */ - public seconds: number | Long; + public seconds: Long; /** Duration nanos. */ public nanos: number; diff --git a/packages/stargate/src/generated/codecimpl.js b/packages/stargate/src/codec/generated/codecimpl.js similarity index 100% rename from packages/stargate/src/generated/codecimpl.js rename to packages/stargate/src/codec/generated/codecimpl.js diff --git a/packages/stargate/src/codec/index.ts b/packages/stargate/src/codec/index.ts new file mode 100644 index 00000000..e27bfc7e --- /dev/null +++ b/packages/stargate/src/codec/index.ts @@ -0,0 +1,9 @@ +import Long from "long"; +import protobuf from "protobufjs/minimal"; + +// Ensure the protobuf module has a Long implementation, which otherwise only works +// in Node.js (see https://github.com/protobufjs/protobuf.js/issues/921#issuecomment-334925145) +protobuf.util.Long = Long; +protobuf.configure(); + +export * from "./generated/codecimpl"; diff --git a/packages/stargate/src/queries/auth.spec.ts b/packages/stargate/src/queries/auth.spec.ts index 4befcb65..bab4270f 100644 --- a/packages/stargate/src/queries/auth.spec.ts +++ b/packages/stargate/src/queries/auth.spec.ts @@ -22,6 +22,7 @@ describe("AuthExtension", () => { const account = await client.auth.account(unused.address); assert(account); + expect(account).toEqual({ address: toAccAddress(unused.address), // pubKey not set diff --git a/packages/stargate/src/queries/auth.ts b/packages/stargate/src/queries/auth.ts index fbc4c470..aeffb54c 100644 --- a/packages/stargate/src/queries/auth.ts +++ b/packages/stargate/src/queries/auth.ts @@ -1,6 +1,6 @@ import { assert } from "@cosmjs/utils"; -import { cosmos, google } from "../generated/codecimpl"; +import { cosmos, google } from "../codec"; import { QueryClient } from "./queryclient"; import { toAccAddress, toObject } from "./utils"; diff --git a/packages/stargate/src/queries/bank.ts b/packages/stargate/src/queries/bank.ts index 6f6c3a93..6b85cb8f 100644 --- a/packages/stargate/src/queries/bank.ts +++ b/packages/stargate/src/queries/bank.ts @@ -1,7 +1,7 @@ import { toAscii } from "@cosmjs/encoding"; import { assert } from "@cosmjs/utils"; -import { cosmos } from "../generated/codecimpl"; +import { cosmos } from "../codec"; import { QueryClient } from "./queryclient"; import { toAccAddress, toObject } from "./utils"; diff --git a/packages/stargate/src/stargateclient.searchtx.spec.ts b/packages/stargate/src/stargateclient.searchtx.spec.ts index 1f10a41b..855fcf73 100644 --- a/packages/stargate/src/stargateclient.searchtx.spec.ts +++ b/packages/stargate/src/stargateclient.searchtx.spec.ts @@ -3,8 +3,9 @@ import { Bech32, fromBase64 } from "@cosmjs/encoding"; import { Coin, coins, Secp256k1Wallet } from "@cosmjs/launchpad"; import { makeSignBytes, omitDefaults, Registry } from "@cosmjs/proto-signing"; import { assert } from "@cosmjs/utils"; +import Long from "long"; -import { cosmos } from "./generated/codecimpl"; +import { cosmos } from "./codec"; import { BroadcastTxResponse, isBroadcastTxFailure, @@ -68,7 +69,7 @@ async function sendTokens( }, ], fee: { - gasLimit: 200000, + gasLimit: Long.fromNumber(200000), }, }; const authInfoBytes = Uint8Array.from(AuthInfo.encode(authInfo).finish()); diff --git a/packages/stargate/src/stargateclient.spec.ts b/packages/stargate/src/stargateclient.spec.ts index a4bf8c4b..130edc2f 100644 --- a/packages/stargate/src/stargateclient.spec.ts +++ b/packages/stargate/src/stargateclient.spec.ts @@ -3,9 +3,10 @@ import { Bech32, fromBase64 } from "@cosmjs/encoding"; import { Secp256k1Wallet } from "@cosmjs/launchpad"; import { makeSignBytes, omitDefaults, Registry } from "@cosmjs/proto-signing"; import { assert, sleep } from "@cosmjs/utils"; +import Long from "long"; import { ReadonlyDate } from "readonly-date"; -import { cosmos } from "./generated/codecimpl"; +import { cosmos } from "./codec"; import { assertIsBroadcastTxSuccess, PrivateStargateClient, StargateClient } from "./stargateclient"; import { faucet, @@ -290,7 +291,7 @@ describe("StargateClient", () => { }, ], fee: { - gasLimit: 200000, + gasLimit: Long.fromNumber(200000), }, }; const authInfoBytes = Uint8Array.from(AuthInfo.encode(authInfo).finish()); diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index 03a89048..447a87bf 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -15,7 +15,7 @@ import { broadcastTxCommitSuccess, Client as TendermintClient, QueryString } fro import { assert, assertDefined } from "@cosmjs/utils"; import Long from "long"; -import { cosmos } from "./generated/codecimpl"; +import { cosmos } from "./codec"; import { AuthExtension, BankExtension, QueryClient, setupAuthExtension, setupBankExtension } from "./queries"; /** A transaction that is indexed as part of the transaction history */ diff --git a/packages/stargate/types/generated/codecimpl.d.ts b/packages/stargate/types/codec/generated/codecimpl.d.ts similarity index 98% rename from packages/stargate/types/generated/codecimpl.d.ts rename to packages/stargate/types/codec/generated/codecimpl.d.ts index 627c179e..43c0b29b 100644 --- a/packages/stargate/types/generated/codecimpl.d.ts +++ b/packages/stargate/types/codec/generated/codecimpl.d.ts @@ -231,10 +231,10 @@ export namespace cosmos { /** Properties of a GasInfo. */ interface IGasInfo { /** GasInfo gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** GasInfo gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; } /** Represents a GasInfo. */ @@ -246,10 +246,10 @@ export namespace cosmos { constructor(p?: cosmos.IGasInfo); /** GasInfo gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** GasInfo gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** * Creates a new GasInfo instance using the specified properties. @@ -476,7 +476,7 @@ export namespace cosmos { /** Properties of a TxResponse. */ interface ITxResponse { /** TxResponse height */ - height?: number | Long | null; + height?: Long | null; /** TxResponse txhash */ txhash?: string | null; @@ -500,10 +500,10 @@ export namespace cosmos { info?: string | null; /** TxResponse gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** TxResponse gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** TxResponse tx */ tx?: google.protobuf.IAny | null; @@ -521,7 +521,7 @@ export namespace cosmos { constructor(p?: cosmos.ITxResponse); /** TxResponse height. */ - public height: number | Long; + public height: Long; /** TxResponse txhash. */ public txhash: string; @@ -545,10 +545,10 @@ export namespace cosmos { public info: string; /** TxResponse gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** TxResponse gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** TxResponse tx. */ public tx?: google.protobuf.IAny | null; @@ -746,10 +746,10 @@ export namespace cosmos { pubKey?: Uint8Array | null; /** BaseAccount accountNumber */ - accountNumber?: number | Long | null; + accountNumber?: Long | null; /** BaseAccount sequence */ - sequence?: number | Long | null; + sequence?: Long | null; } /** Represents a BaseAccount. */ @@ -767,10 +767,10 @@ export namespace cosmos { public pubKey: Uint8Array; /** BaseAccount accountNumber. */ - public accountNumber: number | Long; + public accountNumber: Long; /** BaseAccount sequence. */ - public sequence: number | Long; + public sequence: Long; /** * Creates a new BaseAccount instance using the specified properties. @@ -856,19 +856,19 @@ export namespace cosmos { /** Properties of a Params. */ interface IParams { /** Params maxMemoCharacters */ - maxMemoCharacters?: number | Long | null; + maxMemoCharacters?: Long | null; /** Params txSigLimit */ - txSigLimit?: number | Long | null; + txSigLimit?: Long | null; /** Params txSizeCostPerByte */ - txSizeCostPerByte?: number | Long | null; + txSizeCostPerByte?: Long | null; /** Params sigVerifyCostEd25519 */ - sigVerifyCostEd25519?: number | Long | null; + sigVerifyCostEd25519?: Long | null; /** Params sigVerifyCostSecp256k1 */ - sigVerifyCostSecp256k1?: number | Long | null; + sigVerifyCostSecp256k1?: Long | null; } /** Represents a Params. */ @@ -880,19 +880,19 @@ export namespace cosmos { constructor(p?: cosmos.auth.IParams); /** Params maxMemoCharacters. */ - public maxMemoCharacters: number | Long; + public maxMemoCharacters: Long; /** Params txSigLimit. */ - public txSigLimit: number | Long; + public txSigLimit: Long; /** Params txSizeCostPerByte. */ - public txSizeCostPerByte: number | Long; + public txSizeCostPerByte: Long; /** Params sigVerifyCostEd25519. */ - public sigVerifyCostEd25519: number | Long; + public sigVerifyCostEd25519: Long; /** Params sigVerifyCostSecp256k1. */ - public sigVerifyCostSecp256k1: number | Long; + public sigVerifyCostSecp256k1: Long; /** * Creates a new Params instance using the specified properties. @@ -2360,10 +2360,10 @@ export namespace cosmos { key?: Uint8Array | null; /** PageRequest offset */ - offset?: number | Long | null; + offset?: Long | null; /** PageRequest limit */ - limit?: number | Long | null; + limit?: Long | null; /** PageRequest countTotal */ countTotal?: boolean | null; @@ -2381,10 +2381,10 @@ export namespace cosmos { public key: Uint8Array; /** PageRequest offset. */ - public offset: number | Long; + public offset: Long; /** PageRequest limit. */ - public limit: number | Long; + public limit: Long; /** PageRequest countTotal. */ public countTotal: boolean; @@ -2421,7 +2421,7 @@ export namespace cosmos { nextKey?: Uint8Array | null; /** PageResponse total */ - total?: number | Long | null; + total?: Long | null; } /** Represents a PageResponse. */ @@ -2436,7 +2436,7 @@ export namespace cosmos { public nextKey: Uint8Array; /** PageResponse total. */ - public total: number | Long; + public total: Long; /** * Creates a new PageResponse instance using the specified properties. @@ -2589,10 +2589,10 @@ export namespace cosmos { chainId?: string | null; /** SignDoc accountNumber */ - accountNumber?: number | Long | null; + accountNumber?: Long | null; /** SignDoc accountSequence */ - accountSequence?: number | Long | null; + accountSequence?: Long | null; } /** Represents a SignDoc. */ @@ -2613,10 +2613,10 @@ export namespace cosmos { public chainId: string; /** SignDoc accountNumber. */ - public accountNumber: number | Long; + public accountNumber: Long; /** SignDoc accountSequence. */ - public accountSequence: number | Long; + public accountSequence: Long; /** * Creates a new SignDoc instance using the specified properties. @@ -2653,7 +2653,7 @@ export namespace cosmos { memo?: string | null; /** TxBody timeoutHeight */ - timeoutHeight?: number | Long | null; + timeoutHeight?: Long | null; /** TxBody extensionOptions */ extensionOptions?: google.protobuf.IAny[] | null; @@ -2677,7 +2677,7 @@ export namespace cosmos { public memo: string; /** TxBody timeoutHeight. */ - public timeoutHeight: number | Long; + public timeoutHeight: Long; /** TxBody extensionOptions. */ public extensionOptions: google.protobuf.IAny[]; @@ -2961,7 +2961,7 @@ export namespace cosmos { amount?: cosmos.ICoin[] | null; /** Fee gasLimit */ - gasLimit?: number | Long | null; + gasLimit?: Long | null; } /** Represents a Fee. */ @@ -2976,7 +2976,7 @@ export namespace cosmos { public amount: cosmos.ICoin[]; /** Fee gasLimit. */ - public gasLimit: number | Long; + public gasLimit: Long; /** * Creates a new Fee instance using the specified properties. @@ -3519,10 +3519,10 @@ export namespace tendermint { version?: string | null; /** RequestInfo blockVersion */ - blockVersion?: number | Long | null; + blockVersion?: Long | null; /** RequestInfo p2pVersion */ - p2pVersion?: number | Long | null; + p2pVersion?: Long | null; } /** Represents a RequestInfo. */ @@ -3537,10 +3537,10 @@ export namespace tendermint { public version: string; /** RequestInfo blockVersion. */ - public blockVersion: number | Long; + public blockVersion: Long; /** RequestInfo p2pVersion. */ - public p2pVersion: number | Long; + public p2pVersion: Long; /** * Creates a new RequestInfo instance using the specified properties. @@ -3711,7 +3711,7 @@ export namespace tendermint { path?: string | null; /** RequestQuery height */ - height?: number | Long | null; + height?: Long | null; /** RequestQuery prove */ prove?: boolean | null; @@ -3732,7 +3732,7 @@ export namespace tendermint { public path: string; /** RequestQuery height. */ - public height: number | Long; + public height: Long; /** RequestQuery prove. */ public prove: boolean; @@ -3954,7 +3954,7 @@ export namespace tendermint { /** Properties of a RequestEndBlock. */ interface IRequestEndBlock { /** RequestEndBlock height */ - height?: number | Long | null; + height?: Long | null; } /** Represents a RequestEndBlock. */ @@ -3966,7 +3966,7 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IRequestEndBlock); /** RequestEndBlock height. */ - public height: number | Long; + public height: Long; /** * Creates a new RequestEndBlock instance using the specified properties. @@ -4318,10 +4318,10 @@ export namespace tendermint { version?: string | null; /** ResponseInfo appVersion */ - appVersion?: number | Long | null; + appVersion?: Long | null; /** ResponseInfo lastBlockHeight */ - lastBlockHeight?: number | Long | null; + lastBlockHeight?: Long | null; /** ResponseInfo lastBlockAppHash */ lastBlockAppHash?: Uint8Array | null; @@ -4342,10 +4342,10 @@ export namespace tendermint { public version: string; /** ResponseInfo appVersion. */ - public appVersion: number | Long; + public appVersion: Long; /** ResponseInfo lastBlockHeight. */ - public lastBlockHeight: number | Long; + public lastBlockHeight: Long; /** ResponseInfo lastBlockAppHash. */ public lastBlockAppHash: Uint8Array; @@ -4513,7 +4513,7 @@ export namespace tendermint { info?: string | null; /** ResponseQuery index */ - index?: number | Long | null; + index?: Long | null; /** ResponseQuery key */ key?: Uint8Array | null; @@ -4525,7 +4525,7 @@ export namespace tendermint { proof?: tendermint.crypto.merkle.IProof | null; /** ResponseQuery height */ - height?: number | Long | null; + height?: Long | null; /** ResponseQuery codespace */ codespace?: string | null; @@ -4549,7 +4549,7 @@ export namespace tendermint { public info: string; /** ResponseQuery index. */ - public index: number | Long; + public index: Long; /** ResponseQuery key. */ public key: Uint8Array; @@ -4561,7 +4561,7 @@ export namespace tendermint { public proof?: tendermint.crypto.merkle.IProof | null; /** ResponseQuery height. */ - public height: number | Long; + public height: Long; /** ResponseQuery codespace. */ public codespace: string; @@ -4663,10 +4663,10 @@ export namespace tendermint { info?: string | null; /** ResponseCheckTx gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** ResponseCheckTx gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** ResponseCheckTx events */ events?: tendermint.abci.types.IEvent[] | null; @@ -4696,10 +4696,10 @@ export namespace tendermint { public info: string; /** ResponseCheckTx gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** ResponseCheckTx gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** ResponseCheckTx events. */ public events: tendermint.abci.types.IEvent[]; @@ -4756,10 +4756,10 @@ export namespace tendermint { info?: string | null; /** ResponseDeliverTx gasWanted */ - gasWanted?: number | Long | null; + gasWanted?: Long | null; /** ResponseDeliverTx gasUsed */ - gasUsed?: number | Long | null; + gasUsed?: Long | null; /** ResponseDeliverTx events */ events?: tendermint.abci.types.IEvent[] | null; @@ -4789,10 +4789,10 @@ export namespace tendermint { public info: string; /** ResponseDeliverTx gasWanted. */ - public gasWanted: number | Long; + public gasWanted: Long; /** ResponseDeliverTx gasUsed. */ - public gasUsed: number | Long; + public gasUsed: Long; /** ResponseDeliverTx events. */ public events: tendermint.abci.types.IEvent[]; @@ -5014,10 +5014,10 @@ export namespace tendermint { /** Properties of a BlockParams. */ interface IBlockParams { /** BlockParams maxBytes */ - maxBytes?: number | Long | null; + maxBytes?: Long | null; /** BlockParams maxGas */ - maxGas?: number | Long | null; + maxGas?: Long | null; } /** Represents a BlockParams. */ @@ -5029,10 +5029,10 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IBlockParams); /** BlockParams maxBytes. */ - public maxBytes: number | Long; + public maxBytes: Long; /** BlockParams maxGas. */ - public maxGas: number | Long; + public maxGas: Long; /** * Creates a new BlockParams instance using the specified properties. @@ -5065,7 +5065,7 @@ export namespace tendermint { /** Properties of an EvidenceParams. */ interface IEvidenceParams { /** EvidenceParams maxAgeNumBlocks */ - maxAgeNumBlocks?: number | Long | null; + maxAgeNumBlocks?: Long | null; /** EvidenceParams maxAgeDuration */ maxAgeDuration?: google.protobuf.IDuration | null; @@ -5080,7 +5080,7 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IEvidenceParams); /** EvidenceParams maxAgeNumBlocks. */ - public maxAgeNumBlocks: number | Long; + public maxAgeNumBlocks: Long; /** EvidenceParams maxAgeDuration. */ public maxAgeDuration?: google.protobuf.IDuration | null; @@ -5285,7 +5285,7 @@ export namespace tendermint { chainId?: string | null; /** Header height */ - height?: number | Long | null; + height?: Long | null; /** Header time */ time?: google.protobuf.ITimestamp | null; @@ -5336,7 +5336,7 @@ export namespace tendermint { public chainId: string; /** Header height. */ - public height: number | Long; + public height: Long; /** Header time. */ public time?: google.protobuf.ITimestamp | null; @@ -5400,10 +5400,10 @@ export namespace tendermint { /** Properties of a Version. */ interface IVersion { /** Version Block */ - Block?: number | Long | null; + Block?: Long | null; /** Version App */ - App?: number | Long | null; + App?: Long | null; } /** Represents a Version. */ @@ -5415,10 +5415,10 @@ export namespace tendermint { constructor(p?: tendermint.abci.types.IVersion); /** Version Block. */ - public Block: number | Long; + public Block: Long; /** Version App. */ - public App: number | Long; + public App: Long; /** * Creates a new Version instance using the specified properties. @@ -5555,7 +5555,7 @@ export namespace tendermint { address?: Uint8Array | null; /** Validator power */ - power?: number | Long | null; + power?: Long | null; } /** Represents a Validator. */ @@ -5570,7 +5570,7 @@ export namespace tendermint { public address: Uint8Array; /** Validator power. */ - public power: number | Long; + public power: Long; /** * Creates a new Validator instance using the specified properties. @@ -5604,7 +5604,7 @@ export namespace tendermint { pubKey?: tendermint.abci.types.IPubKey | null; /** ValidatorUpdate power */ - power?: number | Long | null; + power?: Long | null; } /** Represents a ValidatorUpdate. */ @@ -5619,7 +5619,7 @@ export namespace tendermint { public pubKey?: tendermint.abci.types.IPubKey | null; /** ValidatorUpdate power. */ - public power: number | Long; + public power: Long; /** * Creates a new ValidatorUpdate instance using the specified properties. @@ -5762,13 +5762,13 @@ export namespace tendermint { validator?: tendermint.abci.types.IValidator | null; /** Evidence height */ - height?: number | Long | null; + height?: Long | null; /** Evidence time */ time?: google.protobuf.ITimestamp | null; /** Evidence totalVotingPower */ - totalVotingPower?: number | Long | null; + totalVotingPower?: Long | null; } /** Represents an Evidence. */ @@ -5786,13 +5786,13 @@ export namespace tendermint { public validator?: tendermint.abci.types.IValidator | null; /** Evidence height. */ - public height: number | Long; + public height: Long; /** Evidence time. */ public time?: google.protobuf.ITimestamp | null; /** Evidence totalVotingPower. */ - public totalVotingPower: number | Long; + public totalVotingPower: Long; /** * Creates a new Evidence instance using the specified properties. @@ -6313,7 +6313,7 @@ export namespace tendermint { key?: Uint8Array | null; /** KI64Pair value */ - value?: number | Long | null; + value?: Long | null; } /** Represents a KI64Pair. */ @@ -6328,7 +6328,7 @@ export namespace tendermint { public key: Uint8Array; /** KI64Pair value. */ - public value: number | Long; + public value: Long; /** * Creates a new KI64Pair instance using the specified properties. @@ -6415,7 +6415,7 @@ export namespace google { /** Properties of a Timestamp. */ interface ITimestamp { /** Timestamp seconds */ - seconds?: number | Long | null; + seconds?: Long | null; /** Timestamp nanos */ nanos?: number | null; @@ -6430,7 +6430,7 @@ export namespace google { constructor(p?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: number | Long; + public seconds: Long; /** Timestamp nanos. */ public nanos: number; @@ -6464,7 +6464,7 @@ export namespace google { /** Properties of a Duration. */ interface IDuration { /** Duration seconds */ - seconds?: number | Long | null; + seconds?: Long | null; /** Duration nanos */ nanos?: number | null; @@ -6479,7 +6479,7 @@ export namespace google { constructor(p?: google.protobuf.IDuration); /** Duration seconds. */ - public seconds: number | Long; + public seconds: Long; /** Duration nanos. */ public nanos: number; diff --git a/packages/stargate/types/codec/index.d.ts b/packages/stargate/types/codec/index.d.ts new file mode 100644 index 00000000..7cbb5810 --- /dev/null +++ b/packages/stargate/types/codec/index.d.ts @@ -0,0 +1 @@ +export * from "./generated/codecimpl"; diff --git a/packages/stargate/types/queries/auth.d.ts b/packages/stargate/types/queries/auth.d.ts index db6bcb4f..1fd1d65c 100644 --- a/packages/stargate/types/queries/auth.d.ts +++ b/packages/stargate/types/queries/auth.d.ts @@ -1,4 +1,4 @@ -import { cosmos } from "../generated/codecimpl"; +import { cosmos } from "../codec"; import { QueryClient } from "./queryclient"; export interface AuthExtension { readonly auth: { diff --git a/packages/stargate/types/queries/bank.d.ts b/packages/stargate/types/queries/bank.d.ts index 5e02551c..ad67fe12 100644 --- a/packages/stargate/types/queries/bank.d.ts +++ b/packages/stargate/types/queries/bank.d.ts @@ -1,4 +1,4 @@ -import { cosmos } from "../generated/codecimpl"; +import { cosmos } from "../codec"; import { QueryClient } from "./queryclient"; export interface BankExtension { readonly bank: {