API

class pyopenwatch.NFT(token_url: str, token_id: int, issuing_contract_address: str, minting_transaction_hash: str)

A Non-Fungiable Token “on” the blockchain

Repreresents an NFT that is recorded on the blockchain.

Parameters
  • token_url (str) – URL Of the NFT resource.

  • token_id (int) – ID of the NFT in its contract.

  • issuing_contract_address (str) – Address of the ERC-721 smart contract that issued the NFT token.

  • minting_transaction_hash (str) – Hash of the transaction that minted the token.

class pyopenwatch.EthereumNFTWatcher(host: str, port: str | int, log_level: int)
fetch_nfts_until_block(terminal_block_hash: str = '0x0000000000000000000000000000000000000000000000000000000000000000', limit: int = - 1, callback: Optional[Callable[[pyopenwatch.ethereum_classes.NFT], None]] = None, wait: bool = False) list[pyopenwatch.ethereum_classes.NFT]

Traverse the blockchain to find the NFTs.

Return a list of NFTs minted in transaction that have occurred between the latest block in the Ethereum blockchain and the block with the given block hash (or before the given limit of blocks are exceeded).

Parameters
  • terminal_block_hash (str) – The hash of the latest block to be fetched, if not provided, go to the first block, defaults to 0x00…

  • limit (int) – Maximum number of blocks to be fetched, if not provided, ignored.

  • callback (Optional[Callable[[NFT], None]]) – Function to be called with the latest fetched NFT whenever an NFT is fetched, defaults to None.

  • wait (bool) – Wait for the node to stop syncing before fetching the NFTs, defaults to False

Returns

the list of NFTs.

Return type

list[NFT]

property most_recent_block_hash: str

Hash of the most recent block on the blockchain.

Hash of the block of the blockchain that was most recent the last time self.fetch_nfts_until_block was run, if it was not run prior, then the null address.