Skip to main content

List Transactions

An account can have multiple transactions associated with it, capturing its history of sending and receiving assets or other activities. Transactions are linked to specific accounts, providing a transparent record of the account's interactions and facilitating the secure transfer of value across the network.

This guide will show you how to list all the transactions of all the addresses of an Account.

Sync Options

If you want to list incoming transactions, you need to specify that in your sync call. Transactions for outputs that you synced before with other sync options, will not be requested later. Also, only transactions that weren't pruned on the point of syncingA process when a node downloads and verifies the entire history of the Tangle corresponding to a slot commitment chain. This allows to ensure that it has an up-to-date and accurate copy of the ledger. will be listed.

Example Code

  1. Instantiate a Wallet, get Alice's Account which was created in the first guide and sync it.
  2. Get all the Transactions related to the Account by calling the Account.transactions() function.
sdk/examples/how_tos/accounts_and_addresses/list_transactions.rs
loading...
  1. Get all the incoming Transactions related to the Account by calling the Account.incoming_transactions() function.
sdk/examples/how_tos/accounts_and_addresses/list_transactions.rs
loading...

Full Example Code

sdk/examples/how_tos/accounts_and_addresses/list_transactions.rs
loading...

Expected Output

Sent transactions:
0x3b92c80c5d108b0b756989aafe8843b98f1981726e5ddfe70bb51bc8e0ad5dbc
Received transactions:
0x3461e923da5e8222fac50397493d2237030d3ad743ecce141300de9477441756
0x22efc1c85c925d3cea275b355ef37c8c0795713ac5c0a1ec3d6634d6e9d13416
0x033f3766d7f202d82af52a17242da3747d9e51ca79704854307fe30a67526a54
0x738d5c74d03aa5e954e4028a963d42d5f2283d24d69abc994dcb89f55dd3f67c
0xde54940601a3153f4cae4986ee83853ee17c7eae389a0d1d7b7c678c6dec5f20