Links

Transaction

call

caver.klay.call(callObject [, defaultBlock] [, callback])
메시지 호출 트랜잭션을 실행합니다. 이 트랜잭션은 노드의 Klaytn 가상머신에서 직접 실행되지만 블록체인에 기록되지 않습니다.
Parameters
Name
Type
Description
callObject
Object
호출 시 from 속성도 선택 사항인 트랜잭션 객체입니다. 인코딩된 함수 호출이 반드시 트랜잭션 객체의 데이터 필드에 주어져야 합니다.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
프로미스String을 반환합니다: 스마트 컨트랙트 함수 리턴값과 같이 호출의 결과로 리턴된 값입니다.
Example
> caver.klay.call({
to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", // contract address
data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003"
})
.then(console.log);
"0x000000000000000000000000000000000000000000000000000000000000000a"

estimateGas

caver.klay.estimateGas(callObject [, callback])
메세지 호출 혹은 트랜잭션을 실행하고 모의 호출/트랜잭션에 사용된 가스를 반환합니다.
Parameters
Name
Type
Description
callObject
Object
A transaction object with the difference that for calls the from property is optional as well. An encoded function call must be set in the data field of the transaction object.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
Promise returns Number - the used gas for the simulated call/transaction.
Example
> caver.klay.estimateGas({
to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe",
data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003"
})
.then(console.log);
40

estimateComputationCost

caver.klay.estimateComputationCost(callObject [, defaultBlock] [, callback])
Generates and returns an estimate of how much computation cost will be spent to execute the transaction. Klaytn limits the computation cost of a transaction to 100000000 currently not to take too much time by a single transaction. The transaction will not be added to the blockchain.
Parameters
Name
Type
Description
callObject
Object
A transaction object with the difference that for calls the from property is optional as well. An encoded function call must be set in the data field of the transaction object.
defaultBlock
Number | String
(optional) If you don't pass this parameter, the default block set by caver.klay.defaultBlock will be used.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
프로미스Number를 반환합니다 - 사용된 연산 비용(Computation Cost)의 양입니다.
Example
> caver.klay.estimateComputationCost({
to: '0xf796b2F18507Ec8F8C19e9F0c03092888093ebAc',
data : '0xd14e62b80000000000000000000000000000000000000000000000000000000000000022'
}).then(console.log);
0x5773
// With 'latest' block tag
> caver.klay.estimateComputationCost({
to: '0xf796b2F18507Ec8F8C19e9F0c03092888093ebAc',
data : '0xd14e62b80000000000000000000000000000000000000000000000000000000000000022'
}, 'latest').then(console.log);
0x5773

decodeTransaction

