RosettaApi class
Manages Rosetta API calls.
Constructors
- RosettaApi({String host = "https://rosetta-api.internetcomputer.org"})
Properties
- currency ↔ Currency?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ String
-
getter/setter pair
- networkIdentifier ↔ NetworkIdentifier?
-
Create a RosettaApi.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suggestedFee ↔ BigInt?
-
getter/setter pair
Methods
-
accountBalanceByAddress(
String accountAddress) → Future< AccountBalanceResponse> - Return the /account/balance response for the specified account. @param {string} accountAddress The account address to get the balance of. @returns {Promise
-
blockByIndex(
int blockIndex) → Future< BlockResponse> - Return the /block response for the block corresponding to the specified block index (i.e., block height). @param {number} blockIndex The index of the block to return. @returns {Promise
-
getAccountBalance(
dynamic accountAddress) → Future< BigInt> - Return the ICP account balance of the specified account. @param {string} accountAddress The account address to get the ICP balance of. @returns {Promise<BigNumber|TransactionError>} The ICP account balance of the specified account, or a TransactionError for error.
-
getLastBlockIndex(
) → Future< int> - Return the latest block index. @returns {Promise
-
getNetworkIdentifier(
) → Future< void> -
getSuggestedFee(
) → Future< void> -
getTransaction(
String transactionHash) → Future< RosettaTransaction> - Return the Transaction object with the specified hash. @param {string} transactionHash The hash of the transaction to return. @returns {Transaction|null} The Transaction object with the specified hash, or a TransactionError for error.
-
getTransactionByBlock(
int blockIndex) → Future< RosettaTransaction> -
getTransactions(
int limit, int maxBlockIndex, int offset) → Future< List< RosettaTransaction> > - Return an array of Transaction objects based on the specified parameters, or an empty array if none found. @param limit {number} The maximum number of transactions to return in one call. @param maxBlockIndex {number} The block index to start at. If not specified, start at current block. @param offset {number} The offset from maxBlockIndex to start returning transactions. @returns {Promise<Array
-
getTransactionsByAccount(
dynamic accountAddress) → Future< List< RosettaTransaction> > - Return an array of Transaction objects based on the specified parameters, or an empty array if none found. @param {string} accountAddress The account address to get the transactions of. @returns {Promise<Array
-
init(
) → Future< void> -
metadata(
ConstructionMetadataRequest req) → Future< ConstructionMetadataResponse> -
networksList(
) → Future< NetworkListResponse> - Return the /network/list response, containing a list of NetworkIdentifiers that the Rosetta server supports. @returns {Promise
-
networkStatus(
) → Future< NetworkStatusResponse> - Return /network/status response, describing the current status of the network. @returns {Promise
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
payloads(
ConstructionPayloadsRequest req) → Future< ConstructionPayloadsResponse> -
request(
String url, dynamic data) → Future< Map< String, dynamic> > - Perform the specified http request and return the response data. @param {string} url The server URL that will be used for the request. @param {object} data The data to be sent as the request body. @returns {Promise
-
submit(
ConstructionSubmitRequest req) → Future< TransactionIdentifierResponse> -
toString(
) → String -
A string representation of this object.
inherited
-
transactions(
SearchTransactionsRequest req) → Future< SearchTransactionsResponse> - Return the /search/transactions response for transactions (only one) with the specified hash. @param {string} transactionHash The hash of the transaction to return. @returns {Promise
-
transactionsByAccount(
String accountAddress) → Future< SearchTransactionsResponse> - Return the /search/transactions response for transactions containing an operation that affects the specified account. @param {string} accountAddress The account address to get the transactions of. @returns {Promise
-
transactionsByHash(
String transactionHash) → Future< SearchTransactionsResponse> - Return the /search/transactions response for transactions (only one) with the specified hash. @param {string} transactionHash The hash of the transaction to return. @returns {Promise
-
transfer_post_combine(
CombineSignedTransactionResult combineRes) → Future< TransactionIdentifierResponse> -
transferPreCombine(
Uint8List srcPub, Uint8List destAddr, BigInt count, BigInt? maxFee, Map< String, dynamic> ? opt) → Future<ConstructionPayloadsResponse>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited