1

有人可以帮助跟踪 elrond 网络上价值转移的交易状态吗?

   const testTransaction = new Transaction({
      value: Balance.egld(1),
      data: new TransactionPayload('Test Transfer'),
      receiver: new Address(ownerWallet),
      nonce: sender.nonce,
      gasPrice: new GasPrice(10000000000,
      gasLimit: new GasLimit(1000000)
    });

    await refreshAccount();

    const { sessionId  } = await sendTransactions({
      transactions: testTransaction,
      transactionsDisplayInfo: {
        processingMessage: 'Processing transaction',
        errorMessage: 'An error has occured during Transaction',
        successMessage: 'Transaction successful'
      }
    });

我目前正在使用sendTransactions发送我的交易。

4

1 回答 1

1

根据 erdjs 文档的文档,您可以使用TransactionWatcher

以下是文档中的简化示例:

await tx1.send(provider);

let watcher = new TransactionWatcher(tx1.hash, provider);
await watcher.awaitStatus(status => status.isExecuted());

erdjs 文档: https ://elrondnetwork.github.io/elrond-sdk-docs/erdjs/latest/

于 2022-02-09T10:25:58.130 回答