WatchData Documentation
  • πŸ“–Welcome to WatchData Docs
    • 🧩Features
      • ⛓️Blockchain API
      • ⚑Powered API
      • πŸͺ™Price API
    • πŸ’ΌWhat products are suitable for our solutions
  • πŸ‘‹Introduction
    • πŸ› οΈQuick start guide to WatchData!
    • πŸ€”Why Use WatchData?
    • πŸ’‘Supported chains
    • πŸ›‘Error Reference
    • πŸ—οΈChange Log (update)
  • πŸ’ŽPowered API
    • πŸ”€Transfers
      • watch_getTransfers
      • watch_getTransfersByAddress
    • πŸ’ Parity
      • parity_getBlockReceipts
    • πŸŒ€Trace
      • trace_transaction
      • trace_block
    • ⏹️Blocks
      • watch_getBlockNumberByTimestamp
    • *️⃣Token API
      • watch_getTokenBalances
      • πŸ†•watch_getTokenMetadata
    • πŸ†’Stats
      • watch_getStatsByDay
  • πŸ•ΈοΈBlockchain API's
    • Ethereum API
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getTransactionCount
      • eth_getTransactionByHash
      • eth_getTransactionReceipt
      • eth_getBlockTransactionCountByHash
      • eth_getBlockTransactionCountByNumber
      • eth_getTransactionByBlockHashAndIndex
      • eth_getTransactionByBlockNumberAndIndex
      • eth_getUncleCountByBlockHash
      • eth_getUncleCountByBlockNumber
      • eth_getLogs
      • eth_call
      • eth_chainId
      • eth_estimateGas
      • eth_gasPrice
      • eth_getBalance
      • eth_getCode
      • net_version
      • eth_getStorageAt
      • eth_sendRawTransaction
      • eth_blockNumber
    • ♨️Polygon API
      • eth_blockNumber - Polygon
      • eth_getBlockByHash - Polygon
      • eth_getBlockByNumber - Polygon
      • eth_getTransactionByHash - Polygon
      • eth_getTransactionCount - Polygon
      • eth_getTransactionReceipt -Polygon
      • eth_getBlockTransactionCountByHash - Polygon
      • eth_getBlockTransactionCountByNumber - Polygon
      • eth_getTransactionByBlockHashAndIndex - Polygon
      • eth_getTransactionByBlockNumberAndIndex - Polygon
      • eth_getUncleCountByBlockHash - Polygon
      • eth_getUncleCountByBlockNumber - Polygon
      • eth_getLogs - Polygon
      • eth_call - Polygon
      • eth_chainId - Polygon
      • eth_estimateGas - Polygon
      • eth_gasPrice - Polygon
      • eth_getBalance - Polygon
      • eth_getCode - Polygon
      • net_version - Polygon
      • eth_getStorageAt - Polygon
      • eth_sendRawTransaction - Polygon
    • Binance Smart Chain API
      • eth_blockNumber (BSC)
      • eth_getBlockByHash (BSC)
      • eth_getBlockByNumber (BSC)
      • eth_getTransactionCount (BSC)
      • eth_getTransactionByHash (BSC)
      • eth_getTransactionReceipt (BSC)
      • eth_getBlockTransactionCountByHash (BSC)
      • eth_getBlockTransactionCountByNumber (BSC)
      • eth_getTransactionByBlockHashAndIndex (BSC)
      • eth_getTransactionByBlockNumberAndIndex (BSC)
      • eth_getUncleCountByBlockHash (BSC)
      • eth_getUncleCountByBlockNumber (BSC)
      • eth_getLogs (BSC)
      • eth_call (BSC)
      • eth_chainId (BSC)
      • eth_estimateGas (BSC)
      • eth_gasPrice (BSC)
      • eth_getBalance (BSC)
      • eth_getCode (BSC)
      • net_version (BSC)
      • eth_getStorageAt (BSC)
      • eth_sendRawTransaction (BSC)
    • Tron API
      • Full Node API Overview
      • Address Utilities
        • CreateAddress
        • GenerateAddress
        • ValidateAddress
      • Transactions
        • CreateTransaction
        • EasyTransferByPrivate
        • EasyTransfer
        • BroadcastHex
        • BroadcastTransaction
      • Accounts
        • AccountPermissionUpdate
        • UpdateAccount
        • GetAccount
        • CreateAccount
      • Account Resources
        • GetAccountNet
        • GetAccountResource
        • UnfreezeBalance
        • FreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query The Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • GetNodeInfo
        • GetChainParameters
      • TRC 10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • ParticipateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
        • EasyTransferAsset
        • EasyTransferAssetByPrivate
      • Smart Contracts
        • GetContract
        • TriggerSmartContract
        • TriggerConstantContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
      • TRONZ Shielded Smart Contract
        • GetSpendingKey
        • GetExpandedSpendingKey
        • GetAkFromAsk
        • GetNkFromNsk
        • GetIncomingViewingKey
        • GetDiversifier
        • GetZenPaymentAddress
        • GetNewShieldedAddress
        • CreateShieldedContractParameters
        • CreateSpendAuthSig
        • GetTriggerInputForShieldedTrc20Contract
        • ScanShieldedTrc20NotesByIvk
        • ScanShieldedTrc20NotesByOvk
        • IsShieldedTrc20ContractNoteSpent
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Proposals
        • ListProposals
        • GetProposalById
        • ProposalCreate
        • ProposalApprove
        • ProposalDelete
      • DEX Exchange
        • ListExchanges
        • GetExchangeById
        • ExchangeCreate
        • ExchangeInject
        • ExchangeWithdraw
        • ExchangeTransaction
      • Pending Pool
        • GetTransactionListFromPending
        • GetTransactionFromPending
        • GetPendingSize
    • Bitcoin API
      • Blockchain RPCs
        • getbestblockhash
        • getblock
        • getblockchaininfo
        • getblockcount
        • getblockhash
        • getblockheader
        • getblockstats
        • getchaintips
        • getchaintxstats
        • getdifficulty
        • getmempoolancestors
        • getmempooldescendants
        • getmempoolentry
        • getmempoolinfo
        • getrawmempool
        • gettxout
        • gettxoutproof
      • Rawtransactions RPCs
        • analyzepsbt
        • combinepsbt
        • combinerawtransaction
        • converttopsbt
        • createpsbt
        • createrawtransaction
        • decodepsbt
        • decoderawtransaction
        • decodescript
        • finalizepsbt
        • fundrawtransaction
        • getrawtransaction
        • joinpsbts
        • sendrawtransaction
        • testmempoolaccept
        • utxoupdatepsbt
  • πŸͺ™Price API
    • Price API
      • All tickers
      • Current price
  • ⛓️Web3
    • Web3 SDK
      • Web3.js
      • Web3.py
      • Ethers.js
      • Ethereum.rb
  • πŸ—ΊοΈTutorials and Guides
    • How to guides
      • How Getting Ethereum Account Balance and Transactions
      • How do I add WatchData to MetaMask?
      • How can i Get stats by Day
      • How to get the balance of an ERC-20 token
      • How can i get transfers using watch_getTransfersByAddress?
    • WatchData PriceΒ API and how it works?
    • How eth_getLogs works?
  • πŸ—ƒοΈResources
    • Pricing and Limits
      • Watch Units
    • FAQ
      • General
      • Pricing
      • Privacy
    • Support
    • Community
