import { Extrinsic, Preamble, PortableRegistry, TransactionStatus } from '@dedot/codecs'; import { AddressOrPair, IKeyringPair, IRuntimeTxCall, ISubmittableResult, TxStatus, Unsub } from '@dedot/types'; import { Deferred, HexString } from '@dedot/utils'; /** * Resolve a transaction input into a call and optional preamble. * * Supports: * - `Extrinsic` instance: extract call + preamble * - `IRuntimeTxCall` object: use directly as call, no preamble * - `HexString` or `Uint8Array`: try decode as extrinsic first, fallback to runtime call */ export declare function resolveCallAndPreamble(registry: PortableRegistry, tx: HexString | Uint8Array | Extrinsic | IRuntimeTxCall): { call: IRuntimeTxCall; preamble?: Preamble; }; export declare function isKeyringPair(account: AddressOrPair): account is IKeyringPair; /** * Sign a raw message * @param signerPair * @param raw */ export declare function signRawMessage(signerPair: IKeyringPair, raw: HexString | string): Uint8Array; type TxInfo = { txIndex: number; blockNumber: number; }; /** * Convert transaction status to transaction event * * Ref: https://github.com/paritytech/polkadot-sdk/blob/98a364fe6e7abf10819f5fddd3de0588f7c38700/substrate/client/rpc-spec-v2/src/transaction/transaction.rs#L132-L159 * @param txStatus * @param txInfo */ export declare function toTxStatus(txStatus: TransactionStatus, txInfo?: TxInfo): TxStatus; export declare function txDefer(): { deferTx: Deferred<`0x${string}` | Unsub>; deferFinalized: () => Deferred>> | undefined; deferBestChainBlockIncluded: () => Deferred>> | undefined; onTxProgress: (result: ISubmittableResult) => void; }; export {};