Class AbstractFeeDelegatedTransaction

    • Constructor Detail

      • AbstractFeeDelegatedTransaction

        public AbstractFeeDelegatedTransaction​(AbstractFeeDelegatedTransaction.Builder builder)
        Create an AbstractFeeDelegatedTransaction instance
        Parameters:
        builder - AbstractFeeDelegatedTransaction.Builder
      • AbstractFeeDelegatedTransaction

        public AbstractFeeDelegatedTransaction​(Klay klaytnCall,
                                               java.lang.String type,
                                               java.lang.String from,
                                               java.lang.String nonce,
                                               java.lang.String gas,
                                               java.lang.String chainId,
                                               java.util.List<SignatureData> signatures,
                                               java.lang.String feePayer,
                                               java.util.List<SignatureData> feePayerSignatures)
        Create an AbstractFeeDelegatedTransaction instance
        Parameters:
        klaytnCall - Klay RPC instance
        type - Transaction's type string
        from - The address of the sender.
        nonce - A value used to uniquely identify a sender’s transaction.
        gas - The maximum amount of gas the transaction is allowed to use.
        chainId - Network ID
        signatures - A Signature list
        feePayer - The address of the fee payer.
        feePayerSignatures - The fee payers's signatures.
    • Method Detail

      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(java.lang.String keyString)
                                                       throws java.io.IOException
        Signs to the transaction with a single private key as a fee payer. It sets Hasher default value. - signer : TransactionHasher.getHashForFeePayerSignature()
        Parameters:
        keyString - The private key string.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(java.lang.String keyString,
                                                              java.util.function.Function<AbstractFeeDelegatedTransaction,​java.lang.String> hasher)
                                                       throws java.io.IOException
        Signs to the transaction with a single private key as a fee payer.
        Parameters:
        keyString - The private key string.
        hasher - The function to get hash of transaction.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(AbstractKeyring keyring)
                                                       throws java.io.IOException
        Sign the transaction as a fee payer using all private keys used as roleFeePayerKey in the Keyring instance. It sets index and Hasher default value. - signer : TransactionHasher.getHashForFeePayerSignature()
        Parameters:
        keyring - The Keyring instance.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(AbstractKeyring keyring,
                                                              int index)
                                                       throws java.io.IOException
        Sign the the transaction as a fee payer using a private key at the index among the private keys used as roleFeePayerKey in the Keyring instance.
        Parameters:
        keyring - The Keyring instance.
        index - The index of private key to use in Keyring instance.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(AbstractKeyring keyring,
                                                              java.util.function.Function<AbstractFeeDelegatedTransaction,​java.lang.String> hasher)
                                                       throws java.io.IOException
        Sign the transaction as a fee payer using all private keys used as roleFeePayerKey in the Keyring instance.
        Parameters:
        keyring - The Keyring instance.
        hasher - The function to get hash of transaction.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • signAsFeePayer

        public AbstractFeeDelegatedTransaction signAsFeePayer​(AbstractKeyring keyring,
                                                              int index,
                                                              java.util.function.Function<AbstractFeeDelegatedTransaction,​java.lang.String> hasher)
                                                       throws java.io.IOException
        Sign the the transaction as a fee payer using a private key at the index among the private keys used as roleFeePayerKey in the Keyring instance.
        Parameters:
        keyring - The Keyring instance.
        index - The index of private key to use in Keyring instance.
        hasher - The function to get hash of transaction.
        Returns:
        AbstractFeeDelegatedTransaction
        Throws:
        java.io.IOException
      • appendFeePayerSignatures

        public void appendFeePayerSignatures​(SignatureData signatureData)
        Appends fee payer's signatures to the transaction.
        Parameters:
        signatureData - SignatureData instance contains ECDSA signature data
      • appendFeePayerSignatures

        public void appendFeePayerSignatures​(java.util.List<SignatureData> signatureData)
        Appends fee payer's signatures to the transaction.
        Parameters:
        signatureData - List of SignatureData contains ECDSA signature data
      • getRLPEncodingForFeePayerSignature

        public java.lang.String getRLPEncodingForFeePayerSignature()
        Returns a RLP-encoded transaction string for making fee payer's signature.
        Returns:
        String
      • compareTxField

        public boolean compareTxField​(AbstractFeeDelegatedTransaction txObj,
                                      boolean checkSig)
        Check equals txObj passed parameter and current instance.
        Parameters:
        txObj - The AbstractFeeDelegatedTransaction Object to compare
        checkSig - Check whether signatures field is equal.
        Returns:
        boolean
      • recoverFeePayerPublicKeys

        public java.util.List<java.lang.String> recoverFeePayerPublicKeys()
        Recovers the public key strings from "feePayerSignatures" field in transaction object.

        If you want to derive an address from public key, please use Utils.publicKeyToAddress(String).

        Example :
         
         List<String> publicKeys = tx.recoverFeePayerPublicKeys();
         
         
        Returns:
        List<String>
      • getFeePayer

        public java.lang.String getFeePayer()
        Getter function for feePayer
        Returns:
        String
      • setFeePayer

        public void setFeePayer​(java.lang.String feePayer)
        Setter function for feePayer
        Parameters:
        feePayer - The address of fee payer.
      • getFeePayerSignatures

        public java.util.List<SignatureData> getFeePayerSignatures()
        Getter function for feePayerSignatures
        Returns:
        List
      • setFeePayerSignatures

        public void setFeePayerSignatures​(java.util.List<SignatureData> feePayerSignatures)