BramblClient class

Class for sending requests over an HTTP JSON-RPC API endpoint to Bifrost nodes. You will instead have to obtain private keys of addresses yourself before transactions can be created.

Constructors

BramblClient({Dio? httpClient, String? basePathOverride, List<Interceptor>? interceptors})
Starts a client that connects to a JSON rpc API, available at basePath. The httpClient will be used to send requests to the rpc server. An isolate will be used to perform expensive operations, such as signing transactions or computing private keys.

Properties

hashCode int
The hash code for this object.
no setterinherited
jsonRpc JsonRPC
final
printErrors bool
Whether errors, handled or not, should be printed to the console.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

credentialsFromPrivateKey(String privateKey, NetworkId network, PropositionType propositionType) Future<ToplSigningKey>
Constructs a new Credentials with the provided privateKey by using a ToplSigningKey.
getAllAddressBalances(List<ToplAddress> addresses, {int batchSize = 50}) Future<List<Balance>>
Retrieves balances for multiple addresses. If there are more than batchSize addresses to process this method will process via chunks of batchSize addresses
getBalance(ToplAddress address) Future<Balance>
Returns the balance object of the address
getBlockFromHead() Future<BlockResponse>
getBlockFromHeight(BlockNum block) Future<Block>
getBlockFromId(String id) Future<Block>
getBlockNumber() Future<String>
Returns the number of the most recent block on the chain
getClientVersion() Future<String>
Returns the version of the client we're sending requests to.
getFee() Future<PolyAmount>
getMempool() Future<List<TransactionReceipt>>
Returns a list of pending transactions.
getNetwork() Future<String>
Returns the network that the client is currently connected to.
getTransactionById(String transactionId) Future<TransactionReceipt>
Returns the information about a transaction requested by a transactionId transactionId
getTransactionFromMempool(String id) Future<TransactionReceipt?>
Returns a receipt of a transaction that has not yet been forged into a block and is still present in the mempool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendRawArbitTransfer({required ArbitTransaction arbitTransaction}) Future<Map<String, dynamic>>
Sends a raw arbit transfer call to a node
sendRawAssetTransfer({required AssetTransaction assetTransaction}) Future<Map<String, dynamic>>
Sends a raw asset transfer call to a node
sendRawPolyTransfer({required PolyTransaction polyTransaction}) Future<Map<String, dynamic>>
Sends a raw poly transfer call to a node
sendSignedTransaction(TransactionReceipt transaction) Future<String>
Sends a signed transaction.
sendTransaction(List<Credentials> cred, TransactionReceipt transaction, Uint8List messageToSign) Future<String>
Signs the given transaction using the keys supplied in the cred object to upload it to the client so that it can be forged into a block.
setApiKey(String name, String apiKey) → void
signTransaction(List<Credentials> cred, TransactionReceipt transactionReceipt, Uint8List messageToSign) Future<TransactionReceipt>
Signs the transactionReceipt with the credentials cred. The transaction will not be sent.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

basePath → const String