Skip to main content
The wallet SDK primarily focus on an on-party basis interaction, therefore it is almost always required to define the party you are using for each command.

Reading Available Parties

Reading all available parties to you can easily be done using the wallet SDK as shown in the example below, and the result is paginated. It’s worth noting that the call to read all available parties doesn’t use the the party and synchronizer fields therefore changing them has no effect on the result.

Reading Ledger End

A lot of different requests will take a ledger offset to ensure the requested time correlates with ledger time. A Validator does not have a block height since there is no total state replication. There are two values that correlate:
  • ledger time - this is the time the ledger chooses when computing a transaction prior to commit.
  • record time - this is the time assigned by the sequencer when registering the confirmation request.
Ledger time should be used for all operations in your local environment (that does not affect partners). When doing reconciliation for transactions with partners or other members of a synchronizer it is better to use record time. Ledger end is used as a default for wallet SDK operations.

Reading Active Contracts

Using the above ledger time we can figure out what the current state of all active contracts are. Contracts can be in two states - active and archived - which correlates to the UTXO mode of unspent and spent. Active contracts are contracts that are unspent and thereby can be used in new transactions or to exercise choices.

Streaming and Monitoring Transaction History

In order to stream transaction events as they happen on ledger the listHoldingTransactions endpoint can be used. This takes two ledger offset and gives an overview of all token standard transactions that have happened between. It also returns a nextOffset that can be used when calling the endpoint again. This will allow you to easily ensure you do not receive any transaction twice and you are only querying the transactions that have happened after.
to quickly convert the stream into deposit and withdrawal you can use this function:

How do I fetch transaction by updateId?

Given an update Id, the token namespace has a method for getting a transaction based on the updateId. This will print out the transaction in the same format as sdk.token.holdings