Class KIP7Wrapper
- java.lang.Object
-
- com.klaytn.caver.kct.kip7.wrapper.KIP7Wrapper
-
public class KIP7Wrapper extends java.lang.Object
Representing a KIP7Wrapper 1. This class wraps all static methods of KIP7 2. This class should be accessed via `caver.kct.kip7`
-
-
Constructor Summary
Constructors Constructor Description KIP7Wrapper(Caver caver)
Creates a KIP7Wrapper instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KIP7
create()
Creates a KIP7 instanceKIP7
create(java.lang.String contractAddress)
Creates a KIP7 instance.KIP7
deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply)
Deploy KIP-7 contract.KIP7
deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply, IWallet wallet)
Deploy KIP-7 contract.KIP7
deploy(KIP7DeployParams tokenInfo, SendOptions sendOptions)
Deploy KIP-7 contract.KIP7
deploy(KIP7DeployParams tokenInfo, SendOptions sendOptions, IWallet wallet)
Deploy KIP-7 contract.KIP7
deploy(KIP7DeployParams tokenInfo, java.lang.String deployer)
Deploy KIP-7 contract.KIP7
deploy(KIP7DeployParams tokenInfo, java.lang.String deployer, IWallet wallet)
Deploy KIP-7 contract.KIP7
deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply)
Deploy KIP-7 contract.KIP7
deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply, IWallet wallet)
Deploy KIP-7 contract.java.util.Map<java.lang.String,java.lang.Boolean>
detectInterface(java.lang.String contractAddress)
Detects which interface the KIP-7 token contract supports.
-
-
-
Constructor Detail
-
KIP7Wrapper
public KIP7Wrapper(Caver caver)
Creates a KIP7Wrapper instance- Parameters:
caver
- A Caver instance
-
-
Method Detail
-
create
public KIP7 create() throws java.io.IOException
Creates a KIP7 instance- Returns:
- KIP7
- Throws:
java.io.IOException
-
create
public KIP7 create(java.lang.String contractAddress) throws java.io.IOException
Creates a KIP7 instance.Example :
KIP7 kip7 = caver.kct.kip7.create();
- Parameters:
contractAddress
- A contract address- Returns:
- KIP7
- Throws:
java.io.IOException
-
deploy
public KIP7 deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply) 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
Deploy KIP-7 contract.The deployer's keyring should be existed in `caver.wallet`.
Example :
String deployerAddress = "0x{deployerAddress}"; String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 KIP7 kip7 = caver.kct.kip7.deploy(deployerAddress, name, symbol, decimals, initialSupply);
- Parameters:
deployer
- A deployer's address.name
- A KIP-7 contract name.symbol
- A KIP-7 contract symbol.decimals
- A KIP-7 contract decimals.initialSupply
- A KIP-7 contract initial supply.- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply) 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
Deploy KIP-7 contract.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.
Example :
String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 SendOptions sendOptions = new SendOptions(); sendOptions.setFrom("0x{deployerAddress}"); sendOptions.setGas(BigInteger.valueOf(gas value)); sendOptions.setFeeDelegation(true); sendOptions.setFeePayer("0x{feePayerAddress}"); KIP7 kip7 = caver.kct.kip7.deploy(sendOptions, name, symbol, decimals, initialSupply);
- Parameters:
sendOptions
- The send options to deploy a contract.name
- A KIP-7 contract name.symbol
- A KIP-7 contract symbol.decimals
- A KIP-7 contract decimals.initialSupply
- A KIP-7 contract initial supply.- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(java.lang.String deployer, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply, IWallet wallet) throws java.lang.NoSuchMethodException, org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException
Deploy KIP-7 contract.The wallet used in the contract is set with the wallet that implements the IWallet interface passed as a parameter of the method.
Example :
String deployerAddress = "0x{deployerAddress}"; String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 KIP7 kip7 = caver.kct.kip7.deploy(deployerAddress, name, symbol, decimals, initialSupply, caver.getWallet());
- Parameters:
deployer
- A deployer's address.name
- A KIP-7 contract name.symbol
- A KIP-7 contract symbol.decimals
- A KIP-7 contract decimals.initialSupply
- A KIP-7 contract initial supply.wallet
- The class instance implemented IWallet to sign transaction.- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(SendOptions sendOptions, java.lang.String name, java.lang.String symbol, int decimals, java.math.BigInteger initialSupply, IWallet wallet) throws java.lang.NoSuchMethodException, org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException
Deploy KIP-7 contract.The wallet used in the contract is set with the wallet that implements the IWallet interface 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.
Example :
String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 SendOptions sendOptions = new SendOptions(); sendOptions.setFrom("0x{deployerAddress}"); sendOptions.setGas(BigInteger.valueOf(gas value)); sendOptions.setFeeDelegation(true); sendOptions.setFeePayer("0x{feePayerAddress}"); KIP7 kip7 = caver.kct.kip7.deploy(sendOptions, name, symbol, decimals, initialSupply, caver.getWallet());
- Parameters:
sendOptions
- The send options to deploy a contract.name
- A KIP-7 contract name.symbol
- A KIP-7 contract symbol.decimals
- A KIP-7 contract decimals.initialSupply
- A KIP-7 contract initial supply.wallet
- The class instance implemented IWallet to sign transaction.- Returns:
- KIP7
- Throws:
java.lang.NoSuchMethodException
org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
-
deploy
public KIP7 deploy(KIP7DeployParams tokenInfo, java.lang.String deployer) throws java.lang.NoSuchMethodException, org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException
Deploy KIP-7 contract.The deployer's keyring should be existed in `caver.wallet`.
Example :
String deployerAddress = "0x{deployerAddress}"; String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply); KIP7 kip7 = caver.kct.kip7.deploy(tokenInfo, deployerAddress);
- Parameters:
tokenInfo
- The KIP-7 contract's deploy parameter valuesdeployer
- A deployer's address- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(KIP7DeployParams 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
Deploy KIP-7 contract.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.
String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 SendOptions sendOptions = new SendOptions(); sendOptions.setFrom("0x{deployerAddress}"); sendOptions.setGas(BigInteger.valueOf(gas value)); sendOptions.setFeeDelegation(true); sendOptions.setFeePayer("0x{feePayerAddress}"); KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply); KIP7 kip7 = caver.kct.kip7.deploy(tokenInfo, sendOptions);
- Parameters:
tokenInfo
- The KIP-7 contract's deploy parameter valuessendOptions
- The send options to deploy a contract.- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(KIP7DeployParams 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
Deploy KIP-7 contract.The wallet used in the contract is set with the wallet that implements the IWallet interface passed as a parameter of the method.
Example :
String deployerAddress = "0x{deployerAddress}"; String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply); KIP7 kip7 = caver.kct.kip7.deploy(tokenInfo, deployerAddress, caver.getWallet());
- Parameters:
tokenInfo
- The KIP-7 contract's deploy parameter valuesdeployer
- A deployer's addresswallet
- The class instance implemented IWallet to sign transaction.- Returns:
- KIP7
- 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
-
deploy
public KIP7 deploy(KIP7DeployParams tokenInfo, 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
Deploy KIP-7 contract.The wallet used in the contract is set with the wallet that implements the IWallet interface 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.
Example :
String name = "KIP7"; String symbol = "KIP7Symbol"; int decimals = 18; BigInteger initialSupply = BigInteger.valueOf(100_000).multiply(BigInteger.TEN.pow(CONTRACT_DECIMALS)); // 100000 * 10^18 SendOptions sendOptions = new SendOptions(); sendOptions.setFrom("0x{deployerAddress}"); sendOptions.setGas(BigInteger.valueOf(gas value)); sendOptions.setFeeDelegation(true); sendOptions.setFeePayer("0x{feePayerAddress}"); KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply); KIP7 kip7 = caver.kct.kip7.deploy(tokenInfo, sendOptions, caver.getWallet());
- Parameters:
tokenInfo
- The KIP-7 contract's deploy parameter valuessendOptions
- The send options to deploy a contract.wallet
- The class instance implemented IWallet to sign transaction.- Returns:
- KIP7
- 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
-
detectInterface
public java.util.Map<java.lang.String,java.lang.Boolean> detectInterface(java.lang.String contractAddress)
Detects which interface the KIP-7 token contract supports.Example :
Map<String, Boolean> result = KIP7.detectInterface(); result.get(KIP7.INTERFACE_ID_IKIP7); result.get(KIP7.INTERFACE_ID_IKIP7_BURNABLE); result.get(KIP7.INTERFACE_ID_IKIP7_METADATA); result.get(KIP7.INTERFACE_ID_IKIP7_MINTABLE); result.get(KIP7.INTERFACE_ID_IKIP7_PAUSABLE);
- Parameters:
contractAddress
- A contract address.- Returns:
- Map<String, Boolean>
-
-