Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

end-user has to sign the transaction when minting in a gassless way #2

Open
JuanRdBO opened this issue Nov 1, 2022 · 4 comments
Open

Comments

@JuanRdBO
Copy link
Contributor

JuanRdBO commented Nov 1, 2022

Would it be possible to have the end-user just receive the mint, instead of having to be a signer?

@0xMukesh
Copy link
Member

0xMukesh commented Nov 2, 2022

Hey! Can you explain what your use case is? The SDK already has an NFT airdrop function which doesn't require the end-user to sign the transaction. The transaction is being signed via the mint keypair and the payer wallet

https://github.com/candypay/sdk/blob/bfb30790356a6bc0140f527a74cd19b9cf1f1a75/packages/sdk/src/lib/nft-airdrop.ts#L162

@0xMukesh
Copy link
Member

0xMukesh commented Nov 3, 2022

Update: The airdrop function's internal types have been changed in the latest version of the SDK. Here is the latest code on how to use the airdrop function - https://github.com/candypay/sdk#airdrop

https://github.com/candypay/sdk/blob/553791e5cfdf22ff10fb16a972930f8929ca076d/packages/sdk/src/types/nft.ts#L7-L57

@JuanRdBO
Copy link
Contributor Author

JuanRdBO commented Nov 3, 2022

Hey! I saw that one, but I was referring to the gasless mint of a candy machine. It would be awesome, if the gassless way would not require the end-user to sign the transaction

@0xMukesh
Copy link
Member

0xMukesh commented Nov 3, 2022

Gotcha! The latest update of the SDK doesn't require the end user to sign the transaction for minting the Candy Machine via the gasless method. You can take a look at the test suite for the candyMachine module -- https://github.com/candypay/sdk/blob/main/packages/sdk/tests/candy-machine.test.ts. Under the test for the gasless method, you can see that the transaction is only being signed by the payer wallet and the mint keypair.

https://github.com/candypay/sdk/blob/553791e5cfdf22ff10fb16a972930f8929ca076d/packages/sdk/tests/candy-machine.test.ts#L42-L46

Here is a transaction created via the gasless method's test -- 5c3V3sGLJEU3j3wjJnV1786hhJtLddEcGoikmtPTskXCyhUTkDx1Xxr5xWdi3mJTBWYGUJRhBVGidRnRSzPZ9ywq via the following configuration:

  • 3DzHJzPZGBwp7uN5NSMDgQjLAo2qAF78XEMwacmnFDMk as the payer account
  • 2S9jKJEGKoVxR3xkEfFyGVrLwJj1H8xYjqtSP5LAX97x as the end-user account

The end-user account on the explorer doesn't show the "Signer" badge beside it, whereas the payer account has both the "Signer" and "Fee Payer" badges beside it

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants