Class EthereumAccount

  • All Implemented Interfaces:
    network.quant.api.Account

    public class EthereumAccount
    extends java.lang.Object
    implements network.quant.api.Account
    Ethereum implementation of Account
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network)  
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, byte[] privateKey, java.math.BigInteger nonce)  
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, byte[] privateKey, java.math.BigInteger nonce, network.quant.api.Encryptor encryptor, network.quant.api.Compressor compressor)
      Get Ethereum wallet instance by given secret key array
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, java.math.BigInteger privateKey, java.math.BigInteger nonce)  
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, java.math.BigInteger privateKey, java.math.BigInteger nonce, network.quant.api.Encryptor encryptor, network.quant.api.Compressor compressor)
      Get Ethereum wallet instance by given secret key number
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, network.quant.api.Encryptor encryptor, network.quant.api.Compressor compressor)
      Create Ethereum wallet instance with new key
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, org.web3j.crypto.ECKeyPair privateKey, java.math.BigInteger nonce)  
      static network.quant.api.Account getInstance​(network.quant.api.NETWORK network, org.web3j.crypto.ECKeyPair privateKey, java.math.BigInteger nonce, network.quant.api.Encryptor encryptor, network.quant.api.Compressor compressor)
      Get Ethereum wallet instance by given secret key object
      java.math.BigInteger getPrivateKey()  
      void setPrivateKey​(java.math.BigInteger key)  
      void sign​(java.lang.String fromAddress, java.lang.String toAddress, byte[] data, network.quant.api.DltTransaction dltTransaction)  
      void sign​(java.lang.String fromAddress, java.lang.String toAddress, java.io.InputStream stream, network.quant.api.DltTransaction dltTransaction)  
      void sign​(java.lang.String fromAddress, java.lang.String toAddress, java.lang.String message, network.quant.api.DltTransaction dltTransaction)  
      network.quant.api.Account withNetwork​(network.quant.api.NETWORK network)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • withNetwork

        public network.quant.api.Account withNetwork​(network.quant.api.NETWORK network)
        Specified by:
        withNetwork in interface network.quant.api.Account
      • setPrivateKey

        public void setPrivateKey​(java.math.BigInteger key)
        Specified by:
        setPrivateKey in interface network.quant.api.Account
      • getPrivateKey

        public java.math.BigInteger getPrivateKey()
        Specified by:
        getPrivateKey in interface network.quant.api.Account
      • sign

        public void sign​(java.lang.String fromAddress,
                         java.lang.String toAddress,
                         java.lang.String message,
                         network.quant.api.DltTransaction dltTransaction)
        Specified by:
        sign in interface network.quant.api.Account
      • sign

        public void sign​(java.lang.String fromAddress,
                         java.lang.String toAddress,
                         byte[] data,
                         network.quant.api.DltTransaction dltTransaction)
        Specified by:
        sign in interface network.quant.api.Account
      • sign

        public void sign​(java.lang.String fromAddress,
                         java.lang.String toAddress,
                         java.io.InputStream stream,
                         network.quant.api.DltTransaction dltTransaction)
        Specified by:
        sign in interface network.quant.api.Account
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            network.quant.api.Encryptor encryptor,
                                                            network.quant.api.Compressor compressor)
                                                     throws java.lang.Exception
        Create Ethereum wallet instance with new key
        Parameters:
        network - NETWORK containing network param
        encryptor - Encryptor containing encryptor
        compressor - Compressor containing compressor
        Returns:
        Account containing a Ethereum wallet
        Throws:
        java.lang.Exception
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network)
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            java.math.BigInteger privateKey,
                                                            java.math.BigInteger nonce,
                                                            network.quant.api.Encryptor encryptor,
                                                            network.quant.api.Compressor compressor)
        Get Ethereum wallet instance by given secret key number
        Parameters:
        network - NETWORK containing network param
        privateKey - BigInteger containing the key
        encryptor - Encryptor containing encryptor
        compressor - Compressor containing compressor
        Returns:
        Account containing a Ethereum wallet
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            java.math.BigInteger privateKey,
                                                            java.math.BigInteger nonce)
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            byte[] privateKey,
                                                            java.math.BigInteger nonce,
                                                            network.quant.api.Encryptor encryptor,
                                                            network.quant.api.Compressor compressor)
        Get Ethereum wallet instance by given secret key array
        Parameters:
        network - NETWORK containing network param
        privateKey - byte array containing the key in array
        encryptor - Encryptor containing encryptor
        compressor - Compressor containing compressor
        Returns:
        Account containing a Ethereum wallet
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            byte[] privateKey,
                                                            java.math.BigInteger nonce)
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            org.web3j.crypto.ECKeyPair privateKey,
                                                            java.math.BigInteger nonce,
                                                            network.quant.api.Encryptor encryptor,
                                                            network.quant.api.Compressor compressor)
        Get Ethereum wallet instance by given secret key object
        Parameters:
        network - NETWORK containing network param
        privateKey - ECKey containing the key
        encryptor - Encryptor containing encryptor
        compressor - Compressor containing compressor
        Returns:
        Account containing a Ethereum wallet
      • getInstance

        public static network.quant.api.Account getInstance​(network.quant.api.NETWORK network,
                                                            org.web3j.crypto.ECKeyPair privateKey,
                                                            java.math.BigInteger nonce)