From c0494645f43e4ed2eb43bf4d2ad46399b4c8f7d9 Mon Sep 17 00:00:00 2001 From: nickfrosty <75431177+nickfrosty@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:20:17 -0500 Subject: [PATCH] docs: readme --- README.md | 5 +++++ examples/get-started/README.md | 15 ++++++++++----- examples/get-started/src/tokens.ts | 6 +++--- packages/gill/README.md | 8 +++++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 900e9d2..adf8e89 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,11 @@ yarn add gill ## Quick start +> Find a collection of example code snippets using `gill` inside the +> [`/examples` directory](https://github.com/solana-foundation/gill/tree/master/examples), including +> [basic operations](https://github.com/solana-foundation/gill/tree/master/examples/get-started) and +> common [token operations](https://github.com/solana-foundation/gill/tree/master/examples/tokens). + - [Create a Solana RPC connection](#create-a-solana-rpc-connection) - [Making Solana RPC calls](#making-solana-rpc-calls) - [Create a transaction](#create-a-transaction) diff --git a/examples/get-started/README.md b/examples/get-started/README.md index 9d399ee..0b2207c 100644 --- a/examples/get-started/README.md +++ b/examples/get-started/README.md @@ -44,6 +44,7 @@ After getting setup locally, we recommend exploring the code of the following files (in order): - [`intro.ts`](./src/intro.ts) +- [`airdrop.ts`](./src/airdrop.ts) - [`tokens.ts`](./src/tokens.ts) #### `intro.ts` @@ -64,9 +65,15 @@ commonly used tasks involved to interact with the Solana blockchain, including: These are all the most basic tasks required for any application sending transaction to the Solana blockchain. +#### `airdrop.ts` + +Demonstrates how to create a client connection to the Solana blockchain on a +test cluster (e.g. `devnet`, `testnet`, or `localnet`) and request airdrops of +testing SOL tokens to a wallet address. + #### `tokens.ts` -Demonstrating how to use gill's "transaction builders" to create a brand new +Demonstrates how to use gill's "transaction builders" to create a brand new Solana token (with onchain metadata) and then mint tokens to another user's wallet: @@ -78,10 +85,8 @@ wallet: - build an optimized transaction to mint - sign, send, and confirm that "mint tokens" transaction -#### `2.complexTransaction.ts` - -An introduction to more complex transactions using Solana web3.js. Demonstrates -how to build a more complex transaction, with multiple instructions. +> For more examples interacting with Tokens on Solana, see the +> [token examples examples here](../tokens/README.md) ## Comparison of gill vs web3js v2 diff --git a/examples/get-started/src/tokens.ts b/examples/get-started/src/tokens.ts index d910d0e..9bf0dae 100644 --- a/examples/get-started/src/tokens.ts +++ b/examples/get-started/src/tokens.ts @@ -90,7 +90,7 @@ const createTokenTx = await buildCreateTokenTransaction({ // updateAuthority, // default=same as the `feePayer` decimals: 2, // default=9, tokenProgram, // default=TOKEN_PROGRAM_ADDRESS, token22 also supported - // default cu limit set to be optimized, but can be overriden here + // default cu limit set to be optimized, but can be overridden here // computeUnitLimit?: number, // obtain from your favorite priority fee api // computeUnitPrice?: number, // no default set @@ -149,7 +149,7 @@ const mintTokensTx = await buildMintTokensTransaction({ destination: mintToDestination, // use the correct token program for the `mint` tokenProgram, // default=TOKEN_PROGRAM_ADDRESS - // default cu limit set to be optimized, but can be overriden here + // default cu limit set to be optimized, but can be overridden here // computeUnitLimit?: number, // obtain from your favorite priority fee api // computeUnitPrice?: number, // no default set @@ -227,7 +227,7 @@ const transferTokensTx = await buildTransferTokensTransaction({ destination: transferToDestination, // use the correct token program for the `mint` tokenProgram, // default=TOKEN_PROGRAM_ADDRESS - // default cu limit set to be optimized, but can be overriden here + // default cu limit set to be optimized, but can be overridden here // computeUnitLimit?: number, // obtain from your favorite priority fee api // computeUnitPrice?: number, // no default set diff --git a/packages/gill/README.md b/packages/gill/README.md index 53dcd3c..adf8e89 100644 --- a/packages/gill/README.md +++ b/packages/gill/README.md @@ -46,6 +46,11 @@ yarn add gill ## Quick start +> Find a collection of example code snippets using `gill` inside the +> [`/examples` directory](https://github.com/solana-foundation/gill/tree/master/examples), including +> [basic operations](https://github.com/solana-foundation/gill/tree/master/examples/get-started) and +> common [token operations](https://github.com/solana-foundation/gill/tree/master/examples/tokens). + - [Create a Solana RPC connection](#create-a-solana-rpc-connection) - [Making Solana RPC calls](#making-solana-rpc-calls) - [Create a transaction](#create-a-transaction) @@ -589,7 +594,8 @@ const mintTokensTx = await buildMintTokensTransaction({ ### Transfer tokens to a destination wallet -Build a transaction that transfers tokens to the `destination` wallet address form the `source` +Build a transaction that transfers tokens to the `destination` wallet address from the `source` (aka +from `sourceAta` to `destinationAta`). - ensure you set the correct `tokenProgram` used by the `mint` itself - if the `destination` owner does not have an associated token account (ata) created for the `mint`,