Skip to main content
These docs will be deprecated and no longer maintained with the release of LangChain v1.0 in October 2025. Visit the v1.0 alpha docs
Open In ColabOpen on GitHub

Near Blockchain

The intention of this notebook is to provide a means of testing functionality in the Langchain Document Loader for Near Blockchain.

Initially this Loader supports:

  • Loading NFTs as Documents from NFT Smart Contracts (NEP-171 and NEP-177)
  • Near Mainnnet, Near Testnet (default is mainnet)
  • Mintbase's Graph API

It can be extended if the community finds value in this loader. Specifically:

  • Additional APIs can be added (e.g. Tranction-related APIs)

This Document Loader Requires:

The output takes the following format:

  • pageContent= Individual NFT
  • metadata={'source': 'nft.yearofchef.near', 'blockchain': 'mainnet', 'tokenId': '1846'}

Load NFTs into Document Loaderโ€‹

# get MINTBASE_API_KEY from https://docs.mintbase.xyz/dev/mintbase-graph/

mintbaseApiKey = "..."

Option 1: Ethereum Mainnet (default BlockchainType)โ€‹

from MintbaseLoader import MintbaseDocumentLoader

contractAddress = "nft.yearofchef.near" # Year of chef contract address


blockchainLoader = MintbaseDocumentLoader(
contract_address=contractAddress, blockchain_type="mainnet", api_key="omni-site"
)

nfts = blockchainLoader.load()

print(nfts[:1])

for doc in blockchainLoader.lazy_load():
print()
print(type(doc))
print(doc)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.