getXmrTxs method

Future<List<XmrTx>> getXmrTxs()

Retrieves the XMR transactions associated with the wallet.

This method sends a GetXmrTxsRequest to retrieve all XMR transactions associated with the wallet.

Example:

final transactions = await walletsClient.getXmrTxs();
for (final tx in transactions) {
  print('Transaction: ${tx.txId}');
}

Returns:

  • A Future containing a list of XmrTx transactions.
  • An empty list if an error occurs.

Implementation

Future<List<XmrTx>> getXmrTxs() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    final getXmrTxsReply =
        await havenoChannel.walletsClient!.getXmrTxs(GetXmrTxsRequest());
    return getXmrTxsReply.txs;
  } on GrpcError catch (e) {
    handleGrpcError(e);
    return [];
  }
}