KlaytnScope 처럼 특정 Smart Contract (not token) 로부터 발생한 Transaction 목록을
Caver SDK를 사용해서 조회하려 합니다.
baobab network , contract address: 0xC9266Ce5B2A94cDF00F496F555299554D20d4AAd
KlaytnScope에서 조회하면 아래와 같이 표시가 되는데요…
caver.rpc.klay.getLogs({
fromBlock: '0x1',
toBlock: 'latest',
address: '0xC9266Ce5B2A94cDF00F496F555299554D20d4AAd'
}).then(console.dir);
이렇게 조회를 해 보면
[
///// 1. contract deploy 트랜잭션
{
"address": "0xc9266ce5b2a94cdf00f496f555299554d20d4aad",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000002214bac5f641b8a1c8a1942700de64474212b5d1"
],
"data": "0x",
"blockNumber": "0x53ae302",
"transactionHash": "0xcb8742468a2521f4e6200a394c250fa144d8e2d65c97085679a22f323c5e2676",
"transactionIndex": "0x0",
"blockHash": "0x8d9a009accddc53fe96068e00f5b81e91af97925d1b5b06a52e915adbe6f34b5",
"logIndex": "0x0",
"removed": false
},
///// 2. Token Transfer (Fee delegation smart contract execution) 트랜잭션
{
"address": "0xc9266ce5b2a94cdf00f496f555299554d20d4aad",
"topics": [
"0x2d5f146ab2c469cb0e00f3f4d4a026f6781b3bfdd56c243e705a39ce677e6de1"
],
"data": "0x00000000000000000000000043a8b43952ca406f5b8964a56341d9c9ead6b0f500000000000000000000000000000000000000000000000098a7d9b8314c0000000000000000000000000000000000000000000000000000000000000001adb000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000574656d7031000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x53afdb1",
"transactionHash": "0x3ddf32731b5889a83d9bf5ca4f835b9794121f471aa45e8961c512de2cb19cb6",
"transactionIndex": "0x0",
"blockHash": "0x33a2fa642f7c0c44d7da0acd7b23beb49d029e89e68a05ba354e19ace3a4f0e3",
"logIndex": "0x2",
"removed": false
},
///// 3. Token Transfer (smart contract execution) 트랜잭션
{
"address": "0xc9266ce5b2a94cdf00f496f555299554d20d4aad",
"topics": [
"0x98ca1009a398fdb2850b974de81a7679fa337f45b03d469a8a091a965496914a"
],
"data": "0x00000000000000000000000043a8b43952ca406f5b8964a56341d9c9ead6b0f500000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000574656d7031000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x53afe7c",
"transactionHash": "0xeb2dc26b1a3d7f2440811d8d25249464f9617cffc2f197a6927714679d72bd6a",
"transactionIndex": "0x1",
"blockHash": "0x9373533aa0ec4f380131639aff1da498e8aceecb5646d6ee3338a9d7ba6e0564",
"logIndex": "0x3",
"removed": false
}
]
위의 3개만 조회가 됩니다. 다른 트랜잭션들도 조회하려면 어떤 방법이 있을까요?