import { Account, DeliverTxResponse, SignerData, SigningStargateClientOptions, StdFee } from "@cosmjs/stargate"; import { Any } from "cosmjs-types/google/protobuf/any"; import { EncodeObject } from "@cosmjs/proto-signing"; import { Tendermint37Client } from "@cosmjs/tendermint-rpc"; import { AminoMsg } from "@cosmjs/amino"; import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx"; import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing"; import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; import { Profile } from "@desmoslabs/desmjs-types/desmos/profiles/v3/models_profile"; import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; import { Height } from "@desmoslabs/desmjs-types/ibc/core/client/v1/client"; import { Signer } from "./signers"; import { SignatureResult } from "./signatureresult"; import { PublicKey } from "./types/pubkey"; import { AsyncBroadcastResponse, BlockBroadcastResponse, BroadcastMode, BroadcastResponse, SyncBroadcastResponse } from "./types/responses"; import { DesmosQueryClient } from "./modules/queries"; export interface SimulateOptions { publicKey?: PublicKey; memo?: string; feeGranter?: string; } export interface SignTxOptions { /** * Transaction fees, if undefined will be considered to be "auto". */ fee?: StdFee | "auto"; /** * Transaction memo. */ memo?: string; /** * Optional transaction fee granter. */ feeGranter?: string; /** * Signer data that will be used instead of querying them from the chain. * This field is required when signing a transaction in offline mode. */ signerData?: SignerData; } /** * Creates and serializes an AuthInfo document. * This implementation does not support different signing modes for the different signers. */ export declare function makeAuthInfoBytes(signers: ReadonlyArray<{ readonly pubkey: Any; readonly sequence: number; }>, feeAmount: readonly Coin[], gasLimit: number, signMode?: SignMode, granter?: string): Uint8Array; interface Options extends SigningStargateClientOptions { readonly gasAdjustment?: number; } /** * Client to interact with the Desmos chain. */ export declare class DesmosClient extends SigningCosmWasmClient { private txSigner; private typesRegistry; private types; private readonly options; static connect(endpoint: string, options?: Options): Promise; static connectWithSigner(endpoint: string, signer: Signer, options?: Options): Promise; signAndBroadcast(signerAddress: string, messages: readonly EncodeObject[], fee: StdFee | "auto" | number, memo?: string): Promise; /** * Creates a client in offline mode. * * When you try to use online functionality with such client, an * exception will be raised. */ static offline(signer: Signer, options?: Options): Promise; protected constructor(client: Tendermint37Client | undefined, options: Options, signer?: Signer); /** * Updates the signer used to sign the transaction. * @param signer - The new signer that will be used. */ setSigner(signer: Signer): void; /** * Gets the account associated to the provided address, or `null` if no account is found. * This function has been overridden to correctly parse a Desmos profile. */ getAccount(searchAddress: string): Promise; /** * Gets the profile associated to the provided address, or `null` if no profile is found. */ getProfile(searchAddress: string): Promise; /** * Implements SigningStargateClient. * @protected */ protected getQueryClient(): DesmosQueryClient | undefined; /** * Implements SigningStargateClient. * @protected */ protected forceGetQueryClient(): DesmosQueryClient; /** * Returns the SignerData for the user having the given address, querying them from the chain. */ private getSignerData; /** * Signs a transaction using the provided data. * Note that an error will be thrown if the signer is not set (i.e. the client has been built * without using the `withSigner` builder). * * The sign mode (SIGN_MODE_DIRECT or SIGN_MODE_LEGACY_AMINO_JSON) is determined by this client's signer. * * You can pass signer data (account number, sequence and chain id) explicitly instead of querying them * from the chain. This is needed when signing for a multisig account, but it also allows for offline signing * (See the SigningStargateClient.offline constructor). * * NOTE: It's recommend to use the signTx method instead of this. */ sign(signerAddress: string, messages: readonly EncodeObject[], fee: StdFee | "auto", memo?: string, explicitSignerData?: SignerData): Promise; /** * Returns the account having the given address reading them from the signer. * @param address - Address of the account to be searched for. * @private */ private getAccountFromSigner; /** * Signs a transaction using the provided data. * Note that an error will be thrown if the signer is not set (i.e. the client has been built * without using the `withSigner` builder). * * The sign mode (SIGN_MODE_DIRECT or SIGN_MODE_LEGACY_AMINO_JSON) is determined by this client's signer. * * You can pass signer data (account number, sequence and chain id) explicitly instead of querying them * from the chain. This is needed when signing for a multisig account, but it also allows for offline signing * (See the SigningStargateClient.offline constructor). */ signTx(signerAddress: string, messages: readonly EncodeObject[], options?: SignTxOptions): Promise; /** * Function to estimate the required gas to perform a transaction. * @param signerAddress - Address of who is performing the transaction. * @param messages - Messages of the transaction to simulate. * @param options - Extra transaction simulation options. */ estimateTxGas(signerAddress: string, messages: readonly EncodeObject[], options?: SimulateOptions): Promise; /** * Function to estimate the fees required to perform a transaction. * @param signerAddress - Address of who is performing the transaction. * @param messages - Messages of the transaction to simulate. * @param options - Extra transaction simulation options. */ estimateTxFee(signerAddress: string, messages: readonly EncodeObject[], options?: SimulateOptions): Promise; /** * Encode the given message objects into Amino messages. * @param msgs - Messages to be encoded. */ encodeToAmino(msgs: readonly EncodeObject[]): AminoMsg[]; private signTxAmino; private signTxDirect; /** * This has been re-implemented to support backward compatibility with the SigningStargateClient type. */ sendIbcTokens(senderAddress: string, recipientAddress: string, transferAmount: Coin, sourcePort: string, sourceChannel: string, timeoutHeight: Height | undefined, /** timeout in seconds */ timeoutTimestamp: number | undefined, fee: StdFee | "auto" | number, memo?: string): Promise; /** * Gets a DesmosQueryClient that can be used to query the data from the chain. * NOTE: This method will throw an Error if the Client is not connected. */ get querier(): DesmosQueryClient; /** * Broadcast transaction to mempool and do not wait for response. * @param tx - The transaction to broadcast. */ broadcastTxAsync(tx: TxRaw): Promise; /** * Broadcast transaction to mempool and wait for response. * @param tx - The transaction to broadcast. */ broadcastTxRawSync(tx: TxRaw): Promise; /** * Broadcast transaction to mempool and wait that is included in a block. * @param tx - The transaction to broadcast. */ broadcastTxBlock(tx: TxRaw): Promise; /** * Broadcast a transaction on chain. * @param tx - The transaction to broadcast. * @param mode - The broadcast mode. */ broadcastTransaction(tx: TxRaw, mode: BroadcastMode): Promise; } export {};