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

Update and fix documentation #458

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Update and fix documentation #458

merged 5 commits into from
Nov 5, 2024

Conversation

calintje
Copy link
Contributor

@calintje calintje commented Nov 4, 2024

Title
Update docs

Details

  • Update wallet management, preventing users from not storing their keypairs and losing their assets.
  • Fix imports and return types of code examples
  • Fix typedocs

@calintje calintje marked this pull request as ready for review November 4, 2024 23:59
Copy link
Collaborator

@yugure-orca yugure-orca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

*
* const devnetRpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
* const wallet = await generateKeyPairSigner();
* const keyPairBytes = new Uint8Array(JSON.parse(fs.readFileSync('path/to/solana-keypair.json', 'utf8')));
Copy link
Member

@wjthieme wjthieme Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the one hand I like this because it is better practice than generatekeypair. On the other hand now each example requires an extra setup step and you can't just copy paste to try it out.

I'm in favor of leaving this as generatekeypair but wouldn't be opposed to adding a comment: "see wallat management on how to load a wallet" or something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand don't really care as much as long as it is clear to the user

Copy link
Contributor Author

@calintje calintje Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links to documentattion inside an example code-block does not look nice.
image

I will change to:

const wallet = await generateKeyPairSigner(); // CAUTION: this wallet is not persistent.

Since the functions only generate instructions, and there's no mentioning of "SOL airdrop on Devnet", this should be fine.

@calintje calintje merged commit ed6ad5b into main Nov 5, 2024
5 checks passed
@calintje calintje deleted the calintje/fix-docs branch November 5, 2024 13:05
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