From 1c6f3ee9a5501ebbbe48dbdfd344e4f336a9dfc5 Mon Sep 17 00:00:00 2001 From: willclarktech Date: Tue, 9 Feb 2021 13:01:13 +0000 Subject: [PATCH] Remove types from VCS --- .../cosmwasm-launchpad/types/builder.d.ts | 1 - .../cosmwasm-launchpad/types/cosmosmsg.d.ts | 65 - .../types/cosmwasmclient.d.ts | 177 -- .../types/cw1cosmwasmclient.d.ts | 18 - .../types/cw1subkeycosmwasmclient.d.ts | 52 - .../types/cw3cosmwasmclient.d.ts | 96 -- packages/cosmwasm-launchpad/types/index.d.ts | 58 - .../types/interfaces/cw0.d.ts | 13 - .../types/interfaces/index.d.ts | 1 - .../cosmwasm-launchpad/types/lcdapi/wasm.d.ts | 80 - packages/cosmwasm-launchpad/types/msgs.d.ts | 119 -- .../types/signingcosmwasmclient.d.ts | 156 -- packages/cosmwasm-launchpad/types/types.d.ts | 14 - .../cosmwasm-stargate/types/aminotypes.d.ts | 2 - .../cosmos/base/query/v1beta1/pagination.d.ts | 86 - .../cosmos/base/query/v1beta1/pagination.ts | 269 --- .../types/codec/cosmos/base/v1beta1/coin.d.ts | 72 - .../types/codec/cosmos/base/v1beta1/coin.ts | 290 ---- .../codec/x/wasm/internal/types/query.d.ts | 286 ---- .../codec/x/wasm/internal/types/query.ts | 1516 ----------------- .../types/codec/x/wasm/internal/types/tx.d.ts | 223 --- .../types/codec/x/wasm/internal/types/tx.ts | 1113 ------------ .../codec/x/wasm/internal/types/types.d.ts | 171 -- .../codec/x/wasm/internal/types/types.ts | 899 ---------- .../types/cosmwasmclient.d.ts | 69 - packages/cosmwasm-stargate/types/index.d.ts | 3 - .../types/queries/index.d.ts | 1 - .../cosmwasm-stargate/types/queries/wasm.d.ts | 58 - .../types/signingcosmwasmclient.d.ts | 93 - packages/cosmwasm/types/index.d.ts | 1 - packages/crypto/types/bip39.d.ts | 22 - packages/crypto/types/englishmnemonic.d.ts | 7 - packages/crypto/types/hash.d.ts | 5 - packages/crypto/types/hmac.d.ts | 11 - packages/crypto/types/index.d.ts | 29 - packages/crypto/types/keccak.d.ts | 10 - packages/crypto/types/libsodium.d.ts | 52 - packages/crypto/types/random.d.ts | 6 - packages/crypto/types/ripemd.d.ts | 10 - packages/crypto/types/secp256k1.d.ts | 17 - packages/crypto/types/secp256k1signature.d.ts | 35 - packages/crypto/types/sha.d.ts | 28 - packages/crypto/types/slip10.d.ts | 67 - packages/encoding/types/ascii.d.ts | 2 - packages/encoding/types/base64.d.ts | 2 - packages/encoding/types/bech32.d.ts | 10 - packages/encoding/types/hex.d.ts | 2 - packages/encoding/types/index.d.ts | 6 - packages/encoding/types/rfc3339.d.ts | 3 - packages/encoding/types/utf8.d.ts | 2 - .../faucet-client/types/faucetclient.d.ts | 5 - packages/faucet-client/types/index.d.ts | 1 - packages/json-rpc/types/compatibility.d.ts | 23 - packages/json-rpc/types/id.d.ts | 8 - packages/json-rpc/types/index.d.ts | 20 - packages/json-rpc/types/jsonrpcclient.d.ts | 17 - packages/json-rpc/types/parse.d.ts | 23 - packages/json-rpc/types/types.d.ts | 46 - .../types/workers/dummyservice.worker.d.ts | 2 - packages/launchpad/types/address.d.ts | 3 - packages/launchpad/types/coins.d.ts | 12 - packages/launchpad/types/cosmosclient.d.ts | 143 -- packages/launchpad/types/encoding.d.ts | 26 - packages/launchpad/types/gas.d.ts | 17 - packages/launchpad/types/index.d.ts | 140 -- packages/launchpad/types/lcdapi/auth.d.ts | 60 - packages/launchpad/types/lcdapi/bank.d.ts | 12 - packages/launchpad/types/lcdapi/base.d.ts | 129 -- .../launchpad/types/lcdapi/distribution.d.ts | 68 - packages/launchpad/types/lcdapi/gov.d.ts | 114 -- packages/launchpad/types/lcdapi/index.d.ts | 71 - .../launchpad/types/lcdapi/lcdclient.d.ts | 164 -- packages/launchpad/types/lcdapi/mint.d.ts | 28 - packages/launchpad/types/lcdapi/slashing.d.ts | 31 - packages/launchpad/types/lcdapi/staking.d.ts | 194 --- packages/launchpad/types/lcdapi/supply.d.ts | 18 - packages/launchpad/types/lcdapi/utils.d.ts | 22 - packages/launchpad/types/logs.d.ts | 28 - packages/launchpad/types/msgs.d.ts | 237 --- packages/launchpad/types/pubkey.d.ts | 24 - .../launchpad/types/secp256k1hdwallet.d.ts | 97 -- packages/launchpad/types/secp256k1wallet.d.ts | 23 - packages/launchpad/types/sequence.d.ts | 19 - packages/launchpad/types/signature.d.ts | 14 - packages/launchpad/types/signer.d.ts | 33 - .../launchpad/types/signingcosmosclient.d.ts | 66 - packages/launchpad/types/tx.d.ts | 36 - packages/launchpad/types/types.d.ts | 21 - packages/launchpad/types/wallet.d.ts | 46 - packages/ledger-amino/types/index.d.ts | 2 - .../ledger-amino/types/launchpadledger.d.ts | 30 - packages/ledger-amino/types/ledgersigner.d.ts | 13 - packages/math/types/decimal.d.ts | 46 - packages/math/types/index.d.ts | 2 - packages/math/types/integers.d.ts | 61 - packages/proto-signing/types/adr27.d.ts | 11 - .../types/codec/cosmos/bank/v1beta1/bank.d.ts | 130 -- .../types/codec/cosmos/bank/v1beta1/tx.d.ts | 77 - .../types/codec/cosmos/base/v1beta1/coin.d.ts | 72 - .../crypto/multisig/v1beta1/multisig.d.ts | 48 - .../codec/cosmos/crypto/secp256k1/keys.d.ts | 44 - .../cosmos/tx/signing/v1beta1/signing.d.ts | 123 -- .../types/codec/cosmos/tx/v1beta1/tx.d.ts | 279 --- .../types/codec/cosmos_proto/cosmos.d.ts | 1 - .../types/codec/gogoproto/gogo.d.ts | 1 - .../types/codec/google/protobuf/any.d.ts | 138 -- .../codec/google/protobuf/descriptor.d.ts | 1033 ----------- .../types/codec/tendermint/crypto/keys.d.ts | 28 - packages/proto-signing/types/demo.d.ts | 4 - packages/proto-signing/types/demo.proto.d.ts | 2 - .../types/directsecp256k1hdwallet.d.ts | 45 - .../types/directsecp256k1wallet.d.ts | 24 - packages/proto-signing/types/index.d.ts | 6 - packages/proto-signing/types/pubkey.d.ts | 4 - packages/proto-signing/types/registry.d.ts | 50 - packages/proto-signing/types/signer.d.ts | 16 - packages/proto-signing/types/signing.d.ts | 26 - packages/socket/types/index.d.ts | 9 - .../socket/types/queueingstreamingsocket.d.ts | 31 - packages/socket/types/reconnectingsocket.d.ts | 23 - packages/socket/types/socketwrapper.d.ts | 59 - packages/socket/types/streamingsocket.d.ts | 17 - packages/stream/types/concat.d.ts | 19 - .../stream/types/defaultvalueproducer.d.ts | 31 - packages/stream/types/dropduplicates.d.ts | 25 - packages/stream/types/index.d.ts | 6 - packages/stream/types/promise.d.ts | 18 - packages/stream/types/reducer.d.ts | 14 - packages/stream/types/valueandupdates.d.ts | 21 - packages/tendermint-rpc/types/adaptor.d.ts | 48 - .../tendermint-rpc/types/adaptors/index.d.ts | 32 - .../types/adaptors/v0-33/hasher.d.ts | 3 - .../types/adaptors/v0-33/index.d.ts | 2 - .../types/adaptors/v0-33/requests.d.ts | 18 - .../types/adaptors/v0-33/responses.d.ts | 33 - packages/tendermint-rpc/types/client.d.ts | 82 - packages/tendermint-rpc/types/encodings.d.ts | 69 - packages/tendermint-rpc/types/index.d.ts | 81 - packages/tendermint-rpc/types/jsonrpc.d.ts | 3 - packages/tendermint-rpc/types/requests.d.ts | 150 -- packages/tendermint-rpc/types/responses.d.ts | 267 --- .../types/rpcclients/httpclient.d.ts | 8 - .../types/rpcclients/index.d.ts | 3 - .../types/rpcclients/rpcclient.d.ts | 25 - .../types/rpcclients/websocketclient.d.ts | 20 - packages/tendermint-rpc/types/types.d.ts | 18 - packages/utils/types/arrays.d.ts | 12 - packages/utils/types/assert.d.ts | 6 - packages/utils/types/index.d.ts | 4 - packages/utils/types/sleep.d.ts | 1 - packages/utils/types/typechecks.d.ts | 13 - 151 files changed, 11856 deletions(-) delete mode 100644 packages/cosmwasm-launchpad/types/builder.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/cosmosmsg.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/index.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/interfaces/index.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/msgs.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-launchpad/types/types.d.ts delete mode 100644 packages/cosmwasm-stargate/types/aminotypes.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.d.ts delete mode 100644 packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.ts delete mode 100644 packages/cosmwasm-stargate/types/cosmwasmclient.d.ts delete mode 100644 packages/cosmwasm-stargate/types/index.d.ts delete mode 100644 packages/cosmwasm-stargate/types/queries/index.d.ts delete mode 100644 packages/cosmwasm-stargate/types/queries/wasm.d.ts delete mode 100644 packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts delete mode 100644 packages/cosmwasm/types/index.d.ts delete mode 100644 packages/crypto/types/bip39.d.ts delete mode 100644 packages/crypto/types/englishmnemonic.d.ts delete mode 100644 packages/crypto/types/hash.d.ts delete mode 100644 packages/crypto/types/hmac.d.ts delete mode 100644 packages/crypto/types/index.d.ts delete mode 100644 packages/crypto/types/keccak.d.ts delete mode 100644 packages/crypto/types/libsodium.d.ts delete mode 100644 packages/crypto/types/random.d.ts delete mode 100644 packages/crypto/types/ripemd.d.ts delete mode 100644 packages/crypto/types/secp256k1.d.ts delete mode 100644 packages/crypto/types/secp256k1signature.d.ts delete mode 100644 packages/crypto/types/sha.d.ts delete mode 100644 packages/crypto/types/slip10.d.ts delete mode 100644 packages/encoding/types/ascii.d.ts delete mode 100644 packages/encoding/types/base64.d.ts delete mode 100644 packages/encoding/types/bech32.d.ts delete mode 100644 packages/encoding/types/hex.d.ts delete mode 100644 packages/encoding/types/index.d.ts delete mode 100644 packages/encoding/types/rfc3339.d.ts delete mode 100644 packages/encoding/types/utf8.d.ts delete mode 100644 packages/faucet-client/types/faucetclient.d.ts delete mode 100644 packages/faucet-client/types/index.d.ts delete mode 100644 packages/json-rpc/types/compatibility.d.ts delete mode 100644 packages/json-rpc/types/id.d.ts delete mode 100644 packages/json-rpc/types/index.d.ts delete mode 100644 packages/json-rpc/types/jsonrpcclient.d.ts delete mode 100644 packages/json-rpc/types/parse.d.ts delete mode 100644 packages/json-rpc/types/types.d.ts delete mode 100644 packages/json-rpc/types/workers/dummyservice.worker.d.ts delete mode 100644 packages/launchpad/types/address.d.ts delete mode 100644 packages/launchpad/types/coins.d.ts delete mode 100644 packages/launchpad/types/cosmosclient.d.ts delete mode 100644 packages/launchpad/types/encoding.d.ts delete mode 100644 packages/launchpad/types/gas.d.ts delete mode 100644 packages/launchpad/types/index.d.ts delete mode 100644 packages/launchpad/types/lcdapi/auth.d.ts delete mode 100644 packages/launchpad/types/lcdapi/bank.d.ts delete mode 100644 packages/launchpad/types/lcdapi/base.d.ts delete mode 100644 packages/launchpad/types/lcdapi/distribution.d.ts delete mode 100644 packages/launchpad/types/lcdapi/gov.d.ts delete mode 100644 packages/launchpad/types/lcdapi/index.d.ts delete mode 100644 packages/launchpad/types/lcdapi/lcdclient.d.ts delete mode 100644 packages/launchpad/types/lcdapi/mint.d.ts delete mode 100644 packages/launchpad/types/lcdapi/slashing.d.ts delete mode 100644 packages/launchpad/types/lcdapi/staking.d.ts delete mode 100644 packages/launchpad/types/lcdapi/supply.d.ts delete mode 100644 packages/launchpad/types/lcdapi/utils.d.ts delete mode 100644 packages/launchpad/types/logs.d.ts delete mode 100644 packages/launchpad/types/msgs.d.ts delete mode 100644 packages/launchpad/types/pubkey.d.ts delete mode 100644 packages/launchpad/types/secp256k1hdwallet.d.ts delete mode 100644 packages/launchpad/types/secp256k1wallet.d.ts delete mode 100644 packages/launchpad/types/sequence.d.ts delete mode 100644 packages/launchpad/types/signature.d.ts delete mode 100644 packages/launchpad/types/signer.d.ts delete mode 100644 packages/launchpad/types/signingcosmosclient.d.ts delete mode 100644 packages/launchpad/types/tx.d.ts delete mode 100644 packages/launchpad/types/types.d.ts delete mode 100644 packages/launchpad/types/wallet.d.ts delete mode 100644 packages/ledger-amino/types/index.d.ts delete mode 100644 packages/ledger-amino/types/launchpadledger.d.ts delete mode 100644 packages/ledger-amino/types/ledgersigner.d.ts delete mode 100644 packages/math/types/decimal.d.ts delete mode 100644 packages/math/types/index.d.ts delete mode 100644 packages/math/types/integers.d.ts delete mode 100644 packages/proto-signing/types/adr27.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts delete mode 100644 packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts delete mode 100644 packages/proto-signing/types/codec/gogoproto/gogo.d.ts delete mode 100644 packages/proto-signing/types/codec/google/protobuf/any.d.ts delete mode 100644 packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts delete mode 100644 packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts delete mode 100644 packages/proto-signing/types/demo.d.ts delete mode 100644 packages/proto-signing/types/demo.proto.d.ts delete mode 100644 packages/proto-signing/types/directsecp256k1hdwallet.d.ts delete mode 100644 packages/proto-signing/types/directsecp256k1wallet.d.ts delete mode 100644 packages/proto-signing/types/index.d.ts delete mode 100644 packages/proto-signing/types/pubkey.d.ts delete mode 100644 packages/proto-signing/types/registry.d.ts delete mode 100644 packages/proto-signing/types/signer.d.ts delete mode 100644 packages/proto-signing/types/signing.d.ts delete mode 100644 packages/socket/types/index.d.ts delete mode 100644 packages/socket/types/queueingstreamingsocket.d.ts delete mode 100644 packages/socket/types/reconnectingsocket.d.ts delete mode 100644 packages/socket/types/socketwrapper.d.ts delete mode 100644 packages/socket/types/streamingsocket.d.ts delete mode 100644 packages/stream/types/concat.d.ts delete mode 100644 packages/stream/types/defaultvalueproducer.d.ts delete mode 100644 packages/stream/types/dropduplicates.d.ts delete mode 100644 packages/stream/types/index.d.ts delete mode 100644 packages/stream/types/promise.d.ts delete mode 100644 packages/stream/types/reducer.d.ts delete mode 100644 packages/stream/types/valueandupdates.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptor.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptors/index.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptors/v0-33/hasher.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptors/v0-33/index.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptors/v0-33/requests.d.ts delete mode 100644 packages/tendermint-rpc/types/adaptors/v0-33/responses.d.ts delete mode 100644 packages/tendermint-rpc/types/client.d.ts delete mode 100644 packages/tendermint-rpc/types/encodings.d.ts delete mode 100644 packages/tendermint-rpc/types/index.d.ts delete mode 100644 packages/tendermint-rpc/types/jsonrpc.d.ts delete mode 100644 packages/tendermint-rpc/types/requests.d.ts delete mode 100644 packages/tendermint-rpc/types/responses.d.ts delete mode 100644 packages/tendermint-rpc/types/rpcclients/httpclient.d.ts delete mode 100644 packages/tendermint-rpc/types/rpcclients/index.d.ts delete mode 100644 packages/tendermint-rpc/types/rpcclients/rpcclient.d.ts delete mode 100644 packages/tendermint-rpc/types/rpcclients/websocketclient.d.ts delete mode 100644 packages/tendermint-rpc/types/types.d.ts delete mode 100644 packages/utils/types/arrays.d.ts delete mode 100644 packages/utils/types/assert.d.ts delete mode 100644 packages/utils/types/index.d.ts delete mode 100644 packages/utils/types/sleep.d.ts delete mode 100644 packages/utils/types/typechecks.d.ts diff --git a/packages/cosmwasm-launchpad/types/builder.d.ts b/packages/cosmwasm-launchpad/types/builder.d.ts deleted file mode 100644 index 68e18c0a0e..0000000000 --- a/packages/cosmwasm-launchpad/types/builder.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isValidBuilder(builder: string): boolean; diff --git a/packages/cosmwasm-launchpad/types/cosmosmsg.d.ts b/packages/cosmwasm-launchpad/types/cosmosmsg.d.ts deleted file mode 100644 index 82b225ba6b..0000000000 --- a/packages/cosmwasm-launchpad/types/cosmosmsg.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Coin } from "@cosmjs/launchpad"; -interface BankSendMsg { - readonly send: { - readonly from_address: string; - readonly to_address: string; - readonly amount: readonly Coin[]; - }; -} -export interface BankMsg { - readonly bank: BankSendMsg; -} -export interface CustomMsg { - readonly custom: Record; -} -interface StakingDelegateMsg { - readonly delegate: { - readonly validator: string; - readonly amount: Coin; - }; -} -interface StakingRedelegateMsg { - readonly redelgate: { - readonly src_validator: string; - readonly dst_validator: string; - readonly amount: Coin; - }; -} -interface StakingUndelegateMsg { - readonly undelegate: { - readonly validator: string; - readonly amount: Coin; - }; -} -interface StakingWithdrawMsg { - readonly withdraw: { - readonly validator: string; - readonly recipient?: string; - }; -} -export interface StakingMsg { - readonly staking: StakingDelegateMsg | StakingRedelegateMsg | StakingUndelegateMsg | StakingWithdrawMsg; -} -interface WasmExecuteMsg { - readonly execute: { - readonly contract_address: string; - readonly msg: any; - readonly send: readonly Coin[]; - }; -} -interface WasmInstantiateMsg { - readonly instantiate: { - readonly code_id: string; - readonly msg: any; - readonly send: readonly Coin[]; - readonly label?: string; - }; -} -export interface WasmMsg { - readonly wasm: WasmExecuteMsg | WasmInstantiateMsg; -} -/** These definitions are derived from CosmWasm: - * https://github.com/CosmWasm/cosmwasm/blob/v0.12.0/packages/std/src/results/cosmos_msg.rs#L10-L23 - */ -export declare type CosmosMsg = BankMsg | CustomMsg | StakingMsg | WasmMsg; -export {}; diff --git a/packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts deleted file mode 100644 index 66cd6ee159..0000000000 --- a/packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { - AuthExtension, - BroadcastMode, - BroadcastTxResult, - Coin, - IndexedTx, - LcdClient, - PubKey, - StdTx, - WrappedStdTx, -} from "@cosmjs/launchpad"; -import { WasmExtension } from "./lcdapi/wasm"; -import { JsonObject } from "./types"; -export interface GetSequenceResult { - readonly accountNumber: number; - readonly sequence: number; -} -export interface Account { - /** Bech32 account address */ - readonly address: string; - readonly balance: readonly Coin[]; - readonly pubkey: PubKey | undefined; - readonly accountNumber: number; - readonly sequence: number; -} -export interface SearchByIdQuery { - readonly id: string; -} -export interface SearchByHeightQuery { - readonly height: number; -} -export interface SearchBySentFromOrToQuery { - readonly sentFromOrTo: string; -} -/** - * This query type allows you to pass arbitrary key/value pairs to the backend. It is - * more powerful and slightly lower level than the other search options. - */ -export interface SearchByTagsQuery { - readonly tags: ReadonlyArray<{ - readonly key: string; - readonly value: string; - }>; -} -export declare type SearchTxQuery = SearchByHeightQuery | SearchBySentFromOrToQuery | SearchByTagsQuery; -export interface SearchTxFilter { - readonly minHeight?: number; - readonly maxHeight?: number; -} -export interface Code { - readonly id: number; - /** Bech32 account address */ - readonly creator: string; - /** Hex-encoded sha256 hash of the code stored here */ - readonly checksum: string; - /** - * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. - * - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly source?: string; - /** - * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. - * - * @example ```cosmwasm/rust-optimizer:0.8.0``` - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly builder?: string; -} -export interface CodeDetails extends Code { - /** The original wasm bytes */ - readonly data: Uint8Array; -} -export interface Contract { - readonly address: string; - readonly codeId: number; - /** Bech32 account address */ - readonly creator: string; - /** Bech32-encoded admin address */ - readonly admin: string | undefined; - readonly label: string; -} -export interface ContractCodeHistoryEntry { - /** The source of this history entry */ - readonly operation: "Genesis" | "Init" | "Migrate"; - readonly codeId: number; - readonly msg: Record; -} -export interface BlockHeader { - readonly version: { - readonly block: string; - readonly app: string; - }; - readonly height: number; - readonly chainId: string; - /** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */ - readonly time: string; -} -export interface Block { - /** The ID is a hash of the block header (uppercase hex) */ - readonly id: string; - readonly header: BlockHeader; - /** Array of raw transactions */ - readonly txs: readonly Uint8Array[]; -} -/** Use for testing only */ -export interface PrivateCosmWasmClient { - readonly lcdClient: LcdClient & AuthExtension & WasmExtension; -} -export declare class CosmWasmClient { - protected readonly lcdClient: LcdClient & AuthExtension & WasmExtension; - /** Any address the chain considers valid (valid bech32 with proper prefix) */ - protected anyValidAddress: string | undefined; - private readonly codesCache; - private chainId; - /** - * Creates a new client to interact with a CosmWasm blockchain. - * - * This instance does a lot of caching. In order to benefit from that you should try to use one instance - * for the lifetime of your application. When switching backends, a new instance must be created. - * - * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) - * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns - */ - constructor(apiUrl: string, broadcastMode?: BroadcastMode); - getChainId(): Promise; - getHeight(): Promise; - /** - * Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID) - */ - getIdentifier(tx: WrappedStdTx): Promise; - /** - * Returns account number and sequence. - * - * Throws if the account does not exist on chain. - * - * @param address returns data for this address. When unset, the client's sender adddress is used. - */ - getSequence(address: string): Promise; - getAccount(address: string): Promise; - /** - * Gets block header and meta - * - * @param height The height of the block. If undefined, the latest height is used. - */ - getBlock(height?: number): Promise; - getTx(id: string): Promise; - searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise; - broadcastTx(tx: StdTx): Promise; - getCodes(): Promise; - getCodeDetails(codeId: number): Promise; - getContracts(codeId: number): Promise; - /** - * Throws an error if no contract was found at the address - */ - getContract(address: string): Promise; - /** - * Throws an error if no contract was found at the address - */ - getContractCodeHistory(address: string): Promise; - /** - * Returns the data at the key if present (raw contract dependent storage data) - * or null if no data at this key. - * - * Promise is rejected when contract does not exist. - */ - queryContractRaw(address: string, key: Uint8Array): Promise; - /** - * Makes a smart query on the contract, returns the parsed JSON document. - * - * Promise is rejected when contract does not exist. - * Promise is rejected for invalid query format. - * Promise is rejected for invalid response format. - */ - queryContractSmart(address: string, queryMsg: Record): Promise; - private txsQuery; -} diff --git a/packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts deleted file mode 100644 index b3da0c3237..0000000000 --- a/packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Account, BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad"; -import { CosmosMsg } from "./cosmosmsg"; -import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient"; -export declare class Cw1CosmWasmClient extends SigningCosmWasmClient { - readonly cw1ContractAddress: string; - constructor( - apiUrl: string, - signerAddress: string, - signer: OfflineSigner, - cw1ContractAddress: string, - gasPrice?: GasPrice, - gasLimits?: Partial>, - broadcastMode?: BroadcastMode, - ); - getAccount(address?: string): Promise; - canSend(msg: CosmosMsg, address?: string): Promise; - executeCw1(msgs: readonly CosmosMsg[], memo?: string): Promise; -} diff --git a/packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts deleted file mode 100644 index da665871f0..0000000000 --- a/packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Coin } from "@cosmjs/launchpad"; -import { Cw1CosmWasmClient } from "./cw1cosmwasmclient"; -import { Expiration } from "./interfaces"; -import { ExecuteResult } from "./signingcosmwasmclient"; -/** - * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/msg.rs#L88 - */ -export interface Cw1SubkeyAllowanceInfo { - readonly balance: readonly Coin[]; - readonly expires: Expiration; -} -/** - * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/state.rs#L15 - */ -export interface Cw1SubkeyPermissions { - readonly delegate: boolean; - readonly redelegate: boolean; - readonly undelegate: boolean; - readonly withdraw: boolean; -} -/** - * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/msg.rs#L95 - */ -export interface Cw1SubkeyPermissionsInfo { - /** Spender address */ - readonly spender: string; - readonly permissions: readonly Cw1SubkeyPermissions[]; -} -export declare class Cw1SubkeyCosmWasmClient extends Cw1CosmWasmClient { - private setAdmins; - getAdmins(): Promise; - isAdmin(address?: string): Promise; - getAllAllowances(): Promise; - getAllowance(address?: string): Promise; - getAllPermissions(): Promise; - getPermissions(address?: string): Promise; - addAdmin(address: string, memo?: string): Promise; - removeAdmin(address: string, memo?: string): Promise; - increaseAllowance( - address: string, - amount: Coin, - expires?: Expiration, - memo?: string, - ): Promise; - decreaseAllowance( - address: string, - amount: Coin, - expires?: Expiration, - memo?: string, - ): Promise; - setPermissions(address: string, permissions: Cw1SubkeyPermissions, memo?: string): Promise; -} diff --git a/packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts deleted file mode 100644 index b0fe42201a..0000000000 --- a/packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad"; -import { CosmosMsg } from "./cosmosmsg"; -import { Account } from "./cosmwasmclient"; -import { Expiration } from "./interfaces"; -import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient"; -/** - * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw3/src/msg.rs#L35 - */ -export declare enum Vote { - Yes = "yes", - No = "no", - Abstain = "abstain", - Veto = "veto", -} -export interface ThresholdResult { - readonly absolute_count: { - readonly weight_needed: number; - readonly total_weight: number; - }; -} -export interface ProposalResult { - readonly id: number; - readonly title: string; - readonly description: string; - readonly msgs: readonly CosmosMsg[]; - readonly expires: Expiration; - readonly status: string; -} -export interface ProposalsResult { - readonly proposals: readonly ProposalResult[]; -} -export interface VoteResult { - readonly vote: Vote; -} -export interface VotesResult { - readonly votes: ReadonlyArray<{ - readonly vote: Vote; - readonly voter: string; - readonly weight: number; - }>; -} -export interface VoterResult { - readonly addr: string; - readonly weight: number; -} -export interface VotersResult { - readonly voters: readonly VoterResult[]; -} -interface StartBeforeNumberPaginationOptions { - readonly startBefore?: number; - readonly limit?: number; -} -interface StartAfterNumberPaginationOptions { - readonly startAfter?: number; - readonly limit?: number; -} -interface StartAfterStringPaginationOptions { - readonly startAfter?: string; - readonly limit?: number; -} -export declare class Cw3CosmWasmClient extends SigningCosmWasmClient { - readonly cw3ContractAddress: string; - constructor( - apiUrl: string, - signerAddress: string, - signer: OfflineSigner, - cw3ContractAddress: string, - gasPrice?: GasPrice, - gasLimits?: Partial>, - broadcastMode?: BroadcastMode, - ); - getAccount(address?: string): Promise; - getThreshold(): Promise; - getProposal(proposalId: number): Promise; - listProposals({ startAfter, limit }?: StartAfterNumberPaginationOptions): Promise; - reverseProposals({ startBefore, limit }?: StartBeforeNumberPaginationOptions): Promise; - getVote(proposalId: number, voter: string): Promise; - listVotes( - proposalId: number, - { startAfter, limit }?: StartAfterStringPaginationOptions, - ): Promise; - getVoter(address: string): Promise; - listVoters({ startAfter, limit }?: StartAfterStringPaginationOptions): Promise; - createMultisigProposal( - title: string, - description: string, - msgs: readonly CosmosMsg[], - earliest?: Expiration, - latest?: Expiration, - memo?: string, - ): Promise; - voteMultisigProposal(proposalId: number, vote: Vote, memo?: string): Promise; - executeMultisigProposal(proposalId: number, memo?: string): Promise; - closeMultisigProposal(proposalId: number, memo?: string): Promise; -} -export {}; diff --git a/packages/cosmwasm-launchpad/types/index.d.ts b/packages/cosmwasm-launchpad/types/index.d.ts deleted file mode 100644 index 3b86b7c0de..0000000000 --- a/packages/cosmwasm-launchpad/types/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -export { isValidBuilder } from "./builder"; -export { Expiration } from "./interfaces"; -export { setupWasmExtension, WasmExtension } from "./lcdapi/wasm"; -export { BankMsg, CosmosMsg, CustomMsg, StakingMsg, WasmMsg } from "./cosmosmsg"; -export { - Account, - Block, - BlockHeader, - Code, - CodeDetails, - Contract, - ContractCodeHistoryEntry, - CosmWasmClient, - GetSequenceResult, - SearchByHeightQuery, - SearchBySentFromOrToQuery, - SearchByTagsQuery, - SearchTxQuery, - SearchTxFilter, -} from "./cosmwasmclient"; -export { Cw1CosmWasmClient } from "./cw1cosmwasmclient"; -export { - Cw3CosmWasmClient, - ProposalResult, - ProposalsResult, - ThresholdResult, - Vote, - VoteResult, - VotesResult, - VoterResult, - VotersResult, -} from "./cw3cosmwasmclient"; -export { - ChangeAdminResult, - ExecuteResult, - CosmWasmFeeTable, - InstantiateOptions, - InstantiateResult, - MigrateResult, - SigningCosmWasmClient, - UploadMeta, - UploadResult, -} from "./signingcosmwasmclient"; -export { - isMsgClearAdmin, - isMsgExecuteContract, - isMsgInstantiateContract, - isMsgMigrateContract, - isMsgUpdateAdmin, - isMsgStoreCode, - MsgClearAdmin, - MsgExecuteContract, - MsgInstantiateContract, - MsgMigrateContract, - MsgUpdateAdmin, - MsgStoreCode, -} from "./msgs"; -export { JsonObject, parseWasmData, WasmData } from "./types"; diff --git a/packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts b/packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts deleted file mode 100644 index 1a9bae4326..0000000000 --- a/packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw0/src/expiration.rs#L14 - */ -export declare type Expiration = - | { - readonly at_height: number; - } - | { - readonly at_time: number; - } - | { - readonly never: Record; - }; diff --git a/packages/cosmwasm-launchpad/types/interfaces/index.d.ts b/packages/cosmwasm-launchpad/types/interfaces/index.d.ts deleted file mode 100644 index b91ff756b6..0000000000 --- a/packages/cosmwasm-launchpad/types/interfaces/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { Expiration } from "./cw0"; diff --git a/packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts b/packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts deleted file mode 100644 index 04a1fe2d2b..0000000000 --- a/packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { LcdClient } from "@cosmjs/launchpad"; -import { JsonObject, Model } from "../types"; -export interface CodeInfo { - readonly id: number; - /** Bech32 account address */ - readonly creator: string; - /** Hex-encoded sha256 hash of the code stored here */ - readonly data_hash: string; - /** - * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. - * - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly source?: string; - /** - * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. - * - * @example ```cosmwasm/rust-optimizer:0.8.0``` - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly builder?: string; -} -export interface CodeDetails extends CodeInfo { - /** Base64 encoded raw wasm data */ - readonly data: string; -} -export interface ContractInfo { - readonly address: string; - readonly code_id: number; - /** Bech32 account address */ - readonly creator: string; - /** Bech32-encoded admin address */ - readonly admin?: string; - readonly label: string; -} -export interface ContractCodeHistoryEntry { - /** The source of this history entry */ - readonly operation: "Genesis" | "Init" | "Migrate"; - readonly code_id: number; - readonly msg: Record; -} -/** - * @see https://github.com/cosmwasm/wasmd/blob/master/x/wasm/client/rest/query.go#L19-L27 - */ -export interface WasmExtension { - readonly wasm: { - readonly listCodeInfo: () => Promise; - /** - * Downloads the original wasm bytecode by code ID. - * - * Throws an error if no code with this id - */ - readonly getCode: (id: number) => Promise; - readonly listContractsByCodeId: (id: number) => Promise; - /** - * Returns null when contract was not found at this address. - */ - readonly getContractInfo: (address: string) => Promise; - /** - * Returns null when contract history was not found for this address. - */ - readonly getContractCodeHistory: (address: string) => Promise; - /** - * Returns all contract state. - * This is an empty array if no such contract, or contract has no data. - */ - readonly getAllContractState: (address: string) => Promise; - /** - * Returns the data at the key if present (unknown decoded json), - * or null if no data at this (contract address, key) pair - */ - readonly queryContractRaw: (address: string, key: Uint8Array) => Promise; - /** - * Makes a smart query on the contract and parses the response as JSON. - * Throws error if no such contract exists, the query format is invalid or the response is invalid. - */ - readonly queryContractSmart: (address: string, query: Record) => Promise; - }; -} -export declare function setupWasmExtension(base: LcdClient): WasmExtension; diff --git a/packages/cosmwasm-launchpad/types/msgs.d.ts b/packages/cosmwasm-launchpad/types/msgs.d.ts deleted file mode 100644 index 9b9c89c48d..0000000000 --- a/packages/cosmwasm-launchpad/types/msgs.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { Coin, Msg } from "@cosmjs/launchpad"; -/** - * @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/params.go#L68-L71 - */ -export declare type AccessConfig = never; -/** - * Uploads Wasm code to the chain. - * A numeric, auto-incrementing code ID will be generated as a result of the execution of this message. - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/msg.go#L10-L20 - */ -export interface MsgStoreCode extends Msg { - readonly type: "wasm/MsgStoreCode"; - readonly value: { - /** Bech32 account address */ - readonly sender: string; - /** Base64 encoded Wasm */ - readonly wasm_byte_code: string; - /** A valid URI reference to the contract's source code. Can be empty. */ - readonly source: string; - /** A docker tag. Can be empty. */ - readonly builder: string; - readonly instantiate_permission?: AccessConfig; - }; -} -export declare function isMsgStoreCode(msg: Msg): msg is MsgStoreCode; -/** - * Creates an instance of contract that was uploaded before. - * This will trigger a call to the "init" export. - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L104 - */ -export interface MsgInstantiateContract extends Msg { - readonly type: "wasm/MsgInstantiateContract"; - readonly value: { - /** Bech32 account address */ - readonly sender: string; - /** ID of the Wasm code that was uploaded before */ - readonly code_id: string; - /** Human-readable label for this contract */ - readonly label: string; - /** Init message as JavaScript object */ - readonly init_msg: any; - readonly init_funds: readonly Coin[]; - /** Bech32-encoded admin address */ - readonly admin?: string; - }; -} -export declare function isMsgInstantiateContract(msg: Msg): msg is MsgInstantiateContract; -/** - * Update the admin of a contract - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-beta/x/wasm/internal/types/msg.go#L231 - */ -export interface MsgUpdateAdmin extends Msg { - readonly type: "wasm/MsgUpdateAdmin"; - readonly value: { - /** Bech32-encoded sender address. This must be the old admin. */ - readonly sender: string; - /** Bech32-encoded contract address to be updated */ - readonly contract: string; - /** Bech32-encoded address of the new admin */ - readonly new_admin: string; - }; -} -export declare function isMsgUpdateAdmin(msg: Msg): msg is MsgUpdateAdmin; -/** - * Clears the admin of a contract, making it immutable. - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-beta/x/wasm/internal/types/msg.go#L269 - */ -export interface MsgClearAdmin extends Msg { - readonly type: "wasm/MsgClearAdmin"; - readonly value: { - /** Bech32-encoded sender address. This must be the old admin. */ - readonly sender: string; - /** Bech32-encoded contract address to be updated */ - readonly contract: string; - }; -} -export declare function isMsgClearAdmin(msg: Msg): msg is MsgClearAdmin; -/** - * Execute a smart contract. - * This will trigger a call to the "handle" export. - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L158 - */ -export interface MsgExecuteContract extends Msg { - readonly type: "wasm/MsgExecuteContract"; - readonly value: { - /** Bech32 account address */ - readonly sender: string; - /** Bech32 account address */ - readonly contract: string; - /** Handle message as JavaScript object */ - readonly msg: any; - readonly sent_funds: readonly Coin[]; - }; -} -export declare function isMsgExecuteContract(msg: Msg): msg is MsgExecuteContract; -/** - * Migrates a contract to a new Wasm code. - * - * @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L195 - */ -export interface MsgMigrateContract extends Msg { - readonly type: "wasm/MsgMigrateContract"; - readonly value: { - /** Bech32 account address */ - readonly sender: string; - /** Bech32 account address */ - readonly contract: string; - /** The new code */ - readonly code_id: string; - /** Migrate message as JavaScript object */ - readonly msg: any; - }; -} -export declare function isMsgMigrateContract(msg: Msg): msg is MsgMigrateContract; diff --git a/packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts deleted file mode 100644 index f8548400ff..0000000000 --- a/packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { - BroadcastMode, - BroadcastTxResult, - Coin, - CosmosFeeTable, - GasLimits, - GasPrice, - logs, - Msg, - OfflineSigner, - StdFee, -} from "@cosmjs/launchpad"; -import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient"; -/** - * These fees are used by the higher level methods of SigningCosmWasmClient - */ -export interface CosmWasmFeeTable extends CosmosFeeTable { - readonly upload: StdFee; - readonly init: StdFee; - readonly exec: StdFee; - readonly migrate: StdFee; - /** Paid when setting the contract admin to a new address or unsetting it */ - readonly changeAdmin: StdFee; -} -export interface UploadMeta { - /** - * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. - * - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly source?: string; - /** - * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. - * - * @example ```cosmwasm/rust-optimizer:0.8.0``` - * @see https://github.com/CosmWasm/cosmwasm-verify - */ - readonly builder?: string; -} -export interface UploadResult { - /** Size of the original wasm code in bytes */ - readonly originalSize: number; - /** A hex encoded sha256 checksum of the original wasm code (that is stored on chain) */ - readonly originalChecksum: string; - /** Size of the compressed wasm code in bytes */ - readonly compressedSize: number; - /** A hex encoded sha256 checksum of the compressed wasm code (that stored in the transaction) */ - readonly compressedChecksum: string; - /** The ID of the code asigned by the chain */ - readonly codeId: number; - readonly logs: readonly logs.Log[]; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; -} -/** - * The options of an .instantiate() call. - * All properties are optional. - */ -export interface InstantiateOptions { - readonly memo?: string; - readonly transferAmount?: readonly Coin[]; - /** - * A bech32 encoded address of an admin account. - * Caution: an admin has the privilege to upgrade a contract. If this is not desired, do not set this value. - */ - readonly admin?: string; -} -export interface InstantiateResult { - /** The address of the newly instantiated contract */ - readonly contractAddress: string; - readonly logs: readonly logs.Log[]; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; -} -/** - * Result type of updateAdmin and clearAdmin - */ -export interface ChangeAdminResult { - readonly logs: readonly logs.Log[]; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; -} -export interface MigrateResult { - readonly logs: readonly logs.Log[]; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; -} -export interface ExecuteResult { - readonly logs: readonly logs.Log[]; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; -} -/** Use for testing only */ -export interface PrivateSigningCosmWasmClient { - readonly fees: CosmWasmFeeTable; -} -export declare class SigningCosmWasmClient extends CosmWasmClient { - readonly signerAddress: string; - private readonly signer; - private readonly fees; - /** - * Creates a new client with signing capability to interact with a CosmWasm blockchain. This is the bigger brother of CosmWasmClient. - * - * This instance does a lot of caching. In order to benefit from that you should try to use one instance - * for the lifetime of your application. When switching backends, a new instance must be created. - * - * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) - * @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address. - * @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input. - * @param gasPrice The price paid per unit of gas - * @param gasLimits Custom overrides for gas limits related to specific transaction types - * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns - */ - constructor( - apiUrl: string, - signerAddress: string, - signer: OfflineSigner, - gasPrice?: GasPrice, - gasLimits?: Partial>, - broadcastMode?: BroadcastMode, - ); - getSequence(address?: string): Promise; - getAccount(address?: string): Promise; - /** Uploads code and returns a receipt, including the code ID */ - upload(wasmCode: Uint8Array, meta?: UploadMeta, memo?: string): Promise; - instantiate( - codeId: number, - initMsg: Record, - label: string, - options?: InstantiateOptions, - ): Promise; - updateAdmin(contractAddress: string, newAdmin: string, memo?: string): Promise; - clearAdmin(contractAddress: string, memo?: string): Promise; - migrate( - contractAddress: string, - codeId: number, - migrateMsg: Record, - memo?: string, - ): Promise; - execute( - contractAddress: string, - handleMsg: Record, - memo?: string, - transferAmount?: readonly Coin[], - ): Promise; - sendTokens( - recipientAddress: string, - transferAmount: readonly Coin[], - memo?: string, - ): Promise; - /** - * Gets account number and sequence from the API, creates a sign doc, - * creates a single signature, assembles the signed transaction and broadcasts it. - */ - signAndBroadcast(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise; -} diff --git a/packages/cosmwasm-launchpad/types/types.d.ts b/packages/cosmwasm-launchpad/types/types.d.ts deleted file mode 100644 index 2109a73064..0000000000 --- a/packages/cosmwasm-launchpad/types/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface WasmData { - readonly key: string; - readonly val: string; -} -export interface Model { - readonly key: Uint8Array; - readonly val: Uint8Array; -} -export declare function parseWasmData({ key, val }: WasmData): Model; -/** - * An object containing a parsed JSON document. The result of JSON.parse(). - * This doesn't provide any type safety over `any` but expresses intent in the code. - */ -export declare type JsonObject = any; diff --git a/packages/cosmwasm-stargate/types/aminotypes.d.ts b/packages/cosmwasm-stargate/types/aminotypes.d.ts deleted file mode 100644 index 413e64a244..0000000000 --- a/packages/cosmwasm-stargate/types/aminotypes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { AminoConverter } from "@cosmjs/stargate"; -export declare const cosmWasmTypes: Record; diff --git a/packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.d.ts b/packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.d.ts deleted file mode 100644 index 2284742272..0000000000 --- a/packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -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/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.ts b/packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 54fe9e9ea6..0000000000 --- a/packages/cosmwasm-stargate/types/codec/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,269 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export 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; -} - -const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTotal: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.key); - writer.uint32(16).uint64(message.offset); - writer.uint32(24).uint64(message.limit); - writer.uint32(32).bool(message.countTotal); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = reader.uint64() as Long; - break; - case 3: - message.limit = reader.uint64() as Long; - break; - case 4: - message.countTotal = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Long.fromString(object.offset); - } else { - message.offset = Long.UZERO; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Long.fromString(object.limit); - } else { - message.limit = Long.UZERO; - } - if (object.countTotal !== undefined && object.countTotal !== null) { - message.countTotal = Boolean(object.countTotal); - } else { - message.countTotal = false; - } - return message; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset as Long; - } else { - message.offset = Long.UZERO; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit as Long; - } else { - message.limit = Long.UZERO; - } - if (object.countTotal !== undefined && object.countTotal !== null) { - message.countTotal = object.countTotal; - } else { - message.countTotal = false; - } - return message; - }, - - toJSON(message: PageRequest): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); - message.countTotal !== undefined && (obj.countTotal = message.countTotal); - return obj; - }, -}; - -const basePageResponse: object = { total: Long.UZERO }; - -export const PageResponse = { - encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.nextKey); - writer.uint32(16).uint64(message.total); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nextKey = reader.bytes(); - break; - case 2: - message.total = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.nextKey !== undefined && object.nextKey !== null) { - message.nextKey = bytesFromBase64(object.nextKey); - } - if (object.total !== undefined && object.total !== null) { - message.total = Long.fromString(object.total); - } else { - message.total = Long.UZERO; - } - return message; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.nextKey !== undefined && object.nextKey !== null) { - message.nextKey = object.nextKey; - } else { - message.nextKey = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total as Long; - } else { - message.total = Long.UZERO; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.nextKey !== undefined && - (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); - return obj; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw new Error("Unable to locate global object"); -})(); - -const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.d.ts b/packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.d.ts deleted file mode 100644 index 67d31d1c58..0000000000 --- a/packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -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/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.ts b/packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index 9e54cfd1ef..0000000000 --- a/packages/cosmwasm-stargate/types/codec/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -1,290 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export 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; -} - -const baseCoin: object = { denom: "", amount: "" }; - -export const Coin = { - encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.denom); - writer.uint32(18).string(message.amount); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCoin } as Coin; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, -}; - -const baseDecCoin: object = { denom: "", amount: "" }; - -export const DecCoin = { - encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.denom); - writer.uint32(18).string(message.amount); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecCoin } as DecCoin; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - return message; - }, - - toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, -}; - -const baseIntProto: object = { int: "" }; - -export const IntProto = { - encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.int); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseIntProto } as IntProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } - return message; - }, - - toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; - }, -}; - -const baseDecProto: object = { dec: "" }; - -export const DecProto = { - encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.dec); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDecProto } as DecProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } - return message; - }, - - toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.d.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.d.ts deleted file mode 100644 index 38d3eb5f99..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.d.ts +++ /dev/null @@ -1,286 +0,0 @@ -import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../../x/wasm/internal/types/types"; -import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; -export declare const protobufPackage = "cosmwasm.wasm.v1beta1"; -/** QueryContractInfoRequest is the request type for the Query/ContractInfo RPC method */ -export interface QueryContractInfoRequest { - /** address is the address of the contract to query */ - address: string; -} -/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */ -export interface QueryContractInfoResponse { - /** address is the address of the contract */ - address: string; - contractInfo?: ContractInfo; -} -/** QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method */ -export interface QueryContractHistoryRequest { - /** address is the address of the contract to query */ - address: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} -/** QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method */ -export interface QueryContractHistoryResponse { - entries: ContractCodeHistoryEntry[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} -/** QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method */ -export interface QueryContractsByCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ - codeId: Long; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} -/** ContractInfoWithAddress adds the address (key) to the ContractInfo representation */ -export interface ContractInfoWithAddress { - address: string; - contractInfo?: ContractInfo; -} -/** QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method */ -export interface QueryContractsByCodeResponse { - contractInfos: ContractInfoWithAddress[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} -/** QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method */ -export interface QueryAllContractStateRequest { - /** address is the address of the contract */ - address: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} -/** QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method */ -export interface QueryAllContractStateResponse { - models: Model[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} -/** QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method */ -export interface QueryRawContractStateRequest { - /** address is the address of the contract */ - address: string; - queryData: Uint8Array; -} -/** QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method */ -export interface QueryRawContractStateResponse { - /** Data contains the raw store data */ - data: Uint8Array; -} -/** QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method */ -export interface QuerySmartContractStateRequest { - /** address is the address of the contract */ - address: string; - /** QueryData contains the query data passed to the contract */ - queryData: Uint8Array; -} -/** QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method */ -export interface QuerySmartContractStateResponse { - /** Data contains the json data returned from the smart contract */ - data: Uint8Array; -} -/** QueryCodeRequest is the request type for the Query/Code RPC method */ -export interface QueryCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ - codeId: Long; -} -/** CodeInfoResponse contains code meta data from CodeInfo */ -export interface CodeInfoResponse { - /** id for legacy support */ - codeId: Long; - creator: string; - dataHash: Uint8Array; - source: string; - builder: string; -} -/** QueryCodeResponse is the response type for the Query/Code RPC method */ -export interface QueryCodeResponse { - codeInfo?: CodeInfoResponse; - data: Uint8Array; -} -/** QueryCodesRequest is the request type for the Query/Codes RPC method */ -export interface QueryCodesRequest { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} -/** QueryCodesResponse is the response type for the Query/Codes RPC method */ -export interface QueryCodesResponse { - codeInfos: CodeInfoResponse[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} -export declare const QueryContractInfoRequest: { - encode(message: QueryContractInfoRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractInfoRequest; - fromJSON(object: any): QueryContractInfoRequest; - fromPartial(object: DeepPartial): QueryContractInfoRequest; - toJSON(message: QueryContractInfoRequest): unknown; -}; -export declare const QueryContractInfoResponse: { - encode(message: QueryContractInfoResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractInfoResponse; - fromJSON(object: any): QueryContractInfoResponse; - fromPartial(object: DeepPartial): QueryContractInfoResponse; - toJSON(message: QueryContractInfoResponse): unknown; -}; -export declare const QueryContractHistoryRequest: { - encode(message: QueryContractHistoryRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractHistoryRequest; - fromJSON(object: any): QueryContractHistoryRequest; - fromPartial(object: DeepPartial): QueryContractHistoryRequest; - toJSON(message: QueryContractHistoryRequest): unknown; -}; -export declare const QueryContractHistoryResponse: { - encode(message: QueryContractHistoryResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractHistoryResponse; - fromJSON(object: any): QueryContractHistoryResponse; - fromPartial(object: DeepPartial): QueryContractHistoryResponse; - toJSON(message: QueryContractHistoryResponse): unknown; -}; -export declare const QueryContractsByCodeRequest: { - encode(message: QueryContractsByCodeRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractsByCodeRequest; - fromJSON(object: any): QueryContractsByCodeRequest; - fromPartial(object: DeepPartial): QueryContractsByCodeRequest; - toJSON(message: QueryContractsByCodeRequest): unknown; -}; -export declare const ContractInfoWithAddress: { - encode(message: ContractInfoWithAddress, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractInfoWithAddress; - fromJSON(object: any): ContractInfoWithAddress; - fromPartial(object: DeepPartial): ContractInfoWithAddress; - toJSON(message: ContractInfoWithAddress): unknown; -}; -export declare const QueryContractsByCodeResponse: { - encode(message: QueryContractsByCodeResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractsByCodeResponse; - fromJSON(object: any): QueryContractsByCodeResponse; - fromPartial(object: DeepPartial): QueryContractsByCodeResponse; - toJSON(message: QueryContractsByCodeResponse): unknown; -}; -export declare const QueryAllContractStateRequest: { - encode(message: QueryAllContractStateRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllContractStateRequest; - fromJSON(object: any): QueryAllContractStateRequest; - fromPartial(object: DeepPartial): QueryAllContractStateRequest; - toJSON(message: QueryAllContractStateRequest): unknown; -}; -export declare const QueryAllContractStateResponse: { - encode(message: QueryAllContractStateResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllContractStateResponse; - fromJSON(object: any): QueryAllContractStateResponse; - fromPartial(object: DeepPartial): QueryAllContractStateResponse; - toJSON(message: QueryAllContractStateResponse): unknown; -}; -export declare const QueryRawContractStateRequest: { - encode(message: QueryRawContractStateRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRawContractStateRequest; - fromJSON(object: any): QueryRawContractStateRequest; - fromPartial(object: DeepPartial): QueryRawContractStateRequest; - toJSON(message: QueryRawContractStateRequest): unknown; -}; -export declare const QueryRawContractStateResponse: { - encode(message: QueryRawContractStateResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRawContractStateResponse; - fromJSON(object: any): QueryRawContractStateResponse; - fromPartial(object: DeepPartial): QueryRawContractStateResponse; - toJSON(message: QueryRawContractStateResponse): unknown; -}; -export declare const QuerySmartContractStateRequest: { - encode(message: QuerySmartContractStateRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySmartContractStateRequest; - fromJSON(object: any): QuerySmartContractStateRequest; - fromPartial(object: DeepPartial): QuerySmartContractStateRequest; - toJSON(message: QuerySmartContractStateRequest): unknown; -}; -export declare const QuerySmartContractStateResponse: { - encode(message: QuerySmartContractStateResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySmartContractStateResponse; - fromJSON(object: any): QuerySmartContractStateResponse; - fromPartial(object: DeepPartial): QuerySmartContractStateResponse; - toJSON(message: QuerySmartContractStateResponse): unknown; -}; -export declare const QueryCodeRequest: { - encode(message: QueryCodeRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodeRequest; - fromJSON(object: any): QueryCodeRequest; - fromPartial(object: DeepPartial): QueryCodeRequest; - toJSON(message: QueryCodeRequest): unknown; -}; -export declare const CodeInfoResponse: { - encode(message: CodeInfoResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CodeInfoResponse; - fromJSON(object: any): CodeInfoResponse; - fromPartial(object: DeepPartial): CodeInfoResponse; - toJSON(message: CodeInfoResponse): unknown; -}; -export declare const QueryCodeResponse: { - encode(message: QueryCodeResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodeResponse; - fromJSON(object: any): QueryCodeResponse; - fromPartial(object: DeepPartial): QueryCodeResponse; - toJSON(message: QueryCodeResponse): unknown; -}; -export declare const QueryCodesRequest: { - encode(message: QueryCodesRequest, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodesRequest; - fromJSON(object: any): QueryCodesRequest; - fromPartial(object: DeepPartial): QueryCodesRequest; - toJSON(message: QueryCodesRequest): unknown; -}; -export declare const QueryCodesResponse: { - encode(message: QueryCodesResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodesResponse; - fromJSON(object: any): QueryCodesResponse; - fromPartial(object: DeepPartial): QueryCodesResponse; - toJSON(message: QueryCodesResponse): unknown; -}; -/** Query provides defines the gRPC querier service */ -export interface Query { - /** ContractInfo gets the contract meta data */ - ContractInfo(request: QueryContractInfoRequest): Promise; - /** ContractHistory gets the contract code history */ - ContractHistory(request: QueryContractHistoryRequest): Promise; - /** ContractsByCode lists all smart contracts for a code id */ - ContractsByCode(request: QueryContractsByCodeRequest): Promise; - /** AllContractState gets all raw store data for a single contract */ - AllContractState(request: QueryAllContractStateRequest): Promise; - /** RawContractState gets single key from the raw store data of a contract */ - RawContractState(request: QueryRawContractStateRequest): Promise; - /** SmartContractState get smart query result from the contract */ - SmartContractState(request: QuerySmartContractStateRequest): Promise; - /** Code gets the binary code and metadata for a singe wasm code */ - Code(request: QueryCodeRequest): Promise; - /** Codes gets the metadata for all stored wasm codes */ - Codes(request: QueryCodesRequest): Promise; -} -export declare class QueryClientImpl implements Query { - private readonly rpc; - constructor(rpc: Rpc); - ContractInfo(request: QueryContractInfoRequest): Promise; - ContractHistory(request: QueryContractHistoryRequest): Promise; - ContractsByCode(request: QueryContractsByCodeRequest): Promise; - AllContractState(request: QueryAllContractStateRequest): Promise; - RawContractState(request: QueryRawContractStateRequest): Promise; - SmartContractState(request: QuerySmartContractStateRequest): Promise; - Code(request: QueryCodeRequest): Promise; - Codes(request: QueryCodesRequest): 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/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.ts deleted file mode 100644 index ccb657920b..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/query.ts +++ /dev/null @@ -1,1516 +0,0 @@ -/* eslint-disable */ -import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../../x/wasm/internal/types/types"; -import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "cosmwasm.wasm.v1beta1"; - -/** QueryContractInfoRequest is the request type for the Query/ContractInfo RPC method */ -export interface QueryContractInfoRequest { - /** address is the address of the contract to query */ - address: string; -} - -/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */ -export interface QueryContractInfoResponse { - /** address is the address of the contract */ - address: string; - contractInfo?: ContractInfo; -} - -/** QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method */ -export interface QueryContractHistoryRequest { - /** address is the address of the contract to query */ - address: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} - -/** QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method */ -export interface QueryContractHistoryResponse { - entries: ContractCodeHistoryEntry[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} - -/** QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method */ -export interface QueryContractsByCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ - codeId: Long; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} - -/** ContractInfoWithAddress adds the address (key) to the ContractInfo representation */ -export interface ContractInfoWithAddress { - address: string; - contractInfo?: ContractInfo; -} - -/** QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method */ -export interface QueryContractsByCodeResponse { - contractInfos: ContractInfoWithAddress[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} - -/** QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method */ -export interface QueryAllContractStateRequest { - /** address is the address of the contract */ - address: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} - -/** QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method */ -export interface QueryAllContractStateResponse { - models: Model[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} - -/** QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method */ -export interface QueryRawContractStateRequest { - /** address is the address of the contract */ - address: string; - queryData: Uint8Array; -} - -/** QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method */ -export interface QueryRawContractStateResponse { - /** Data contains the raw store data */ - data: Uint8Array; -} - -/** QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method */ -export interface QuerySmartContractStateRequest { - /** address is the address of the contract */ - address: string; - /** QueryData contains the query data passed to the contract */ - queryData: Uint8Array; -} - -/** QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method */ -export interface QuerySmartContractStateResponse { - /** Data contains the json data returned from the smart contract */ - data: Uint8Array; -} - -/** QueryCodeRequest is the request type for the Query/Code RPC method */ -export interface QueryCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ - codeId: Long; -} - -/** CodeInfoResponse contains code meta data from CodeInfo */ -export interface CodeInfoResponse { - /** id for legacy support */ - codeId: Long; - creator: string; - dataHash: Uint8Array; - source: string; - builder: string; -} - -/** QueryCodeResponse is the response type for the Query/Code RPC method */ -export interface QueryCodeResponse { - codeInfo?: CodeInfoResponse; - data: Uint8Array; -} - -/** QueryCodesRequest is the request type for the Query/Codes RPC method */ -export interface QueryCodesRequest { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; -} - -/** QueryCodesResponse is the response type for the Query/Codes RPC method */ -export interface QueryCodesResponse { - codeInfos: CodeInfoResponse[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponse; -} - -const baseQueryContractInfoRequest: object = { address: "" }; - -export const QueryContractInfoRequest = { - encode(message: QueryContractInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractInfoRequest { - const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractInfoRequest { - const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - return message; - }, - - toJSON(message: QueryContractInfoRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - return obj; - }, -}; - -const baseQueryContractInfoResponse: object = { address: "" }; - -export const QueryContractInfoResponse = { - encode(message: QueryContractInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - if (message.contractInfo !== undefined && message.contractInfo !== undefined) { - ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.contractInfo = ContractInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractInfoResponse { - const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.contractInfo !== undefined && object.contractInfo !== null) { - message.contractInfo = ContractInfo.fromJSON(object.contractInfo); - } else { - message.contractInfo = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractInfoResponse { - const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.contractInfo !== undefined && object.contractInfo !== null) { - message.contractInfo = ContractInfo.fromPartial(object.contractInfo); - } else { - message.contractInfo = undefined; - } - return message; - }, - - toJSON(message: QueryContractInfoResponse): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.contractInfo !== undefined && - (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); - return obj; - }, -}; - -const baseQueryContractHistoryRequest: object = { address: "" }; - -export const QueryContractHistoryRequest = { - encode(message: QueryContractHistoryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - if (message.pagination !== undefined && message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractHistoryRequest { - const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractHistoryRequest { - const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryContractHistoryRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryContractHistoryResponse: object = {}; - -export const QueryContractHistoryResponse = { - encode(message: QueryContractHistoryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.entries) { - ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined && message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; - message.entries = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.entries.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractHistoryResponse { - const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(ContractCodeHistoryEntry.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractHistoryResponse { - const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(ContractCodeHistoryEntry.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryContractHistoryResponse): unknown { - const obj: any = {}; - if (message.entries) { - obj.entries = message.entries.map((e) => (e ? ContractCodeHistoryEntry.toJSON(e) : undefined)); - } else { - obj.entries = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryContractsByCodeRequest: object = { codeId: Long.UZERO }; - -export const QueryContractsByCodeRequest = { - encode(message: QueryContractsByCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.codeId); - if (message.pagination !== undefined && message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64() as Long; - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractsByCodeRequest { - const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractsByCodeRequest { - const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryContractsByCodeRequest): unknown { - const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseContractInfoWithAddress: object = { address: "" }; - -export const ContractInfoWithAddress = { - encode(message: ContractInfoWithAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - if (message.contractInfo !== undefined && message.contractInfo !== undefined) { - ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfoWithAddress { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.contractInfo = ContractInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContractInfoWithAddress { - const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.contractInfo !== undefined && object.contractInfo !== null) { - message.contractInfo = ContractInfo.fromJSON(object.contractInfo); - } else { - message.contractInfo = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): ContractInfoWithAddress { - const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.contractInfo !== undefined && object.contractInfo !== null) { - message.contractInfo = ContractInfo.fromPartial(object.contractInfo); - } else { - message.contractInfo = undefined; - } - return message; - }, - - toJSON(message: ContractInfoWithAddress): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.contractInfo !== undefined && - (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); - return obj; - }, -}; - -const baseQueryContractsByCodeResponse: object = {}; - -export const QueryContractsByCodeResponse = { - encode(message: QueryContractsByCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.contractInfos) { - ContractInfoWithAddress.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined && message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; - message.contractInfos = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractInfos.push(ContractInfoWithAddress.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryContractsByCodeResponse { - const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; - message.contractInfos = []; - if (object.contractInfos !== undefined && object.contractInfos !== null) { - for (const e of object.contractInfos) { - message.contractInfos.push(ContractInfoWithAddress.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryContractsByCodeResponse { - const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; - message.contractInfos = []; - if (object.contractInfos !== undefined && object.contractInfos !== null) { - for (const e of object.contractInfos) { - message.contractInfos.push(ContractInfoWithAddress.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryContractsByCodeResponse): unknown { - const obj: any = {}; - if (message.contractInfos) { - obj.contractInfos = message.contractInfos.map((e) => - e ? ContractInfoWithAddress.toJSON(e) : undefined, - ); - } else { - obj.contractInfos = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryAllContractStateRequest: object = { address: "" }; - -export const QueryAllContractStateRequest = { - encode(message: QueryAllContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - if (message.pagination !== undefined && message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllContractStateRequest { - const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryAllContractStateRequest { - const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllContractStateRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryAllContractStateResponse: object = {}; - -export const QueryAllContractStateResponse = { - encode(message: QueryAllContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.models) { - Model.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined && message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; - message.models = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.models.push(Model.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllContractStateResponse { - const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; - message.models = []; - if (object.models !== undefined && object.models !== null) { - for (const e of object.models) { - message.models.push(Model.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryAllContractStateResponse { - const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; - message.models = []; - if (object.models !== undefined && object.models !== null) { - for (const e of object.models) { - message.models.push(Model.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllContractStateResponse): unknown { - const obj: any = {}; - if (message.models) { - obj.models = message.models.map((e) => (e ? Model.toJSON(e) : undefined)); - } else { - obj.models = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryRawContractStateRequest: object = { address: "" }; - -export const QueryRawContractStateRequest = { - encode(message: QueryRawContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - writer.uint32(18).bytes(message.queryData); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.queryData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryRawContractStateRequest { - const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.queryData !== undefined && object.queryData !== null) { - message.queryData = bytesFromBase64(object.queryData); - } - return message; - }, - - fromPartial(object: DeepPartial): QueryRawContractStateRequest { - const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.queryData !== undefined && object.queryData !== null) { - message.queryData = object.queryData; - } else { - message.queryData = new Uint8Array(); - } - return message; - }, - - toJSON(message: QueryRawContractStateRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.queryData !== undefined && - (obj.queryData = base64FromBytes( - message.queryData !== undefined ? message.queryData : new Uint8Array(), - )); - return obj; - }, -}; - -const baseQueryRawContractStateResponse: object = {}; - -export const QueryRawContractStateResponse = { - encode(message: QueryRawContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.data); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryRawContractStateResponse { - const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - fromPartial(object: DeepPartial): QueryRawContractStateResponse { - const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, - - toJSON(message: QueryRawContractStateResponse): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; - }, -}; - -const baseQuerySmartContractStateRequest: object = { address: "" }; - -export const QuerySmartContractStateRequest = { - encode(message: QuerySmartContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - writer.uint32(18).bytes(message.queryData); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.queryData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySmartContractStateRequest { - const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.queryData !== undefined && object.queryData !== null) { - message.queryData = bytesFromBase64(object.queryData); - } - return message; - }, - - fromPartial(object: DeepPartial): QuerySmartContractStateRequest { - const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.queryData !== undefined && object.queryData !== null) { - message.queryData = object.queryData; - } else { - message.queryData = new Uint8Array(); - } - return message; - }, - - toJSON(message: QuerySmartContractStateRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.queryData !== undefined && - (obj.queryData = base64FromBytes( - message.queryData !== undefined ? message.queryData : new Uint8Array(), - )); - return obj; - }, -}; - -const baseQuerySmartContractStateResponse: object = {}; - -export const QuerySmartContractStateResponse = { - encode(message: QuerySmartContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.data); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QuerySmartContractStateResponse { - const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - fromPartial(object: DeepPartial): QuerySmartContractStateResponse { - const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, - - toJSON(message: QuerySmartContractStateResponse): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; - }, -}; - -const baseQueryCodeRequest: object = { codeId: Long.UZERO }; - -export const QueryCodeRequest = { - encode(message: QueryCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.codeId); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCodeRequest { - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryCodeRequest { - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - return message; - }, - - toJSON(message: QueryCodeRequest): unknown { - const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - return obj; - }, -}; - -const baseCodeInfoResponse: object = { codeId: Long.UZERO, creator: "", source: "", builder: "" }; - -export const CodeInfoResponse = { - encode(message: CodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.codeId); - writer.uint32(18).string(message.creator); - writer.uint32(26).bytes(message.dataHash); - writer.uint32(34).string(message.source); - writer.uint32(42).string(message.builder); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfoResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64() as Long; - break; - case 2: - message.creator = reader.string(); - break; - case 3: - message.dataHash = reader.bytes(); - break; - case 4: - message.source = reader.string(); - break; - case 5: - message.builder = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CodeInfoResponse { - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if (object.dataHash !== undefined && object.dataHash !== null) { - message.dataHash = bytesFromBase64(object.dataHash); - } - if (object.source !== undefined && object.source !== null) { - message.source = String(object.source); - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = String(object.builder); - } else { - message.builder = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): CodeInfoResponse { - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if (object.dataHash !== undefined && object.dataHash !== null) { - message.dataHash = object.dataHash; - } else { - message.dataHash = new Uint8Array(); - } - if (object.source !== undefined && object.source !== null) { - message.source = object.source; - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = object.builder; - } else { - message.builder = ""; - } - return message; - }, - - toJSON(message: CodeInfoResponse): unknown { - const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.creator !== undefined && (obj.creator = message.creator); - message.dataHash !== undefined && - (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); - message.source !== undefined && (obj.source = message.source); - message.builder !== undefined && (obj.builder = message.builder); - return obj; - }, -}; - -const baseQueryCodeResponse: object = {}; - -export const QueryCodeResponse = { - encode(message: QueryCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.codeInfo !== undefined && message.codeInfo !== undefined) { - CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); - } - writer.uint32(18).bytes(message.data); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); - break; - case 2: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCodeResponse { - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; - if (object.codeInfo !== undefined && object.codeInfo !== null) { - message.codeInfo = CodeInfoResponse.fromJSON(object.codeInfo); - } else { - message.codeInfo = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - fromPartial(object: DeepPartial): QueryCodeResponse { - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; - if (object.codeInfo !== undefined && object.codeInfo !== null) { - message.codeInfo = CodeInfoResponse.fromPartial(object.codeInfo); - } else { - message.codeInfo = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, - - toJSON(message: QueryCodeResponse): unknown { - const obj: any = {}; - message.codeInfo !== undefined && - (obj.codeInfo = message.codeInfo ? CodeInfoResponse.toJSON(message.codeInfo) : undefined); - message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; - }, -}; - -const baseQueryCodesRequest: object = {}; - -export const QueryCodesRequest = { - encode(message: QueryCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined && message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesRequest { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCodesRequest { - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryCodesRequest { - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryCodesRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -const baseQueryCodesResponse: object = {}; - -export const QueryCodesResponse = { - encode(message: QueryCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.codeInfos) { - CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined && message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.codeInfos = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeInfos.push(CodeInfoResponse.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryCodesResponse { - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.codeInfos = []; - if (object.codeInfos !== undefined && object.codeInfos !== null) { - for (const e of object.codeInfos) { - message.codeInfos.push(CodeInfoResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): QueryCodesResponse { - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.codeInfos = []; - if (object.codeInfos !== undefined && object.codeInfos !== null) { - for (const e of object.codeInfos) { - message.codeInfos.push(CodeInfoResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryCodesResponse): unknown { - const obj: any = {}; - if (message.codeInfos) { - obj.codeInfos = message.codeInfos.map((e) => (e ? CodeInfoResponse.toJSON(e) : undefined)); - } else { - obj.codeInfos = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, -}; - -/** Query provides defines the gRPC querier service */ -export interface Query { - /** ContractInfo gets the contract meta data */ - ContractInfo(request: QueryContractInfoRequest): Promise; - /** ContractHistory gets the contract code history */ - ContractHistory(request: QueryContractHistoryRequest): Promise; - /** ContractsByCode lists all smart contracts for a code id */ - ContractsByCode(request: QueryContractsByCodeRequest): Promise; - /** AllContractState gets all raw store data for a single contract */ - AllContractState(request: QueryAllContractStateRequest): Promise; - /** RawContractState gets single key from the raw store data of a contract */ - RawContractState(request: QueryRawContractStateRequest): Promise; - /** SmartContractState get smart query result from the contract */ - SmartContractState(request: QuerySmartContractStateRequest): Promise; - /** Code gets the binary code and metadata for a singe wasm code */ - Code(request: QueryCodeRequest): Promise; - /** Codes gets the metadata for all stored wasm codes */ - Codes(request: QueryCodesRequest): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - ContractInfo(request: QueryContractInfoRequest): Promise { - const data = QueryContractInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractInfo", data); - return promise.then((data) => QueryContractInfoResponse.decode(new _m0.Reader(data))); - } - - ContractHistory(request: QueryContractHistoryRequest): Promise { - const data = QueryContractHistoryRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractHistory", data); - return promise.then((data) => QueryContractHistoryResponse.decode(new _m0.Reader(data))); - } - - ContractsByCode(request: QueryContractsByCodeRequest): Promise { - const data = QueryContractsByCodeRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractsByCode", data); - return promise.then((data) => QueryContractsByCodeResponse.decode(new _m0.Reader(data))); - } - - AllContractState(request: QueryAllContractStateRequest): Promise { - const data = QueryAllContractStateRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "AllContractState", data); - return promise.then((data) => QueryAllContractStateResponse.decode(new _m0.Reader(data))); - } - - RawContractState(request: QueryRawContractStateRequest): Promise { - const data = QueryRawContractStateRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "RawContractState", data); - return promise.then((data) => QueryRawContractStateResponse.decode(new _m0.Reader(data))); - } - - SmartContractState(request: QuerySmartContractStateRequest): Promise { - const data = QuerySmartContractStateRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "SmartContractState", data); - return promise.then((data) => QuerySmartContractStateResponse.decode(new _m0.Reader(data))); - } - - Code(request: QueryCodeRequest): Promise { - const data = QueryCodeRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "Code", data); - return promise.then((data) => QueryCodeResponse.decode(new _m0.Reader(data))); - } - - Codes(request: QueryCodesRequest): Promise { - const data = QueryCodesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "Codes", data); - return promise.then((data) => QueryCodesResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw new Error("Unable to locate global object"); -})(); - -const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.d.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.d.ts deleted file mode 100644 index cdff96776f..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { AccessConfig } from "../../../../x/wasm/internal/types/types"; -import Long from "long"; -import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import _m0 from "protobufjs/minimal"; -export declare const protobufPackage = "cosmwasm.wasm.v1beta1"; -/** MsgStoreCode submit Wasm code to the system */ -export interface MsgStoreCode { - /** Sender is the that actor that signed the messages */ - sender: string; - /** WASMByteCode can be raw or gzip compressed */ - wasmByteCode: Uint8Array; - /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ - source: string; - /** Builder is a valid docker image name with tag, optional */ - builder: string; - /** InstantiatePermission access control to apply on contract creation, optional */ - instantiatePermission?: AccessConfig; -} -/** MsgStoreCodeResponse returns store result data. */ -export interface MsgStoreCodeResponse { - /** CodeID is the reference to the stored WASM code */ - codeId: Long; -} -/** MsgInstantiateContract create a new smart contract instance for the given code id. */ -export interface MsgInstantiateContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** CodeID is the reference to the stored WASM code */ - codeId: Long; - /** Label is optional metadata to be stored with a contract instance. */ - label: string; - /** InitMsg json encoded message to be passed to the contract on instantiation */ - initMsg: Uint8Array; - /** InitFunds coins that are transferred to the contract on instantiation */ - initFunds: Coin[]; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; -} -/** MsgExecuteContract submits the given message data to a smart contract */ -export interface MsgExecuteContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; - /** Msg json encoded message to be passed to the contract */ - msg: Uint8Array; - /** SentFunds coins that are transferred to the contract on execution */ - sentFunds: Coin[]; -} -/** MsgExecuteContractResponse returns execution result data. */ -export interface MsgExecuteContractResponse { - /** Data contains base64-encoded bytes to returned from the contract */ - data: Uint8Array; -} -/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ -export interface MsgMigrateContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; - /** CodeID references the new WASM code */ - codeId: Long; - /** MigrateMsg json encoded message to be passed to the contract on migration */ - migrateMsg: Uint8Array; -} -/** MsgMigrateContractResponse returns contract migration result data. */ -export interface MsgMigrateContractResponse { - /** - * Data contains same raw bytes returned as data from the wasm contract. - * (May be empty) - */ - data: Uint8Array; -} -/** MsgUpdateAdmin sets a new admin for a smart contract */ -export interface MsgUpdateAdmin { - /** Sender is the that actor that signed the messages */ - sender: string; - /** NewAdmin address to be set */ - newAdmin: string; - /** Contract is the address of the smart contract */ - contract: string; -} -/** MsgUpdateAdminResponse returns empty data */ -export interface MsgUpdateAdminResponse {} -/** MsgClearAdmin removes any admin stored for a smart contract */ -export interface MsgClearAdmin { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; -} -/** MsgClearAdminResponse returns empty data */ -export interface MsgClearAdminResponse {} -export declare const MsgStoreCode: { - encode(message: MsgStoreCode, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgStoreCode; - fromJSON(object: any): MsgStoreCode; - fromPartial(object: DeepPartial): MsgStoreCode; - toJSON(message: MsgStoreCode): unknown; -}; -export declare const MsgStoreCodeResponse: { - encode(message: MsgStoreCodeResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgStoreCodeResponse; - fromJSON(object: any): MsgStoreCodeResponse; - fromPartial(object: DeepPartial): MsgStoreCodeResponse; - toJSON(message: MsgStoreCodeResponse): unknown; -}; -export declare const MsgInstantiateContract: { - encode(message: MsgInstantiateContract, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgInstantiateContract; - fromJSON(object: any): MsgInstantiateContract; - fromPartial(object: DeepPartial): MsgInstantiateContract; - toJSON(message: MsgInstantiateContract): unknown; -}; -export declare const MsgInstantiateContractResponse: { - encode(message: MsgInstantiateContractResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgInstantiateContractResponse; - fromJSON(object: any): MsgInstantiateContractResponse; - fromPartial(object: DeepPartial): MsgInstantiateContractResponse; - toJSON(message: MsgInstantiateContractResponse): unknown; -}; -export declare const MsgExecuteContract: { - encode(message: MsgExecuteContract, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgExecuteContract; - fromJSON(object: any): MsgExecuteContract; - fromPartial(object: DeepPartial): MsgExecuteContract; - toJSON(message: MsgExecuteContract): unknown; -}; -export declare const MsgExecuteContractResponse: { - encode(message: MsgExecuteContractResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgExecuteContractResponse; - fromJSON(object: any): MsgExecuteContractResponse; - fromPartial(object: DeepPartial): MsgExecuteContractResponse; - toJSON(message: MsgExecuteContractResponse): unknown; -}; -export declare const MsgMigrateContract: { - encode(message: MsgMigrateContract, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMigrateContract; - fromJSON(object: any): MsgMigrateContract; - fromPartial(object: DeepPartial): MsgMigrateContract; - toJSON(message: MsgMigrateContract): unknown; -}; -export declare const MsgMigrateContractResponse: { - encode(message: MsgMigrateContractResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMigrateContractResponse; - fromJSON(object: any): MsgMigrateContractResponse; - fromPartial(object: DeepPartial): MsgMigrateContractResponse; - toJSON(message: MsgMigrateContractResponse): unknown; -}; -export declare const MsgUpdateAdmin: { - encode(message: MsgUpdateAdmin, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUpdateAdmin; - fromJSON(object: any): MsgUpdateAdmin; - fromPartial(object: DeepPartial): MsgUpdateAdmin; - toJSON(message: MsgUpdateAdmin): unknown; -}; -export declare const MsgUpdateAdminResponse: { - encode(_: MsgUpdateAdminResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUpdateAdminResponse; - fromJSON(_: any): MsgUpdateAdminResponse; - fromPartial(_: DeepPartial): MsgUpdateAdminResponse; - toJSON(_: MsgUpdateAdminResponse): unknown; -}; -export declare const MsgClearAdmin: { - encode(message: MsgClearAdmin, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClearAdmin; - fromJSON(object: any): MsgClearAdmin; - fromPartial(object: DeepPartial): MsgClearAdmin; - toJSON(message: MsgClearAdmin): unknown; -}; -export declare const MsgClearAdminResponse: { - encode(_: MsgClearAdminResponse, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClearAdminResponse; - fromJSON(_: any): MsgClearAdminResponse; - fromPartial(_: DeepPartial): MsgClearAdminResponse; - toJSON(_: MsgClearAdminResponse): unknown; -}; -/** Msg defines the wasm Msg service. */ -export interface Msg { - /** StoreCode to submit Wasm code to the system */ - StoreCode(request: MsgStoreCode): Promise; - /** Instantiate creates a new smart contract instance for the given code id. */ - InstantiateContract(request: MsgInstantiateContract): Promise; - /** Execute submits the given message data to a smart contract */ - ExecuteContract(request: MsgExecuteContract): Promise; - /** Migrate runs a code upgrade/ downgrade for a smart contract */ - MigrateContract(request: MsgMigrateContract): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ - UpdateAdmin(request: MsgUpdateAdmin): Promise; - /** ClearAdmin removes any admin stored for a smart contract */ - ClearAdmin(request: MsgClearAdmin): Promise; -} -export declare class MsgClientImpl implements Msg { - private readonly rpc; - constructor(rpc: Rpc); - StoreCode(request: MsgStoreCode): Promise; - InstantiateContract(request: MsgInstantiateContract): Promise; - ExecuteContract(request: MsgExecuteContract): Promise; - MigrateContract(request: MsgMigrateContract): Promise; - UpdateAdmin(request: MsgUpdateAdmin): Promise; - ClearAdmin(request: MsgClearAdmin): 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/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.ts deleted file mode 100644 index 8f7a610be9..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/tx.ts +++ /dev/null @@ -1,1113 +0,0 @@ -/* eslint-disable */ -import { AccessConfig } from "../../../../x/wasm/internal/types/types"; -import Long from "long"; -import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "cosmwasm.wasm.v1beta1"; - -/** MsgStoreCode submit Wasm code to the system */ -export interface MsgStoreCode { - /** Sender is the that actor that signed the messages */ - sender: string; - /** WASMByteCode can be raw or gzip compressed */ - wasmByteCode: Uint8Array; - /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ - source: string; - /** Builder is a valid docker image name with tag, optional */ - builder: string; - /** InstantiatePermission access control to apply on contract creation, optional */ - instantiatePermission?: AccessConfig; -} - -/** MsgStoreCodeResponse returns store result data. */ -export interface MsgStoreCodeResponse { - /** CodeID is the reference to the stored WASM code */ - codeId: Long; -} - -/** MsgInstantiateContract create a new smart contract instance for the given code id. */ -export interface MsgInstantiateContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** CodeID is the reference to the stored WASM code */ - codeId: Long; - /** Label is optional metadata to be stored with a contract instance. */ - label: string; - /** InitMsg json encoded message to be passed to the contract on instantiation */ - initMsg: Uint8Array; - /** InitFunds coins that are transferred to the contract on instantiation */ - initFunds: Coin[]; -} - -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; -} - -/** MsgExecuteContract submits the given message data to a smart contract */ -export interface MsgExecuteContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; - /** Msg json encoded message to be passed to the contract */ - msg: Uint8Array; - /** SentFunds coins that are transferred to the contract on execution */ - sentFunds: Coin[]; -} - -/** MsgExecuteContractResponse returns execution result data. */ -export interface MsgExecuteContractResponse { - /** Data contains base64-encoded bytes to returned from the contract */ - data: Uint8Array; -} - -/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ -export interface MsgMigrateContract { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; - /** CodeID references the new WASM code */ - codeId: Long; - /** MigrateMsg json encoded message to be passed to the contract on migration */ - migrateMsg: Uint8Array; -} - -/** MsgMigrateContractResponse returns contract migration result data. */ -export interface MsgMigrateContractResponse { - /** - * Data contains same raw bytes returned as data from the wasm contract. - * (May be empty) - */ - data: Uint8Array; -} - -/** MsgUpdateAdmin sets a new admin for a smart contract */ -export interface MsgUpdateAdmin { - /** Sender is the that actor that signed the messages */ - sender: string; - /** NewAdmin address to be set */ - newAdmin: string; - /** Contract is the address of the smart contract */ - contract: string; -} - -/** MsgUpdateAdminResponse returns empty data */ -export interface MsgUpdateAdminResponse {} - -/** MsgClearAdmin removes any admin stored for a smart contract */ -export interface MsgClearAdmin { - /** Sender is the that actor that signed the messages */ - sender: string; - /** Contract is the address of the smart contract */ - contract: string; -} - -/** MsgClearAdminResponse returns empty data */ -export interface MsgClearAdminResponse {} - -const baseMsgStoreCode: object = { sender: "", source: "", builder: "" }; - -export const MsgStoreCode = { - encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(18).bytes(message.wasmByteCode); - writer.uint32(26).string(message.source); - writer.uint32(34).string(message.builder); - if (message.instantiatePermission !== undefined && message.instantiatePermission !== undefined) { - AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCode } as MsgStoreCode; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.wasmByteCode = reader.bytes(); - break; - case 3: - message.source = reader.string(); - break; - case 4: - message.builder = reader.string(); - break; - case 5: - message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { - message.wasmByteCode = bytesFromBase64(object.wasmByteCode); - } - if (object.source !== undefined && object.source !== null) { - message.source = String(object.source); - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = String(object.builder); - } else { - message.builder = ""; - } - if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { - message.instantiatePermission = AccessConfig.fromJSON(object.instantiatePermission); - } else { - message.instantiatePermission = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { - message.wasmByteCode = object.wasmByteCode; - } else { - message.wasmByteCode = new Uint8Array(); - } - if (object.source !== undefined && object.source !== null) { - message.source = object.source; - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = object.builder; - } else { - message.builder = ""; - } - if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { - message.instantiatePermission = AccessConfig.fromPartial(object.instantiatePermission); - } else { - message.instantiatePermission = undefined; - } - return message; - }, - - toJSON(message: MsgStoreCode): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.wasmByteCode !== undefined && - (obj.wasmByteCode = base64FromBytes( - message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), - )); - message.source !== undefined && (obj.source = message.source); - message.builder !== undefined && (obj.builder = message.builder); - message.instantiatePermission !== undefined && - (obj.instantiatePermission = message.instantiatePermission - ? AccessConfig.toJSON(message.instantiatePermission) - : undefined); - return obj; - }, -}; - -const baseMsgStoreCodeResponse: object = { codeId: Long.UZERO }; - -export const MsgStoreCodeResponse = { - encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.codeId); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - return message; - }, - - fromPartial(object: DeepPartial): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - return message; - }, - - toJSON(message: MsgStoreCodeResponse): unknown { - const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - return obj; - }, -}; - -const baseMsgInstantiateContract: object = { sender: "", admin: "", codeId: Long.UZERO, label: "" }; - -export const MsgInstantiateContract = { - encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(18).string(message.admin); - writer.uint32(24).uint64(message.codeId); - writer.uint32(34).string(message.label); - writer.uint32(42).bytes(message.initMsg); - for (const v of message.initFunds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.initFunds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - case 3: - message.codeId = reader.uint64() as Long; - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.initMsg = reader.bytes(); - break; - case 6: - message.initFunds.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.initFunds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.initMsg !== undefined && object.initMsg !== null) { - message.initMsg = bytesFromBase64(object.initMsg); - } - if (object.initFunds !== undefined && object.initFunds !== null) { - for (const e of object.initFunds) { - message.initFunds.push(Coin.fromJSON(e)); - } - } - return message; - }, - - fromPartial(object: DeepPartial): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.initFunds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.initMsg !== undefined && object.initMsg !== null) { - message.initMsg = object.initMsg; - } else { - message.initMsg = new Uint8Array(); - } - if (object.initFunds !== undefined && object.initFunds !== null) { - for (const e of object.initFunds) { - message.initFunds.push(Coin.fromPartial(e)); - } - } - return message; - }, - - toJSON(message: MsgInstantiateContract): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.admin !== undefined && (obj.admin = message.admin); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.label !== undefined && (obj.label = message.label); - message.initMsg !== undefined && - (obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array())); - if (message.initFunds) { - obj.initFunds = message.initFunds.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.initFunds = []; - } - return obj; - }, -}; - -const baseMsgInstantiateContractResponse: object = { address: "" }; - -export const MsgInstantiateContractResponse = { - encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.address); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgInstantiateContractResponse { - const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): MsgInstantiateContractResponse { - const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - return message; - }, - - toJSON(message: MsgInstantiateContractResponse): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - return obj; - }, -}; - -const baseMsgExecuteContract: object = { sender: "", contract: "" }; - -export const MsgExecuteContract = { - encode(message: MsgExecuteContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(18).string(message.contract); - writer.uint32(26).bytes(message.msg); - for (const v of message.sentFunds) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContract { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.sentFunds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.contract = reader.string(); - break; - case 3: - message.msg = reader.bytes(); - break; - case 5: - message.sentFunds.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgExecuteContract { - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.sentFunds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.sentFunds !== undefined && object.sentFunds !== null) { - for (const e of object.sentFunds) { - message.sentFunds.push(Coin.fromJSON(e)); - } - } - return message; - }, - - fromPartial(object: DeepPartial): MsgExecuteContract { - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.sentFunds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.sentFunds !== undefined && object.sentFunds !== null) { - for (const e of object.sentFunds) { - message.sentFunds.push(Coin.fromPartial(e)); - } - } - return message; - }, - - toJSON(message: MsgExecuteContract): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.contract !== undefined && (obj.contract = message.contract); - message.msg !== undefined && - (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); - if (message.sentFunds) { - obj.sentFunds = message.sentFunds.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.sentFunds = []; - } - return obj; - }, -}; - -const baseMsgExecuteContractResponse: object = {}; - -export const MsgExecuteContractResponse = { - encode(message: MsgExecuteContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.data); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContractResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgExecuteContractResponse { - const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - fromPartial(object: DeepPartial): MsgExecuteContractResponse { - const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, - - toJSON(message: MsgExecuteContractResponse): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; - }, -}; - -const baseMsgMigrateContract: object = { sender: "", contract: "", codeId: Long.UZERO }; - -export const MsgMigrateContract = { - encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(18).string(message.contract); - writer.uint32(24).uint64(message.codeId); - writer.uint32(34).bytes(message.migrateMsg); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.contract = reader.string(); - break; - case 3: - message.codeId = reader.uint64() as Long; - break; - case 4: - message.migrateMsg = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.migrateMsg !== undefined && object.migrateMsg !== null) { - message.migrateMsg = bytesFromBase64(object.migrateMsg); - } - return message; - }, - - fromPartial(object: DeepPartial): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.migrateMsg !== undefined && object.migrateMsg !== null) { - message.migrateMsg = object.migrateMsg; - } else { - message.migrateMsg = new Uint8Array(); - } - return message; - }, - - toJSON(message: MsgMigrateContract): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.contract !== undefined && (obj.contract = message.contract); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.migrateMsg !== undefined && - (obj.migrateMsg = base64FromBytes( - message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array(), - )); - return obj; - }, -}; - -const baseMsgMigrateContractResponse: object = {}; - -export const MsgMigrateContractResponse = { - encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.data); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgMigrateContractResponse { - const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - fromPartial(object: DeepPartial): MsgMigrateContractResponse { - const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, - - toJSON(message: MsgMigrateContractResponse): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; - }, -}; - -const baseMsgUpdateAdmin: object = { sender: "", newAdmin: "", contract: "" }; - -export const MsgUpdateAdmin = { - encode(message: MsgUpdateAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(18).string(message.newAdmin); - writer.uint32(26).string(message.contract); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdmin { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.newAdmin = reader.string(); - break; - case 3: - message.contract = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgUpdateAdmin { - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.newAdmin !== undefined && object.newAdmin !== null) { - message.newAdmin = String(object.newAdmin); - } else { - message.newAdmin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): MsgUpdateAdmin { - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.newAdmin !== undefined && object.newAdmin !== null) { - message.newAdmin = object.newAdmin; - } else { - message.newAdmin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - return message; - }, - - toJSON(message: MsgUpdateAdmin): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); - message.contract !== undefined && (obj.contract = message.contract); - return obj; - }, -}; - -const baseMsgUpdateAdminResponse: object = {}; - -export const MsgUpdateAdminResponse = { - encode(_: MsgUpdateAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdminResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgUpdateAdminResponse { - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; - return message; - }, - - fromPartial(_: DeepPartial): MsgUpdateAdminResponse { - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; - return message; - }, - - toJSON(_: MsgUpdateAdminResponse): unknown { - const obj: any = {}; - return obj; - }, -}; - -const baseMsgClearAdmin: object = { sender: "", contract: "" }; - -export const MsgClearAdmin = { - encode(message: MsgClearAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).string(message.sender); - writer.uint32(26).string(message.contract); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdmin { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 3: - message.contract = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgClearAdmin { - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): MsgClearAdmin { - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - return message; - }, - - toJSON(message: MsgClearAdmin): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.contract !== undefined && (obj.contract = message.contract); - return obj; - }, -}; - -const baseMsgClearAdminResponse: object = {}; - -export const MsgClearAdminResponse = { - encode(_: MsgClearAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdminResponse { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgClearAdminResponse { - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; - return message; - }, - - fromPartial(_: DeepPartial): MsgClearAdminResponse { - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; - return message; - }, - - toJSON(_: MsgClearAdminResponse): unknown { - const obj: any = {}; - return obj; - }, -}; - -/** Msg defines the wasm Msg service. */ -export interface Msg { - /** StoreCode to submit Wasm code to the system */ - StoreCode(request: MsgStoreCode): Promise; - /** Instantiate creates a new smart contract instance for the given code id. */ - InstantiateContract(request: MsgInstantiateContract): Promise; - /** Execute submits the given message data to a smart contract */ - ExecuteContract(request: MsgExecuteContract): Promise; - /** Migrate runs a code upgrade/ downgrade for a smart contract */ - MigrateContract(request: MsgMigrateContract): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ - UpdateAdmin(request: MsgUpdateAdmin): Promise; - /** ClearAdmin removes any admin stored for a smart contract */ - ClearAdmin(request: MsgClearAdmin): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - StoreCode(request: MsgStoreCode): Promise { - const data = MsgStoreCode.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "StoreCode", data); - return promise.then((data) => MsgStoreCodeResponse.decode(new _m0.Reader(data))); - } - - InstantiateContract(request: MsgInstantiateContract): Promise { - const data = MsgInstantiateContract.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "InstantiateContract", data); - return promise.then((data) => MsgInstantiateContractResponse.decode(new _m0.Reader(data))); - } - - ExecuteContract(request: MsgExecuteContract): Promise { - const data = MsgExecuteContract.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "ExecuteContract", data); - return promise.then((data) => MsgExecuteContractResponse.decode(new _m0.Reader(data))); - } - - MigrateContract(request: MsgMigrateContract): Promise { - const data = MsgMigrateContract.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "MigrateContract", data); - return promise.then((data) => MsgMigrateContractResponse.decode(new _m0.Reader(data))); - } - - UpdateAdmin(request: MsgUpdateAdmin): Promise { - const data = MsgUpdateAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "UpdateAdmin", data); - return promise.then((data) => MsgUpdateAdminResponse.decode(new _m0.Reader(data))); - } - - ClearAdmin(request: MsgClearAdmin): Promise { - const data = MsgClearAdmin.encode(request).finish(); - const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "ClearAdmin", data); - return promise.then((data) => MsgClearAdminResponse.decode(new _m0.Reader(data))); - } -} - -interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -declare var self: any | undefined; -declare var window: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw new Error("Unable to locate global object"); -})(); - -const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.d.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.d.ts deleted file mode 100644 index 35a72c7484..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -export declare const protobufPackage = "cosmwasm.wasm.v1beta1"; -/** AccessType permission types */ -export declare enum AccessType { - /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ - ACCESS_TYPE_UNSPECIFIED = 0, - /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ - ACCESS_TYPE_NOBODY = 1, - /** ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to an address */ - ACCESS_TYPE_ONLY_ADDRESS = 2, - /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ - ACCESS_TYPE_EVERYBODY = 3, - UNRECOGNIZED = -1, -} -export declare function accessTypeFromJSON(object: any): AccessType; -export declare function accessTypeToJSON(object: AccessType): string; -/** ContractCodeHistoryOperationType actions that caused a code change */ -export declare enum ContractCodeHistoryOperationType { - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, - UNRECOGNIZED = -1, -} -export declare function contractCodeHistoryOperationTypeFromJSON( - object: any, -): ContractCodeHistoryOperationType; -export declare function contractCodeHistoryOperationTypeToJSON( - object: ContractCodeHistoryOperationType, -): string; -/** AccessTypeParam */ -export interface AccessTypeParam { - value: AccessType; -} -/** AccessConfig access control type. */ -export interface AccessConfig { - permission: AccessType; - address: string; -} -/** Params defines the set of wasm parameters. */ -export interface Params { - codeUploadAccess?: AccessConfig; - instantiateDefaultPermission: AccessType; - maxWasmCodeSize: Long; -} -/** CodeInfo is data for the uploaded contract WASM code */ -export interface CodeInfo { - /** CodeHash is the unique CodeID */ - codeHash: Uint8Array; - /** Creator address who initially stored the code */ - creator: string; - /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ - source: string; - /** Builder is a valid docker image name with tag, optional */ - builder: string; - /** InstantiateConfig access control to apply on contract creation, optional */ - instantiateConfig?: AccessConfig; -} -/** ContractInfo stores a WASM contract instance */ -export interface ContractInfo { - /** CodeID is the reference to the stored Wasm code */ - codeId: Long; - /** Creator address who initially instantiated the contract */ - creator: string; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** Label is optional metadata to be stored with a contract instance. */ - label: string; - /** - * Created Tx position when the contract was instantiated. - * This data should kept internal and not be exposed via query results. Just use for sorting - */ - created?: AbsoluteTxPosition; -} -/** ContractCodeHistoryEntry metadata to a contract. */ -export interface ContractCodeHistoryEntry { - operation: ContractCodeHistoryOperationType; - /** CodeID is the reference to the stored WASM code */ - codeId: Long; - /** Updated Tx position when the operation was executed. */ - updated?: AbsoluteTxPosition; - msg: Uint8Array; -} -/** AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. */ -export interface AbsoluteTxPosition { - /** BlockHeight is the block the contract was created at */ - blockHeight: Long; - /** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */ - txIndex: Long; -} -/** Model is a struct that holds a KV pair */ -export interface Model { - /** hex-encode key to read it better (this is often ascii) */ - key: Uint8Array; - /** base64-encode raw value */ - value: Uint8Array; -} -export declare const AccessTypeParam: { - encode(message: AccessTypeParam, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccessTypeParam; - fromJSON(object: any): AccessTypeParam; - fromPartial(object: DeepPartial): AccessTypeParam; - toJSON(message: AccessTypeParam): unknown; -}; -export declare const AccessConfig: { - encode(message: AccessConfig, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccessConfig; - fromJSON(object: any): AccessConfig; - fromPartial(object: DeepPartial): AccessConfig; - toJSON(message: AccessConfig): 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 CodeInfo: { - encode(message: CodeInfo, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CodeInfo; - fromJSON(object: any): CodeInfo; - fromPartial(object: DeepPartial): CodeInfo; - toJSON(message: CodeInfo): unknown; -}; -export declare const ContractInfo: { - encode(message: ContractInfo, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractInfo; - fromJSON(object: any): ContractInfo; - fromPartial(object: DeepPartial): ContractInfo; - toJSON(message: ContractInfo): unknown; -}; -export declare const ContractCodeHistoryEntry: { - encode(message: ContractCodeHistoryEntry, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractCodeHistoryEntry; - fromJSON(object: any): ContractCodeHistoryEntry; - fromPartial(object: DeepPartial): ContractCodeHistoryEntry; - toJSON(message: ContractCodeHistoryEntry): unknown; -}; -export declare const AbsoluteTxPosition: { - encode(message: AbsoluteTxPosition, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AbsoluteTxPosition; - fromJSON(object: any): AbsoluteTxPosition; - fromPartial(object: DeepPartial): AbsoluteTxPosition; - toJSON(message: AbsoluteTxPosition): unknown; -}; -export declare const Model: { - encode(message: Model, writer?: _m0.Writer): _m0.Writer; - decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Model; - fromJSON(object: any): Model; - fromPartial(object: DeepPartial): Model; - toJSON(message: Model): 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/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.ts b/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.ts deleted file mode 100644 index f139ada606..0000000000 --- a/packages/cosmwasm-stargate/types/codec/x/wasm/internal/types/types.ts +++ /dev/null @@ -1,899 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "cosmwasm.wasm.v1beta1"; - -/** AccessType permission types */ -export enum AccessType { - /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ - ACCESS_TYPE_UNSPECIFIED = 0, - /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ - ACCESS_TYPE_NOBODY = 1, - /** ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to an address */ - ACCESS_TYPE_ONLY_ADDRESS = 2, - /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ - ACCESS_TYPE_EVERYBODY = 3, - UNRECOGNIZED = -1, -} - -export function accessTypeFromJSON(object: any): AccessType { - switch (object) { - case 0: - case "ACCESS_TYPE_UNSPECIFIED": - return AccessType.ACCESS_TYPE_UNSPECIFIED; - case 1: - case "ACCESS_TYPE_NOBODY": - return AccessType.ACCESS_TYPE_NOBODY; - case 2: - case "ACCESS_TYPE_ONLY_ADDRESS": - return AccessType.ACCESS_TYPE_ONLY_ADDRESS; - case 3: - case "ACCESS_TYPE_EVERYBODY": - return AccessType.ACCESS_TYPE_EVERYBODY; - case -1: - case "UNRECOGNIZED": - default: - return AccessType.UNRECOGNIZED; - } -} - -export function accessTypeToJSON(object: AccessType): string { - switch (object) { - case AccessType.ACCESS_TYPE_UNSPECIFIED: - return "ACCESS_TYPE_UNSPECIFIED"; - case AccessType.ACCESS_TYPE_NOBODY: - return "ACCESS_TYPE_NOBODY"; - case AccessType.ACCESS_TYPE_ONLY_ADDRESS: - return "ACCESS_TYPE_ONLY_ADDRESS"; - case AccessType.ACCESS_TYPE_EVERYBODY: - return "ACCESS_TYPE_EVERYBODY"; - default: - return "UNKNOWN"; - } -} - -/** ContractCodeHistoryOperationType actions that caused a code change */ -export enum ContractCodeHistoryOperationType { - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, - /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, - UNRECOGNIZED = -1, -} - -export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { - switch (object) { - case 0: - case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": - return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; - case 1: - case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": - return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; - case 2: - case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": - return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; - case 3: - case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": - return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; - case -1: - case "UNRECOGNIZED": - default: - return ContractCodeHistoryOperationType.UNRECOGNIZED; - } -} - -export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { - switch (object) { - case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: - return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; - case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: - return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; - case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: - return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; - case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: - return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; - default: - return "UNKNOWN"; - } -} - -/** AccessTypeParam */ -export interface AccessTypeParam { - value: AccessType; -} - -/** AccessConfig access control type. */ -export interface AccessConfig { - permission: AccessType; - address: string; -} - -/** Params defines the set of wasm parameters. */ -export interface Params { - codeUploadAccess?: AccessConfig; - instantiateDefaultPermission: AccessType; - maxWasmCodeSize: Long; -} - -/** CodeInfo is data for the uploaded contract WASM code */ -export interface CodeInfo { - /** CodeHash is the unique CodeID */ - codeHash: Uint8Array; - /** Creator address who initially stored the code */ - creator: string; - /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ - source: string; - /** Builder is a valid docker image name with tag, optional */ - builder: string; - /** InstantiateConfig access control to apply on contract creation, optional */ - instantiateConfig?: AccessConfig; -} - -/** ContractInfo stores a WASM contract instance */ -export interface ContractInfo { - /** CodeID is the reference to the stored Wasm code */ - codeId: Long; - /** Creator address who initially instantiated the contract */ - creator: string; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** Label is optional metadata to be stored with a contract instance. */ - label: string; - /** - * Created Tx position when the contract was instantiated. - * This data should kept internal and not be exposed via query results. Just use for sorting - */ - created?: AbsoluteTxPosition; -} - -/** ContractCodeHistoryEntry metadata to a contract. */ -export interface ContractCodeHistoryEntry { - operation: ContractCodeHistoryOperationType; - /** CodeID is the reference to the stored WASM code */ - codeId: Long; - /** Updated Tx position when the operation was executed. */ - updated?: AbsoluteTxPosition; - msg: Uint8Array; -} - -/** AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. */ -export interface AbsoluteTxPosition { - /** BlockHeight is the block the contract was created at */ - blockHeight: Long; - /** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */ - txIndex: Long; -} - -/** Model is a struct that holds a KV pair */ -export interface Model { - /** hex-encode key to read it better (this is often ascii) */ - key: Uint8Array; - /** base64-encode raw value */ - value: Uint8Array; -} - -const baseAccessTypeParam: object = { value: 0 }; - -export const AccessTypeParam = { - encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).int32(message.value); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAccessTypeParam } as AccessTypeParam; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccessTypeParam { - const message = { ...baseAccessTypeParam } as AccessTypeParam; - if (object.value !== undefined && object.value !== null) { - message.value = accessTypeFromJSON(object.value); - } else { - message.value = 0; - } - return message; - }, - - fromPartial(object: DeepPartial): AccessTypeParam { - const message = { ...baseAccessTypeParam } as AccessTypeParam; - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = 0; - } - return message; - }, - - toJSON(message: AccessTypeParam): unknown { - const obj: any = {}; - message.value !== undefined && (obj.value = accessTypeToJSON(message.value)); - return obj; - }, -}; - -const baseAccessConfig: object = { permission: 0, address: "" }; - -export const AccessConfig = { - encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).int32(message.permission); - writer.uint32(18).string(message.address); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAccessConfig } as AccessConfig; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.permission = reader.int32() as any; - break; - case 2: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccessConfig { - const message = { ...baseAccessConfig } as AccessConfig; - if (object.permission !== undefined && object.permission !== null) { - message.permission = accessTypeFromJSON(object.permission); - } else { - message.permission = 0; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; - }, - - fromPartial(object: DeepPartial): AccessConfig { - const message = { ...baseAccessConfig } as AccessConfig; - if (object.permission !== undefined && object.permission !== null) { - message.permission = object.permission; - } else { - message.permission = 0; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - return message; - }, - - toJSON(message: AccessConfig): unknown { - const obj: any = {}; - message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission)); - message.address !== undefined && (obj.address = message.address); - return obj; - }, -}; - -const baseParams: object = { instantiateDefaultPermission: 0, maxWasmCodeSize: Long.UZERO }; - -export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.codeUploadAccess !== undefined && message.codeUploadAccess !== undefined) { - AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); - } - writer.uint32(16).int32(message.instantiateDefaultPermission); - writer.uint32(24).uint64(message.maxWasmCodeSize); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); - break; - case 2: - message.instantiateDefaultPermission = reader.int32() as any; - break; - case 3: - message.maxWasmCodeSize = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) { - message.codeUploadAccess = AccessConfig.fromJSON(object.codeUploadAccess); - } else { - message.codeUploadAccess = undefined; - } - if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) { - message.instantiateDefaultPermission = accessTypeFromJSON(object.instantiateDefaultPermission); - } else { - message.instantiateDefaultPermission = 0; - } - if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) { - message.maxWasmCodeSize = Long.fromString(object.maxWasmCodeSize); - } else { - message.maxWasmCodeSize = Long.UZERO; - } - return message; - }, - - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) { - message.codeUploadAccess = AccessConfig.fromPartial(object.codeUploadAccess); - } else { - message.codeUploadAccess = undefined; - } - if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) { - message.instantiateDefaultPermission = object.instantiateDefaultPermission; - } else { - message.instantiateDefaultPermission = 0; - } - if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) { - message.maxWasmCodeSize = object.maxWasmCodeSize as Long; - } else { - message.maxWasmCodeSize = Long.UZERO; - } - return message; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - message.codeUploadAccess !== undefined && - (obj.codeUploadAccess = message.codeUploadAccess - ? AccessConfig.toJSON(message.codeUploadAccess) - : undefined); - message.instantiateDefaultPermission !== undefined && - (obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission)); - message.maxWasmCodeSize !== undefined && - (obj.maxWasmCodeSize = (message.maxWasmCodeSize || Long.UZERO).toString()); - return obj; - }, -}; - -const baseCodeInfo: object = { creator: "", source: "", builder: "" }; - -export const CodeInfo = { - encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.codeHash); - writer.uint32(18).string(message.creator); - writer.uint32(26).string(message.source); - writer.uint32(34).string(message.builder); - if (message.instantiateConfig !== undefined && message.instantiateConfig !== undefined) { - AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCodeInfo } as CodeInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeHash = reader.bytes(); - break; - case 2: - message.creator = reader.string(); - break; - case 3: - message.source = reader.string(); - break; - case 4: - message.builder = reader.string(); - break; - case 5: - message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CodeInfo { - const message = { ...baseCodeInfo } as CodeInfo; - if (object.codeHash !== undefined && object.codeHash !== null) { - message.codeHash = bytesFromBase64(object.codeHash); - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if (object.source !== undefined && object.source !== null) { - message.source = String(object.source); - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = String(object.builder); - } else { - message.builder = ""; - } - if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) { - message.instantiateConfig = AccessConfig.fromJSON(object.instantiateConfig); - } else { - message.instantiateConfig = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): CodeInfo { - const message = { ...baseCodeInfo } as CodeInfo; - if (object.codeHash !== undefined && object.codeHash !== null) { - message.codeHash = object.codeHash; - } else { - message.codeHash = new Uint8Array(); - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if (object.source !== undefined && object.source !== null) { - message.source = object.source; - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = object.builder; - } else { - message.builder = ""; - } - if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) { - message.instantiateConfig = AccessConfig.fromPartial(object.instantiateConfig); - } else { - message.instantiateConfig = undefined; - } - return message; - }, - - toJSON(message: CodeInfo): unknown { - const obj: any = {}; - message.codeHash !== undefined && - (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); - message.creator !== undefined && (obj.creator = message.creator); - message.source !== undefined && (obj.source = message.source); - message.builder !== undefined && (obj.builder = message.builder); - message.instantiateConfig !== undefined && - (obj.instantiateConfig = message.instantiateConfig - ? AccessConfig.toJSON(message.instantiateConfig) - : undefined); - return obj; - }, -}; - -const baseContractInfo: object = { codeId: Long.UZERO, creator: "", admin: "", label: "" }; - -export const ContractInfo = { - encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.codeId); - writer.uint32(18).string(message.creator); - writer.uint32(26).string(message.admin); - writer.uint32(34).string(message.label); - if (message.created !== undefined && message.created !== undefined) { - AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContractInfo } as ContractInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64() as Long; - break; - case 2: - message.creator = reader.string(); - break; - case 3: - message.admin = reader.string(); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContractInfo { - const message = { ...baseContractInfo } as ContractInfo; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.created !== undefined && object.created !== null) { - message.created = AbsoluteTxPosition.fromJSON(object.created); - } else { - message.created = undefined; - } - return message; - }, - - fromPartial(object: DeepPartial): ContractInfo { - const message = { ...baseContractInfo } as ContractInfo; - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.created !== undefined && object.created !== null) { - message.created = AbsoluteTxPosition.fromPartial(object.created); - } else { - message.created = undefined; - } - return message; - }, - - toJSON(message: ContractInfo): unknown { - const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.creator !== undefined && (obj.creator = message.creator); - message.admin !== undefined && (obj.admin = message.admin); - message.label !== undefined && (obj.label = message.label); - message.created !== undefined && - (obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined); - return obj; - }, -}; - -const baseContractCodeHistoryEntry: object = { operation: 0, codeId: Long.UZERO }; - -export const ContractCodeHistoryEntry = { - encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).int32(message.operation); - writer.uint32(16).uint64(message.codeId); - if (message.updated !== undefined && message.updated !== undefined) { - AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); - } - writer.uint32(34).bytes(message.msg); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.operation = reader.int32() as any; - break; - case 2: - message.codeId = reader.uint64() as Long; - break; - case 3: - message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); - break; - case 4: - message.msg = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContractCodeHistoryEntry { - const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; - if (object.operation !== undefined && object.operation !== null) { - message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); - } else { - message.operation = 0; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromString(object.codeId); - } else { - message.codeId = Long.UZERO; - } - if (object.updated !== undefined && object.updated !== null) { - message.updated = AbsoluteTxPosition.fromJSON(object.updated); - } else { - message.updated = undefined; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - return message; - }, - - fromPartial(object: DeepPartial): ContractCodeHistoryEntry { - const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; - if (object.operation !== undefined && object.operation !== null) { - message.operation = object.operation; - } else { - message.operation = 0; - } - if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = object.codeId as Long; - } else { - message.codeId = Long.UZERO; - } - if (object.updated !== undefined && object.updated !== null) { - message.updated = AbsoluteTxPosition.fromPartial(object.updated); - } else { - message.updated = undefined; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - return message; - }, - - toJSON(message: ContractCodeHistoryEntry): unknown { - const obj: any = {}; - message.operation !== undefined && - (obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation)); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); - message.updated !== undefined && - (obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined); - message.msg !== undefined && - (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); - return obj; - }, -}; - -const baseAbsoluteTxPosition: object = { blockHeight: Long.UZERO, txIndex: Long.UZERO }; - -export const AbsoluteTxPosition = { - encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(8).uint64(message.blockHeight); - writer.uint32(16).uint64(message.txIndex); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.blockHeight = reader.uint64() as Long; - break; - case 2: - message.txIndex = reader.uint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AbsoluteTxPosition { - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; - if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = Long.fromString(object.blockHeight); - } else { - message.blockHeight = Long.UZERO; - } - if (object.txIndex !== undefined && object.txIndex !== null) { - message.txIndex = Long.fromString(object.txIndex); - } else { - message.txIndex = Long.UZERO; - } - return message; - }, - - fromPartial(object: DeepPartial): AbsoluteTxPosition { - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; - if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = object.blockHeight as Long; - } else { - message.blockHeight = Long.UZERO; - } - if (object.txIndex !== undefined && object.txIndex !== null) { - message.txIndex = object.txIndex as Long; - } else { - message.txIndex = Long.UZERO; - } - return message; - }, - - toJSON(message: AbsoluteTxPosition): unknown { - const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString()); - message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString()); - return obj; - }, -}; - -const baseModel: object = {}; - -export const Model = { - encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).bytes(message.key); - writer.uint32(18).bytes(message.value); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Model { - const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModel } as Model; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Model { - const message = { ...baseModel } as Model; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; - }, - - fromPartial(object: DeepPartial): Model { - const message = { ...baseModel } as Model; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - return message; - }, - - toJSON(message: Model): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - return obj; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw new Error("Unable to locate global object"); -})(); - -const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined | Long; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts b/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts deleted file mode 100644 index e17bab721b..0000000000 --- a/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - Code, - CodeDetails, - Contract, - ContractCodeHistoryEntry, - JsonObject, -} from "@cosmjs/cosmwasm-launchpad"; -import { Block, Coin, SearchTxFilter, SearchTxQuery } from "@cosmjs/launchpad"; -import { - Account, - AuthExtension, - BankExtension, - BroadcastTxResponse, - IndexedTx, - QueryClient, - SequenceResponse, -} from "@cosmjs/stargate"; -import { Client as TendermintClient } from "@cosmjs/tendermint-rpc"; -import { WasmExtension } from "./queries"; -/** Use for testing only */ -export interface PrivateCosmWasmClient { - readonly tmClient: TendermintClient; - readonly queryClient: QueryClient & AuthExtension & BankExtension & WasmExtension; -} -export declare class CosmWasmClient { - private readonly tmClient; - private readonly queryClient; - private readonly codesCache; - 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; - getTx(id: string): Promise; - searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise; - disconnect(): void; - broadcastTx(tx: Uint8Array): Promise; - getCodes(): Promise; - getCodeDetails(codeId: number): Promise; - getContracts(codeId: number): Promise; - /** - * Throws an error if no contract was found at the address - */ - getContract(address: string): Promise; - /** - * Throws an error if no contract was found at the address - */ - getContractCodeHistory(address: string): Promise; - /** - * Returns the data at the key if present (raw contract dependent storage data) - * or null if no data at this key. - * - * Promise is rejected when contract does not exist. - */ - queryContractRaw(address: string, key: Uint8Array): Promise; - /** - * Makes a smart query on the contract, returns the parsed JSON document. - * - * Promise is rejected when contract does not exist. - * Promise is rejected for invalid query format. - * Promise is rejected for invalid response format. - */ - queryContractSmart(address: string, queryMsg: Record): Promise; - private txsQuery; -} diff --git a/packages/cosmwasm-stargate/types/index.d.ts b/packages/cosmwasm-stargate/types/index.d.ts deleted file mode 100644 index 523a85c142..0000000000 --- a/packages/cosmwasm-stargate/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { cosmWasmTypes } from "./aminotypes"; -export { CosmWasmClient } from "./cosmwasmclient"; -export { SigningCosmWasmClient, SigningCosmWasmClientOptions } from "./signingcosmwasmclient"; diff --git a/packages/cosmwasm-stargate/types/queries/index.d.ts b/packages/cosmwasm-stargate/types/queries/index.d.ts deleted file mode 100644 index c069252311..0000000000 --- a/packages/cosmwasm-stargate/types/queries/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { setupWasmExtension, WasmExtension } from "./wasm"; diff --git a/packages/cosmwasm-stargate/types/queries/wasm.d.ts b/packages/cosmwasm-stargate/types/queries/wasm.d.ts deleted file mode 100644 index 6a7b315c1d..0000000000 --- a/packages/cosmwasm-stargate/types/queries/wasm.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { JsonObject } from "@cosmjs/cosmwasm-launchpad"; -import { QueryClient } from "@cosmjs/stargate"; -import { - QueryAllContractStateResponse, - QueryCodeResponse, - QueryCodesResponse, - QueryContractHistoryResponse, - QueryContractInfoResponse, - QueryContractsByCodeResponse, - QueryRawContractStateResponse, -} from "../codec/x/wasm/internal/types/query"; -export interface WasmExtension { - readonly unverified: { - readonly wasm: { - readonly listCodeInfo: (paginationKey?: Uint8Array) => Promise; - /** - * Downloads the original wasm bytecode by code ID. - * - * Throws an error if no code with this id - */ - readonly getCode: (id: number) => Promise; - readonly listContractsByCodeId: ( - id: number, - paginationKey?: Uint8Array, - ) => Promise; - /** - * Returns null when contract was not found at this address. - */ - readonly getContractInfo: (address: string) => Promise; - /** - * Returns null when contract history was not found for this address. - */ - readonly getContractCodeHistory: ( - address: string, - paginationKey?: Uint8Array, - ) => Promise; - /** - * Returns all contract state. - * This is an empty array if no such contract, or contract has no data. - */ - readonly getAllContractState: ( - address: string, - paginationKey?: Uint8Array, - ) => Promise; - /** - * Returns the data at the key if present (unknown decoded json), - * or null if no data at this (contract address, key) pair - */ - readonly queryContractRaw: (address: string, key: Uint8Array) => Promise; - /** - * Makes a smart query on the contract and parses the response as JSON. - * Throws error if no such contract exists, the query format is invalid or the response is invalid. - */ - readonly queryContractSmart: (address: string, query: Record) => Promise; - }; - }; -} -export declare function setupWasmExtension(base: QueryClient): WasmExtension; diff --git a/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts b/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts deleted file mode 100644 index c6d66c4e46..0000000000 --- a/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { - ChangeAdminResult, - CosmWasmFeeTable, - ExecuteResult, - InstantiateOptions, - InstantiateResult, - MigrateResult, - UploadMeta, - UploadResult, -} from "@cosmjs/cosmwasm-launchpad"; -import { Coin, CosmosFeeTable, GasLimits, GasPrice, StdFee } from "@cosmjs/launchpad"; -import { EncodeObject, OfflineSigner, Registry } from "@cosmjs/proto-signing"; -import { AminoTypes, BroadcastTxResponse } from "@cosmjs/stargate"; -import { CosmWasmClient } from "./cosmwasmclient"; -export interface SigningCosmWasmClientOptions { - readonly registry?: Registry; - readonly aminoTypes?: AminoTypes; - readonly prefix?: string; - readonly gasPrice?: GasPrice; - readonly gasLimits?: GasLimits; -} -/** Use for testing only */ -export interface PrivateSigningCosmWasmClient { - readonly fees: CosmWasmFeeTable; - readonly registry: Registry; -} -export declare class SigningCosmWasmClient extends CosmWasmClient { - private readonly fees; - private readonly registry; - private readonly signer; - private readonly aminoTypes; - static connectWithSigner( - endpoint: string, - signer: OfflineSigner, - options?: SigningCosmWasmClientOptions, - ): Promise; - private constructor(); - /** Uploads code and returns a receipt, including the code ID */ - upload( - senderAddress: string, - wasmCode: Uint8Array, - meta?: UploadMeta, - memo?: string, - ): Promise; - instantiate( - senderAddress: string, - codeId: number, - initMsg: Record, - label: string, - options?: InstantiateOptions, - ): Promise; - updateAdmin( - senderAddress: string, - contractAddress: string, - newAdmin: string, - memo?: string, - ): Promise; - clearAdmin(senderAddress: string, contractAddress: string, memo?: string): Promise; - migrate( - senderAddress: string, - contractAddress: string, - codeId: number, - migrateMsg: Record, - memo?: string, - ): Promise; - execute( - senderAddress: string, - contractAddress: string, - handleMsg: Record, - memo?: string, - transferAmount?: readonly Coin[], - ): Promise; - sendTokens( - senderAddress: string, - recipientAddress: string, - transferAmount: readonly Coin[], - memo?: string, - ): Promise; - /** - * Creates a transaction with the given messages, fee and memo. Then signs and broadcasts the transaction. - * - * @param signerAddress The address that will sign transactions using this instance. The signer must be able to sign with this address. - * @param messages - * @param fee - * @param memo - */ - signAndBroadcast( - signerAddress: string, - messages: readonly EncodeObject[], - fee: StdFee, - memo?: string, - ): Promise; -} diff --git a/packages/cosmwasm/types/index.d.ts b/packages/cosmwasm/types/index.d.ts deleted file mode 100644 index bdad471c59..0000000000 --- a/packages/cosmwasm/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@cosmjs/cosmwasm-launchpad"; diff --git a/packages/crypto/types/bip39.d.ts b/packages/crypto/types/bip39.d.ts deleted file mode 100644 index fcbeea04d2..0000000000 --- a/packages/crypto/types/bip39.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { EnglishMnemonic } from "./englishmnemonic"; -export declare class Bip39 { - /** - * Encodes raw entropy of length 16, 20, 24, 28 or 32 bytes as an English mnemonic between 12 and 24 words. - * - * | Entropy | Words | - * |--------------------|-------| - * | 128 bit (16 bytes) | 12 | - * | 160 bit (20 bytes) | 15 | - * | 192 bit (24 bytes) | 18 | - * | 224 bit (28 bytes) | 21 | - * | 256 bit (32 bytes) | 24 | - * - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic - * @param entropy The entropy to be encoded. This must be cryptographically secure. - */ - static encode(entropy: Uint8Array): EnglishMnemonic; - static decode(mnemonic: EnglishMnemonic): Uint8Array; - static mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise; - private static pbkdf2; -} diff --git a/packages/crypto/types/englishmnemonic.d.ts b/packages/crypto/types/englishmnemonic.d.ts deleted file mode 100644 index a38f3c39a5..0000000000 --- a/packages/crypto/types/englishmnemonic.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare class EnglishMnemonic { - static readonly wordlist: readonly string[]; - private static readonly mnemonicMatcher; - private readonly data; - constructor(mnemonic: string); - toString(): string; -} diff --git a/packages/crypto/types/hash.d.ts b/packages/crypto/types/hash.d.ts deleted file mode 100644 index 08fe193b09..0000000000 --- a/packages/crypto/types/hash.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HashFunction { - readonly blockSize: number; - readonly update: (_: Uint8Array) => HashFunction; - readonly digest: () => Uint8Array; -} diff --git a/packages/crypto/types/hmac.d.ts b/packages/crypto/types/hmac.d.ts deleted file mode 100644 index 3a8c48ca35..0000000000 --- a/packages/crypto/types/hmac.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Hmac implements HashFunction { - readonly blockSize: number; - private readonly messageHasher; - private readonly oKeyPad; - private readonly iKeyPad; - private readonly hash; - constructor(hashFunctionConstructor: new () => H, originalKey: Uint8Array); - update(data: Uint8Array): Hmac; - digest(): Uint8Array; -} diff --git a/packages/crypto/types/index.d.ts b/packages/crypto/types/index.d.ts deleted file mode 100644 index d69fa3266c..0000000000 --- a/packages/crypto/types/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export { Bip39 } from "./bip39"; -export { EnglishMnemonic } from "./englishmnemonic"; -export { HashFunction } from "./hash"; -export { Hmac } from "./hmac"; -export { Keccak256, keccak256 } from "./keccak"; -export { - Xchacha20poly1305Ietf, - xchacha20NonceLength, - Argon2id, - Argon2idOptions, - isArgon2idOptions, - Ed25519, - Ed25519Keypair, -} from "./libsodium"; -export { Random } from "./random"; -export { Ripemd160, ripemd160 } from "./ripemd"; -export { Secp256k1, Secp256k1Keypair } from "./secp256k1"; -export { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; -export { Sha1, sha1, Sha256, sha256, Sha512, sha512 } from "./sha"; -export { - HdPath, - pathToString, - stringToPath, - Slip10, - Slip10Curve, - Slip10RawIndex, - Slip10Result, - slip10CurveFromString, -} from "./slip10"; diff --git a/packages/crypto/types/keccak.d.ts b/packages/crypto/types/keccak.d.ts deleted file mode 100644 index a85384633c..0000000000 --- a/packages/crypto/types/keccak.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Keccak256 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): Keccak256; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Keccak256(data).digest()` */ -export declare function keccak256(data: Uint8Array): Uint8Array; diff --git a/packages/crypto/types/libsodium.d.ts b/packages/crypto/types/libsodium.d.ts deleted file mode 100644 index fbddb7f3d2..0000000000 --- a/packages/crypto/types/libsodium.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export interface Argon2idOptions { - /** Output length in bytes */ - readonly outputLength: number; - /** - * An integer between 1 and 4294967295 representing the computational difficulty. - * - * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation - */ - readonly opsLimit: number; - /** - * Memory limit measured in KiB (like argon2 command line tool) - * - * Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js - * - * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation - */ - readonly memLimitKib: number; -} -export declare function isArgon2idOptions(thing: unknown): thing is Argon2idOptions; -export declare class Argon2id { - static execute(password: string, salt: Uint8Array, options: Argon2idOptions): Promise; -} -export declare class Ed25519Keypair { - static fromLibsodiumPrivkey(libsodiumPrivkey: Uint8Array): Ed25519Keypair; - readonly privkey: Uint8Array; - readonly pubkey: Uint8Array; - constructor(privkey: Uint8Array, pubkey: Uint8Array); - toLibsodiumPrivkey(): Uint8Array; -} -export declare class Ed25519 { - /** - * Generates a keypair deterministically from a given 32 bytes seed. - * - * This seed equals the Ed25519 private key. - * For implementation details see crypto_sign_seed_keypair in - * https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures.html - * and diagram on https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ - */ - static makeKeypair(seed: Uint8Array): Promise; - static createSignature(message: Uint8Array, keyPair: Ed25519Keypair): Promise; - static verifySignature(signature: Uint8Array, message: Uint8Array, pubkey: Uint8Array): Promise; -} -/** - * Nonce length in bytes for all flavours of XChaCha20. - * - * @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes - */ -export declare const xchacha20NonceLength = 24; -export declare class Xchacha20poly1305Ietf { - static encrypt(message: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise; - static decrypt(ciphertext: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise; -} diff --git a/packages/crypto/types/random.d.ts b/packages/crypto/types/random.d.ts deleted file mode 100644 index 81a523c7f5..0000000000 --- a/packages/crypto/types/random.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare class Random { - /** - * Returns `count` cryptographically secure random bytes - */ - static getBytes(count: number): Uint8Array; -} diff --git a/packages/crypto/types/ripemd.d.ts b/packages/crypto/types/ripemd.d.ts deleted file mode 100644 index 8aa1951085..0000000000 --- a/packages/crypto/types/ripemd.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Ripemd160 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): Ripemd160; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Ripemd160(data).digest()` */ -export declare function ripemd160(data: Uint8Array): Uint8Array; diff --git a/packages/crypto/types/secp256k1.d.ts b/packages/crypto/types/secp256k1.d.ts deleted file mode 100644 index 1b0d1422a0..0000000000 --- a/packages/crypto/types/secp256k1.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; -export interface Secp256k1Keypair { - readonly pubkey: Uint8Array; - readonly privkey: Uint8Array; -} -export declare class Secp256k1 { - static makeKeypair(privkey: Uint8Array): Promise; - static createSignature(messageHash: Uint8Array, privkey: Uint8Array): Promise; - static verifySignature( - signature: Secp256k1Signature, - messageHash: Uint8Array, - pubkey: Uint8Array, - ): Promise; - static recoverPubkey(signature: ExtendedSecp256k1Signature, messageHash: Uint8Array): Uint8Array; - static compressPubkey(pubkey: Uint8Array): Uint8Array; - static trimRecoveryByte(signature: Uint8Array): Uint8Array; -} diff --git a/packages/crypto/types/secp256k1signature.d.ts b/packages/crypto/types/secp256k1signature.d.ts deleted file mode 100644 index 627b53e22c..0000000000 --- a/packages/crypto/types/secp256k1signature.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export declare class Secp256k1Signature { - /** - * Takes the pair of integers (r, s) as 2x32 byte of binary data. - * - * Note: This is the format Cosmos SDK uses natively. - * - * @param data a 64 byte value containing integers r and s. - */ - static fromFixedLength(data: Uint8Array): Secp256k1Signature; - static fromDer(data: Uint8Array): Secp256k1Signature; - private readonly data; - constructor(r: Uint8Array, s: Uint8Array); - r(length?: number): Uint8Array; - s(length?: number): Uint8Array; - toFixedLength(): Uint8Array; - toDer(): Uint8Array; -} -/** - * A Secp256k1Signature plus the recovery parameter - */ -export declare class ExtendedSecp256k1Signature extends Secp256k1Signature { - /** - * Decode extended signature from the simple fixed length encoding - * described in toFixedLength(). - */ - static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature; - readonly recovery: number; - constructor(r: Uint8Array, s: Uint8Array, recovery: number); - /** - * A simple custom encoding that encodes the extended signature as - * r (32 bytes) | s (32 bytes) | recovery param (1 byte) - * where | denotes concatenation of bonary data. - */ - toFixedLength(): Uint8Array; -} diff --git a/packages/crypto/types/sha.d.ts b/packages/crypto/types/sha.d.ts deleted file mode 100644 index a8c73543bd..0000000000 --- a/packages/crypto/types/sha.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Sha1 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): Sha1; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Sha1(data).digest()` */ -export declare function sha1(data: Uint8Array): Uint8Array; -export declare class Sha256 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): Sha256; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Sha256(data).digest()` */ -export declare function sha256(data: Uint8Array): Uint8Array; -export declare class Sha512 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): Sha512; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Sha512(data).digest()` */ -export declare function sha512(data: Uint8Array): Uint8Array; diff --git a/packages/crypto/types/slip10.d.ts b/packages/crypto/types/slip10.d.ts deleted file mode 100644 index c808a0f041..0000000000 --- a/packages/crypto/types/slip10.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Uint32 } from "@cosmjs/math"; -export interface Slip10Result { - readonly chainCode: Uint8Array; - readonly privkey: Uint8Array; -} -/** - * Raw values must match the curve string in SLIP-0010 master key generation - * - * @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation - */ -export declare enum Slip10Curve { - Secp256k1 = "Bitcoin seed", - Ed25519 = "ed25519 seed", -} -/** - * Reverse mapping of Slip10Curve - */ -export declare function slip10CurveFromString(curveString: string): Slip10Curve; -export declare class Slip10RawIndex extends Uint32 { - static hardened(hardenedIndex: number): Slip10RawIndex; - static normal(normalIndex: number): Slip10RawIndex; - isHardened(): boolean; -} -/** - * An array of raw SLIP10 indices. - * - * This can be constructed via string parsing: - * - * ```ts - * import { stringToPath } from "@cosmjs/crypto"; - * - * const path = stringToPath("m/0'/1/2'/2/1000000000"); - * ``` - * - * or manually: - * - * ```ts - * import { HdPath, Slip10RawIndex } from "@cosmjs/crypto"; - * - * // m/0'/1/2'/2/1000000000 - * const path: HdPath = [ - * Slip10RawIndex.hardened(0), - * Slip10RawIndex.normal(1), - * Slip10RawIndex.hardened(2), - * Slip10RawIndex.normal(2), - * Slip10RawIndex.normal(1000000000), - * ]; - * ``` - */ -export declare type HdPath = readonly Slip10RawIndex[]; -export declare class Slip10 { - static derivePath(curve: Slip10Curve, seed: Uint8Array, path: HdPath): Slip10Result; - private static master; - private static child; - /** - * Implementation of ser_P(point(k_par)) from BIP-0032 - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki - */ - private static serializedPoint; - private static childImpl; - private static isZero; - private static isGteN; - private static n; -} -export declare function pathToString(path: HdPath): string; -export declare function stringToPath(input: string): HdPath; diff --git a/packages/encoding/types/ascii.d.ts b/packages/encoding/types/ascii.d.ts deleted file mode 100644 index 42d32698fe..0000000000 --- a/packages/encoding/types/ascii.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toAscii(input: string): Uint8Array; -export declare function fromAscii(data: Uint8Array): string; diff --git a/packages/encoding/types/base64.d.ts b/packages/encoding/types/base64.d.ts deleted file mode 100644 index 3eb3915c1d..0000000000 --- a/packages/encoding/types/base64.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toBase64(data: Uint8Array): string; -export declare function fromBase64(base64String: string): Uint8Array; diff --git a/packages/encoding/types/bech32.d.ts b/packages/encoding/types/bech32.d.ts deleted file mode 100644 index 9ddd6388df..0000000000 --- a/packages/encoding/types/bech32.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare class Bech32 { - static encode(prefix: string, data: Uint8Array, limit?: number): string; - static decode( - address: string, - limit?: number, - ): { - readonly prefix: string; - readonly data: Uint8Array; - }; -} diff --git a/packages/encoding/types/hex.d.ts b/packages/encoding/types/hex.d.ts deleted file mode 100644 index a337851fff..0000000000 --- a/packages/encoding/types/hex.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toHex(data: Uint8Array): string; -export declare function fromHex(hexstring: string): Uint8Array; diff --git a/packages/encoding/types/index.d.ts b/packages/encoding/types/index.d.ts deleted file mode 100644 index 6fb102e2e6..0000000000 --- a/packages/encoding/types/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { fromAscii, toAscii } from "./ascii"; -export { fromBase64, toBase64 } from "./base64"; -export { Bech32 } from "./bech32"; -export { fromHex, toHex } from "./hex"; -export { fromRfc3339, toRfc3339 } from "./rfc3339"; -export { fromUtf8, toUtf8 } from "./utf8"; diff --git a/packages/encoding/types/rfc3339.d.ts b/packages/encoding/types/rfc3339.d.ts deleted file mode 100644 index e19a9e8def..0000000000 --- a/packages/encoding/types/rfc3339.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReadonlyDate } from "readonly-date"; -export declare function fromRfc3339(str: string): ReadonlyDate; -export declare function toRfc3339(date: Date | ReadonlyDate): string; diff --git a/packages/encoding/types/utf8.d.ts b/packages/encoding/types/utf8.d.ts deleted file mode 100644 index 53df44c1bb..0000000000 --- a/packages/encoding/types/utf8.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toUtf8(str: string): Uint8Array; -export declare function fromUtf8(data: Uint8Array): string; diff --git a/packages/faucet-client/types/faucetclient.d.ts b/packages/faucet-client/types/faucetclient.d.ts deleted file mode 100644 index 3f7c74daf8..0000000000 --- a/packages/faucet-client/types/faucetclient.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare class FaucetClient { - private readonly baseUrl; - constructor(baseUrl: string); - credit(address: string, denom: string): Promise; -} diff --git a/packages/faucet-client/types/index.d.ts b/packages/faucet-client/types/index.d.ts deleted file mode 100644 index 7a2633a5ba..0000000000 --- a/packages/faucet-client/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { FaucetClient } from "./faucetclient"; diff --git a/packages/json-rpc/types/compatibility.d.ts b/packages/json-rpc/types/compatibility.d.ts deleted file mode 100644 index 9187f0d8be..0000000000 --- a/packages/json-rpc/types/compatibility.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A single JSON value. This is the missing return type of JSON.parse(). - */ -export declare type JsonCompatibleValue = - | JsonCompatibleDictionary - | JsonCompatibleArray - | string - | number - | boolean - | null; -/** - * An array of JsonCompatibleValue - */ -export interface JsonCompatibleArray extends ReadonlyArray {} -/** - * A string to json value dictionary. - */ -export interface JsonCompatibleDictionary { - readonly [key: string]: JsonCompatibleValue | readonly JsonCompatibleValue[]; -} -export declare function isJsonCompatibleValue(value: unknown): value is JsonCompatibleValue; -export declare function isJsonCompatibleArray(value: unknown): value is JsonCompatibleArray; -export declare function isJsonCompatibleDictionary(data: unknown): data is JsonCompatibleDictionary; diff --git a/packages/json-rpc/types/id.d.ts b/packages/json-rpc/types/id.d.ts deleted file mode 100644 index ab69ffdfdd..0000000000 --- a/packages/json-rpc/types/id.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Creates a new ID to be used for creating a JSON-RPC request. - * - * Multiple calls of this produce unique values. - * - * The output may be any value compatible to JSON-RPC request IDs with an undefined output format and generation logic. - */ -export declare function makeJsonRpcId(): number; diff --git a/packages/json-rpc/types/index.d.ts b/packages/json-rpc/types/index.d.ts deleted file mode 100644 index fc6fa06aa7..0000000000 --- a/packages/json-rpc/types/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export { makeJsonRpcId } from "./id"; -export { JsonRpcClient, SimpleMessagingConnection } from "./jsonrpcclient"; -export { - parseJsonRpcId, - parseJsonRpcRequest, - parseJsonRpcResponse, - parseJsonRpcErrorResponse, - parseJsonRpcSuccessResponse, -} from "./parse"; -export { - isJsonRpcErrorResponse, - isJsonRpcSuccessResponse, - JsonRpcError, - JsonRpcErrorResponse, - JsonRpcId, - JsonRpcRequest, - JsonRpcResponse, - JsonRpcSuccessResponse, - jsonRpcCode, -} from "./types"; diff --git a/packages/json-rpc/types/jsonrpcclient.d.ts b/packages/json-rpc/types/jsonrpcclient.d.ts deleted file mode 100644 index 06199739e8..0000000000 --- a/packages/json-rpc/types/jsonrpcclient.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Stream } from "xstream"; -import { JsonRpcRequest, JsonRpcResponse, JsonRpcSuccessResponse } from "./types"; -export interface SimpleMessagingConnection { - readonly responseStream: Stream; - readonly sendRequest: (request: Request) => void; -} -/** - * A thin wrapper that is used to bring together requests and responses by ID. - * - * Using this class is only advised for continous communication channels like - * WebSockets or WebWorker messaging. - */ -export declare class JsonRpcClient { - private readonly connection; - constructor(connection: SimpleMessagingConnection); - run(request: JsonRpcRequest): Promise; -} diff --git a/packages/json-rpc/types/parse.d.ts b/packages/json-rpc/types/parse.d.ts deleted file mode 100644 index 94576d99c7..0000000000 --- a/packages/json-rpc/types/parse.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { - JsonRpcErrorResponse, - JsonRpcId, - JsonRpcRequest, - JsonRpcResponse, - JsonRpcSuccessResponse, -} from "./types"; -/** - * Extracts ID field from request or response object. - * - * Returns `null` when no valid ID was found. - */ -export declare function parseJsonRpcId(data: unknown): JsonRpcId | null; -export declare function parseJsonRpcRequest(data: unknown): JsonRpcRequest; -/** Throws if data is not a JsonRpcErrorResponse */ -export declare function parseJsonRpcErrorResponse(data: unknown): JsonRpcErrorResponse; -/** Throws if data is not a JsonRpcSuccessResponse */ -export declare function parseJsonRpcSuccessResponse(data: unknown): JsonRpcSuccessResponse; -/** - * Returns a JsonRpcErrorResponse if input can be parsed as a JSON-RPC error. Otherwise parses - * input as JsonRpcSuccessResponse. Throws if input is neither a valid error nor success response. - */ -export declare function parseJsonRpcResponse(data: unknown): JsonRpcResponse; diff --git a/packages/json-rpc/types/types.d.ts b/packages/json-rpc/types/types.d.ts deleted file mode 100644 index 6ff60e2adc..0000000000 --- a/packages/json-rpc/types/types.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { JsonCompatibleArray, JsonCompatibleDictionary, JsonCompatibleValue } from "./compatibility"; -export declare type JsonRpcId = number | string; -export interface JsonRpcRequest { - readonly jsonrpc: "2.0"; - readonly id: JsonRpcId; - readonly method: string; - readonly params: JsonCompatibleArray | JsonCompatibleDictionary; -} -export interface JsonRpcSuccessResponse { - readonly jsonrpc: "2.0"; - readonly id: JsonRpcId; - readonly result: any; -} -export interface JsonRpcError { - readonly code: number; - readonly message: string; - readonly data?: JsonCompatibleValue; -} -/** - * And error object as described in https://www.jsonrpc.org/specification#error_object - */ -export interface JsonRpcErrorResponse { - readonly jsonrpc: "2.0"; - readonly id: JsonRpcId | null; - readonly error: JsonRpcError; -} -export declare type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse; -export declare function isJsonRpcErrorResponse(response: JsonRpcResponse): response is JsonRpcErrorResponse; -export declare function isJsonRpcSuccessResponse( - response: JsonRpcResponse, -): response is JsonRpcSuccessResponse; -/** - * Error codes as specified in JSON-RPC 2.0 - * - * @see https://www.jsonrpc.org/specification#error_object - */ -export declare const jsonRpcCode: { - parseError: number; - invalidRequest: number; - methodNotFound: number; - invalidParams: number; - internalError: number; - serverError: { - default: number; - }; -}; diff --git a/packages/json-rpc/types/workers/dummyservice.worker.d.ts b/packages/json-rpc/types/workers/dummyservice.worker.d.ts deleted file mode 100644 index 67dd33d605..0000000000 --- a/packages/json-rpc/types/workers/dummyservice.worker.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -export {}; diff --git a/packages/launchpad/types/address.d.ts b/packages/launchpad/types/address.d.ts deleted file mode 100644 index 9eb5af8224..0000000000 --- a/packages/launchpad/types/address.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PubKey } from "./types"; -export declare function rawSecp256k1PubkeyToAddress(pubkeyRaw: Uint8Array, prefix: string): string; -export declare function pubkeyToAddress(pubkey: PubKey, prefix: string): string; diff --git a/packages/launchpad/types/coins.d.ts b/packages/launchpad/types/coins.d.ts deleted file mode 100644 index 2c95639091..0000000000 --- a/packages/launchpad/types/coins.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface Coin { - readonly denom: string; - readonly amount: string; -} -/** Creates a coin */ -export declare function coin(amount: number, denom: string): Coin; -/** Creates a list of coins with one element */ -export declare function coins(amount: number, denom: string): Coin[]; -/** - * Takes a coins list like "819966000ucosm,700000000ustake" and parses it - */ -export declare function parseCoins(input: string): Coin[]; diff --git a/packages/launchpad/types/cosmosclient.d.ts b/packages/launchpad/types/cosmosclient.d.ts deleted file mode 100644 index 919502ced7..0000000000 --- a/packages/launchpad/types/cosmosclient.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Coin } from "./coins"; -import { AuthExtension, BroadcastMode, LcdClient } from "./lcdapi"; -import { Log } from "./logs"; -import { StdTx, WrappedStdTx } from "./tx"; -import { PubKey } from "./types"; -export interface GetSequenceResult { - readonly accountNumber: number; - readonly sequence: number; -} -export interface Account { - /** Bech32 account address */ - readonly address: string; - readonly balance: readonly Coin[]; - readonly pubkey: PubKey | undefined; - readonly accountNumber: number; - readonly sequence: number; -} -export interface BroadcastTxFailure { - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; - readonly height: number; - readonly code: number; - readonly rawLog: string; -} -export interface BroadcastTxSuccess { - readonly logs: readonly Log[]; - readonly rawLog: string; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; - readonly data?: Uint8Array; -} -export declare type BroadcastTxResult = BroadcastTxSuccess | BroadcastTxFailure; -export declare function isBroadcastTxFailure(result: BroadcastTxResult): result is BroadcastTxFailure; -export declare function isBroadcastTxSuccess(result: BroadcastTxResult): result is BroadcastTxSuccess; -/** - * Ensures the given result is a success. Throws a detailed error message otherwise. - */ -export declare function assertIsBroadcastTxSuccess( - result: BroadcastTxResult, -): asserts result is BroadcastTxSuccess; -export interface SearchByHeightQuery { - readonly height: number; -} -export interface SearchBySentFromOrToQuery { - readonly sentFromOrTo: string; -} -/** - * This query type allows you to pass arbitrary key/value pairs to the backend. It is - * more powerful and slightly lower level than the other search options. - */ -export interface SearchByTagsQuery { - readonly tags: ReadonlyArray<{ - readonly key: string; - readonly value: string; - }>; -} -export declare type SearchTxQuery = SearchByHeightQuery | SearchBySentFromOrToQuery | SearchByTagsQuery; -export declare function isSearchByHeightQuery(query: SearchTxQuery): query is SearchByHeightQuery; -export declare function isSearchBySentFromOrToQuery(query: SearchTxQuery): query is SearchBySentFromOrToQuery; -export declare function isSearchByTagsQuery(query: SearchTxQuery): query is SearchByTagsQuery; -export interface SearchTxFilter { - readonly minHeight?: number; - readonly maxHeight?: number; -} -/** 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 logs: readonly Log[]; - readonly tx: WrappedStdTx; - /** The gas limit as set by the user */ - readonly gasWanted?: number; - /** The gas used by the execution */ - readonly gasUsed?: number; - /** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */ - readonly timestamp: string; -} -export interface BlockHeader { - readonly version: { - readonly block: string; - readonly app: string; - }; - readonly height: number; - readonly chainId: string; - /** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */ - readonly time: string; -} -export interface Block { - /** The ID is a hash of the block header (uppercase hex) */ - readonly id: string; - readonly header: BlockHeader; - /** Array of raw transactions */ - readonly txs: readonly Uint8Array[]; -} -/** Use for testing only */ -export interface PrivateCosmosClient { - readonly lcdClient: LcdClient & AuthExtension; -} -export declare class CosmosClient { - protected readonly lcdClient: LcdClient & AuthExtension; - /** Any address the chain considers valid (valid bech32 with proper prefix) */ - protected anyValidAddress: string | undefined; - private chainId; - /** - * Creates a new client to interact with a CosmWasm blockchain. - * - * This instance does a lot of caching. In order to benefit from that you should try to use one instance - * for the lifetime of your application. When switching backends, a new instance must be created. - * - * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) - * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns - */ - constructor(apiUrl: string, broadcastMode?: BroadcastMode); - getChainId(): Promise; - getHeight(): Promise; - /** - * Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID) - */ - getIdentifier(tx: WrappedStdTx): Promise; - /** - * Returns account number and sequence. - * - * Throws if the account does not exist on chain. - * - * @param address returns data for this address. When unset, the client's sender adddress is used. - */ - getSequence(address: string): Promise; - getAccount(address: string): Promise; - /** - * Gets block header and meta - * - * @param height The height of the block. If undefined, the latest height is used. - */ - getBlock(height?: number): Promise; - getTx(id: string): Promise; - searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise; - broadcastTx(tx: StdTx): Promise; - private txsQuery; -} diff --git a/packages/launchpad/types/encoding.d.ts b/packages/launchpad/types/encoding.d.ts deleted file mode 100644 index cb20550d18..0000000000 --- a/packages/launchpad/types/encoding.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Msg } from "./msgs"; -import { StdFee } from "./types"; -/** Returns a JSON string with objects sorted by key */ -export declare function sortedJsonStringify(obj: any): string; -/** - * The document to be signed - * - * @see https://docs.cosmos.network/master/modules/auth/03_types.html#stdsigndoc - */ -export interface StdSignDoc { - readonly chain_id: string; - readonly account_number: string; - readonly sequence: string; - readonly fee: StdFee; - readonly msgs: readonly Msg[]; - readonly memo: string; -} -export declare function makeSignDoc( - msgs: readonly Msg[], - fee: StdFee, - chainId: string, - memo: string | undefined, - accountNumber: number | string, - sequence: number | string, -): StdSignDoc; -export declare function serializeSignDoc(signDoc: StdSignDoc): Uint8Array; diff --git a/packages/launchpad/types/gas.d.ts b/packages/launchpad/types/gas.d.ts deleted file mode 100644 index 8fccc2bcf9..0000000000 --- a/packages/launchpad/types/gas.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Decimal } from "@cosmjs/math"; -import { StdFee } from "./types"; -export declare type FeeTable = Record; -export declare class GasPrice { - readonly amount: Decimal; - readonly denom: string; - constructor(amount: Decimal, denom: string); - static fromString(gasPrice: string): GasPrice; -} -export declare type GasLimits> = { - readonly [key in keyof T]: number; -}; -export declare function buildFeeTable>( - gasPrice: GasPrice, - defaultGasLimits: GasLimits, - gasLimits: Partial>, -): T; diff --git a/packages/launchpad/types/index.d.ts b/packages/launchpad/types/index.d.ts deleted file mode 100644 index 44e906e2ea..0000000000 --- a/packages/launchpad/types/index.d.ts +++ /dev/null @@ -1,140 +0,0 @@ -import * as logs from "./logs"; -export { logs }; -export { pubkeyToAddress, rawSecp256k1PubkeyToAddress } from "./address"; -export { Coin, coin, coins, parseCoins } from "./coins"; -export { - Account, - assertIsBroadcastTxSuccess, - Block, - BlockHeader, - CosmosClient, - GetSequenceResult, - IndexedTx, - isBroadcastTxFailure, - isBroadcastTxSuccess, - BroadcastTxFailure, - BroadcastTxResult, - BroadcastTxSuccess, - SearchByHeightQuery, - SearchBySentFromOrToQuery, - SearchByTagsQuery, - SearchTxQuery, - SearchTxFilter, - isSearchByHeightQuery, - isSearchBySentFromOrToQuery, - isSearchByTagsQuery, -} from "./cosmosclient"; -export { makeSignDoc, serializeSignDoc, StdSignDoc } from "./encoding"; -export { buildFeeTable, FeeTable, GasLimits, GasPrice } from "./gas"; -export { - AuthAccountsResponse, - AuthExtension, - BankBalancesResponse, - BankExtension, - BaseAccount, - BlockResponse, - BroadcastMode, - DistributionCommunityPoolResponse, - DistributionDelegatorRewardResponse, - DistributionDelegatorRewardsResponse, - DistributionExtension, - DistributionParametersResponse, - DistributionValidatorOutstandingRewardsResponse, - DistributionValidatorResponse, - DistributionValidatorRewardsResponse, - DistributionWithdrawAddressResponse, - EncodeTxResponse, - GovExtension, - GovParametersResponse, - GovProposalsResponse, - GovProposalResponse, - GovProposerResponse, - GovDepositsResponse, - GovDepositResponse, - GovTallyResponse, - GovVotesResponse, - GovVoteResponse, - LcdApiArray, - LcdClient, - MintAnnualProvisionsResponse, - MintExtension, - MintInflationResponse, - MintParametersResponse, - NodeInfoResponse, - normalizeLcdApiArray, - normalizePubkey, - BroadcastTxsResponse, - SearchTxsResponse, - setupAuthExtension, - setupBankExtension, - setupDistributionExtension, - setupGovExtension, - setupMintExtension, - setupSlashingExtension, - setupStakingExtension, - setupSupplyExtension, - SlashingExtension, - SlashingParametersResponse, - SlashingSigningInfosResponse, - StakingExtension, - StakingDelegatorDelegationsResponse, - StakingDelegatorUnbondingDelegationsResponse, - StakingDelegatorTransactionsResponse, - StakingDelegatorValidatorsResponse, - StakingDelegatorValidatorResponse, - StakingDelegationResponse, - StakingUnbondingDelegationResponse, - StakingRedelegationsResponse, - StakingValidatorsResponse, - StakingValidatorResponse, - StakingValidatorDelegationsResponse, - StakingValidatorUnbondingDelegationsResponse, - StakingHistoricalInfoResponse, - StakingParametersResponse, - StakingPoolResponse, - SupplyExtension, - TxsResponse, - uint64ToNumber, - uint64ToString, -} from "./lcdapi"; -export { - isMsgBeginRedelegate, - isMsgCreateValidator, - isMsgDelegate, - isMsgEditValidator, - isMsgFundCommunityPool, - isMsgMultiSend, - isMsgSend, - isMsgSetWithdrawAddress, - isMsgUndelegate, - isMsgWithdrawDelegatorReward, - isMsgWithdrawValidatorCommission, - Msg, - MsgBeginRedelegate, - MsgCreateValidator, - MsgDelegate, - MsgEditValidator, - MsgFundCommunityPool, - MsgMultiSend, - MsgSend, - MsgSetWithdrawAddress, - MsgUndelegate, - MsgWithdrawDelegatorReward, - MsgWithdrawValidatorCommission, -} from "./msgs"; -export { - decodeAminoPubkey, - decodeBech32Pubkey, - encodeAminoPubkey, - encodeBech32Pubkey, - encodeSecp256k1Pubkey, -} from "./pubkey"; -export { findSequenceForSignedTx } from "./sequence"; -export { encodeSecp256k1Signature, decodeSignature } from "./signature"; -export { AccountData, Algo, AminoSignResponse, OfflineSigner } from "./signer"; -export { CosmosFeeTable, SigningCosmosClient } from "./signingcosmosclient"; -export { isStdTx, isWrappedStdTx, makeStdTx, CosmosSdkTx, StdTx, WrappedStdTx, WrappedTx } from "./tx"; -export { pubkeyType, PubKey, StdFee, StdSignature } from "./types"; -export { makeCosmoshubPath, executeKdf, KdfConfiguration } from "./wallet"; -export { extractKdfConfiguration, Secp256k1HdWallet } from "./secp256k1hdwallet"; -export { Secp256k1Wallet } from "./secp256k1wallet"; diff --git a/packages/launchpad/types/lcdapi/auth.d.ts b/packages/launchpad/types/lcdapi/auth.d.ts deleted file mode 100644 index e20b710206..0000000000 --- a/packages/launchpad/types/lcdapi/auth.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Coin } from "../coins"; -import { PubKey } from "../types"; -import { LcdClient } from "./lcdclient"; -/** - * A Cosmos SDK base account. - * - * This type describes the base account representation as returned - * by the Cosmos SDK 0.37–0.39 LCD API. - * - * @see https://docs.cosmos.network/master/modules/auth/02_state.html#base-account - */ -export interface BaseAccount { - /** Bech32 account address */ - readonly address: string; - readonly coins: readonly Coin[]; - /** - * The public key of the account. This is not available on-chain as long as the account - * did not send a transaction. - * - * This was a type/value object in Cosmos SDK 0.37, changed to bech32 in Cosmos SDK 0.38 ([1]) - * and changed back to type/value object in Cosmos SDK 0.39 ([2]). - * - * [1]: https://github.com/cosmos/cosmos-sdk/pull/5280 - * [2]: https://github.com/cosmos/cosmos-sdk/pull/6749 - */ - readonly public_key: string | PubKey | null; - /** - * The account number assigned by the blockchain. - * - * This was string encoded in Cosmos SDK 0.37, changed to number in Cosmos SDK 0.38 ([1]) - * and changed back to string in Cosmos SDK 0.39 ([2]). - * - * [1]: https://github.com/cosmos/cosmos-sdk/pull/5280 - * [2]: https://github.com/cosmos/cosmos-sdk/pull/6749 - */ - readonly account_number: number | string; - /** - * The sequence number for replay protection. - * - * This was string encoded in Cosmos SDK 0.37, changed to number in Cosmos SDK 0.38 ([1]) - * and changed back to string in Cosmos SDK 0.39 ([2]). - * - * [1]: https://github.com/cosmos/cosmos-sdk/pull/5280 - * [2]: https://github.com/cosmos/cosmos-sdk/pull/6749 - */ - readonly sequence: number | string; -} -export interface AuthAccountsResponse { - readonly height: string; - readonly result: { - readonly type: "cosmos-sdk/Account"; - readonly value: BaseAccount; - }; -} -export interface AuthExtension { - readonly auth: { - readonly account: (address: string) => Promise; - }; -} -export declare function setupAuthExtension(base: LcdClient): AuthExtension; diff --git a/packages/launchpad/types/lcdapi/bank.d.ts b/packages/launchpad/types/lcdapi/bank.d.ts deleted file mode 100644 index f992569ae7..0000000000 --- a/packages/launchpad/types/lcdapi/bank.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coin } from "../coins"; -import { LcdClient } from "./lcdclient"; -export interface BankBalancesResponse { - readonly height: string; - readonly result: readonly Coin[]; -} -export interface BankExtension { - readonly bank: { - readonly balances: (address: string) => Promise; - }; -} -export declare function setupBankExtension(base: LcdClient): BankExtension; diff --git a/packages/launchpad/types/lcdapi/base.d.ts b/packages/launchpad/types/lcdapi/base.d.ts deleted file mode 100644 index f35cfcd02b..0000000000 --- a/packages/launchpad/types/lcdapi/base.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { WrappedStdTx } from "../tx"; -/** - * The mode used to send transaction - * - * @see https://cosmos.network/rpc/#/Transactions/post_txs - */ -export declare enum BroadcastMode { - /** Return after tx commit */ - Block = "block", - /** Return after CheckTx */ - Sync = "sync", - /** Return right away */ - Async = "async", -} -/** A response from the /txs/encode endpoint */ -export interface EncodeTxResponse { - /** base64-encoded amino-binary encoded representation */ - readonly tx: string; -} -interface NodeInfo { - readonly protocol_version: { - readonly p2p: string; - readonly block: string; - readonly app: string; - }; - readonly id: string; - readonly listen_addr: string; - readonly network: string; - readonly version: string; - readonly channels: string; - readonly moniker: string; - readonly other: { - readonly tx_index: string; - readonly rpc_address: string; - }; -} -interface ApplicationVersion { - readonly name: string; - readonly server_name: string; - readonly client_name: string; - readonly version: string; - readonly commit: string; - readonly build_tags: string; - readonly go: string; -} -export interface NodeInfoResponse { - readonly node_info: NodeInfo; - readonly application_version: ApplicationVersion; -} -interface BlockId { - readonly hash: string; -} -export interface BlockHeader { - readonly version: { - readonly block: string; - readonly app: string; - }; - readonly height: string; - readonly chain_id: string; - /** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */ - readonly time: string; - readonly last_commit_hash: string; - readonly last_block_id: BlockId; - /** Can be empty */ - readonly data_hash: string; - readonly validators_hash: string; - readonly next_validators_hash: string; - readonly consensus_hash: string; - readonly app_hash: string; - /** Can be empty */ - readonly last_results_hash: string; - /** Can be empty */ - readonly evidence_hash: string; - readonly proposer_address: string; -} -interface Block { - readonly header: BlockHeader; - readonly data: { - /** Array of base64 encoded transactions */ - readonly txs: readonly string[] | null; - }; -} -export interface BlockResponse { - readonly block_id: BlockId; - readonly block: Block; -} -export interface TxsResponse { - readonly height: string; - readonly txhash: string; - /** 🤷‍♂️ */ - readonly codespace?: string; - /** Falsy when transaction execution succeeded. Contains error code on error. */ - readonly code?: number; - readonly raw_log: string; - readonly logs?: unknown[]; - readonly tx: WrappedStdTx; - /** The gas limit as set by the user */ - readonly gas_wanted?: string; - /** The gas used by the execution */ - readonly gas_used?: string; - readonly timestamp: string; -} -export interface SearchTxsResponse { - readonly total_count: string; - readonly count: string; - readonly page_number: string; - readonly page_total: string; - readonly limit: string; - readonly txs: readonly TxsResponse[]; -} -export interface BroadcastTxsResponse { - readonly height: string; - readonly txhash: string; - readonly code?: number; - /** - * The result data of the execution (hex encoded). - * - * @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/types/result.go#L101 - */ - readonly data?: string; - readonly raw_log?: string; - /** The same as `raw_log` but deserialized? */ - readonly logs?: unknown[]; - /** The gas limit as set by the user */ - readonly gas_wanted?: string; - /** The gas used by the execution */ - readonly gas_used?: string; -} -export {}; diff --git a/packages/launchpad/types/lcdapi/distribution.d.ts b/packages/launchpad/types/lcdapi/distribution.d.ts deleted file mode 100644 index 59789b1763..0000000000 --- a/packages/launchpad/types/lcdapi/distribution.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Coin } from "../coins"; -import { LcdClient } from "./lcdclient"; -export interface RewardContainer { - readonly validator_address: string; - readonly reward: readonly Coin[] | null; -} -export interface DistributionDelegatorRewardsResponse { - readonly height: string; - readonly result: { - readonly rewards: readonly RewardContainer[] | null; - readonly total: readonly Coin[] | null; - }; -} -export interface DistributionDelegatorRewardResponse { - readonly height: string; - readonly result: readonly Coin[]; -} -export interface DistributionWithdrawAddressResponse { - readonly height: string; - readonly result: string; -} -export interface DistributionValidatorResponse { - readonly height: string; - readonly result: { - readonly operator_address: string; - readonly self_bond_rewards: readonly Coin[]; - readonly val_commission: readonly Coin[]; - }; -} -export interface DistributionValidatorRewardsResponse { - readonly height: string; - readonly result: readonly Coin[]; -} -export interface DistributionValidatorOutstandingRewardsResponse { - readonly height: string; - readonly result: readonly Coin[]; -} -export interface DistributionParametersResponse { - readonly height: string; - readonly result: { - readonly community_tax: string; - readonly base_proposer_reward: string; - readonly bonus_proposer_reward: string; - readonly withdraw_addr_enabled: boolean; - }; -} -export interface DistributionCommunityPoolResponse { - readonly height: string; - readonly result: readonly Coin[]; -} -export interface DistributionExtension { - readonly distribution: { - readonly delegatorRewards: (delegatorAddress: string) => Promise; - readonly delegatorReward: ( - delegatorAddress: string, - validatorAddress: string, - ) => Promise; - readonly withdrawAddress: (delegatorAddress: string) => Promise; - readonly validator: (validatorAddress: string) => Promise; - readonly validatorRewards: (validatorAddress: string) => Promise; - readonly validatorOutstandingRewards: ( - validatorAddress: string, - ) => Promise; - readonly parameters: () => Promise; - readonly communityPool: () => Promise; - }; -} -export declare function setupDistributionExtension(base: LcdClient): DistributionExtension; diff --git a/packages/launchpad/types/lcdapi/gov.d.ts b/packages/launchpad/types/lcdapi/gov.d.ts deleted file mode 100644 index b7f3f8fdf5..0000000000 --- a/packages/launchpad/types/lcdapi/gov.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { Coin } from "../coins"; -import { LcdClient } from "./lcdclient"; -export declare enum GovParametersType { - Deposit = "deposit", - Tallying = "tallying", - Voting = "voting", -} -export interface GovParametersDepositResponse { - readonly height: string; - readonly result: { - readonly min_deposit: readonly Coin[]; - readonly max_deposit_period: string; - }; -} -export interface GovParametersTallyingResponse { - readonly height: string; - readonly result: { - readonly quorum: string; - readonly threshold: string; - readonly veto: string; - }; -} -export interface GovParametersVotingResponse { - readonly height: string; - readonly result: { - readonly voting_period: string; - }; -} -export declare type GovParametersResponse = - | GovParametersDepositResponse - | GovParametersTallyingResponse - | GovParametersVotingResponse; -export interface Tally { - readonly yes: string; - readonly abstain: string; - readonly no: string; - readonly no_with_veto: string; -} -export interface Proposal { - readonly id: string; - readonly proposal_status: string; - readonly final_tally_result: Tally; - readonly submit_time: string; - readonly total_deposit: readonly Coin[]; - readonly deposit_end_time: string; - readonly voting_start_time: string; - readonly voting_end_time: string; - readonly content: { - readonly type: string; - readonly value: { - readonly title: string; - readonly description: string; - }; - }; -} -export interface GovProposalsResponse { - readonly height: string; - readonly result: readonly Proposal[]; -} -export interface GovProposalResponse { - readonly height: string; - readonly result: Proposal; -} -export interface GovProposerResponse { - readonly height: string; - readonly result: { - readonly proposal_id: string; - readonly proposer: string; - }; -} -export interface Deposit { - readonly amount: readonly Coin[]; - readonly proposal_id: string; - readonly depositor: string; -} -export interface GovDepositsResponse { - readonly height: string; - readonly result: readonly Deposit[]; -} -export interface GovDepositResponse { - readonly height: string; - readonly result: Deposit; -} -export interface GovTallyResponse { - readonly height: string; - readonly result: Tally; -} -export interface Vote { - readonly voter: string; - readonly proposal_id: string; - readonly option: string; -} -export interface GovVotesResponse { - readonly height: string; - readonly result: readonly Vote[]; -} -export interface GovVoteResponse { - readonly height: string; - readonly result: Vote; -} -export interface GovExtension { - readonly gov: { - readonly parameters: (parametersType: GovParametersType) => Promise; - readonly proposals: () => Promise; - readonly proposal: (proposalId: string) => Promise; - readonly proposer: (proposalId: string) => Promise; - readonly deposits: (proposalId: string) => Promise; - readonly deposit: (proposalId: string, depositorAddress: string) => Promise; - readonly tally: (proposalId: string) => Promise; - readonly votes: (proposalId: string) => Promise; - readonly vote: (proposalId: string, voterAddress: string) => Promise; - }; -} -export declare function setupGovExtension(base: LcdClient): GovExtension; diff --git a/packages/launchpad/types/lcdapi/index.d.ts b/packages/launchpad/types/lcdapi/index.d.ts deleted file mode 100644 index ea39c092c5..0000000000 --- a/packages/launchpad/types/lcdapi/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export { AuthExtension, AuthAccountsResponse, BaseAccount, setupAuthExtension } from "./auth"; -export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank"; -export { - DistributionCommunityPoolResponse, - DistributionDelegatorRewardResponse, - DistributionDelegatorRewardsResponse, - DistributionExtension, - DistributionParametersResponse, - DistributionValidatorOutstandingRewardsResponse, - DistributionValidatorResponse, - DistributionValidatorRewardsResponse, - DistributionWithdrawAddressResponse, - setupDistributionExtension, -} from "./distribution"; -export { - GovExtension, - GovParametersResponse, - GovProposalsResponse, - GovProposalResponse, - GovProposerResponse, - GovDepositsResponse, - GovDepositResponse, - GovTallyResponse, - GovVotesResponse, - GovVoteResponse, - setupGovExtension, -} from "./gov"; -export { - MintAnnualProvisionsResponse, - MintExtension, - MintInflationResponse, - MintParametersResponse, - setupMintExtension, -} from "./mint"; -export { - setupSlashingExtension, - SlashingExtension, - SlashingParametersResponse, - SlashingSigningInfosResponse, -} from "./slashing"; -export { - setupStakingExtension, - StakingDelegatorDelegationsResponse, - StakingDelegatorUnbondingDelegationsResponse, - StakingDelegatorTransactionsResponse, - StakingDelegatorValidatorsResponse, - StakingDelegatorValidatorResponse, - StakingDelegationResponse, - StakingUnbondingDelegationResponse, - StakingRedelegationsResponse, - StakingValidatorsResponse, - StakingValidatorResponse, - StakingValidatorDelegationsResponse, - StakingValidatorUnbondingDelegationsResponse, - StakingHistoricalInfoResponse, - StakingExtension, - StakingParametersResponse, - StakingPoolResponse, -} from "./staking"; -export { setupSupplyExtension, SupplyExtension, TotalSupplyAllResponse, TotalSupplyResponse } from "./supply"; -export { - BlockResponse, - BroadcastMode, - EncodeTxResponse, - BroadcastTxsResponse, - NodeInfoResponse, - SearchTxsResponse, - TxsResponse, -} from "./base"; -export { LcdApiArray, LcdClient, normalizeLcdApiArray } from "./lcdclient"; -export { normalizePubkey, uint64ToNumber, uint64ToString } from "./utils"; diff --git a/packages/launchpad/types/lcdapi/lcdclient.d.ts b/packages/launchpad/types/lcdapi/lcdclient.d.ts deleted file mode 100644 index 56682379a4..0000000000 --- a/packages/launchpad/types/lcdapi/lcdclient.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { StdTx, WrappedStdTx } from "../tx"; -import { - BlockResponse, - BroadcastMode, - BroadcastTxsResponse, - EncodeTxResponse, - NodeInfoResponse, - SearchTxsResponse, - TxsResponse, -} from "./base"; -/** Unfortunately, Cosmos SDK encodes empty arrays as null */ -export declare type LcdApiArray = readonly T[] | null; -export declare function normalizeLcdApiArray(backend: LcdApiArray): readonly T[]; -declare type LcdExtensionSetup

