Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFT example update to work with wallet on TestNet #314

Closed
ilblackdragon opened this issue Aug 30, 2021 · 5 comments
Closed

NFT example update to work with wallet on TestNet #314

ilblackdragon opened this issue Aug 30, 2021 · 5 comments
Assignees
Labels

Comments

@ilblackdragon
Copy link
Member

No description provided.

@zavodil
Copy link

zavodil commented Aug 30, 2021

This issue happens because simple nft_mint call is not enough to show NFT on the Collectibles Tab in the wallet.
We have a several ways to fix it:

  1. update nft_mint section in the example: we will set owner_id=$CONTRACT_NAME and run nft_transfer then to send it to user's account_id. It is a typical workflow when contract mints tokens and distribute them to recipients. nft_transfer will trigger token display.
  2. add nft_marketplace contract to the example: we will mint token and offer it for sale on a marketplace. offer will trigger token display. This will extend init process of the example due to marketplace initialization.
  3. Update near-wallet to check nft_mint calls

@ilblackdragon @thisisjoshford @mehtaphysical wdyt?

@zavodil
Copy link

zavodil commented Sep 8, 2021

mint call is quite challenging to perform, since it's not payable, but it requires tokens to cover storage for metadata. So I believe the way how it was designed is to call it within the wrapper function (as nft_mint). I asked wallet team if they are in position to track nft_mint calls since they are already tracking mint calls

@ilblackdragon
Copy link
Member Author

Yes, that's an issue with the library implementation. It's tracked here near/near-sdk-rs#542

We def should change that implementation first.

My question is what is the wallet using to pick up for minting in the wallet. @MaximusHaximus what are you currently using?

@MaximusHaximus
Copy link

@zavodil We use an indexer query to find transactions that appear to be NFT transactions. We currently look for any method called starting with nft_, where the receiver_id in the JSON args of the method call is the active account. Is it possible the usages of nft_mint you are seeing don't use receiver_id in the JSON args for the nft_mint call?

For your reference, this is the code: https://github.com/near/near-contract-helper/blob/master/middleware/indexer.js#L144-L160

We're happy to update our queries if there is an obvious solution here; maybe you have an example transaction we could use to model the behaviour?

This is also a relevant discussion happening right now in the NEPs repository which makes me believe that having log outputs from NEP171 contracts is the 'correct' solution here: near/NEPs#254

@zavodil
Copy link

zavodil commented Sep 8, 2021

@zavodil We use an indexer query to find transactions that appear to be NFT transactions. We currently look for any method called starting with nft_, where the receiver_id in the JSON args of the method call is the active account. Is it possible the usages of nft_mint you are seeing don't use receiver_id in the JSON args for the nft_mint call?

Many thanks, I pushed PR with the corresponding fix near-examples/NFT#176
We just have to use receiver_id instead of token_owner_id everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants