Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

support get_blockReceipts API #605

Merged
merged 2 commits into from
Dec 11, 2020
Merged

support get_blockReceipts API #605

merged 2 commits into from
Dec 11, 2020

Conversation

cow-hs
Copy link
Contributor

@cow-hs cow-hs commented Dec 10, 2020

We support API to get block receipts at once. (API V3)

reference API Klaytn getBlockReceipts

Example

// Request 1 - get last block receipts
{
    "jsonrpc": "2.0",
    "method": "icx_getBlockReceipts",
    "id": 1234
}

// Request 2 - get block receipts by hash
{
    "jsonrpc": "2.0",
    "method": "icx_getBlockReceipts",
    "id": 1234,
    "params": {
        "hash": "0x6d4a4dbb950152050684eef5d0e228b8a31cae7afd37d9760b79312305008977"
    }
}

// Request 3 - get block receipts by height
{
    "jsonrpc": "2.0",
    "method": "icx_getBlockReceipts",
    "id": 1234,
    "params": {
        "height": "0x4"
    }
}

// Response - success
{
    "jsonrpc": "2.0",
    "result": [
		{
			"txHash": "4b9afccf0ce595fc67fd84959d8ff3107aad2e78ea418d8e115d39dbb5ddf683",
			"blockHeight": "0x696",
			"blockHash": "59415879e59977ac29bfa5dcfff3dfff2604beb0f1ba97d1944caf90b39d4c49",
			"txIndex": "0x0",
			"to": "hxe3d6d5d8e433fbd13b9c481d11cf46cebd84b23c",
			"stepUsed": "0x0",
			"stepPrice": "0x0",
			"cumulativeStepUsed": "0x0",
			"eventLogs": [
				{
					"scoreAddress": "cx0000000000000000000000000000000000000000",
					"indexed": [
						"PRepIssued(int,int,int,int)"
					],
					"data": [
						"0xa968163f0a57b400000",
						"0x477",
						"0xd3e02419de2130fd07fe4",
						"0x20bd5ed6b99b1fcb"
					]
				},
				{
					"scoreAddress": "cx0000000000000000000000000000000000000000",
					"indexed": [
						"ICXIssued(int,int,int,int)"
					],
					"data": [
						"0x0",
						"0x20bd5ed6b99b1fcb",
						"0x0",
						"0x53a06a5e791a89dbe"
					]
				}
			],
			"status": "0x1"
		}
	],
  "id": 1234
}

@cow-hs cow-hs requested a review from yakkle December 10, 2020 06:22
@cow-hs cow-hs self-assigned this Dec 10, 2020
@yakkle yakkle changed the base branch from release/2.7.0 to develop December 11, 2020 07:34
@yakkle
Copy link
Member

yakkle commented Dec 11, 2020

Is this different with get_receipt_proof?

@cow-hs
Copy link
Contributor Author

cow-hs commented Dec 11, 2020

This method is a function that can search icx_getTransactionResult in block units.

@cow-hs cow-hs merged commit ddaddbb into develop Dec 11, 2020
@cow-hs cow-hs deleted the append_icx_getBlockReceipts branch December 11, 2020 11:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants