Class 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 instance
      KIP7 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
        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`.

        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.

         
             SendOptions sendOptions = new SendOptions();
             sendOptions.setFrom("deployer address");
             sendOptions.setGas(BigInteger.valueOf(gas value));
             sendOptions.setFeeDelegation(true);
             sendOptions.setFeePayer("fee payer address");
        
             KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply);
             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 to the wallet type passed as a parameter of the method.

        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 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");
        
             KIP7DeployParams tokenInfo = new KIP7DeployParams(name, symbol, decimals, initialSupply);
             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`.

        Parameters:
        tokenInfo - The KIP-7 contract's deploy parameter values
        deployer - 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.

         
             SendOptions sendOptions = new SendOptions();
             sendOptions.setFrom("deployer address");
             sendOptions.setGas(BigInteger.valueOf(gas value));
             sendOptions.setFeeDelegation(true);
             sendOptions.setFeePayer("fee payer address");
        
             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 values
        sendOptions - 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 to the wallet type passed as a parameter of the method.

        Parameters:
        tokenInfo - The KIP-7 contract's deploy parameter values
        deployer - A deployer's address
        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
      • 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 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");
        
             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 values
        sendOptions - 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>