/** * Transaction Cancel Module * * Cancels a pending transaction by replacing it with a 0-value transaction to self * using the same nonce and a higher gas price (e.g. 2x when using --transaction-hash). * @see https://info.etherscan.com/how-to-cancel-ethereum-pending-transactions/ */ interface CancelTransactionOptions { /** Pending transaction nonce (use with gasPrice, or use transactionHash instead) */ nonce?: string; /** Gas price higher than the pending transaction (use with nonce) */ gasPrice?: string; /** Pending transaction hash; nonce and gas price will be fetched and gas price increased by 100% */ transactionHash?: string; } /** Signer with provider, compatible with ethers v5 and v6. */ interface CancelTransactionSigner { getAddress(): Promise; provider: { getTransaction?(hash: string): Promise; } | null; sendTransaction(tx: Record): Promise<{ hash: string; }>; } /** * Cancels a pending transaction by sending a 0-value transaction to self with the same nonce * and a higher gas price. Supports both ethers v5 and v6 signers via a unified transaction object. * @param {CancelTransactionSigner} signer - Signer with provider (ethers v5 or v6) * @param {CancelTransactionOptions} options - Either (nonce + gasPrice) or transactionHash * @returns {Promise} The replacement transaction hash * @throws If neither (nonce and gasPrice) nor transactionHash is provided * @throws If provider is not available on signer */ declare const cancelTransaction: (signer: CancelTransactionSigner, options: CancelTransactionOptions) => Promise; export { type CancelTransactionOptions, type CancelTransactionSigner, cancelTransaction };