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

Add onMint callback to MINT interaction #89

Open
Yuripetusko opened this issue Feb 9, 2022 · 3 comments
Open

Add onMint callback to MINT interaction #89

Yuripetusko opened this issue Feb 9, 2022 · 3 comments

Comments

@Yuripetusko
Copy link
Member

Because TS/extrinsic implementation version of RMRK standard uses block number in NFT id, this prevents you from doing anything with an NFT in the same block as it is MINTed. This is because you need to know at which block the NFT was minted before you can construct additional remarks for it.

with that in mind, I propose to accept an optional onMint array with nft fields object passed with MINT interaction. This array would use double curly brace notation that will be interpolated into nft id that is being minted at a runtime.

RMRK::MINT::2.0.0::${encodeURIComponent(
  JSON.stringify({
    collection: '8949162-e0b9bdcc456a36497a',
    symbol: 'KANL',
    transferable: 1,
    sn: 00009999,
    metadata: 'ipfs://ipfs/foo',
    onMint: [
      `RMRK::RESADD::2.0.0::{{nft.id}}::${encodeURIComponent(
          JSON.stringify({
            id: nanoid(8),
            src: 'ipfs://ipfs/foo',
          })
        )}`
    ]
  })
)}
@Swader
Copy link
Contributor

Swader commented Feb 9, 2022

Needs a spec change, and a whitelist for callback ops to LIST, SEND, RESADD. Otherwise fine, but needs to be aware of possible double curlies in the resource fields, if someone decides to break things 🤔

@yornaath
Copy link

yornaath commented Mar 2, 2022

Definitely a 👍 Need the exact use case you are using as an example.

@boyswan
Copy link

boyswan commented Mar 14, 2022

This would be a hugely useful addition to the spec!

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

No branches or pull requests

4 participants