ApiService class

Constructors

ApiService(String endpoint, {bool logsActivation = true})

Properties

endpoint String
endpoint is the HTTP URL to a Archethic node (acting as welcome node)
final
hashCode int
The hash code for this object.
no setterinherited
logsActivation bool
logsActivation manage log activation
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addOriginKey({String? originPublicKey, String? certificate}) Future<String>
Add a new origin key @param {String} originPublicKey origin public key to be added @param {String} certificate certificate of the origin public key
callSCFunction({required SCCallFunctionRequest jsonRPCRequest, bool resultMap = false}) Future<Object>
Call a smart contract's function @param {SCCallFunctionRequest} RPC Request @param {bool} Format of the response (true=Map, false=String)
callSCFunctionMulti({required List<SCCallFunctionRequest> jsonRPCRequests}) Future<List>
Call a smart contract's function @param {List
fetchBalance(List<String> addresses, {String request = Transaction.kBalanceQueryAllFields}) Future<Map<String, Balance>>
Query the network to find a balance from a list of addresses
getBlockchainVersion() Future<BlockchainVersionModel>
Query the network to find the protocol, transaction and code versions Returns a BlockchainVersionModel with blockchain's versions information
getGenesisAddress(String address) Future<Address>
Query the network to find the genesis address of a transaction Returns a Address with genesisAddress
getJsonRPCResult(String body) → dynamic
inherited
getJsonRPCResultString(String body) String
inherited
getKeychain(String seed) Future<Keychain>
Retrieve a keychain by using keychain access seed @param {String} seed Keychain's access seed
getLastTransaction(List<String> addresses, {String request = Transaction.kTransactionQueryAllFields}) Future<Map<String, Transaction>>
Query the network to find the last transaction from a liste of addresses
getNearestEndpoints() Future<List<Endpoint>>
List the nearest endpoints nodes from the client's IP Returns a List<Endpoint> with infos
getNodeList() Future<List<Node>>
Query the node infos Returns a List<Node> with infos
getOriginKey() String
getStorageNoncePublicKey() Future<String>
getToken(List<String> addresses, {String request = 'genesis, name, id, supply, symbol, type, properties, decimals, collection, ownerships { authorizedPublicKeys { encryptedSecretKey, publicKey }, secret }'}) Future<Map<String, Token>>
Query the network to find a token's data from a list of token addresses
getTransaction(List<String> addresses, {String request = Transaction.kTransactionQueryAllFields}) Future<Map<String, Transaction>>
Query the network to find a transaction Returns all informations represent transaction content.
getTransactionChain(Map<String, String> addresses, {String request = Transaction.kTransactionQueryAllFields, bool orderAsc = true, int? fromCriteria}) Future<Map<String, List<Transaction>>>
Query the network to find transaction chains from a map of addresses and pagingAddress Returns the content scalar type represents transaction content List<Transaction>. Depending if the content can displayed it will be rendered as plain text otherwise in hexadecimal
getTransactionContent(Map<String, String> addresses) Future<Map<String, String>>
Query the network to find a transaction from a list of addresses
getTransactionFee(Transaction transaction) Future<TransactionFee>
Get transaction fees @param {Object} tx Transaction to estimate fees
getTransactionIndex(List<String> addresses) Future<Map<String, int>>
getTransactionInputs(List<String> addresses, {String request = Transaction.kTransactionInputQueryAllFields, int limit = 0, int pagingOffset = 0}) Future<Map<String, List<TransactionInput>>>
Query the network to list the transaction inputs from a list of addresses
getTransactionOwnerships(List<String> addresses) Future<Map<String, List<Ownership>>>
getTransactionOwnerships @param {List
manageLinkException(QueryResult<Object?> result) → void
networkTransactions(String type, int page, {String request = Transaction.kTransactionQueryAllFields}) Future<List<Transaction>>
Query the network to list the transaction on the type @param {String} The type of transaction @param {int} The page @param {String} request List of informations to retrieve in the GraphQL Query Returns the content scalar type represents transaction content List<Transaction>. Depending if the content can displayed it will be rendered as plain text otherwise in hexadecimal
newAccessKeychainTransaction(String seed, Uint8List keychainAddress, Uint8List originPrivateKey, int blockchainTxVersion) Transaction
Create a new access keychain and build a transaction @param {String} seed Access keychain's seed @param {Uint8List} keychainAddress Keychain's transaction address @param {Uint8List} originPrivateKey Origin private key to attest the transaction
newKeychainTransaction(String seed, List<String> authorizedPublicKeys, Uint8List originPrivateKey, int blockchainTxVersion, {String? serviceName, String? derivationPath}) Transaction
Create a new keychain and build a transaction @param {String} seed Keychain's seed @param {List
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendTx(Transaction transaction) Future<TransactionStatus>
Send a transaction to the network @param {Object} tx Transaction to send
setJsonRPCRequest(String method, Object params, {int id = 1}) String
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

kRequestHeaders → const Map<String, String>