MintbaseDocumentLoader(
self,
contract_address: str,
*,
blockchain_type: Literal['mainnet', 'testnet'],
api_key| Name | Type | Description |
|---|---|---|
contract_address* | str | The address of the smart contract. |
blockchainType* | unknown | The blockchain type. |
api_key | str | Default: ''The Mintbase API key. |
table | str | Default: '' |
select | str | Default: '' |
fields | Optional[List[str]] | Default: None |
get_all_tokens | bool | Default: False |
max_execution_time | Optional[int] | Default: None |
Load elements from a blockchain smart contract.
The supported blockchains are: Near mainnet, Near testnet.
If no BlockchainType is specified, the default is Near mainnet.
The Loader uses the Mintbase API to interact with the blockchain. MB_API_KEY environment variable must be set to use this loader.
The API returns 100 NFTs per request and can be paginated using the startToken parameter.
If get_all_tokens is set to True, the loader will get all tokens on the contract. Note that for contracts with a large number of tokens, this may take a long time (e.g. 10k tokens is 100 requests). Default value is false for this reason.
The max_execution_time (sec) can be set to limit the execution time of the loader.
Future versions of this loader can:
Example:
.. code-block:: python
contractAddress = "nft.yearofchef.near" # Year of chef contract address blockchainLoader = MintbaseDocumentLoader( contract_address=contractAddress, blockchain_type="mainnet",api_key="omni-site" )
name of the table to query
Conditions for querying
Information to display after query
Whether to get all tokens on the contract.
The maximum execution time (sec).