Error: Missing required argument count for minting. Please provide the argument in the mintParams

368 views Asked by At

I am trying to implement crossmint-pay-button using javascript. I am using cdn link: https://unpkg.com/@crossmint/[email protected]/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

1

There are 1 answers

3
Devlyn Dorfer On

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!