public class KIP17Wrapper
extends java.lang.Object
Constructor and Description |
---|
KIP17Wrapper(Caver caver)
Creates a KIP17Wrapper instance.
|
Modifier and Type | Method and Description |
---|---|
KIP17 |
create()
Creates a KIP17 instance.
|
KIP17 |
create(java.lang.String contractAddress)
Creates a KIP17 instance.
|
KIP17 |
deploy(KIP17DeployParams tokenInfo,
SendOptions sendOptions)
Deploy KIP-17 contract.
|
KIP17 |
deploy(KIP17DeployParams tokenInfo,
SendOptions sendOptions,
IWallet wallet)
Deploy KIP-17 contract.
|
KIP17 |
deploy(KIP17DeployParams tokenInfo,
java.lang.String deployer)
Deploy KIP17 contract.
|
KIP17 |
deploy(KIP17DeployParams tokenInfo,
java.lang.String deployer,
IWallet wallet)
Deploy KIP17 contract.
|
KIP17 |
deploy(SendOptions sendOptions,
java.lang.String name,
java.lang.String symbol)
Deploy a KIP-17 contract.
|
KIP17 |
deploy(SendOptions sendOptions,
java.lang.String name,
java.lang.String symbol,
IWallet wallet)
Deploy KIP-17 contract.
|
KIP17 |
deploy(java.lang.String deployer,
java.lang.String name,
java.lang.String symbol)
Deploy a KIP-17 contract.
|
KIP17 |
deploy(java.lang.String deployer,
java.lang.String name,
java.lang.String symbol,
IWallet wallet)
Deploy a KIP-17 contract.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
detectInterface(java.lang.String contractAddress)
Detects which interface the KIP-17 token contract supports.
|
public KIP17Wrapper(Caver caver)
caver
- A Caver instance.public KIP17 create() throws java.io.IOException
java.io.IOException
public KIP17 create(java.lang.String contractAddress) throws java.io.IOException
contractAddress
- A contract address.java.io.IOException
public KIP17 deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol) throws java.lang.NoSuchMethodException, java.io.IOException, 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`.
deployer
- A deployer's address.name
- A KIP-17 contract name.symbol
- A KIP-17 contract symbol.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be added 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");
KIP17 kip17 = caver.kct.kip17.deploy(sendOptions, name, symbol);
sendOptions
- The send options to deploy a contract.name
- A KIP-17 contract name.symbol
- A KIP-17 contract symbol.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol, IWallet wallet) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
deployer
- A deployer's address.name
- A KIP-17 contract name.symbol
- A KIP-17 contract symbol.wallet
- The class instance implemented IWallet to sign transaction.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol, IWallet wallet) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
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");
KIP17 kip17 = caver.kct.kip17.deploy(sendOptions, name, symbol, caver.getWallet());
sendOptions
- The send options to deploy a contract.name
- A KIP-17 contract name.symbol
- A KIP-17 contract symbol.wallet
- The class instance implemented IWallet to sign transaction.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(KIP17DeployParams tokenInfo, java.lang.String deployer) throws java.lang.NoSuchMethodException, java.io.IOException, 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`.
tokenInfo
- The KIP-17 contract's deploy parameter values.deployer
- A deployer's address.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(KIP17DeployParams tokenInfo, SendOptions sendOptions) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The deployer's keyring should be added 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");
KIP17DeployParams tokenInfo = new KIP17DeployParams(name, symbol);
KIP17 kip17 = caver.kct.kip17.deploy(tokenInfo, sendOptions);
tokenInfo
- The KIP-17 contract's deploy parameter valuessendOptions
- The send options to deploy a contract.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(KIP17DeployParams tokenInfo, java.lang.String deployer, IWallet wallet) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
The wallet used in the contract is set to the wallet type passed as a parameter of the method.
tokenInfo
- The KIP-17 contract's deploy parameter values.deployer
- A deployer's address.wallet
- The class instance implemented IWallet to sign transaction.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public KIP17 deploy(KIP17DeployParams tokenInfo, SendOptions sendOptions, IWallet wallet) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, org.web3j.protocol.exceptions.TransactionException
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");
KIP17DeployParams tokenInfo = new KIP17DeployParams(name, symbol);
KIP17 kip17 = caver.kct.kip17.deploy(tokenInfo, sendOptions, caver.getWallet());
tokenInfo
- The KIP-17 contract's deploy parameter valuessendOptions
- The send options to deploy a contract.wallet
- The class instance implemented IWallet to sign transaction.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
org.web3j.protocol.exceptions.TransactionException
public java.util.Map<java.lang.String,java.lang.Boolean> detectInterface(java.lang.String contractAddress)
Example :
Map<String, Boolean> result = KIP17.detectInterface();
result.get(KIP17.INTERFACE_ID_IKIP17);
result.get(KIP17.INTERFACE_ID_IKIP17_METADATA);
result.get(KIP17.INTERFACE_ID_IKIP17_ENUMERABLE);
result.get(KIP17.INTERFACE_ID_IKIP17_MINTABLE);
result.get(KIP17.INTERFACE_ID_IKIP17_METADATA_MINTABLE);
result.get(KIP17.INTERFACE_ID_IKIP17_BURNABLE);
result.get(KIP17.INTERFACE_ID_IKIP17_PAUSABLE);
contractAddress
- A contract instance