import { TendermintClient } from "@cosmjs/tendermint-rpc"; import { AminoConverters, AminoTypes, StdFee } from "@shareledgerjs/amino"; import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@shareledgerjs/signing"; import { ClientOptions } from "./baseclient"; import { Client, DeliverTxResponse } from "./client"; import { GasPrice } from "./fee"; /** * Signing information for a single signer that is not included in the transaction. * * @see https://github.com/cosmos/cosmos-sdk/blob/v0.42.2/x/auth/signing/sign_mode_handler.go#L23-L37 */ export interface SignerData { readonly accountNumber: number; readonly sequence: number; readonly chainId: string; } export interface SigningOptions extends ClientOptions { readonly registry?: Registry; readonly aminoTypes?: AminoTypes; readonly broadcastTimeoutMs?: number; readonly broadcastPollIntervalMs?: number; readonly gasPrice?: GasPrice; } /** */ export declare const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]>; export declare function createDefaultAminoTypes(): AminoConverters; export declare const defaultActions: Record; export declare class SigningClient extends Client { readonly registry: Registry; readonly broadcastTimeoutMs?: number; readonly broadcastPollIntervalMs?: number; protected readonly gasPrice?: GasPrice; private signer?; private readonly aminoTypes; constructor(tmClient: TendermintClient | undefined, signer?: OfflineSigner, options?: SigningOptions); protected forceGetSigner(): OfflineSigner; withSigner(signer: OfflineSigner): Promise; withoutSigner(): SigningClient; getSignerAccounts(): Promise; getSignerAccount(): Promise; simulate(signerAddress: string, messages: readonly EncodeObject[], memo?: string, fee?: StdFee, explicitSignerData?: SignerData): Promise; signAndBroadcast(signerAddress: string, messages: readonly EncodeObject[] | Uint8Array, fee?: (StdFee & { gasPrice?: GasPrice; }) | number, memo?: string, explicitSignerData?: SignerData): Promise; /** * This method is useful if you want to send a transaction in broadcast, * without waiting for it to be placed inside a block, because for example * I would like to receive the hash to later track the transaction with another tool. * @returns Returns the hash of the transaction */ signAndBroadcastSync(signerAddress: string, messages: readonly EncodeObject[] | Uint8Array, fee?: (StdFee & { gasPrice?: GasPrice; }) | number, memo?: string, explicitSignerData?: SignerData): Promise; /** * Gets account number and sequence from the API, creates a sign doc, * creates a single signature and assembles the signed transaction. * * 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). */ sign(signerAddress: string, messages: readonly EncodeObject[] | Uint8Array, fee?: (StdFee & { gasPrice?: GasPrice; }) | number, memo?: string, explicitSignerData?: SignerData): Promise; private signAmino; private signDirect; getTxBody(messages: readonly EncodeObject[], memo?: string): Uint8Array; }