Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Resends a stuck transaction (one that has not been mined for a long time) with a higher fee: the recipient address, amount, call data, and gas limit remain unchanged, and only the fee is increased.

exchange.IO(k, txHash)
exchange.IO(k, txHash, options)

Examples

Resend a transaction with a higher fee when it has not been mined within a certain period of time.

javascript
function main() { var USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" var spender = "0x1111111254EEB25477B68fb85Ed929f73A960582" var txHash = exchange.IO("api", USDC, "approve", spender, "1000000") Log("Sent:", txHash) var rec = exchange.IO("waitReceipt", txHash, { timeout: 30000 }) if (!rec) { // Still not mined after 30 seconds: resend with a higher fee using the same nonce (tip and // maxFee increased by at least 12.5%) txHash = exchange.IO("speedUp", txHash) Log("Sped up:", txHash) rec = exchange.IO("waitReceipt", txHash, { timeout: 30000 }) } Log(rec ? "Mined, status: " + rec.status : "Still not mined: " + GetLastError()) }

Returns

TypeDescription

string / object

Returns the hash of the replacement transaction; when dryRun is true, returns the content of the replacement transaction.

Arguments

NameTypeRequiredDescription

k

string

Yes

Function of the exchange.IO() function. Setting it to speedUp indicates that the function is used to resend a transaction with a higher fee.

txHash

string

Yes

Hash of the pending (not yet mined) transaction to be replaced. The transaction must have been sent from the current wallet.

options

object

No

Optional settings: multiplier is the fee multiplier, between 1.1 and 10, 1.125 by default; dryRun set to true only signs without sending and returns the replacement transaction (the same fields as exchange.IO("api", ...) with dryRun, plus replaces, the hash of the transaction being replaced).

See Also

Remarks

The replacement transaction reuses the nonce of the original transaction. The fee is scaled up by multiplier (default value is 1.125, minimum value is 1.1; nodes require both the tip and maxFee of a replacement transaction to increase by at least 10%), and will not be lower than the current network's suggested value.

When the original transaction has already been mined, the node cannot find the original transaction (for example, it was sent through a private channel), or the original transaction was not sent from the current wallet, the function returns a null value and reports an error.

Currently only Ethereum (EVM) chains are supported; TRON is not supported yet.

Fee calculation: if the original is an EIP-1559 transaction, the tip is the larger of the original tip × multiplier and the current suggested tip, and the max fee is the larger of the original max fee × multiplier and 2 × baseFee + tip; if the original is a legacy transaction, the gas price is the larger of the original gas price × multiplier and the node's eth_gasPrice. The recipient, amount, call data and gas limit are the same as the original's.

The original transaction is looked up on the node configured on the exchange object; when exchange.IO("sendBase", ...) is set, the replacement is broadcast through that node.