Skip to content

Conversation

@datasalaryman
Copy link

Solana Docs recommend generating a keypair when creating a token account. This isn't standard practice and should be avoided.

All references to generating a keypair for the token account have been replaced with finding the token account with seeds.

@vercel
Copy link

vercel bot commented Nov 7, 2025

@datasalaryman is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@datasalaryman
Copy link
Author

I missed the token 2022 references. Will work on them tomorrow

@datasalaryman datasalaryman marked this pull request as draft November 7, 2025 10:20
@datasalaryman datasalaryman force-pushed the fix/docs-token-account branch from 8f81f2f to 0d7cbaa Compare November 8, 2025 02:00
@datasalaryman datasalaryman marked this pull request as ready for review November 8, 2025 02:28
@datasalaryman
Copy link
Author

this is ready for review. thanks

@jacobcreech jacobcreech requested a review from ZYJLiu November 10, 2025 21:25
@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
solana-com Ready Ready Preview Nov 26, 2025 3:36pm

@ZYJLiu
Copy link
Collaborator

ZYJLiu commented Nov 14, 2025

The existing create-token-account page as section for creating an ATA and creating a token account from keypair.
Both are included for reference in the examples. It looks like your changes would make both sections create ATAs.

Can you also update the other pages (cpi-guard and default-state) where changes are only for the files in the /en locale? The other locale pages are generated from the /en and it would make reviewing simpler since the changes are only for snippets.

@datasalaryman
Copy link
Author

... and creating a token account from keypair

Ah, I see. I'll revise this PR to change the header from How to Create a Token Account to How to Create a Token Account with a Keypair. That distinction would be better made explicitly. I should also indicate somewhere in the introduction to this section that there are two possible ways to create a token account.

image

I will follow your guidance when modifying code to only modify the /en/ locale for this PR.

I'll revise the PR title and description once done.

Thanks!

@datasalaryman datasalaryman force-pushed the fix/docs-token-account branch 2 times, most recently from 46c09b3 to 38cd2d6 Compare November 15, 2025 09:28
@datasalaryman datasalaryman changed the title fix: derive pda instead of creating a keypair for creating token account fix: derive ata instead of creating a keypair for cpi and default state examples Nov 17, 2025
@datasalaryman
Copy link
Author

@ZYJLiu - this pr will need another review. hopefully I didn't miss anything

@ZYJLiu
Copy link
Collaborator

ZYJLiu commented Nov 18, 2025

the snippets currently do not run on the vercel preview deployment with the changes.
can you check locally that the snippets work. you can use the existing snippets on solana-com as reference

@datasalaryman
Copy link
Author

@ZYJLiu - feel free to check now. I'm having a hard time testing it locally. Let me know if you have a way that works.

@ZYJLiu
Copy link
Collaborator

ZYJLiu commented Nov 26, 2025

the updated web3js on cpi guard page still not running
the rust snippets should also be updated for consistency

@ZYJLiu
Copy link
Collaborator

ZYJLiu commented Nov 26, 2025

@ZYJLiu - feel free to check now. I'm having a hard time testing it locally. Let me know if you have a way that works.

are you updating these pages without checking the updated snippets work?

@datasalaryman
Copy link
Author

hi @ZYJLiu I'm unable to on local because it takes awhile to run a dev server for this project on localhost. I also don't have access to the vercel project.

I have a pesonal project I'm basing these examples on, but it isn't clear if it's translating one-for-one.

Is there a way perhaps I can run a --filter flag when running the docs? or is there a better way?

@michellemonteverde2317-ui

.

@michellemonteverde2317-ui michellemonteverde2317-ui mentioned this pull request Dec 9, 2025
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

Successfully merging this pull request may close these issues.

3 participants