Skip to main content
Version: 2.0.0

RPC

The SDK provides a set of functions to perform some common RPC calls to interact with the blockchain. To see all the RPC functions available on the SDK, see the Dartdoc for BifrostQueryAlgebra and GenusQueryAlgebra. To see all the RPC functions available on the Bifrost and Genus nodes, see the protocol buffer definitions for Bifrost and Genus.

Querying UTXOs

You can query the existing UTXOs on the blockchain using the queryUtxo function of a Genus Query instance.

Future<List<Txo>> queryUtxo({required LockAddress fromAddress, TxoState txoState = TxoState.UNSPENT})

This function queries a Genus node for all UTXOs that are encumbered by a given address and are of a specified state.

The parameters are as follows:

  • fromAddress - The LockAddress of the UTXOs we are querying.
  • txoState - The state of the UTXOs we are querying. The default value is UNSPENT.

You can initialize an instance of a Genus Query using the following snippet:

final genusQuery = GenusQueryAlgebra(channel);

Where channel is a native or web grpc channel providing the connection with a Genus node. See the constructor signature.