TonJsonRpc class
TON Blockchain client over jsonRPC
Constructors
- TonJsonRpc.new([String endpoint = 'https://testnet.toncenter.com/api/v2/jsonRPC', String? apiKey, int timeout = 30000])
-
Expects an
endpoint
as either of:
Properties
Methods
-
estimateExternalMessageFee(
InternalAddress address, {required Cell body, Cell? initCode, Cell? initData, required bool ignoreSignature}) → Future< ({int forwardFee, int gasFee, int inForwardFee, int storageFee})> - Returns a fee estimate for the external message as a record, wrapped in a Future:
-
getBalance(
InternalAddress address) → Future< BigInt> - Returns the address balance as a Future
-
getContractState(
InternalAddress address) → Future< ({BigInt balance, ({int seqno, String shard, int workchain}) blockId, Uint8List? code, Uint8List? data, LastTransactionId? lastTransaction, String state, int timestamp})> - Returns a contract state as a record, wrapped in a Future:
-
getMasterchainInfo(
) → Future< ({int initSeqno, int latestSeqno, String shard, int workchain})> - Returns the latest masterchain info as a record, wrapped in a Future:
-
getShardTransactions(
int workchain, int seqno, String shard) → Future< List< ({InternalAddress account, LastTransactionId lastTransactionId})> > - Returns the latest workchain shards as a List of records, wrapped in a Future:
-
getTransaction(
InternalAddress address, String lt, String hash) → Future< Transaction?> -
Returns a transaction by its logical time
lt
and a base64 encodedhash
as a Transaction? wrapped in a Future -
getTransactions(
InternalAddress address, {required int limit, String? lt, String? hash, String? toLt, bool? inclusive}) → Future< List< Transaction> > - Returns a List
-
getWorkchainShards(
int seqno) → Future< List< ({int seqno, String shard, int workchain})> > - Returns the latest workchain shards as a List of records, wrapped in a Future:
-
isContractDeployed(
InternalAddress address) → Future< bool> - Returns a bool, wrapped in a Future: true if contract is in active state, false otherwise
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open<
T extends Contract> (T src) → T - Returns a new opened contract with the ContractProvider initialized
-
provider(
InternalAddress address, ContractMaybeInit? init) → ContractProvider - Returns a new ContractProvider
-
runMethod(
InternalAddress address, String methodName, [List< TupleItem> stack = const <TupleItem>[]]) → Future<({int gasUsed, TupleReader stack})> - Returns the gas used and the stack after the get method invocation as a record, wrapped in a Future:
-
runMethodWithError(
InternalAddress address, String methodName, List< TupleItem> stack) → Future<({int exitCode, int gasUsed, TupleReader stack})> - Returns the gas used, stack and the exit code after the get method invocation as a record, wrapped in a Future:
-
sendExternalMessage(
Contract contract, Cell src) → dynamic - Returns nothing, sends an external message to contract
-
sendFile(
Uint8List src) → Future< void> -
Returns nothing, sends a BoC file
src
directly to the network -
sendMessage(
Message src) → Future< void> -
Returns nothing, sends a message
src
as a BoC to the network -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited