exchange.IO("deadline", ...)
Sets the deadline of swap transactions, or queries it.
exchange.IO(k)
exchange.IO(k, seconds)Examples
Set the transaction deadline and query the current value.
javascript
function main() {
exchange.IO("deadline", 300)
Log("Deadline:", exchange.IO("deadline"), "seconds")
}Returns
| Type | Description |
number | Returns the current transaction deadline in seconds. |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Fixed as |
seconds | number | No | Transaction validity period in seconds. Valid range is 10–86400 and the default is 120. If this parameter is omitted, the current value is queried. |
See Also
Uniswap / PancakeSwap Aerodrome / Velodrome KyberSwap 1inch exchange.IO exchange.IO("slippage") exchange.IO("gasMultiplier") exchange.IO("cancelWait")
Remarks
If a swap transaction is not confirmed on-chain before the deadline, it is reverted when executed. This prevents a transaction that has been pending for a long time from being filled after a large price move.
The KyberSwap exchange object passes the deadline to KyberSwap when the swap transaction is built; transactions built by 1inch carry no deadline, so the setting has no effect on swaps of a OneInch exchange object.