Basic
LegacyTransaction
LegacyTransaction
represents a legacy transaction. A Klaytn account can execute a LegacyTransaction
only with AccountKeyLegacy. The transactionObject
can have properties below to create a LegacyTransaction
.
LegacyTransaction
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates LegacyTransaction
.
NOTE: You can create an instance of LegacyTransaction
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.legacyTransaction.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.legacyTransaction({...})
, please change it to caver.transaction.legacyTransaction.create({...})
.
properties
Name | Type | Description |
---|---|---|
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
value | string | (optional, default: |
from | string | (optional) The address of the sender. If omitted, the keyring address used for signing will be set. |
to | string | (optional, default: |
input | string | (optional) Data attached to the transaction, used for smart contract deployment/execution. |
signatures | Array | (optional) An array of signatures. A legacy transaction can have only one signature. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
ValueTransfer
ValueTransfer
represents a value transfer transaction. The transactionObject
can have properties below to create a ValueTransfer
transaction.
ValueTransfer
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates ValueTransfer
transaction.
NOTE: You can create an instance of ValueTransfer
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.valueTransfer.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.valueTransfer({...})
, please change it to caver.transaction.valueTransfer.create({...})
.
properties
Name | Type | Description |
---|---|---|
value | string | The amount of KLAY in peb to be transferred. You can use |
from | string | The address of the sender. |
to | string | The account address that will receive the transferred value. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
signatures | Array | (optional) An array of signatures. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
ValueTransferMemo
ValueTransferMemo
represents a value transfer memo transaction. The transactionObject
can have properties below to create a ValueTransferMemo
transaction.
ValueTransferMemo
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates ValueTransferMemo
transaction.
NOTE: You can create an instance of ValueTransferMemo
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.valueTransferMemo.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.valueTransferMemo({...})
, please change it to caver.transaction.valueTransferMemo.create({...})
.
properties
Name | Type | Description |
---|---|---|
value | string | The amount of KLAY in peb to be transferred. You can use |
from | string | The address of the sender. |
to | string | The account address that will receive the transferred value. |
input | string | Data attached to the transaction. The message should be passed to this property. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
signatures | Array | (optional) An array of signatures. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
AccountUpdate
AccountUpdate
represents a account update transaction. The transactionObject
can have properties below to create an AccountUpdate
transaction.
AccountUpdate
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates AccountUpdate
transaction.
NOTE: You can create an instance of AccountUpdate
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.accountUpdate.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.accountUpdate({...})
, please change it to caver.transaction.accountUpdate.create({...})
.
properties
Name | Type | Description |
---|---|---|
from | string | The address of the sender. |
account | An Account instance that contains the information needed to update your account. | |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
signatures | Array | (optional) An array of signatures. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
For how to create an Account instance for each AccountKey
, refer to Getting Started - Account Update or caver.account.create.
Example
SmartContractDeploy
SmartContractDeploy
represents a smart contract deploy transaction. The transactionObject
can have properties below to create a SmartContractDeploy
transaction.
SmartContractDeploy
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates SmartContractDeploy
transaction.
NOTE: You can create an instance of SmartContractDeploy
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.smartContractDeploy.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.smartContractDeploy({...})
, please change it to caver.transaction.smartContractDeploy.create({...})
.
properties
Name | Type | Description |
---|---|---|
from | string | The address of the sender. |
input | string | Data attached to the transaction. The byte code of the smart contract to be deployed and its arguments. You can get this through caver.abi.encodeContractDeploy. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
value | string | (optional, default: |
to | string | (optional, default: |
humanReadable | boolean | (optional, default: |
codeFormat | string | (optional, default: |
signatures | Array | (optional) An array of signatures. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
SmartContractExecution
SmartContractExecution
represents a smart contract execution transaction. The transactionObject
can have properties below to create a SmartContractExecution
transaction.
SmartContractExecution
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates SmartContractExecution
transaction.
NOTE: You can create an instance of SmartContractExecution
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.smartContractExecution.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.smartContractExecution({...})
, please change it to caver.transaction.smartContractExecution.create({...})
.
properties
Name | Type | Description |
---|---|---|
from | string | The address of the sender. |
to | string | The address of the smart contract account to be executed. |
input | string | Data attached to the transaction, used for transaction execution. The input is an encoded string that indicates a function to call and parameters to be passed to this function. You can get this through caver.abi.encodeFunctionCall. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
value | string | (optional, default: |
signatures | Array | (optional) An array of signatures. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
Cancel
Cancel
represents a cancel transaction. The transactionObject
can have properties below to create a Cancel
transaction.
Cancel
transaction cancels the execution of the transaction with the same nonce in the transaction pool.
Cancel
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates Cancel
transaction.
NOTE: You can create an instance of Cancel
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.cancel.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.xcancelxx({...})
, please change it to caver.transaction.cancel.create({...})
.
properties
Name | Type | Description |
---|---|---|
from | string | The address of the sender. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
signatures | Array | (optional) An array of signatures. |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
ChainDataAnchoring
ChainDataAnchoring
represents a chain data anchoring transaction. The transactionObject
can have properties below to create a ChainDataAnchoring
transaction.
ChainDataAnchoring
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates ChainDataAnchoring
transaction.
NOTE: You can create an instance of ChainDataAnchoring
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.chainDataAnchoring.create
is supported since caver-js v1.6.1.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.chainDataAnchoring({...})
, please change it to caver.transaction.chainDataAnchoring.create({...})
.
properties
Name | Type | Description |
---|---|---|
from | string | The address of the sender. |
input | string | Data of the service chain. |
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
signatures | Array | (optional) An array of signatures. |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
Example
EthereumAccessList
EthereumAccessList
represents an Ethereum access list transaction. A Klaytn account can execute a EthereumAccessList
only with AccountKeyLegacy. The transactionObject
can have properties below to create a EthereumAccessList
.
EthereumAccessList
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates EthereumAccessList
.
NOTE: You can create an instance of EthereumAccessList
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.ethereumAccessList
is supported since caver-js v1.8.0.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.ethereumAccessList({...})
, please change it to caver.transaction.ethereumAccessList.create({...})
.
properties
Name | Type | Description |
---|---|---|
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
value | string | (optional, default: |
from | string | (optional) The address of the sender. If omitted, the keyring address used for signing will be set. |
to | string | (optional, default: |
input | string | (optional) Data attached to the transaction, used for smart contract deployment/execution. |
signatures | Array | (optional) An array of signatures. An ethereum access list transaction can have only one signature. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, |
gasPrice | string | (optional) A multiplier to get how much the sender will pay in tokens. If omitted, |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, |
accessList | Array | (optional) As an EIP-2930 access list that contains all storage slots and addresses read and written by the transaction. |
Example
EthereumDynamicFee
EthereumDynamicFee
represents an Ethereum dynamic fee transaction. A Klaytn account can execute a EthereumDynamicFee
only with AccountKeyLegacy. The transactionObject
can have properties below to create a EthereumDynamicFee
.
EthereumDynamicFee
has the properties below as its member variables. Properties marked as optional
refer to properties that can be optionally given in transactionObject
when the user creates EthereumDynamicFee
. And note that EthereumDynamicFee
does not use gasPrice
, it uses maxPriorityFeePerGas
and maxFeePerGas
.
NOTE: You can create an instance of EthereumDynamicFee
from RLP-encoded strings. Please refer to the below example. NOTE: caver.transaction.ethereumDynamicFee
is supported since caver-js v1.8.0.
NOTE: As of caver-js v1.8.1-rc.4, creating transactions is only supported using the create
function. If you've been creating transactions using a constructor like new caver.transaction.ethereumDynamicFee({...})
, please change it to caver.transaction.ethereumDynamicFee.create({...})
.
properties
Name | Type | Description |
---|---|---|
gas | string | The maximum amount of transaction fee the transaction is allowed to use. |
value | string | (optional, default: |
from | string | (optional) The address of the sender. If omitted, it will be set to the keyring address used for signing. |
to | string | (optional, default: |
input | string | (optional) Data attached to the transaction, used for smart contract deployment/execution. |
signatures | Array | (optional) An array of signatures. An ethereum dynamic fee transaction can have only one signature. |
nonce | string | (optional) A value used to uniquely identify a sender’s transaction. If omitted, it will be set to |
maxPriorityFeePerGas | string | (optional) Gas tip cap for the transaction in peb. Since Klaytn has a fixed gas price, it should be set to the same value as |
maxFeePerGas | string | (optional) A maximum amount to pay for the transaction to execute. Since Klaytn has a fixed gas price, it should be set to the same value as |
chainId | string | (optional) The chain id of the Klaytn network. If omitted, it will be set to |
accessList | Array | (optional) As an EIP-2930 access list that contains all storage slots and addresses read and written by the transaction. |
Example
Last updated