import { Account, CosmWasmClient, GetNonceResult, PostTxResult } from "./cosmwasmclient"; import { SecretUtils } from "./enigmautils"; import { Log } from "./logs"; import { BroadcastMode } from "./restclient"; import { Coin, Msg, StdFee, StdSignature, StdTx } from "./types"; import { OfflineSigner } from "./wallet"; export interface SigningCallback { (signBytes: Uint8Array): Promise; } export interface FeeTable { readonly upload: StdFee; readonly init: StdFee; readonly exec: StdFee; readonly send: StdFee; } export interface UploadMeta { /** The source URL */ readonly source?: string; /** The builder tag */ 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 Log[]; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; } export interface InstantiateResult { /** The address of the newly instantiated contract */ readonly contractAddress: string; readonly logs: readonly Log[]; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; readonly data: any; } export interface ExecuteResult { readonly logs: readonly Log[]; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; readonly data: any; } export declare class SigningCosmWasmClient extends CosmWasmClient { readonly senderAddress: 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 senderAddress The address that will sign and send transactions using this instance * @param signer An asynchronous callback to create a signature for a given transaction. This can be implemented using secure key stores that require user interaction. Or a newer OfflineSigner type that handles that stuff * @param seedOrEnigmaUtils * @param customFees The fees that are paid for transactions * @param broadcastMode Defines at which point of the transaction processing the postTx method (i.e. transaction broadcasting) returns */ constructor( apiUrl: string, senderAddress: string, signer: SigningCallback | OfflineSigner, seedOrEnigmaUtils?: Uint8Array | SecretUtils, customFees?: Partial, broadcastMode?: BroadcastMode, ); getNonce(address?: string): Promise; getAccount(address?: string): Promise; signAdapter( msgs: Msg[], fee: StdFee, chainId: string, memo: string, accountNumber: number, sequence: number, ): Promise; /** Uploads code and returns a receipt, including the code ID */ upload(wasmCode: Uint8Array, meta?: UploadMeta, memo?: string, fee?: StdFee): Promise; instantiate( codeId: number, initMsg: object, label: string, memo?: string, transferAmount?: readonly Coin[], fee?: StdFee, contractCodeHash?: string, ): Promise; multiExecute( inputMsgs: Array<{ contractAddress: string; contractCodeHash?: string; handleMsg: object; transferAmount?: readonly Coin[]; }>, memo?: string, totalFee?: StdFee, ): Promise; execute( contractAddress: string, handleMsg: object, memo?: string, transferAmount?: readonly Coin[], fee?: StdFee, contractCodeHash?: string, ): Promise; sendTokens( recipientAddress: string, transferAmount: readonly Coin[], memo?: string, fee?: StdFee, ): Promise; }