I want to create a website for users to connect their wallets (phantom etc) to my website, then they can generate tokens into their wallets themselves.

I looked at the example on https://spl.solana.com/token#example-creating-your-own-fungible-token and saw that the example is auto generate the keypair.

I want to use the user's keypair, but I only get their public key (can't get secret key). So what can I do?

Anyone who has an answer please let me know, thanks for everything

enter image description here

1 Answer 1


When user connects the wallet, write the code to get the address from the wallet. You shouldn't get the Keypairs from wallet but give the popup for transaction confirmation. Refer to this repository for implementation. https://github.com/anza-xyz/wallet-adapter/blob/master/APP.md

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.