-4

I am trying to implement crossmint-pay-button using javascript. I am using cdn link: https://unpkg.com/@crossmint/client-sdk-vanilla-ui@0.0.1-alpha.1/lib/index.global.js

<crossmint-pay-button
     collectionTitle="Gaia comic"
     collectionDescription="Gaia comic collection "
     collectionPhoto=""
     clientId="8d77450f.....ad497f612"
     mintConfig='{"type":"erc-721","price":"0.1","_count":"1"}'
     environment="staging"
/>

When I click Pay button below error gets. "Missing required argument count for minting. Please provide the argument in the mintParams"

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
Tushar kharat
  • 151
  • 1
  • 1
  • 9

1 Answers1

6

The error message is misleading. Where it says mintParams, it should say mintConfig.

With that in mind: what error is saying is that your contract abi is expecting a count argument to mint, and this argument should be passed in the mintConfig object.

In your case, you are passing the argument _count. If you rename it to count, that should work.

See below:

    <crossmint-pay-button
     collectionTitle="Gaia comic"
     collectionDescription="Gaia comic collection "
     collectionPhoto=""
     clientId="8d77450f.....ad497f612"
     mintConfig='{"type":"erc-721","price":"0.1","count":"1"}'
     environment="staging"
    />

Reach out to the crossmint team on discord if this doesn't work for you!

Mahesh Waghmare
  • 726
  • 9
  • 27
  • Hey thanks for the answer. I renamed it to "count" but still not working. Giving same error. I raised this issue on discord with the team but they asked me to post in stackoverflow. – Tushar kharat May 20 '22 at 05:54
  • Mind adding a screenshot of the error you see if you use this code snippet? I believe it may be a different error – alfongj May 20 '22 at 08:01
  • @alfongj yes your are right, now the error is different. It says "Missing required argument to for minting. Please provide the argument in the mintParams" – Tushar kharat May 26 '22 at 11:46