RosettaApi class
Manages Rosetta API calls.
Constructors
- RosettaApi({String host = 'https://rosetta-api.internetcomputer.org'})
- Create a RosettaApi.
Properties
- currency ↔ Currency?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
final
- networkIdentifier ↔ NetworkIdentifier?
-
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<any>} The response body that was provided by the server. @private
-
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<any>} The response body that was provided by the server. @private
-
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<number>} The latest block index, or a TransactionError for error.
-
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<Transaction>|null>} An array of Transaction objects, or a TransactionError for error.
-
getTransactionsByAccount(
String 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<Transaction>|null>} An array of Transaction objects, or a TransactionError for error.
-
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<any>} The response body that was provided by the server. @private
-
networkStatus(
) → Future< NetworkStatusResponse> - Return /network/status response, describing the current status of the network. @returns {Promise<any>} The response body that was provided by the server. @private
-
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<any>} The response body that was provided by the server. @private
-
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<any>} The response body that was provided by the server. @private
-
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<any>} The response body that was provided by the server. @private
-
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<any>} The response body that was provided by the server. @private
-
transferPostCombine(
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