错误:缺少铸造所需的参数计数。请在 mintParams 中提供参数

Tus*_*rat -4 nft crossmint

我正在尝试使用 javascript 实现 crossmint-pay-button 。我正在使用 cdn 链接: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"
/>
Run Code Online (Sandbox Code Playgroud)

当我单击下面的“付款”按钮时,会出现错误。“缺少铸造所需的参数计数。请在 mintParams 中提供参数”

在此输入图像描述

小智 6

该错误消息具有误导性。该说的地方mintParams就该说mintConfig

考虑到这一点:错误的意思是你的合约 abi 需要一个count参数来铸造,并且这个参数应该在mintConfig对象中传递。

就你而言,你正在传递论点_count。如果您将其重命名为count,那么应该可以工作。

见下文:

    <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"
    />
Run Code Online (Sandbox Code Playgroud)

如果这对您不起作用,请联系不和谐的 crossmint 团队!