= (base: LcdClient) => P; -export interface LcdClientBaseOptions { - readonly apiUrl: string; - readonly broadcastMode?: BroadcastMode; -} -/** - * A client to the LCD's (light client daemon) API. - * This light client connects to Tendermint (i.e. the chain), encodes/decodes Amino data for us and provides a convenient JSON interface. - * - * This _JSON over HTTP_ API is sometimes referred to as "REST" or "RPC", which are both misleading terms - * for the same thing. - * - * Please note that the client to the LCD can not verify light client proofs. When using this, - * you need to trust the API provider as well as the network connection between client and API. - * - * @see https://cosmos.network/rpc - */ -export declare class LcdClient { - /** Constructs an LCD client with 0 extensions */ - static withExtensions(options: LcdClientBaseOptions): LcdClient; - /** Constructs an LCD client with 1 extension */ - static withExtensions( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - ): LcdClient & A; - /** Constructs an LCD client with 2 extensions */ - static withExtensions( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - ): LcdClient & A & B; - /** Constructs an LCD client with 3 extensions */ - static withExtensions( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - ): LcdClient & A & B & C; - /** Constructs an LCD client with 4 extensions */ - static withExtensions( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - setupExtensionD: LcdExtensionSetup, - ): LcdClient & A & B & C & D; - /** Constructs an LCD client with 5 extensions */ - static withExtensions< - A extends object, - B extends object, - C extends object, - D extends object, - E extends object - >( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - setupExtensionD: LcdExtensionSetup, - setupExtensionE: LcdExtensionSetup, - ): LcdClient & A & B & C & D & E; - /** Constructs an LCD client with 6 extensions */ - static withExtensions< - A extends object, - B extends object, - C extends object, - D extends object, - E extends object, - F extends object - >( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - setupExtensionD: LcdExtensionSetup, - setupExtensionE: LcdExtensionSetup, - setupExtensionF: LcdExtensionSetup, - ): LcdClient & A & B & C & D & E & F; - /** Constructs an LCD client 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 - >( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - setupExtensionD: LcdExtensionSetup, - setupExtensionE: LcdExtensionSetup, - setupExtensionF: LcdExtensionSetup, - setupExtensionG: LcdExtensionSetup, - ): LcdClient & A & B & C & D & E & F & G; - /** Constructs an LCD client 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 - >( - options: LcdClientBaseOptions, - setupExtensionA: LcdExtensionSetup, - setupExtensionB: LcdExtensionSetup, - setupExtensionC: LcdExtensionSetup, - setupExtensionD: LcdExtensionSetup, - setupExtensionE: LcdExtensionSetup, - setupExtensionF: LcdExtensionSetup, - setupExtensionG: LcdExtensionSetup, - setupExtensionH: LcdExtensionSetup, - ): LcdClient & A & B & C & D & E & F & G & H; - private readonly client; - private readonly broadcastMode; - /** - * Creates a new client to interact with a Cosmos SDK light client daemon. - * This class tries to be a direct mapping onto the API. Some basic decoding and normalizatin is done - * but things like caching are done at a higher level. - * - * When building apps, you should not need to use this class directly. If you do, this indicates a missing feature - * in higher level components. Feel free to raise an issue in this case. - * - * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) - * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns - */ - constructor(apiUrl: string, broadcastMode?: BroadcastMode); - get(path: string, params?: Record): Promise; - post(path: string, params: any): Promise; - blocksLatest(): Promise; - blocks(height: number): Promise; - nodeInfo(): Promise; - txById(id: string): Promise; - txsQuery(query: string): Promise; - /** returns the amino-encoding of the transaction performed by the server */ - encodeTx(tx: WrappedStdTx): Promise; - /** - * Broadcasts a signed transaction to the transaction pool. - * Depending on the client's broadcast mode, this might or might - * wait for checkTx or deliverTx to be executed before returning. - * - * @param tx a signed transaction as StdTx (i.e. not wrapped in type/value container) - */ - broadcastTx(tx: StdTx): Promise; -} -export {}; diff --git a/packages/launchpad/types/lcdapi/mint.d.ts b/packages/launchpad/types/lcdapi/mint.d.ts deleted file mode 100644 index 755d002a85..0000000000 --- a/packages/launchpad/types/lcdapi/mint.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { LcdClient } from "./lcdclient"; -export interface MintParametersResponse { - readonly height: string; - readonly result: { - readonly mint_denom: string; - readonly inflation_rate_change: string; - readonly inflation_max: string; - readonly inflation_min: string; - readonly goal_bonded: string; - readonly blocks_per_year: string; - }; -} -export interface MintInflationResponse { - readonly height: string; - readonly result: string; -} -export interface MintAnnualProvisionsResponse { - readonly height: string; - readonly result: string; -} -export interface MintExtension { - readonly mint: { - readonly parameters: () => Promise; - readonly inflation: () => Promise; - readonly annualProvisions: () => Promise; - }; -} -export declare function setupMintExtension(base: LcdClient): MintExtension; diff --git a/packages/launchpad/types/lcdapi/slashing.d.ts b/packages/launchpad/types/lcdapi/slashing.d.ts deleted file mode 100644 index deaedf5e3a..0000000000 --- a/packages/launchpad/types/lcdapi/slashing.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { LcdClient } from "./lcdclient"; -interface SlashingSigningInfo { - readonly address: string; - readonly start_height: string; - readonly index_offset: string; - readonly jailed_until: string; - readonly tombstoned: boolean; - readonly missed_blocks_counter: string; -} -export interface SlashingSigningInfosResponse { - readonly height: string; - readonly result: readonly SlashingSigningInfo[]; -} -export interface SlashingParametersResponse { - readonly height: string; - readonly result: { - readonly signed_blocks_window: string; - readonly min_signed_per_window: string; - readonly downtime_jail_duration: string; - readonly slash_fraction_double_sign: string; - readonly slash_fraction_downtime: string; - }; -} -export interface SlashingExtension { - readonly slashing: { - readonly signingInfos: () => Promise; - readonly parameters: () => Promise; - }; -} -export declare function setupSlashingExtension(base: LcdClient): SlashingExtension; -export {}; diff --git a/packages/launchpad/types/lcdapi/staking.d.ts b/packages/launchpad/types/lcdapi/staking.d.ts deleted file mode 100644 index bb046fad1d..0000000000 --- a/packages/launchpad/types/lcdapi/staking.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { Coin } from "../coins"; -import { BlockHeader, SearchTxsResponse } from "./base"; -import { LcdClient } from "./lcdclient"; -/** - * Numeric bonding status - * - * @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.5/types/staking.go#L43-L49 - */ -export declare enum BondStatus { - Unbonded = 0, - Unbonding = 1, - Bonded = 2, -} -interface Validator { - readonly operator_address: string; - readonly consensus_pubkey: string; - readonly jailed: boolean; - readonly status: BondStatus; - readonly tokens: string; - readonly delegator_shares: string; - readonly description: { - readonly moniker: string; - readonly identity: string; - readonly website: string; - readonly security_contact: string; - readonly details: string; - }; - readonly unbonding_height: string; - readonly unbonding_time: string; - readonly commission: { - readonly commission_rates: { - readonly rate: string; - readonly max_rate: string; - readonly max_change_rate: string; - }; - readonly update_time: string; - }; - readonly min_self_delegation: string; -} -interface Delegation { - readonly delegator_address: string; - readonly validator_address: string; - readonly shares: string; - readonly balance: Coin; -} -export interface StakingDelegatorDelegationsResponse { - readonly height: string; - readonly result: readonly Delegation[]; -} -interface UnbondingDelegationEntry { - readonly creation_height: string; - readonly completion_time: string; - readonly initial_balance: string; - readonly balance: string; -} -interface UnbondingDelegation { - readonly delegator_address: string; - readonly validator_address: string; - readonly entries: readonly UnbondingDelegationEntry[]; -} -export interface StakingDelegatorUnbondingDelegationsResponse { - readonly height: string; - readonly result: readonly UnbondingDelegation[]; -} -export declare type StakingDelegatorTransactionsResponse = readonly SearchTxsResponse[]; -export interface StakingDelegatorValidatorsResponse { - readonly height: string; - readonly result: readonly Validator[]; -} -export interface StakingDelegatorValidatorResponse { - readonly height: string; - readonly result: Validator; -} -export interface StakingDelegationResponse { - readonly height: string; - readonly result: Delegation; -} -export interface StakingUnbondingDelegationResponse { - readonly height: string; - readonly result: UnbondingDelegation | null; -} -interface RedelegationEntry { - readonly creation_height: string; - readonly completion_time: string; - readonly initial_balance: Coin; - readonly shares_dst: string; -} -interface Redelegation { - readonly delegator_address: string; - readonly validator_src_address: string; - readonly validator_dst_address: string; - readonly entries: readonly RedelegationEntry[]; -} -export interface StakingRedelegationsResponse { - readonly height: string; - readonly result: readonly Redelegation[]; -} -export interface StakingValidatorsParams { - /** @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.5/types/staking.go#L43-L49 */ - readonly status?: "bonded" | "unbonded" | "unbonding"; - readonly page?: number; - readonly limit?: number; -} -export interface StakingValidatorsResponse { - readonly height: string; - readonly result: readonly Validator[]; -} -export interface StakingValidatorResponse { - readonly height: string; - readonly result: Validator; -} -export interface StakingValidatorDelegationsResponse { - readonly height: string; - readonly result: readonly Delegation[]; -} -export interface StakingValidatorUnbondingDelegationsResponse { - readonly height: string; - readonly result: readonly UnbondingDelegation[]; -} -interface HistoricalInfo { - readonly header: BlockHeader; - readonly validators: readonly Validator[]; -} -export interface StakingHistoricalInfoResponse { - readonly height: string; - readonly result: HistoricalInfo; -} -export interface StakingPoolResponse { - readonly height: string; - readonly result: { - readonly not_bonded_tokens: string; - readonly bonded_tokens: string; - }; -} -export interface StakingParametersResponse { - readonly height: string; - readonly result: { - readonly unbonding_time: string; - readonly max_validators: number; - readonly max_entries: number; - readonly historical_entries: number; - readonly bond_denom: string; - }; -} -export interface StakingExtension { - readonly staking: { - /** Get all delegations from a delegator */ - readonly delegatorDelegations: (delegatorAddress: string) => Promise; - /** Get all unbonding delegations from a delegator */ - readonly delegatorUnbondingDelegations: ( - delegatorAddress: string, - ) => Promise; - /** Get all staking txs (i.e msgs) from a delegator */ - readonly delegatorTransactions: ( - delegatorAddress: string, - ) => Promise; - /** Query all validators that a delegator is bonded to */ - readonly delegatorValidators: (delegatorAddress: string) => Promise; - /** Query a validator that a delegator is bonded to */ - readonly delegatorValidator: ( - delegatorAddress: string, - validatorAddress: string, - ) => Promise; - /** Query a delegation between a delegator and a validator */ - readonly delegation: ( - delegatorAddress: string, - validatorAddress: string, - ) => Promise; - /** Query all unbonding delegations between a delegator and a validator */ - readonly unbondingDelegation: ( - delegatorAddress: string, - validatorAddress: string, - ) => Promise; - /** Query redelegations (filters in query params) */ - readonly redelegations: () => Promise; - /** Get all validators */ - readonly validators: (options?: StakingValidatorsParams) => Promise; - /** Get a single validator info */ - readonly validator: (validatorAddress: string) => Promise; - readonly validatorDelegations: (validatorAddress: string) => Promise; - /** Get all unbonding delegations from a validator */ - readonly validatorUnbondingDelegations: ( - validatorAddress: string, - ) => Promise; - /** Get HistoricalInfo at a given height */ - readonly historicalInfo: (height: string) => Promise; - /** Get the current state of the staking pool */ - readonly pool: () => Promise; - /** Get the current staking parameter values */ - readonly parameters: () => Promise; - }; -} -export declare function setupStakingExtension(base: LcdClient): StakingExtension; -export {}; diff --git a/packages/launchpad/types/lcdapi/supply.d.ts b/packages/launchpad/types/lcdapi/supply.d.ts deleted file mode 100644 index 5d9fe774cc..0000000000 --- a/packages/launchpad/types/lcdapi/supply.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Coin } from "../coins"; -import { LcdApiArray, LcdClient } from "./lcdclient"; -export interface TotalSupplyAllResponse { - readonly height: string; - readonly result: LcdApiArray; -} -export interface TotalSupplyResponse { - readonly height: string; - /** The amount */ - readonly result: string; -} -export interface SupplyExtension { - readonly supply: { - readonly totalAll: () => Promise; - readonly total: (denom: string) => Promise; - }; -} -export declare function setupSupplyExtension(base: LcdClient): SupplyExtension; diff --git a/packages/launchpad/types/lcdapi/utils.d.ts b/packages/launchpad/types/lcdapi/utils.d.ts deleted file mode 100644 index d32685643c..0000000000 --- a/packages/launchpad/types/lcdapi/utils.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PubKey } from "../types"; -/** - * Converts an integer expressed as number or string to a number. - * Throws if input is not a valid uint64 or if the value exceeds MAX_SAFE_INTEGER. - * - * This is needed for supporting Comsos SDK 0.37/0.38/0.39 with one client. - */ -export declare function uint64ToNumber(input: number | string): number; -/** - * Converts an integer expressed as number or string to a string. - * Throws if input is not a valid uint64. - * - * This is needed for supporting Comsos SDK 0.37/0.38/0.39 with one client. - */ -export declare function uint64ToString(input: number | string): string; -/** - * Normalizes a pubkey as in `BaseAccount.public_key` to allow supporting - * Comsos SDK 0.37–0.39. - * - * Returns null when unset. - */ -export declare function normalizePubkey(input: string | PubKey | null): PubKey | null; diff --git a/packages/launchpad/types/logs.d.ts b/packages/launchpad/types/logs.d.ts deleted file mode 100644 index 2e1decb3ab..0000000000 --- a/packages/launchpad/types/logs.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface Attribute { - readonly key: string; - readonly value: string; -} -export interface Event { - readonly type: string; - readonly attributes: readonly Attribute[]; -} -export interface Log { - readonly msg_index: number; - readonly log: string; - readonly events: readonly Event[]; -} -export declare function parseAttribute(input: unknown): Attribute; -export declare function parseEvent(input: unknown): Event; -export declare function parseLog(input: unknown): Log; -export declare function parseLogs(input: unknown): readonly Log[]; -/** - * Searches in logs for the first event of the given event type and in that event - * for the first first attribute with the given attribute key. - * - * Throws if the attribute was not found. - */ -export declare function findAttribute( - logs: readonly Log[], - eventType: "message" | "transfer", - attrKey: string, -): Attribute; diff --git a/packages/launchpad/types/msgs.d.ts b/packages/launchpad/types/msgs.d.ts deleted file mode 100644 index 48818d4e55..0000000000 --- a/packages/launchpad/types/msgs.d.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { Coin } from "./coins"; -export interface Msg { - readonly type: string; - readonly value: any; -} -/** A high level transaction of the coin module */ -export interface MsgSend extends Msg { - readonly type: "cosmos-sdk/MsgSend"; - readonly value: { - /** Bech32 account address */ - readonly from_address: string; - /** Bech32 account address */ - readonly to_address: string; - readonly amount: readonly Coin[]; - }; -} -export declare function isMsgSend(msg: Msg): msg is MsgSend; -interface Input { - /** Bech32 account address */ - readonly address: string; - readonly coins: readonly Coin[]; -} -interface Output { - /** Bech32 account address */ - readonly address: string; - readonly coins: readonly Coin[]; -} -/** A high level transaction of the coin module */ -export interface MsgMultiSend extends Msg { - readonly type: "cosmos-sdk/MsgMultiSend"; - readonly value: { - readonly inputs: readonly Input[]; - readonly outputs: readonly Output[]; - }; -} -export declare function isMsgMultiSend(msg: Msg): msg is MsgMultiSend; -/** Verifies a particular invariance */ -export interface MsgVerifyInvariant extends Msg { - readonly type: "cosmos-sdk/MsgVerifyInvariant"; - readonly value: { - /** Bech32 account address */ - readonly sender: string; - readonly invariant_module_name: string; - readonly invariant_route: string; - }; -} -export declare function isMsgVerifyInvariant(msg: Msg): msg is MsgVerifyInvariant; -/** Changes the withdraw address for a delegator (or validator self-delegation) */ -export interface MsgSetWithdrawAddress extends Msg { - readonly type: "cosmos-sdk/MsgModifyWithdrawAddress"; - readonly value: { - /** Bech32 account address */ - readonly delegator_address: string; - /** Bech32 account address */ - readonly withdraw_address: string; - }; -} -export declare function isMsgSetWithdrawAddress(msg: Msg): msg is MsgSetWithdrawAddress; -/** Message for delegation withdraw from a single validator */ -export interface MsgWithdrawDelegatorReward extends Msg { - readonly type: "cosmos-sdk/MsgWithdrawDelegationReward"; - readonly value: { - /** Bech32 account address */ - readonly delegator_address: string; - /** Bech32 account address */ - readonly validator_address: string; - }; -} -export declare function isMsgWithdrawDelegatorReward(msg: Msg): msg is MsgWithdrawDelegatorReward; -/** Message for validator withdraw */ -export interface MsgWithdrawValidatorCommission extends Msg { - readonly type: "cosmos-sdk/MsgWithdrawValidatorCommission"; - readonly value: { - /** Bech32 account address */ - readonly validator_address: string; - }; -} -export declare function isMsgWithdrawValidatorCommission(msg: Msg): msg is MsgWithdrawValidatorCommission; -/** Allows an account to directly fund the community pool. */ -export interface MsgFundCommunityPool extends Msg { - readonly type: "cosmos-sdk/MsgFundCommunityPool"; - readonly value: { - readonly amount: readonly Coin[]; - /** Bech32 account address */ - readonly depositor: string; - }; -} -export declare function isMsgFundCommunityPool(msg: Msg): msg is MsgFundCommunityPool; -interface Any { - readonly type_url: string; - readonly value: Uint8Array; -} -/** Supports submitting arbitrary evidence */ -export interface MsgSubmitEvidence extends Msg { - readonly type: "cosmos-sdk/MsgSubmitEvidence"; - readonly value: { - /** Bech32 account address */ - readonly submitter: string; - readonly evidence: Any; - }; -} -export declare function isMsgSubmitEvidence(msg: Msg): msg is MsgSubmitEvidence; -/** Supports submitting arbitrary proposal content. */ -export interface MsgSubmitProposal extends Msg { - readonly type: "cosmos-sdk/MsgSubmitProposal"; - readonly value: { - readonly content: Any; - readonly initial_deposit: readonly Coin[]; - /** Bech32 account address */ - readonly proposer: string; - }; -} -export declare function isMsgSubmitProposal(msg: Msg): msg is MsgSubmitProposal; -declare enum VoteOption { - VoteOptionUnspecified = 0, - VoteOptionYes = 1, - VoteOptionAbstain = 2, - VoteOptionNo = 3, - VoteOptionNoWithVeto = 4, -} -/** Casts a vote */ -export interface MsgVote extends Msg { - readonly type: "cosmos-sdk/MsgVote"; - readonly value: { - readonly proposal_id: number; - /** Bech32 account address */ - readonly voter: string; - readonly option: VoteOption; - }; -} -export declare function isMsgVote(msg: Msg): msg is MsgVote; -/** Submits a deposit to an existing proposal */ -export interface MsgDeposit extends Msg { - readonly type: "cosmos-sdk/MsgDeposit"; - readonly value: { - readonly proposal_id: number; - /** Bech32 account address */ - readonly depositor: string; - readonly amount: readonly Coin[]; - }; -} -export declare function isMsgDeposit(msg: Msg): msg is MsgDeposit; -/** Unjails a jailed validator */ -export interface MsgUnjail extends Msg { - readonly type: "cosmos-sdk/MsgUnjail"; - readonly value: { - /** Bech32 account address */ - readonly validator_addr: string; - }; -} -export declare function isMsgUnjail(msg: Msg): msg is MsgUnjail; -/** The initial commission rates to be used for creating a validator */ -interface CommissionRates { - readonly rate: string; - readonly max_rate: string; - readonly max_change_rate: string; -} -/** A validator description. */ -interface Description { - readonly moniker: string; - readonly identity: string; - readonly website: string; - readonly security_contact: string; - readonly details: string; -} -/** Creates a new validator. */ -export interface MsgCreateValidator extends Msg { - readonly type: "cosmos-sdk/MsgCreateValidator"; - readonly value: { - readonly description: Description; - readonly commission: CommissionRates; - readonly min_self_delegation: string; - /** Bech32 encoded delegator address */ - readonly delegator_address: string; - /** Bech32 encoded validator address */ - readonly validator_address: string; - /** Bech32 encoded public key */ - readonly pubkey: string; - readonly value: Coin; - }; -} -export declare function isMsgCreateValidator(msg: Msg): msg is MsgCreateValidator; -/** Edits an existing validator. */ -export interface MsgEditValidator extends Msg { - readonly type: "cosmos-sdk/MsgEditValidator"; - readonly value: { - readonly description: Description; - /** Bech32 encoded validator address */ - readonly validator_address: string; - readonly commission_rate: string; - readonly min_self_delegation: string; - }; -} -export declare function isMsgEditValidator(msg: Msg): msg is MsgEditValidator; -/** - * Performs a delegation from a delegate to a validator. - * - * @see https://docs.cosmos.network/master/modules/staking/03_messages.html#msgdelegate - */ -export interface MsgDelegate extends Msg { - readonly type: "cosmos-sdk/MsgDelegate"; - readonly value: { - /** Bech32 encoded delegator address */ - readonly delegator_address: string; - /** Bech32 encoded validator address */ - readonly validator_address: string; - readonly amount: Coin; - }; -} -export declare function isMsgDelegate(msg: Msg): msg is MsgDelegate; -/** Performs a redelegation from a delegate and source validator to a destination validator */ -export interface MsgBeginRedelegate extends Msg { - readonly type: "cosmos-sdk/MsgBeginRedelegate"; - readonly value: { - /** Bech32 encoded delegator address */ - readonly delegator_address: string; - /** Bech32 encoded source validator address */ - readonly validator_src_address: string; - /** Bech32 encoded destination validator address */ - readonly validator_dst_address: string; - readonly amount: Coin; - }; -} -export declare function isMsgBeginRedelegate(msg: Msg): msg is MsgBeginRedelegate; -/** Performs an undelegation from a delegate and a validator */ -export interface MsgUndelegate extends Msg { - readonly type: "cosmos-sdk/MsgUndelegate"; - readonly value: { - /** Bech32 encoded delegator address */ - readonly delegator_address: string; - /** Bech32 encoded validator address */ - readonly validator_address: string; - readonly amount: Coin; - }; -} -export declare function isMsgUndelegate(msg: Msg): msg is MsgUndelegate; -export {}; diff --git a/packages/launchpad/types/pubkey.d.ts b/packages/launchpad/types/pubkey.d.ts deleted file mode 100644 index e39865126b..0000000000 --- a/packages/launchpad/types/pubkey.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { PubKey } from "./types"; -export declare function encodeSecp256k1Pubkey(pubkey: Uint8Array): PubKey; -/** - * Decodes a pubkey in the Amino binary format to a type/value object. - */ -export declare function decodeAminoPubkey(data: Uint8Array): PubKey; -/** - * Decodes a bech32 pubkey to Amino binary, which is then decoded to a type/value object. - * The bech32 prefix is ignored and discareded. - * - * @param bechEncoded the bech32 encoded pubkey - */ -export declare function decodeBech32Pubkey(bechEncoded: string): PubKey; -/** - * Encodes a public key to binary Amino. - */ -export declare function encodeAminoPubkey(pubkey: PubKey): Uint8Array; -/** - * Encodes a public key to binary Amino and then to bech32. - * - * @param pubkey the public key to encode - * @param prefix the bech32 prefix (human readable part) - */ -export declare function encodeBech32Pubkey(pubkey: PubKey, prefix: string): string; diff --git a/packages/launchpad/types/secp256k1hdwallet.d.ts b/packages/launchpad/types/secp256k1hdwallet.d.ts deleted file mode 100644 index 4044139504..0000000000 --- a/packages/launchpad/types/secp256k1hdwallet.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { EnglishMnemonic, HdPath } from "@cosmjs/crypto"; -import { StdSignDoc } from "./encoding"; -import { AccountData, AminoSignResponse, OfflineSigner } from "./signer"; -import { EncryptionConfiguration, KdfConfiguration } from "./wallet"; -/** - * This interface describes a JSON object holding the encrypted wallet and the meta data. - * All fields in here must be JSON types. - */ -export interface Secp256k1HdWalletSerialization { - /** A format+version identifier for this serialization format */ - readonly type: string; - /** Information about the key derivation function (i.e. password to encryption key) */ - readonly kdf: KdfConfiguration; - /** Information about the symmetric encryption */ - readonly encryption: EncryptionConfiguration; - /** An instance of Secp256k1HdWalletData, which is stringified, encrypted and base64 encoded. */ - readonly data: string; -} -export declare function extractKdfConfiguration(serialization: string): KdfConfiguration; -export declare class Secp256k1HdWallet implements OfflineSigner { - /** - * Restores a wallet from the given BIP39 mnemonic. - * - * @param mnemonic Any valid English mnemonic. - * @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static fromMnemonic(mnemonic: string, hdPath?: HdPath, prefix?: string): Promise; - /** - * Generates a new wallet with a BIP39 mnemonic of the given length. - * - * @param length The number of words in the mnemonic (12, 15, 18, 21 or 24). - * @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static generate( - length?: 12 | 15 | 18 | 21 | 24, - hdPath?: HdPath, - prefix?: string, - ): Promise; - /** - * Restores a wallet from an encrypted serialization. - * - * @param password The user provided password used to generate an encryption key via a KDF. - * This is not normalized internally (see "Unicode normalization" to learn more). - */ - static deserialize(serialization: string, password: string): Promise; - /** - * Restores a wallet from an encrypted serialization. - * - * This is an advanced alternative to calling `deserialize(serialization, password)` directly, which allows - * you to offload the KDF execution to a non-UI thread (e.g. in a WebWorker). - * - * The caller is responsible for ensuring the key was derived with the given KDF configuration. This can be - * done using `extractKdfConfiguration(serialization)` and `executeKdf(password, kdfConfiguration)` from this package. - */ - static deserializeWithEncryptionKey( - serialization: string, - encryptionKey: Uint8Array, - ): Promise; - private static deserializeTypeV1; - /** Base secret */ - private readonly secret; - /** Derivation instruction */ - private readonly accounts; - /** Derived data */ - private readonly pubkey; - private readonly privkey; - protected constructor( - mnemonic: EnglishMnemonic, - hdPath: HdPath, - privkey: Uint8Array, - pubkey: Uint8Array, - prefix: string, - ); - get mnemonic(): string; - private get address(); - getAccounts(): Promise; - signAmino(signerAddress: string, signDoc: StdSignDoc): Promise; - /** - * Generates an encrypted serialization of this wallet. - * - * @param password The user provided password used to generate an encryption key via a KDF. - * This is not normalized internally (see "Unicode normalization" to learn more). - */ - serialize(password: string): Promise; - /** - * Generates an encrypted serialization of this wallet. - * - * This is an advanced alternative to calling `serialize(password)` directly, which allows you to - * offload the KDF execution to a non-UI thread (e.g. in a WebWorker). - * - * The caller is responsible for ensuring the key was derived with the given KDF options. If this - * is not the case, the wallet cannot be restored with the original password. - */ - serializeWithEncryptionKey(encryptionKey: Uint8Array, kdfConfiguration: KdfConfiguration): Promise; -} diff --git a/packages/launchpad/types/secp256k1wallet.d.ts b/packages/launchpad/types/secp256k1wallet.d.ts deleted file mode 100644 index b039f5021b..0000000000 --- a/packages/launchpad/types/secp256k1wallet.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { StdSignDoc } from "./encoding"; -import { AccountData, AminoSignResponse, OfflineSigner } from "./signer"; -/** - * A wallet that holds a single secp256k1 keypair. - * - * If you want to work with BIP39 mnemonics and multiple accounts, use Secp256k1HdWallet. - */ -export declare class Secp256k1Wallet implements OfflineSigner { - /** - * Creates a Secp256k1Wallet from the given private key - * - * @param privkey The private key. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static fromKey(privkey: Uint8Array, prefix?: string): Promise; - private readonly pubkey; - private readonly privkey; - private readonly prefix; - private constructor(); - private get address(); - getAccounts(): Promise; - signAmino(signerAddress: string, signDoc: StdSignDoc): Promise; -} diff --git a/packages/launchpad/types/sequence.d.ts b/packages/launchpad/types/sequence.d.ts deleted file mode 100644 index 3bd3430d5e..0000000000 --- a/packages/launchpad/types/sequence.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { WrappedStdTx } from "./tx"; -/** - * Serach for sequence s with `min` <= `s` < `upperBound` to find the sequence that was used to sign the transaction - * - * @param tx The signed transaction - * @param chainId The chain ID for which this transaction was signed - * @param accountNumber The account number for which this transaction was signed - * @param upperBound The upper bound for the testing, i.e. sequence must be lower than this value - * @param min The lowest sequence that is tested - * - * @returns the sequence if a match was found and undefined otherwise - */ -export declare function findSequenceForSignedTx( - tx: WrappedStdTx, - chainId: string, - accountNumber: number, - upperBound: number, - min?: number, -): Promise; diff --git a/packages/launchpad/types/signature.d.ts b/packages/launchpad/types/signature.d.ts deleted file mode 100644 index c23e7167bc..0000000000 --- a/packages/launchpad/types/signature.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { StdSignature } from "./types"; -/** - * Takes a binary pubkey and signature to create a signature object - * - * @param pubkey a compressed secp256k1 public key - * @param signature a 64 byte fixed length representation of secp256k1 signature components r and s - */ -export declare function encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Array): StdSignature; -export declare function decodeSignature( - signature: StdSignature, -): { - readonly pubkey: Uint8Array; - readonly signature: Uint8Array; -}; diff --git a/packages/launchpad/types/signer.d.ts b/packages/launchpad/types/signer.d.ts deleted file mode 100644 index 783c429998..0000000000 --- a/packages/launchpad/types/signer.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { StdSignDoc } from "./encoding"; -import { StdSignature } from "./types"; -export declare type Algo = "secp256k1" | "ed25519" | "sr25519"; -export interface AccountData { - /** A printable address (typically bech32 encoded) */ - readonly address: string; - readonly algo: Algo; - readonly pubkey: Uint8Array; -} -export interface AminoSignResponse { - /** - * The sign doc that was signed. - * This may be different from the input signDoc when the signer modifies it as part of the signing process. - */ - readonly signed: StdSignDoc; - readonly signature: StdSignature; -} -export interface OfflineSigner { - /** - * Get AccountData array from wallet. Rejects if not enabled. - */ - readonly getAccounts: () => Promise; - /** - * Request signature from whichever key corresponds to provided bech32-encoded address. Rejects if not enabled. - * - * The signer implementation may offer the user the ability to override parts of the signDoc. It must - * return the doc that was signed in the response. - * - * @param signerAddress The address of the account that should sign the transaction - * @param signDoc The content that should be signed - */ - readonly signAmino: (signerAddress: string, signDoc: StdSignDoc) => Promise; -} diff --git a/packages/launchpad/types/signingcosmosclient.d.ts b/packages/launchpad/types/signingcosmosclient.d.ts deleted file mode 100644 index b5d2765dde..0000000000 --- a/packages/launchpad/types/signingcosmosclient.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Coin } from "./coins"; -import { Account, BroadcastTxResult, CosmosClient, GetSequenceResult } from "./cosmosclient"; -import { FeeTable, GasLimits, GasPrice } from "./gas"; -import { BroadcastMode } from "./lcdapi"; -import { Msg } from "./msgs"; -import { OfflineSigner } from "./signer"; -import { StdTx } from "./tx"; -import { StdFee } from "./types"; -/** - * These fees are used by the higher level methods of SigningCosmosClient - */ -export interface CosmosFeeTable extends FeeTable { - readonly send: StdFee; -} -/** Use for testing only */ -export interface PrivateSigningCosmosClient { - readonly fees: CosmosFeeTable; -} -export declare class SigningCosmosClient extends CosmosClient { - readonly signerAddress: string; - private readonly signer; - private readonly fees; - /** - * Creates a new client with signing capability to interact with a Cosmos SDK blockchain. This is the bigger brother of CosmosClient. - * - * This instance does a lot of caching. In order to benefit from that you should try to use one instance - * for the lifetime of your application. When switching backends, a new instance must be created. - * - * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) - * @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address. - * @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input. - * @param gasPrice The price paid per unit of gas - * @param gasLimits Custom overrides for gas limits related to specific transaction types - * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns - */ - constructor( - apiUrl: string, - signerAddress: string, - signer: OfflineSigner, - gasPrice?: GasPrice, - gasLimits?: Partial>, - broadcastMode?: BroadcastMode, - ); - getSequence(address?: string): Promise; - getAccount(address?: string): Promise; - sendTokens( - recipientAddress: string, - transferAmount: readonly Coin[], - memo?: string, - ): Promise; - /** - * Gets account number and sequence from the API, creates a sign doc, - * creates a single signature, assembles the signed transaction and broadcasts it. - */ - signAndBroadcast(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise; - /** - * Gets account number and sequence from the API, creates a sign doc, - * creates a single signature and assembles the signed transaction. - */ - sign(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise; - /** - * Gets account number and sequence from the API, creates a sign doc, - * creates a single signature and appends it to the existing signatures. - */ - appendSignature(signedTx: StdTx): Promise; -} diff --git a/packages/launchpad/types/tx.d.ts b/packages/launchpad/types/tx.d.ts deleted file mode 100644 index 501dc880aa..0000000000 --- a/packages/launchpad/types/tx.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StdSignDoc } from "./encoding"; -import { Msg } from "./msgs"; -import { StdFee, StdSignature } from "./types"; -/** - * A Cosmos SDK StdTx - * - * @see https://docs.cosmos.network/master/modules/auth/03_types.html#stdtx - */ -export interface StdTx { - readonly msg: readonly Msg[]; - readonly fee: StdFee; - readonly signatures: readonly StdSignature[]; - readonly memo: string | undefined; -} -export declare function isStdTx(txValue: unknown): txValue is StdTx; -export declare function makeStdTx( - content: Pick, - signatures: StdSignature | readonly StdSignature[], -): StdTx; -/** - * An Amino JSON wrapper around the Tx interface - */ -export interface WrappedTx { - readonly type: string; - readonly value: any; -} -/** - * An Amino JSON wrapper around StdTx - */ -export interface WrappedStdTx extends WrappedTx { - readonly type: "cosmos-sdk/StdTx"; - readonly value: StdTx; -} -export declare function isWrappedStdTx(wrapped: WrappedTx): wrapped is WrappedStdTx; -/** @deprecated use WrappedStdTx */ -export declare type CosmosSdkTx = WrappedStdTx; diff --git a/packages/launchpad/types/types.d.ts b/packages/launchpad/types/types.d.ts deleted file mode 100644 index 9c22056aa8..0000000000 --- a/packages/launchpad/types/types.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Coin } from "./coins"; -export interface StdFee { - readonly amount: readonly Coin[]; - readonly gas: string; -} -export interface StdSignature { - readonly pub_key: PubKey; - readonly signature: string; -} -export interface PubKey { - readonly type: string; - readonly value: string; -} -export declare const pubkeyType: { - /** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/ed25519/ed25519.go#L22 */ - secp256k1: "tendermint/PubKeySecp256k1"; - /** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/secp256k1/secp256k1.go#L23 */ - ed25519: "tendermint/PubKeyEd25519"; - /** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/sr25519/codec.go#L12 */ - sr25519: "tendermint/PubKeySr25519"; -}; diff --git a/packages/launchpad/types/wallet.d.ts b/packages/launchpad/types/wallet.d.ts deleted file mode 100644 index 6c433d3299..0000000000 --- a/packages/launchpad/types/wallet.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HdPath } from "@cosmjs/crypto"; -/** - * The Cosmoshub derivation path in the form `m/44'/118'/0'/0/a` - * with 0-based account index `a`. - */ -export declare function makeCosmoshubPath(a: number): HdPath; -/** - * A fixed salt is chosen to archive a deterministic password to key derivation. - * This reduces the scope of a potential rainbow attack to all CosmJS users. - * Must be 16 bytes due to implementation limitations. - */ -export declare const cosmjsSalt: Uint8Array; -export interface KdfConfiguration { - /** - * An algorithm identifier, such as "argon2id" or "scrypt". - */ - readonly algorithm: string; - /** A map of algorithm-specific parameters */ - readonly params: Record; -} -export declare function executeKdf(password: string, configuration: KdfConfiguration): Promise; -/** - * Configuration how to encrypt data or how data was encrypted. - * This is stored as part of the wallet serialization and must only contain JSON types. - */ -export interface EncryptionConfiguration { - /** - * An algorithm identifier, such as "xchacha20poly1305-ietf". - */ - readonly algorithm: string; - /** A map of algorithm-specific parameters */ - readonly params?: Record; -} -export declare const supportedAlgorithms: { - xchacha20poly1305Ietf: string; -}; -export declare function encrypt( - plaintext: Uint8Array, - encryptionKey: Uint8Array, - config: EncryptionConfiguration, -): Promise; -export declare function decrypt( - ciphertext: Uint8Array, - encryptionKey: Uint8Array, - config: EncryptionConfiguration, -): Promise; diff --git a/packages/ledger-amino/types/index.d.ts b/packages/ledger-amino/types/index.d.ts deleted file mode 100644 index 155dfd1433..0000000000 --- a/packages/ledger-amino/types/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { LaunchpadLedger } from "./launchpadledger"; -export { LedgerSigner } from "./ledgersigner"; diff --git a/packages/ledger-amino/types/launchpadledger.d.ts b/packages/ledger-amino/types/launchpadledger.d.ts deleted file mode 100644 index 525d297a3c..0000000000 --- a/packages/ledger-amino/types/launchpadledger.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { HdPath } from "@cosmjs/crypto"; -import Transport from "@ledgerhq/hw-transport"; -export interface LedgerAppErrorResponse { - readonly error_message?: string; - readonly device_locked?: boolean; -} -export interface LaunchpadLedgerOptions { - readonly hdPaths?: readonly HdPath[]; - readonly prefix?: string; - readonly testModeAllowed?: boolean; -} -export declare class LaunchpadLedger { - private readonly testModeAllowed; - private readonly hdPaths; - private readonly prefix; - private readonly app; - constructor(transport: Transport, options?: LaunchpadLedgerOptions); - getCosmosAppVersion(): Promise; - getPubkey(hdPath?: HdPath): Promise; - getPubkeys(): Promise; - getCosmosAddress(pubkey?: Uint8Array): Promise; - sign(message: Uint8Array, hdPath?: HdPath): Promise; - private verifyAppMode; - private getOpenAppName; - private verifyAppVersion; - private verifyCosmosAppIsOpen; - private verifyDeviceIsReady; - private handleLedgerErrors; -} diff --git a/packages/ledger-amino/types/ledgersigner.d.ts b/packages/ledger-amino/types/ledgersigner.d.ts deleted file mode 100644 index 80505ec0ae..0000000000 --- a/packages/ledger-amino/types/ledgersigner.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import { AccountData, OfflineSigner, StdSignDoc } from "@cosmjs/launchpad"; -import { AminoSignResponse } from "@cosmjs/launchpad"; -import Transport from "@ledgerhq/hw-transport"; -import { LaunchpadLedgerOptions } from "./launchpadledger"; -export declare class LedgerSigner implements OfflineSigner { - private readonly ledger; - private readonly hdPaths; - private accounts?; - constructor(transport: Transport, options?: LaunchpadLedgerOptions); - getAccounts(): Promise; - signAmino(signerAddress: string, signDoc: StdSignDoc): Promise; -} diff --git a/packages/math/types/decimal.d.ts b/packages/math/types/decimal.d.ts deleted file mode 100644 index c2f431659a..0000000000 --- a/packages/math/types/decimal.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Uint32, Uint53, Uint64 } from "./integers"; -/** - * A type for arbitrary precision, non-negative decimals. - * - * Instances of this class are immutable. - */ -export declare class Decimal { - static fromUserInput(input: string, fractionalDigits: number): Decimal; - static fromAtomics(atomics: string, fractionalDigits: number): Decimal; - private static verifyFractionalDigits; - static compare(a: Decimal, b: Decimal): number; - get atomics(): string; - get fractionalDigits(): number; - private readonly data; - private constructor(); - toString(): string; - /** - * Returns an approximation as a float type. Only use this if no - * exact calculation is required. - */ - toFloatApproximation(): number; - /** - * a.plus(b) returns a+b. - * - * Both values need to have the same fractional digits. - */ - plus(b: Decimal): Decimal; - /** - * a.minus(b) returns a-b. - * - * Both values need to have the same fractional digits. - * The resulting difference needs to be non-negative. - */ - minus(b: Decimal): Decimal; - /** - * a.multiply(b) returns a*b. - * - * We only allow multiplication by unsigned integers to avoid rounding errors. - */ - multiply(b: Uint32 | Uint53 | Uint64): Decimal; - equals(b: Decimal): boolean; - isLessThan(b: Decimal): boolean; - isLessThanOrEqual(b: Decimal): boolean; - isGreaterThan(b: Decimal): boolean; - isGreaterThanOrEqual(b: Decimal): boolean; -} diff --git a/packages/math/types/index.d.ts b/packages/math/types/index.d.ts deleted file mode 100644 index b888136fd9..0000000000 --- a/packages/math/types/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Decimal } from "./decimal"; -export { Int53, Uint32, Uint53, Uint64 } from "./integers"; diff --git a/packages/math/types/integers.d.ts b/packages/math/types/integers.d.ts deleted file mode 100644 index b1078dcf11..0000000000 --- a/packages/math/types/integers.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** Internal interface to ensure all integer types can be used equally */ -interface Integer { - readonly toNumber: () => number; - readonly toString: () => string; -} -interface WithByteConverters { - readonly toBytesBigEndian: () => Uint8Array; - readonly toBytesLittleEndian: () => Uint8Array; -} -export declare class Uint32 implements Integer, WithByteConverters { - /** @deprecated use Uint32.fromBytes */ - static fromBigEndianBytes(bytes: ArrayLike): Uint32; - /** - * Creates a Uint32 from a fixed length byte array. - * - * @param bytes a list of exactly 4 bytes - * @param endianess defaults to big endian - */ - static fromBytes(bytes: ArrayLike, endianess?: "be" | "le"): Uint32; - static fromString(str: string): Uint32; - protected readonly data: number; - constructor(input: number); - toBytesBigEndian(): Uint8Array; - toBytesLittleEndian(): Uint8Array; - toNumber(): number; - toString(): string; -} -export declare class Int53 implements Integer { - static fromString(str: string): Int53; - protected readonly data: number; - constructor(input: number); - toNumber(): number; - toString(): string; -} -export declare class Uint53 implements Integer { - static fromString(str: string): Uint53; - protected readonly data: Int53; - constructor(input: number); - toNumber(): number; - toString(): string; -} -export declare class Uint64 implements Integer, WithByteConverters { - /** @deprecated use Uint64.fromBytes */ - static fromBytesBigEndian(bytes: ArrayLike): Uint64; - /** - * Creates a Uint64 from a fixed length byte array. - * - * @param bytes a list of exactly 8 bytes - * @param endianess defaults to big endian - */ - static fromBytes(bytes: ArrayLike, endianess?: "be" | "le"): Uint64; - static fromString(str: string): Uint64; - static fromNumber(input: number): Uint64; - private readonly data; - private constructor(); - toBytesBigEndian(): Uint8Array; - toBytesLittleEndian(): Uint8Array; - toString(): string; - toNumber(): number; -} -export {}; diff --git a/packages/proto-signing/types/adr27.d.ts b/packages/proto-signing/types/adr27.d.ts deleted file mode 100644 index 89e45c6897..0000000000 --- a/packages/proto-signing/types/adr27.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Converts default values to null in order to tell protobuf.js - * to not serialize them. - * - * @see https://github.com/cosmos/cosmos-sdk/pull/6979 - */ -export declare function omitDefault(input: T): T | null; -/** - * Walks through a potentially nested object and calls omitDefault on each element. - */ -export declare function omitDefaults(input: any): any; diff --git a/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts deleted file mode 100644 index 1bbe838cd5..0000000000 --- a/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -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/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts deleted file mode 100644 index b6e3e21709..0000000000 --- a/packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -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/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts b/packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts deleted file mode 100644 index 67d31d1c58..0000000000 --- a/packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -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/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts b/packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts deleted file mode 100644 index d5b079cf3e..0000000000 --- a/packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -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/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts b/packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts deleted file mode 100644 index 35e612d5e3..0000000000 --- a/packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -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/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts b/packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts deleted file mode 100644 index da62633cc4..0000000000 --- a/packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -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/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts b/packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts deleted file mode 100644 index 9ac578db27..0000000000 --- a/packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts +++ /dev/null @@ -1,279 +0,0 @@ -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/proto-signing/types/codec/cosmos_proto/cosmos.d.ts b/packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts deleted file mode 100644 index ac37814871..0000000000 --- a/packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const protobufPackage = "cosmos_proto"; diff --git a/packages/proto-signing/types/codec/gogoproto/gogo.d.ts b/packages/proto-signing/types/codec/gogoproto/gogo.d.ts deleted file mode 100644 index 885d30bdc6..0000000000 --- a/packages/proto-signing/types/codec/gogoproto/gogo.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const protobufPackage = "gogoproto"; diff --git a/packages/proto-signing/types/codec/google/protobuf/any.d.ts b/packages/proto-signing/types/codec/google/protobuf/any.d.ts deleted file mode 100644 index 1b3a977b6d..0000000000 --- a/packages/proto-signing/types/codec/google/protobuf/any.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -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/proto-signing/types/codec/google/protobuf/descriptor.d.ts b/packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts deleted file mode 100644 index ea55892107..0000000000 --- a/packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts +++ /dev/null @@ -1,1033 +0,0 @@ -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/proto-signing/types/codec/tendermint/crypto/keys.d.ts b/packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts deleted file mode 100644 index 8b5b0c59df..0000000000 --- a/packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -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/proto-signing/types/demo.d.ts b/packages/proto-signing/types/demo.d.ts deleted file mode 100644 index 3cacd8ffc0..0000000000 --- a/packages/proto-signing/types/demo.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Type } from "protobufjs"; -export declare const MsgDemo: Type; -declare const root: import("protobufjs").Namespace; -export default root; diff --git a/packages/proto-signing/types/demo.proto.d.ts b/packages/proto-signing/types/demo.proto.d.ts deleted file mode 100644 index 2cad5e4f64..0000000000 --- a/packages/proto-signing/types/demo.proto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const proto: string; -export default proto; diff --git a/packages/proto-signing/types/directsecp256k1hdwallet.d.ts b/packages/proto-signing/types/directsecp256k1hdwallet.d.ts deleted file mode 100644 index f94e1272b6..0000000000 --- a/packages/proto-signing/types/directsecp256k1hdwallet.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { EnglishMnemonic, HdPath } from "@cosmjs/crypto"; -import { AccountData } from "@cosmjs/launchpad"; -import { SignDoc } from "./codec/cosmos/tx/v1beta1/tx"; -import { DirectSignResponse, OfflineDirectSigner } from "./signer"; -/** A wallet for protobuf based signing using SIGN_MODE_DIRECT */ -export declare class DirectSecp256k1HdWallet implements OfflineDirectSigner { - /** - * Restores a wallet from the given BIP39 mnemonic. - * - * @param mnemonic Any valid English mnemonic. - * @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static fromMnemonic(mnemonic: string, hdPath?: HdPath, prefix?: string): Promise; - /** - * Generates a new wallet with a BIP39 mnemonic of the given length. - * - * @param length The number of words in the mnemonic (12, 15, 18, 21 or 24). - * @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static generate( - length?: 12 | 15 | 18 | 21 | 24, - hdPath?: HdPath, - prefix?: string, - ): Promise; - /** Base secret */ - private readonly secret; - /** Derivation instruction */ - private readonly accounts; - /** Derived data */ - private readonly pubkey; - private readonly privkey; - protected constructor( - mnemonic: EnglishMnemonic, - hdPath: HdPath, - privkey: Uint8Array, - pubkey: Uint8Array, - prefix: string, - ); - get mnemonic(): string; - private get address(); - getAccounts(): Promise; - signDirect(address: string, signDoc: SignDoc): Promise; -} diff --git a/packages/proto-signing/types/directsecp256k1wallet.d.ts b/packages/proto-signing/types/directsecp256k1wallet.d.ts deleted file mode 100644 index fc7e189f75..0000000000 --- a/packages/proto-signing/types/directsecp256k1wallet.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AccountData } from "@cosmjs/launchpad"; -import { SignDoc } from "./codec/cosmos/tx/v1beta1/tx"; -import { DirectSignResponse, OfflineDirectSigner } from "./signer"; -/** - * A wallet that holds a single secp256k1 keypair. - * - * If you want to work with BIP39 mnemonics and multiple accounts, use DirectSecp256k1HdWallet. - */ -export declare class DirectSecp256k1Wallet implements OfflineDirectSigner { - /** - * Creates a DirectSecp256k1Wallet from the given private key - * - * @param privkey The private key. - * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". - */ - static fromKey(privkey: Uint8Array, prefix?: string): Promise; - private readonly pubkey; - private readonly privkey; - private readonly prefix; - private constructor(); - private get address(); - getAccounts(): Promise; - signDirect(address: string, signDoc: SignDoc): Promise; -} diff --git a/packages/proto-signing/types/index.d.ts b/packages/proto-signing/types/index.d.ts deleted file mode 100644 index 634ff40182..0000000000 --- a/packages/proto-signing/types/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { EncodeObject, GeneratedType, Registry } from "./registry"; -export { DirectSecp256k1HdWallet } from "./directsecp256k1hdwallet"; -export { DirectSecp256k1Wallet } from "./directsecp256k1wallet"; -export { decodePubkey, encodePubkey } from "./pubkey"; -export { DirectSignResponse, isOfflineDirectSigner, OfflineDirectSigner, OfflineSigner } from "./signer"; -export { makeAuthInfoBytes, makeSignBytes, makeSignDoc } from "./signing"; diff --git a/packages/proto-signing/types/pubkey.d.ts b/packages/proto-signing/types/pubkey.d.ts deleted file mode 100644 index 9a64a11d49..0000000000 --- a/packages/proto-signing/types/pubkey.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PubKey as LaunchpadPubKey } from "@cosmjs/launchpad"; -import { Any } from "./codec/google/protobuf/any"; -export declare function encodePubkey(pubkey: LaunchpadPubKey): Any; -export declare function decodePubkey(pubkey?: Any | null): LaunchpadPubKey | null; diff --git a/packages/proto-signing/types/registry.d.ts b/packages/proto-signing/types/registry.d.ts deleted file mode 100644 index 3f19f6bd5e..0000000000 --- a/packages/proto-signing/types/registry.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import Long from "long"; -import protobuf from "protobufjs"; -import { TxBody } from "./codec/cosmos/tx/v1beta1/tx"; -import { Any } from "./codec/google/protobuf/any"; -export interface GeneratedType { - readonly encode: ( - message: - | any - | { - [k: string]: any; - }, - writer?: protobuf.Writer, - ) => protobuf.Writer; - readonly decode: (input: Uint8Array | protobuf.Reader, length?: number) => any; - readonly fromJSON: (object: { [k: string]: any }) => any; - readonly fromPartial: (object: { [k: string]: any }) => any; - readonly toJSON: ( - message: - | any - | { - [k: string]: any; - }, - ) => unknown; -} -export interface EncodeObject { - readonly typeUrl: string; - readonly value: any; -} -export interface DecodeObject { - readonly typeUrl: string; - readonly value: Uint8Array; -} -export interface TxBodyValue { - readonly messages: readonly EncodeObject[]; - readonly memo?: string; - readonly timeoutHeight?: Long; - readonly extensionOptions?: Any[]; - readonly nonCriticalExtensionOptions?: Any[]; -} -export declare class Registry { - private readonly types; - constructor(customTypes?: Iterable<[string, GeneratedType]>); - register(typeUrl: string, type: GeneratedType): void; - lookupType(typeUrl: string): GeneratedType | undefined; - private lookupTypeWithError; - encode({ typeUrl, value }: EncodeObject): Uint8Array; - encodeTxBody(txBodyFields: TxBodyValue): Uint8Array; - decode({ typeUrl, value }: DecodeObject): any; - decodeTxBody(txBody: Uint8Array): TxBody; -} diff --git a/packages/proto-signing/types/signer.d.ts b/packages/proto-signing/types/signer.d.ts deleted file mode 100644 index d607d1977d..0000000000 --- a/packages/proto-signing/types/signer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { AccountData, OfflineSigner as OfflineAminoSigner, StdSignature } from "@cosmjs/launchpad"; -import { SignDoc } from "./codec/cosmos/tx/v1beta1/tx"; -export interface DirectSignResponse { - /** - * The sign doc that was signed. - * This may be different from the input signDoc when the signer modifies it as part of the signing process. - */ - readonly signed: SignDoc; - readonly signature: StdSignature; -} -export interface OfflineDirectSigner { - readonly getAccounts: () => Promise; - readonly signDirect: (signerAddress: string, signDoc: SignDoc) => Promise; -} -export declare type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner; -export declare function isOfflineDirectSigner(signer: OfflineSigner): signer is OfflineDirectSigner; diff --git a/packages/proto-signing/types/signing.d.ts b/packages/proto-signing/types/signing.d.ts deleted file mode 100644 index 0511f2e8c0..0000000000 --- a/packages/proto-signing/types/signing.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Coin } from "./codec/cosmos/base/v1beta1/coin"; -import { SignMode } from "./codec/cosmos/tx/signing/v1beta1/signing"; -import { SignDoc } from "./codec/cosmos/tx/v1beta1/tx"; -import { Any } from "./codec/google/protobuf/any"; -/** - * Creates and serializes an AuthInfo document using SIGN_MODE_DIRECT. - */ -export declare function makeAuthInfoBytes( - pubkeys: readonly Any[], - feeAmount: readonly Coin[], - gasLimit: number, - sequence: number, - signMode?: SignMode, -): Uint8Array; -export declare function makeSignDoc( - bodyBytes: Uint8Array, - authInfoBytes: Uint8Array, - chainId: string, - accountNumber: number, -): SignDoc; -export declare function makeSignBytes({ - accountNumber, - authInfoBytes, - bodyBytes, - chainId, -}: SignDoc): Uint8Array; diff --git a/packages/socket/types/index.d.ts b/packages/socket/types/index.d.ts deleted file mode 100644 index 25f0df121f..0000000000 --- a/packages/socket/types/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { ConnectionStatus, QueueingStreamingSocket } from "./queueingstreamingsocket"; -export { ReconnectingSocket } from "./reconnectingsocket"; -export { - SocketWrapper, - SocketWrapperCloseEvent, - SocketWrapperErrorEvent, - SocketWrapperMessageEvent, -} from "./socketwrapper"; -export { StreamingSocket } from "./streamingsocket"; diff --git a/packages/socket/types/queueingstreamingsocket.d.ts b/packages/socket/types/queueingstreamingsocket.d.ts deleted file mode 100644 index 46fd9e739a..0000000000 --- a/packages/socket/types/queueingstreamingsocket.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ValueAndUpdates } from "@cosmjs/stream"; -import { Stream } from "xstream"; -import { SocketWrapperMessageEvent } from "./socketwrapper"; -export declare enum ConnectionStatus { - Unconnected = 0, - Connecting = 1, - Connected = 2, - Disconnected = 3, -} -/** - * A wrapper around StreamingSocket that can queue requests. - */ -export declare class QueueingStreamingSocket { - readonly connectionStatus: ValueAndUpdates; - readonly events: Stream; - private readonly url; - private readonly timeout; - private readonly queue; - private socket; - private isProcessingQueue; - private eventProducerListener; - private readonly connectionStatusProducer; - private readonly reconnectedHandler?; - constructor(url: string, timeout?: number, reconnectedHandler?: () => void); - connect(): void; - disconnect(): void; - reconnect(): void; - getQueueLength(): number; - queueRequest(request: string): void; - private processQueue; -} diff --git a/packages/socket/types/reconnectingsocket.d.ts b/packages/socket/types/reconnectingsocket.d.ts deleted file mode 100644 index fc490b4fed..0000000000 --- a/packages/socket/types/reconnectingsocket.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ValueAndUpdates } from "@cosmjs/stream"; -import { Stream } from "xstream"; -import { ConnectionStatus } from "./queueingstreamingsocket"; -import { SocketWrapperMessageEvent } from "./socketwrapper"; -/** - * A wrapper around QueueingStreamingSocket that reconnects automatically. - */ -export declare class ReconnectingSocket { - /** Starts with a 0.1 second timeout, then doubles every attempt with a maximum timeout of 5 seconds. */ - private static calculateTimeout; - readonly connectionStatus: ValueAndUpdates; - readonly events: Stream; - private readonly socket; - private eventProducerListener; - private unconnected; - private disconnected; - private timeoutIndex; - private reconnectTimeout; - constructor(url: string, timeout?: number, reconnectedHandler?: () => void); - connect(): void; - disconnect(): void; - queueRequest(request: string): void; -} diff --git a/packages/socket/types/socketwrapper.d.ts b/packages/socket/types/socketwrapper.d.ts deleted file mode 100644 index dc77176f4f..0000000000 --- a/packages/socket/types/socketwrapper.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface SocketWrapperCloseEvent { - readonly wasClean: boolean; - readonly code: number; -} -export interface SocketWrapperErrorEvent { - readonly isTrusted?: boolean; - readonly type?: string; - readonly message?: string; -} -export interface SocketWrapperMessageEvent { - readonly data: string; - readonly type: string; -} -/** - * A thin wrapper around isomorphic-ws' WebSocket class that adds - * - constant message/error/open/close handlers - * - explict connection via a connect() method - * - type support for events - * - handling of corner cases in the open and close behaviour - */ -export declare class SocketWrapper { - readonly connected: Promise; - private connectedResolver; - private connectedRejecter; - private socket; - private timeoutId; - private closed; - private readonly url; - private readonly messageHandler; - private readonly errorHandler; - private readonly openHandler?; - private readonly closeHandler?; - private readonly timeout; - constructor( - url: string, - messageHandler: (event: SocketWrapperMessageEvent) => void, - errorHandler: (event: SocketWrapperErrorEvent) => void, - openHandler?: () => void, - closeHandler?: (event: SocketWrapperCloseEvent) => void, - timeout?: number, - ); - /** - * returns a promise that resolves when connection is open - */ - connect(): void; - /** - * Closes an established connection and aborts other connection states - */ - disconnect(): void; - send(data: string): Promise; - /** - * Clears the timeout function, such that no timeout error will be raised anymore. This should be - * called when the connection is established, a connection error occurred or the socket is disconnected. - * - * This method must not be called before `connect()`. - * This method is idempotent. - */ - private clearTimeout; -} diff --git a/packages/socket/types/streamingsocket.d.ts b/packages/socket/types/streamingsocket.d.ts deleted file mode 100644 index 6c850e6a8d..0000000000 --- a/packages/socket/types/streamingsocket.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Stream } from "xstream"; -import { SocketWrapperMessageEvent } from "./socketwrapper"; -/** - * A WebSocket wrapper that exposes all events as a stream. - * - * This underlying socket will not be closed when the stream has no listeners - */ -export declare class StreamingSocket { - readonly connected: Promise; - readonly events: Stream; - private eventProducerListener; - private readonly socket; - constructor(url: string, timeout?: number); - connect(): void; - disconnect(): void; - send(data: string): Promise; -} diff --git a/packages/stream/types/concat.d.ts b/packages/stream/types/concat.d.ts deleted file mode 100644 index 132f6f62b6..0000000000 --- a/packages/stream/types/concat.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Stream } from "xstream"; -/** - * An implementation of concat that buffers all source stream events - * - * Marble diagram: - * - * ```text - * --1--2---3---4-| - * -a--b-c--d-| - * --------X---------Y---------Z- - * concat - * --1--2---3---4-abcdXY-------Z- - * ``` - * - * This is inspired by RxJS's concat as documented at http://rxmarbles.com/#concat and behaves - * differently than xstream's concat as discussed in https://github.com/staltz/xstream/issues/170. - * - */ -export declare function concat(...streams: Array>): Stream; diff --git a/packages/stream/types/defaultvalueproducer.d.ts b/packages/stream/types/defaultvalueproducer.d.ts deleted file mode 100644 index e8359790fc..0000000000 --- a/packages/stream/types/defaultvalueproducer.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Listener, Producer } from "xstream"; -export interface DefaultValueProducerCallsbacks { - readonly onStarted: () => void; - readonly onStop: () => void; -} -export declare class DefaultValueProducer implements Producer { - get value(): T; - private readonly callbacks; - private internalValue; - private listener; - constructor(value: T, callbacks?: DefaultValueProducerCallsbacks); - /** - * Update the current value. - * - * If producer is active (i.e. someone is listening), this emits an event. - * If not, just the current value is updated. - */ - update(value: T): void; - /** - * Produce an error - */ - error(error: any): void; - /** - * Called by the stream. Do not call this directly. - */ - start(listener: Listener): void; - /** - * Called by the stream. Do not call this directly. - */ - stop(): void; -} diff --git a/packages/stream/types/dropduplicates.d.ts b/packages/stream/types/dropduplicates.d.ts deleted file mode 100644 index 3a31cdd057..0000000000 --- a/packages/stream/types/dropduplicates.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Stream } from "xstream"; -/** - * The type that fits into Stream.compose() with input stream and output stream - * of the same type. - */ -export declare type SameTypeStreamOperator = (ins: Stream) => Stream; -/** - * Drops duplicate values in a stream. - * - * Marble diagram: - * - * ```text - * -1-1-1-2-4-3-3-4-- - * dropDuplicates - * -1-----2-4-3------ - * ``` - * - * Each value must be uniquely identified by a string given by - * valueToKey(value). - * - * Internally this maintains a set of keys that have been processed already, - * i.e. memory consumption and Set lookup times should be considered when - * using this function. - */ -export declare function dropDuplicates(valueToKey: (x: T) => string): SameTypeStreamOperator; diff --git a/packages/stream/types/index.d.ts b/packages/stream/types/index.d.ts deleted file mode 100644 index 562930b46d..0000000000 --- a/packages/stream/types/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { DefaultValueProducer, DefaultValueProducerCallsbacks } from "./defaultvalueproducer"; -export { concat } from "./concat"; -export { dropDuplicates, SameTypeStreamOperator } from "./dropduplicates"; -export { firstEvent, fromListPromise, toListPromise } from "./promise"; -export * from "./reducer"; -export { ValueAndUpdates } from "./valueandupdates"; diff --git a/packages/stream/types/promise.d.ts b/packages/stream/types/promise.d.ts deleted file mode 100644 index 7c29bb1af6..0000000000 --- a/packages/stream/types/promise.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Stream } from "xstream"; -/** - * Emits one event for each list element as soon as the promise resolves - */ -export declare function fromListPromise(promise: Promise>): Stream; -/** - * Listens to stream and collects events. When `count` events are collected, - * the promise resolves with an array of events. - * - * Rejects if stream completes before `count` events are collected. - */ -export declare function toListPromise(stream: Stream, count: number): Promise; -/** - * Listens to stream, collects one event and revolves. - * - * Rejects if stream completes before one event was fired. - */ -export declare function firstEvent(stream: Stream): Promise; diff --git a/packages/stream/types/reducer.d.ts b/packages/stream/types/reducer.d.ts deleted file mode 100644 index 731c709d5c..0000000000 --- a/packages/stream/types/reducer.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Stream } from "xstream"; -export declare type ReducerFunc = (acc: U, evt: T) => U; -export declare class Reducer { - private readonly stream; - private readonly reducer; - private state; - private readonly completed; - constructor(stream: Stream, reducer: ReducerFunc, initState: U); - value(): U; - finished(): Promise; -} -export declare function countStream(stream: Stream): Reducer; -export declare function asArray(stream: Stream): Reducer; -export declare function lastValue(stream: Stream): Reducer; diff --git a/packages/stream/types/valueandupdates.d.ts b/packages/stream/types/valueandupdates.d.ts deleted file mode 100644 index 1745b02020..0000000000 --- a/packages/stream/types/valueandupdates.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { MemoryStream } from "xstream"; -import { DefaultValueProducer } from "./defaultvalueproducer"; -export declare type SearchFunction = (value: T) => boolean; -/** - * A read only wrapper around DefaultValueProducer that allows - * to synchronously get the current value using the .value property - * and listen to to updates by suscribing to the .updates stream - */ -export declare class ValueAndUpdates { - readonly updates: MemoryStream; - get value(): T; - private readonly producer; - constructor(producer: DefaultValueProducer); - /** - * Resolves as soon as search value is found. - * - * @param search either a value or a function that must return true when found - * @returns the value of the update that caused the search match - */ - waitFor(search: SearchFunction | T): Promise; -} diff --git a/packages/tendermint-rpc/types/adaptor.d.ts b/packages/tendermint-rpc/types/adaptor.d.ts deleted file mode 100644 index 4adad234b7..0000000000 --- a/packages/tendermint-rpc/types/adaptor.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; -import * as requests from "./requests"; -import * as responses from "./responses"; -import { SubscriptionEvent } from "./rpcclients"; -export interface Adaptor { - readonly params: Params; - readonly responses: Responses; - readonly hashTx: (tx: Uint8Array) => Uint8Array; - readonly hashBlock: (header: responses.Header) => Uint8Array; -} -export declare type Encoder = (req: T) => JsonRpcRequest; -export declare type Decoder = (res: JsonRpcSuccessResponse) => T; -export interface Params { - readonly encodeAbciInfo: (req: requests.AbciInfoRequest) => JsonRpcRequest; - readonly encodeAbciQuery: (req: requests.AbciQueryRequest) => JsonRpcRequest; - readonly encodeBlock: (req: requests.BlockRequest) => JsonRpcRequest; - readonly encodeBlockchain: (req: requests.BlockchainRequest) => JsonRpcRequest; - readonly encodeBlockResults: (req: requests.BlockResultsRequest) => JsonRpcRequest; - readonly encodeBroadcastTx: (req: requests.BroadcastTxRequest) => JsonRpcRequest; - readonly encodeCommit: (req: requests.CommitRequest) => JsonRpcRequest; - readonly encodeGenesis: (req: requests.GenesisRequest) => JsonRpcRequest; - readonly encodeHealth: (req: requests.HealthRequest) => JsonRpcRequest; - readonly encodeStatus: (req: requests.StatusRequest) => JsonRpcRequest; - readonly encodeSubscribe: (req: requests.SubscribeRequest) => JsonRpcRequest; - readonly encodeTx: (req: requests.TxRequest) => JsonRpcRequest; - readonly encodeTxSearch: (req: requests.TxSearchRequest) => JsonRpcRequest; - readonly encodeValidators: (req: requests.ValidatorsRequest) => JsonRpcRequest; -} -export interface Responses { - readonly decodeAbciInfo: (response: JsonRpcSuccessResponse) => responses.AbciInfoResponse; - readonly decodeAbciQuery: (response: JsonRpcSuccessResponse) => responses.AbciQueryResponse; - readonly decodeBlock: (response: JsonRpcSuccessResponse) => responses.BlockResponse; - readonly decodeBlockResults: (response: JsonRpcSuccessResponse) => responses.BlockResultsResponse; - readonly decodeBlockchain: (response: JsonRpcSuccessResponse) => responses.BlockchainResponse; - readonly decodeBroadcastTxSync: (response: JsonRpcSuccessResponse) => responses.BroadcastTxSyncResponse; - readonly decodeBroadcastTxAsync: (response: JsonRpcSuccessResponse) => responses.BroadcastTxAsyncResponse; - readonly decodeBroadcastTxCommit: (response: JsonRpcSuccessResponse) => responses.BroadcastTxCommitResponse; - readonly decodeCommit: (response: JsonRpcSuccessResponse) => responses.CommitResponse; - readonly decodeGenesis: (response: JsonRpcSuccessResponse) => responses.GenesisResponse; - readonly decodeHealth: (response: JsonRpcSuccessResponse) => responses.HealthResponse; - readonly decodeStatus: (response: JsonRpcSuccessResponse) => responses.StatusResponse; - readonly decodeTx: (response: JsonRpcSuccessResponse) => responses.TxResponse; - readonly decodeTxSearch: (response: JsonRpcSuccessResponse) => responses.TxSearchResponse; - readonly decodeValidators: (response: JsonRpcSuccessResponse) => responses.ValidatorsResponse; - readonly decodeNewBlockEvent: (response: SubscriptionEvent) => responses.NewBlockEvent; - readonly decodeNewBlockHeaderEvent: (response: SubscriptionEvent) => responses.NewBlockHeaderEvent; - readonly decodeTxEvent: (response: SubscriptionEvent) => responses.TxEvent; -} diff --git a/packages/tendermint-rpc/types/adaptors/index.d.ts b/packages/tendermint-rpc/types/adaptors/index.d.ts deleted file mode 100644 index 7cf0000558..0000000000 --- a/packages/tendermint-rpc/types/adaptors/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Adaptor } from "../adaptor"; -/** - * Adaptor for Tendermint 0.33. - * - * Use this to skip auto-detection: - * - * ``` - * import { adaptor33, Client as TendermintClient } from "@cosmjs/tendermint-rpc"; - * // ... - * const client = await TendermintClient.connect(url, adaptor33); - * ``` - */ -export declare const adaptor33: Adaptor; -/** - * Adaptor for Tendermint 0.34. - * - * Use this to skip auto-detection: - * - * ``` - * import { adaptor34, Client as TendermintClient } from "@cosmjs/tendermint-rpc"; - * // ... - * const client = await TendermintClient.connect(url, adaptor34); - * ``` - */ -export declare const adaptor34: Adaptor; -/** - * Returns an Adaptor implementation for a given tendermint version. - * Throws when version is not supported. - * - * @param version full Tendermint version string, e.g. "0.20.1" - */ -export declare function adaptorForVersion(version: string): Adaptor; diff --git a/packages/tendermint-rpc/types/adaptors/v0-33/hasher.d.ts b/packages/tendermint-rpc/types/adaptors/v0-33/hasher.d.ts deleted file mode 100644 index 2104d509b6..0000000000 --- a/packages/tendermint-rpc/types/adaptors/v0-33/hasher.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Header } from "../../responses"; -export declare function hashTx(tx: Uint8Array): Uint8Array; -export declare function hashBlock(header: Header): Uint8Array; diff --git a/packages/tendermint-rpc/types/adaptors/v0-33/index.d.ts b/packages/tendermint-rpc/types/adaptors/v0-33/index.d.ts deleted file mode 100644 index d4c71fcd69..0000000000 --- a/packages/tendermint-rpc/types/adaptors/v0-33/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Adaptor } from "../../adaptor"; -export declare const v0_33: Adaptor; diff --git a/packages/tendermint-rpc/types/adaptors/v0-33/requests.d.ts b/packages/tendermint-rpc/types/adaptors/v0-33/requests.d.ts deleted file mode 100644 index ad142450b2..0000000000 --- a/packages/tendermint-rpc/types/adaptors/v0-33/requests.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { JsonRpcRequest } from "@cosmjs/json-rpc"; -import * as requests from "../../requests"; -export declare class Params { - static encodeAbciInfo(req: requests.AbciInfoRequest): JsonRpcRequest; - static encodeAbciQuery(req: requests.AbciQueryRequest): JsonRpcRequest; - static encodeBlock(req: requests.BlockRequest): JsonRpcRequest; - static encodeBlockchain(req: requests.BlockchainRequest): JsonRpcRequest; - static encodeBlockResults(req: requests.BlockResultsRequest): JsonRpcRequest; - static encodeBroadcastTx(req: requests.BroadcastTxRequest): JsonRpcRequest; - static encodeCommit(req: requests.CommitRequest): JsonRpcRequest; - static encodeGenesis(req: requests.GenesisRequest): JsonRpcRequest; - static encodeHealth(req: requests.HealthRequest): JsonRpcRequest; - static encodeStatus(req: requests.StatusRequest): JsonRpcRequest; - static encodeSubscribe(req: requests.SubscribeRequest): JsonRpcRequest; - static encodeTx(req: requests.TxRequest): JsonRpcRequest; - static encodeTxSearch(req: requests.TxSearchRequest): JsonRpcRequest; - static encodeValidators(req: requests.ValidatorsRequest): JsonRpcRequest; -} diff --git a/packages/tendermint-rpc/types/adaptors/v0-33/responses.d.ts b/packages/tendermint-rpc/types/adaptors/v0-33/responses.d.ts deleted file mode 100644 index e3a8d5b6d4..0000000000 --- a/packages/tendermint-rpc/types/adaptors/v0-33/responses.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; -import * as responses from "../../responses"; -import { SubscriptionEvent } from "../../rpcclients"; -export interface RpcProofOp { - readonly type: string; - /** base64 encoded */ - readonly key: string; - /** base64 encoded */ - readonly data: string; -} -export interface RpcQueryProof { - readonly ops: readonly RpcProofOp[]; -} -export declare class Responses { - static decodeAbciInfo(response: JsonRpcSuccessResponse): responses.AbciInfoResponse; - static decodeAbciQuery(response: JsonRpcSuccessResponse): responses.AbciQueryResponse; - static decodeBlock(response: JsonRpcSuccessResponse): responses.BlockResponse; - static decodeBlockResults(response: JsonRpcSuccessResponse): responses.BlockResultsResponse; - static decodeBlockchain(response: JsonRpcSuccessResponse): responses.BlockchainResponse; - static decodeBroadcastTxSync(response: JsonRpcSuccessResponse): responses.BroadcastTxSyncResponse; - static decodeBroadcastTxAsync(response: JsonRpcSuccessResponse): responses.BroadcastTxAsyncResponse; - static decodeBroadcastTxCommit(response: JsonRpcSuccessResponse): responses.BroadcastTxCommitResponse; - static decodeCommit(response: JsonRpcSuccessResponse): responses.CommitResponse; - static decodeGenesis(response: JsonRpcSuccessResponse): responses.GenesisResponse; - static decodeHealth(): responses.HealthResponse; - static decodeStatus(response: JsonRpcSuccessResponse): responses.StatusResponse; - static decodeNewBlockEvent(event: SubscriptionEvent): responses.NewBlockEvent; - static decodeNewBlockHeaderEvent(event: SubscriptionEvent): responses.NewBlockHeaderEvent; - static decodeTxEvent(event: SubscriptionEvent): responses.TxEvent; - static decodeTx(response: JsonRpcSuccessResponse): responses.TxResponse; - static decodeTxSearch(response: JsonRpcSuccessResponse): responses.TxSearchResponse; - static decodeValidators(response: JsonRpcSuccessResponse): responses.ValidatorsResponse; -} diff --git a/packages/tendermint-rpc/types/client.d.ts b/packages/tendermint-rpc/types/client.d.ts deleted file mode 100644 index e4c8b46811..0000000000 --- a/packages/tendermint-rpc/types/client.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Stream } from "xstream"; -import { Adaptor } from "./adaptor"; -import * as requests from "./requests"; -import * as responses from "./responses"; -import { RpcClient } from "./rpcclients"; -export declare class Client { - /** - * Creates a new Tendermint client for the given endpoint. - * - * Uses HTTP when the URL schema is http or https. Uses WebSockets otherwise. - * - * If the adaptor is not set an auto-detection is attempted. - */ - static connect(url: string, adaptor?: Adaptor): Promise; - /** - * Creates a new Tendermint client given an RPC client. - * - * If the adaptor is not set an auto-detection is attempted. - */ - static create(rpcClient: RpcClient, adaptor?: Adaptor): Promise; - private static detectVersion; - private readonly client; - private readonly p; - private readonly r; - /** - * Use `Client.connect` or `Client.create` to create an instance. - */ - private constructor(); - disconnect(): void; - abciInfo(): Promise; - abciQuery(params: requests.AbciQueryParams): Promise; - block(height?: number): Promise; - blockResults(height?: number): Promise; - /** - * Queries block headers filtered by minHeight <= height <= maxHeight. - * - * @param minHeight The minimum height to be included in the result. Defaults to 0. - * @param maxHeight The maximum height to be included in the result. Defaults to infinity. - */ - blockchain(minHeight?: number, maxHeight?: number): Promise; - /** - * Broadcast transaction to mempool and wait for response - * - * @see https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_sync - */ - broadcastTxSync(params: requests.BroadcastTxParams): Promise; - /** - * Broadcast transaction to mempool and do not wait for result - * - * @see https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_async - */ - broadcastTxAsync(params: requests.BroadcastTxParams): Promise; - /** - * Broadcast transaction to mempool and wait for block - * - * @see https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_commit - */ - broadcastTxCommit(params: requests.BroadcastTxParams): Promise; - commit(height?: number): Promise; - genesis(): Promise; - health(): Promise; - status(): Promise; - subscribeNewBlock(): Stream; - subscribeNewBlockHeader(): Stream; - subscribeTx(query?: string): Stream; - /** - * Get a single transaction by hash - * - * @see https://docs.tendermint.com/master/rpc/#/Info/tx - */ - tx(params: requests.TxParams): Promise; - /** - * Search for transactions that are in a block - * - * @see https://docs.tendermint.com/master/rpc/#/Info/tx_search - */ - txSearch(params: requests.TxSearchParams): Promise; - txSearchAll(params: requests.TxSearchParams): Promise; - validators(height?: number): Promise; - private doCall; - private subscribe; -} diff --git a/packages/tendermint-rpc/types/encodings.d.ts b/packages/tendermint-rpc/types/encodings.d.ts deleted file mode 100644 index f45914f8bc..0000000000 --- a/packages/tendermint-rpc/types/encodings.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { BlockId, ReadonlyDateWithNanoseconds, Version } from "./responses"; -/** - * A runtime checker that ensures a given value is set (i.e. not undefined or null) - * - * This is used when you want to verify that data at runtime matches the expected type. - */ -export declare function assertSet(value: T): T; -/** - * A runtime checker that ensures a given value is a boolean - * - * This is used when you want to verify that data at runtime matches the expected type. - * This implies assertSet. - */ -export declare function assertBoolean(value: boolean): boolean; -/** - * A runtime checker that ensures a given value is a string. - * - * This is used when you want to verify that data at runtime matches the expected type. - * This implies assertSet. - */ -export declare function assertString(value: string): string; -/** - * A runtime checker that ensures a given value is a number - * - * This is used when you want to verify that data at runtime matches the expected type. - * This implies assertSet. - */ -export declare function assertNumber(value: number): number; -/** - * A runtime checker that ensures a given value is an array - * - * This is used when you want to verify that data at runtime matches the expected type. - * This implies assertSet. - */ -export declare function assertArray(value: readonly T[]): readonly T[]; -/** - * A runtime checker that ensures a given value is an object in the sense of JSON - * (an unordered collection of key–value pairs where the keys are strings) - * - * This is used when you want to verify that data at runtime matches the expected type. - * This implies assertSet. - */ -export declare function assertObject(value: T): T; -/** - * Throws an error if value matches the empty value for the - * given type (array/string of length 0, number of value 0, ...) - * - * Otherwise returns the value. - * - * This implies assertSet - */ -export declare function assertNotEmpty(value: T): T; -export declare function optional(value: T | null | undefined, fallback: T): T; -export declare function may(transform: (val: T) => U, value: T | null | undefined): U | undefined; -export declare function dictionaryToStringMap(obj: Record): Map; -export declare class Integer { - static parse(input: string | number): number; - static encode(num: number): string; -} -export declare class DateTime { - static decode(dateTimeString: string): ReadonlyDateWithNanoseconds; - static encode(dateTime: ReadonlyDateWithNanoseconds): string; -} -export declare function encodeString(s: string): Uint8Array; -export declare function encodeInt(n: number): Uint8Array; -export declare function encodeTime(time: ReadonlyDateWithNanoseconds): Uint8Array; -export declare function encodeBytes(bytes: Uint8Array): Uint8Array; -export declare function encodeVersion(version: Version): Uint8Array; -export declare function encodeBlockId(blockId: BlockId): Uint8Array; diff --git a/packages/tendermint-rpc/types/index.d.ts b/packages/tendermint-rpc/types/index.d.ts deleted file mode 100644 index c4de41bcfb..0000000000 --- a/packages/tendermint-rpc/types/index.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -export { Adaptor } from "./adaptor"; -export { adaptor33, adaptor34 } from "./adaptors"; -export { Client } from "./client"; -export { DateTime } from "./encodings"; -export { - AbciInfoRequest, - AbciQueryParams, - AbciQueryRequest, - BlockRequest, - BlockchainRequest, - BlockResultsRequest, - BroadcastTxRequest, - BroadcastTxParams, - CommitRequest, - GenesisRequest, - HealthRequest, - Method, - Request, - QueryTag, - StatusRequest, - SubscriptionEventType, - TxParams, - TxRequest, - TxSearchParams, - TxSearchRequest, - ValidatorsRequest, -} from "./requests"; -export { - AbciInfoResponse, - AbciQueryResponse, - Attribute, - Block, - BlockchainResponse, - BlockGossipParams, - BlockId, - BlockMeta, - BlockParams, - BlockResponse, - BlockResultsResponse, - BroadcastTxAsyncResponse, - BroadcastTxCommitResponse, - broadcastTxCommitSuccess, - BroadcastTxSyncResponse, - broadcastTxSyncSuccess, - Commit, - CommitResponse, - ConsensusParams, - Event, - Evidence, - EvidenceParams, - GenesisResponse, - Header, - HealthResponse, - NewBlockEvent, - NewBlockHeaderEvent, - NodeInfo, - ProofOp, - QueryProof, - ReadonlyDateWithNanoseconds, - Response, - StatusResponse, - SyncInfo, - TxData, - TxEvent, - TxProof, - TxResponse, - TxSearchResponse, - TxSizeParams, - Validator, - ValidatorsResponse, - Version, - Vote, - VoteType, -} from "./responses"; -export { HttpClient, WebsocketClient } from "./rpcclients"; -export { - ValidatorEd25519Pubkey, - ValidatorEd25519Signature, - ValidatorPubkey, - ValidatorSignature, -} from "./types"; diff --git a/packages/tendermint-rpc/types/jsonrpc.d.ts b/packages/tendermint-rpc/types/jsonrpc.d.ts deleted file mode 100644 index 0d3b78024e..0000000000 --- a/packages/tendermint-rpc/types/jsonrpc.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JsonRpcRequest } from "@cosmjs/json-rpc"; -/** Creates a JSON-RPC request with random ID */ -export declare function createJsonRpcRequest(method: string, params?: {}): JsonRpcRequest; diff --git a/packages/tendermint-rpc/types/requests.d.ts b/packages/tendermint-rpc/types/requests.d.ts deleted file mode 100644 index c7284797c6..0000000000 --- a/packages/tendermint-rpc/types/requests.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * RPC methods as documented in https://docs.tendermint.com/master/rpc/ - * - * Enum raw value must match the spelling in the "shell" example call (snake_case) - */ -export declare enum Method { - AbciInfo = "abci_info", - AbciQuery = "abci_query", - Block = "block", - /** Get block headers for minHeight <= height <= maxHeight. */ - Blockchain = "blockchain", - BlockResults = "block_results", - BroadcastTxAsync = "broadcast_tx_async", - BroadcastTxSync = "broadcast_tx_sync", - BroadcastTxCommit = "broadcast_tx_commit", - Commit = "commit", - Genesis = "genesis", - Health = "health", - Status = "status", - Subscribe = "subscribe", - Tx = "tx", - TxSearch = "tx_search", - Validators = "validators", - Unsubscribe = "unsubscribe", -} -export declare type Request = - | AbciInfoRequest - | AbciQueryRequest - | BlockRequest - | BlockchainRequest - | BlockResultsRequest - | BroadcastTxRequest - | CommitRequest - | GenesisRequest - | HealthRequest - | StatusRequest - | TxRequest - | TxSearchRequest - | ValidatorsRequest; -/** - * Raw values must match the tendermint event name - * - * @see https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants - */ -export declare enum SubscriptionEventType { - NewBlock = "NewBlock", - NewBlockHeader = "NewBlockHeader", - Tx = "Tx", -} -export interface AbciInfoRequest { - readonly method: Method.AbciInfo; -} -export interface AbciQueryRequest { - readonly method: Method.AbciQuery; - readonly params: AbciQueryParams; -} -export interface AbciQueryParams { - readonly path: string; - readonly data: Uint8Array; - readonly height?: number; - /** - * A flag that defines if proofs are included in the response or not. - * - * Internally this is mapped to the old inverse name `trusted` for Tendermint < 0.26. - * Starting with Tendermint 0.26, the default value changed from true to false. - */ - readonly prove?: boolean; -} -export interface BlockRequest { - readonly method: Method.Block; - readonly params: { - readonly height?: number; - }; -} -export interface BlockchainRequest { - readonly method: Method.Blockchain; - readonly params: BlockchainRequestParams; -} -export interface BlockchainRequestParams { - readonly minHeight?: number; - readonly maxHeight?: number; -} -export interface BlockResultsRequest { - readonly method: Method.BlockResults; - readonly params: { - readonly height?: number; - }; -} -export interface BroadcastTxRequest { - readonly method: Method.BroadcastTxAsync | Method.BroadcastTxSync | Method.BroadcastTxCommit; - readonly params: BroadcastTxParams; -} -export interface BroadcastTxParams { - readonly tx: Uint8Array; -} -export interface CommitRequest { - readonly method: Method.Commit; - readonly params: { - readonly height?: number; - }; -} -export interface GenesisRequest { - readonly method: Method.Genesis; -} -export interface HealthRequest { - readonly method: Method.Health; -} -export interface StatusRequest { - readonly method: Method.Status; -} -export interface SubscribeRequest { - readonly method: Method.Subscribe; - readonly query: { - readonly type: SubscriptionEventType; - readonly raw?: string; - }; -} -export interface QueryTag { - readonly key: string; - readonly value: string; -} -export interface TxRequest { - readonly method: Method.Tx; - readonly params: TxParams; -} -export interface TxParams { - readonly hash: Uint8Array; - readonly prove?: boolean; -} -export interface TxSearchRequest { - readonly method: Method.TxSearch; - readonly params: TxSearchParams; -} -export interface TxSearchParams { - readonly query: string; - readonly prove?: boolean; - readonly page?: number; - readonly per_page?: number; -} -export interface ValidatorsRequest { - readonly method: Method.Validators; - readonly params: { - readonly height?: number; - }; -} -export interface BuildQueryComponents { - readonly tags?: readonly QueryTag[]; - readonly raw?: string; -} -export declare function buildQuery(components: BuildQueryComponents): string; diff --git a/packages/tendermint-rpc/types/responses.d.ts b/packages/tendermint-rpc/types/responses.d.ts deleted file mode 100644 index c9fbcaaf00..0000000000 --- a/packages/tendermint-rpc/types/responses.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -import { ReadonlyDate } from "readonly-date"; -import { ValidatorPubkey, ValidatorSignature } from "./types"; -export declare type Response = - | AbciInfoResponse - | AbciQueryResponse - | BlockResponse - | BlockResultsResponse - | BlockchainResponse - | BroadcastTxAsyncResponse - | BroadcastTxSyncResponse - | BroadcastTxCommitResponse - | CommitResponse - | GenesisResponse - | HealthResponse - | StatusResponse - | TxResponse - | TxSearchResponse - | ValidatorsResponse; -export interface AbciInfoResponse { - readonly data?: string; - readonly lastBlockHeight?: number; - readonly lastBlockAppHash?: Uint8Array; -} -export interface ProofOp { - readonly type: string; - readonly key: Uint8Array; - readonly data: Uint8Array; -} -export interface QueryProof { - readonly ops: readonly ProofOp[]; -} -export interface AbciQueryResponse { - readonly key: Uint8Array; - readonly value: Uint8Array; - readonly proof?: QueryProof; - readonly height?: number; - readonly index?: number; - readonly code?: number; - readonly log?: string; -} -export interface BlockResponse { - readonly blockId: BlockId; - readonly block: Block; -} -export interface BlockResultsResponse { - readonly height: number; - readonly results: readonly TxData[]; - readonly validatorUpdates: readonly Validator[]; - readonly consensusUpdates?: ConsensusParams; - readonly beginBlockEvents: readonly Event[]; - readonly endBlockEvents: readonly Event[]; -} -export interface BlockchainResponse { - readonly lastHeight: number; - readonly blockMetas: readonly BlockMeta[]; -} -/** No data in here because RPC method BroadcastTxAsync "returns right away, with no response" */ -export interface BroadcastTxAsyncResponse {} -export interface BroadcastTxSyncResponse extends TxData { - readonly hash: Uint8Array; -} -/** - * Returns true iff transaction made it sucessfully into the transaction pool - */ -export declare function broadcastTxSyncSuccess(res: BroadcastTxSyncResponse): boolean; -export interface BroadcastTxCommitResponse { - readonly height: number; - readonly hash: Uint8Array; - readonly checkTx: TxData; - readonly deliverTx?: TxData; -} -/** - * Returns true iff transaction made it successfully into a block - * (i.e. success in `check_tx` and `deliver_tx` field) - */ -export declare function broadcastTxCommitSuccess(response: BroadcastTxCommitResponse): boolean; -export interface CommitResponse { - readonly header: Header; - readonly commit: Commit; - readonly canonical: boolean; -} -export interface GenesisResponse { - readonly genesisTime: ReadonlyDate; - readonly chainId: string; - readonly consensusParams: ConsensusParams; - readonly validators: readonly Validator[]; - readonly appHash: Uint8Array; - readonly appState: Record | undefined; -} -export declare type HealthResponse = null; -export interface StatusResponse { - readonly nodeInfo: NodeInfo; - readonly syncInfo: SyncInfo; - readonly validatorInfo: Validator; -} -/** - * A transaction from RPC calls like search. - * - * Try to keep this compatible to TxEvent - */ -export interface TxResponse { - readonly tx: Uint8Array; - readonly hash: Uint8Array; - readonly height: number; - readonly index: number; - readonly result: TxData; - readonly proof?: TxProof; -} -export interface TxSearchResponse { - readonly txs: readonly TxResponse[]; - readonly totalCount: number; -} -export interface ValidatorsResponse { - readonly blockHeight: number; - readonly results: readonly Validator[]; -} -export interface NewBlockEvent extends Block {} -export interface NewBlockHeaderEvent extends Header {} -export interface TxEvent { - readonly tx: Uint8Array; - readonly hash: Uint8Array; - readonly height: number; - /** @deprecated this value is not set in Tendermint 0.34+ */ - readonly index?: number; - readonly result: TxData; -} -/** An event attribute */ -export interface Attribute { - readonly key: Uint8Array; - readonly value: Uint8Array; -} -export interface Event { - readonly type: string; - readonly attributes: readonly Attribute[]; -} -export interface TxData { - readonly code: number; - readonly log?: string; - readonly data?: Uint8Array; - readonly events: readonly Event[]; -} -export interface TxProof { - readonly data: Uint8Array; - readonly rootHash: Uint8Array; - readonly proof: { - readonly total: number; - readonly index: number; - readonly leafHash: Uint8Array; - readonly aunts: readonly Uint8Array[]; - }; -} -export interface BlockMeta { - readonly blockId: BlockId; - readonly header: Header; -} -export interface BlockId { - readonly hash: Uint8Array; - readonly parts: { - readonly total: number; - readonly hash: Uint8Array; - }; -} -export interface Block { - readonly header: Header; - readonly lastCommit: Commit; - readonly txs: readonly Uint8Array[]; - readonly evidence?: readonly Evidence[]; -} -export interface Evidence { - readonly type: string; - readonly validator: Validator; - readonly height: number; - readonly time: number; - readonly totalVotingPower: number; -} -export interface Commit { - readonly blockId: BlockId; - readonly signatures: readonly ValidatorSignature[]; -} -/** - * raw values from https://github.com/tendermint/tendermint/blob/dfa9a9a30a666132425b29454e90a472aa579a48/types/vote.go#L44 - */ -export declare enum VoteType { - PreVote = 1, - PreCommit = 2, -} -export interface Vote { - readonly type: VoteType; - readonly validatorAddress: Uint8Array; - readonly validatorIndex: number; - readonly height: number; - readonly round: number; - readonly timestamp: ReadonlyDate; - readonly blockId: BlockId; - readonly signature: ValidatorSignature; -} -export interface Version { - readonly block: number; - readonly app: number; -} -export interface ReadonlyDateWithNanoseconds extends ReadonlyDate { - readonly nanoseconds?: number; -} -export interface Header { - readonly version: Version; - readonly chainId: string; - readonly height: number; - readonly time: ReadonlyDateWithNanoseconds; - readonly lastBlockId: BlockId; - readonly lastCommitHash: Uint8Array; - readonly dataHash: Uint8Array; - readonly validatorsHash: Uint8Array; - readonly nextValidatorsHash: Uint8Array; - readonly consensusHash: Uint8Array; - readonly appHash: Uint8Array; - readonly lastResultsHash: Uint8Array; - readonly evidenceHash: Uint8Array; - readonly proposerAddress: Uint8Array; -} -export interface NodeInfo { - readonly id: Uint8Array; - /** IP and port */ - readonly listenAddr: string; - readonly network: string; - readonly version: string; - readonly channels: string; - readonly moniker: string; - readonly other: Map; - readonly protocolVersion: { - readonly p2p: number; - readonly block: number; - readonly app: number; - }; -} -export interface SyncInfo { - readonly latestBlockHash: Uint8Array; - readonly latestAppHash: Uint8Array; - readonly latestBlockHeight: number; - readonly latestBlockTime: ReadonlyDate; - readonly catchingUp: boolean; -} -export interface Validator { - readonly address?: Uint8Array; - readonly pubkey: ValidatorPubkey; - readonly votingPower: number; - readonly accum?: number; - readonly name?: string; -} -export interface ConsensusParams { - readonly block: BlockParams; - readonly evidence: EvidenceParams; -} -export interface BlockParams { - readonly maxBytes: number; - readonly maxGas: number; -} -export interface TxSizeParams { - readonly maxBytes: number; - readonly maxGas: number; -} -export interface BlockGossipParams { - readonly blockPartSizeBytes: number; -} -export interface EvidenceParams { - readonly maxAgeNumBlocks: number; - readonly maxAgeDuration: number; -} diff --git a/packages/tendermint-rpc/types/rpcclients/httpclient.d.ts b/packages/tendermint-rpc/types/rpcclients/httpclient.d.ts deleted file mode 100644 index 8b50c1d35d..0000000000 --- a/packages/tendermint-rpc/types/rpcclients/httpclient.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; -import { RpcClient } from "./rpcclient"; -export declare class HttpClient implements RpcClient { - protected readonly url: string; - constructor(url?: string); - disconnect(): void; - execute(request: JsonRpcRequest): Promise; -} diff --git a/packages/tendermint-rpc/types/rpcclients/index.d.ts b/packages/tendermint-rpc/types/rpcclients/index.d.ts deleted file mode 100644 index 32e8777e66..0000000000 --- a/packages/tendermint-rpc/types/rpcclients/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { instanceOfRpcStreamingClient, RpcClient, RpcStreamingClient, SubscriptionEvent } from "./rpcclient"; -export { HttpClient } from "./httpclient"; -export { WebsocketClient } from "./websocketclient"; diff --git a/packages/tendermint-rpc/types/rpcclients/rpcclient.d.ts b/packages/tendermint-rpc/types/rpcclients/rpcclient.d.ts deleted file mode 100644 index 9089d78fdd..0000000000 --- a/packages/tendermint-rpc/types/rpcclients/rpcclient.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; -import { Stream } from "xstream"; -/** - * An event emitted from Tendermint after subscribing via RPC. - * - * These events are passed as the `result` of JSON-RPC responses, which is kind - * of hacky because it breaks the idea that exactly one JSON-RPC response belongs - * to each JSON-RPC request. But this is how subscriptions work in Tendermint. - */ -export interface SubscriptionEvent { - readonly query: string; - readonly data: { - readonly type: string; - readonly value: any; - }; -} -export interface RpcClient { - readonly execute: (request: JsonRpcRequest) => Promise; - readonly disconnect: () => void; -} -export interface RpcStreamingClient extends RpcClient { - readonly listen: (request: JsonRpcRequest) => Stream; -} -export declare function instanceOfRpcStreamingClient(client: RpcClient): client is RpcStreamingClient; -export declare function hasProtocol(url: string): boolean; diff --git a/packages/tendermint-rpc/types/rpcclients/websocketclient.d.ts b/packages/tendermint-rpc/types/rpcclients/websocketclient.d.ts deleted file mode 100644 index 36db855a40..0000000000 --- a/packages/tendermint-rpc/types/rpcclients/websocketclient.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { JsonRpcId, JsonRpcRequest, JsonRpcResponse, JsonRpcSuccessResponse } from "@cosmjs/json-rpc"; -import { Stream } from "xstream"; -import { RpcStreamingClient, SubscriptionEvent } from "./rpcclient"; -export declare class WebsocketClient implements RpcStreamingClient { - private readonly url; - private readonly socket; - /** Same events as in socket.events but in the format we need */ - private readonly jsonRpcResponseStream; - private readonly subscriptionStreams; - constructor(baseUrl?: string, onError?: (err: any) => void); - execute(request: JsonRpcRequest): Promise; - listen(request: JsonRpcRequest): Stream; - /** - * Resolves as soon as websocket is connected. execute() queues requests automatically, - * so this should be required for testing purposes only. - */ - connected(): Promise; - disconnect(): void; - protected responseForRequestId(id: JsonRpcId): Promise; -} diff --git a/packages/tendermint-rpc/types/types.d.ts b/packages/tendermint-rpc/types/types.d.ts deleted file mode 100644 index 784cbe78be..0000000000 --- a/packages/tendermint-rpc/types/types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface ValidatorEd25519Pubkey { - readonly algorithm: "ed25519"; - readonly data: Uint8Array; -} -/** - * Union type for different possible pubkeys. - * Currently only Ed25519 supported. - */ -export declare type ValidatorPubkey = ValidatorEd25519Pubkey; -export interface ValidatorEd25519Signature { - readonly algorithm: "ed25519"; - readonly data: Uint8Array; -} -/** - * Union type for different possible voting signatures. - * Currently only Ed25519 supported. - */ -export declare type ValidatorSignature = ValidatorEd25519Signature; diff --git a/packages/utils/types/arrays.d.ts b/packages/utils/types/arrays.d.ts deleted file mode 100644 index 2d30e57991..0000000000 --- a/packages/utils/types/arrays.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Compares the content of two arrays-like objects for equality. - * - * Equality is defined as having equal length and element values, where element equality means `===` returning `true`. - * - * This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. - * As a consequence, this returns different results than Jasmine's `toEqual`, which ensures elements have the same type. - */ -export declare function arrayContentEquals( - a: ArrayLike, - b: ArrayLike, -): boolean; diff --git a/packages/utils/types/assert.d.ts b/packages/utils/types/assert.d.ts deleted file mode 100644 index 36ab18e071..0000000000 --- a/packages/utils/types/assert.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function assert(condition: any, msg?: string): asserts condition; -export declare function assertDefined(value: T | undefined, msg?: string): asserts value is T; -export declare function assertDefinedAndNotNull( - value: T | undefined | null, - msg?: string, -): asserts value is T; diff --git a/packages/utils/types/index.d.ts b/packages/utils/types/index.d.ts deleted file mode 100644 index 372b361537..0000000000 --- a/packages/utils/types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { arrayContentEquals } from "./arrays"; -export { assert, assertDefined, assertDefinedAndNotNull } from "./assert"; -export { sleep } from "./sleep"; -export { isNonNullObject, isUint8Array } from "./typechecks"; diff --git a/packages/utils/types/sleep.d.ts b/packages/utils/types/sleep.d.ts deleted file mode 100644 index deb121ba98..0000000000 --- a/packages/utils/types/sleep.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sleep(ms: number): Promise; diff --git a/packages/utils/types/typechecks.d.ts b/packages/utils/types/typechecks.d.ts deleted file mode 100644 index 68c29628f0..0000000000 --- a/packages/utils/types/typechecks.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Checks if data is a non-null object (i.e. matches the TypeScript object type). - * - * Note: this returns true for arrays, which are objects in JavaScript - * even though array and object are different types in JSON. - * - * @see https://www.typescriptlang.org/docs/handbook/basic-types.html#object - */ -export declare function isNonNullObject(data: unknown): data is object; -/** - * Checks if data is an Uint8Array. Note: Buffer is treated as not a Uint8Array - */ -export declare function isUint8Array(data: unknown): data is Uint8Array;