Block Module
Block module for accessing blockchain block data.
To learn more about how to use the AI Agent SDK to interact with the wallet module, please visit AI Agent SDK Block Information.
4.1 Get Current Block
Get the current latest block.
Function Name
get_current
Example Code
from crypto_com_developer_platform_client import Block block = Block.get_current() print(block)
4.2 Get Block By Tag
Get a block by tag or block number.
Function Name
get_by_tag
Arguments
tag (str): Integer of a block number in hex, or the string "earliest", "latest" or "pending", as in https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block tx_detail (str): If true it returns the full transaction objects, if false only the hashes of the transactions.
Example Code
from crypto_com_developer_platform_client import Block block = Block.get_current("latest", "true") print(block)
Last updated
Was this helpful?