public class XuperClient extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
XuperClient.BalDetails |
| 构造器和说明 |
|---|
XuperClient(String target) |
public XuperClient(String target)
target - the address of xchain node, like 127.0.0.1:37101public void close()
public XuperClient setChainName(String name)
name - name of chainpublic XendorserClient getXendorserClient()
public Transaction transfer(Account from, String to, BigInteger amount, String fee)
from - from addressto - to addressamount - transfer amountpublic Transaction invokeContract(Account from, String module, String contract, String method, Map<String,byte[]> args)
from - the initiator of calling methodmodule - module of contract, usually wasmcontract - contract namemethod - contract methodargs - contract method argumentspublic Transaction queryContract(Account from, String module, String contract, String method, Map<String,byte[]> args)
from - the initiator of calling methodmodule - module of contract, usually wasmcontract - contract namemethod - contract methodargs - contract method argumentspublic Transaction deployWasmContract(Account from, byte[] code, String contract, String runtime, Map<String,byte[]> initArgs)
from - the contract account to deploy contractcode - the binary of contract codecontract - the name of contractruntime - contract runtime c or goinitArgs - initial argument of initialize methodpublic Transaction createContractAccount(Account from, String accountName)
from - the use account to create contract accountaccountName - the name of contract accountpublic BigInteger getBalance(String account)
account - account name, can be contract accountpublic XuperClient.BalDetails[] getBalanceDetails(String account)
account - account name, can be contract accountpublic XchainOuterClass.Transaction queryTx(String txid)
txid - the id of transactionpublic XchainOuterClass.InternalBlock queryBlock(String blockid)
blockid - the id of blockpublic XchainOuterClass.SystemsStatus getSystemStatus()
public XchainOuterClass.BCStatus getBlockchainStatus(String chainName)
chainName - the name of blockchainpublic Transaction deployEVMContract(Account from, byte[] bin, byte[] abi, String contract, Map<String,String> initArgs)
from - the account of create contract.bin - evm contract bin byte array.abi - evm contract abi byte array.contract - contract name.initArgs - constructor args.public Transaction queryEVMContract(Account from, String contract, String method, Map<String,String> args)
from - the initiator of calling method.contract - contract name.method - contract method.args - method args.public Transaction invokeEVMContract(Account from, String contract, String method, Map<String,String> args, BigInteger amount)
from - the initiator of calling method.contract - contract name.method - contract method.args - contract method args.amount - amount of transfer to contract when call payable method.Copyright © 2021. All rights reserved.