import { type DecodeObject, type EncodeObject } from '@cosmjs/proto-signing'; import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; import { type AccountDetails } from './account-details'; import { type StdFee } from '@cosmjs/stargate'; import type { Prettify, Signer } from './types'; export interface Account { bech32Address: string; pubKey: Uint8Array; isNanoLedger: boolean; } export type TxResponseBase = { height: string; txhash: string; code: number; gas_wanted: string; gas_used: string; timestamp: string; codespace: string; }; export declare const getPublicKey: ({ chainId, coinType, key }: { chainId: string; coinType: string; key: Uint8Array; }) => { typeUrl: string; value: Uint8Array; }; export declare const createSignDoc: (chainId: string, coinType: string, account: Prettify>, messages: DecodeObject[], fee: StdFee, memo: string) => SignDoc; export type SignAndBroadcastResponse = { transactionHash: string; code: number; codespace: string; height: number; gasWanted: number; gasUsed: number; timestamp: string; }; export declare class TxClient { chainId: string; restUrl: string; coinType: string; signer: Signer; account: Account; private registry; /** * Constructs a `TxClient` instance. * @param chainId - The blockchain chain ID. * @param restUrl - The REST URL of the blockchain node. * @param coinType - The coin type identifier. * @param signer - The object responsible for signing transactions ({@link Signer}). * @param account - The account information ({@link Account}). */ constructor(chainId: string, restUrl: string, coinType: string, signer: Signer, account: Account); /** * Signs a transaction using the direct signing method. * @param address - The address of the account. * @param messages - An array of messages to be included in the transaction ({@link DecodeObject}[]). * @param fee - The transaction fee information ({@link StdFee}). * @param memo - Optional transaction memo. * @returns A Promise resolving to the signed transaction as a base64 encoded string. */ signDirect: (address: string, messages: DecodeObject[], fee: StdFee, memo?: string) => Promise; /** * Signs a transaction using the Amino signing method. * @param address - The address of the account. * @param messages - An array of messages to be included in the transaction ({@link EncodeObject}[]). * @param fee - The transaction fee information ({@link StdFee}). * @param memo - Optional transaction memo. * @returns A Promise resolving to the signed transaction as a base64 encoded string. */ signAmino: (address: string, messages: EncodeObject[], fee: StdFee, memo?: string) => Promise; /** * Signs a transaction using the appropriate method based on the account type. * @param address - The address of the account. * @param messages - An array of messages to be included in the transaction ({@link EncodeObject}[]). * @param fee - The transaction fee information ({@link StdFee}). * @param memo - Optional transaction memo. * @returns A Promise resolving to the signed transaction as a base64 encoded string. */ sign: (address: string, messages: EncodeObject[], fee: StdFee, memo?: string) => Promise; /** * Broadcasts a signed transaction to the blockchain. * @param txBytesString - The signed transaction as a base64 encoded string. * @returns A Promise resolving to the broadcast transaction response ({@link SignAndBroadcastResponse}). */ broadcastTx: (txBytesString: string) => Promise; /** * Signs and broadcasts a transaction. * @param address - The address of the account. * @param messages - An array of messages to be included in the transaction ({@link EncodeObject}[]). * @param fee - The transaction fee information ({@link StdFee}). * @param memo - Optional transaction memo. * @returns A Promise resolving to the broadcast transaction response ({@link SignAndBroadcastResponse}). */ signAndBroadcastTx: (address: string, messages: EncodeObject[], fee: StdFee, memo?: string) => Promise; /** * Submits a transaction using the Skip API. * @param chainId - The blockchain chain ID. * @param txBytesString - The signed transaction as a base64 encoded string. * @returns A Promise resolving to the result of the transaction submission. */ submitTx: (chainId: string, txBytesString: string) => Promise<{ success: true; response: import("./skip-api").TransactionResponse; }>; }