|
|
1 ヶ月 前 | |
|---|---|---|
| .. | ||
| src | 1 ヶ月 前 | |
| .gitignore | 9 ヶ月 前 | |
| .prettierignore | 2 ヶ月 前 | |
| .prettierrc | 9 ヶ月 前 | |
| README.md | 2 ヶ月 前 | |
| package.json | 1 ヶ月 前 | |
| tsconfig.json | 2 ヶ月 前 | |
Gill is aimed at abstracting away many of the complexities and boilerplate required to perform common interactions with the Solana blockchain, while still offering the low level "escape hatches" when developers need (or want) fine-grain control.
Take a look through these examples to see how gill works and even how it compares to using the vanilla web3js v2 library.
pnpmesrunpnpm installcd examples/get-startedOnce setup locally, you will be able to run the scripts included within this
repo using esrun:
npx esrun ./src/<script>
pnpx esrun ./src/<script>
From the esrun readme:
esrun is a "work out of the box" library to execute Typescript (as well as modern Javascript with decorators and stuff) without having to use a bundler. This is useful for quick demonstrations or when launching your tests written in Typescript.
After getting setup locally, we recommend exploring the code of the following files (in order):
intro.tsA brief introduction to the gill library. Demonstrating and explaining the
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.tsDemonstrates 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.tsDemonstrates 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:
For more examples interacting with Tokens on Solana, see the token examples examples here
reference-keys.tsThis script demonstrates the process to add a reference key into a transaction.
See the gill docs for Reference Keys for more information.
Adding reference keys to transactions allows developers to be able track the completion of transactions given to users, without knowing the signature ahead of time. Then, perform any desired logic after detection of the reference keyed transaction landing onchain.
Most notably utilized within SolanaPay and Blinks.
You can find comparison scripts that demonstrates some of the differences between gill and @solana/kit (formerly known as "web3.js v2").
Find a more comprehensive comparison in gill vs @solana/kit comparison docs
Both scripts accomplish the same task: send an optimized transaction to the Solana blockchain.
basic.tsbasic-compare.tsBoth will load a keypair file from your local filesystem (the one used by the Solana CLI).
Both are written with honest intentions, best practices, and attempt to be as concise as possible in accomplishing the same task.
You decide which you prefer :)