caver.klay.decodeTransaction(rawTransaction)
RLP-encoded 트랜잭션인 주어진 rawTransaction의 모든 값을 디코딩한 트랜잭션 객체를 반환합니다. 레거시 트랜잭션을 제외한 모든 트랜잭션 타입이 트랜잭션 발신자와 트랜잭션 수수료 납부자의 다중 서명을 가질 수 있으므로, 기존에 리턴된 v, r, s 필드들과 payerV, payerR, payerS는 발신자외 트랜잭션 수수료 납부자의 0번째 서명입니다.
참고 caver.klay.decodeTransaction는 v1.0.1-rc.8에서 지원됩니다. 이 기능을 사용하려면 v1.0.1-rc.8 또는 그 이상을 설치하세요.
참고 다중 서명을 지원하기 위해 signaturesfeePayerSignatures 속성이 caver-js v1.2.0-rc.3 부터 추가되었습니다.
Parameters
Name
Type
Description
rawTransaction
String
RLP 인코딩된 트랜잭션 데이터.
Return Value
Type
Description
Object
A transaction object. 반환되는 트랜잭션 객체가 가지는 속성은 트랜잭션 타입에 따라 다릅니다. 각 트랜잭션 타입의 속성은 SendTransaction을 참조하세요.
Example
// Basic Transaction
> caver.klay.decodeTransaction('0xf86b038505d21dba00843b9ac9ff94d03227635c90c7986f0e3a4e551cefbca8c5531685174876e8008026a06fc7412ad1801b4790e7a5a5097fdbef01bc9fe1b970d08232184d110226c221a04665f772edbc4ba4dfbf189d89a9b9cb1e5cdcea0fd5a8b1a497b9c275e5267c')
{
type: 'LEGACY',
nonce: '0x03',
gasPrice: '0x05d21dba00',
gas: '0x3b9ac9ff',
to: '0xd03227635c90c7986f0e3a4e551cefbca8c55316',
value: '0x174876e800',
data: '0x',
v: '0x26',
r: '0x6fc7412ad1801b4790e7a5a5097fdbef01bc9fe1b970d08232184d110226c221',
s: '0x4665f772edbc4ba4dfbf189d89a9b9cb1e5cdcea0fd5a8b1a497b9c275e5267c',
signatures: [
'0x26',
'0x6fc7412ad1801b4790e7a5a5097fdbef01bc9fe1b970d08232184d110226c221',
'0x4665f772edbc4ba4dfbf189d89a9b9cb1e5cdcea0fd5a8b1a497b9c275e5267c'
]
}
// Fee Delegation
> caver.klay.decodeTransaction('0x09f8dd2c8505d21dba00830dbba094a36960d00c9cbf10e80928eead73ff308193bde70194ad8d5b8c7da3746df7de39c41fa572d660aa8e91f847f845824e43a099c0a4c85bb9f2c0be2646b963201680e2f76128e4fd1f54d3f9cf80d1d117e7a069b62aa6640c8aa3606a67869fe062dde1c61a60aea5c5161550ff11ee71c24b946a4b71a6796c2fd376fb0526385e0783da86a039f847f845824e43a0bdfdc50649c8f52930a330b2e44d92f8943b28c7ff7edd8ff7f2f95e617c0d77a06e96bdd983494f6967f1a26d2f0ae991a4e8ebef1ac3c9029251a18c19002ab3')
{
type: 'FEE_DELEGATED_VALUE_TRANSFER',
nonce: '0x2c',
gasPrice: '0x05d21dba00',
gas: '0x0dbba0',
to: '0xa36960d00c9cbf10e80928eead73ff308193bde7',
value: '0x01',
from: '0xad8d5b8c7da3746df7de39c41fa572d660aa8e91',
v: '0x4e43',
r: '0x99c0a4c85bb9f2c0be2646b963201680e2f76128e4fd1f54d3f9cf80d1d117e7',
s: '0x69b62aa6640c8aa3606a67869fe062dde1c61a60aea5c5161550ff11ee71c24b',
signatures: [
[
'0x4e43',
'0x99c0a4c85bb9f2c0be2646b963201680e2f76128e4fd1f54d3f9cf80d1d117e7',
'0x69b62aa6640c8aa3606a67869fe062dde1c61a60aea5c5161550ff11ee71c24b'
]
],
feePayer: '0x6a4b71a6796c2fd376fb0526385e0783da86a039',
payerV: '0x4e43',
payerR: '0xbdfdc50649c8f52930a330b2e44d92f8943b28c7ff7edd8ff7f2f95e617c0d77',
payerS: '0x6e96bdd983494f6967f1a26d2f0ae991a4e8ebef1ac3c9029251a18c19002ab3',
feePayerSignatures: [
[
'0x4e43',
'0xbdfdc50649c8f52930a330b2e44d92f8943b28c7ff7edd8ff7f2f95e617c0d77',
'0x6e96bdd983494f6967f1a26d2f0ae991a4e8ebef1ac3c9029251a18c19002ab3'
]
]
}
// Partial Fee Delegation
> caver.klay.decodeTransaction('0x2af902ca0a8505d21dba00843b9ac9ff80809490b3e9a3770481345a7f17f22f16d020bccfd33eb901fe608060405234801561001057600080fd5b506101de806100206000396000f3006080604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a39d8ef81146100805780636353586b146100a757806370a08231146100ca578063fd6b7ef8146100f8575b3360009081526001602052604081208054349081019091558154019055005b34801561008c57600080fd5b5061009561010d565b60408051918252519081900360200190f35b6100c873ffffffffffffffffffffffffffffffffffffffff60043516610113565b005b3480156100d657600080fd5b5061009573ffffffffffffffffffffffffffffffffffffffff60043516610147565b34801561010457600080fd5b506100c8610159565b60005481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604081208054349081019091558154019055565b60016020526000908152604090205481565b336000908152600160205260408120805490829055908111156101af57604051339082156108fc029083906000818181858888f193505050501561019c576101af565b3360009081526001602052604090208190555b505600a165627a7a72305820627ca46bb09478a015762806cc00c431230501118c7c26c30ac58c4e09e51c4f0029802180f845f84325a0d8cdc1219df8bbca8a00255420a5bec0f602e6266b76ce7dcf5b0b26bd7fe3b9a05557496a3a17f784c3eb40acbb526dfbc20ae6b00c633a0186d804cd9137b13e9433f524631e573329a550296f595c820d6c65213ff845f84325a041a4c4bf0e3039d04472beae4135a14c26ae4c88bad08d5f0acf61f7c0eb60dfa03d1658f38e5c2089d64985fb33cb13db2e41cde6958ba2cfcfaba685a7f565e2')
{
type: 'FEE_DELEGATED_SMART_CONTRACT_DEPLOY_WITH_RATIO',
nonce: '0x0a',
gasPrice: '0x05d21dba00',
gas: '0x3b9ac9ff',
to: '0x',
value: '0x',
from: '0x90b3e9a3770481345a7f17f22f16d020bccfd33e',
data: '0x608060405234801561001057600080fd5b506101de806100206000396000f3006080604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a39d8ef81146100805780636353586b146100a757806370a08231146100ca578063fd6b7ef8146100f8575b3360009081526001602052604081208054349081019091558154019055005b34801561008c57600080fd5b5061009561010d565b60408051918252519081900360200190f35b6100c873ffffffffffffffffffffffffffffffffffffffff60043516610113565b005b3480156100d657600080fd5b5061009573ffffffffffffffffffffffffffffffffffffffff60043516610147565b34801561010457600080fd5b506100c8610159565b60005481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604081208054349081019091558154019055565b60016020526000908152604090205481565b336000908152600160205260408120805490829055908111156101af57604051339082156108fc029083906000818181858888f193505050501561019c576101af565b3360009081526001602052604090208190555b505600a165627a7a72305820627ca46bb09478a015762806cc00c431230501118c7c26c30ac58c4e09e51c4f0029',
humanReadable: false,
feeRatio: '0x21',
codeFormat: '0x',
v: '0x25',
r: '0xd8cdc1219df8bbca8a00255420a5bec0f602e6266b76ce7dcf5b0b26bd7fe3b9',
s: '0x5557496a3a17f784c3eb40acbb526dfbc20ae6b00c633a0186d804cd9137b13e',
signatures: [
[
'0x25',
'0xd8cdc1219df8bbca8a00255420a5bec0f602e6266b76ce7dcf5b0b26bd7fe3b9',
'0x5557496a3a17f784c3eb40acbb526dfbc20ae6b00c633a0186d804cd9137b13e'
]
],
feePayer: '0x33f524631e573329a550296f595c820d6c65213f',
payerV: '0x25',
payerR: '0x41a4c4bf0e3039d04472beae4135a14c26ae4c88bad08d5f0acf61f7c0eb60df',
payerS: '0x3d1658f38e5c2089d64985fb33cb13db2e41cde6958ba2cfcfaba685a7f565e2',
feePayerSignatures: [
[
'0x25',
'0x41a4c4bf0e3039d04472beae4135a14c26ae4c88bad08d5f0acf61f7c0eb60df',
'0x3d1658f38e5c2089d64985fb33cb13db2e41cde6958ba2cfcfaba685a7f565e2'
]
]
}

getTransaction

caver.klay.getTransaction(transactionHash [, callback])
주어진 트랜잭션 해시에 대응하는 트랜잭션을 반환합니다.
Parameters
Name
Type
Description
transactionHash
String
트랜잭션 해시.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
프로미스객체를 반환합니다 - 트랜잭션 객체를 반환하거나 또는 해당하는 트랜잭션을 찾을 수 없는 경우 null을 반환합니다.
Name
Type
Description
blockHash
32-byte DATA
Hash of the block where this transaction was in. null when it is pending.
blockNumber
QUANTITY
Block number where this transaction was in. null when it is pending.
codeFormat
String
(optional) The code format of smart contract code.
feePayer
20-byte DATA
(optional) Address of the fee payer.
feePayerSignatures
Array
(optional) An array of fee payer's 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.
feeRatio
QUANTITY
(optional) 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.
from
20-byte DATA
Address of the sender.
gas
QUANTITY
Gas provided by the sender.
gasPrice
QUANTITY
Gas price provided by the sender in peb.
hash
32-byte DATA
Hash of the transaction.
humanReadable
Boolean
(optional) true if the address is humanReadable, false if the address is not humanReadable.
key
String
(optional) Key of the newly created account.
input
DATA
(optional) The data sent along with the transaction.
nonce
QUANTITY
The number of transactions made by the sender prior to this one.
senderTxHash
32-byte DATA
(optional) Hash of the tx without the fee payer's address and signature. 이 값은 수수료를 위임하지 않은 트랜잭션의 hash 값과 항상 동일합니다.
signatures
Array
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.
to
20-byte DATA
Address of the receiver. null when it is a contract creation transaction.
transactionIndex
QUANTITY
Integer of the transaction index position in the block. null when it is pending.
type
String
A string representing the type of the transaction.
typeInt
QUANTITY
An integer representing the type of the transaction.
value
QUANTITY
Value transferred in peb.
Example
> caver.klay.getTransaction('0x2d26f602cfbb4c662931592bf2c4ee18d29f09683be5b9e8d589ff935fca0b97')
.then(console.log);
{
blockHash: '0xd6f3bc2bd7853ed423677766b5332c3e55d900abf4252ede196661cd58e817a6',
blockNumber: 141766,
from: '0x8948Ab8526fDA9a7349Ee8FCa5372e46d0268777',
gas: 20000000,
gasPrice: '25000000000',
hash: '0x2d26f602cfbb4c662931592bf2c4ee18d29f09683be5b9e8d589ff935fca0b97',
input: '0x',
nonce: 8,
signatures:[{
V: '0xfe9',
R: '0x76a0ac07a371fe3849f46a115d62830e611e62fab91714bb66fe18a937557666',
S: '0x1daace52366434ab11287d4f5ebe9c87f314e45d13f05093bbcdd5862fcf462e'
}],
to: '0x2259cFDae62F9853f84298aAf20C999391B1c6a3',
transactionIndex: 0,
type: 'TxTypeLegacyTransaction',
typeInt: 0,
value: '1'
}

