EvmRpcInterface class final

Constructors

EvmRpcInterface({bool useQueuedManager = true, bool awaitRefresh = true, Duration? refreshIntervall, bool eagerError = false, RefreshType refreshType = RefreshType.onTask, required List<EvmRpcClient> clients, required EVMNetworkType type})
clients - A list of clients to use for the manager useQueuedManager - If true, the manager will use a QueuedRpcManager and requests will be queued awaitRefresh - If true, the manager will wait for the clients to be refreshed before performing a task refreshIntervall - The rate at which the clients are refreshed if null the clients will only be refreshed once eagerError - If true a task will throw the first error it encounters, if false it will try all clients before throwing an error

Properties

blockTimestampCache Map<int, int>
final
hashCode int
The hash code for this object.
no setterinherited
refreshFuture Future<void>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
txStatusCache Map<String, ConfirmationStatus>
final
type EVMNetworkType
final

Methods

buildAndBroadcastTransaction({required String sender, required String recipient, required Uint8List seed, required EvmFeeInformation<EvmGasPrice>? feeInfo, required Uint8List? data, required BigInt? value, List<AccessListItem>? accessList}) Future<String>
buildTransaction({required String sender, required String recipient, required Uint8List seed, required EvmFeeInformation<EvmGasPrice>? feeInfo, required Uint8List? data, required BigInt? value, List<AccessListItem>? accessList}) Future<RawEvmTransaction>
Used to create a raw Transactions Fetches the gasPrice and gasLimit from the network Fetches the nonce from the network Signs the transaction
buildUnsignedTransaction({required String sender, required String recipient, required EvmFeeInformation<EvmGasPrice>? feeInfo, required Uint8List? data, required BigInt? value, List<AccessListItem>? accessList}) Future<RawEvmTransaction>
Used to create a raw Transactions Fetches the gasPrice and gasLimit from the network Fetches the nonce from the network If Transaction Type is not provided, it will use Legacy
call({String? sender, required String contractAddress, required Uint8List data, BlockNum? atBlock}) Future<String>
eth_call
estimateGasLimit({required String sender, required String recipient, Uint8List? data, BigInt? value, BigInt? gasPrice}) Future<int>
estimateNetworkFees({required String recipient, required String sender, required Uint8List? data, required BigInt? value}) Future<(Amount, int)>
fetchBalance({required String address}) Future<Amount>
Fetch Balance
fetchNetworkFees({EvmFeeInformation<EvmGasPrice>? existing, required String recipient, required String sender, required Uint8List? data, required BigInt? value}) Future<(int, EvmGasPrice)>
fetchTokenBalance(String address, ERC20Entity token) Future<Amount>
Fetch Token Balance
getBlockNumber() Future<int>
Get Block Number
getConfirmationStatus(String hash) Future<ConfirmationStatus>
getCurrentBlock() Future<Json>
Get Current Block
getGasPrice() Future<BigInt>
Get Gas Price
getGasPriceAmount() Future<Amount>
Get Gas Price
getPriorityFee() Future<Amount>
getTransactionByHash(String hash) Future<RawEvmTransaction>
Get Transaction By Hash
getTransactionCount(String address) Future<BigInt>
Get Transaction Count (Nonce)
getType2GasPrice() Future<EvmType2GasPrice>
interactWithContract({required String contractAddress, required LocalContractFunctionWithValues function, required String sender, required Uint8List seed, required EvmFeeInformation<EvmGasPrice>? feeInfo, BigInt? value}) Future<String>
Interact with Contract
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performTask<T>(Future<T> task(EvmRpcClient client), {Duration timeout = const Duration(seconds: 30), int? maxTries}) Future<T>
readContract({required String contractAddress, required LocalContractFunctionWithValues function}) Future<String>
resolveENS({required String name, required String contractAddress}) Future<String?>
sendCoin({required TransferIntent<EvmFeeInformation<EvmGasPrice>> intent, required String from, required Uint8List seed}) Future<String>
Send Currency
sendERC20Token({required TransferIntent<EvmFeeInformation<EvmGasPrice>> intent, required String from, required Uint8List seed}) Future<String>
Send ERC20 Token
sendERC721Nft({required String recipient, required String from, required int tokenId, required String contractAddress, required Uint8List seed}) Future<String>
Send ERC721
sendRawTransaction(String serializedTransactionHex) Future<String>
toString() String
A string representation of this object.
inherited
waitForTxConfirmation(String hash, {Duration interval = const Duration(seconds: 5)}) Future<bool>

Operators

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