o1js icon indicating copy to clipboard operation
o1js copied to clipboard

Monitor `Mina.Transaction` hash

Open Pfed-prog opened this issue 10 months ago • 1 comments

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.

Pfed-prog avatar Apr 05 '24 15:04 Pfed-prog

You can use checkZkappTransaction()

dfstio avatar Apr 16 '24 09:04 dfstio