getTransactionBySenderTxHash

caver.klay.getTransactionBySenderTxHash(senderTxHash [, callback])
주어진 senderTxHash에 대응하는 트랜잭션의 정보를 반환합니다. 이 API는 --sendertxhashindexing에 의해 인덱싱 기능이 노드에서 활성화되어 있을 때만 올바른 결과를 반환합니다. isSenderTxHashIndexingEnabled을 사용해 인덱싱 기능이 활성화되었는지 아닌지를 확인합니다.
Parameters
Name
Type
Description
senderTxHash
String
Hash of a transaction that is signed only by the sender. 이에 대한 자세한 내용은 SenderTxHash를 참고하세요.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
Promise returns Object - A transaction object, or null when no transaction was found:
Name
Type
Description
blockHash
32-byte DATA
Hash of the block where this transaction was in. null when it is pending.
blockNumber
QUANTITY
Block number where this transaction was in. null when it is pending.
codeFormat
String
(optional) The code format of smart contract code.
feePayer
20-byte DATA
Address of the fee payer.
feePayerSignatures
Array
An array of fee payer's 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.
feeRatio
QUANTITY
(optional) 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.
from
20-byte DATA
Address of the sender.
gas
QUANTITY
Gas provided by the sender.
gasPrice
QUANTITY
Gas price provided by the sender in peb.
hash
32-byte DATA
Hash of the transaction.
humanReadable
Boolean
(optional) true if the address is humanReadable, false if the address is not humanReadable.
key
String
(optional) Key of the newly created account.
input
DATA
(optional) The data sent along with the transaction.
nonce
QUANTITY
The number of transactions made by the sender prior to this one.
senderTxHash
32-byte DATA
Hash of a transaction that is signed only by the sender. See SenderTxHash. This value is always the same as hash for non fee-delegated transactions.
signatures
Array
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.
to
20-byte DATA
Address of the receiver. null when it is a contract creation transaction.
transactionIndex
QUANTITY
Integer of the transaction index position in the block. null when it is pending.
type
String
A string representing the type of the transaction.
typeInt
QUANTITY
An integer representing the type of the transaction.
value
QUANTITY
Value transferred in peb.
Example
> caver.klay.getTransactionBySenderTxHash('0x8c0b092fed92a6619666efd582f7d71fbc3d784781072dd26741715b3731ab22').then(console.log);
{
blockHash: '0x56e950bd9283c11ad2dab7cfcbacd9164aff2f6cbeb99dd2a7b754eb210753af',
blockNumber: 773,
codeFormat: '0x0',
feePayer: '0xabae1fe62aebbfabeff072eb815d54c3359a45f4',
feePayerSignatures: [
{
V: '0x4e43',
R: '0x16293eefe0f13228ae47af67ecfe659448d8f80d9667a67a25d82c72b5ee246a',
S: '0x3c4043324bee41a6cbab905d3b4e740a3a18fde021260fc1196f73d2ab037b91' } ],
feeRatio: '0x14',
from: '0x3F0E31836C7AABb4C9e9B19d5D61359a9139E949',
gas: 900000,
gasPrice: '25000000000',
hash: '0x2ab7665d25f8f64969fa03b8d5e40a70485bb56a4e72ca2fe1e467fff904c173',
humanReadable: false,
input: '0x6080604052600080556040516020806101fa8339810180604052810190808051906020019092919050505080600081905550506101b9806100416000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306661abd1461006757806342cbb15c14610092578063a87d942c146100bd578063d14e62b8146100e8575b600080fd5b34801561007357600080fd5b5061007c610108565b6040518082815260200191505060405180910390f35b34801561009e57600080fd5b506100a761010e565b6040518082815260200191505060405180910390f35b3480156100c957600080fd5b506100d2610116565b6040518082815260200191505060405180910390f35b6101066004803603810190808035906020019092919050505061014c565b005b60005481565b600043905090565b60007f7197668b8690d2324050bc9ad83b2b5ca0b3f5336cb178ffa2aa07006b51b65160405160405180910390a1600054905090565b7fe8451a9161f9159bc887328b634789768bd596360ef07c5a5cbfb927c44051f9816040518082815260200191505060405180910390a180600081905550505600a165627a7a723058203cb41ebe3d7128a72c997645693c64789a9b5fdeae26158fb28b55e567e805c700290000000000000000000000000000000000000000000000000000000000000001',
nonce: 9,
senderTxHash: '0x8c0b092fed92a6619666efd582f7d71fbc3d784781072dd26741715b3731ab22',
signatures: [
{
V: '0x4e43',
R: '0x1b48ee0508d242c9568d7e09212d62137080d68d86c1d067b31b4bb4196c9960',
S: '0x24982f60b37859d7c39d7bd9c00b446196b3a08b27f80dbc9ceca8ee52513b11'
}
],
to: null,
transactionIndex: 0,
type: 'TxTypeFeeDelegatedSmartContractDeployWithRatio',
typeInt: 42,
value: '1'
}

