import { Binary, Transaction, TxBestBlocksState, TxBroadcasted, TxCallData, TxFinalized, TxInBestBlocksFound, TxInBestBlocksNotFound, TxSigned } from 'polkadot-api'; import { PolkadotSigner } from 'polkadot-api/signer'; import { MultiAddress } from './descriptors'; import { GetKeyPairParams } from './keyring'; export interface SubmitParams { transaction: Transaction<{ calls: TxCallData[]; } | { dest: MultiAddress; value: bigint; } | { receiver: number; } | { owner_key: string; } | { idty_name: Binary; } | undefined, any, any, void | undefined>; signer: PolkadotSigner; at?: 'best' | 'finalized'; tip?: number; signed?: (event: TxSigned) => void; broadcasted?: (event: TxBroadcasted) => void; txBestBlocksState?: (event: TxBestBlocksState & (TxInBestBlocksNotFound | TxInBestBlocksFound), duration: number) => void; finalized?: (event: TxFinalized) => void; } export interface SubmitResult { duration: number; event: TxBestBlocksState & { ok: boolean; }; } /** * Sign a transaction and watch for events * @param params - The parameters object * @param params.transaction - The transaction to sign * @param params.signer - The signer to use * @param [params.at] - Resolve on best block or finalized block, default is best * @param [params.signed] - Called when the transaction is signed * @param [params.broadcasted] - Called when the transaction is broadcasted * @param [params.txBestBlocksState] - Called when the transaction is in best block * @param [params.finalized] - Called when the transaction is finalized * @returns A promise that resolves when the transaction is signed and broadcasted with the duration of the transaction and the event */ export declare function submit(params: SubmitParams): Promise; export interface SubmitWithCredentialsParams extends Omit { credentials: GetKeyPairParams; } /** * Sign a transaction with a key pair and watch for events * @param params - The parameters object * @param params.transaction - The transaction to sign * @param params.credentials - The credentials to use (mnemonic, derivation?, algorithm?) * @param [params.at] - Resolve on best block or finalized block, default is best * @param [params.signed] - Called when the transaction is signed * @param [params.broadcasted] - Called when the transaction is broadcasted * @param [params.txBestBlocksState] - Called when the transaction is in best block * @param [params.finalized] - Called when the transaction is finalized * @returns A promise that resolves when the transaction is signed and broadcasted with the duration of the transaction and the event */ export declare function submitWithCredentials(params: SubmitWithCredentialsParams): Promise;