o1js
o1js copied to clipboard
Monitor `Mina.Transaction` hash
Can not find how to monitor the inclusion or rejection of Mina Transaction
In Auro Wallet the transaction sent only returns a hash https://docs.aurowallet.com/general/reference/api-reference/methods/mina_sendpayment
Here is how I am monitoring tx status on backEnd.
export async function sendWaitTx(
tx: Transaction,
pks: PrivateKey[],
live: boolean = true
): Promise<TxStatus> {
tx.sign(pks);
await tx.prove();
let pendingTx: PendingTransaction = await tx.send();
if (live) {
if (pendingTx.status === 'pending') {
const transaction: Mina.IncludedTransaction | Mina.RejectedTransaction =
await pendingTx.safeWait();
return transaction.status;
}
throw new Error('tx not accepted by Mina Daemon');
}
}
Unfortunately, I can not find a way to intialize Mina Transaction with only a hash.
You can use checkZkappTransaction()