Class Cancel
- java.lang.Object
-
- com.klaytn.caver.transaction.AbstractTransaction
-
- com.klaytn.caver.transaction.type.Cancel
-
- All Implemented Interfaces:
ITransactionWithGasPriceField
public class Cancel extends AbstractTransaction implements ITransactionWithGasPriceField
Represents a cancel transaction. Please refer to https://docs.klaytn.com/klaytn/design/transactions/basic#txtypecancel to see more detail.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Cancel.Builder
Cancel Builder class
-
Constructor Summary
Constructors Constructor Description Cancel(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String gasPrice, java.lang.String chainId, java.util.List<SignatureData> signatures)
Creates a Cancel instance.Cancel(Cancel.Builder builder)
Creates a Cancel instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 Cancel
create(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String gasPrice, java.lang.String chainId, java.util.List<SignatureData> signatures)
Creates a Cancel instance.static Cancel
create(Cancel.Builder builder)
Create a Cancel instance.static Cancel
decode(byte[] rlpEncoded)
Decodes a RLP-encoded Cancel byte array.static Cancel
decode(java.lang.String rlpEncoded)
Decodes a RLP-encoded Cancel string.void
fillTransaction()
Fills empty optional transaction field.(gasPrice)java.lang.String
getCommonRLPEncodingForSignature()
Returns the RLP-encoded string to make the signature of this transaction.java.lang.String
getGasPrice()
Getter function for gas pricejava.lang.String
getRLPEncoding()
Returns the RLP-encoded string of this transaction (i.e., rawTransaction).void
setGasPrice(java.lang.String gasPrice)
Setter function for gas price.void
setGasPrice(java.math.BigInteger gasPrice)
Setter function for gas price.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
appendSignatures, appendSignatures, getChainId, getFrom, getGas, getKeyType, getKlaytnCall, getNonce, getRawTransaction, getRLPEncodingForSignature, getSenderTxHash, getSignatures, getTransactionHash, getType, recoverPublicKeys, refineSignature, setChainId, setChainId, setFrom, setGas, setGas, setKlaytnCall, setNonce, setNonce, setSignatures, setType, sign, sign, sign, sign, sign, sign, suggestGasPrice
-
-
-
-
Constructor Detail
-
Cancel
public Cancel(Cancel.Builder builder)
Creates a Cancel instance- Parameters:
builder
- Cancel.builder instance
-
Cancel
public Cancel(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String gasPrice, java.lang.String chainId, java.util.List<SignatureData> signatures)
Creates a Cancel 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.gasPrice
- A unit price of gas in peb the sender will pay for a transaction fee.chainId
- Network IDsignatures
- A Signature list
-
-
Method Detail
-
create
public static Cancel create(Cancel.Builder builder)
Create a Cancel instance.- Parameters:
builder
- Cancel.builder instance- Returns:
- Cancel
-
create
public static Cancel create(Klay klaytnCall, java.lang.String from, java.lang.String nonce, java.lang.String gas, java.lang.String gasPrice, java.lang.String chainId, java.util.List<SignatureData> signatures)
Creates a Cancel 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.gasPrice
- A unit price of gas in peb the sender will pay for a transaction fee.chainId
- Network IDsignatures
- A Signature list- Returns:
- Cancel
-
getGasPrice
public java.lang.String getGasPrice()
Getter function for gas price- Specified by:
getGasPrice
in interfaceITransactionWithGasPriceField
- Returns:
- String
-
setGasPrice
public void setGasPrice(java.lang.String gasPrice)
Setter function for gas price.- Parameters:
gasPrice
- A unit price of gas in peb the sender will pay for a transaction fee.
-
setGasPrice
public void setGasPrice(java.math.BigInteger gasPrice)
Setter function for gas price.- Parameters:
gasPrice
- A unit price of gas in peb the sender will pay for a transaction fee.
-
decode
public static Cancel decode(java.lang.String rlpEncoded)
Decodes a RLP-encoded Cancel string.- Parameters:
rlpEncoded
- RLP-encoded Cancel string- Returns:
- Cancel
-
decode
public static Cancel decode(byte[] rlpEncoded)
Decodes a RLP-encoded Cancel byte array.- Parameters:
rlpEncoded
- RLP-encoded Cancel byte array.- Returns:
- Cancel
-
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
-
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 field.(gasPrice)- 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
-
-