With this method you can perform polling on the blockchain to get the transaction outcome as soon as the transaction gets executed.
Function Signature
async getTransactionOutcome(TxID, timeoutSec)
Parameters
Parameter Name
Datatype
TxID
String
timeoutSec
int
Example (CommonJS)
const { CEP_Account } = require('circular-enterprise-apis');
const Address = 'your-wallet-address';
let account = new CEP_Account();
async function run() {
//...
var txID = "some_txid"; // Usually you get that from the submitCertificate response
var timeout = 25;
console.log("Getting Transaction Outcome");
const outcome = await account.GetTransactionOutcome(txID, timeout);
console.log("Report ", outcome);
//...
}
run();
Example (ES Modules)
import { CEP_Account } from 'circular-enterprise-apis';
const Address = 'your-wallet-address';
let account = new CEP_Account();
async function run() {
//...
var txID = "some_txid"; // Usually you get that from the submitCertificate response
var timeout = 25;
console.log("Getting Transaction Outcome");
const outcome = await account.GetTransactionOutcome(txID, timeout);
console.log("Report ", outcome);
//...
}
run();