public class KIP37Wrapper
extends java.lang.Object
Constructor and Description |
---|
KIP37Wrapper(Caver caver)
Creates a KIP37Wrapper instance
|
Modifier and Type | Method and Description |
---|---|
KIP37 |
create()
Creates a KIP37 instance
|
KIP37 |
create(java.lang.String contractAddress)
Creates a KIP37 instance
|
KIP37 |
deploy(KIP37DeployParams tokenInfo,
SendOptions sendOptions)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(KIP37DeployParams tokenInfo,
SendOptions sendOptions,
IWallet wallet)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(KIP37DeployParams tokenInfo,
java.lang.String deployer)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(KIP37DeployParams tokenInfo,
java.lang.String deployer,
IWallet wallet)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(java.lang.String uri,
SendOptions sendOptions)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(java.lang.String uri,
SendOptions sendOptions,
IWallet wallet)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(java.lang.String uri,
java.lang.String deployer)
Deploy a KIP-37 contract.
|
KIP37 |
deploy(java.lang.String uri,
java.lang.String deployer,
IWallet wallet)
Deploy a KIP-37 contract.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
detectInterface(java.lang.String contractAddress)
Detects which interface the KIP-37 token contract supports.
|
public KIP37Wrapper(Caver caver)
caver
- A Caver instancepublic KIP37 create() throws java.io.IOException
java.io.IOException
public KIP37 create(java.lang.String contractAddress) throws java.io.IOException
contractAddress
- A contract addressjava.io.IOException
public KIP37 deploy(java.lang.String uri, java.lang.String deployer) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be existed in `caver.wallet`.
uri
- The URI for token type.deployer
- A deployer's address.java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP37 deploy(java.lang.String uri, SendOptions sendOptions) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be existed in `caver.wallet`.
If you want to deploy a contract using fee delegation transaction, you can create and send a fee delegated transaction through setting a fee delegation field in `SendOptions` like below code example.
SendOptions sendOptions = new SendOptions();
sendOptions.setFrom("deployer address");
sendOptions.setGas(BigInteger.valueOf(gas value));
sendOptions.setFeeDelegation(true);
sendOptions.setFeePayer("fee payer address");
KIP37 kip37 = caver.kct.kip37.deploy(uri, sendOptions);
uri
- The URI for token type.sendOptions
- The send options to deploy a contract.java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP37 deploy(java.lang.String uri, java.lang.String deployer, IWallet wallet) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be existed in `caver.wallet`.
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
uri
- The URI for token type.deployer
- A deployer's address.wallet
- The class instance implemented IWallet to sign transaction.java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP37 deploy(java.lang.String uri, SendOptions sendOptions, IWallet wallet) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be existed in `caver.wallet`.
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
If you want to deploy a contract using fee delegation transaction, you can create and send a fee delegated transaction through setting a fee delegation field in `SendOptions` like below code example.
SendOptions sendOptions = new SendOptions();
sendOptions.setFrom("deployer address");
sendOptions.setGas(BigInteger.valueOf(gas value));
sendOptions.setFeeDelegation(true);
sendOptions.setFeePayer("fee payer address");
KIP37 kip37 = caver.kct.kip37.deploy(uri, sendOptions, caver.getWallet());
uri
- The URI for token type.sendOptions
- The send options to deploy a contract.wallet
- The class instance implemented IWallet to sign transaction.java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP37 deploy(KIP37DeployParams tokenInfo, java.lang.String deployer) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.ClassNotFoundException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException
The deployer's keyring should be existed in `caver.wallet`.
tokenInfo
- The KIP-37 contract's deploy parameter values.deployer
- A deployer's addressorg.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
public KIP37 deploy(KIP37DeployParams tokenInfo, SendOptions sendOptions) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.ClassNotFoundException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException
The deployer's keyring should be existed in `caver.wallet`.
If you want to deploy a contract using fee delegation transaction, you can create and send a fee delegated transaction through setting a fee delegation field in SendOptions.
SendOptions sendOptions = new SendOptions();
sendOptions.setFrom("deployer address");
sendOptions.setGas(BigInteger.valueOf(gas value));
sendOptions.setFeeDelegation(true);
sendOptions.setFeePayer("fee payer address");
KIP37 kip37 = caver.kct.kip37.deploy(new KIP37DeployParams(uri), sendOptions);
tokenInfo
- The KIP-37 contract's deploy parameter values.sendOptions
- The send options to deploy a contract.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
public KIP37 deploy(KIP37DeployParams tokenInfo, java.lang.String deployer, IWallet wallet) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be existed in `caver.wallet`.
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
tokenInfo
- The KIP-37 contract's deploy parameter values.deployer
- A deployer's addresswallet
- The class instance implemented IWallet to sign transaction.java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP37 deploy(KIP37DeployParams tokenInfo, SendOptions sendOptions, IWallet wallet) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.ClassNotFoundException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException
The deployer's keyring should be existed in `caver.wallet`.
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
SendOptions sendOptions = new SendOptions();
sendOptions.setFrom("deployer address");
sendOptions.setGas(BigInteger.valueOf(gas value));
sendOptions.setFeeDelegation(true);
sendOptions.setFeePayer("fee payer address");
KIP37 kip37 = caver.kct.kip37.deploy(new KIP37DeployParams(uri), sendOptions, caver.getWallet());
tokenInfo
- The KIP-37 contract's deploy parameter values.sendOptions
- The send options to deploy a contract.wallet
- The class instance implemented IWallet to sign transaction.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.util.Map<java.lang.String,java.lang.Boolean> detectInterface(java.lang.String contractAddress)
Example :
Map<String, Boolean> result = KIP37.detectInterface();
result.get(KIP37.INTERFACE_ID_IKIP37);
result.get(KIP37.INTERFACE_ID_IKIP37_BURNABLE);
result.get(KIP37.INTERFACE_ID_IKIP37_METADATA);
result.get(KIP37.INTERFACE_ID_IKIP37_MINTABLE);
result.get(KIP37.INTERFACE_ID_IKIP37_PAUSABLE);
contractAddress
- A contract instance