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

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

TypeDescription

object

When the transaction is on-chain, returns {txHash, status, blockNumber, gasUsed, fee}. Here status is success or reverted, and fee is the fee actually paid, in the native coin and in readable units. If the transaction is not on-chain within the wait time, returns {txHash, pending: true, known}. known shows whether the node can find the transaction. If it cannot, the transaction was usually dropped or the hash is wrong.

Arguments

NameTypeRequiredDescription

k

string

Yes

Always receipt, which queries a transaction receipt.

txHash

string

Yes

The transaction hash, a 32-byte hexadecimal string starting with 0x, such as the txHash returned by exchange.IO("transfer", ...). To query the transaction behind an order, pass the part of the order ID (in the form ETH_USDC,0x…) after the comma.

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

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.