Charging ICP from users wallet?

Hello!

I’ve been trying to find proper example (with code) of how one might write a smart contract on ICP (let’s say NFT minting one) that would have a method that mints an NFT and deducts certain set mint price from the callers balance on his wallet (not sure which wallets would allow for this, I’ve been using nns wallet so far) and either forwards those ICP to a set wallet (that would ideally be specified in the smart contract itself and stored as a variable), or are there other methods of doing this (like storing ICP in the smart contract itself, like ETH SC’s do) ?

delegating a wallet for charging is dangerous. I would say normally:

  1. Minting app makes a “transfer” request to user’s wallet
  2. User sign the “transfer” request manually using wallet
  3. Minting app executes the minting process after confirming the successful “transfer”

current popular wallets: stoic https://www.stoicwallet.com/, plug https://plugwallet.ooo/

1 Like

Thanks for answering :slight_smile: Yeah, that’s what I meant. Would just like to have functionality to charge ICP for minting NFT. Is there an example of this implementation somewhere?

you might look at this GitHub - sagacards/legends-minter and other repos in this project

2 Likes

thank you very much, will dive into it :slight_smile: