Connect class
Connect to VeChain
Constructors
- Connect.new(String url)
Properties
Methods
-
balanceOfToken(
String caller, String tokenContractAddress) → Future< BigInt> -
call(
String caller, Contract contract, String funcName, List funcParams, String to, {BigInt? value, int gas = 0, String? gasPayer, String block = "best"}) → Future< Map> - Call a contract method (read-only). This is a single transaction, single clause call. This WON'T create ANY change on blockchain. Only emulation happens. If function has any return value, it will be included in "decoded" field
-
callMulti(
String caller, List< Clause> clauses, {int gas = 0, String? gasPayer, String block = "best"}) → Future<List< Map> > - Call a contract method (read-only). This is a single transaction, multi-clause call. This WON'T create ANY change on blockchain. Only emulation happens. If the called functions has any return value, it will be included in "decoded" field
-
clause(
Contract contract, String funcName, List funcParams, String to, {BigInt? value}) → RClause - There are two types of calls:
-
deploy(
Wallet wallet, Contract contract, List< String> paramsTypes, List params, BigInt value) → Future<Map> -
Deploy a smart contract to blockchain
This is a single clause transaction.
paramsTypes
Constructor params types,params
Constructor params,value
send VET in Wei with constructor call -
emulate(
Map body, {String block = 'best'}) → Future< List< Map> > - Upload a tx body for emulation, Get a list of execution responses (as the tx has multiple clauses).
-
emulateTx(
String address, Map txBody, {String block = "best", String? gasPayer}) → Future< List< Map> > -
Emulate the execution of a transaction.
adress
address of caller,txBody
Tx body to be emulated,block
Target at which block? by default "best", -
getAccount(
String address, {String block = 'best'}) → Future< Map> -
Takes a address
address
and returns te account status as a json -
getBlock(
{String block = 'best', bool expanded = false}) → Future< Map> -
Returns block as a Map.
block
enter block id or number,expanded
returned block data should be expanded -
getChainTag(
) → Future< int> - returns chaintag
-
getTransaction(
String transactionId) → Future< Map> -
Get transaction data of transaction with id
transactionId
-
getTransactionReceipt(
String transactionId) → Future< Map?> -
get transaction recipt of transaction with id
transactionId
-
getVetBalance(
String address) → Future< BigInt> - returns VET blance in VEI
-
getVthoBalance(
String address) → Future< BigInt> - returns the VTHO balance in Wei
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postTransaction(
String raw) → Future< Map> -
Post a new transaction with raw payload
raw
-
replayTx(
String txId) → Future< List< Map> > - Use the emulate function to replay the tx softly (for debug) Usually when you replay the tx to see what's wrong.
-
ticker(
) → Stream< Map> - stream output of best block
-
toString(
) → String -
A string representation of this object.
inherited
-
transact(
Wallet wallet, Contract contract, String funcName, List funcParams, String to, {BigInt? value, int expiration = 32, int gasPriceCoef = 0, int gas = 0, String? dependsOn, bool force = false, Wallet? gasPayer}) → Future< Map> -
transactMulti(
Wallet wallet, List< Clause> clauses, {int gasPriceCoef = 0, int gas = 0, String? dependsOn, int expiration = 32, bool force = false, Wallet? gasPayer}) → dynamic -
transferToken(
Wallet wallet, String to, String tokenContractAddress, [BigInt? amountInWei, Wallet? gasPayer]) → Future< Map> -
transferVet(
Wallet wallet, String to, {BigInt? value, Wallet? gasPayer}) → Future< Map> - Convenient function: do a pure VET transfer Parameters: to : Address of the receiver, value : optional Amount of VET to transfer in Wei, by default 0
-
transferVtho(
Wallet wallet, String to, [BigInt? vthoInWei, Wallet? gasPayer]) → Future< Map> -
waitForTxReceipt(
String txId, {int timeout = 20}) → Future< Map?> - Wait for tx receipt, for several seconds Returns the receipt or Null
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited