exchange.IO("receipt", ...)
Queries the receipt of any transaction on the exchange object's chain (not only orders and transfers sent by it), optionally waiting for it to be mined.
exchange.IO(k, txHash)
exchange.IO(k, txHash, waitMs)Examples
Wait for a transaction to be confirmed on-chain.
javascript
function main() {
var txHash = "TX_HASH" // Hash of the transaction to query
var rc = exchange.IO("receipt", txHash, 120000)
if (rc.pending) {
Log("Not mined within 2 minutes; known to the node:", rc.known)
return
}
Log("Status:", rc.status, "Block:", rc.blockNumber, "gasUsed:", rc.gasUsed, "Fee:", rc.fee)
}Returns
| Type | Description |
object | When the transaction is on-chain, returns |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Always |
txHash | string | Yes | The transaction hash, a 32-byte hexadecimal string starting with |
waitMs | number | No | The maximum wait time in milliseconds. While the transaction is not yet on-chain, it is queried every 1.5 seconds, for up to 10 minutes. If this is omitted or set to 0, the transaction is queried only once. |
See Also
Uniswap / PancakeSwap Aerodrome / Velodrome KyberSwap 1inch exchange.IO exchange.IO("transfer") exchange.IO("cancelWait") exchange.IO("wrap") exchange.IO("unwrap")
Remarks
To check an order's fill status, just use exchange.GetOrder(). exchange.IO("receipt", ...) is mainly for querying transactions that are not orders, such as transfers.