POSTklay_getTransactionByBlockNumberAndIndex

Returns transaction information in a block by block number and transaction index.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

Enter the following parameters as an array with the appropriate types.

  1. block number or block tag: Enter the block number to query as a hexadecimal string. You may also use block tags such as "earliest", "latest", "pending".
  2. transaction index: Enter the transaction index as a hexadecimal string.
params[0]string

Use one of block number or block tag to specify the block.

  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
params[1]string

Use one of block number or block tag to specify the block.

  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
Responses
blockHashstring

Hash of the block containing this transaction. Null for pending transactions

blockNumberstring

Block number containing this transaction (hex). Null for pending transactions

fromstring

Sender address of the transaction

gasstring

Gas limit set for the transaction (hex)

gasPricestring

Gas price (hex, in peb)

hashstring

Transaction hash

inputstring

Transaction input data (hex)

noncestring

Number of transactions sent by the sender prior to this one (hex)

tostring

Recipient address. Null for contract creation transactions

transactionIndexstring

Transaction position index within the block (hex). Null for pending transactions

valuestring

Amount of KAIA transferred (hex, in peb)

typestring

Transaction type (hex string)

typeIntinteger

Transaction type as integer

Vstring

ECDSA signature v value (hex)

Rstring

ECDSA signature r value (hex)

Sstring

ECDSA signature s value (hex)

chainIdstring

Chain ID of the network this transaction belongs to (hex)

X-API-KEY
RequestCU13
cURL
curl -X POST "https://kaia-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "klay_getTransactionByBlockNumberAndIndex",
  "params": [
    "0x1076B5A",
    "0x0"
  ]
}'
Response
Example · 200
{
  "blockHash": "string",
  "blockNumber": "string",
  "from": "string",
  "gas": "string",
  "gasPrice": "string",
  "hash": "string",
  "input": "string",
  "nonce": "string",
  "to": "string",
  "transactionIndex": "string",
  "value": "string",
  "type": "string",
  "typeInt": 0,
  "signatures": [
    {
      "V": "string",
      "R": "string",
      "S": "string"
    }
  ],
  "chainId": "string"
}