Klaytn has various types of transaction and each type of transaction consists of different fields. Therefore, users should understand the transaction types and specify the correct one when sending and signing a transaction. Related APIs: klay_signTransaction, klay_sendTransaction, klay_signTransactionAsFeePayer, klay_sendTransactionAsFeePayer, personal_signTransaction, personal_sendTransaction.
TxTypeLegacyTransaction
TxTypeLegacyTransaction represents a type of transaction existed previously in Klaytn. This transaction type exists to support compatibility. For more information, see TxTypeLegacyTransaction.
Parameters
Name
Type
Description
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
(optional when creating a new contract) The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
value
QUANTITY
(optional) Integer of the value sent with this transaction.
data
DATA
The compiled byte code of a contract to deploy or data (function indicator and parameter values) required to call a contract.
TxTypeValueTransfer is used when a user wants to send KLAY. For more information, see TxTypeValueTransfer.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeValueTransfer: 8
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
The integer indicating TxTypeFeeDelegatedValueTransfer: 9
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
feePayer
20-byte DATA
The address which pays the transaction fee.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedValueTransferWithRatio: 10
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
TxTypeValueTransferMemo is used when a user wants to send KLAY with a specific message. For more information, see TxTypeValueTransferMemo.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeValueTransferMemo: 16
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
The integer indicating TxTypeFeeDelegatedValueTransferMemo: 17
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
feePayer
20-byte DATA
The fee payer address of the transaction.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedValueTransferMemoWithRatio: 18
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
TxTypeAccountUpdate updates the key of the given account. For more information, see TxTypeAccountUpdate.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeAccountUpdate: 32
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
key
DATA
The new account key of the from account in RLP encoded format. For more information about the account key, see Account Key.
The integer indicating TxTypeFeeDelegatedAccountUpdate: 33
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
key
DATA
The new account key of the from account in RLP encoded format. For more information about the account key, see Account Key.
feePayer
20-byte DATA
The fee payer address of the transaction.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedAccountUpdateWithRatio: 34
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
key
DATA
The new account key of the from account in RLP encoded format. For more information about the account key, see Account Key.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
TxTypeSmartContractDeploy deploys a smart contract to the given address. For more information, see TxTypeSmartContractDeploy.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeSmartContractDeploy: 40
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
humanReadable
Boolean
true if the address is humanReadable, false if the address is not humanReadable. Currently, the value should be false. Human-readable addresses will be supported later.
codeFormat
QUANTITY
The code format of smart contract code. The value 0 indicates EVM.
The integer indicating TxTypeFeeDelegatedSmartContractDeploy: 41
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
humanReadable
Boolean
true if the address is humanReadable, false if the address is not humanReadable. Currently, the value should be false. Human-readable addresses will be supported later.
codeFormat
QUANTITY
The code format of smart contract code. The value 0 indicates EVM.
feePayer
20-byte DATA
The fee payer address of the transaction.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedSmartContractDeployWithRatio: 42
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
humanReadable
Boolean
true if the address is humanReadable, false if the address is not humanReadable. Currently, the value should be false. Human-readable addresses will be supported later.
codeFormat
QUANTITY
The code format of smart contract code. The value 0 indicates EVM.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
TxTypeSmartContractExecution executes a smart contract with the given data in input. For more information, see TxTypeSmartContractExecution.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeSmartContractExecution: 48
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
The integer indicating TxTypeFeeDelegatedSmartContractExecution: 49
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
feePayer
20-byte DATA
The fee payer address of the transaction.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedSmartContractExecutionWithRatio: 50
from
20-byte DATA
The address from which the transaction is sent.
to
20-byte DATA
The address to which the transaction is directed.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
value
QUANTITY
Integer of the value sent with this transaction.
input
DATA
The data sent along with the transaction.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
TxTypeCancel cancels the execution of the transaction with the same nonce in the transaction pool. For more information, see TxTypeCancel.
Parameters
Name
Type
Description
typeInt
Integer
The integer indicating TxTypeCancel: 56
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
The integer indicating TxTypeFeeDelegatedCancel: 57
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
feePayer
20-byte DATA
The fee payer address of the transaction.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.
The integer indicating TxTypeFeeDelegatedCancelWithRatio: 58
from
20-byte DATA
The address from which the transaction is sent.
gas
QUANTITY
(optional, default: 90000) Integer of the gas provided for the transaction execution. Unused gas will be refunded to the sender. If the specified gas is not enough to execute the transaction, the transaction is reverted.
gasPrice
QUANTITY
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
nonce
QUANTITY
(optional) Integer of a nonce.
feePayer
20-byte DATA
The fee payer address of the transaction.
feeRatio
QUANTITY
Fee ratio of the fee payer. If it is 30, 30% of the fee will be paid by the fee payer. 70% will be paid by the sender. The range of fee ratio is 1 ~ 99, if it is out of range, the transaction will not be accepted.
signatures
DATA
(optional - only for klay_sendTransactionAsFeePayer API) An array of signature objects. A signature object contains three fields (V, R, and S). V contains ECDSA recovery id. R contains ECDSA signature r while S contains ECDSA signature s.