getTransactionFromBlock

caver.klay.getTransactionFromBlock(hashStringOrNumber, indexNumber [, callback])
블록 해시 또는 블록 넘버, 그리고 트랜잭션 인덱스 위치를 통해 트랜잭션을 반환합니다.
Parameters
Name
Type
Description
hashStringOrNumber
String
블록 번호 또는 해시. Or the string "genesis" or "latest".
indexNumber
Number
트랜잭션의 인덱스 위치의 정숫값입니다.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
객체 - 트랜잭션 객체를 반환하며 자세한 내용은 caver.klay.getTransaction를 참고하십시오.
Examples
> caver.klay.getTransactionFromBlock('0x4534534534', 2).then(console.log);
// see caver.klay.getTransaction

getTransactionReceipt

caver.klay.getTransactionReceipt(transactionHash [, callback])
Returns the receipt of a transaction by transaction hash.
Parameters
Name
Type
Description
transactionHash
String
The transaction hash
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
프로미스Object를 반환합니다 - 트랜잭션 영수증 객체를 반환하거나 영수증을 찾을 수 없는 경우 null을 반환합니다.
Name
Type
Description
blockHash
32-byte String
Hash of the block where this transaction was in.
blockNumber
Number
Block number where this transaction was in.
codeFormat
String
(optional) The code format of smart contract code.
contractAddress
DATA
The contract address created, if the transaction was a contract creation, otherwise null.
feePayer
20-byte DATA
(optional) Address of the fee payer.
feePayerSignatures
Array
(optional) An array of fee payer's 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.
feeRatio
QUANTITY
(optional) 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.
from
20-byte DATA
Address of the sender.
gas
QUANTITY
Gas provided by the sender.
gasPrice
QUANTITY
Gas price provided by the sender in peb.
gasUsed
QUANTITY
The amount of gas used by this specific transaction alone.
humanReadable
Boolean
(optional) true if the address is humanReadable, false if the address is not humanReadable.
key
String
(optional) Key of the newly created account.
input
DATA
(optional) The data sent along with the transaction.
logs
Array
Array of log objects, which this transaction generated.
logsBloom
256-byte DATA
Bloom filter for light clients to quickly retrieve related logs.
nonce
QUANTITY
The number of transactions made by the sender prior to this one.
senderTxHash
32-byte DATA
(선택사항) 발신자만 서명한 트랜잭션 해시. See SenderTxHash. 이 값은 수수료를 위임하지 않은 트랜잭션의 transactionHash 값과 항상 동일합니다.
signatures
Array
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.
status
Boolean
트랜잭션이 성공적으로 실행되면 true를 반환하며, 만약 Klaytn 가상머신이 트랜잭션을 거부하면 false를 반환합니다.
txError
QUANTITY
(optional) detailed error code if status is equal to zero.
to
20-byte DATA
Address of the receiver. null when it is a contract creation transaction.
transactionHash
32-byte DATA
Hash of the transaction.
transactionIndex
QUANTITY
Integer of the transaction index position in the block.
type
String
A string representing the type of the transaction.
typeInt
QUANTITY
An integer representing the type of the transaction.
value
QUANTITY
Value transferred in peb.
Example
> caver.klay.getTransactionReceipt('0x9108f22693de7b16ece4db2c8d11c004feae31973acc2ecb9dbd61cd57bb0d7b')
.then(console.log);
{
blockHash: '0x62f0b4e4d2c0fdeda968bf82688a6b4426fb0b75c83ebd39a04633e087060f00',
blockNumber: 140949,
contractAddress: null,
from: '0x8948ab8526fda9a7349ee8fca5372e46d0268777',
gas: '0x1312d00',
gasPrice: '0x5d21dba00',
gasUsed: 21000,
input: '0x',
logs: [],
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
nonce: '0x6',
signatures: [{
V:'0xfe9',
R:'0x95e5fc90a27b4a364f4047072474147fb8885213acbc4ac89902da28ddea3931',
S:'0xeebe7d37c047f6a7b841da5c6ff2849eb6f99b689666da30f48b60a12028e59'
}],
status: true,
to: '0x2259cfdae62f9853f84298aaf20c999391b1c6a3',
transactionHash: '0x9108f22693de7b16ece4db2c8d11c004feae31973acc2ecb9dbd61cd57bb0d7b',
transactionIndex: 0,
type: 'TxTypeLegacyTransaction',
typeInt: 0,
value: '0x1'
}

getTransactionReceiptBySenderTxHash

caver.klay.getTransactionReceiptBySenderTxHash(senderTxHash [, callback])
주어진 senderTxHash에 대응하는 트랜잭션의 영수증를 반환합니다.
NOTE: The receipt is not available for pending transactions. Please note that this API returns correct result only if the indexing feature is enabled in the node by --sendertxhashindexing. isSenderTxHashIndexingEnabled를 호출하여 인덱싱 기능이 활성화되어 있는지 확인할 수 있습니다.
Parameters
Name
Type
Description
senderTxHash
String
Hash of a transaction that is signed only by the sender. See SenderTxHash.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Return Value
Promise returns Object - A transaction receipt object, or null when no receipt was found:
Name
Type
Description
blockHash
32-byte String
Hash of the block where this transaction was in.
blockNumber
Number
Block number where this transaction was in.
codeFormat
String
(optional) The code format of smart contract code.
contractAddress
DATA
The contract address created, if the transaction was a contract creation, otherwise null.
feePayer
20-byte DATA
Address of the fee payer.
feePayerSignatures
Array
An array of fee payer's 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.
feeRatio
QUANTITY
(optional) 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.
from
20-byte DATA
Address of the sender.
gas
QUANTITY
Gas provided by the sender.
gasPrice
QUANTITY
Gas price provided by the sender in peb.
gasUsed
QUANTITY
The amount of gas used by this specific transaction alone.
humanReadable
Boolean
(optional) true if the address is humanReadable, false if the address is not humanReadable.
key
String
(optional) Key of the newly created account.
input
DATA
(optional) The data sent along with the transaction.
logs
Array
Array of log objects, which this transaction generated.
logsBloom
256-byte DATA
Bloom filter for light clients to quickly retrieve related logs.
nonce
QUANTITY
The number of transactions made by the sender prior to this one.
senderTxHash
32-byte DATA
Hash of a transaction that is signed only by the sender. See SenderTxHash. This value is always the same as transactionHash for non fee-delegated transactions.
signatures
Array
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.
status
Boolean
true if the transaction was successful, false if the Klaytn Virtual Machine reverted the transaction.
txError
QUANTITY
(optional) detailed error code if status is equal to zero.
to
20-byte DATA
Address of the receiver. null when it is a contract creation transaction.
transactionHash
32-byte DATA
Hash of the transaction.
transactionIndex
QUANTITY
Integer of the transaction index position in the block.
type
String
A string representing the type of the transaction.
<