[Transaction] klay_signTransactionAsFeePayer
Constructs a transaction with given parameters and signs the transaction with a fee payer's private key. This method can be used either to generate a fee payer signature or to make a final raw transaction that is ready to submit to Klaytn network. In case you just want to extract the fee-payer signature, simply take the feePayerSignatures from the result. Note that the raw transaction is not final if the sender's signature is not attached (that is, signatures in tx is empty).
klay_signTransactionAsFeePayer
will be failed to baobab/cypress network because it is signed in the EN node, which means that the EN must have the key that you want to sign with.
Steps to test klay_signTransactionAsFeePayer
.
- Step 1: Setup a local EN node
- Step 2: Create an account into the EN node
- Step 3: Unlock the account for using in signing
JSONRPC: klay_signTransactionAsFeePayer
Request
- application/json
Body
Array [
- TxTypeLegacyTransaction
- TxTypeValueTransfer
- TxTypeFeeDelegatedValueTransfer
- TxTypeFeeDelegatedValueTransferWithRatio
- TxTypeValueTransferMemo
- TxTypeFeeDelegatedValueTransferMemo
- TxTypeFeeDelegatedValueTransferMemoWithRatio
- TxTypeAccountUpdate
- TxTypeFeeDelegatedAccountUpdate
- TxTypeFeeDelegatedAccountUpdateWithRatio
- TxTypeSmartContractDeploy
- TxTypeFeeDelegatedSmartContractDeploy
- TxTypeFeeDelegatedSmartContractDeployWithRatio
- TxTypeSmartContractExecution
- TxTypeFeeDelegatedSmartContractExecution
- TxTypeFeeDelegatedSmartContractExecutionWithRatio
- TxTypeCancel
- TxTypeFeeDelegatedCancel
- TxTypeFeeDelegatedCancelWithRatio
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
]
Default value: klay_signTransactionAsFeePayer
Method name
Default value: 1
Request ID, Random or Auto incrementation
Default value: 2.0
JSON-RPC Version (2.0)
params
object[]
required
oneOf
The address from which the transaction is sent.
(optional when creating a new contract) The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
(optional) Integer of the value sent with this transaction.
The compiled byte code of a contract to deploy or data (function indicator and parameter values) required to call a contract.
(optional) Integer of a nonce.
The integer indicating TxTypeValueTransfer 8
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The integer indicating TxTypeFeeDelegatedValueTransfer 9
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The address which pays the transaction fee.
signatures
object[]
(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
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The fee payer address of the transaction.
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
object[]
(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 TxTypeValueTransferMemo 16
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice. The transaction fee is calculated by the multiplication of gas and gasPrice.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The integer indicating TxTypeFeeDelegatedValueTransferMemo 17
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The fee payer address of the transaction.
signatures
object[]
(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
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The fee payer address of the transaction.
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
object[]
(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 TxTypeAccountUpdate 32
The address from which the transaction is sent.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
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
The address from which the transaction is sent.
(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.
(optional, default 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
The new account key of the from account in RLP encoded format. For more information about the account key, see Account Key.
The fee payer address of the transaction.
signatures
object[]
(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
The address from which the transaction is sent.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
The new account key of the from account in RLP encoded format. For more information about the account key, see Account Key.
The fee payer address of the transaction.
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
object[]
(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 TxTypeSmartContractDeploy: 40
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
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.
The code format of smart contract code. The value 0 indicates EVM.
The integer indicating TxTypeFeeDelegatedSmartContractDeploy: 41
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
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.
The code format of smart contract code. The value 0 indicates EVM.
The fee payer address of the transaction.
signatures
object[]
(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
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
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.
The code format of smart contract code. The value 0 indicates EVM.
The fee payer address of the transaction.
signatures
object[]
(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.
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.
The integer indicating TxTypeSmartContractExecution: 48
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The integer indicating TxTypeFeeDelegatedSmartContractExecution: 49
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The fee payer address of the transaction.
signatures
object[]
(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
The address from which the transaction is sent.
The address to which the transaction is directed.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
Integer of the value sent with this transaction.
The data sent along with the transaction.
The fee payer address of the transaction.
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
object[]
(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 TxTypeCancel: 56
The address from which the transaction is sent.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
The integer indicating TxTypeFeeDelegatedCancel: 57
The address from which the transaction is sent.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
The fee payer address of the transaction.
signatures
object[]
(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
The address from which the transaction is sent.
(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.
(optional, default: 25000000000 Peb) Integer of the gasPrice used for each paid gas.
(optional) Integer of a nonce.
The fee payer address of the transaction.
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
object[]
(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.
Responses
- 200
Returns signed raw transaction and transaction object including the fee payer's signature
- application/json
- Schema
- Example (from schema)
Schema
Default value: 2.0
error
object
A Number that indicates the error type that occurred. This MUST be an integer.
| code | message | description | |-----|-----|-------| | -32700 | Parse error | invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. | |-32602 | Invalid params | Invalid method parameter(s). |
A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.
A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
result
object
Signed raw transaction
Transaction object including the fee payer's signature
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "Parse error",
"data": "string"
},
"result": {
"raw": "0xf86c0286025000000000840100000094cd6bfdb523a4d030890d28bf1eb6ef36307c9aaa8301000080820fe8a056d2ddd231c3c111687ab351d339240db18cd721e5aa33c601dd4fc3927fb4d1a03443443392517aa7da082aa0a00b9ee5e3e1ee007d22e57cd9ff55b5ddbf4a64",
"tx": {
"nonce": "0x2",
"gasPrice": "0x5d21dba00",
"gas": "0x1000000",
"to": "0xcd6bfdb523a4d030890d28bf1eb6ef36307c9aaa",
"value": "0x10000",
"input": "0x",
"v": "0xfe8",
"r": "0x56d2ddd231c3c111687ab351d339240db18cd721e5aa33c601dd4fc3927fb4d1",
"s": "0x3443443392517aa7da082aa0a00b9ee5e3e1ee007d22e57cd9ff55b5ddbf4a64",
"hash": "0xb53cc9128a19c3916c0de1914725b7337bba84666c2556d8682c72ca34c6874c"
}
}
}