When a block doesn't have any transactions, block.transaction property won't be present and it will be undefined.
but the type for block.transaction is an array TronTransaction<ContractParamter>[] it should be TronTransaction<ContractParamter>[] | undefined or make it return an empty array.
This is a simple code that retrives an empty block:
When a block doesn't have any transactions,
block.transaction
property won't be present and it will be undefined.but the type for
block.transaction
is an arrayTronTransaction<ContractParamter>[]
it should beTronTransaction<ContractParamter>[] | undefined
or make it return an empty array.This is a simple code that retrives an empty block: