Search…
Transaction Verification

Confirming that Funds have been Received

1
// The 64-character transaction hash is necessary to retrieve the transaction:
2
const tx = await pocket.query.getTX(hash)
3
4
if (typeGuard(tx, RpcError)) {
5
throw new Error(tx.message)
6
}
7
8
// The retrieved transaction object:
9
console.log(tx)
Copied!
The return code of the transaction must be 0 — indicating success:
1
"tx_result": {
2
"code": 0,
3
"codespace": "",
4
"data": null,
5
"events": null,
6
"info": "",
7
"log": "",
8
"message_type": "send",
9
"recipient": "...",
10
"signer": "..."
11
}
Copied!
Consult the error types in Pocket Core for information on failed transactions.
Copy link
Edit on GitHub