Skip to main content
Version: 0.2

Querying a transaction

To query a transaction, you would need the request id returned after submitting your transaction to the AVN.

await api.poll.requestState(requestId);

Example

const AvnApi = require("avn-api");
const GATEWAY = "<node_url>"; //Replace the node_url with the url received from Aventus.
const api = new AvnApi(GATEWAY);

async function main() {
await api.init();

// Get the current state of a previously sent transaction.:
const state = await api.poll.requestState(requestId);
}

(async () => {
await main();
})();

Expected Output

"Processed"

RESULT FIELDS
The resulting state could be any of the following ('Pending', 'Pending and Lost', 'Processed', 'Errored', 'Unknown').