mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-10 11:55:11 +03:00
3.7 KiB
3.7 KiB
In [ ]:
# get ALCHEMY_API_KEY from https://www.alchemy.com/
alchemyApiKey = "..."In [ ]:
from langchain.document_loaders.blockchain import (
BlockchainDocumentLoader,
BlockchainType,
)
contractAddress = "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d" # Bored Ape Yacht Club contract address
blockchainType = BlockchainType.ETH_MAINNET # default value, optional parameter
blockchainLoader = BlockchainDocumentLoader(
contract_address=contractAddress, api_key=alchemyApiKey
)
nfts = blockchainLoader.load()
nfts[:2]In [ ]:
contractAddress = (
"0x448676ffCd0aDf2D85C1f0565e8dde6924A9A7D9" # Polygon Mainnet contract address
)
blockchainType = BlockchainType.POLYGON_MAINNET
blockchainLoader = BlockchainDocumentLoader(
contract_address=contractAddress,
blockchainType=blockchainType,
api_key=alchemyApiKey,
)
nfts = blockchainLoader.load()
nfts[:2]