o1-labs / o1js

TypeScript framework for zk-SNARKs and zkApps

Home Page:https://docs.minaprotocol.com/en/zkapps/how-to-write-a-zkapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monitor `Mina.Transaction` hash

Pfed-prog opened this issue · 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.

commented

You can use checkZkappTransaction()