Skip to main content

getBlock

Callable

  • getBlock<ReturnFormat>(web3Context: Web3Context<EthExecutionAPI, any>, block?: string | number | bigint | Uint8Array, hydrated?: boolean, returnFormat: ReturnFormat): Promise<{ baseFeePerGas?: NumberTypes[ReturnFormat[number]]; difficulty?: NumberTypes[ReturnFormat[number]]; extraData: ByteTypes[ReturnFormat[bytes]]; gasLimit: NumberTypes[ReturnFormat[number]]; gasUsed: NumberTypes[ReturnFormat[number]]; hash?: ByteTypes[ReturnFormat[bytes]]; logsBloom?: ByteTypes[ReturnFormat[bytes]]; miner: ByteTypes[ReturnFormat[bytes]]; mixHash: ByteTypes[ReturnFormat[bytes]]; nonce: NumberTypes[ReturnFormat[number]]; number: NumberTypes[ReturnFormat[number]]; parentHash: ByteTypes[ReturnFormat[bytes]]; receiptsRoot: ByteTypes[ReturnFormat[bytes]]; sha3Uncles: ByteTypes[ReturnFormat[bytes]]; size: NumberTypes[ReturnFormat[number]]; stateRoot: ByteTypes[ReturnFormat[bytes]]; timestamp: NumberTypes[ReturnFormat[number]]; totalDifficulty: NumberTypes[ReturnFormat[number]]; transactions: string[] | { accessList?: { address?: string; storageKeys?: string[] }[]; blockHash?: ByteTypes[ReturnFormat[bytes]]; blockNumber?: NumberTypes[ReturnFormat[number]]; chain?: ValidChains; chainId?: NumberTypes[ReturnFormat[number]]; common?: { baseChain?: ValidChains; customChain: { chainId: NumberTypes[ReturnFormat[number]]; name?: string; networkId: NumberTypes[ReturnFormat[number]] }; hardfork?: chainstart | frontier | homestead | dao | tangerineWhistle | spuriousDragon | byzantium | constantinople | petersburg | istanbul | muirGlacier | berlin | london | altair | arrowGlacier | grayGlacier | bellatrix | merge | capella | shanghai }; data?: ByteTypes[ReturnFormat[bytes]]; from: string; gas?: NumberTypes[ReturnFormat[number]]; gasLimit?: NumberTypes[ReturnFormat[number]]; gasPrice?: NumberTypes[ReturnFormat[number]]; hardfork?: chainstart | frontier | homestead | dao | tangerineWhistle | spuriousDragon | byzantium | constantinople | petersburg | istanbul | muirGlacier | berlin | london | altair | arrowGlacier | grayGlacier | bellatrix | merge | capella | shanghai; hash: ByteTypes[ReturnFormat[bytes]]; input?: ByteTypes[ReturnFormat[bytes]]; maxFeePerGas?: NumberTypes[ReturnFormat[number]]; maxPriorityFeePerGas?: NumberTypes[ReturnFormat[number]]; networkId?: NumberTypes[ReturnFormat[number]]; nonce?: NumberTypes[ReturnFormat[number]]; r?: ByteTypes[ReturnFormat[bytes]]; s?: ByteTypes[ReturnFormat[bytes]]; to?: null | string; transactionIndex?: NumberTypes[ReturnFormat[number]]; type?: NumberTypes[ReturnFormat[number]]; v?: NumberTypes[ReturnFormat[number]]; value?: NumberTypes[ReturnFormat[number]]; yParity?: string }[]; transactionsRoot: ByteTypes[ReturnFormat[bytes]]; uncles: string[] }>

  • View additional documentations here: Web3Eth.getBlock


    Type parameters

    Parameters

    • web3Context: Web3Context<EthExecutionAPI, any>

      (Web3Context) Web3 configuration object that contains things such as the provider, request manager, wallet, etc.

    • block: string | number | bigint | Uint8Array = web3Context.defaultBlock
    • hydrated: boolean = false
    • returnFormat: ReturnFormat

    Returns Promise<{ baseFeePerGas?: NumberTypes[ReturnFormat[number]]; difficulty?: NumberTypes[ReturnFormat[number]]; extraData: ByteTypes[ReturnFormat[bytes]]; gasLimit: NumberTypes[ReturnFormat[number]]; gasUsed: NumberTypes[ReturnFormat[number]]; hash?: ByteTypes[ReturnFormat[bytes]]; logsBloom?: ByteTypes[ReturnFormat[bytes]]; miner: ByteTypes[ReturnFormat[bytes]]; mixHash: ByteTypes[ReturnFormat[bytes]]; nonce: NumberTypes[ReturnFormat[number]]; number: NumberTypes[ReturnFormat[number]]; parentHash: ByteTypes[ReturnFormat[bytes]]; receiptsRoot: ByteTypes[ReturnFormat[bytes]]; sha3Uncles: ByteTypes[ReturnFormat[bytes]]; size: NumberTypes[ReturnFormat[number]]; stateRoot: ByteTypes[ReturnFormat[bytes]]; timestamp: NumberTypes[ReturnFormat[number]]; totalDifficulty: NumberTypes[ReturnFormat[number]]; transactions: string[] | { accessList?: { address?: string; storageKeys?: string[] }[]; blockHash?: ByteTypes[ReturnFormat[bytes]]; blockNumber?: NumberTypes[ReturnFormat[number]]; chain?: ValidChains; chainId?: NumberTypes[ReturnFormat[number]]; common?: { baseChain?: ValidChains; customChain: { chainId: NumberTypes[ReturnFormat[number]]; name?: string; networkId: NumberTypes[ReturnFormat[number]] }; hardfork?: chainstart | frontier | homestead | dao | tangerineWhistle | spuriousDragon | byzantium | constantinople | petersburg | istanbul | muirGlacier | berlin | london | altair | arrowGlacier | grayGlacier | bellatrix | merge | capella | shanghai }; data?: ByteTypes[ReturnFormat[bytes]]; from: string; gas?: NumberTypes[ReturnFormat[number]]; gasLimit?: NumberTypes[ReturnFormat[number]]; gasPrice?: NumberTypes[ReturnFormat[number]]; hardfork?: chainstart | frontier | homestead | dao | tangerineWhistle | spuriousDragon | byzantium | constantinople | petersburg | istanbul | muirGlacier | berlin | london | altair | arrowGlacier | grayGlacier | bellatrix | merge | capella | shanghai; hash: ByteTypes[ReturnFormat[bytes]]; input?: ByteTypes[ReturnFormat[bytes]]; maxFeePerGas?: NumberTypes[ReturnFormat[number]]; maxPriorityFeePerGas?: NumberTypes[ReturnFormat[number]]; networkId?: NumberTypes[ReturnFormat[number]]; nonce?: NumberTypes[ReturnFormat[number]]; r?: ByteTypes[ReturnFormat[bytes]]; s?: ByteTypes[ReturnFormat[bytes]]; to?: null | string; transactionIndex?: NumberTypes[ReturnFormat[number]]; type?: NumberTypes[ReturnFormat[number]]; v?: NumberTypes[ReturnFormat[number]]; value?: NumberTypes[ReturnFormat[number]]; yParity?: string }[]; transactionsRoot: ByteTypes[ReturnFormat[bytes]]; uncles: string[] }>