Class EthereumDynamicFee
- java.lang.Object
-
- com.klaytn.caver.transaction.AbstractTransaction
-
- com.klaytn.caver.transaction.type.EthereumDynamicFee
-
public class EthereumDynamicFee extends AbstractTransaction
Represents an ethereum access list transaction.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EthereumDynamicFee.Builder
EthereumDynamicFee Builder class
-
Constructor Summary
Constructors Constructor Description EthereumDynamicFee(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String maxPriorityFeePerGas, java.lang.String maxFeePerGas, java.lang.String chainId, java.util.List<SignatureData> signatures, java.lang.String to, java.lang.String input, java.lang.String value, AccessList accessList)
Create a EthereumDynamicFee instance.EthereumDynamicFee(EthereumDynamicFee.Builder builder)
Creates a EthereumDynamicFee instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendSignatures(SignatureData signatureData)
Appends signatures array to transaction.void
appendSignatures(java.util.List<SignatureData> signatureData)
Appends signatures array to transaction.java.lang.String
combineSignedRawTransactions(java.util.List<java.lang.String> rlpEncoded)
Combines signatures to the transaction from RLP-encoded transaction strings and returns a single transaction with all signatures combined.boolean
compareTxField(AbstractTransaction obj, boolean checkSig)
Check equals txObj passed parameter and Current instance.static EthereumDynamicFee
create(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String maxPriorityFeePerGas, java.lang.String maxFeePerGas, java.lang.String chainId, java.util.List<SignatureData> signatures, java.lang.String to, java.lang.String input, java.lang.String value, AccessList accessList)
Create a EthereumDynamicFee instance.static EthereumDynamicFee
create(EthereumDynamicFee.Builder builder)
Creates a EthereumDynamicFee instance.static EthereumDynamicFee
decode(byte[] rlpEncoded)
Decodes a RLP-encoded EthereumDynamicFee byte array.static EthereumDynamicFee
decode(java.lang.String rlpEncoded)
Decodes a RLP-encoded EthereumDynamicFee string.void
fillTransaction()
Fills empty optional transaction fields.(maxPriorityFeePerGas and maxFeePerGas)AccessList
getAccessList()
Getter function for accessListjava.lang.String
getCommonRLPEncodingForSignature()
Returns the RLP-encoded string to make the signature of this transaction.java.lang.String
getInput()
Getter function for inputjava.lang.String
getMaxFeePerGas()
Getter function for maxFeePerGas.java.lang.String
getMaxPriorityFeePerGas()
Getter function for maxPriorityFeePerGasjava.lang.String
getRLPEncoding()
Returns the RLP-encoded string of this transaction (i.e., rawTransaction).java.lang.String
getRLPEncodingForSignature()
Returns the RLP-encoded string to make the signature of this transaction.java.lang.String
getTo()
Getter function for tojava.lang.String
getTransactionHash()
Returns a hash string of transactionjava.lang.String
getValue()
Getter function for valuevoid
setAccessList(AccessList accessList)
Setter function for accessListvoid
setInput(java.lang.String input)
Setter function for inputvoid
setMaxFeePerGas(java.lang.String maxFeePerGas)
Setter function for maxFeePerGas.void
setMaxFeePerGas(java.math.BigInteger maxFeePerGas)
Setter function for gas price.void
setMaxPriorityFeePerGas(java.lang.String maxPriorityFeePerGas)
Setter function for maxPriorityFeePerGas.void
setMaxPriorityFeePerGas(java.math.BigInteger maxPriorityFeePerGas)
Setter function for maxPriorityFeePerGas.void
setTo(java.lang.String to)
Setter function for tovoid
setValue(java.lang.String value)
Setter function for valuevoid
setValue(java.math.BigInteger value)
Setter function for valueAbstractTransaction
sign(AbstractKeyring keyring)
Signs using all private keys used in the role defined in the Keyring instance.AbstractTransaction
sign(AbstractKeyring keyring, int index)
Signs to the transaction with a private key in the Keyring instance.AbstractTransaction
sign(AbstractKeyring keyring, int index, java.util.function.Function<AbstractTransaction,java.lang.String> signer)
Signs to the transaction with a private key in the Keyring instance.AbstractTransaction
sign(AbstractKeyring keyring, java.util.function.Function<AbstractTransaction,java.lang.String> signer)
Signs using all private keys used in the role defined in the Keyring instance.AbstractTransaction
sign(java.lang.String keyString)
Signs to the transaction with a single private key.AbstractTransaction
sign(java.lang.String keyString, java.util.function.Function<AbstractTransaction,java.lang.String> signer)
Signs to the transaction with a single private key.void
validateOptionalValues(boolean checkChainID)
Checks that member variables that can be defined by the user are defined.-
Methods inherited from class com.klaytn.caver.transaction.AbstractTransaction
getChainId, getFrom, getGas, getKeyType, getKlaytnCall, getNonce, getRawTransaction, getSenderTxHash, getSignatures, getType, recoverPublicKeys, refineSignature, setChainId, setChainId, setFrom, setGas, setGas, setKlaytnCall, setNonce, setNonce, setSignatures, setType, suggestGasPrice
-
-
-
-
Constructor Detail
-
EthereumDynamicFee
public EthereumDynamicFee(EthereumDynamicFee.Builder builder)
Creates a EthereumDynamicFee instance.- Parameters:
builder
- EthereumDynamicFee.Builder instance.
-
EthereumDynamicFee
public EthereumDynamicFee(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String maxPriorityFeePerGas, java.lang.String maxFeePerGas, java.lang.String chainId, java.util.List<SignatureData> signatures, java.lang.String to, java.lang.String input, java.lang.String value, AccessList accessList)
Create a EthereumDynamicFee instance.- Parameters:
klaytnCall
- Klay RPC instancefrom
- 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.maxPriorityFeePerGas
- Max priority fee per gas.maxFeePerGas
- Max fee per gas.chainId
- Network IDsignatures
- A Signature listto
- The account address that will receive the transferred value.input
- Data attached to the transaction, used for transaction execution.value
- The amount of KLAY in peb to be transferred.
-
-
Method Detail
-
create
public static EthereumDynamicFee create(EthereumDynamicFee.Builder builder)
Creates a EthereumDynamicFee instance.- Parameters:
builder
- EthereumDynamicFee.Builder instance.- Returns:
- EthereumDynamicFee
-
create
public static EthereumDynamicFee create(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String maxPriorityFeePerGas, java.lang.String maxFeePerGas, java.lang.String chainId, java.util.List<SignatureData> signatures, java.lang.String to, java.lang.String input, java.lang.String value, AccessList accessList)
Create a EthereumDynamicFee instance.- Parameters:
klaytnCall
- Klay RPC instancefrom
- 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.maxPriorityFeePerGas
- Max priority fee per gas.maxFeePerGas
- Max fee per gas.chainId
- Network IDsignatures
- A Signature listto
- The account address that will receive the transferred value.input
- Data attached to the transaction, used for transaction execution.value
- The amount of KLAY in peb to be transferred.accessList
- The EIP-2930 access list.- Returns:
- EthereumDynamicFee
-
getRLPEncoding
public java.lang.String getRLPEncoding()
Returns the RLP-encoded string of this transaction (i.e., rawTransaction).- Specified by:
getRLPEncoding
in classAbstractTransaction
- Returns:
- String
-
getCommonRLPEncodingForSignature
public java.lang.String getCommonRLPEncodingForSignature()
Returns the RLP-encoded string to make the signature of this transaction.- Specified by:
getCommonRLPEncodingForSignature
in classAbstractTransaction
- Returns:
- String
-
getRLPEncodingForSignature
public java.lang.String getRLPEncodingForSignature()
Returns the RLP-encoded string to make the signature of this transaction.- Overrides:
getRLPEncodingForSignature
in classAbstractTransaction
- Returns:
- String
-
compareTxField
public boolean compareTxField(AbstractTransaction obj, boolean checkSig)
Check equals txObj passed parameter and Current instance.- Overrides:
compareTxField
in classAbstractTransaction
- Parameters:
obj
- The AbstractTransaction Object to comparecheckSig
- Check whether signatures field is equal.- Returns:
- boolean
-
combineSignedRawTransactions
public java.lang.String combineSignedRawTransactions(java.util.List<java.lang.String> rlpEncoded)
Combines signatures to the transaction from RLP-encoded transaction strings and returns a single transaction with all signatures combined. When combining the signatures into a transaction instance, an error is thrown if the decoded transaction contains different value except signatures.- Specified by:
combineSignedRawTransactions
in classAbstractTransaction
- Parameters:
rlpEncoded
- A List of RLP-encoded transaction strings.- Returns:
- String
-
fillTransaction
public void fillTransaction() throws java.io.IOException
Fills empty optional transaction fields.(maxPriorityFeePerGas and maxFeePerGas)- Overrides:
fillTransaction
in classAbstractTransaction
- Throws:
java.io.IOException
-
validateOptionalValues
public void validateOptionalValues(boolean checkChainID)
Checks that member variables that can be defined by the user are defined. If there is an undefined variable, an error occurs.- Overrides:
validateOptionalValues
in classAbstractTransaction
-
decode
public static EthereumDynamicFee decode(java.lang.String rlpEncoded)
Decodes a RLP-encoded EthereumDynamicFee string.- Parameters:
rlpEncoded
- RLP-encoded EthereumDynamicFee string- Returns:
- EthereumDynamicFee
-
decode
public static EthereumDynamicFee decode(byte[] rlpEncoded)
Decodes a RLP-encoded EthereumDynamicFee byte array.- Parameters:
rlpEncoded
- RLP-encoded EthereumDynamicFee byte array.- Returns:
- EthereumDynamicFee
-
appendSignatures
public void appendSignatures(SignatureData signatureData)
Appends signatures array to transaction. EthereumDynamicFee transaction cannot have more than one signature, so an error occurs if the transaction already has a signature.- Overrides:
appendSignatures
in classAbstractTransaction
- Parameters:
signatureData
- SignatureData instance contains ECDSA signature data
-
appendSignatures
public void appendSignatures(java.util.List<SignatureData> signatureData)
Appends signatures array to transaction. EthereumDynamicFee transaction cannot have more than one signature, so an error occurs if the transaction already has a signature.- Overrides:
appendSignatures
in classAbstractTransaction
- Parameters:
signatureData
- List of SignatureData contains ECDSA signature data
-
getTransactionHash
public java.lang.String getTransactionHash()
Returns a hash string of transaction- Overrides:
getTransactionHash
in classAbstractTransaction
- Returns:
- String
-
sign
public AbstractTransaction sign(java.lang.String keyString) throws java.io.IOException
Signs to the transaction with a single private key. It sets Hasher default value. - signer : TransactionHasher.getHashForSignature()- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyString
- The private key string.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
sign
public AbstractTransaction sign(AbstractKeyring keyring, java.util.function.Function<AbstractTransaction,java.lang.String> signer) throws java.io.IOException
Signs using all private keys used in the role defined in the Keyring instance. It sets index and Hasher default value.- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyring
- The Keyring instance.signer
- The function to get hash of transaction.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
sign
public AbstractTransaction sign(AbstractKeyring keyring) throws java.io.IOException
Signs using all private keys used in the role defined in the Keyring instance. It sets index and Hasher default value. - signer : TransactionHasher.getHashForSignature()- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyring
- The Keyring instance.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
sign
public AbstractTransaction sign(java.lang.String keyString, java.util.function.Function<AbstractTransaction,java.lang.String> signer) throws java.io.IOException
Signs to the transaction with a single private key.- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyString
- The private key stringsigner
- The function to get hash of transaction.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
sign
public AbstractTransaction sign(AbstractKeyring keyring, int index) throws java.io.IOException
Signs to the transaction with a private key in the Keyring instance. It sets signer to TransactionHasher.getHashForSignature()- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyring
- The Keyring instance.index
- The index of private key to use in Keyring instance.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
sign
public AbstractTransaction sign(AbstractKeyring keyring, int index, java.util.function.Function<AbstractTransaction,java.lang.String> signer) throws java.io.IOException
Signs to the transaction with a private key in the Keyring instance.- Overrides:
sign
in classAbstractTransaction
- Parameters:
keyring
- The Keyring instance.index
- The index of private key to use in Keyring instance.signer
- The function to get hash of transaction.- Returns:
- AbstractTransaction
- Throws:
java.io.IOException
-
getTo
public java.lang.String getTo()
Getter function for to- Returns:
- String
-
setTo
public void setTo(java.lang.String to)
Setter function for to- Parameters:
to
- The account address that will receive the transferred value.
-
getInput
public java.lang.String getInput()
Getter function for input- Returns:
- String
-
setInput
public void setInput(java.lang.String input)
Setter function for input- Parameters:
input
- Data attached to the transaction.
-
getValue
public java.lang.String getValue()
Getter function for value- Returns:
- String
-
setValue
public void setValue(java.lang.String value)
Setter function for value- Parameters:
value
- The amount of KLAY in peb to be transferred.
-
setValue
public void setValue(java.math.BigInteger value)
Setter function for value- Parameters:
value
- The amount of KLAY in peb to be transferred.
-
getAccessList
public AccessList getAccessList()
Getter function for accessList- Returns:
- accessList Access list is an EIP-2930 access list.
-
setAccessList
public void setAccessList(AccessList accessList)
Setter function for accessList- Parameters:
accessList
- Access list is an EIP-2930 access list.
-
getMaxPriorityFeePerGas
public java.lang.String getMaxPriorityFeePerGas()
Getter function for maxPriorityFeePerGas- Returns:
- String
-
setMaxPriorityFeePerGas
public void setMaxPriorityFeePerGas(java.lang.String maxPriorityFeePerGas)
Setter function for maxPriorityFeePerGas.- Parameters:
maxPriorityFeePerGas
- Max priority fee per gas.
-
setMaxPriorityFeePerGas
public void setMaxPriorityFeePerGas(java.math.BigInteger maxPriorityFeePerGas)
Setter function for maxPriorityFeePerGas.- Parameters:
maxPriorityFeePerGas
- Max priority fee per gas.
-
getMaxFeePerGas
public java.lang.String getMaxFeePerGas()
Getter function for maxFeePerGas.- Returns:
- String
-
setMaxFeePerGas
public void setMaxFeePerGas(java.lang.String maxFeePerGas)
Setter function for maxFeePerGas.- Parameters:
maxFeePerGas
- Max fee per gas.
-
setMaxFeePerGas
public void setMaxFeePerGas(java.math.BigInteger maxFeePerGas)
Setter function for gas price.- Parameters:
maxFeePerGas
- Max fee per gas.
-
-