I have integrated a Cardano wallet into my site and done some basic interactions. I am hoping to get a sample, example and/or guidance on how to build the transaction I am interested in implementing:


  • User visits my site, connects their wallet.
  • User pays an amount of ADA or an amount of a native token to mint an NFT.
  • User has NFT in their wallet now, and site can verify it is there as a means of confirming paid membership.

So the transaction I need to build:

User pays an amount of ADA or a native token to mint an NFT. => ADA gets transferred from the users wallet to the wallet of the site, NFT gets minted and sent to users wallet.

Has anyone here done this?

1 Answer 1


This all can be done in a single transaction using lucid. Suggest you to see examples here. You can use payToContract to pay Ada / native token and simultaneously, mintAssets to mint them (in your minting script, check script context to see whether the required amount is getting transferred to required address). Can see a similar example I coded for my project here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.