Powered by GitBook
On this page
  1. Blockchain API's
  2. Binance Smart Chain API

eth_getTransactionByBlockNumberAndIndex (BSC)

Returns information about a transaction by block number and transaction index position.

Previouseth_getTransactionByBlockHashAndIndex (BSC)Nexteth_getUncleCountByBlockHash (BSC)

Last updated 2 years ago

Parameters

  • QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the .

  • QUANTITY - the transaction index position.

 params: [ 
     'latest', // 668 
     '0x0' // 0 
 ]

Returns

See

Object - A transaction object, or null when no transaction was found:

  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.

  • blockNumber: QUANTITY - block number where this transaction was in. null when it's pending.

  • from: DATA, 20 Bytes - address of the sender.

  • gas: QUANTITY - gas provided by the sender.

  • gasPrice: QUANTITY - gas price provided by the sender in Wei.

  • hash: DATA, 32 Bytes - hash of the transaction.

  • input: DATA - the data send along with the transaction.

  • nonce: QUANTITY - the number of transactions made by the sender prior to this one.

  • to: DATA, 20 Bytes - address of the receiver. null when it's a contract creation transaction.

  • transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.

  • value: QUANTITY - value transferred in Wei.

  • v: QUANTITY - ECDSA recovery id

  • r: DATA, 32 Bytes - ECDSA signature r

  • s: DATA, 32 Bytes - ECDSA signature s

Request example

curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockNumberAndIndex",
    "params":["latest", "0x0"],
    "id":0
}

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xd7f4fe9ac374329f15f4f6c4fd6292b4768803cc6e48eee4f61e969700a013c2",
        "nonce": "0x25c8",
        "transactionIndex": "0x0",
        "from": "0xc01667054fe2c5a0d6ea6e1ebba9a64291af1e59",
        "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
        "value": "0x0",
        "gasPrice": "0x37e11d605",
        "gas": "0x6ddd0",
        "input": "0x38ed17390000000000000000000000000000000000000000000000d8d726b7177a800000000000000000000000000000000000000000000000000016af765ba6f3470b8000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000c01667054fe2c5a0d6ea6e1ebba9a64291af1e5900000000000000000000000000000000000000000000000000000000629e70200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000eceb87cf00dcbf2d4e2880223743ff087a995ad9000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d5600000000000000000000000055d398326f99059ff775485246999027b3197955",
        "v": "0x94",
        "r": "0x6444ef2644b763fdf6b7a993535eacb7a90c48c86bc820c6d688a4ec9e923e18",
        "s": "0x2385df7f2a543e6a8e130e3c0cda54b146a8929a208d5b06008906ca00f3f368",
        "chainId": "0x38",
        "blockHash": "0x66193e459a0080385e84205c59458a53e39e5c5e97d8b5b119c2f2821c77d684",
        "blockNumber": "0x119b830"
    }
}
πŸ•ΈοΈ
default block parameter
eth_getTransactionByHash