public class ContractLoader
extends java.lang.Object
| 构造器和说明 |
|---|
ContractLoader(java.lang.String abiFilePath,
java.lang.String binaryFilePath)
create ContractLoader, which load abi and binary files from configured file path
|
ContractLoader(java.lang.String contractName,
java.lang.String abi,
java.lang.String bin)
create ContractLoader, which load single contract
|
| 限定符和类型 | 方法和说明 |
|---|---|
AbiInfo |
abiInfo(java.lang.String abiFilePath)
parse contract binary from binary file path to cached map.
|
boolean |
appendContractAbi(java.lang.String contractName,
java.lang.String abi)
append single contract abi to cached map.
|
boolean |
appendContractBinary(java.lang.String contractName,
java.lang.String bin)
append single contract binary to cached map.
|
BinInfo |
binInfo(java.lang.String binaryFilePath)
parse contract binary from binary file path to cached map.
|
org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.String> |
getABIAndBinaryByContractName(java.lang.String contractName)
get binary and abi string from cached map by contract name.
|
java.lang.String |
getABIByContractName(java.lang.String contractName)
get abi string from cached map by contract name.
|
java.lang.String |
getBinaryByContractName(java.lang.String contractName)
get binary string from cached map by contract name.
|
ABIDefinition |
getConstructorABIByContractName(java.lang.String contractName)
get constructor abi definition by contract name.
|
java.util.List<ABIDefinition> |
getFunctionABIListByContractName(java.lang.String contractName)
get function abi definition list by contract name.
|
protected boolean |
loadABI(java.lang.String contractName,
java.lang.String abi)
append single contract abi to cached map.
|
protected boolean |
loadBinary(java.lang.String contractName,
java.lang.String bin)
append single contract binary to cached map.
|
static ABIDefinition |
selectConstructor(java.util.List<ABIDefinition> abiList)
select constructor abi from abi list.
|
public ContractLoader(java.lang.String abiFilePath,
java.lang.String binaryFilePath)
throws java.io.IOException
abiFilePath - abi files path which are compiled by solc from solidity files. Don't
support recursive directories.binaryFilePath - binary files' path which are compiled by solc from solidity files.
Don't support recursive directoriesjava.io.IOException - throw when can not find filepublic ContractLoader(java.lang.String contractName,
java.lang.String abi,
java.lang.String bin)
contractName - loaded contract name.abi - abi string, which could be obtained by compiling solidity contract.bin - binary string, which could be obtained by compiling solidity contract. If deploy
was not allowed, you could set null.public boolean appendContractAbi(java.lang.String contractName,
java.lang.String abi)
contractName - loaded contract name.abi - abi string, which could be obtained by compiling solidity contract.public boolean appendContractBinary(java.lang.String contractName,
java.lang.String bin)
contractName - loaded contract name.bin - binary string, which could be obtained by compiling solidity contract.protected boolean loadBinary(java.lang.String contractName,
java.lang.String bin)
contractName - loaded contract name.bin - binary string, which could be obtained by compiling solidity contract.protected boolean loadABI(java.lang.String contractName,
java.lang.String abi)
contractName - loaded contract name.abi - abi string, which could be obtained by compiling solidity contract.public BinInfo binInfo(java.lang.String binaryFilePath) throws java.io.IOException
binaryFilePath - binary file path. The binary file could be obtained by compiling
solidity contract.java.io.IOException - throw when get binary file errorpublic AbiInfo abiInfo(java.lang.String abiFilePath) throws java.io.IOException
abiFilePath - abi file path. The abi file could be obtained by compiling solidity
contract.java.io.IOException - throw when get ABI file errorpublic static ABIDefinition selectConstructor(java.util.List<ABIDefinition> abiList)
abiList - ABIDefinition list of a contractpublic java.lang.String getABIByContractName(java.lang.String contractName)
throws NoSuchTransactionFileException
contractName - loaded contract name.NoSuchTransactionFileException - throw when loader not contains contract namepublic java.lang.String getBinaryByContractName(java.lang.String contractName)
throws NoSuchTransactionFileException
contractName - loaded contract name.NoSuchTransactionFileException - throw when loader not contains contract namepublic org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.String> getABIAndBinaryByContractName(java.lang.String contractName)
throws NoSuchTransactionFileException
contractName - loaded contract name.NoSuchTransactionFileException - throw when loader not contains contract namepublic ABIDefinition getConstructorABIByContractName(java.lang.String contractName) throws NoSuchTransactionFileException
contractName - contract name.NoSuchTransactionFileException - throw when loader not contains contract namepublic java.util.List<ABIDefinition> getFunctionABIListByContractName(java.lang.String contractName) throws NoSuchTransactionFileException
contractName - contract name.NoSuchTransactionFileException - throw when loader not contains contract name