-
Notifications
You must be signed in to change notification settings - Fork 31
Missing Example/Test-Case: Mint NFTs with Different Sets of Metadata and Retrieve That Metadata #77
Comments
Although I can't manage to write a working lambda, I've managed to assert from this:
That it seems to match on So if I want data for token 3 and there are four pairs in storage
It will always pick
And
And
And
|
I think we should put this more clearly somewhere as an example for future devs as it's a pretty odd pattern for something where each token inherently is supposed to have unique data. I still have no idea how to pass in the lambda for getting token data. |
This is a special way to implement contract view entry points. Tezos will have Solidity-like view entry points with the next protocol update. At the moment, view entry points use continuation passing style pattern when the parameter contains a callback lambda. If the contract A wants to get some value from the contract B, it should call contract's A view entry point passing parameters (like token_id) and a callback. Contract B then will call a provided callback entry point of the contract A, passing the requested value. In general, view entry points cannot be called off-chain (only by other contracts). But Taquito library has special API which lets to inspect view entry points off-chain: https://tezostaquito.io/docs/lambda_view/ |
Yes, this is a special NFT contract which represents "semi-fungible" NFTs. You may also have a look at https://github.com/tqtezos/minter-sdk which has a variety of fungible and non-fungible token contracts implementation or take the NFT contract from https://github.com/oxheadalpha/nft-tutorial |
@emishur thank you so much for all of this information. really appreciated |
It's unclear how you mint two different singular NFTs on the same contract with different metadata, which is usually the case for NFT contracts. The
token_metadata
endpoint is also a little arcane, as it asks for a lambda as the first parameter and I'm not sure what sort of function it expects.Everything is catered toward a range of NFT IDs with the same metadata.
The test cases only show one case where you want to mint two NFTs with the same metadata:
https://github.com/oxheadalpha/smart-contracts/blob/master/nft_assets/tezos_fa2_nft_tests/test_fa2.py#L132-L153
So my question is how do I do two?
Is this how I would do two separate ones?
Furthermore, how do I check the metadata for a single token with
token_metadata
?What does "type" mean? It's unclear. A non-fungible token is 1-1 and therefore it's always a unique type.
The text was updated successfully, but these errors were encountered: