Skip to content

Commit

Permalink
docs: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfrosty committed Feb 27, 2025
1 parent c79d915 commit c049464
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 10 additions & 5 deletions examples/get-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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:

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions examples/get-started/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion packages/gill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`,
Expand Down

0 comments on commit c049464

Please sign in to comment.