Showing preview only (1,149K chars total). Download the full file or copy to clipboard to get everything.
Repository: solana-foundation/gill
Branch: master
Commit: 45acd737726f
Files: 416
Total size: 1.0 MB
Directory structure:
gitextract_un7yn6a6/
├── .bundlemonrc.json
├── .changeset/
│ ├── README.md
│ ├── config.json
│ └── gold-chicken-rhyme.md
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── config.yml
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── actions/
│ │ └── install-dependencies/
│ │ └── action.yml
│ ├── bundlesize.yml
│ ├── preview-docs.yml
│ ├── publish-canary-releases.yml
│ ├── publish-docs.yml
│ ├── publish-packages.yml
│ └── pull-requests.yml
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .vscode/
│ └── settings.json
├── CONTRIBUTING.md
├── LICENSE
├── MAINTAINERS.md
├── README.md
├── docs/
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── .npmrc
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── README.md
│ ├── build-api-docs.sh
│ ├── content/
│ │ ├── api/
│ │ │ ├── index.mdx
│ │ │ └── meta.json
│ │ └── docs/
│ │ ├── compare/
│ │ │ ├── kit.mdx
│ │ │ └── meta.json
│ │ ├── debug-mode.mdx
│ │ ├── examples.mdx
│ │ ├── getting-started/
│ │ │ ├── client.mdx
│ │ │ ├── meta.json
│ │ │ └── signers.mdx
│ │ ├── guides/
│ │ │ ├── codama.mdx
│ │ │ ├── index.mdx
│ │ │ ├── loading-and-saving-keypairs.mdx
│ │ │ ├── meta.json
│ │ │ ├── reference-keys.mdx
│ │ │ ├── solana-pay.mdx
│ │ │ └── tokens/
│ │ │ ├── burn-tokens.mdx
│ │ │ ├── create-token.mdx
│ │ │ ├── get-token-metadata.mdx
│ │ │ ├── index.mdx
│ │ │ ├── meta.json
│ │ │ ├── mint-tokens.mdx
│ │ │ └── transfer-tokens.mdx
│ │ ├── index.mdx
│ │ ├── meta.json
│ │ ├── react/
│ │ │ ├── examples.mdx
│ │ │ ├── getting-started.mdx
│ │ │ ├── hooks/
│ │ │ │ ├── client.mdx
│ │ │ │ ├── data-fetching.mdx
│ │ │ │ ├── index.mdx
│ │ │ │ ├── meta.json
│ │ │ │ └── transactions.mdx
│ │ │ ├── index.mdx
│ │ │ └── meta.json
│ │ └── typescript.mdx
│ ├── generic.d.ts
│ ├── next.config.mjs
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── public/
│ │ └── site.webmanifest
│ ├── source.config.ts
│ ├── src/
│ │ ├── app/
│ │ │ ├── (home)/
│ │ │ │ ├── layout.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── api/
│ │ │ │ ├── [[...slug]]/
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ └── search/
│ │ │ │ └── route.ts
│ │ │ ├── docs/
│ │ │ │ ├── [[...slug]]/
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ └── og/
│ │ │ │ └── [...slug]/
│ │ │ │ ├── og.tsx
│ │ │ │ └── route.tsx
│ │ │ ├── global.css
│ │ │ ├── layout.config.tsx
│ │ │ ├── layout.tsx
│ │ │ ├── not-found.tsx
│ │ │ └── styles/
│ │ │ ├── brand.css
│ │ │ ├── fumadocs-overrides.css
│ │ │ └── typography.css
│ │ ├── components/
│ │ │ ├── fathom-analytics.tsx
│ │ │ ├── footer-links.tsx
│ │ │ └── package-badges.tsx
│ │ ├── const.ts
│ │ └── lib/
│ │ ├── Spread.tsx
│ │ └── source.ts
│ ├── tsconfig.json
│ ├── typedoc-data.mjs
│ └── vercel.json
├── e2e/
│ └── imports/
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── package.json
│ ├── src/
│ │ ├── imports.js
│ │ └── imports.ts
│ └── tsconfig.json
├── examples/
│ ├── get-started/
│ │ ├── .gitignore
│ │ ├── .prettierignore
│ │ ├── .prettierrc
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── airdrop.ts
│ │ │ ├── basic-compare.ts
│ │ │ ├── basic.ts
│ │ │ ├── intro.ts
│ │ │ ├── reference-keys.ts
│ │ │ └── tokens.ts
│ │ └── tsconfig.json
│ └── tokens/
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── 1.intro.ts
│ │ ├── 2.create-token-mint.ts
│ │ ├── 3.create-token-mint-builder.ts
│ │ ├── 4.mint-tokens.ts
│ │ ├── 5.mint-tokens-builder.ts
│ │ ├── 6.transfer-tokens.ts
│ │ └── 7.transfer-tokens-builder.ts
│ └── tsconfig.json
├── idls/
│ ├── build-codama-clients.sh
│ └── token_metadata/
│ ├── codama.json
│ └── idl.json
├── package.json
├── packages/
│ ├── build-scripts/
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── dev-flag.ts
│ │ ├── getBaseConfig.ts
│ │ ├── package.json
│ │ ├── register-node-globals.cjs
│ │ ├── tsconfig.json
│ │ ├── tsup.config.browser.ts
│ │ ├── tsup.config.library.ts
│ │ └── tsup.config.package.ts
│ ├── config-eslint/
│ │ ├── base.mjs
│ │ └── package.json
│ ├── gill/
│ │ ├── .gitignore
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── eslint.config.mjs
│ │ ├── generate-reexports.ts
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── __tests__/
│ │ │ │ ├── accounts.ts
│ │ │ │ ├── addresses.ts
│ │ │ │ ├── base64-bytes-to.ts
│ │ │ │ ├── base64-transactions.ts
│ │ │ │ ├── create-codama.config.ts
│ │ │ │ ├── create-solana-client.ts
│ │ │ │ ├── create-token-instructions.ts
│ │ │ │ ├── create-transaction.ts
│ │ │ │ ├── debug.ts
│ │ │ │ ├── explorer.ts
│ │ │ │ ├── get-oldest-signature.ts
│ │ │ │ ├── keypairs-base58.ts
│ │ │ │ ├── mint-tokens-instructions.ts
│ │ │ │ ├── reference-keys.ts
│ │ │ │ ├── rpc.ts
│ │ │ │ ├── token/
│ │ │ │ │ ├── assert-is-mint.ts
│ │ │ │ │ └── fetch-token-accounts.ts
│ │ │ │ ├── transfer-tokens-instructions.ts
│ │ │ │ ├── ui-amount.ts
│ │ │ │ ├── utils.ts
│ │ │ │ └── verify-signature.ts
│ │ │ ├── __typetests__/
│ │ │ │ ├── create-solana-client.ts
│ │ │ │ ├── create-token-transaction.ts
│ │ │ │ ├── create-transaction.ts
│ │ │ │ ├── mint-tokens-transaction.ts
│ │ │ │ ├── prepare-transaction.ts
│ │ │ │ ├── send-and-confirm-transaction-with-signers-typetests.ts
│ │ │ │ ├── simulate-transaction.ts
│ │ │ │ └── transfer-tokens-transaction.ts
│ │ │ ├── core/
│ │ │ │ ├── base64-bytes-to.ts
│ │ │ │ ├── base64-from-transaction.ts
│ │ │ │ ├── base64-to-transaction.ts
│ │ │ │ ├── const.ts
│ │ │ │ ├── create-codama-config.ts
│ │ │ │ ├── create-solana-client.ts
│ │ │ │ ├── create-transaction.ts
│ │ │ │ ├── debug.ts
│ │ │ │ ├── explorer.ts
│ │ │ │ ├── get-oldest-signature.ts
│ │ │ │ ├── get-signature-from-bytes.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── insert-reference-key.ts
│ │ │ │ ├── keypairs-base58.ts
│ │ │ │ ├── keypairs-extractable.ts
│ │ │ │ ├── prepare-transaction.ts
│ │ │ │ ├── rent.ts
│ │ │ │ ├── rpc.ts
│ │ │ │ ├── send-and-confirm-transaction-with-signers.ts
│ │ │ │ ├── simulate-transaction.ts
│ │ │ │ ├── utils.ts
│ │ │ │ └── verify-signature.ts
│ │ │ ├── index.ts
│ │ │ ├── node/
│ │ │ │ ├── const.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── load-keypair-base58.ts
│ │ │ │ ├── load-keypair.ts
│ │ │ │ └── save-keypair.ts
│ │ │ ├── programs/
│ │ │ │ ├── address-lookup-table/
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── reexports.ts
│ │ │ │ ├── compute-budget/
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── reexports.ts
│ │ │ │ │ └── utils.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── memo/
│ │ │ │ │ ├── generated/
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── instructions/
│ │ │ │ │ │ │ ├── addMemo.ts
│ │ │ │ │ │ │ └── index.ts
│ │ │ │ │ │ └── programs/
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ └── memo.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── shared/
│ │ │ │ │ └── index.ts
│ │ │ │ ├── system/
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── reexports.ts
│ │ │ │ ├── token/
│ │ │ │ │ ├── addresses.ts
│ │ │ │ │ ├── assert-is-mint.ts
│ │ │ │ │ ├── fetch-token-accounts.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── instructions/
│ │ │ │ │ │ ├── create-token.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── mint-tokens.ts
│ │ │ │ │ │ ├── transfer-tokens.ts
│ │ │ │ │ │ └── types.ts
│ │ │ │ │ ├── reexports.ts
│ │ │ │ │ ├── transactions/
│ │ │ │ │ │ ├── create-token.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── mint-tokens.ts
│ │ │ │ │ │ ├── transfer-tokens.ts
│ │ │ │ │ │ └── types.ts
│ │ │ │ │ └── ui-amount.ts
│ │ │ │ └── token-metadata/
│ │ │ │ ├── addresses.ts
│ │ │ │ ├── generated/
│ │ │ │ │ ├── accounts/
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ └── metadata.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── instructions/
│ │ │ │ │ │ ├── createMetadataAccountV3.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ └── updateMetadataAccountV2.ts
│ │ │ │ │ ├── programs/
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ └── tokenMetadata.ts
│ │ │ │ │ └── types/
│ │ │ │ │ ├── assetData.ts
│ │ │ │ │ ├── authorizationData.ts
│ │ │ │ │ ├── collection.ts
│ │ │ │ │ ├── collectionDetails.ts
│ │ │ │ │ ├── collectionDetailsToggle.ts
│ │ │ │ │ ├── collectionToggle.ts
│ │ │ │ │ ├── createArgs.ts
│ │ │ │ │ ├── creator.ts
│ │ │ │ │ ├── data.ts
│ │ │ │ │ ├── dataV2.ts
│ │ │ │ │ ├── delegateArgs.ts
│ │ │ │ │ ├── escrowAuthority.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── key.ts
│ │ │ │ │ ├── mintArgs.ts
│ │ │ │ │ ├── payload.ts
│ │ │ │ │ ├── payloadType.ts
│ │ │ │ │ ├── printSupply.ts
│ │ │ │ │ ├── programmableConfig.ts
│ │ │ │ │ ├── proofInfo.ts
│ │ │ │ │ ├── reservation.ts
│ │ │ │ │ ├── ruleSetToggle.ts
│ │ │ │ │ ├── seedsVec.ts
│ │ │ │ │ ├── tokenStandard.ts
│ │ │ │ │ ├── updateArgs.ts
│ │ │ │ │ ├── useMethod.ts
│ │ │ │ │ ├── uses.ts
│ │ │ │ │ └── usesToggle.ts
│ │ │ │ └── index.ts
│ │ │ └── types/
│ │ │ ├── explorer.ts
│ │ │ ├── global.d.ts
│ │ │ ├── index.ts
│ │ │ ├── rpc.ts
│ │ │ └── transactions.ts
│ │ ├── tsconfig.declarations.json
│ │ ├── tsconfig.json
│ │ ├── tsup.config.package.ts
│ │ ├── typedoc.core.json
│ │ ├── typedoc.node.json
│ │ └── typedoc.programs.json
│ ├── react/
│ │ ├── .gitignore
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── eslint.config.mjs
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── __tests__/
│ │ │ │ └── placeholder.ts
│ │ │ ├── __typeset__/
│ │ │ │ ├── account.ts
│ │ │ │ ├── balance.ts
│ │ │ │ ├── get-slot.ts
│ │ │ │ ├── latest-blockhash.ts
│ │ │ │ ├── multiple-accounts.ts
│ │ │ │ ├── program-accounts.ts
│ │ │ │ ├── recent-prioritization-fees.ts
│ │ │ │ ├── signature-statuses.ts
│ │ │ │ ├── signatures-for-address.ts
│ │ │ │ ├── simulate-transaction.ts
│ │ │ │ ├── token-account-balance.ts
│ │ │ │ ├── token-account.ts
│ │ │ │ ├── token-mint.ts
│ │ │ │ └── transaction.ts
│ │ │ ├── const.ts
│ │ │ ├── hooks/
│ │ │ │ ├── account.ts
│ │ │ │ ├── balance.ts
│ │ │ │ ├── client.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── latest-blockhash.ts
│ │ │ │ ├── multiple-accounts.ts
│ │ │ │ ├── program-accounts.ts
│ │ │ │ ├── recent-prioritization-fees.ts
│ │ │ │ ├── signature-statuses.ts
│ │ │ │ ├── signatures-for-address.ts
│ │ │ │ ├── simulate-transaction.ts
│ │ │ │ ├── slot.ts
│ │ │ │ ├── token-account-balance.ts
│ │ │ │ ├── token-account.ts
│ │ │ │ ├── token-mint.ts
│ │ │ │ ├── transaction.ts
│ │ │ │ └── types.ts
│ │ │ ├── index.ts
│ │ │ ├── providers.tsx
│ │ │ └── types/
│ │ │ └── global.d.ts
│ │ ├── tsconfig.declarations.json
│ │ ├── tsconfig.json
│ │ ├── tsup.config.package.ts
│ │ └── typedoc.json
│ ├── solana-pay/
│ │ ├── .gitignore
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── __tests__/
│ │ │ │ ├── encode-url.ts
│ │ │ │ ├── fetchers.ts
│ │ │ │ ├── parse-url.ts
│ │ │ │ └── response.ts
│ │ │ ├── __typetests__/
│ │ │ │ └── response.ts
│ │ │ ├── constants.ts
│ │ │ ├── encode-url.ts
│ │ │ ├── fetchers.ts
│ │ │ ├── global.d.ts
│ │ │ ├── index.ts
│ │ │ ├── parse-url.ts
│ │ │ ├── request.ts
│ │ │ └── response.ts
│ │ ├── tsconfig.declarations.json
│ │ ├── tsconfig.json
│ │ ├── tsup.config.package.ts
│ │ └── typedoc.json
│ ├── svelte/
│ │ ├── .gitignore
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── README.md
│ │ ├── eslint.config.mjs
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── __tests__/
│ │ │ │ └── placeholder.ts
│ │ │ ├── const.ts
│ │ │ ├── index.ts
│ │ │ └── types/
│ │ │ ├── global.d.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.declarations.json
│ │ ├── tsconfig.json
│ │ └── tsup.config.package.ts
│ ├── test-config/
│ │ ├── .npmrc
│ │ ├── .prettierignore
│ │ ├── browser-environment.ts
│ │ ├── global.d.ts
│ │ ├── jest-dev.config.ts
│ │ ├── jest-lint.config.ts
│ │ ├── jest-prettier.config.ts
│ │ ├── jest-unit.config.browser.ts
│ │ ├── jest-unit.config.common.ts
│ │ ├── jest-unit.config.node.ts
│ │ ├── package.json
│ │ ├── setup-define-version-constant.ts
│ │ ├── setup-dev-mode.ts
│ │ ├── setup-secure-context.ts
│ │ ├── setup-text-encoder.ts
│ │ ├── setup-undici-fetch.ts
│ │ ├── setup-web-buffer-global.ts
│ │ ├── setup-webcrypto.ts
│ │ ├── setup-whatwg-fetch.ts
│ │ └── tsconfig.json
│ ├── tsconfig/
│ │ ├── .npmrc
│ │ ├── README.md
│ │ ├── base.json
│ │ └── package.json
│ └── vue/
│ ├── .gitignore
│ ├── .npmrc
│ ├── .prettierignore
│ ├── README.md
│ ├── eslint.config.mjs
│ ├── package.json
│ ├── src/
│ │ ├── __tests__/
│ │ │ └── placeholder.ts
│ │ ├── const.ts
│ │ ├── index.ts
│ │ └── types/
│ │ ├── global.d.ts
│ │ └── index.ts
│ ├── tsconfig.declarations.json
│ ├── tsconfig.json
│ └── tsup.config.package.ts
├── pnpm-workspace.yaml
├── turbo.json
├── typedoc.json
└── typedoc.plugin.mjs
================================================
FILE CONTENTS
================================================
================================================
FILE: .bundlemonrc.json
================================================
{
"baseDir": "./packages",
"files": [
{
"friendlyName": "gill production bundle",
"path": "gill/dist/index.production.min.js"
},
{
"path": "**/dist/**/index.*.mjs"
}
],
"includeCommitMessage": true,
"reportOutput": ["github"]
}
================================================
FILE: .changeset/README.md
================================================
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
================================================
FILE: .changeset/config.json
================================================
{
"$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
"access": "public",
"baseBranch": "master",
"changelog": [
"@changesets/changelog-github",
{
"repo": "gillsdk/gill"
}
],
"commit": false,
"ignore": [
"@gillsdk/vue", "@gillsdk/svelte",
"@gillsdk/tsconfig", "@gillsdk/build-scripts", "@gillsdk/test-config"
],
"fixed": [["@gillsdk/!({build-scripts,config-*,test-*,tsconfig})"]],
"linked": [],
"updateInternalDependencies": "patch"
}
================================================
FILE: .changeset/gold-chicken-rhyme.md
================================================
---
"@gillsdk/solana-pay": minor
---
made explicit types for parsed and non parsed solana pay transaction request response
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: If you've already confirmed something is broken within the gill sdk itself, create a bug report.
title: "[BUG] "
labels: ""
assignees: ""
---
<!-- Please provide all of the information requested below. Our maintainers are limited on time without all of this information it's not possible for us to help and your bug report will be closed. -->
**Which gill sdk packages are you having issues with?**
For example: gill, @gillsdk/react
**What versions of these packages are you using?**
For example: v0.11.0
**What build tool (or framework if it abstracts the build tool) are you using?**
For example: Next.js 15.1.7, Vite 6.1.0
**What version of NodeJS (or other server runtime) are you using?**
For example: NodeJS v20.0.0, Bun v1.2.1
**What package manager (and version) are you using?**
For example: pnpm v9.1.0, npm v11.4.2
**What browser are you using?**
For example: Chrome, Brave, Safari, or N/A
**What operating system are you using?**
For example: Ubuntu, PopOS, Fedora, MacOS, Windows, etc
**Reproduction URL**
A public GitHub repo that includes a minimal reproduction of the bug. **Please do not link to your actual project**,
what we need instead is a _minimal_ reproduction in a fresh project without any unnecessary code. This means it doesn't
matter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways.
A reproduction is **required** when filing a bug report — any bug report opened without a reproduction will be closed
and you'll be asked to create a new issue that includes a reproduction. We're a small team and we can't keep up with the
volume of issues we receive if we need to reproduce each issue from scratch ourselves.
**Describe your issue**
Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead.
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature Request
about: Suggest an idea for the gill sdk
title: "[FEATURE] "
labels: "enhancement"
assignees: ""
---
## Summary
<!-- A clear and concise description of what you want to happen. -->
## Problem Statement
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem
is.
## Proposed Solution
**Describe the solution you'd like** A clear and concise description of what you want to happen.
## Alternatives Considered
**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features
you've considered.
## Use Cases
**Who would benefit from this feature?**
- [ ] End users
- [ ] Developers
- [ ] System administrators
- [ ] Other: \***\*\_\_\_\*\***
**How would this feature be used?** Provide specific examples or user stories.
## Implementation Details
**Do you have any ideas on how this could be implemented?**
- Technical approach suggestions
- Dependencies or requirements
- Breaking changes (if any)
## Additional Context
**Add any other context or screenshots about the feature request here.**
- Screenshots
- Mockups
- References to similar features in other projects
- Links to relevant documentation
## Acceptance Criteria
**What would need to be true for this feature to be considered complete?**
- [ ] Criterion 1
- [ ] Criterion 2
- [ ] Criterion 3
## Priority
**How important is this feature to you?** Select one.
- [ ] Critical - Blocking my work
- [ ] High - Would significantly improve my workflow
- [ ] Medium - Nice to have
- [ ] Low - Minor improvement
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
### Problem
### Summary of Changes
Fixes #
================================================
FILE: .github/workflows/actions/install-dependencies/action.yml
================================================
name: Install Dependencies
description: Sets up Node and its package manager, then installs all dependencies
inputs:
version:
default: 'lts/*'
type: string
runs:
using: composite
steps:
- name: Install package manager
uses: pnpm/action-setup@v3
with:
version: 9.1.0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.version }}
cache: 'pnpm'
- name: Install dependencies
shell: bash
run: pnpm install
================================================
FILE: .github/workflows/bundlesize.yml
================================================
name: Compare bundle size
on:
push:
branches: [master]
paths-ignore:
- 'docs/**'
pull_request:
types: [synchronize, opened, reopened]
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
with:
version: current
- name: Build
run: pnpm build
- name: BundleMon
uses: lironer/bundlemon-action@v1
================================================
FILE: .github/workflows/preview-docs.yml
================================================
name: Preview Documentation
on:
pull_request:
paths:
- "docs/**"
permissions:
contents: read
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: "1"
NEXT_TELEMETRY_DISABLED: "1"
VERCEL_TELEMETRY_DISABLED: "1"
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
preview-docs:
if: github.actor != 'dependabot[bot]'
permissions:
pull-requests: write
runs-on: ubuntu-latest
name: Build Documentation Preview
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Install Isolated Docs Dependencies
working-directory: ./docs/
shell: bash
run: pnpm install --ignore-workspace
- name: Install Vercel CLI
run: pnpm install -g vercel
- name: Deploy to Vercel
shell: bash
id: vercel_deploy
env:
BRANCH_NAME: ${{ github.head_ref }}
PR_NUMBER: ${{ github.event.pull_request.number }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
vercel pull --token="$VERCEL_TOKEN" --yes --environment=preview
vercel build --token="$VERCEL_TOKEN" --target=preview
DEPLOY_OUTPUT=$(vercel deploy --token="$VERCEL_TOKEN" --archive=tgz --env GITHUB_PR_NUMBER="$PR_NUMBER" --env GITHUB_PR_BRANCH="$BRANCH_NAME" --prebuilt --target=preview 2>&1)
DEPLOY_EXIT_CODE=$?
if [ $DEPLOY_EXIT_CODE -ne 0 ]; then
echo "Vercel deploy failed:"
echo "$DEPLOY_OUTPUT"
exit $DEPLOY_EXIT_CODE
fi
DEPLOY_URL=$(echo "$DEPLOY_OUTPUT" | grep -o 'https://[a-zA-Z0-9.-]*\.vercel\.app' | tail -1)
echo "preview_url=$DEPLOY_URL" >> $GITHUB_OUTPUT
- name: Comment on PR with Preview URL
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PREVIEW_URL: "${{ steps.vercel_deploy.outputs.preview_url }}"
run: |
gh pr comment $PR_NUMBER --body "Documentation Preview: $PREVIEW_URL" --create-if-none --edit-last
================================================
FILE: .github/workflows/publish-canary-releases.yml
================================================
name: Publish Canary Releases
on:
workflow_dispatch:
branches:
- master
pull_request:
types: [opened, synchronize, labeled]
permissions:
contents: read
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
build-and-publish-snapshots-to-npm:
permissions:
pull-requests: write
runs-on: ubuntu-latest
# Only run if it's a push to master, manual dispatch, or PR with 'canary' label
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'canary'))
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Run Build Step (force)
run: pnpm turbo build --force=true
- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Canary Releases
run: |
find packages/* -maxdepth 0 -type d -print0 | \
xargs -t0 -n 1 -I {} \
sh -c 'cd {} && pnpm pkg delete devDependencies'
pnpm changeset version --snapshot canary
pnpm turbo publish-packages --concurrency=${TURBO_CONCURRENCY:-1}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_TAG: canary
- name: Remove canary label from PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'canary'
});
================================================
FILE: .github/workflows/publish-docs.yml
================================================
name: Publish Documentation
on:
workflow_dispatch:
branches:
- master
push:
branches:
- master
paths:
- 'docs/**'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
NEXT_TELEMETRY_DISABLED: '1'
VERCEL_TELEMETRY_DISABLED: '1'
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
deploy-docs:
runs-on: ubuntu-latest
name: Deploy Documentation
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Install Isolated Docs Dependencies
working-directory: ./docs/
shell: bash
run: pnpm install --ignore-workspace
- name: Install Vercel CLI
run: pnpm install -g vercel
- name: Deploy to Vercel
shell: bash
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
vercel pull --token="$VERCEL_TOKEN" --yes --environment=production
vercel build --token="$VERCEL_TOKEN" --prod
vercel deploy --token="$VERCEL_TOKEN" --archive=tgz --prebuilt --prod
================================================
FILE: .github/workflows/publish-packages.yml
================================================
name: Version & Publish Packages
on:
workflow_dispatch:
branches:
- master
paths-ignore:
- 'docs/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: "1"
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
build-and-publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Changesets Pull Request or Trigger an NPM Publish
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Pre-Build Step
run: pnpm prebuild --force=true
- name: Choose Build Step
id: build-step-decider
run:
echo "step-name=${{ steps.changesets.outputs.hasChangesets == 'false' && 'publish-packages
--concurrency=${TURBO_CONCURRENCY:-1}' || 'build' }}" >> $GITHUB_OUTPUT
- name: Run Build Step (force)
run: pnpm turbo ${{ steps.build-step-decider.outputs.step-name }} --force=true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_TAG: next
# - name: Push Git Tag
# if: steps.changesets.outputs.hasChangesets == 'false'
# run: |
# VERSION_TAG=v$(cd packages/library/ && pnpm pkg get version | sed -n '2p' | grep -o '"\([^"]\)\+"$' | tr -d \")
# if ! git ls-remote --tags | grep -q "$VERSION_TAG"; then git tag $VERSION_TAG && git push --tags; fi
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/pull-requests.yml
================================================
name: Pull requests
on:
pull_request:
paths-ignore:
- "docs/**"
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: "1"
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1
jobs:
# Needed for grouping check-web3 strategies into one check for mergify
all-pr-checks:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- run: echo "Done"
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node:
# !stopping builds on current since node v25.2.0 breaks things with `localStorage`
# - "current"
- "lts/*"
name: Build & Test on Node ${{ matrix.node }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
with:
version: ${{ matrix.node }}
- name: Build (with prebuild)
run: pnpm build # Don't add --concurrency here; it's already baked in
- name: Test
run: pnpm test # Don't add --concurrency here; it's already baked in
================================================
FILE: .gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules
.pnp
.pnp.js
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# turbo
.turbo
# typedocs output
.docs
# Sapling SCM
.sl
# `solana-test-validator`
.agave/
.cache
test-ledger
# coverage reports
coverage
# GitHub Pages deploy directory
.ghpages-deploy
*.env*
*.local*
.vercel
================================================
FILE: .prettierignore
================================================
node_modules
pnpm-lock.yaml
LICENSE
.changeset/
.github/PULL_REQUEST_TEMPLATE.md
declarations/
dist/
doc/
lib/
kit/
.docs
.turbo
.next
.vercel
**/generated/
**/generated/**
generated/
generated/**
================================================
FILE: .prettierrc
================================================
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true,
"semi": true,
"trailingComma": "all",
"proseWrap": "always",
"arrowParens": "always",
"printWidth": 120
}
================================================
FILE: .vscode/settings.json
================================================
{
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
"source.sortMembers": "explicit"
},
"editor.formatOnPaste": true,
"editor.formatOnType": false,
"typescript.preferences.organizeImports": true,
"javascript.preferences.organizeImports": true,
"typescript.preferences.importModuleSpecifierEnding": "js",
// Set Prettier as the default formatter
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Language-specific formatters (optional overrides)
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Ensure consistent line endings
"files.eol": "\n"
}
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
## Bug fixes
If you've found a bug in gill that you'd like to fix, please [open an issue](https://github.com/gillsdk/gill/issues/new)
before working on specific code changes to ensure it is within scope and desire for this library. Once approved,
[submit a pull request](https://github.com/gillsdk/gill/pulls) with your changes. Include a helpful description of the
problem and how your changes address it, and provide tests so we can verify the fix works as expected.
## New features
If there's a new feature you'd like to see added to gill, please
[open an issue](https://github.com/gillsdk/gill/issues/new) before working on specific code changes to ensure it is
within scope and desire for this library.
Contributions are welcome and loved, but it's best to discuss major changes before investing time in implementation.
## System requirements
Before getting started, ensure your system has access to the following tools:
- [Node.js](https://nodejs.org/)
- [pnpm](https://pnpm.io/)
## Getting started
Clone and prepare the repo locally:
```sh
git clone https://github.com/gillsdk/gill.git
cd gill
pnpm install
```
Build all the packages in parallel (via Turborepo):
```sh
pnpm build
```
> Note: You must run the build command the first time manually before running the test commands detailed below.
To build a specific package, use the `--filter` flag:
```sh
pnpm build --filter=gill
pnpm build --filter=@gillsdk/react
# or multiple specific packages
pnpm build --filter=gill --filter=@gillsdk/react
```
## Running tests
All unit tests can be run at the same time (including rebuilding):
```sh
pnpm test
```
> Note: You must run the build command the first time manually before running the `test` command.
Please ensure that all tests are passing when submitting a pull request. If you're adding new features to the gill sdk,
always include tests.
## Pull request process
When submitting a pull request:
- Ensure the pull request title and description explain the changes you made and why you made them.
- Include a test plan section that outlines how you tested your contributions. We do not accept contributions without
tests.
- Ensure all tests pass.
When a pull request is created, gill maintainers will be notified automatically.
## Communication
- **GitHub issues**: For bug reports and feature requests
- **GitHub pull requests**: For code contributions
================================================
FILE: LICENSE
================================================
Copyright (c) 2023 Solana Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: MAINTAINERS.md
================================================
# Maintainers
In this document, you can find various pieces of information about the gill sdk and its associated packages. From
architecture and build steps to foot-guns and gotchas.
This should be a living document to describe in detail anything the maintainers of this repository feel the need should
be specifically elaborated on.
# Publishing and versioning
This monorepo contains many the many packages that constitute the "gill sdk". Including `gill` and those scoped within
`@gillsdk` (e.g. `@gillsdk/react`).
## Versioning
This repo uses [changesets](https://github.com/changesets/changesets) to aid in versioning and auto generating the
various package changelog documents.
On each PR that requires a version bump (major, minor, or patch), simply run the `pnpm changeset` command. This will
automatically detect which packages had code files changed and requiring a version bump.
The `changeset` command will create a markdown file in the [.changeset](./.changeset/) directory which will be auto
detected by the Changeset bot when PRs are pushed to github.
## Publishing new versions
All package versions are published by the [publish-packages](./.github/workflows/publish-packages.yml) action.
When a PR is merged to the `master` branch, this github action will do one of two things:
1. Read all the available changeset files and create/update a "Version Packages" PR that details all the changes since
the last version bump, generate changelog entries for them, and perform appropriate version bumps.
([See example here](https://github.com/gillsdk/gill/pull/218)).
2. If the last merge to the `master` branch was a "Version Packages" PR, the actions will publish all the changed
packages.
This repo has an NPM token stored in it for the [`gill-maintainers`](https://www.npmjs.com/~gill-maintainers) NPM user
which is the CI bot account for publishing. This account should be the only authorized user to publish these packages,
helping to mitigate various supply chain attacks that have become so common :/
# Multiple import paths
The core `gill` library is constructed in such a way to have multiple "import paths" to access different functionality.
Including:
```ts
import { ... } from "gill";
import { ... } from "gill/programs";
import { ... } from "gill/node";
```
To achieve this, the `gill` package includes the following configurations:
- "exports" fields in the [`package.json`](./packages/gill/package.json) for each of these paths
- TSUP entries for each desired paths ([see here](./packages/gill/tsup.config.package.ts))
- tsconfig settings for each path ([see here](./packages/gill/tsconfig.declarations.json))
Altering (or removing these) configuration settings will break these "import paths" for consumers of the `gill` package
in different ways.
For example, altering the tsconfig declarations from:
```json
{
...
"include": ["src/programs/token/index.ts", "src/programs/index.ts", "src/node/index.ts", "src/index.ts", "src/types"]
}
```
to
```json
{
...
"include": ["src"]
}
```
will break developer experience by removing all the types from the different paths.
# Docs
When building the docs for production, the `build-api-docs.sh` script is run which will run the `compile:docs` script
for each of the configured submodule packages. This includes building the submodule itself, generating typedocs for it,
and moving those typedocs into the `docs/content/api` directory in a sub-directory for each submodule.
This process utilizes the `typedoc-data.mjs` to know where specifically to put each submodule's docs and what to insert
into its respective `index.mdx` to ensure we have nice looking docs.
## Submodule API references
To include any submodule in the gill docs' [API references section](https://www.gillsdk.com/api), each submodules must
be properly configured.
steps to update include a submodule package in the api docs:
In the `docs` directory:
1. install the submodule into the docs themselves (required for use by `twoslash` to get prettier code blocks)
```shell
pnpm add @gillsdk/react@latest --ignore-workspace
```
2. update the docs' `update:gill` script to include the new package (allow maintainers to update all packages at once)
3. update the `typedoc-data.mjs` to include the key and frontmatter details for the submodules, following existing
patterns
In the respective submodule's source code directory:
1. Setup the submodule's typedoc configuration via a `typedoc.json` file in the submodules's directory (along side it's
`package.json`)
1. Create a `compile:docs` script command that will compile the typedocs
- See `@gillsdk/react` [here](/packages/react/package.json) for an example of a submodule with a single import path
- See `gill` [here](/packages/gill/package.json) for an example of a submodule with a multiple import paths
1. Create a `move:docs` script command that will relocate the compiled typedocs from its submodule specific build
location to the actual gill docs content directory
1. Create a `clean:docs` script command that can purge the existing submodule docs (ensures the docs build is fresh)
> Note: The `docs/content/api` subdirectories are intentionally git ignored to ensure they are built fresh on docs
> deployments. This also allows the docs site to load much faster when running locally (by removing the submodule api
> references directory) since we rarely need to view these locally. But you can still build the api references and view
> them if you need too. Flexibility :)
# Token Metadata program client
The included Token Metadata program client was generated using [Codama](https://github.com/codama-idl/codama).
## Minimal functionality
Given the IDL, Codama will generate a LOT of code that we simply do not need to or want to ship within the gill sdk. So
we (manually) removed it. Gill intentionally only ships a minimal amount of Token Metadata functionality to get most
users by with core uses (namely attaching metadata to legacy SPL tokens)
Care should be taken when regenerating this program client. Especially to prevent the `gill` package size from
ballooning (and therefore developer applications from ballooning.)
## Naming collisions
There is a naming collision between the Token Metadata program and the SPL Token/Token22 program clients for the
`MintArgs` type.
Since gill ships a generated client for Token Metadata, and reexports the Token22 client from its source package, the
Token Metadata's `MintArgs` were renamed to `MetadataMintArgs`.
See
[token-metadata/generated/types/mintArgs.ts](./packages/gill/src/programs/token-metadata/generated/types/mintArgs.ts)
================================================
FILE: README.md
================================================
<h1 align="center">
gill sdk
</h1>
<p align="center">
javascript/typescript client library for interacting with the Solana blockchain
</p>
<p align="center">
<a href="https://github.com/gillsdk/gill/actions/workflows/publish-packages.yml"><img src="https://img.shields.io/github/actions/workflow/status/gillsdk/gill/publish-packages.yml?logo=GitHub&label=tests" /></a>
<a href="https://www.npmjs.com/package/gill"><img src="https://img.shields.io/npm/v/gill?logo=npm&color=377CC0" /></a>
<a href="https://www.npmjs.com/package/gill"><img src="https://img.shields.io/npm/dm/gill?color=377CC0" /></a>
</p>
<p align="center">
<img width="600" alt="gill" src="https://raw.githubusercontent.com/gillsdk/gill/refs/heads/master/docs/public/cover.png" />
</p>
## Overview
Welcome to the gill sdk, a JavaScript/TypeScript client library for interacting with the [Solana](http://solana.com/)
blockchain. You can use it to build Solana apps in Node, web, React Native, or just about any other JavaScript
environment.
Gill is built on top of the modern javascript libraries for Solana built by Anza called
[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as "web3.js v2"). By utilizing the same types and
functions under the hood, `gill` is compatible with `kit`. See [Replacing Kit with gill](#replace-kit-with-gill).
> For a comparison of using gill vs `@solana/kit`, take a look at the
> [gill vs @solana/kit comparison docs](https://gillsdk.com/docs/compare/kit) and the
> [comparison examples](https://github.com/gillsdk/gill/tree/master/examples/get-started#comparison-of-gill-vs-solanakit-aka-web3js-v2).
## Documentation
You can find the gill library docs here:
- [gill docs site](https://gillsdk.com)
- [gill setup guide](https://gillsdk.com/docs#quick-start)
- [gill API references](https://gillsdk.com/api)
## Packages
The following packages are published from within this repo, collectively known as the "gill sdk":
| Package | Description | Version | Source |
| :-------------------- | :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `gill` | SDK for building on the Solana blockchain | [](https://www.npmjs.com/package/gill) | [Source](https://github.com/gillsdk/gill/tree/master/packages/gill) |
| `@gillsdk/react` | React hooks library for the Solana blockchain | [](https://www.npmjs.com/package/@gillsdk/react) | [Source](https://github.com/gillsdk/gill/tree/master/packages/react) |
| `@gillsdk/solana-pay` | Modern Solana Pay protocol client library | [](https://www.npmjs.com/package/@gillsdk/solana-pay) | [Source](https://github.com/gillsdk/gill/tree/master/packages/solana-pay) |
## Development
### Environment setup
1. Install [NodeJS](https://nodejs.org/en)
2. Install [pnpm](https://pnpm.io/installation)
Clone and prepare this repo locally:
```shell
git clone https://github.com/gillsdk/gill.git
cd gill
pnpm install
```
### Build
To build all the packages in parallel (via Turborepo):
```shell
pnpm build
```
> Note: You must run the build command the first time manually before running the test commands detailed below.
To build a specific package, use the `--filter` flag:
```shell
pnpm build --filter=gill
pnpm build --filter=@gillsdk/react
# or multiple specific packages
pnpm build --filter=gill --filter=@gillsdk/react
```
### Testing
All unit tests can be run at the same time (including rebuilding):
```shell
pnpm test
```
> Note: You must run the build command the first time manually before running the `test` command.
## Contributing
Contributions are welcome and loved! Please [open an issue](https://github.com/gillsdk/gill/issues/new) before working
on specific code changes to ensure it is within scope and desire for this library.
See the [CONTRIBUTING.md](./CONTRIBUTING.md) document for full details.
Seriously. Read (and follow) this document if you want to contribute.
## Maintainers
See the [MAINTAINERS.md](./MAINTAINERS.md) document for full details.
================================================
FILE: docs/.eslintrc.json
================================================
{
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"@next/next/no-img-element": "off"
}
}
================================================
FILE: docs/.gitignore
================================================
# deps
/node_modules
# generated content
.contentlayer
.content-collections
.source
# api content
.docs
content/api/
!./content/api/index.mdx
!./content/api/meta.json
# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo
# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# others
.env*.local
.vercel
next-env.d.ts
# Turborepo
.turbo
================================================
FILE: docs/.npmrc
================================================
enable-pre-post-scripts = true
================================================
FILE: docs/.prettierignore
================================================
node_modules
pnpm-lock.yaml
LICENSE
.changeset/
.github/PULL_REQUEST_TEMPLATE.md
declarations/
dist/
doc/
lib/
kit/
.docs
.turbo
.next
.vercel
**/generated/
**/generated/**
generated/
generated/**
================================================
FILE: docs/.prettierrc
================================================
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true,
"semi": true,
"trailingComma": "all",
"proseWrap": "always",
"arrowParens": "always",
"printWidth": 100
}
================================================
FILE: docs/README.md
================================================
# gill documentation
Documentation website for gill, built with [Fumadocs](https://github.com/fuma-nama/fumadocs).
## Install dependencies
Install using the `--ignore-workspace` flag to ensure the dependencies of the documentation website
are separate from the library dependencies.
```bash
pnpm install --ignore-workspace
```
## Run development server
```bash
pnpm dev
```
Open http://localhost:3000 with your browser to see the result.
## Generating the API references documentation
The docs have a `prebuild` command that will generate API docs (via TypeDoc) for the library's
packages.
> When working locally, it is not required to build these in order to test the local docs site.
You can manually trigger building the API references using the following command:
```shell
pnpm prebuild
```
## Learn more
To learn more about Next.js and Fumadocs, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
================================================
FILE: docs/build-api-docs.sh
================================================
#!/usr/bin/env bash
set -euo pipefail
cd ..
pnpm compile:docs --output-logs=hash-only
================================================
FILE: docs/content/api/index.mdx
================================================
---
title: API Reference
description:
"Explore the functions, variables, types, and more that are included within the gill library, the
new Solana developer JavaScript SDK."
---
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
## Importing from gill
The `gill` library has a few different import paths to help segment the code within library and
improve compatibility in different environments (i.e. browser vs server).
To utilize the core functionality in either browser or server environments, you can import directly
from `gill` as expected:
```ts
import { ... } from "gill"
```
### Import program clients
The `gill` package includes several Solana program clients including Token/Token22, System, Compute
Budget, and several others. The available program clients can be imported from the `gill/programs`
path as follows:
```ts
import { ... } from "gill/programs"
```
### Import server only utilities
The `gill` package includes some "server only" functionality that is only usable in JavaScript
server runtimes like NodeJs and Bun. To utilize this specific functionality, you can import from
`gill/node` as follows:
```ts
import { ... } from "gill/node"
```
================================================
FILE: docs/content/api/meta.json
================================================
{
"title": "API Reference",
"root": true,
"pages": ["!index", "..."]
}
================================================
FILE: docs/content/docs/compare/kit.mdx
================================================
---
title: gill vs @solana/kit
description:
"Explore a side-by-side comparison of gill and @solana/kit (formerly known as web3js v2)"
---
The gill library is built directly on top of
[`@solana/kit`](https://www.npmjs.com/package/@solana/kit), the new JavaScript primitives developed
by [Anza](https://anza.xyz) as a more performant replacement for the old
[`@solana/web3.js`](https://www.npmjs.com/package/@solana/web3.js). Since Kit only ships these new
low level primitives, developers are forced into a single experience of manually crafting everything
and ballooning their applications with verbose boilerplate.
Gill is able to ship **both** the same low level primitives as Kit **and** lightly opinionated
abstractions to simplify common tasks, all from a single compatible interface. By simplifying across
the board with gill, developers can focus more time on their application's business logic and not
verbose boilerplate.
<Callout>
`@solana/kit` was formerly know as "web3.js v2" as it was originally published as the version
`2.x` release of `@solana/web3.js`. Anza engineers noted this to complicate and confuse the
upgrade path for the new technologies, so they decided to publish under the new package name of
`@solana/kit`.
</Callout>
You can find the complete scripts that the example code snippets were created from in the gill repo
[here](https://github.com/gillsdk/gill/tree/master/examples/get-started#comparison-of-gill-vs-solanakit-aka-web3js-v2).
Both are written with honest intentions, best practices, and attempt to be as concise as possible in
accomplishing the same task.
## Connecting to the blockchain
Every application will need to create a connection to the blockchain. A complete and usable
connection consists of the following three parts (at a minimum):
1. `rpc` - used to send [Solana RPC](https://solana.com/docs/rpc) requests over HTTP (the most
common way)
2. `rpcSubscriptions` - used to make certain RPC requests over websockets
3. `sendAndConfirmTransaction` - function used to actually send a complete transaction to the
blockchain for confirmation
The following code snippets demonstrate how to instantiate all three of these connection pieces for
each of the libraries:
```ts tab="gill"
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet",
});
```
```ts tab="@solana/kit"
import {
devnet,
createSolanaRpc,
createSolanaRpcSubscriptions,
sendAndConfirmTransactionFactory,
} from "@solana/kit";
const rpc = createSolanaRpc(devnet("https://api.devnet.solana.com"));
const rpcSubscriptions = createSolanaRpcSubscriptions(devnet("wss://api.devnet.solana.com"));
const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({
rpc,
rpcSubscriptions,
});
```
## Making RPC requests
For both `@solana/kit` and `gill`, making standard Solana RPC requests is the same: use the
previously created `rpc` object.
```ts
// get slot
const slot = await rpc.getSlot().send();
// get the latest blockhash
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
```
## Loading a signer
There are many different ways to obtain a keypair that is capable of performing the Solana specific
signing operations (aka a "signer"). This will look different for frontend and backend applications.
For local scripts, JavaScript server runtimes (like NodeJS and Bun), and backend applications it's
common to load a keypair from the file system or an ENV variable. The following is how to accomplish
this for both libraries:
```ts tab="gill"
import { loadKeypairSignerFromFile } from "gill/node";
const signer = await loadKeypairSignerFromFile();
```
```ts tab="@solana/kit"
import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { resolve } from "node:path";
import { createKeyPairFromBytes } from "@solana/kit";
const keypairFilePath = "~/.config/solana/id.json";
const resolvedKeypairPath = resolve(keypairFilePath.replace("~", homedir()));
const keypair = await createKeyPairFromBytes(
Uint8Array.from(JSON.parse(readFileSync(resolvedKeypairPath, "utf8"))),
);
```
Note that `@solana/kit` has no specific functionality for loading keypairs from files or ENV
variables, so developers must implement the file/ENV reading operations themselves.
Whereas gill includes multiple functions to handle these very scenarios:
- [`loadKeypairSignerFromFile()`](/api/gill-node/functions/loadKeypairSignerFromFile)
- [`loadKeypairSignerFromEnvironment()`](/api/gill-node/functions/loadKeypairSignerFromEnvironment)
- [`loadKeypairSignerFromEnvironmentBase58()`](/api/gill-node/functions/loadKeypairSignerFromEnvironmentBase58)
<Callout>
The `loadKeypairSignerFromFile()` function defaults to the Solana CLI's keypair path
(`~/.config/solana/id.json`). If you wish to load a different keypair file, provide the path in as
an argument.
</Callout>
## Creating a transaction
After connecting to the blockchain and making RPC requests, the next most common tasks is actually
creating transactions.
The following are examples of how to create a simple Memo transaction that includes basic
optimizations (via compute budget instructions):
```ts tab="gill"
import { createTransaction } from "gill";
import { getAddMemoInstruction } from "gill/programs";
const transaction = createTransaction({
version: "legacy",
feePayer: signer,
instructions: [
getAddMemoInstruction({
memo: "gm world!",
}),
],
latestBlockhash,
computeUnitLimit: 5000,
computeUnitPrice: 1000,
});
```
```ts tab="@solana/kit"
import {
pipe,
createTransactionMessage,
setTransactionMessageFeePayerSigner,
appendTransactionMessageInstructions,
setTransactionMessageLifetimeUsingBlockhash,
} from "@solana/kit";
import { getAddMemoInstruction } from "@solana-program/memo";
import {
getSetComputeUnitLimitInstruction,
getSetComputeUnitPriceInstruction,
} from "@solana-program/compute-budget";
const transaction = pipe(
createTransactionMessage({ version: "legacy" }),
(tx) => setTransactionMessageFeePayerSigner(signer, tx),
(tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
(tx) =>
appendTransactionMessageInstructions(
[
getAddMemoInstruction({
memo: "gm world!",
}),
getSetComputeUnitLimitInstruction({ units: 5000 }),
getSetComputeUnitPriceInstruction({ microLamports: 1000 }),
],
tx,
),
);
```
Notice that the `@solana/kit` based example above requires manually installing two additional
packages: `@solana-program/compute-budget` and `@solana-program/memo`.
Whereas gill takes a different approach:
- `createTransaction` natively supports setting the same compute budget instructions
- the included Memo program client is directly accessible via the `gill/programs` import path
without having to manually install the package
================================================
FILE: docs/content/docs/compare/meta.json
================================================
{
"title": "Comparisons",
"pages": ["kit", "web3js", "..."]
}
================================================
FILE: docs/content/docs/debug-mode.mdx
================================================
---
title: Debug Mode
description:
"Understand how to use gill's debug mode to more easily debug your Solana applications."
---
Within `gill`, you can enable "debug mode" to automatically log additional information that will be
helpful in troubleshooting your Solana applications (especially failing transactions).
[Debug mode](./debug-mode) is disabled by default to minimize additional logs for your application.
But with its flexible debug controller, you can enable it from the most common places your code will
be run. Including your code itself, NodeJS backends, serverless functions, and even the in web
browser console itself.
Some examples of the existing debug logs that `gill` has sprinkled in:
- log the Solana Explorer link for transactions as you are sending them via
`sendAndConfirmTransaction`
- log the base64 transaction string for further troubleshooting using
[`mucho inspect`](https://github.com/solana-developers/mucho?tab=readme-ov-file#inspect) or the
Solana Explorer's [Transaction Inspector](https://explorer.solana.com/tx/inspector)
## How to enable debug mode
To enable debug mode, set any of the following to `true` or `1`:
- `process.env.GILL_DEBUG`
- `global.__GILL_DEBUG__`
- `window.__GILL_DEBUG__` (i.e. in your web browser's console)
- or manually set any debug log level (see below)
```ts
import { ... } from "gill"
/** Turn on debug mode */
global.__GILL_DEBUG__ = true;
```
<Callout title="Pro Tip">
Set the `GILL_DEBUG` environment variable in your applications' preview/staging environments to
improve your logging and troubleshooting workflows.
</Callout>
## How to set a debug level
To set a desired level of logs to be output in your application, set the value of one of the
following (default: `info`):
- `process.env.GILL_DEBUG_LEVEL`
- `global.__GILL_DEBUG_LEVEL__`
- `window.__GILL_DEBUG_LEVEL__` (i.e. in your web browser's console)
```ts
import { ... } from "gill"
/** Set the debug mode log level (default: `info`) */
global.__GILL_DEBUG_LEVEL__ = "debug";
```
The log levels supported (in order of priority):
1. `debug` (lowest)
2. `info` (default)
3. `warn`
4. `error`
## Custom debug logs
Gill also exports the same debug functions it uses internally, allowing you to implement your own
debug logic related to your Solana application and use the same controller for it as `gill` does.
These functions include:
- `isDebugEnabled()` - check if debug mode is enabled or not
- `debug()` - print debug message if the set log level is reached
```typescript
import { debug, isDebugEnabled } from "gill";
if (isDebugEnabled()) {
// your custom logic
}
// log this message if the "info" or above log level is enabled
debug("custom message");
// log this message if the "debug" or above log level is enabled
debug("custom message", "debug");
// log this message if the "warn" or above log level is enabled
debug("custom message", "warn");
// log this message if the "warn" or above log level is enabled
debug("custom message", "warn");
```
================================================
FILE: docs/content/docs/examples.mdx
================================================
---
title: Examples
description:
Collection of example scripts and code snippets on how to use gill, the Solana JavaScript SDK.
---
Listed here and in gill's open source repository, you can find a collection of example scripts and
code snippets that demonstrate how to accomplish various common tasks for Solana developers.
[github.com/gillsdk/gill/tree/master/examples](https://github.com/gillsdk/gill/tree/master/examples)
## Get started with the basics
Inside of the gill repository, you can find the `get-started` directory that contains gill examples
scripts on the following:
### intro.ts
<Callout title="Source Code Link">
https://github.com/gillsdk/gill/blob/master/examples/get-started/src/intro.ts
</Callout>
A brief introduction to the `gill` library. Demonstrating and explaining the commonly used tasks
involved to interact with the Solana blockchain, including:
- load a keypair signer from the local filesystem
- create an rpc connection to the blockchain
- creating basic instructions (like the memo instruction)
- getting the latest blockhash
- building a complete transaction
- signing the transaction with the loaded local keypair signer
- getting the signature of a transaction (even before it is sent)
- logging Solana Explorer links
- sending and confirming a transaction
These are all the most basic tasks required for any application sending transaction to the Solana
blockchain.
### airdrop.ts
<Callout title="Source Code Link">
https://github.com/gillsdk/gill/blob/master/examples/get-started/src/airdrop.ts
</Callout>
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
<Callout title="Source Code Link">
https://github.com/gillsdk/gill/blob/master/examples/get-started/src/tokens.ts
</Callout>
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:
- load a keypair signer from the local filesystem
- create an rpc connection to the blockchain
- getting the latest blockhash
- build an optimized transaction to create a token
- sign, send, and confirm that "create token" transaction
- build an optimized transaction to mint
- sign, send, and confirm that "mint tokens" transaction
### reference-keys.ts
<Callout title="Source Code Link">
https://github.com/gillsdk/gill/blob/master/examples/get-started/src/reference-keys.ts
</Callout>
This script demonstrates the process to add a reference key into a transaction.
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.
See also: the gill docs for [Reference Keys](https://gillsdk.com/docs/guides/reference-keys) for
more information.
### Comparison between @solana/kit and gill
You can find comparison scripts that demonstrates some of the differences between
[gill](https://github.com/gillsdk/gill) and [@solana/kit](https://github.com/anza-xyz/kit) (formerly
known as "web3.js v2").
<Callout>
Find a more comprehensive comparison in [gill vs @solana/kit comparison
docs](https://gillsdk.com/docs/compare/kit)
</Callout>
Both scripts accomplish the same task: send an optimized transaction to the Solana blockchain.
- Using gill -
[`basic.ts`](https://github.com/gillsdk/gill/blob/master/examples/get-started/src/basic.ts)
- Using web3js v2 -
[`basic-compare.ts`](https://github.com/gillsdk/gill/blob/master/examples/get-started/src/basic-compare.ts)
================================================
FILE: docs/content/docs/getting-started/client.mdx
================================================
---
title: Create a Solana client
description: Create a client connection to the Solana blockchain to perform Solana RPC requests.
---
Setting up a client connection to the Solana blockchain is a very important part of your
application. This client connection is how your application will be sending and receiving data from
the Solana JSON RPC layer, including [fetching accounts](#fetch-an-account) and sending
transactions.
Gill considers the "Solana client" to be (at a minimum) the following pieces:
- `rpc` - used to interact with the your [Solana JSON RPC](https://solana.com/docs/rpc/http)
provider (typically via HTTP)
- `rpcSubscriptions` - used to interact with the Solana RPC over websockets
- `sendAndConfirmTransaction` - used to send and confirm a Solana transaction over the RPC
connections
<Callout>
If you are familiar with the `Connection` class from the older `@solana/web3.js` library, gill's
`createSolanaClient` is similar. But more bare-bones and lightweight.
</Callout>
Most client applications will need to initialize the above functionality in their codebase. Within
gill, there are two primary ways to create a Solana client:
1. using the [`createSolanaClient()`](#create-a-solana-rpc-connection) function (recommended in
order to reduce application boilerplate)
2. manually initialize them all individually
## Create a Solana RPC connection
Create the Solana client connections (i.e. `rpc` and `rpcSubscriptions`) from any RPC URL or
standard Solana network moniker (i.e. `devnet`, `localnet`, `mainnet` etc) using the
`createSolanaClient()` function.
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "mainnet",
});
```
Using the Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and use the URL provided by them.
### Solana client for localnet
Developers can also connect to a local test validator (like
[`solana-test-validator`](https://solana.com/docs/intro/installation#run-local-validator)) running
on your computer.
To create a Solana client for your local test validator:
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "localnet",
});
```
<Callout>
The `urlOrMoniker` value of `localnet` will utilize the default test validator address and port of
`http://127.0.0.1:8899`. If you need to connect to a different address/port, then simply pass in
its entire URL. See [custom RPC URL](#solana-client-for-a-custom-rpc-url) below.
</Callout>
### Solana client for a custom RPC URL
To create an RPC client for an custom RPC provider or service:
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "https://private-solana-rpc-provider.com",
});
```
## Making Solana RPC calls
After you have a Solana `rpc` connection, you can make all the
[JSON RPC method](https://solana.com/docs/rpc) calls directly off of it. Most commonly to get the
[latest blockhash](#get-the-latest-blockhash) or [fetching a specific account](#fetch-an-account).
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
// get slot
const slot = await rpc.getSlot().send();
// get the latest blockhash
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
```
The `rpc` client requires you to call `.send()` on the RPC method in order to actually send the
request to your RPC provider and get a response.
#### Destructure and renaming response values
Many of the Solana RPC responses will return a generic `value` attribute containing the typed
response payload. It is a common practice to
[destructure](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring)
this generic `value` into a more aptly named variable, such as `latestBlockhash` (as demonstrated in
the example below).
### Get the latest blockhash
On Solana, the latest blockhash is uses as a sort of "recent timestamp" check within the
transaction.
To get the latest blockhash from your RPC:
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
// get the latest blockhash
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
```
<Callout title="Pro tip">
Only request this value *just before* you are going to use it your code. Since latest blockhashes
are only valid for approximately 1-2 minutes, requesting it at the latest possible time in your
codebase can help improve transaction landing rates.
</Callout>
### Fetch an account
All the data stored on the Solana blockchain is stored in
[accounts](https://solana.com/docs/core/accounts), including native SOL balance, tokens, and
programs. The structure of an account's data and associated metadata information is called an
`AccountInfo`.
To get an account's `AccountInfo` from your RPC:
```typescript twoslash
import { createSolanaClient, address } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
const accountToFetch = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
// get the `AccountInfo` with (default) `base58` encoding for the data
const { value: accountInfo } = await rpc.getAccountInfo(accountToFetch).send();
```
<Callout title="" type="error">
By default, the `getAccountInfo` RPC method will utilize the `base58` encoding for the `data`
within the account itself. This is fine for accounts with small amounts of data stored in them,
but fetching accounts with larger amounts of `data` will result in an error with the `base58`
encoding.
</Callout>
It is **strongly** recommended to utilize `base64` encoding when fetching accounts from the
blockchain to avoid the common errors when fetching with the default `base58` encoding.
```typescript twoslash
import { createSolanaClient, address } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
const accountToFetch = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
// get the `AccountInfo` with `base64` encoding for the data
const { value: accountInfo } = await rpc
.getAccountInfo(accountToFetch, { encoding: "base64" })
.send();
```
An even better solution is to utilize the `fetchEncodedAccount()` function to fetch accounts, which
always utilizes the `base64` encoding.
```typescript twoslash
import { createSolanaClient, address, fetchEncodedAccount } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
const accountToFetch = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const account = await fetchEncodedAccount(rpc, accountToFetch);
```
These encoded accounts can then easily be decoded by the correct `Decoder` for the structure of the
account's `data`.
### Using AbortControllers
You can also include custom configuration settings on your RPC calls, like using a JavaScript
[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController), by passing them
into `send()`:
```typescript twoslash
import { createSolanaClient } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
// Create a new AbortController.
const abortController = new AbortController();
// Abort the request when the user navigates away from the current page.
function onUserNavigateAway() {
abortController.abort();
}
// The request will be aborted if and only if the user navigates away from the page.
const slot = await rpc.getSlot().send({ abortSignal: abortController.signal });
```
================================================
FILE: docs/content/docs/getting-started/meta.json
================================================
{
"title": "Getting Started",
"defaultOpen": true,
"pages": ["client", "signers", "..."]
}
================================================
FILE: docs/content/docs/getting-started/signers.mdx
================================================
---
title: Generate a signer
description: Create a new keypair signer that can perform Solana signing operations.
---
For most typical Solana transaction signing operations, you will be utilizing a `TransactionSigner`.
This object type is capable of being "attached" to instructions and transaction to perform signing
operations.
The most common of which is a `KeyPairSigner`, which is able to be passed around to the various
functions within gill to satisfies any `TransactionSigner` type requirements, like when building
instructions or creating transactions.
<Callout>
Unless otherwise specifically noted in the gill documentation, the term "signer" refers to
`TransactionSigner` and usually a `KeyPairSigner`.
</Callout>
## Generating a keypair signer
For various Solana development tasks, you may need to generate a new signer. Including when creating
a new account, generating reference keys for transactions, or
[creating tokens](/docs/guides/tokens/create-token).
The `generateKeyPairSigner()` function allows you to generate a new random `KeyPairSigner` (which
satisfies the `TransactionSigner` type) to perform signing operations.
```typescript twoslash
import { generateKeyPairSigner, type KeyPairSigner } from "gill";
const signer = await generateKeyPairSigner();
```
### Non-extractable by default
Under the hood, a `KeyPairSigner` utilize the
[Web Crypto APIs](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) to improve
security.
These signers are non-extractable by default; meaning there is no way to get the secret key material
out of the instance. This is a more secure practice and highly recommended to be used over
extractable keypairs, unless you REALLY need to be able to save the keypair for some reason.
## Generating extractable keypairs and signers
Extractable keypairs are less secure and should not be used unless you REALLY need to
[save a keypair](/docs/guides/loading-and-saving-keypairs) for some reason. Since there are a few
useful cases for saving these keypairs, gill contains a separate explicit function to generate these
extractable keypairs.
To generate a random, **extractable** `KeyPairSigner`:
```typescript twoslash
import { generateExtractableKeyPairSigner } from "gill";
const signer = await generateExtractableKeyPairSigner();
```
<Callout title="WARNING" type="error">
Using **extractable** keypairs are inherently less-secure, since they allow the secret key
material to be extracted. Obviously. As such, they should only be used sparingly and ONLY when you
have an explicit reason you need extract the key material (like if you are going to save the key
to a file or environment variable).
</Callout>
## Create a signer without the secret key
If your Solana application allows users to sign transaction's by way of connecting their wallet
(e.g. Backpack, Phantom, Solflare, etc) to your app, you will not have access to their secret key
material.
You will need to create a "noop signer" in order to satisfy the `TransactionSigner` type, such as
the `createTransaction()` functions's `feePayer`:
```typescript twoslash
import { createNoopSigner, type Address, createTransaction } from "gill";
const wallet = "nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5" as Address;
const signer = createNoopSigner(wallet);
const transaction = createTransaction({
version: "legacy",
feePayer: signer,
instructions: [],
});
```
================================================
FILE: docs/content/docs/guides/codama.mdx
================================================
---
title: Generate Solana program clients with Codama
description:
"Step-by-step guide on how to use Codama to generate a Solana program client from an IDL."
---
[Codama](https://github.com/codama-idl/codama) is a tool that allows developers to take a Solana
program's IDL and generate client libraries (e.g. JavaScript, Rust, etc) for use by other
applications. Codama handles all the complexities of crafting Solana instructions into an IDL, a
config file, and importing a function.
Codama is quickly becoming part of the defacto standard tooling for Solana developers. Even the new
Solana Program Library (SPL) program clients are now generated using Codama. See the
[solana-program](https://github.com/solana-program) organization on GitHub.
This guide will walk you through the step-by-step of taking a Solana program IDL and generating a
JavaScript/TypeScript client library that utilizes the `gill` library. Afterwards, you can import
the various functions, types, and more into your application and easily interact with the specific
Solana program your IDL is from.
<Callout>
This guide was written using `v1.1.1` of the Codama CLI. If you experience any issues or
discrepancies on newer versions, please [open an
issue](https://github.com/gillsdk/gill/issues/new?title=%5BCodama%5D%20) on the gill repo here so
we can investigate and update this guide.
</Callout>
<Steps>
<Step>
## Install the Codama CLI
To get started, you first need to install the
[Codama CLI](https://github.com/codama-idl/codama/tree/main/packages/cli) inside your repo:
```package-install
@codama/cli
```
<Callout type="warn">
The Codama CLI is **not** meant to be installed globally, but rather version controlled with your
repo. Ensuring your generated program client will continue to be compatible with the rest of your
code base (should breaking changes happen in the future).
</Callout>
This will allow you to execute the Codama CLI via your package manager's "run" command:
```shell
npx codama --version
# output: 1.1.1
```
</Step>
<Step>
## Create a Codama config
The Codama CLI utilizes a config file to declare which "renderers" should be used and other assorted
logic. Gill provides the `createCodamaConfig()` helper function to simplify this setup.
<Callout>
Utilizing a JavaScript Codama config file (e.g. `codama.js`) is recommended for use with gill. If
you need more control, you can always fallback to [manually initializing your Codama
config](#manually-initialize-a-codama-config) using a JSON file.
</Callout>
Create a `codama.js` file to utilize the `createCodamaConfig()` function, providing your program
specific configuration:
```ts
import { createCodamaConfig } from "gill";
export default createCodamaConfig({
idl: "program/idl.json",
clientJs: "clients/js/src/generated",
});
```
- `idl` - should be the relative path to your program's IDL JSON file
- `clientJs` - should be the relative path to where your generated program client should be stored
within your repo
<Callout>
It's recommended to store your generated program client in a `generated` directory. This will
allow you to easily co-locate other manually crafted functions. See [this
example](https://github.com/solana-program/token-2022/tree/main/clients/js/src) of the SPL Token
Extension program client doing exactly this.
</Callout>
</Step>
<Step>
## Generate your program client with Codama
With your Codama config file setup, you can use the `run` command to generate your
JavaScript/TypeScript client, storing the generated output in your configured destination:
```shell
npx codama run js
```
You can now import your newly generated client library from anywhere in your code base or publish as
an installable package for any application to easily consume and interact with your program.
</Step>
</Steps>
## Multiple program clients in a single repo
At the time of writing this guide, the latest Codama CLI (`v1.1.1`) does not support multiple
program clients in a single Codama config file.
If you have multiple Solana program IDLs in a single repo, you will need to create a separate config
file for each. We recommend creating a shell script to generate all the program clients with a
single command.
For example, the gill library itself utilizes a shell script similar to this one:
```shell
#!/usr/bin/env bash
set -euo pipefail
# generate all the codama clients (per their respective config files)
npx codama run js --config ./idls/token_metadata/codama.js
npx codama run js --config ./idls/another_program/codama.js
# run the repo's prettier settings on the generated files
npx prettier --write './packages/gill/src/programs/**/generated/{*,**/*}.{ts,js}'
```
This script will execute the `codama run js` command for each program by explicitly passing in the
config file to each. Then you can easily execute any additional commands you desire, like performing
your standard prettier formatting operations.
<Callout title="Use gill's source code as a reference">
You can find the [exact shell
script](https://github.com/gillsdk/gill/blob/master/idls/build-codama-clients.sh) that gill uses
in our repo to ship some of the program clients gill includes.
</Callout>
## Manually initialize a Codama config
For more complex scenarios, you may desire to have more control over the Codama config file. In this
case, use the `codama.json` file and manually configure it to your needs.
<Steps>
<Step>
### Create a codama.json file
Run the Codama `init` command and follow the prompts to scaffold your `codama.json` config file:
```shell
npx codama init
```
You will be asked a few questions in order to generate the config file for your IDL:
- location of the IDL within your repo (e.g. `program/idl.json`)
- the type of clients to generate (make sure to select "JavaScript client")
- where your generated JavaScript client should be output to (e.g. `clients/js/src/generated`)
<Callout>
It's recommended to store your generated program client in a `generated` directory. This will
allow you to easily co-locate other manually crafted functions. See [this
example](https://github.com/solana-program/token-2022/tree/main/clients/js/src) of the SPL Token
Extension program client doing exactly this.
</Callout>
Your newly created `codama.json` config file should look something like this:
```json
{
"idl": "program/idl.json",
"before": [],
"scripts": {
"js": {
"from": "@codama/renderers-js",
"args": ["clients/js/src/generated"]
}
}
}
```
<Callout>
At the time of writing this guide, the latest Codama CLI version of `v1.1.1` does not support
multiple program clients in a single `codama.json` config file. You will have to create a separate
config file for each Solana program. See [Multiple program clients in a single
repo](#multiple-program-clients-in-a-single-repo) for more info.
</Callout>
</Step>
<Step>
### Replace @solana/kit imports with gill
By default, Codama will utilize the `@solana/kit` package for the imported symbols within the
generated client. Since the gill library includes Kit (so you do not have to manually install it),
we need to instruct Codama to utilize `gill` instead.
Update your `codama.json` config file to include the following `dependencyMap` settings by passing
the following object as the **second value** of the JavaScript renderer's `args` array:
```json
{
"idl": "program/idl.json",
"before": [],
"scripts": {
"js": {
"from": "@codama/renderers-js",
"args": [
"clients/js/src/generated",
{
"dependencyMap": {
"solanaAccounts": "gill",
"solanaAddresses": "gill",
"solanaCodecsCore": "gill",
"solanaCodecsDataStructures": "gill",
"solanaCodecsNumbers": "gill",
"solanaCodecsStrings": "gill",
"solanaErrors": "gill",
"solanaInstructions": "gill",
"solanaOptions": "gill",
"solanaPrograms": "gill",
"solanaRpcTypes": "gill",
"solanaSigners": "gill"
}
}
]
}
}
}
```
</Step>
</Steps>
================================================
FILE: docs/content/docs/guides/index.mdx
================================================
---
title: Guides
description: "Collection of helpful task-based references and code snippets for Solana developers."
---
## Wallet & Keys
Learn how to manage Solana keypairs and signers in your applications, from loading existing wallets
to creating and saving new ones.
<Cards>
<Card href="/docs/guides/loading-and-saving-keypairs" title="Loading and Saving Keypairs">
Load and save Solana keypairs from files and environment variables in Node.js, perfect for backend
applications, serverless functions, and CI/CD pipelines.
</Card>
</Cards>
## Tokens on Solana
The following [Solana token guides](/docs/guides/tokens) demonstrate the most common tasks when
working with SPL tokens on Solana.
<Cards>
<Card href="/docs/guides/tokens/create-token" title="Create a Token with Metadata">
Learn how to create a new Solana token, with metadata, using either the legacy Token Program or
Token Extensions program.
</Card>
<Card href="/docs/guides/tokens/mint-tokens" title="Mint Tokens">
Learn how to mint new token supply to a wallet using the mint authority, including automatically
creating the destination's Associated Token Account.
</Card>
<Card href="/docs/guides/tokens/transfer-tokens" title="Transfer Tokens">
Learn how to transfer tokens between wallets using the token authority, including automatically
creating the destination's Associated Token Account.
</Card>
<Card href="/docs/guides/tokens/burn-tokens" title="Burn Tokens">
Learn how to permanently remove tokens from circulation by burning them from a wallet's Associated
Token Account.
</Card>
<Card href="/docs/guides/tokens/get-token-metadata" title="Get Token Metadata">
Learn how to read and parse token metadata from the Solana blockchain, including both legacy Token
Metadata Program accounts and Token Extensions (Token22) inline metadata.
</Card>
</Cards>
## Transactions
Master advanced transaction techniques including reference keys for priority fees and implementing
Solana Pay for payment flows.
<Cards>
<Card href="/docs/guides/reference-keys" title="Reference Keys">
Learn how to insert reference keys into Solana transactions to enable priority fees and improve
transaction processing.
</Card>
<Card href="/docs/guides/solana-pay" title="Solana Pay">
Implement the Solana Pay protocol in your applications to create payment requests, transfer
requests, and transaction requests.
</Card>
</Cards>
## Developer Tools
Streamline your Solana development workflow with code generation and automation tools.
<Cards>
<Card href="/docs/guides/codama" title="Generate Solana Program Clients with Codama">
Use Codama to automatically generate type-safe Solana program clients from IDL files, saving time
and reducing errors.
</Card>
</Cards>
================================================
FILE: docs/content/docs/guides/loading-and-saving-keypairs.mdx
================================================
---
title: Loading and Saving Keypairs
description:
Guide on loading and saving keypairs from files and environment variables in server-side
environments.
---
When building server-side applications, backend services, or CLI tools, you'll often need to manage
keypairs for signing transactions. The `gill/node` package provides utilities for loading keypairs
from the filesystem or environment variables, and even simplifies saving them for later use.
This guide covers the essential functions for keypair management in JavaScript server environments
including Node.js, Bun, and others.
## Installation
To get started, install the `gill` package:
```package-install
gill
```
The server-side keypair utilities are available under the `gill/node` export path:
```ts
import { loadKeypairSignerFromFile, saveKeypairSignerToFile } from "gill/node";
```
## Available Functions
The `gill/node` package provides the following keypair management functions:
**Loading functions:**
- `loadKeypairSignerFromFile()` - Load a keypair signer from a filesystem JSON file (defaults to
Solana CLI path)
- `loadKeypairSignerFromEnvironment()` - Load a keypair signer from an environment variable (JSON
array format)
- `loadKeypairSignerFromEnvironmentBase58()` - Load a keypair signer from an environment variable
(base58 format)
**Saving functions:**
- `saveKeypairSignerToFile()` - Save an extractable keypair signer to a filesystem JSON file
- `saveKeypairSignerToEnvFile()` - Save an extractable keypair signer to a `.env` file
All functions also have non-`Signer` variants (e.g., `loadKeypairFromFile`) that work with raw
`CryptoKeyPair` objects instead of `KeyPairSigner` objects. See the
[Related Functions](#related-functions) section for more details.
## Loading Keypairs from Environment Variables
Environment variables are the recommended approach for loading Solana keypairs in production
environments, serverless functions, and CI/CD pipelines. This method provides better security and
portability compared to storing private keys in files on disk.
When you load a keypair from an environment variable, the keypair data is stored as a string value
in your system's environment (like `process.env` in Node.js). This approach is particularly useful
in cloud deployments, containerized applications, GitHub Actions, and other automated workflows
where file system access may be limited or where secrets are managed through environment
configuration.
### JSON Array Format
The most common format for storing keypairs in environment variables is the JSON array format (a
stringified array of 64 numbers representing the keypair bytes). This is the same format as the
keypairs generated and used by the Solana CLI.
```ts twoslash
import { loadKeypairSignerFromEnvironment } from "gill/node";
// Expects process.env.MY_KEYPAIR to contain: [123,45,67,89,...]
const signer = await loadKeypairSignerFromEnvironment("MY_KEYPAIR");
console.log("Loaded signer:", signer.address);
```
Your `.env` file would look like this:
```bash
MY_KEYPAIR=[123,45,67,89,...]
# or
MY_KEYPAIR="[123,45,67,89,...]"
```
### Base58 Format
Some Solana wallets, browser extensions, and third-party tools export keypairs as base58-encoded
strings instead of JSON arrays. The base58 format is a compact string representation that's easier
to copy and paste, and is commonly used in certain wallet applications.
Use `loadKeypairSignerFromEnvironmentBase58()` when your keypair is stored in this format:
```ts twoslash
import { loadKeypairSignerFromEnvironmentBase58 } from "gill/node";
// Expects process.env.MY_KEYPAIR to contain a base58 string
const signer = await loadKeypairSignerFromEnvironmentBase58("MY_KEYPAIR");
console.log("Loaded signer:", signer.address);
```
Your `.env` file with base58 format would look like this:
```bash
MY_KEYPAIR=5J7WTMRm9FG6TvmzJkKp3qQ...
# or
MY_KEYPAIR="5J7WTMRm9FG6TvmzJkKp3qQ..."
```
<Callout type="warn">
Both environment variable loading functions will throw an error if the specified environment
variable is not set. Make sure your environment variables are properly configured before running
your application.
</Callout>
## Saving Keypairs to Environment Files
When setting up a server-side application or preparing configuration for deployment, you may need to
generate new keypairs and save them to environment files for later use. The
`saveKeypairSignerToEnvFile()` function generates a `.env` file entry that you can use in
development or copy to your production environment's secret management system.
This is particularly useful for:
- Initial project setup when you need to create a new Solana wallet for your backend
- Local development configurations
- Generating keypairs that will be deployed to cloud platforms (AWS, Google Cloud, Vercel, etc.)
- CI/CD pipeline configuration
<Callout type="error">
**Security Warning**: Only [**extractable**
keypairs](/docs/getting-started/signers#generating-extractable-keypairs-and-signers) can be saved
to environment files. You must generate keypairs using `generateExtractableKeyPairSigner()`
instead of the regular `generateKeyPairSigner()`. This is a deliberate security feature - regular
keypairs keep the private key material locked in memory and cannot be exported.
</Callout>
Here's how to generate and save a keypair to a `.env` file:
```ts twoslash
import { generateExtractableKeyPairSigner } from "gill";
import { saveKeypairSignerToEnvFile } from "gill/node";
// Generate an extractable keypair
const signer = await generateExtractableKeyPairSigner();
// Save to .env file (defaults to ./.env)
await saveKeypairSignerToEnvFile(signer, "MY_KEYPAIR");
console.log("Keypair saved to .env file");
```
This will append to your `.env` file with a helpful comment showing the public address:
```bash
# Solana Address: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
MY_KEYPAIR=[123,45,67,89,...]
```
### Custom .env File Path
You can specify a custom path for the environment file:
```ts twoslash
import { generateExtractableKeyPairSigner } from "gill";
import { saveKeypairSignerToEnvFile } from "gill/node";
const signer = await generateExtractableKeyPairSigner();
// Save to a custom .env file
await saveKeypairSignerToEnvFile(signer, "MY_KEYPAIR", "./config/.env.production");
```
<Callout type="warn">
The function will throw an error if the environment variable name already exists in `process.env`.
This prevents accidentally overwriting existing configuration.
</Callout>
## Loading Keypairs from Files
For local development, testing, and CLI tools, loading Solana keypairs from JSON files on your
filesystem is often the most convenient approach. The Solana CLI (Command Line Interface) stores
keypairs as JSON files by default, making this method seamlessly compatible with existing Solana
tooling.
File-based keypair loading is ideal for:
- **Local development** - Working on your laptop or development machine
- **Solana CLI integration** - Using keypairs generated with `solana-keygen`
- **CLI tools and scripts** - Node.js or Bun scripts that interact with Solana
- **Testing and debugging** - Quick iteration without managing environment variables
The keypair files contain a JSON array of 64 bytes (numbers from 0-255) representing the full
keypair.
### Using the Default Solana CLI Path
By default, `loadKeypairSignerFromFile()` loads the keypair from the default Solana CLI keypair path
(`~/.config/solana/id.json`):
```ts twoslash
import { loadKeypairSignerFromFile } from "gill/node";
const signer = await loadKeypairSignerFromFile();
console.log("Loaded signer:", signer.address);
```
### Using a Custom File Path
You can also specify a custom path to load keypairs from other locations:
```ts twoslash
import { loadKeypairSignerFromFile } from "gill/node";
const signer = await loadKeypairSignerFromFile("./my-keypair.json");
console.log("Loaded signer:", signer.address);
```
The file should contain a JSON array of 64 numbers (the standard Solana CLI format):
```json
[123, 45, 67, 89, ...]
```
<Callout type="info">
The `loadKeypairSignerFromFile()` function supports tilde (`~`) expansion in file paths, so you
can use paths like `~/wallets/my-keypair.json`.
</Callout>
## Saving Keypairs to Files
When building CLI tools, development scripts, or testing utilities, you may need to generate new
Solana keypairs and save them as JSON files on your local filesystem. The
`saveKeypairSignerToFile()` function makes this easy by creating Solana CLI-compatible keypair files
that can be used across your development workflow.
Common use cases for saving keypairs to files include:
- **Generating test wallets** - Creating throwaway keypairs for development and testing on
devnet/testnet
- **CLI tool development** - Building tools that need to create and manage multiple wallets
- **Development automation** - Scripts that set up local development environments
- **Backup and portability** - Creating keypair files that can be easily copied or backed up
<Callout type="error">
**Important Security Consideration**: Only [**extractable**
keypairs](/docs/getting-started/signers#generating-extractable-keypairs-and-signers) can be saved
to files or environment variables. Regular keypairs generated with `generateKeyPairSigner()` are
**non-extractable** by design for security reasons - the private key material is locked in memory
and cannot be exported. To save a keypair, you must use `generateExtractableKeyPairSigner()`
instead.
</Callout>
### Generating and Saving an Extractable Keypair
```ts twoslash
import { generateExtractableKeyPairSigner } from "gill";
import { saveKeypairSignerToFile } from "gill/node";
// Generate an extractable keypair
const signer = await generateExtractableKeyPairSigner();
console.log("Generated signer:", signer.address);
// Save to a JSON file
const saved = await saveKeypairSignerToFile(signer, "./my-new-keypair.json");
if (saved) {
console.log("Keypair saved successfully!");
}
```
The function validates the save by attempting to reload the file, returning `true` if successful.
<Callout type="info">
The file path must end with `.json` extension. The function will create the file if it doesn't
exist, or overwrite it if it does.
</Callout>
## Best Practices
### Development vs Production
- **Development**: Use `loadKeypairSignerFromFile()` to load from the Solana CLI default path or
project-specific files
- **Production**: Use `loadKeypairSignerFromEnvironment()` or
`loadKeypairSignerFromEnvironmentBase58()` to load from environment variables
### Security Considerations
<Callout type="error">
Never commit keypair files or `.env` files containing private keys to version control. Add them to
your `.gitignore` file immediately.
</Callout>
Here are some security best practices:
1. **Use extractable keypairs only when necessary**: Regular (non-extractable) keypairs are more
secure because the private key material cannot be extracted from memory. Only use extractable
keypairs when you actually need to save or export them.
2. **Protect your files**: If you must store keypairs in files, ensure they have appropriate file
permissions (e.g., `chmod 600` on Unix systems).
3. **Use environment variables in production**: Environment variables are generally more secure than
files for production deployments, as they don't persist on disk and can be managed by secret
management systems.
4. **Rotate keys regularly**: Implement a key rotation strategy, especially for production systems.
5. **Use secret management services**: For production environments, consider using dedicated secret
management services like AWS Secrets Manager, Google Secret Manager, or HashiCorp Vault instead
of plain environment variables.
### Common Patterns
Here's a typical pattern for a backend service that works in both development and production:
```ts twoslash
import { loadKeypairSignerFromFile, loadKeypairSignerFromEnvironment } from "gill/node";
// Load keypair based on environment
const signer =
process.env.NODE_ENV === "production"
? await loadKeypairSignerFromEnvironment("KEYPAIR")
: await loadKeypairSignerFromFile(); // Uses Solana CLI default
console.log("Loaded signer for", process.env.NODE_ENV, ":", signer.address);
```
## Related Functions
If you need to work with raw `CryptoKeyPair` objects instead of `KeyPairSigner` objects, the
following functions are also available:
- `loadKeypairFromFile()` - Returns `CryptoKeyPair`
- `loadKeypairFromEnvironment()` - Returns `CryptoKeyPair`
- `loadKeypairFromEnvironmentBase58()` - Returns `CryptoKeyPair`
- `saveKeypairToFile()` - Accepts `CryptoKeyPair`
- `saveKeypairToEnvFile()` - Accepts `CryptoKeyPair`
The `*Signer` variants are recommended for most use cases as they return ready-to-use signers for
transactions.
================================================
FILE: docs/content/docs/guides/meta.json
================================================
{
"title": "Guides",
"pages": ["tokens", "..."]
}
================================================
FILE: docs/content/docs/guides/reference-keys.mdx
================================================
---
title: Reference Keys
description: "Guide on how to insert reference keys into Solana transactions."
---
On Solana, a "reference key" is a unique, single-use, non-signer address that is put inside of a
transaction in order to track its completion on the network. This is a common technique used within
the [Solana Pay](https://docs.solanapay.com/spec#reference) and
[Blockchain Link (Blink)](https://solana.com/solutions/actions) specifications.
Until a Solana transaction is signed by the "fee payer", it does not have a signature; making it
difficult to determine if and when the transaction has landed on-chain. Inserting a reference key
into the transaction allows developers to programmatically call the
[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress) RPC method to
determine if the transaction has landed. Triggering any desired business logic in their application.
## Add a reference key to a transaction
Inserting a reference key inside of a transaction can be accomplished by adding the desired address
as a "non-signer" account key in any supporting instruction.
Within gill, there are two functions for inserting reference keys:
1. `insertReferenceKeyToTransactionMessage()` - insert just one reference key
2. `insertReferenceKeysToTransactionMessage()` - insert multiple reference keys
Under the hood, these "insert reference key" functions search the instructions inside the
transaction and manually inserts the reference key address as a non-signer on the
[first supported instruction](#program-errors-due-to-reference-keys).
The following is an example of constructing a transaction using the `createTransaction()` then
inserting the reference key using the "pipe method". This is the most recommended way to perform
this:
```ts twoslash
// @noErrors
import {
pipe,
createTransaction,
generateKeyPairSigner,
insertReferenceKeysToTransactionMessage,
} from "gill";
// generate a reference key address
const { address: reference } = await generateKeyPairSigner();
const transaction = pipe(
createTransaction({
version: "legacy",
feePayer: signer,
instructions: [
getAddMemoInstruction({
memo: "gm world!",
}),
],
latestBlockhash,
// setting a CU limit ensures there is at least one non-memo instruction
computeUnitLimit: 5000,
}),
(tx) => insertReferenceKeysToTransactionMessage([reference], tx),
);
```
The above transaction will have two instructions in it:
1. SPL memo instruction (via the `getAddMemoInstruction` function)
2. compute unit limit instruction (via the `computeUnitLimit` value)
<Callout type="warn" title="At least one non-memo instruction is required">
To insert a reference key into a transaction, the transaction **must** have at least one non-memo
instruction. See [Program errors due to reference keys](#program-errors-due-to-reference-keys)
below for details.
</Callout>
This transaction can be signed and sent to the network. Then anyone can
[monitor for the reference key](#monitoring-for-a-reference-key) and trigger their desired business
logic.
### Add to an existing transaction
If your application is not directly creating the transaction, like when consuming external APIs, you
can still add a reference key to the transaction.
First fetch the transaction from your desired external source, then insert the reference key as
follows:
```ts twoslash
// @noErrors
import {
createTransaction,
generateKeyPairSigner,
insertReferenceKeysToTransactionMessage
} from "gill";
// note: `transaction` is mutable here so we can modify it later to insert the reference key
let { transaction } = await fetchTransactionFromExternalSource(...);
// ... [your other business logic here]
// generate a reference key address
const { address: reference } = await generateKeyPairSigner();
transaction = insertReferenceKeysToTransactionMessage([reference], transaction);
```
<Callout type="warn" title="Notice for already signed transactions">
If the transaction obtained from an external source or API is already signed, you cannot modify
the transaction to insert a reference key. Your only option is to wipe the existing signatures,
insert the reference key, and resign. Or encourage your external API provider to accept a
reference key input to their API endpoints that return signed transactions.
</Callout>
This transaction can be signed and sent to the network. Then anyone can
[monitor for the reference key](#monitoring-for-a-reference-key) and trigger their desired business
logic.
## Program errors due to reference keys
Some programs on the Solana network do not allow adding additional non-signer accounts due to the
way they are coded. Often times, these programs expect all provided account keys to be writable or a
signer. If they receive additional or unexpected accounts, they will error.
As such, gill's "insert reference key" functions attempt to prevent these errors by skipping
instructions from these programs. The following programs are known to fall into this condition and
are skipped when inserting reference keys:
- `MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr` - SPL memo program
<Callout title="Know of another program?">
If you locate another commonly used program that results in errors due to inserting additional
account keys, please [open an
issue](https://github.com/gillsdk/gill/issues?title=%5BReference%20Key%20Program%5D%20) and share
with the community.
</Callout>
## Monitoring for a reference key
After a reference key has been inserted into a transaction, and that transaction is expected to have
been signed then sent to the network for confirmation, you use the
[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress) RPC method to
determine if the transaction has been confirmed.
Using gill's `getOldestSignatureForAddress()` function, we can easily fetch the oldest signature
that includes the reference key. If the reference key is not found, it will throw an error.
```ts twoslash
// @noErrors
import { createSolanaClient, address, getOldestSignatureForAddress } from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet",
});
const reference = address("...");
try {
const { signature } = await getOldestSignatureForAddress(rpc, reference);
const transaction = await rpc.getTransaction(signature).send();
// ... [validate the `transaction` performed the expected actions on-chain]
// perform business logic for a successful transaction
} catch (err) {
// handle errors
}
```
<Callout type="warn">
While you can utilize the raw response from the `getSignaturesForAddress` RPC method, your
application will need to manually handle recursively fetching signatures until you locate the
oldest one (i.e. the only one we care about).
</Callout>
Your application can then fetch and process the transaction with the signature returned by
`getOldestSignatureForAddress()`, validating the transaction is as expected.
After your application validates the oldest transaction accomplishes the expected on-chain actions
(e.g. correct token balance changes, etc), you can proceed with any of your "success case" business
logic and handle errors accordingly.
### Security concerns
<Callout type="error" title="Reference keys can be easily spoofed in transactions">
Due to the architecture of Solana transactions, reference keys can be easily spoofed inside of
transactions (i.e. anyone can insert them into transactions). Just because your reference key was
located in a confirmed transaction, does **NOT** mean the transaction is what you expect it to be.
</Callout>
It is crucially important that your application validates the transaction associated with the oldest
signature obtained. Otherwise, your application can be vulnerable to various attacks.
================================================
FILE: docs/content/docs/guides/solana-pay.mdx
================================================
---
title: Solana Pay
description: "Guide on how to utilize the Solana Pay protocol using the gill sdk."
---
Solana Pay is a standardized protocol for encoding transaction requests within URLs, enabling
payments and other blockchain interactions across the Solana ecosystem. The protocol supports both
simple transfer requests for direct payments and interactive "transaction requests" for more complex
use cases like merchant checkouts or scenarios where you need a non-user controlled keypair to
pre-sign a transaction.
The gill SDK provides a complete, type-safe implementation of the
[Solana Pay specification](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md) with
comprehensive validation and error handling. This guide covers how to create, parse, and validate
Solana Pay URLs using [`@gillsdk/solana-pay`](https://www.npmjs.com/package/@gillsdk/solana-pay).
## Request Types
Solana Pay supports two distinct request types, each suited for different use cases:
**Transfer Requests:**
- Non-interactive request for SOL or SPL token transfer
- All payment details encoded directly in the URL
- Wallet constructs and submits transaction immediately
- Best for simple payments, invoices, and QR code payments
- No server infrastructure required
```text
solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.5&label=Coffee+Shop
```
**Transaction Requests:**
- Interactive, multi-step checkout flow
- URL points to an HTTPS endpoint that provides transaction details
- Requires GET request for merchant info, then POST request for transaction
- Best for complex transactions, server signers, dynamic pricing, and merchant integrations
- Requires server-side implementation and HTTPS
```
solana:https://checkout.usedecal.com/api/solana-pay-transaction
```
## Install the Solana Pay SDK
This guide requires both the `gill` SDK and the
[`@gillsdk/solana-pay`](https://www.npmjs.com/package/@gillsdk/solana-pay) package.
```package-install
gill @gillsdk/solana-pay
```
## Transfer Requests
Transfer requests are non-interactive URLs that encode all SOL or SPL token transfer details
directly in the URL parameters. When a wallet app scans or receives a transfer request URL, it can
construct and submit the transaction without any additional network requests.
<Callout>
The Solana Pay Transfer Request's `amount` parameter is used to denote how many tokens are
requested in the transfer transaction. Crucially, this `amount` is the UI amount (aka
human-readable amount), not the raw blockchain amount.
- For SOL, this means SOL (not lamports)
- For SPL tokens, this means the token's display amount (not the raw token amount)
</Callout>
### Basic SOL Transfer
The simplest transfer request specifies only a recipient address:
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const url = encodeSolanaPayURL({ recipient });
// → "solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5"
```
To specify a specific amount of tokens to be transferred by the user, add the `amount` parameter.
The `amount` field is the UI amount (human-readable amount), not the raw blockchain amount. For SOL,
this means SOL (not lamports). For SPL tokens, this means the token's display amount (not the raw
token amount).
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
// Request 1.5 SOL
const url = encodeSolanaPayURL({
recipient,
amount: 1.5,
});
// → "solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.5"
```
### SPL Token Transfers
To request a token transfer instead of SOL, specify the `splToken` parameter with the token mint
address. The `amount` is still the UI amount based on the token's decimals (not the raw token
amount).
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const usdcMint = address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
// Request 100 USDC
const url = encodeSolanaPayURL({
recipient,
amount: 100,
splToken: usdcMint,
});
```
When `splToken` is specified, the wallet will create a token transfer instruction using the
Associated Token Account convention.
### Reference Keys
Reference keys enable transaction tracking by including one or more public keys as read-only keys in
the transaction. This allows you to query for specific transactions using the
`getSignaturesForAddress` RPC method.
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const referenceKey = address("Href9m18T7a9TKgS21e9Y9Aa1yce1Sw3TjXbRJ9Exm5P");
const url = encodeSolanaPayURL({
recipient,
amount: 1,
reference: referenceKey,
});
```
You can include multiple reference keys by passing an array:
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const ref1 = address("Href9m18T7a9TKgS21e9Y9Aa1yce1Sw3TjXbRJ9Exm5P");
const ref2 = address("2nT8kNX7YvTBMekVWKqpRdDKQ7z9r8FVq4VNSS3bH4Qo");
const url = encodeSolanaPayURL({
recipient,
amount: 1,
reference: [ref1, ref2],
});
```
For more details on generating and using reference keys, see the
[Reference Keys guide](/docs/guides/reference-keys).
### Labels, Messages, and Memos
Solana Pay Transfer requests support additional metadata to provide context:
- **label**: Describes the source of the request (e.g., merchant name)
- **message**: Describes the nature of the transfer (e.g., what's being purchased)
- **memo**: Text included in an SPL Memo instruction in the transaction
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
import { address } from "gill";
const recipient = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const usdcMint = address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
const url = encodeSolanaPayURL({
recipient,
amount: 9.67,
label: "Coffee Shop",
message: "Payment for espresso and croissant",
memo: "Order #12345",
splToken: usdcMint,
});
```
<Callout type="warn">
Memo data is recorded publicly onchain and should not contain sensitive information.
</Callout>
## Transaction Requests
Transaction requests are interactive URLs that point to an HTTPS endpoint. Unlike transfer requests,
transaction requests require the wallet app to make HTTP requests to fetch transaction details from
a server.
### Creating Transaction Request URLs
Transaction requests require an HTTPS URL and optionally include `label` and `message` metadata:
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
const url = encodeSolanaPayURL({
link: new URL("https://merchant.example.com/checkout"),
label: "Example Merchant",
message: "Purchase item #42",
});
// → "solana:https%3A%2F%2Fmerchant.example.com%2Fcheckout?label=Example+Merchant&message=Purchase+item+%2342"
```
<Callout type="error">
Transaction request links MUST use HTTPS. The `@gillsdk/solana-pay` SDK validates this requirement
and will throw an error for non-HTTPS URLs.
</Callout>
If your link includes query parameters, they will be properly URL-encoded:
```ts twoslash
import { encodeSolanaPayURL } from "@gillsdk/solana-pay";
const url = encodeSolanaPayURL({
link: new URL("https://merchant.example.com/api?item=123&quantity=2"),
});
```
### Fetching Merchant Information (GET Request)
When a wallet receives a transaction request URL, it first makes a GET request to fetch the
merchant's label and icon:
```ts twoslash
import { solanaPayTransactionRequest } from "@gillsdk/solana-pay";
const response = await solanaPayTransactionRequest.get(new URL("https://merchant.example.com/api"));
console.log(response.label); // "Example Merchant"
console.log(response.icon); // "https://merchant.example.com/icon.svg"
```
The icon URL must point to an SVG, PNG, WebP, JPG, or JPEG file.
### Requesting a Transaction (POST Request)
After displaying the merchant information to the user, the wallet makes a POST request with the
user's account to receive the transaction to sign:
```ts
import { solanaPayTransactionRequest } from "@gillsdk/solana-pay";
import { address } from "gill";
const userAccount = address("nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5");
const response = await solanaPayTransactionRequest.post(
new URL("https://merchant.example.com/api"),
{ account: userAccount },
);
const transaction = response.transaction;
const message = response.message; // Optional message to display
```
The underlying response contains a base64-encoded transaction that the wallet will present to the
user for signing. The `@gillsdk/solana-pay` sdk will automatically decode and deserialize this
transaction from a `string` to a ready to sign `Transaction`.
## Parsing Solana Pay URLs
The `parseSolanaPayURL` function parses any Solana Pay URL and returns the appropriate typed
structure:
```ts twoslash
import { parseSolanaPayURL } from "@gillsdk/solana-pay";
const url = "solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1";
const parsed = parseSolanaPayURL(url);
// Use a type guard to determine the request type
if ("link" in parsed) {
// Transaction request
const { link, label, message } = parsed;
console.log("Transaction request to:", link.href);
} else {
// Transfer request
const { recipient, amount, splToken, reference, label, message, memo } = parsed;
console.log("Transfer request for:", amount, "to", recipient);
}
```
The parser automatically validates the URL format and throws a `SolanaPayParseURLError` if the URL
is invalid.
## Response Validation
For advanced use cases where you need to manually validate API responses, the SDK provides
validation functions:
### Validating GET Responses
```ts twoslash
import { parseSolanaPayGetResponse } from "@gillsdk/solana-pay";
const data = await fetch("https://merchant.example.com/api").then((r) => r.json());
const validated = parseSolanaPayGetResponse(data);
// Ensures data has required 'label' and 'icon' fields with correct formats
```
### Validating POST Responses
```ts twoslash
import { parseSolanaPayPostResponse } from "@gillsdk/solana-pay";
const data = await fetch("https://merchant.example.com/api", {
method: "POST",
body: JSON.stringify({ account: "nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5" }),
}).then((r) => r.json());
const validated = parseSolanaPayPostResponse(data);
// Ensures data has required 'transaction' field and optional 'message'
```
Both functions throw a `SolanaPayResponseError` if validation fails.
<Callout title="Security Considerations">
The gill SDK enforces several security measures:
- **HTTPS Requirement**: Transaction request links must use HTTPS to prevent man-in-the-middle
attacks
- **URL Length Validation**: URLs are limited to 2048 characters
- **Comprehensive Input Validation**: All addresses, amounts, and other parameters are validated
before encoding
- **Transaction Validation**: Wallets should validate all transaction details before prompting the
user to sign
Always validate transactions received from untrusted sources and never sign transactions without
user review.
</Callout>
## Summary
The `@gillsdk/solana-pay` package provides everything needed to implement Solana Pay in your
application:
- **Transfer Requests**: Create payment URLs for SOL and SPL tokens with optional reference tracking
- **Transaction Requests**: Build interactive checkout flows with HTTPS endpoints
- **URL Parsing**: Parse and validate any Solana Pay URL with full type safety
- **Response Handling**: Fetch and validate merchant information and transactions
For more information on the Solana Pay protocol, refer to the
[official specification](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md).
================================================
FILE: docs/content/docs/guides/tokens/burn-tokens.mdx
================================================
---
title: Burn Tokens
description: Learn how to burn tokens from a wallet using the gill JavaScript library.
---
Burning tokens permanently removes them from circulation by destroying them from a wallet's
Associated Token Account (ATA). The token account `authority` (owner) must sign the transaction to
authorize the burn.
This guide demonstrates how to burn tokens using the
[`gill` package](https://www.npmjs.com/package/gill) with the `getBurnCheckedInstruction` from
`gill/programs`.
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
import { PackageBadges } from "@/components/package-badges";
<PackageBadges packageName="gill" />
## Create an RPC connection
In order to send transactions and/or fetch data from the Solana blockchain, you will need a client
connection. You can easily create a Solana client connection using the `createSolanaClient()`
function.
The `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or
a full URL of your RPC provider.
```ts twoslash
import { createSolanaClient } from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet", // `mainnet`, `localnet`, etc
});
```
<Callout title="Public RPC endpoints are subject to rate limits">
Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and the URL provided from them.
</Callout>
## Prepare a Signer
Every Solana transaction requires at least one "signer" to be the fee payer for the transaction.
When burning tokens, the `authority` (the token account owner) must also be a signer to authorize
the burn.
### Load a signer from a local keypair file
For backend scripts and some server environments, you can load a signer from your local filesystem:
```ts twoslash
import { type KeyPairSigner } from "gill";
import { loadKeypairSignerFromFile } from "gill/node";
// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`
const signer: KeyPairSigner = await loadKeypairSignerFromFile();
console.log("signer:", signer.address);
```
## Understanding token amounts
When burning tokens, the `amount` you provide is in raw base units, not human-readable units. The
conversion depends on the `decimals` value of your token mint.
For example, if your token has `decimals = 9` (the most common for fungible tokens):
- `1_000_000_000` (1e9) = **1 token**
- `5_000_000_000` (5e9) = **5 tokens**
- `1_000_000` (1e6) = **0.001 tokens**
<Callout title="Decimals matter">
With `decimals = 9`, to burn **100 tokens** you would set `amount` to `100_000_000_000` (100e9).
With `decimals = 6`, to burn **100 tokens** you would set `amount` to `100_000_000` (100e6).
Always check your token's decimals to calculate the correct raw amount.
</Callout>
## Build the burn transaction
To burn tokens, use the `getBurnCheckedInstruction()` from `gill/programs`. This is the recommended
burn instruction because it validates the token's decimals for safety.
First, derive the ATA for the wallet that holds the tokens to burn:
```ts
import { getAssociatedTokenAccountAddress } from "gill/programs";
const ata = await getAssociatedTokenAccountAddress(mint, signer.address);
```
Then create the burn instruction and build the transaction:
```ts
import { createTransaction } from "gill";
import { getBurnCheckedInstruction } from "gill/programs";
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const burnIx = getBurnCheckedInstruction({
account: ata,
mint,
authority: signer,
amount: 1_000_000_000, // 1 token (with decimals=9)
decimals: 9,
});
const transaction = createTransaction({
feePayer: signer,
version: "legacy",
instructions: [burnIx],
latestBlockhash,
});
```
Where `mint` is the address of the token mint and `signer` is the owner of the token account.
## Sign and send the transaction
With your transaction fully created, you can now sign and send it:
```ts
import {
signTransactionMessageWithSigners,
getSignatureFromTransaction,
getExplorerLink,
} from "gill";
const signedTransaction = await signTransactionMessageWithSigners(transaction);
console.log(
"Explorer:",
getExplorerLink({
cluster: "devnet",
transaction: getSignatureFromTransaction(signedTransaction),
}),
);
```
If your transaction is already fully signed or has all signers available, you can send and confirm
it on the blockchain:
```ts
await sendAndConfirmTransaction(signedTransaction);
```
<Callout title="Pro Tip">
If you do not need to know the transaction signature prior to sending the transaction AND all
signers are attached to the transaction, you can pass a fully signable transaction to the
`sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then
perform the signing operations prior to sending and confirming.
</Callout>
## Using Token Extensions (Token22)
If your token was created with the Token Extensions program (Token22), pass the `programAddress` in
the config to `getBurnCheckedInstruction()` and the `tokenProgram` to
`getAssociatedTokenAccountAddress()`:
```ts
import {
TOKEN_2022_PROGRAM_ADDRESS,
getAssociatedTokenAccountAddress,
getBurnCheckedInstruction,
} from "gill/programs";
const ata = await getAssociatedTokenAccountAddress(
mint,
signer.address,
TOKEN_2022_PROGRAM_ADDRESS,
);
const burnIx = getBurnCheckedInstruction(
{
account: ata,
mint,
authority: signer,
amount: 1_000_000_000,
decimals: 9,
},
{ programAddress: TOKEN_2022_PROGRAM_ADDRESS },
);
```
================================================
FILE: docs/content/docs/guides/tokens/create-token.mdx
================================================
---
title: Create a Token with Metadata
description:
Learn how to create a new Solana token, with metadata, using the gill JavaScript library.
---
Tokens are digital assets that represent ownership over diverse categories of assets. Tokenization
enables the digitalization of property rights. Tokens on Solana are referred to as SPL
([Solana Program Library](https://github.com/solana-program)) Tokens.
This article will demonstrate [how to create a new SPL token](./create-token) using the
[`gill` package](https://www.npmjs.com/package/gill), including attaching metadata to the token for
users to see and applications to display.
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
import { PackageBadges } from "@/components/package-badges";
<PackageBadges packageName="gill" />
## Create an RPC connection
In order to send transactions and/or fetch data from the Solana blockchain, you will need an client
connection. You can easily create a Solana client connection using the `createSolanaClient()`
function.
The `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or
a full URL of your RPC provider.
```ts twoslash
import { createSolanaClient } from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet", // `mainnet`, `localnet`, etc
});
```
<Callout title="Public RPC endpoints are subject to rate limits">
Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and the URL provided from them.
</Callout>
## Prepare a Signer
Every Solana transaction requires at least one "signer" to be the fee payer for the transaction. The
following are common practices:
- load a signer from a local keypair file (like `~/.config/solana/id.json`, the one used by the
Solana CLI)
- loading the signer from an ENV variable (e.g. `process.env.SERVER_SIGNER`)
- having a user's wallet be the signer via a front end application
### Load a signer from a local keypair file
For backend scripts and some server environments, you can load a signer from your local filesystem:
```ts twoslash
import { type KeyPairSigner } from "gill";
import { loadKeypairSignerFromFile } from "gill/node";
// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`
const signer: KeyPairSigner = await loadKeypairSignerFromFile();
console.log("signer:", signer.address);
```
## Decide which Token Program to use
To use the legacy Token Program:
```ts twoslash
import { TOKEN_PROGRAM_ADDRESS } from "gill/programs";
const tokenProgram = TOKEN_PROGRAM_ADDRESS;
```
To use the Token Extensions Program (aka Token22):
```ts twoslash
import { TOKEN_2022_PROGRAM_ADDRESS } from "gill/programs";
const tokenProgram = TOKEN_2022_PROGRAM_ADDRESS;
```
## Generate a Mint and metadata address
```ts twoslash
import { generateKeyPairSigner } from "gill";
const mint = await generateKeyPairSigner();
```
If you are using the legacy Token Program, you will need to derive the "metadata address" from
Metaplex's Token Metadata program.
```ts twoslash
import { generateKeyPairSigner } from "gill";
import { getTokenMetadataAddress } from "gill/programs";
const mint = await generateKeyPairSigner();
const metadataAddress = await getTokenMetadataAddress(mint);
```
## Get the latest blockhash
```ts
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
```
## Create a transaction that creates a token
<Callout>
Instead of manually crafting all of these instructions, you can also use gill's instruction
builder function: `getCreateTokenInstructions()`
</Callout>
```ts
import { createTransaction } from "gill";
import { getMintSize } from "gill/programs";
const space = getMintSize();
const transaction = createTransaction({
feePayer: signer,
version: "legacy",
instructions: [
getCreateAccountInstruction({
space,
lamports: getMinimumBalanceForRentExemption(space),
newAccount: mint,
payer: signer,
programAddress: tokenProgram,
}),
getInitializeMintInstruction(
{
mint: mint.address,
mintAuthority: signer.address,
freezeAuthority: signer.address,
decimals: 9,
},
{
programAddress: tokenProgram,
},
),
getCreateMetadataAccountV3Instruction({
collectionDetails: null,
isMutable: true,
updateAuthority: signer,
mint: mint.address,
metadata: metadataAddress,
mintAuthority: signer,
payer: signer,
data: {
sellerFeeBasisPoints: 0,
collection: null,
creators: null,
uses: null,
name: "super sweet token",
symbol: "SST",
uri: "https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json",
},
}),
],
latestBlockhash,
});
```
## Sign and send the transaction
With your transaction fully created, you can now sign the transaction to
```ts
import { signTransactionMessageWithSigners } from "gill";
const signedTransaction = await signTransactionMessageWithSigners(transaction);
console.log(
"Explorer:",
getExplorerLink({
cluster: "devnet",
transaction: getSignatureFromTransaction(signedTransaction),
}),
);
```
If your transaction is already fully signed or has all signer's available, you can send and confirm
it on the blockchain.
```ts
await sendAndConfirmTransaction(signedTransaction);
```
<Callout title="Pro Tip">
If you do not need to know the transaction signature prior to sending the transaction AND you all
signers are attached to the transaction, you can pass a fully signable transaction to the
`sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then
perform the signing operations prior to sending and confirming.
</Callout>
================================================
FILE: docs/content/docs/guides/tokens/get-token-metadata.mdx
================================================
---
title: Get Token Metadata
description:
Learn how to read and parse token metadata from the Solana blockchain using the gill JavaScript
library.
---
Every Solana token can have metadata associated with it, including a name, symbol, URI pointing to
off-chain data, and more. The approach to reading this metadata depends on which token program was
used to create the token:
- **Token Metadata Program (legacy):** Metadata lives in a separate PDA account managed by the
Metaplex Token Metadata program.
- **Token Extensions (Token22):** Metadata is stored inline on the mint account as an extension.
This guide demonstrates how to fetch token metadata using the
[`gill` package](https://www.npmjs.com/package/gill), covering both approaches.
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
import { PackageBadges } from "@/components/package-badges";
<PackageBadges packageName="gill" />
## Create an RPC connection
In order to fetch data from the Solana blockchain, you will need a client connection. You can easily
create a Solana client connection using the `createSolanaClient()` function.
The `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or
a full URL of your RPC provider.
```ts twoslash
import { createSolanaClient } from "gill";
const { rpc } = createSolanaClient({
urlOrMoniker: "mainnet", // `devnet`, `localnet`, etc
});
```
<Callout title="Public RPC endpoints are subject to rate limits">
Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and the URL provided from them.
</Callout>
## Token Metadata Program (legacy tokens)
For tokens created with the original Token Program and the Metaplex Token Metadata program, metadata
is stored in a separate PDA account derived from the token's mint address.
### Derive the metadata address
Use `getTokenMetadataAddress()` from `gill/programs` to derive the metadata PDA from the mint
address:
```ts
import { address } from "gill";
import { getTokenMetadataAddress } from "gill/programs";
const mint = address("So11111111111111111111111111111111111111112");
const metadataAddress = await getTokenMetadataAddress(mint);
```
### Fetch the metadata account
Use `fetchMetadata()` from `gill/programs` to fetch and decode the metadata account:
```ts
import { fetchMetadata } from "gill/programs";
const metadata = await fetchMetadata(rpc, metadataAddress);
console.log("Name:", metadata.data.name);
console.log("Symbol:", metadata.data.symbol);
console.log("URI:", metadata.data.uri);
console.log("Seller fee:", metadata.data.sellerFeeBasisPoints);
console.log("Creators:", metadata.data.creators);
```
The metadata account also contains additional fields:
```ts
console.log("Update authority:", metadata.updateAuthority);
console.log("Is mutable:", metadata.isMutable);
console.log("Collection:", metadata.collection);
console.log("Token standard:", metadata.tokenStandard);
```
<Callout title="Use fetchMaybeMetadata for optional lookups">
If you are unsure whether a metadata account exists for a given mint, use `fetchMaybeMetadata()`
instead. It returns `null` if the account does not exist, rather than throwing an error.
</Callout>
```ts
import { fetchMaybeMetadata } from "gill/programs";
const maybeMeta = await fetchMaybeMetadata(rpc, metadataAddress);
if (maybeMeta.exists) {
console.log("Name:", maybeMeta.data.name);
} else {
console.log("No metadata account found");
}
```
## Token Extensions (Token22)
For tokens created with the Token Extensions program (Token22), metadata can be stored directly on
the mint account as an extension. No separate PDA is needed.
### Fetch the mint account
Use `fetchMint()` from `gill/programs` to fetch the mint account, which includes any extensions:
```ts
import { address } from "gill";
import { fetchMint } from "gill/programs";
const mint = address("your-token22-mint-address");
const mintAccount = await fetchMint(rpc, mint);
```
### Find the TokenMetadata extension
The mint account's `extensions` array contains all enabled extensions. Use the `isExtension()` type
guard from `gill/programs` to find the `TokenMetadata` extension:
```ts
import { fetchMint, isExtension } from "gill/programs";
const mintAccount = await fetchMint(rpc, mint);
const tokenMetadata = mintAccount.data.extensions?.find((ext) => isExtension("TokenMetadata", ext));
if (tokenMetadata && tokenMetadata.__kind === "TokenMetadata") {
console.log("Name:", tokenMetadata.name);
console.log("Symbol:", tokenMetadata.symbol);
console.log("URI:", tokenMetadata.uri);
console.log("Update authority:", tokenMetadata.updateAuthority);
console.log("Additional metadata:", tokenMetadata.additionalMetadata);
}
```
<Callout title="Token22 metadata differences">
Token Extensions metadata includes an `additionalMetadata` field, which is a `Map` of arbitrary
key-value string pairs. This is different from the legacy Token Metadata Program, which uses
structured fields like `creators` and `collection`.
</Callout>
## Fetching the off-chain JSON metadata
Both the legacy Token Metadata Program and Token Extensions store a `uri` field that points to an
off-chain JSON file. This JSON typically contains the token's image, description, attributes, and
other rich metadata.
Fetching this data is a standard HTTP request, not a Solana RPC call:
```ts
const response = await fetch(uri);
const offChainMetadata = await response.json();
console.log("Image:", offChainMetadata.image);
console.log("Description:", offChainMetadata.description);
```
The off-chain JSON format generally follows the
[Metaplex Token Metadata Standard](https://developers.metaplex.com/token-metadata/token-standard),
which includes fields like `image`, `description`, `attributes`, `external_url`, and more.
================================================
FILE: docs/content/docs/guides/tokens/index.mdx
================================================
---
title: Tokens on Solana
description: "Learn the basics of creating and working with Solana tokens."
---
Tokens are digital assets that represent ownership over diverse categories of assets. Tokenization
enables the digitalization of property rights. Tokens on Solana are referred to as SPL
([Solana Program Library](https://github.com/solana-program)) Tokens.
The following guides demonstrate the most common tasks a Solana developer should be familiar with if
building an application that utilizes tokens.
<Steps>
<Step>
### Create a token with metadata
Learn how to create a new Solana token, with metadata, using either the legacy Token Program or
Token Extensions program.
Read the full guide here on [how to create an SPL token on Solana](/docs/guides/tokens/create-token)
</Step>
<Step>
### Mint tokens
Learn how to mint new token supply to a wallet using the mint authority, including automatically
creating the destination's Associated Token Account.
Read the full guide here on [how to mint tokens on Solana](/docs/guides/tokens/mint-tokens)
</Step>
<Step>
### Get token metadata
Learn how to read and parse token metadata from the Solana blockchain, including both legacy Token
Metadata Program accounts and Token Extensions (Token22) inline metadata.
Read the full guide here on
[how to get token metadata on Solana](/docs/guides/tokens/get-token-metadata)
</Step>
<Step>
### Transfer tokens
Learn how to transfer tokens between wallets using the token authority, including automatically
creating the destination's Associated Token Account.
Read the full guide here on [how to transfer tokens on Solana](/docs/guides/tokens/transfer-tokens)
</Step>
<Step>
### Burn tokens
Learn how to permanently remove tokens from circulation by burning them from a wallet's Associated
Token Account.
Read the full guide here on [how to burn tokens on Solana](/docs/guides/tokens/burn-tokens)
</Step>
</Steps>
================================================
FILE: docs/content/docs/guides/tokens/meta.json
================================================
{
"root": false,
"pages": ["create-token", "mint-tokens", "get-token-metadata", "transfer-tokens", "burn-tokens"]
}
================================================
FILE: docs/content/docs/guides/tokens/mint-tokens.mdx
================================================
---
title: Mint Tokens
description: Learn how to mint new token supply to a wallet using the gill JavaScript library.
---
Minting tokens creates new supply of an existing token and sends it to a wallet via its Associated
Token Account (ATA). Only the mint authority signer can authorize minting new tokens.
This guide demonstrates how to mint tokens using the
[`gill` package](https://www.npmjs.com/package/gill), including automatically creating the
destination wallet's ATA if it does not already exist.
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
import { PackageBadges } from "@/components/package-badges";
<PackageBadges packageName="gill" />
## Create an RPC connection
In order to send transactions and/or fetch data from the Solana blockchain, you will need a client
connection. You can easily create a Solana client connection using the `createSolanaClient()`
function.
The `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or
a full URL of your RPC provider.
```ts twoslash
import { createSolanaClient } from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet", // `mainnet`, `localnet`, etc
});
```
<Callout title="Public RPC endpoints are subject to rate limits">
Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and the URL provided from them.
</Callout>
## Prepare a Signer
Every Solana transaction requires at least one "signer" to be the fee payer for the transaction.
When minting tokens, the `mintAuthority` must also be a signer to authorize the mint.
### Load a signer from a local keypair file
For backend scripts and some server environments, you can load a signer from your local filesystem:
```ts twoslash
import { type KeyPairSigner } from "gill";
import { loadKeypairSignerFromFile } from "gill/node";
// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`
const signer: KeyPairSigner = await loadKeypairSignerFromFile();
console.log("signer:", signer.address);
```
## Understanding token amounts
When minting tokens, the `amount` you provide is in raw base units, not human-readable units. The
conversion depends on the `decimals` value of your token mint.
For example, if your token has `decimals = 9` (the most common for fungible tokens):
- `1_000_000_000` (1e9) = **1 token**
- `5_000_000_000` (5e9) = **5 tokens**
- `1_000_000` (1e6) = **0.001 tokens**
<Callout title="Decimals matter">
With `decimals = 9`, to mint **100 tokens** you would set `amount` to `100_000_000_000` (100e9).
With `decimals = 6`, to mint **100 tokens** you would set `amount` to `100_000_000` (100e6).
Always check your token's decimals to calculate the correct raw amount.
</Callout>
## Build the mint transaction
The simplest way to mint tokens is using the `buildMintTokensTransaction()` helper from
`gill/programs`. It automatically derives the destination wallet's ATA and sets compute unit limits.
```ts
import { buildMintTokensTransaction } from "gill/programs";
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const transaction = await buildMintTokensTransaction({
feePayer: signer,
version: "legacy",
latestBlockhash,
mint: mint.address,
mintAuthority: signer,
destination: destinationWallet,
amount: 1_000_000_000, // 1 token (with decimals=9)
});
```
Where `mint.address` is the address of the token mint you previously created and `destinationWallet`
is the wallet address that should receive the tokens.
## Manually create the mint instructions
If you need more control over the transaction, you can use `getMintTokensInstructions()` to get the
individual instructions and compose the transaction yourself.
First, derive the ATA for the destination wallet:
```ts
import { getAssociatedTokenAccountAddress } from "gill/programs";
const ata = await getAssociatedTokenAccountAddress(mint.address, destinationWallet);
```
Then create the instructions and build the transaction:
```ts
import { createTransaction } from "gill";
import { getMintTokensInstructions } from "gill/programs";
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const instructions = getMintTokensInstructions({
feePayer: signer,
mint: mint.address,
mintAuthority: signer,
destination: destinationWallet,
ata,
amount: 1_000_000_000, // 1 token (with decimals=9)
});
const transaction = createTransaction({
feePayer: signer,
version: "legacy",
instructions,
latestBlockhash,
});
```
This gives you the same two instructions that `buildMintTokensTransaction()` creates under the hood:
1. **Create ATA** (idempotent) — creates the destination's Associated Token Account if it does not
already exist
2. **Mint to** — mints the specified amount of tokens to the ATA
## Sign and send the transaction
With your transaction fully created, you can now sign and send it:
```ts
import {
signTransactionMessageWithSigners,
getSignatureFromTransaction,
getExplorerLink,
} from "gill";
const signedTransaction = await signTransactionMessageWithSigners(transaction);
console.log(
"Explorer:",
getExplorerLink({
cluster: "devnet",
transaction: getSignatureFromTransaction(signedTransaction),
}),
);
```
If your transaction is already fully signed or has all signers available, you can send and confirm
it on the blockchain:
```ts
await sendAndConfirmTransaction(signedTransaction);
```
<Callout title="Pro Tip">
If you do not need to know the transaction signature prior to sending the transaction AND all
signers are attached to the transaction, you can pass a fully signable transaction to the
`sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then
perform the signing operations prior to sending and confirming.
</Callout>
## Using Token Extensions (Token22)
If your token was created with the Token Extensions program (Token22), pass the `tokenProgram`
parameter to ensure the correct program is used:
```ts
import { TOKEN_2022_PROGRAM_ADDRESS, buildMintTokensTransaction } from "gill/programs";
const transaction = await buildMintTokensTransaction({
feePayer: signer,
version: "legacy",
latestBlockhash,
mint: mint.address,
mintAuthority: signer,
destination: destinationWallet,
amount: 1_000_000_000,
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
});
```
The same `tokenProgram` parameter is available on `getMintTokensInstructions()` and
`getAssociatedTokenAccountAddress()` as well.
================================================
FILE: docs/content/docs/guides/tokens/transfer-tokens.mdx
================================================
---
title: Transfer Tokens
description: Learn how to transfer tokens between wallets using the gill JavaScript library.
---
Transferring tokens sends existing token supply from one wallet to another via their Associated
Token Accounts (ATAs). The source wallet's `authority` must sign the transaction to authorize the
transfer.
This guide demonstrates how to transfer tokens using the
[`gill` package](https://www.npmjs.com/package/gill), including automatically creating the
destination wallet's ATA if it does not already exist.
## Install gill
Install gill using the core `gill` library:
```package-install
gill
```
import { PackageBadges } from "@/components/package-badges";
<PackageBadges packageName="gill" />
## Create an RPC connection
In order to send transactions and/or fetch data from the Solana blockchain, you will need a client
connection. You can easily create a Solana client connection using the `createSolanaClient()`
function.
The `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or
a full URL of your RPC provider.
```ts twoslash
import { createSolanaClient } from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet", // `mainnet`, `localnet`, etc
});
```
<Callout title="Public RPC endpoints are subject to rate limits">
Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits
and should not be used in production applications. Applications should find their own RPC provider
and the URL provided from them.
</Callout>
## Prepare a Signer
Every Solana transaction requires at least one "signer" to be the fee payer for the transaction.
When transferring tokens, the `authority` (the source wallet's owner) must also be a signer to
authorize the transfer.
### Load a signer from a local keypair file
For backend scripts and some server environments, you can load a signer from your local filesystem:
```ts twoslash
import { type KeyPairSigner } from "gill";
import { loadKeypairSignerFromFile } from "gill/node";
// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`
const signer: KeyPairSigner = await loadKeypairSignerFromFile();
console.log("signer:", signer.address);
```
## Understanding token amounts
When transferring tokens, the `amount` you provide is in raw base units, not human-readable units.
The conversion depends on the `decimals` value of your token mint.
For example, if your token has `decimals = 9` (the most common for fungible tokens):
- `1_000_000_000` (1e9) = **1 token**
- `5_000_000_000` (5e9) = **5 tokens**
- `1_000_000` (1e6) = **0.001 tokens**
<Callout title="Decimals matter">
With `decimals = 9`, to transfer **100 tokens** you would set `amount` to `100_000_000_000`
(100e9). With `decimals = 6`, to transfer **100 tokens** you would set `amount` to `100_000_000`
(100e6). Always check your token's decimals to calculate the correct raw amount.
</Callout>
## Build the transfer transaction
The simplest way to transfer tokens is using the `buildTransferTokensTransaction()` helper from
`gill/programs`. It automatically derives the source and destination wallet's ATAs and sets compute
unit limits (default 31,000 CU).
```ts
import { buildTransferTokensTransaction } from "gill/programs";
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const transaction = await buildTransferTokensTransaction({
feePayer: signer,
version: "legacy",
latestBlockhash,
mint: mint.address,
authority: signer,
destination: destinationWallet,
amount: 1_000_000_000, // 1 token (with decimals=9)
});
```
Where `mint.address` is the address of the token mint and `destinationWallet` is the wallet address
that should receive the tokens.
## Manually create the transfer instructions
If you need more control over the transaction, you can use `getTransferTokensInstructions()` to get
the individual instructions and compose the transaction yourself.
First, derive the ATAs for both the source and destination wallets:
```ts
import { getAssociatedTokenAccountAddress } from "gill/programs";
const sourceAta = await getAssociatedTokenAccountAddress(mint.address, signer.address);
const destinationAta = await getAssociatedTokenAccountAddress(mint.address, destinationWallet);
```
Then create the instructions and build the transaction:
```ts
import { createTransaction } from "gill";
import { getTransferTokensInstructions } from "gill/programs";
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const instructions = getTransferTokensInstructions({
feePayer: signer,
mint: mint.address,
authority: signer,
sourceAta,
destination: destinationWallet,
destinationAta,
amount: 1_000_000_000, // 1 token (with decimals=9)
});
const transaction = createTransaction({
feePayer: signer,
version: "legacy",
instructions,
latestBlockhash,
});
```
## Sign and send the transaction
With your transaction fully created, you can now sign and send it:
```ts
import {
signTransactionMessageWithSigners,
getSignatureFromTransaction,
getExplorerLink,
} from "gill";
const signedTransaction = await signTransactionMessageWithSigners(transaction);
console.log(
"Explorer:",
getExplorerLink({
cluster: "devnet",
transaction: getSignatureFromTransaction(signedTransaction),
}),
);
```
If your transaction is already fully signed or has all signers available, you can send and confirm
it on the blockchain:
```ts
await sendAndConfirmTransaction(signedTransaction);
```
<Callout title="Pro Tip">
If you do not need to know the transaction signature prior to sending the transaction AND all
signers are attached to the transaction, you can pass a fully signable transaction to the
`sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then
perform the signing operations prior to sending and confirming.
</Callout>
## Using Token Extensions (Token22)
If your token was created with the Token Extensions program (Token22), pass the `tokenProgram`
parameter to ensure the correct program is used:
```ts
import { TOKEN_2022_PROGRAM_ADDRESS, buildTransferTokensTransaction } from "gill/programs";
const transaction = await buildTransferTokensTransaction({
feePayer: signer,
version: "legacy",
latestBlockhash,
mint: mint.address,
authority: signer,
destination: destinationWallet,
amount: 1_000_000_000,
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
});
```
The same `tokenProgram` parameter is available on `getTransferTokensInstructions()` and
`getAssociatedTokenAccountAddress()` as well.
================================================
FILE: docs/content/docs/index.mdx
================================================
---
title: Installation
description: Get started with gill, the new JavaScript client for Solana developers.
---
Gill is a modern javascript/typescript client library for interacting with the
[Solana](http://solana.com/) blockchain. You can use it to build Solana apps in NodeJS, web
browsers, React Native, and just about any other JavaScript environment.
Gill is built on top of the Solana JavaScript libraries built by Anza:
[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as "web3.js v2"). By utilizing the
same types and functions under the hood, `gill` is compatible with `@solana/kit`. All `@solana/kit`
imports can even be directly replaced with `gill` for one-to-one compatibility, plus unlocking the
various quality-of-life improvements that gill provides.
## Install gill
Install the core `gill` library in your project:
```package-install
gill
```
<Callout title="Coming from Kit?">
All imports from the `@solana/kit` library can be directly replaces with `gill` to achieve the
exact same functionality. Plus unlock the additional functionality only included in gill, like
`createTransaction`.
</Callout>
## Quick start
After [installing gill](#install-gill), follow these simple steps to install and get started with
the `gill` library:
<Steps>
<Step>
### Create a Solana RPC connection
Create a Solana `rpc` and `rpcSubscriptions` client connection from any RPC URL or standard Solana
network moniker (i.e. `devnet`, `localnet`, `mainnet` etc).
```typescript
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "mainnet",
});
```
The above snippet demonstrates how to use the public Solana RPC endpoints. These are great for quick
local testing, but they are (rightfully) subject to heavy rate limits.
When you are ready to ship your application to production, you will need to utilize a production
ready RPC provider.
```typescript
import { createSolanaClient } from "gill";
const { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "https://private-solana-rpc-provider.com",
});
```
</Step>
<Step>
### Make Solana RPC requests
After you have a Solana `rpc` connection, you can make all the
[JSON RPC method](https://solana.com/docs/rpc) calls directly off of it.
```typescript
import { createSolanaClient } from "gill";
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
// get slot
const slot = await rpc.getSlot().send();
// get the latest blockhash
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
```
<Callout>
The `rpc` client requires you to call `.send()` on the RPC method in order to actually send the
request to your RPC provider and get a response.
</Callout>
</Step>
<Step>
### Create a transaction
You can easily create transactions using the `createTransaction()` function. It accepts a single
object argument that is fully typed for all the required (and optional) pieces of a Solana
transaction.
When creating a Solana transaction, you will need several pieces of information:
- version - `legacy` works well for every task, unless you need Address Lookup Tables (then use `0`)
- latest blockhash - This is like a recent timestamp check that the blockchain uses. Simply request
it from your `rpc`.
- instructions - Instructs the Solana runtime which programs and logic to execute onchain.
- fee payer - The signer that will cover the small fee collected by the network to execute the
transaction.
<Callout>
For simplicity, the following examples utilize `loadKeypairSignerFromFile()` to load a Solana
keypair file from the local file system. Specifically the Solana CLI's default file path:
`~/.config/solana/id.json`. This can work well for running local scripts, but not for frontend
applications where users will need to sign using their wallets. See [Creating a signer without a
secret key](/docs/getting-started/signers#create-a-signer-without-the-secret-key) for details.
</Callout>
```ts twoslash
import { createTransaction, createSolanaClient } from "gill";
import { loadKeypairSignerFromFile } from "gill/node";
import { getAddMemoInstruction } from "gill/programs";
/**
* load the Solana CLI's default keypair file (`~/.config/solana/id.json`)
* as a signer into your script
*/
const signer = await loadKeypairSignerFromFile();
const { rpc } = createSolanaClient({ urlOrMoniker: "devnet" });
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
const transaction = createTransaction({
version: "legacy", // or `0` if using address lookup tables
feePayer: signer,
instructions: [
getAddMemoInstruction({
memo: "gm world!",
}),
],
latestBlockhash,
// computeUnitLimit, // optional, but highly recommend to set
// computeUnitPrice, // optional, but highly recommend to set
});
```
In the example above, we are loading a signer from the local file system to act as our fee payer and
only signer. The transaction itself has a single "memo instruction" in it to log a simple message
onchain.
You can now [sign the transaction](#signing-transactions) and send it to the blockchain for
confirmation.
<Callout title="Optimizing transactions">
You can (and should) optimize your Solana transactions by including a compute unit limit and
compute unit price instructions within your transaction. The `createTransaction()` function
supports easily adding these instructions via the `computeUnitLimit` and `computeUnitPrice`
arguments.
</Callout>
</Step>
<Step>
### Signing transactions
Once you have a transaction that is ready to be signed, you can call
`signTransactionMessageWithSigners()` to perform the signing operations with all the available
signers. This function will also assert that the transaction is fully signed.
<Callout type="warn">
If your transaction cannot be fully signed at this time (because you only have some of the signers
available and attached), you can call `partiallySignTransactionMessageWithSigners()` to partially
sign the transaction. Then the remaining signatures can be added later.
</Callout>
```ts twoslash
// @noErrors
import {
createTransaction,
createSolanaClient,
signTransactionMessageWithSigners,
} from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet",
});
// ... [other business logic here]
const transaction = createTransaction({...});
const signedTransaction = await signTransactionMessageWithSigners(transaction);
const signature = getSignatureFromTransaction(signedTransaction);
```
After a transaction has been signed by the `feePayer`, you can obtain its transaction signature
using the `getSignatureFromTransaction()` function (yes, even before sending it to the network).
Once you have a fully signed transaction, `signedTransaction` in the example above, you can now send
it to the blockchain network for confirmation.
</Step>
<Step>
### Send and confirm transactions
When your transaction is ready and signed, you can send it to the network via your RPC provider
using the `sendAndConfirmTransaction()` function initialized via gill's `createSolanaClient()`:
```ts twoslash
// @noErrors
import {
createTransaction,
createSolanaClient,
signTransactionMessageWithSigners,
} from "gill";
const { rpc, sendAndConfirmTransaction } = createSolanaClient({
urlOrMoniker: "devnet",
});
// ... [other business logic here]
const transaction = createTransaction({...});
const signedTransaction = await signTransactionMessageWithSigners(transaction);
const signature = getSignatureFromTransaction(signedTransaction);
try {
console.log("Sending transaction:", signature);
await sendAndConfirmTransaction(signedTransaction);
console.log("Transaction confirmed!");
} catch (err) {
console.error("Unable to send and confirm the transaction");
console.error(err);
}
```
<Callout>
The `sendAndConfirmTransaction()` function performs a check to ensure all required signatures are
present (aka the transactions is "fully signed") before attempting to send it to the network. If
any signatures are missing, it will throw an error.
</Callout>
</Step>
</Steps>
Congratulations! You now understand the basics of using the `gill` library to perform create and
send Solana transactions.
## Example source code
You can find the well-commented source code file for the above code snippets in gill's open source
repo here: https://github.com/gillsdk/gill/blob/master/examples/get-started/src/intro.ts
================================================
FILE: docs/content/docs/meta.json
================================================
{
"title": "Documentation",
"defaultOpen": true,
"root": true,
"pages": [
"---Introduction---",
"index",
"typescript",
"examples",
"---Getting Started---",
"...getting-started",
"---React---",
"...react",
"---Comparisons---",
"...compare",
"---Guides---",
"...guides",
"---Miscellaneous---",
"..."
]
}
================================================
FILE: docs/content/docs/react/examples.mdx
================================================
---
title: Examples
description: Real-world examples of using @gillsdk/react in your applications
---
Learn how to use `@gillsdk/react` through practical examples that demonstrate common patterns and
use cases.
## Basic Examples
### Display Wallet Balance
A simple component to display a wallet's SOL balance:
```tsx
"use client";
import { lamportsToSol } from "gill";
import { useBalance } from "@gillsdk/react";
export function WalletBalance({ address }: { address: string }) {
const { balance, isLoading, isError, error } = useBalance({
address,
refetchInterval: 10000, // Refetch every 10 seconds
});
if (isLoading) return <div>Loading balance...</div>;
if (isError) return <div>Error: {error?.message}</div>;
return (
<div className="p-4 border rounded">
<h3 className="font-bold">Wallet Balance</h3>
<p className="text-2xl">{lamportsToSol(balance)} SOL</p>
</div>
);
}
```
### Token Balance Display
Display a specific SPL token balance:
```tsx
"use client";
import { useTokenAccount, useTokenMint } from "@gillsdk/react";
import { tokenAmountToUiAmount } from "@gillsdk/programs";
export function TokenBalance({ mint, owner }: { mint: string; owner: string }) {
const { account: tokenAccount, isLoading: loadingAccount } = useTokenAccount({
mint,
owner,
});
const { account: mintAccount, isLoading: loadingMint } = useTokenMint({
mint,
});
if (loadingAccount || loadingMint) return <div>Loading...</div>;
const decimals = mintAccount?.data?.decimals || 0;
const amount = tokenAccount?.data?.amount || 0n;
const displayAmount = tokenAmountToUiAmount(amount, decimals);
return (
<div className="p-4 border rounded">
<h3 className="font-bold">Token Balance</h3>
<p className="text-2xl">{displayAmount.toLocaleString()}</p>
</div>
);
}
```
## Advanced Examples
### Transaction History
Display recent transactions for an address:
```tsx
"use client";
import { useSignaturesForAddress } from "@gillsdk/react";
export function TransactionHistory({ address }: { address: string }) {
const { signatures, isLoading, refetch } = useSignaturesForAddress({
address,
config: {
limit: 10,
},
});
if (isLoading) return <div>Loading transactions...</div>;
return (
<div className="space-y-2">
<div className="flex justify-between items-center">
<h3 className="font-bold">Recent Transactions</h3>
<button onClick={() => refetch()} className="px-3 py-1 bg-blue-500 text-white rounded">
Refresh
</button>
</div>
{signatures?.map((sig) => (
<div key={sig.signature} className="p-3 border rounded">
<p className="font-mono text-sm truncate">{sig.signature}</p>
<div className="flex justify-between text-sm text-gray-600">
<span>Slot: {sig.slot}</span>
<span>{sig.blockTime && new Date(sig.blockTime * 1000).toLocaleString()}</span>
</div>
{sig.err && <p className="text-red-500 text-sm">Error: {JSON.stringify(sig.err)}</p>}
</div>
))}
</div>
);
}
```
## Integration Examples
### With Next.js App Router
Create a providers file:
```tsx filename="app/providers.tsx"
"use client";
import { createSolanaClient } from "gill";
import { SolanaProvider } from "@gillsdk/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000, // 1 minute
cacheTime: 10 * 60 * 1000, // 10 minutes
},
},
});
const solanaClient = createSolanaClient({
urlOrMoniker: process.env.NEXT_PUBLIC_RPC_URL || "mainnet",
});
export function Providers({ children }: { children: React.ReactNode }) {
return (
<QueryClientProvider client={queryClient}>
<SolanaProvider client={solanaClient}>{children}</SolanaProvider>
</QueryClientProvider>
);
}
```
Use in layout:
```tsx filename="app/layout.tsx"
import { Providers } from "./providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}
```
### With Wallet Adapter
Combine `@gillsdk/react` with Solana wallet adapter:
```tsx
"use client";
import { useWallet } from "@solana/wallet-adapter-react";
import { useBalance } from "@gillsdk/react";
import { lamportsToSol } from "gill";
export function ConnectedWalletInfo() {
const { publicKey, connected } = useWallet();
const { balance, isLoading } = useBalance({
address: publicKey?.toString() || "",
enabled: !!publicKey, // Only fetch when wallet is connected
});
if (!connected) {
return <div>Please connect your wallet</div>;
}
return (
<div className="p-4 border rounded">
<p className="text-sm text-gray-600">Connected Wallet</p>
<p className="font-mono truncate">{publicKey?.toString()}</p>
{isLoading ? (
<p>Loading balance...</p>
) : (
<p className="text-xl font-bold">{lamportsToSol(balance)} SOL</p>
)}
</div>
);
}
```
## Performance Patterns
### Dependent Queries
Fetch data conditionally based on other data:
```tsx
"use client";
import { useAccount, useTokenAccount } from "@gillsdk/react";
export function ConditionalTokenBalance({ address }: { address: string }) {
// First, check if the address exists
const { account, isLoading: loadingAccount } = useAccount({
address,
});
// Only fetch token balance if account exists
const { account: tokenAccount, isLoading: loadingToken } = useTokenAccount({
mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC
owner: address,
enabled: !!account, // Only fetch if account exists
});
if (loadingAccount) return <div>Checking account...</div>;
if (!account) return <div>Account not found</div>;
if (loadingToken) return <div>Loading token balance...</div>;
return (
<div>
<p>USDC Balance: {tokenAccount?.data?.amount.toString()}</p>
</div>
);
}
```
### Optimistic Updates
Update UI immediately while transaction confirms:
```tsx
"use client";
import { useBalance } from "@gillsdk/react";
import { useQueryClient } from "@tanstack/react-query";
export function OptimisticBalance({ address }: { address: string }) {
const queryClient = useQueryClient();
const { balance } = useBalance({ address });
const handleTransfer = async (amount: bigint) => {
// Optimistically update the balance
queryClient.setQueryData(["gill", "balance", address], (old: bigint) => old - amount);
try {
// Send transaction...
// await sendTransaction(...)
// Refetch to get real balance
queryClient.invalidateQueries({
queryKey: ["gill", "balance", address],
});
} catch (error) {
// Revert optimistic update on error
queryClient.invalidateQueries({
queryKey: ["gill", "balance", address],
});
}
};
return (
<div>
<p>Balance: {balance?.toString()}</p>
{/* Transfer UI */}
</div>
);
}
```
## Error Handling
### Global Error Boundary
```tsx
"use client";
import { ErrorBoundary } from "react-error-boundary";
import { useQueryErrorResetBoundary } from "@tanstack/react-query";
function ErrorFallback({ error, resetErrorBoundary }) {
return (
<div className="p-4 bg-red-50 border border-red-200 rounded">
<h2 className="text-red-800 font-bold">Something went wrong</h2>
<pre className="text-sm">{error.message}</pre>
<button onClick={resetErrorBoundary} className="mt-2 px-4 py-2 bg-red-600 text-white rounded">
Try again
</button>
</div>
);
}
export function AppWithErrorBoundary({ children }) {
const { reset } = useQueryErrorResetBoundary();
return (
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={reset}>
{children}
</ErrorBoundary>
);
}
```
## Resources
- [gill sdk Documentation](/docs) - Core `gill` library documentation
- [TanStack Query Docs](https://tanstack.com/query) - Learn more about React Query
================================================
FILE: docs/content/docs/react/getting-started.mdx
================================================
---
title: Getting Started with @gillsdk/react
description: Learn how to set up and configure @gillsdk/react in your React application
---
This guide will walk you through setting up `@gillsdk/react` in your React application, including
configuration for Next.js App Router, Remix, and other frameworks that support React Server
Components.
## Prerequisites
Before you begin, make sure you have:
1. A React application (Create React App, Next.js, Vite, etc.)
2. Node.js LTS (v22 or later) installed
3. Basic knowledge of React hooks
## Setup Steps
<Steps>
<Step>
### Install Dependencies
First, install `@gillsdk/react` along with its peer dependencies:
```package-install
gill @gillsdk/react @tanstack/react-query
```
</Step>
<Step>
### Create a Solana Client
Create a Solana client using gill's `createSolanaClient` function:
```typescript
import { createSolanaClient } from "gill";
const client = createSolanaClient({
urlOrMoniker: "devnet", // or "mainnet", "testnet", or a custom RPC URL
});
```
<Callout type="warn">
The public Solana RPC endpoints are subject to rate limits and should not be used in production.
For production applications, use a dedicated RPC provider like Helius, QuickNode, or Alchemy.
</Callout>
</Step>
<Step>
### Wrap Your App with SolanaProvider
The `SolanaProvider` is a React context provider that makes the Solana client available to all
`@gillsdk/react` hooks in your component tree.
#### For Standard React Apps
```tsx
import { createSolanaClient } from "gill";
import { SolanaProvider } from "@gillsdk/react";
const client = createSolanaClient({
urlOrMoniker: "devnet",
});
function App() {
return <SolanaProvider client={client}>{/* Your app components */}</SolanaProvider>;
}
export default App;
```
#### For Next.js App Router and React Server Components
For applications that use React Server Components (like Next.js App Router, Remix, or other
RSC-enabled frameworks), you need to create a client-side wrapper component.
<Callout type="info" title='What is the "use client" directive?'>
The `"use client"` directive tells the bundler that this
component and its children should run on the client side (in the browser) rather than on the
server. This is necessary because:
- `@gillsdk/react` uses React hooks (`useState`, `useEffect`, etc.)
which only work on the client
- The provider creates and hooks consume React context, which is a
client-side feature
- Without this directive, you'll get errors about using hooks in Server Components.
</Callout>
Here's how to create a client-side provider wrapper:
```tsx filename="app/providers/solana-provider.tsx"
"use client"; // Required - marks this as a Client Component
import { createSolanaClient } from "gill";
import { SolanaProvider } from "@gillsdk/react";
const client = createSolanaClient({
urlOrMoniker: "devnet",
});
export function SolanaProviderClient({ children }: { children: React.ReactNode }) {
return <SolanaProvider client={client}>{children}</SolanaProvider>;
}
```
Then wrap your app in the root layout with this `SolanaProviderClient` component:
```tsx filename="app/layout.tsx"
import { SolanaProviderClient } from "@/providers/solana-provider";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<SolanaProviderClient>{children}</SolanaProviderClient>
</body>
</html>
);
}
```
</Step>
<Step>
### Use @gillsdk/react Hooks
Now you can use any `@gillsdk/react` hook in your components. When using frameworks with React
Server Components (like Next.js App Router), remember to add the `"use client"` directive to any
component that uses `@gillsdk/react` hooks:
```tsx filename="app/components/balance.tsx"
"use client"; // Required when using React Server Components
import { lamportsToSol } from "gill";
import { useBalance } from "@gillsdk/react";
export function WalletBalance() {
const { balance, isLoading, isError, error } = useBalance({
address: "nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c",
});
if (isLoading) return <div>Loading balance...</div>;
if (isError) return <div>Error: {error?.message}</div>;
return (
<div>
<p>Balance: {lamportsToSol(balance)} SOL</p>
</div>
);
}
```
</Step>
</Steps>
## Configuration Options
### Custom RPC Endpoints
For production applications, configure a dedicated RPC endpoint:
```typescript
const client = createSolanaClient({
urlOrMoniker: "https://your-rpc-provider.com/your-api-key",
});
```
### Popular RPC Providers
- [Helius](https://helius.dev)
- [QuickNode](https://quicknode.com)
- [Alchemy](https://alchemy.com)
- [Triton](https://triton.one)
- [Syndica](https://syndica.io)
### Multiple Clients
You can manage multiple Solana clients using the `useUpdateSolanaClient` hook:
```tsx
"use client";
import { createSolanaClient } from "gill";
import { useUpdateSolanaClient } from "@gillsdk/react";
function NetworkSwitcher() {
const { mutate: updateClient } = useUpdateSolanaClient();
const switchToMainnet = () => {
const mainnetClient = createSolanaClient({
urlOrMoniker: "mainnet",
});
updateClient(mainnetClient);
};
return <button onClick={switchToMainnet}>Switch to Mainnet</button>;
}
```
## TypeScript Configuration
`@gillsdk/react` is fully typed out of the box. No additional TypeScript configuration is required.
However, ensure your `tsconfig.json` has:
```json
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"jsx": "react-jsx" // or "preserve" for Next.js
}
}
```
## Troubleshooting
### "use client" Errors
If you see errors like "You're importing a component that needs useEffect. It only works in a Client
Component" or "useState only works in Client Components", this means you're trying to use
`@gillsdk/react` in a Server Component. (which NextJS App router does by default unless the
`"use client"` directive is explicitly used).
**Why this happens:**
- React Server Components run on the server during build/request time
- `@gillsdk/react` uses browser-specific features like React hooks and Web APIs
- The Solana client needs to make RPC calls from the browser
**To fix:**
1. Add `"use client"` at the top of any file using `@gillsdk/react` hooks
2. Ensure your `SolanaProvider` wrapper has `"use client"` at the top
3. Make sure the provider is properly wrapped around your component tree
**Common scenarios:**
- Forgot to add `"use client"` to a component using
[`useBalance`](/docs/react/hooks/data-fetching#usebalance),
[`useAccount`](/docs/react/hooks/data-fetching#useaccount), etc.
- Trying to use `@gillsdk/react` hooks directly in a `page.tsx` without the directive
- Importing a Client Component into a Server Component without proper boundaries
### RPC Rate Limiting
If you're hitting rate limits:
1. Switch from public endpoints to a dedicated RPC provider
2. Implement request batching and caching strategies
3. Consider using the `staleTime` and `cacheTime` options in hooks
### Bundle Size
To minimize bundle size:
1. Import only the hooks you need
2. Ensure tree-shaking is enabled in your bundler
3. Use dynamic imports for heavy components
---
Ready to start using `@gillsdk/react`? Check out the [available hooks](/docs/react/hooks) to begin
fetching blockchain data in your React application.
================================================
FILE: docs/content/docs/react/hooks/client.mdx
================================================
---
title: Client Management Hooks
description: Hooks for managing and accessing the Solana client connection
---
These hooks allow you to access and manage the Solana client configured in your `SolanaProvider`.
## useSolanaClient
Get the current Solana client configured in the `SolanaProvider`, including the `rpc` and
`rpcSubscriptions` connections.
### Usage
```tsx
"use client";
import { useSolanaClient } from "@gillsdk/react";
export function MyComponent() {
const { rpc, rpcSubscriptions } = useSolanaClient();
// You can now use rpc to access any Solana JSON RPC methods
const getSlot = async () => {
const slot = await rpc.getSlot().send();
console.log("Current slot:", slot);
};
return <button onClick={getSlot}>Get Current Slot</button>;
}
```
### Return Value
```typescript
interface SolanaClient {
rpc: SolanaRpc;
rpcSubscriptions: SolanaRpcSubscriptions;
sendAndConfirmTransaction: SendAndConfirmTransaction;
}
```
### Advanced Example
Using the client to make custom RPC calls:
```tsx
"use client";
import { useSolanaClient } from "@gillsdk/react";
import type { Address } from "gill";
export function AccountExplorer({ accountAddress }: { accountAddress: Address }) {
const { rpc } = useSolanaClient();
const [accountInfo, setAccountInfo] = useState(null);
const fetchAccountInfo = async () => {
try {
const info = await rpc
.getAccountInfo(accountAddress, {
encoding: "base64",
})
.send();
setAccountInfo(info);
} catch (error) {
console.error("Failed to fetch account info:", error);
}
};
return (
<div>
<button onClick={fetchAccountInfo}>Fetch Account Info</button>
{accountInfo && <pre>{JSON.stringify(accountInfo, null, 2)}</pre>}
</div>
);
}
```
## useUpdateSolanaClient
Update the current Solana client in the `SolanaProvider`. This is useful for switching between
different networks or RPC endpoints.
### Usage
```tsx
"use client";
import { createSolanaClient } from "gill";
import type { SolanaClusterMoniker } from "gill";
import { useUpdateSolanaClient } from "@gillsdk/react";
export function NetworkSwitcher() {
const updateClient = useUpdateSolanaClient();
const switchNetwork = (network: SolanaClusterMoniker) => {
const newClient = createSolanaClient({
urlOrMoniker: network,
});
updateClient(newClient);
};
return (
<div>
<button onClick={() => switchNetwork("mainnet")}>Mainnet</button>
<button onClick={() => switchNetwork("devnet")}>Devnet</button>
<button onClick={() => switchNetwork("testnet")}>Testnet</button>
</div>
);
}
```
### Parameters
```typescript
updateClient(client: SolanaClient): void
```
- `client` - The new Solana client to set
### Advanced Example
Switching to a custom RPC endpoint with error handling:
```tsx
"use client";
import { createSolanaClient } from "gill";
import type { SolanaClientUrlOrMoniker } from "gill";
import { useUpdateSolanaClient, useSolanaClient } from "@gillsdk/react";
export function CustomRPCManager() {
const currentClient = useSolanaClient();
const updateClient = useUpdateSolanaClient();
const [rpcUrl, setRpcUrl] = useState("");
const [isConnecting, setIsConnecting] = useState(false);
const connectToCustomRPC = async () => {
if (!rpcUrl) return;
setIsConnecting(true);
try {
const newClient = createSolanaClient({
urlOrMoniker: rpcUrl,
});
// Test the connection
await newClient.rpc.getSlot().send();
// If successful, update the client
updateClient(newClient);
alert("Successfully connected to custom RPC!");
} catch (error) {
alert(`Failed to connect: ${error.message}`);
} finally {
setIsConnecting(false);
}
};
return (
<div>
<input
type="text"
value={rpcUrl}
onChange={(e) => setRpcUrl(e.target.value)}
placeholder="Enter custom RPC URL"
/>
<button onClick={connectToCustomRPC} disabled={isConnecting}>
{isConnecting ? "Connecting..." : "Connect"}
</button>
</div>
);
}
```
## Best Practices
### Client Initialization
Initialize your client with appropriate configuration for your use case:
```typescript
// Development
const devClient = createSolanaClient({
urlOrMoniker: "devnet",
});
// Production with custom RPC
const prodClient = createSolanaClient({
urlOrMoniker: process.env.NEXT_PUBLIC_RPC_URL || "mainnet",
});
// With custom configuration
const customClient = createSolanaClient({
urlOrMoniker: "https://your-rpc.com",
config: {
commitment: "confirmed",
wsEndpoint: "wss://your-rpc.com/ws",
},
});
```
### Network Switching
When implementing network switching, consider:
1. **Clear caches** when switching networks to avoid stale data
2. **Update wallet connections** if using wallet adapters
3. **Notify users** of network changes
4. **Persist preferences** in local storage
```tsx
function NetworkManager() {
const updateClient = useUpdateSolanaClient();
const queryClient = useQueryClient();
const switchNetwork = async (network: SolanaClientUrlOrMoniker) => {
// Create new client
const newClient = createSolanaClient({
urlOrMoniker: network,
});
// Update client
updateClient(newClient);
// Clear all cached queries
await queryClient.invalidateQueries();
// Save preference
localStorage.setItem("preferred-network", network);
};
// ... rest of component
}
```
## Troubleshooting
### Client Not Available
If `useSolanaClient` returns undefined, ensure:
1. Your component is wrapped in `SolanaProvider`
2. The provider is properly initialized with a client
3. You're not calling the hook during SSR (use `"use client"` directive)
### RPC Connection Issues
When updating clients, handle connection failures gracefully:
```tsx
const updateClientSafely = async (url: SolanaClientUrlOrMoniker) => {
try {
const newClient = createSolanaClient({ urlOrMoniker: url });
// Test connection
await newClient.rpc.getHealth().send();
updateClient(newClient);
} catch (error) {
console.error("Failed to connect to RPC:", error);
// Fallback to previous client or default
}
};
```
================================================
FILE: docs/content/docs/react/hooks/data-fetching.mdx
================================================
---
title: Data Fetching Hooks
description: Hooks for fetching data from the Solana blockchain
---
These hooks provide easy access to common Solana blockchain data with automatic caching, refetching,
and error handling.
## useAccount
Get the account info for an address using the Solana RPC method
[`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo).
### Usage
```tsx
"use client";
import { useAccount } from "@gillsdk/react";
export function AccountInfo() {
const { account, isLoading, isError, error } = useAccount({
address: "nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c",
});
if (isLoading) return <div>Loading...</div>;
if (isError) return <div>Error: {error?.message}</div>;
return (
<div>
<pre>{JSON.stringify(account, null, 2)}</pre>
</div>
);
}
```
### With Decoder
Fetch and decode an account's data into a typed object using an appropriate `decoder` function:
```tsx
"use client";
import { useAccount } from "@gillsdk/react";
import { getMintDecoder } from "gill/programs";
export function MintInfo() {
const { account, isLoading } = useAccount({
// USDC mint account on mainnet
address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
decoder: getMintDecoder(),
});
if (isLoading) return <div>Loading...</div>;
return (
<div>
<p>Supply: {account?.data?.supply.toString()}</p>
<p>Decimals: {account?.data?.decimals}</p>
</div>
);
}
```
### Parameters
```typescript
interface UseAccountOptions {
address: Address | string;
decoder?: Decoder<T>;
commitment?: Commitment;
minContextSlot?: number;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useBalance
Get an account's balance in lamports using
[`getBalance`](https://solana.com/docs/rpc/http/getbalance).
### Usage
```tsx
"use client";
import { lamportsToSol } from "gill";
import { useBalance } from "@gillsdk/react";
export function WalletBalance() {
const { balance, isLoading, isError, error } = useBalance({
address: "nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c",
});
if (isLoading) return <div>Loading...</div>;
if (isError) return <div>Error: {error?.message}</div>;
return (
<div>
<p>Balance: {lamportsToSol(balance)} SOL</p>
</div>
);
}
```
### With Automatic Refetch
```tsx
const { balance } = useBalance({
address: walletAddress,
refetchInterval: 5000, // Refetch every 5 seconds
refetchOnWindowFocus: true,
});
```
### Parameters
```typescript
interface UseBalanceOptions {
address: Address | string;
commitment?: Commitment;
minContextSlot?: number;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useLatestBlockhash
Get the latest blockhash using
[`getLatestBlockhash`](https://solana.com/docs/rpc/http/getlatestblockhash).
### Usage
```tsx
"use client";
import { useLatestBlockhash } from "@gillsdk/react";
export function BlockhashDisplay() {
const { latestBlockhash, isLoading } = useLatestBlockhash();
if (isLoading) return <div>Loading...</div>;
return (
<div>
<p>Blockhash: {latestBlockhash?.blockhash}</p>
<p>Last Valid Height: {latestBlockhash?.lastValidBlockHeight}</p>
</div>
);
}
```
### For Transactions
```tsx
const { latestBlockhash } = useLatestBlockhash();
// Use in transaction
const transaction = createTransaction({
blockhash: latestBlockhash.blockhash,
// ... other transaction params
});
```
### Parameters
```typescript
interface UseLatestBlockhashOptions {
commitment?: Commitment;
minContextSlot?: number;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useSignatureStatuses
Get the statuses of signatures using
[`getSignatureStatuses`](https://solana.com/docs/rpc/http/getSignatureStatuses).
### Usage
```tsx
"use client";
import { useSignatureStatuses } from "@gillsdk/react";
export function TransactionStatus({ signature }) {
const { statuses, isLoading } = useSignatureStatuses({
signatures: [signature],
});
if (isLoading) return <div>Checking status...</div>;
const status = statuses?.[0];
return (
<div>
<p>Confirmed: {status?.confirmationStatus}</p>
<p>Confirmations: {status?.confirmations}</p>
{status?.err && <p>Error: {JSON.stringify(status.err)}</p>}
</div>
);
}
```
### Multiple Signatures
```tsx
const { statuses } = useSignatureStatuses({
signatures: [sig1, sig2, sig3],
searchTransactionHistory: true,
});
statuses?.forEach((status, index) => {
console.log(`Signature ${index}:`, status);
});
```
### Parameters
```typescript
interface UseSignatureStatusesOptions {
signatures: string[];
searchTransactionHistory?: boolean;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useSignaturesForAddress
Get signatures for confirmed transactions using
[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress).
### Usage
```tsx
"use client";
import { useSignaturesForAddress } from "@gillsdk/react";
export function TransactionHistory({ address }) {
const { signatures, isLoading } = useSignaturesForAddress({
address,
config: {
limit: 10,
},
});
if (isLoading) return <div>Loading history...</div>;
return (
<ul>
{signatures?.map((sig) => (
<li key={sig.signature}>
<p>Signature: {sig.signature}</p>
<p>Slot: {sig.slot}</p>
<p>Time: {new Date(sig.blockTime * 1000).toLocaleString()}</p>
</li>
))}
</ul>
);
}
```
### With Pagination
```tsx
const { signatures, refetch } = useSignaturesForAddress({
address,
config: {
limit: 20,
before: lastSignature, // For pagination
until: firstSignature,
},
});
```
### Parameters
```typescript
interface UseSignaturesForAddressOptions {
address: Address | string;
config?: {
limit?: number;
before?: string;
until?: string;
commitment?: Commitment;
};
enabled?: boolean;
// ... other TanStack Query options
}
```
## useProgramAccounts
Get all accounts owned by a program using the
[`getProgramAccounts`](https://solana.com/docs/rpc/http/getProgramAccounts) RPC method.
<Callout type="warn" title="Important getProgramAccounts (GPA) Limitations">
- `getProgramAccounts` can return large amounts of data and is resource-intensive
- Many RPC providers return errors or have rate limits due to the system load
- Public RPC endpoints often have `getProgramAccounts` disabled entirely
- Consider using filters to reduce the data returned and always use a paid RPC provider for
production
- For large programs, consider alternative approaches like indexers or specialized APIs
</Callout>
### Usage
```tsx
"use client";
import { useProgramAccounts } from "@gillsdk/react";
export function ProgramAccounts() {
const { accounts, isLoading } = useProgramAccounts({
program: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
config: {
encoding: "base64",
filters: [
{ dataSize: 165n }, // Token account size
],
},
});
if (isLoading) return <div>Loading accounts...</div>;
return (
<div>
<p>Found {accounts?.length} accounts</p>
</div>
);
}
```
### With Memcmp Filter
```tsx
const { accounts } = useProgramAccounts({
program: programId,
config: {
filters: [
{
memcmp: {
offset: 0n,
bytes: base58.encode(ownerPubkey),
encoding: "base58",
},
},
],
},
});
```
### Parameters
```typescript
interface UseProgramAccountsOptions {
program: Address | string;
config?: {
encoding?: "base64" | "jsonParsed";
filters?: Filter[];
commitment?: Commitment;
minContextSlot?: number;
withContext?: boolean;
};
decoder?: Decoder<T>;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useTokenMint
Get a decoded [Mint account](https://solana.com/docs/tokens#mint-account) for a token.
### Usage
```tsx
"use client";
import { useTokenMint } from "@gillsdk/react";
export function TokenInfo() {
const { account, isLoading } = useTokenMint({
// USDC mint on mainnet
mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
});
if (isLoading) return <div>Loading...</div>;
const mintData = account?.data;
return (
<div>
<p>Supply: {mintData?.supply.toString()}</p>
<p>Decimals: {mintData?.decimals}</p>
<p>Mint Authority: {mintData?.mintAuthority?.toString()}</p>
</div>
);
}
```
### Parameters
```typescript
interface UseTokenMintOptions {
mint: Address | string;
commitment?: Commitment;
enabled?: boolean;
// ... other TanStack Query options
}
```
## useTokenAccount
Get the decoded [Token Account](https://solana.com/docs/tokens#token-account) for a given mint and
owner, automatically deriving the Associated Token Account (ATA) address:
### Usage
```tsx
"use client";
import { useTokenAccount } from "@gillsdk/react";
export function TokenBalance() {
const { account, isLoading } = useTokenAccount({
mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
owner: "nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c",
});
if (isLoading) return <div>Loading...</div>;
const tokenData = account?.data;
return (
<div>
<p>Balance: {tokenData?.amount.toString()}</p>
<p>Delegated: {tokenData?.delegatedAmount.toString()}</p>
</div>
);
}
```
### With ATA Address
If you need to fetch and decode a specific Token Account's address (like for ancillary token
accounts), you can manually derive the address and provide it to the hook:
```tsx
const { account } = useTokenAccount({
ata: "CCMCWh4FudPEmY6Q1AVi5o8mQMXkHYkJUmZfzRGdcJ9P",
});
```
### Parameters
```typescript
interface UseTokenAccountOptions {
// Option 1: Provide mint and owner
mint?: Address | string;
owner?: Address | string;
// Option 2: Provide ATA address directly
ata?: Address | string;
commitment?: Commitment;
enabled?: boolean;
// ... other TanStack Query options
}
```
## Performance Optimization
### Conditional Fetching
```tsx
const { balance } = useBalance({
address: walletAddress,
enabled: !!walletAddress, // Only fetch if address exists
});
```
### Stale Time Configuration
```tsx
const { account } = useAccount({
address,
options: {
staleTime: 30000, // Consider data fresh for 30 seconds
cacheTime: 300000, // Keep in cache for 5 minutes
},
});
```
### Query Invalidation
```tsx
import { useQueryClient } from "@tanstack/react-query";
function RefreshButton() {
const queryClient = useQueryClient();
const refreshAll = () => {
// Invalidate all `@gillsdk/react` queries
queryClient.invalidateQueries({ queryKey: ["gill"] });
};
return <button onClick={refreshAll}>Refresh All</button>;
}
```
================================================
FILE: docs/content/docs/react/hooks/index.mdx
================================================
---
title: React Hooks Reference
description: Complete reference for all available hooks in @gillsdk/react
---
`@gillsdk/react` provides a comprehensive set of React hooks for interacting with the Solana
blockchain. All hooks are built on top of TanStack Query, providing automatic caching, background
refetching, and error handling.
## Hook Categories
### Client Management
Hooks for managing and accessing the Solana client connection:
- [`useSolanaClient`](/docs/react/hooks/client#usesolanaclient) - Get the current Solana client
- [`useUpdateSolanaClient`](/docs/react/hooks/client#useupdatesolanaclient) - Update the Solana
client
### Data Fetching
Hooks for fetching data from the Solana blockchain:
- [`useAccount`](/docs/react/hooks/data-fetching#useaccount) - Get account info and data
- [`useBalance`](/docs/react/hooks/data-fetching#usebalance) - Get an account's balance
- [`useLatestBlockhash`](/docs/react/hooks/data-fetching#uselatestblockhash) - Get the latest
blockhash
- [`useSignatureStatuses`](/docs/react/hooks/data-fetching#usesignaturestatuses) - Get the statuses
of signatures
- [`useSignaturesForAddress`](/docs/react/hooks/data-fetching#usesignaturesforaddress) - Get
signatures for an address
- [`useProgramAccounts`](/docs/react/hooks/data-fetching#useprogramaccounts) - Get all accounts
owned by a program
- [`useTokenMint`](/docs/react/hooks/data-fetching#usetokenmint) - Get a token mint account
- [`useTokenAccount`](/docs/react/hooks/data-fetching#usetokenaccount) - Get a token account
### Transaction Handling
Hooks for sending and managing transactions (coming soon):
- `useSendTransaction` - Send transactions with automatic confirmation
- `useSimulateTransaction` - Simulate transactions before sending
## Common Hook Options
All data fetching hooks in `@gillsdk/react` accept standard TanStack Query options:
```typescript
interface HookOptions {
// Query key for caching
queryKey?: QueryKey;
// How often to refetch in milliseconds
refetchInterval?: number;
// Whether to refetch on window focus
refetchOnWindowFocus?: boolean;
// Whether to refetch on reconnect
refetchOnReconnect?: boolean;
// Time in milliseconds before data is considered stale
staleTime?: number;
// Time in milliseconds to keep data in cache
cacheTime?: number;
// Whether to enable the query
enabled?: boolean;
// Retry configuration
retry?: boolean | number | RetryConfig;
}
```
## Common Return Values
All data fetching hooks return a consistent shape based on TanStack Query:
```typescript
interface HookResult<T> {
// The fetched data - hooks return specific field names like `account`, `balance`, etc. instead of generic `data`
account?: T; // or balance, signatures, etc. depending on the hook
// Loading state
isLoading: boolean;
isFetching: boolean;
// Error state
isError: boolean;
error: Error | null;
// Success state
isSuccess: boolean;
// Refetch function
refetch: () => void;
// Query status
status: "loading" | "error" | "success" | "idle";
}
```
## Error Handling
All hooks provide built-in error handling. You can handle errors at the component level:
```tsx
function MyComponent() {
const { balance, isError, error } = useBalance({
address: "...",
});
if (isError) {
return <div>Error: {error?.message}</div>;
}
// ... rest of component
}
```
Or configure global error handling through TanStack Query:
```tsx
import { QueryClient } from "@tanstack/react-query";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
onError: (error) => {
console.error("Query error:", error);
// Handle error globally
},
},
},
});
```
## Performance Tips
1. **Use `staleTime` wisely** - Set appropriate stale times to reduce unnecessary refetches
2. **Enable queries conditionally** - Use the `enabled` option to prevent unnecessary queries
3. **Batch requests** - Multiple hooks can share the same query key to deduplicate requests
4. **Implement pagination** - For large datasets, use pagination parameters
## TypeScript Support
All hooks are fully typed with TypeScript. Import types from `gill` for complete type safety:
```typescript
import type { Address, Lamports } from "gill";
import { useBalance } from "@gillsdk/react";
function Balance({ address }: { address: Address }) {
const { balance } = useBalance({ address });
// balance is typed as `Lamports | undefined`
}
```
================================================
FILE: docs/content/docs/react/hooks/meta.json
================================================
{
"title": "Hooks",
"defaultOpen": false,
"pages": ["index", "client", "data-fetching", "transactions"]
}
================================================
FILE: docs/content/docs/react/hooks/transactions.mdx
================================================
---
title: Transaction Hooks
description: Hooks for sending and managing Solana transactions
---
<Callout type="info">
Transaction hooks are coming soon to `@gillsdk/react`. This page documents the planned API.
</Callout>
These hooks will provide an easy way to send, confirm, and manage Solana transactions with automatic
error handling and retry logic.
## Planned Hooks
### useSendTransaction
Send and confirm transactions with automatic retry and confirmation handling.
```tsx
// Coming soon
const { sendTransaction, isLoading, error } = useSendTransaction();
const handleTransfer = async () => {
const signature = await sendTransaction({
transaction,
signers: [keypair],
options: {
skipPreflight: false,
commitment: "confirmed",
},
});
};
```
### useSimulateTransaction
Simulate transactions before sending to check for errors.
```tsx
// Coming soon
const { simulate, result } = useSimulateTransaction();
const checkTransaction = async () => {
const simulation = await simulate({
transaction,
signers: [keypair],
});
if (simulation.err) {
console.error("Transaction would fail:", simulation.err);
}
};
```
### useTransactionStatus
Monitor transaction confirmation status in real-time.
```tsx
// Coming soon
const { status, confirmations } = useTransactionStatus({
signature: "...",
targetConfirmations: 10,
});
```
## Current Approach
Until transaction hooks are available, you can use the Solana client directly:
```tsx
"use client";
import { useSolanaClient } from "@gillsdk/react";
import { createTransaction } from "gill";
export function SendTransaction() {
const { rpc, sendAndConfirmTransaction } = useSolanaClient();
const [isLoading, setIsLoading] = useState(false);
const handleSend = async () => {
setIsLoading(true);
try {
// Create your transaction
const transaction = createTransaction({
// ... transaction params
});
// Send and confirm
const signature = await sendAndConfirmTransaction(transaction, { commitment: "confirmed" });
console.log("Transaction confirmed:", signature);
} catch (error) {
console.error("Transaction failed:", error);
} finally {
setIsLoading(false);
}
};
return (
<button onClick={handleSend} disabled={isLoading}>
{isLoading ? "Sending..." : "Send Transaction"}
</button>
);
}
```
## With Wallet Adapter
If you're using a wallet adapter, combine it with `@gillsdk/react`:
```tsx
"use client";
import { useWallet } from "@solana/wallet-adapter-react";
import { useSolanaClient } from "@gillsdk/react";
import { createTransaction } from "gill";
export function WalletTransaction() {
const { publicKey, signTransaction } = useWallet();
const { rpc } = useSolanaClient();
const sendTransaction = async () => {
if (!publicKey || !signTransaction) return;
// Create transaction
const transaction = createTransaction({
// ... params
});
// Sign with wallet
const signedTx = await signTransaction(transaction);
// Send via RPC
const signature = await rpc.sendTransaction(signedTx, { skipPreflight: false }).send();
console.log("Sent:", signature);
};
// ... rest of component
}
```
## Contributing
Transaction hooks are actively being developed. If you have suggestions or want to contribute,
please check out the
[`@gillsdk/react` repository](https://github.com/gillsdk/gill/tree/master/packages/react) on GitHub.
================================================
FILE: docs/content/docs/react/index.mdx
================================================
---
title: React Hooks for Solana
description:
A React hooks library for easily interacting with the Solana blockchain, built on top of gill
---
Welcome to `@gillsdk/react`, a React hooks library for easily interacting with the
[Solana](http://solana.com/) blockchain.
<Callout type="info">
`@gillsdk/react` is in active development. All APIs are subject to change until reaching the first
major version (v1.0.0).
</Callout>
This React hooks library is built on top of two core libraries:
1. [`gill`](https://www.npmjs.com/package/gill) - modern JavaScript/TypeScript library for
interacting with the Solana blockchain.
2. [`@tanstack/react-query`](https://www.npmjs.com/package/@tanstack/react-query) - popular and
powerful asynchronous state management for React.
## Installation
Install `@gillsdk/react` with your package manager of choice:
```package-install
gill @gillsdk/react @tanstack/react-query
```
<Callout>
`gill` and `@tanstack/react-query` are peer dependencies of `@gillsdk/react` so you need to
explicitly install them. This allows you have more control over managing dependencies yourself.
</Callout>
## Key Features
- **Type-safe hooks** - Full TypeScript support with proper typing for all Solana data
- **Built on TanStack Query** - Leverages the power of React Query for caching, background
refetching, and optimistic updates
- **Easy to use** - Simple, intuitive API that follows React best practices
- **Server component ready** - Works with Next.js and other React Server Component frameworks
- **Lightweight** - Minimal bundle size with tree-shaking support
## Available Hooks
### Client Management
- [`useSolanaClient`](/docs/react/hooks/client#usesolanaclient) - Get the current Solana client
- [`useUpdateSolanaClient`](/docs/react/hooks/client#useupdatesolanaclient) - Update the Solana
client
### Data Fetching
- [`useAccount`](/docs/react/hooks/data-fetching#useaccount) - Get account info and data
- [`useBalance`](/docs/react/hooks/data-fetching#usebalance) - Get an account's balance in lamports
- [`useLatestBlockhash`](/docs/react/hooks/data-fetching#uselatestblockhash) - Get the latest
blockhash
- [`useSignatureStatuses`](/docs/react/hooks/data-fetching#usesignaturestatuses) - Get the statuses
of signatures
- [`useSignaturesForAddress`](/docs/react/hooks/data-fetching#usesignaturesforaddress) - Get
signatures for an address
- [`useProgramAccounts`](/docs/react/hooks/data-fetching#useprogramaccounts) - Get all accounts
owned by a program (GPA)
- [`useTokenMint`](/docs/react/hooks/data-fetching#usetokenmint) - Get a decoded token's Mint
account
- [`useTokenAccount`](/docs/react/hooks/data-fetching#usetokenaccount) - Get a token account for a
mint and owner
## Qu
gitextract_un7yn6a6/ ├── .bundlemonrc.json ├── .changeset/ │ ├── README.md │ ├── config.json │ └── gold-chicken-rhyme.md ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── config.yml │ │ └── feature_request.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── actions/ │ │ └── install-dependencies/ │ │ └── action.yml │ ├── bundlesize.yml │ ├── preview-docs.yml │ ├── publish-canary-releases.yml │ ├── publish-docs.yml │ ├── publish-packages.yml │ └── pull-requests.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .vscode/ │ └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAINERS.md ├── README.md ├── docs/ │ ├── .eslintrc.json │ ├── .gitignore │ ├── .npmrc │ ├── .prettierignore │ ├── .prettierrc │ ├── README.md │ ├── build-api-docs.sh │ ├── content/ │ │ ├── api/ │ │ │ ├── index.mdx │ │ │ └── meta.json │ │ └── docs/ │ │ ├── compare/ │ │ │ ├── kit.mdx │ │ │ └── meta.json │ │ ├── debug-mode.mdx │ │ ├── examples.mdx │ │ ├── getting-started/ │ │ │ ├── client.mdx │ │ │ ├── meta.json │ │ │ └── signers.mdx │ │ ├── guides/ │ │ │ ├── codama.mdx │ │ │ ├── index.mdx │ │ │ ├── loading-and-saving-keypairs.mdx │ │ │ ├── meta.json │ │ │ ├── reference-keys.mdx │ │ │ ├── solana-pay.mdx │ │ │ └── tokens/ │ │ │ ├── burn-tokens.mdx │ │ │ ├── create-token.mdx │ │ │ ├── get-token-metadata.mdx │ │ │ ├── index.mdx │ │ │ ├── meta.json │ │ │ ├── mint-tokens.mdx │ │ │ └── transfer-tokens.mdx │ │ ├── index.mdx │ │ ├── meta.json │ │ ├── react/ │ │ │ ├── examples.mdx │ │ │ ├── getting-started.mdx │ │ │ ├── hooks/ │ │ │ │ ├── client.mdx │ │ │ │ ├── data-fetching.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── meta.json │ │ │ │ └── transactions.mdx │ │ │ ├── index.mdx │ │ │ └── meta.json │ │ └── typescript.mdx │ ├── generic.d.ts │ ├── next.config.mjs │ ├── package.json │ ├── postcss.config.mjs │ ├── public/ │ │ └── site.webmanifest │ ├── source.config.ts │ ├── src/ │ │ ├── app/ │ │ │ ├── (home)/ │ │ │ │ ├── layout.tsx │ │ │ │ └── page.tsx │ │ │ ├── api/ │ │ │ │ ├── [[...slug]]/ │ │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ └── search/ │ │ │ │ └── route.ts │ │ │ ├── docs/ │ │ │ │ ├── [[...slug]]/ │ │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ └── og/ │ │ │ │ └── [...slug]/ │ │ │ │ ├── og.tsx │ │ │ │ └── route.tsx │ │ │ ├── global.css │ │ │ ├── layout.config.tsx │ │ │ ├── layout.tsx │ │ │ ├── not-found.tsx │ │ │ └── styles/ │ │ │ ├── brand.css │ │ │ ├── fumadocs-overrides.css │ │ │ └── typography.css │ │ ├── components/ │ │ │ ├── fathom-analytics.tsx │ │ │ ├── footer-links.tsx │ │ │ └── package-badges.tsx │ │ ├── const.ts │ │ └── lib/ │ │ ├── Spread.tsx │ │ └── source.ts │ ├── tsconfig.json │ ├── typedoc-data.mjs │ └── vercel.json ├── e2e/ │ └── imports/ │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── package.json │ ├── src/ │ │ ├── imports.js │ │ └── imports.ts │ └── tsconfig.json ├── examples/ │ ├── get-started/ │ │ ├── .gitignore │ │ ├── .prettierignore │ │ ├── .prettierrc │ │ ├── README.md │ │ ├── package.json │ │ ├── src/ │ │ │ ├── airdrop.ts │ │ │ ├── basic-compare.ts │ │ │ ├── basic.ts │ │ │ ├── intro.ts │ │ │ ├── reference-keys.ts │ │ │ └── tokens.ts │ │ └── tsconfig.json │ └── tokens/ │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── src/ │ │ ├── 1.intro.ts │ │ ├── 2.create-token-mint.ts │ │ ├── 3.create-token-mint-builder.ts │ │ ├── 4.mint-tokens.ts │ │ ├── 5.mint-tokens-builder.ts │ │ ├── 6.transfer-tokens.ts │ │ └── 7.transfer-tokens-builder.ts │ └── tsconfig.json ├── idls/ │ ├── build-codama-clients.sh │ └── token_metadata/ │ ├── codama.json │ └── idl.json ├── package.json ├── packages/ │ ├── build-scripts/ │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── dev-flag.ts │ │ ├── getBaseConfig.ts │ │ ├── package.json │ │ ├── register-node-globals.cjs │ │ ├── tsconfig.json │ │ ├── tsup.config.browser.ts │ │ ├── tsup.config.library.ts │ │ └── tsup.config.package.ts │ ├── config-eslint/ │ │ ├── base.mjs │ │ └── package.json │ ├── gill/ │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── eslint.config.mjs │ │ ├── generate-reexports.ts │ │ ├── package.json │ │ ├── src/ │ │ │ ├── __tests__/ │ │ │ │ ├── accounts.ts │ │ │ │ ├── addresses.ts │ │ │ │ ├── base64-bytes-to.ts │ │ │ │ ├── base64-transactions.ts │ │ │ │ ├── create-codama.config.ts │ │ │ │ ├── create-solana-client.ts │ │ │ │ ├── create-token-instructions.ts │ │ │ │ ├── create-transaction.ts │ │ │ │ ├── debug.ts │ │ │ │ ├── explorer.ts │ │ │ │ ├── get-oldest-signature.ts │ │ │ │ ├── keypairs-base58.ts │ │ │ │ ├── mint-tokens-instructions.ts │ │ │ │ ├── reference-keys.ts │ │ │ │ ├── rpc.ts │ │ │ │ ├── token/ │ │ │ │ │ ├── assert-is-mint.ts │ │ │ │ │ └── fetch-token-accounts.ts │ │ │ │ ├── transfer-tokens-instructions.ts │ │ │ │ ├── ui-amount.ts │ │ │ │ ├── utils.ts │ │ │ │ └── verify-signature.ts │ │ │ ├── __typetests__/ │ │ │ │ ├── create-solana-client.ts │ │ │ │ ├── create-token-transaction.ts │ │ │ │ ├── create-transaction.ts │ │ │ │ ├── mint-tokens-transaction.ts │ │ │ │ ├── prepare-transaction.ts │ │ │ │ ├── send-and-confirm-transaction-with-signers-typetests.ts │ │ │ │ ├── simulate-transaction.ts │ │ │ │ └── transfer-tokens-transaction.ts │ │ │ ├── core/ │ │ │ │ ├── base64-bytes-to.ts │ │ │ │ ├── base64-from-transaction.ts │ │ │ │ ├── base64-to-transaction.ts │ │ │ │ ├── const.ts │ │ │ │ ├── create-codama-config.ts │ │ │ │ ├── create-solana-client.ts │ │ │ │ ├── create-transaction.ts │ │ │ │ ├── debug.ts │ │ │ │ ├── explorer.ts │ │ │ │ ├── get-oldest-signature.ts │ │ │ │ ├── get-signature-from-bytes.ts │ │ │ │ ├── index.ts │ │ │ │ ├── insert-reference-key.ts │ │ │ │ ├── keypairs-base58.ts │ │ │ │ ├── keypairs-extractable.ts │ │ │ │ ├── prepare-transaction.ts │ │ │ │ ├── rent.ts │ │ │ │ ├── rpc.ts │ │ │ │ ├── send-and-confirm-transaction-with-signers.ts │ │ │ │ ├── simulate-transaction.ts │ │ │ │ ├── utils.ts │ │ │ │ └── verify-signature.ts │ │ │ ├── index.ts │ │ │ ├── node/ │ │ │ │ ├── const.ts │ │ │ │ ├── index.ts │ │ │ │ ├── load-keypair-base58.ts │ │ │ │ ├── load-keypair.ts │ │ │ │ └── save-keypair.ts │ │ │ ├── programs/ │ │ │ │ ├── address-lookup-table/ │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reexports.ts │ │ │ │ ├── compute-budget/ │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── reexports.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── index.ts │ │ │ │ ├── memo/ │ │ │ │ │ ├── generated/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── instructions/ │ │ │ │ │ │ │ ├── addMemo.ts │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ └── programs/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── memo.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── shared/ │ │ │ │ │ └── index.ts │ │ │ │ ├── system/ │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reexports.ts │ │ │ │ ├── token/ │ │ │ │ │ ├── addresses.ts │ │ │ │ │ ├── assert-is-mint.ts │ │ │ │ │ ├── fetch-token-accounts.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── instructions/ │ │ │ │ │ │ ├── create-token.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── mint-tokens.ts │ │ │ │ │ │ ├── transfer-tokens.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── reexports.ts │ │ │ │ │ ├── transactions/ │ │ │ │ │ │ ├── create-token.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── mint-tokens.ts │ │ │ │ │ │ ├── transfer-tokens.ts │ │ │ │ │ │ └── types.ts │ │ │ │ │ └── ui-amount.ts │ │ │ │ └── token-metadata/ │ │ │ │ ├── addresses.ts │ │ │ │ ├── generated/ │ │ │ │ │ ├── accounts/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── metadata.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── instructions/ │ │ │ │ │ │ ├── createMetadataAccountV3.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── updateMetadataAccountV2.ts │ │ │ │ │ ├── programs/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── tokenMetadata.ts │ │ │ │ │ └── types/ │ │ │ │ │ ├── assetData.ts │ │ │ │ │ ├── authorizationData.ts │ │ │ │ │ ├── collection.ts │ │ │ │ │ ├── collectionDetails.ts │ │ │ │ │ ├── collectionDetailsToggle.ts │ │ │ │ │ ├── collectionToggle.ts │ │ │ │ │ ├── createArgs.ts │ │ │ │ │ ├── creator.ts │ │ │ │ │ ├── data.ts │ │ │ │ │ ├── dataV2.ts │ │ │ │ │ ├── delegateArgs.ts │ │ │ │ │ ├── escrowAuthority.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── key.ts │ │ │ │ │ ├── mintArgs.ts │ │ │ │ │ ├── payload.ts │ │ │ │ │ ├── payloadType.ts │ │ │ │ │ ├── printSupply.ts │ │ │ │ │ ├── programmableConfig.ts │ │ │ │ │ ├── proofInfo.ts │ │ │ │ │ ├── reservation.ts │ │ │ │ │ ├── ruleSetToggle.ts │ │ │ │ │ ├── seedsVec.ts │ │ │ │ │ ├── tokenStandard.ts │ │ │ │ │ ├── updateArgs.ts │ │ │ │ │ ├── useMethod.ts │ │ │ │ │ ├── uses.ts │ │ │ │ │ └── usesToggle.ts │ │ │ │ └── index.ts │ │ │ └── types/ │ │ │ ├── explorer.ts │ │ │ ├── global.d.ts │ │ │ ├── index.ts │ │ │ ├── rpc.ts │ │ │ └── transactions.ts │ │ ├── tsconfig.declarations.json │ │ ├── tsconfig.json │ │ ├── tsup.config.package.ts │ │ ├── typedoc.core.json │ │ ├── typedoc.node.json │ │ └── typedoc.programs.json │ ├── react/ │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── eslint.config.mjs │ │ ├── package.json │ │ ├── src/ │ │ │ ├── __tests__/ │ │ │ │ └── placeholder.ts │ │ │ ├── __typeset__/ │ │ │ │ ├── account.ts │ │ │ │ ├── balance.ts │ │ │ │ ├── get-slot.ts │ │ │ │ ├── latest-blockhash.ts │ │ │ │ ├── multiple-accounts.ts │ │ │ │ ├── program-accounts.ts │ │ │ │ ├── recent-prioritization-fees.ts │ │ │ │ ├── signature-statuses.ts │ │ │ │ ├── signatures-for-address.ts │ │ │ │ ├── simulate-transaction.ts │ │ │ │ ├── token-account-balance.ts │ │ │ │ ├── token-account.ts │ │ │ │ ├── token-mint.ts │ │ │ │ └── transaction.ts │ │ │ ├── const.ts │ │ │ ├── hooks/ │ │ │ │ ├── account.ts │ │ │ │ ├── balance.ts │ │ │ │ ├── client.ts │ │ │ │ ├── index.ts │ │ │ │ ├── latest-blockhash.ts │ │ │ │ ├── multiple-accounts.ts │ │ │ │ ├── program-accounts.ts │ │ │ │ ├── recent-prioritization-fees.ts │ │ │ │ ├── signature-statuses.ts │ │ │ │ ├── signatures-for-address.ts │ │ │ │ ├── simulate-transaction.ts │ │ │ │ ├── slot.ts │ │ │ │ ├── token-account-balance.ts │ │ │ │ ├── token-account.ts │ │ │ │ ├── token-mint.ts │ │ │ │ ├── transaction.ts │ │ │ │ └── types.ts │ │ │ ├── index.ts │ │ │ ├── providers.tsx │ │ │ └── types/ │ │ │ └── global.d.ts │ │ ├── tsconfig.declarations.json │ │ ├── tsconfig.json │ │ ├── tsup.config.package.ts │ │ └── typedoc.json │ ├── solana-pay/ │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src/ │ │ │ ├── __tests__/ │ │ │ │ ├── encode-url.ts │ │ │ │ ├── fetchers.ts │ │ │ │ ├── parse-url.ts │ │ │ │ └── response.ts │ │ │ ├── __typetests__/ │ │ │ │ └── response.ts │ │ │ ├── constants.ts │ │ │ ├── encode-url.ts │ │ │ ├── fetchers.ts │ │ │ ├── global.d.ts │ │ │ ├── index.ts │ │ │ ├── parse-url.ts │ │ │ ├── request.ts │ │ │ └── response.ts │ │ ├── tsconfig.declarations.json │ │ ├── tsconfig.json │ │ ├── tsup.config.package.ts │ │ └── typedoc.json │ ├── svelte/ │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── README.md │ │ ├── eslint.config.mjs │ │ ├── package.json │ │ ├── src/ │ │ │ ├── __tests__/ │ │ │ │ └── placeholder.ts │ │ │ ├── const.ts │ │ │ ├── index.ts │ │ │ └── types/ │ │ │ ├── global.d.ts │ │ │ └── index.ts │ │ ├── tsconfig.declarations.json │ │ ├── tsconfig.json │ │ └── tsup.config.package.ts │ ├── test-config/ │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── browser-environment.ts │ │ ├── global.d.ts │ │ ├── jest-dev.config.ts │ │ ├── jest-lint.config.ts │ │ ├── jest-prettier.config.ts │ │ ├── jest-unit.config.browser.ts │ │ ├── jest-unit.config.common.ts │ │ ├── jest-unit.config.node.ts │ │ ├── package.json │ │ ├── setup-define-version-constant.ts │ │ ├── setup-dev-mode.ts │ │ ├── setup-secure-context.ts │ │ ├── setup-text-encoder.ts │ │ ├── setup-undici-fetch.ts │ │ ├── setup-web-buffer-global.ts │ │ ├── setup-webcrypto.ts │ │ ├── setup-whatwg-fetch.ts │ │ └── tsconfig.json │ ├── tsconfig/ │ │ ├── .npmrc │ │ ├── README.md │ │ ├── base.json │ │ └── package.json │ └── vue/ │ ├── .gitignore │ ├── .npmrc │ ├── .prettierignore │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src/ │ │ ├── __tests__/ │ │ │ └── placeholder.ts │ │ ├── const.ts │ │ ├── index.ts │ │ └── types/ │ │ ├── global.d.ts │ │ └── index.ts │ ├── tsconfig.declarations.json │ ├── tsconfig.json │ └── tsup.config.package.ts ├── pnpm-workspace.yaml ├── turbo.json ├── typedoc.json └── typedoc.plugin.mjs
SYMBOL INDEX (481 symbols across 128 files)
FILE: docs/generic.d.ts
type Option (line 1) | type Option<T> = Some<T> | None;
type Entries (line 3) | type Entries<T> = {
type SearchParams (line 7) | type SearchParams<TKeys extends string = string> = Promise<
type SiteConfig (line 11) | type SiteConfig = {
type NotFoundResponse (line 27) | type NotFoundResponse = { notFound: true };
type SimpleComponentProps (line 29) | type SimpleComponentProps = {
type ImageSize (line 34) | type ImageSize = {
type LinkDetails (line 39) | type LinkDetails = {
type SubLinkDetails (line 47) | type SubLinkDetails = Omit<LinkDetails, "subLinks">;
FILE: docs/src/app/(home)/layout.tsx
function Layout (line 5) | function Layout({ children }: { children: ReactNode }) {
FILE: docs/src/app/(home)/page.tsx
function Page (line 10) | function Page() {
FILE: docs/src/app/api/[[...slug]]/page.tsx
function generateStaticParams (line 15) | async function generateStaticParams() {
function generateMetadata (line 19) | async function generateMetadata(props: {
function Page (line 45) | async function Page(props: { params: Promise<{ slug?: string[] }> }) {
FILE: docs/src/app/api/layout.tsx
function Layout (line 16) | function Layout({ children }: { children: ReactNode }) {
FILE: docs/src/app/docs/[[...slug]]/page.tsx
function generateStaticParams (line 14) | async function generateStaticParams() {
function generateMetadata (line 18) | async function generateMetadata(props: {
function Page (line 44) | async function Page(props: { params: Promise<{ slug?: string[] }> }) {
FILE: docs/src/app/docs/layout.tsx
function Layout (line 6) | function Layout({ children }: { children: ReactNode }) {
FILE: docs/src/app/docs/og/[...slug]/og.tsx
type GenerateProps (line 5) | interface GenerateProps {
function generateOGImage (line 11) | function generateOGImage(options: GenerateProps & ImageResponseOptions):...
function generate (line 28) | function generate({
FILE: docs/src/app/docs/og/[...slug]/route.tsx
function GET (line 9) | async function GET(_req: Request, { params }: { params: Promise<{ slug: ...
function generateStaticParams (line 33) | function generateStaticParams(): {
FILE: docs/src/app/layout.tsx
function Layout (line 30) | function Layout({ children }: { children: ReactNode }) {
FILE: docs/src/app/not-found.tsx
function Page (line 9) | function Page() {
FILE: docs/src/components/fathom-analytics.tsx
function TrackPageView (line 6) | function TrackPageView() {
function FathomAnalytics (line 34) | function FathomAnalytics() {
FILE: docs/src/components/footer-links.tsx
function FooterLinks (line 4) | function FooterLinks() {
FILE: docs/src/components/package-badges.tsx
type ComponentProps (line 3) | interface ComponentProps extends React.HTMLAttributes<HTMLDivElement> {
function PackageBadges (line 7) | function PackageBadges({ packageName, className, ...props }: ComponentPr...
FILE: docs/src/lib/Spread.tsx
function Spread (line 3) | function Spread({ children }: { children: ReactNode }) {
FILE: packages/build-scripts/dev-flag.ts
type Loader (line 5) | type Loader = NonNullable<
type Plugin (line 10) | type Plugin = NonNullable<Options["esbuildPlugins"]>[number];
function replaceDev (line 12) | function replaceDev(source: string): string {
method setup (line 35) | setup(build) {
FILE: packages/build-scripts/getBaseConfig.ts
type Platform (line 8) | type Platform =
constant BROWSERSLIST_TARGETS (line 14) | const BROWSERSLIST_TARGETS = browsersListToEsBuild();
function getBaseConfig (line 16) | function getBaseConfig(
FILE: packages/gill/generate-reexports.ts
type ReexportSettings (line 4) | type ReexportSettings = {
function generateExports (line 28) | async function generateExports() {
FILE: packages/gill/src/__tests__/base64-transactions.ts
constant MOCK_PRIVATE_KEY_BYTES (line 16) | const MOCK_PRIVATE_KEY_BYTES = new Uint8Array([
FILE: packages/gill/src/__tests__/create-token-instructions.ts
constant MOCK_SPACE (line 16) | const MOCK_SPACE = 122n;
constant MOCK_RENT (line 17) | const MOCK_RENT = 10000n;
FILE: packages/gill/src/__tests__/debug.ts
constant DEFAULT_PREFIX (line 3) | const DEFAULT_PREFIX = "[GILL]";
FILE: packages/gill/src/__tests__/keypairs-base58.ts
constant EXPECTED_ADDRESS (line 9) | const EXPECTED_ADDRESS = "5CxWcsm9h3NfCM8WPM6eaw8LnnSmnYyEHf8BQQ56YJGK";
constant MOCK_KEY_BYTES (line 12) | const MOCK_KEY_BYTES = new Uint8Array([
constant MOCK_KEY_BASE58 (line 19) | const MOCK_KEY_BASE58 = "4AxFzQaPR6N9dWP5K3GdZRLuWJcdgPznM4h42ASqByP3c6v...
FILE: packages/gill/src/core/base64-bytes-to.ts
function base64BytesToAddress (line 7) | function base64BytesToAddress(base64Bytes: string): Address {
function base64BytesToSignature (line 16) | function base64BytesToSignature(base64Bytes: string): Signature {
function base64BytesToString (line 25) | function base64BytesToString(base64Bytes: string): string {
FILE: packages/gill/src/core/base64-from-transaction.ts
function transactionFromBase64 (line 9) | function transactionFromBase64(base64EncodedTransaction: string): Transa...
FILE: packages/gill/src/core/base64-to-transaction.ts
function transactionToBase64 (line 22) | function transactionToBase64(
function transactionToBase64WithSigners (line 34) | async function transactionToBase64WithSigners(
FILE: packages/gill/src/core/const.ts
constant LAMPORTS_PER_SOL (line 2) | const LAMPORTS_PER_SOL = 1_000_000_000;
constant GENESIS_HASH (line 7) | const GENESIS_HASH = {
FILE: packages/gill/src/core/create-codama-config.ts
constant GILL_EXTERNAL_MODULE_MAP (line 4) | const GILL_EXTERNAL_MODULE_MAP: Record<string, string> = {
function createCodamaConfig (line 34) | function createCodamaConfig({
FILE: packages/gill/src/core/create-solana-client.ts
function createSolanaClient (line 35) | function createSolanaClient<TCluster extends ModifiedClusterUrl>({
FILE: packages/gill/src/core/create-transaction.ts
function createTransaction (line 71) | function createTransaction<
FILE: packages/gill/src/core/debug.ts
type LogLevel (line 5) | type LogLevel = "debug" | "info" | "warn" | "error";
constant GILL_LOG_LEVELS (line 7) | const GILL_LOG_LEVELS: Record<LogLevel, number> = {
function debug (line 64) | function debug(message: unknown, level: LogLevel = "info", prefix: strin...
FILE: packages/gill/src/core/explorer.ts
function getExplorerLink (line 6) | function getExplorerLink(props: GetExplorerLinkArgs = {}): string {
FILE: packages/gill/src/core/get-oldest-signature.ts
type GetOldestSignatureForAddressRpc (line 6) | type GetOldestSignatureForAddressRpc<TCluster> = Rpc<GetSignaturesForAdd...
type GetOldestSignatureForAddressConfig (line 10) | type GetOldestSignatureForAddressConfig = Simplify<
function getOldestSignatureForAddress (line 17) | async function getOldestSignatureForAddress<TCluster>(
FILE: packages/gill/src/core/get-signature-from-bytes.ts
function getSignatureFromBytes (line 9) | function getSignatureFromBytes(sigBytes: SignatureBytes): Signature {
FILE: packages/gill/src/core/insert-reference-key.ts
function insertReferenceKeyToTransactionMessage (line 12) | function insertReferenceKeyToTransactionMessage<TTransaction extends Bas...
function insertReferenceKeysToTransactionMessage (line 26) | function insertReferenceKeysToTransactionMessage<TTransaction extends Ba...
FILE: packages/gill/src/core/keypairs-base58.ts
function createKeypairFromBase58 (line 6) | async function createKeypairFromBase58(punitiveSecretKey: string): Promi...
function createKeypairSignerFromBase58 (line 13) | async function createKeypairSignerFromBase58(punitiveSecretKey: string):...
FILE: packages/gill/src/core/keypairs-extractable.ts
function assertKeyPairIsExtractable (line 5) | function assertKeyPairIsExtractable(keyPair: CryptoKeyPair): asserts key...
type Extractable (line 21) | type Extractable = { "~extractable": true };
type ExtractableCryptoKeyPair (line 23) | type ExtractableCryptoKeyPair = CryptoKeyPair & Extractable;
type ExtractableKeyPairSigner (line 24) | type ExtractableKeyPairSigner = KeyPairSigner & Extractable;
function generateExtractableKeyPair (line 29) | async function generateExtractableKeyPair(): Promise<ExtractableCryptoKe...
function generateExtractableKeyPairSigner (line 41) | async function generateExtractableKeyPairSigner(): Promise<ExtractableKe...
function extractBytesFromKeyPair (line 55) | async function extractBytesFromKeyPair(keypair: ExtractableCryptoKeyPair...
function extractBytesFromKeyPairSigner (line 78) | async function extractBytesFromKeyPairSigner(
FILE: packages/gill/src/core/prepare-transaction.ts
type PrepareCompilableTransactionMessage (line 19) | type PrepareCompilableTransactionMessage = TransactionMessageWithFeePaye...
type PrepareTransactionConfig (line 21) | type PrepareTransactionConfig<TMessage extends PrepareCompilableTransact...
function prepareTransaction (line 56) | async function prepareTransaction<TMessage extends PrepareCompilableTran...
FILE: packages/gill/src/core/rent.ts
function getMinimumBalanceForRentExemption (line 4) | function getMinimumBalanceForRentExemption(space: bigint | number = 0) {
FILE: packages/gill/src/core/rpc.ts
function localnet (line 4) | function localnet(putativeString: string): LocalnetUrl {
function getPublicSolanaRpcUrl (line 13) | function getPublicSolanaRpcUrl(
FILE: packages/gill/src/core/send-and-confirm-transaction-with-signers.ts
type SendAndConfirmTransactionWithBlockhashLifetimeConfig (line 35) | interface SendAndConfirmTransactionWithBlockhashLifetimeConfig extends S...
type SendTransactionConfigWithoutEncoding (line 46) | type SendTransactionConfigWithoutEncoding = Omit<
type SendableTransaction (line 51) | type SendableTransaction =
type SendAndConfirmTransactionWithSignersFunction (line 56) | type SendAndConfirmTransactionWithSignersFunction = (
type SendAndConfirmTransactionWithSignersFactoryConfig (line 64) | type SendAndConfirmTransactionWithSignersFactoryConfig<TCluster> = {
function sendAndConfirmTransactionWithSignersFactory (line 89) | function sendAndConfirmTransactionWithSignersFactory<
FILE: packages/gill/src/core/simulate-transaction.ts
type SimulateTransactionFunction (line 11) | type SimulateTransactionFunction = (
type SimulateTransactionFactoryConfig (line 16) | type SimulateTransactionFactoryConfig<TCluster> = {
function simulateTransactionFactory (line 34) | function simulateTransactionFactory<
FILE: packages/gill/src/core/utils.ts
function getMonikerFromGenesisHash (line 16) | function getMonikerFromGenesisHash(hash: string): SolanaClusterMoniker |...
function checkedAddress (line 29) | function checkedAddress<TAddress extends string = string>(
function checkedTransactionSigner (line 35) | function checkedTransactionSigner<TAddress extends string = string>(
function lamportsToSol (line 49) | function lamportsToSol(lamports: bigint | number, decimals: number = 9):...
FILE: packages/gill/src/core/verify-signature.ts
function verifySignatureForAddress (line 30) | async function verifySignatureForAddress(
FILE: packages/gill/src/node/const.ts
constant DEFAULT_CLI_KEYPAIR_PATH (line 2) | const DEFAULT_CLI_KEYPAIR_PATH = "~/.config/solana/id.json";
FILE: packages/gill/src/node/load-keypair-base58.ts
function loadKeypairFromEnvironmentBase58 (line 9) | async function loadKeypairFromEnvironmentBase58<TName extends keyof Node...
function loadKeypairSignerFromEnvironmentBase58 (line 23) | async function loadKeypairSignerFromEnvironmentBase58<TName extends keyo...
FILE: packages/gill/src/node/load-keypair.ts
function loadKeypairFromFile (line 15) | async function loadKeypairFromFile(filePath: string = DEFAULT_CLI_KEYPAI...
function loadKeypairSignerFromFile (line 26) | async function loadKeypairSignerFromFile(filePath: string = DEFAULT_CLI_...
function loadKeypairFromEnvironment (line 38) | async function loadKeypairFromEnvironment<TName extends keyof NodeJS.Pro...
function loadKeypairSignerFromEnvironment (line 55) | async function loadKeypairSignerFromEnvironment<TName extends keyof Node...
FILE: packages/gill/src/node/save-keypair.ts
function saveKeypairToFile (line 16) | async function saveKeypairToFile(keypair: CryptoKeyPair, filePath: strin...
function saveKeypairSignerToFile (line 47) | async function saveKeypairSignerToFile(keypairSigner: KeyPairSigner, fil...
function saveKeypairToEnvFile (line 59) | async function saveKeypairToEnvFile(
function saveKeypairSignerToEnvFile (line 93) | async function saveKeypairSignerToEnvFile(
FILE: packages/gill/src/programs/compute-budget/utils.ts
function isSetComputeLimitInstruction (line 8) | function isSetComputeLimitInstruction(
function hasSetComputeLimitInstruction (line 21) | function hasSetComputeLimitInstruction(tx: TransactionMessage): boolean {
function isSetComputeUnitPriceInstruction (line 28) | function isSetComputeUnitPriceInstruction(
function hasSetComputeUnitPriceInstruction (line 41) | function hasSetComputeUnitPriceInstruction(tx: TransactionMessage): bool...
FILE: packages/gill/src/programs/memo/generated/instructions/addMemo.ts
type AddMemoInstruction (line 30) | type AddMemoInstruction<
type AddMemoInstructionData (line 35) | type AddMemoInstructionData = { memo: string };
type AddMemoInstructionDataArgs (line 37) | type AddMemoInstructionDataArgs = AddMemoInstructionData;
function getAddMemoInstructionDataEncoder (line 39) | function getAddMemoInstructionDataEncoder(): Encoder<AddMemoInstructionD...
function getAddMemoInstructionDataDecoder (line 43) | function getAddMemoInstructionDataDecoder(): Decoder<AddMemoInstructionD...
function getAddMemoInstructionDataCodec (line 47) | function getAddMemoInstructionDataCodec(): Codec<AddMemoInstructionDataA...
type AddMemoInput (line 51) | type AddMemoInput = {
function getAddMemoInstruction (line 56) | function getAddMemoInstruction<TProgramAddress extends Address = typeof ...
type ParsedAddMemoInstruction (line 82) | type ParsedAddMemoInstruction<TProgram extends string = typeof MEMO_PROG...
function parseAddMemoInstruction (line 87) | function parseAddMemoInstruction<TProgram extends string>(
FILE: packages/gill/src/programs/memo/generated/programs/memo.ts
constant MEMO_PROGRAM_ADDRESS (line 12) | const MEMO_PROGRAM_ADDRESS =
type MemoInstruction (line 15) | enum MemoInstruction {
type ParsedMemoInstruction (line 19) | type ParsedMemoInstruction<TProgram extends string = "MemoSq4gqABAXKb96q...
FILE: packages/gill/src/programs/shared/index.ts
function expectSome (line 21) | function expectSome<T>(value: T | null | undefined): T {
function expectAddress (line 32) | function expectAddress<T extends string = string>(
function expectProgramDerivedAddress (line 51) | function expectProgramDerivedAddress<T extends string = string>(
function expectTransactionSigner (line 64) | function expectTransactionSigner<T extends string = string>(
type ResolvedAccount (line 77) | type ResolvedAccount<
type IInstructionWithByteDelta (line 93) | type IInstructionWithByteDelta = {
function getAccountMetaFactory (line 101) | function getAccountMetaFactory(programAddress: Address, optionalAccountS...
function isTransactionSigner (line 120) | function isTransactionSigner<TAddress extends string = string>(
FILE: packages/gill/src/programs/token-metadata/addresses.ts
function getTokenMetadataAddress (line 10) | async function getTokenMetadataAddress(mint: Address | KeyPairSigner): P...
FILE: packages/gill/src/programs/token-metadata/generated/accounts/metadata.ts
type Metadata (line 70) | type Metadata = {
type MetadataArgs (line 85) | type MetadataArgs = {
function getMetadataEncoder (line 100) | function getMetadataEncoder(): Encoder<MetadataArgs> {
function getMetadataDecoder (line 117) | function getMetadataDecoder(): Decoder<Metadata> {
function getMetadataCodec (line 134) | function getMetadataCodec(): Codec<MetadataArgs, Metadata> {
function decodeMetadata (line 144) | function decodeMetadata<TAddress extends string = string>(
function fetchMetadata (line 150) | async function fetchMetadata<TAddress extends string = string>(
function fetchMaybeMetadata (line 160) | async function fetchMaybeMetadata<TAddress extends string = string>(
function fetchAllMetadata (line 169) | async function fetchAllMetadata(
function fetchAllMaybeMetadata (line 179) | async function fetchAllMaybeMetadata(
FILE: packages/gill/src/programs/token-metadata/generated/instructions/createMetadataAccountV3.ts
constant CREATE_METADATA_ACCOUNT_V3_DISCRIMINATOR (line 54) | const CREATE_METADATA_ACCOUNT_V3_DISCRIMINATOR = 33;
function getCreateMetadataAccountV3DiscriminatorBytes (line 56) | function getCreateMetadataAccountV3DiscriminatorBytes(): ReadonlyUint8Ar...
type CreateMetadataAccountV3Instruction (line 60) | type CreateMetadataAccountV3Instruction<
type CreateMetadataAccountV3InstructionData (line 91) | type CreateMetadataAccountV3InstructionData = {
type CreateMetadataAccountV3InstructionDataArgs (line 98) | type CreateMetadataAccountV3InstructionDataArgs = {
function getCreateMetadataAccountV3InstructionDataEncoder (line 104) | function getCreateMetadataAccountV3InstructionDataEncoder(): Encoder<Cre...
function getCreateMetadataAccountV3InstructionDataDecoder (line 119) | function getCreateMetadataAccountV3InstructionDataDecoder(): Decoder<Cre...
function getCreateMetadataAccountV3InstructionDataCodec (line 128) | function getCreateMetadataAccountV3InstructionDataCodec(): Codec<
type CreateMetadataAccountV3Input (line 138) | type CreateMetadataAccountV3Input<
function getCreateMetadataAccountV3Instruction (line 166) | function getCreateMetadataAccountV3Instruction<
type ParsedCreateMetadataAccountV3Instruction (line 253) | type ParsedCreateMetadataAccountV3Instruction<
function parseCreateMetadataAccountV3Instruction (line 277) | function parseCreateMetadataAccountV3Instruction<
FILE: packages/gill/src/programs/token-metadata/generated/instructions/updateMetadataAccountV2.ts
constant UPDATE_METADATA_ACCOUNT_V2_DISCRIMINATOR (line 41) | const UPDATE_METADATA_ACCOUNT_V2_DISCRIMINATOR = 15;
function getUpdateMetadataAccountV2DiscriminatorBytes (line 43) | function getUpdateMetadataAccountV2DiscriminatorBytes() {
type UpdateMetadataAccountV2Instruction (line 47) | type UpdateMetadataAccountV2Instruction<
type UpdateMetadataAccountV2InstructionData (line 64) | type UpdateMetadataAccountV2InstructionData = {
type UpdateMetadataAccountV2InstructionDataArgs (line 72) | type UpdateMetadataAccountV2InstructionDataArgs = {
function getUpdateMetadataAccountV2InstructionDataEncoder (line 79) | function getUpdateMetadataAccountV2InstructionDataEncoder(): Encoder<Upd...
function getUpdateMetadataAccountV2InstructionDataDecoder (line 95) | function getUpdateMetadataAccountV2InstructionDataDecoder(): Decoder<Upd...
function getUpdateMetadataAccountV2InstructionDataCodec (line 105) | function getUpdateMetadataAccountV2InstructionDataCodec(): Codec<
type UpdateMetadataAccountV2Input (line 115) | type UpdateMetadataAccountV2Input<
function getUpdateMetadataAccountV2Instruction (line 129) | function getUpdateMetadataAccountV2Instruction<
type ParsedUpdateMetadataAccountV2Instruction (line 163) | type ParsedUpdateMetadataAccountV2Instruction<
function parseUpdateMetadataAccountV2Instruction (line 177) | function parseUpdateMetadataAccountV2Instruction<
FILE: packages/gill/src/programs/token-metadata/generated/programs/tokenMetadata.ts
constant TOKEN_METADATA_PROGRAM_ADDRESS (line 11) | const TOKEN_METADATA_PROGRAM_ADDRESS =
type TokenMetadataAccount (line 14) | enum TokenMetadataAccount {
type TokenMetadataInstruction (line 31) | enum TokenMetadataInstruction {
FILE: packages/gill/src/programs/token-metadata/generated/types/assetData.ts
type AssetData (line 59) | type AssetData = {
type AssetDataArgs (line 74) | type AssetDataArgs = {
function getAssetDataEncoder (line 89) | function getAssetDataEncoder(): Encoder<AssetDataArgs> {
function getAssetDataDecoder (line 106) | function getAssetDataDecoder(): Decoder<AssetData> {
function getAssetDataCodec (line 123) | function getAssetDataCodec(): Codec<AssetDataArgs, AssetData> {
FILE: packages/gill/src/programs/token-metadata/generated/types/authorizationData.ts
type AuthorizationData (line 24) | type AuthorizationData = { payload: Payload };
type AuthorizationDataArgs (line 26) | type AuthorizationDataArgs = { payload: PayloadArgs };
function getAuthorizationDataEncoder (line 28) | function getAuthorizationDataEncoder(): Encoder<AuthorizationDataArgs> {
function getAuthorizationDataDecoder (line 32) | function getAuthorizationDataDecoder(): Decoder<AuthorizationData> {
function getAuthorizationDataCodec (line 36) | function getAuthorizationDataCodec(): Codec<
FILE: packages/gill/src/programs/token-metadata/generated/types/collection.ts
type Collection (line 23) | type Collection = { verified: boolean; key: Address };
type CollectionArgs (line 25) | type CollectionArgs = Collection;
function getCollectionEncoder (line 27) | function getCollectionEncoder(): Encoder<CollectionArgs> {
function getCollectionDecoder (line 34) | function getCollectionDecoder(): Decoder<Collection> {
function getCollectionCodec (line 41) | function getCollectionCodec(): Codec<CollectionArgs, Collection> {
FILE: packages/gill/src/programs/token-metadata/generated/types/collectionDetails.ts
type CollectionDetails (line 29) | type CollectionDetails =
type CollectionDetailsArgs (line 33) | type CollectionDetailsArgs =
function getCollectionDetailsEncoder (line 37) | function getCollectionDetailsEncoder(): Encoder<CollectionDetailsArgs> {
function getCollectionDetailsDecoder (line 47) | function getCollectionDetailsDecoder(): Decoder<CollectionDetails> {
function getCollectionDetailsCodec (line 57) | function getCollectionDetailsCodec(): Codec<
function collectionDetails (line 84) | function collectionDetails<
function isCollectionDetails (line 93) | function isCollectionDetails<K extends CollectionDetails['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/collectionDetailsToggle.ts
type CollectionDetailsToggle (line 32) | type CollectionDetailsToggle =
type CollectionDetailsToggleArgs (line 37) | type CollectionDetailsToggleArgs =
function getCollectionDetailsToggleEncoder (line 42) | function getCollectionDetailsToggleEncoder(): Encoder<CollectionDetailsT...
function getCollectionDetailsToggleDecoder (line 55) | function getCollectionDetailsToggleDecoder(): Decoder<CollectionDetailsT...
function getCollectionDetailsToggleCodec (line 68) | function getCollectionDetailsToggleCodec(): Codec<
function collectionDetailsToggle (line 93) | function collectionDetailsToggle<
function isCollectionDetailsToggle (line 102) | function isCollectionDetailsToggle<
FILE: packages/gill/src/programs/token-metadata/generated/types/collectionToggle.ts
type CollectionToggle (line 32) | type CollectionToggle =
type CollectionToggleArgs (line 37) | type CollectionToggleArgs =
function getCollectionToggleEncoder (line 42) | function getCollectionToggleEncoder(): Encoder<CollectionToggleArgs> {
function getCollectionToggleDecoder (line 53) | function getCollectionToggleDecoder(): Decoder<CollectionToggle> {
function getCollectionToggleCodec (line 64) | function getCollectionToggleCodec(): Codec<
function collectionToggle (line 89) | function collectionToggle<
function isCollectionToggle (line 98) | function isCollectionToggle<K extends CollectionToggle['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/createArgs.ts
type CreateArgs (line 38) | type CreateArgs = {
type CreateArgsArgs (line 45) | type CreateArgsArgs = {
function getCreateArgsEncoder (line 52) | function getCreateArgsEncoder(): Encoder<CreateArgsArgs> {
function getCreateArgsDecoder (line 65) | function getCreateArgsDecoder(): Decoder<CreateArgs> {
function getCreateArgsCodec (line 78) | function getCreateArgsCodec(): Codec<CreateArgsArgs, CreateArgs> {
function createArgs (line 87) | function createArgs<K extends CreateArgsArgs['__kind'], Data>(
function isCreateArgs (line 96) | function isCreateArgs<K extends CreateArgs['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/creator.ts
type Creator (line 25) | type Creator = { address: Address; verified: boolean; share: number };
type CreatorArgs (line 27) | type CreatorArgs = Creator;
function getCreatorEncoder (line 29) | function getCreatorEncoder(): Encoder<CreatorArgs> {
function getCreatorDecoder (line 37) | function getCreatorDecoder(): Decoder<Creator> {
function getCreatorCodec (line 45) | function getCreatorCodec(): Codec<CreatorArgs, Creator> {
FILE: packages/gill/src/programs/token-metadata/generated/types/data.ts
type Data (line 38) | type Data = {
type DataArgs (line 46) | type DataArgs = {
function getDataEncoder (line 54) | function getDataEncoder(): Encoder<DataArgs> {
function getDataDecoder (line 64) | function getDataDecoder(): Decoder<Data> {
function getDataCodec (line 74) | function getDataCodec(): Codec<DataArgs, Data> {
FILE: packages/gill/src/programs/token-metadata/generated/types/dataV2.ts
type DataV2 (line 46) | type DataV2 = {
type DataV2Args (line 56) | type DataV2Args = {
function getDataV2Encoder (line 66) | function getDataV2Encoder(): Encoder<DataV2Args> {
function getDataV2Decoder (line 78) | function getDataV2Decoder(): Decoder<DataV2> {
function getDataV2Codec (line 90) | function getDataV2Codec(): Codec<DataV2Args, DataV2> {
FILE: packages/gill/src/programs/token-metadata/generated/types/delegateArgs.ts
type DelegateArgs (line 37) | type DelegateArgs =
type DelegateArgsArgs (line 80) | type DelegateArgsArgs =
function getDelegateArgsEncoder (line 141) | function getDelegateArgsEncoder(): Encoder<DelegateArgsArgs> {
function getDelegateArgsDecoder (line 231) | function getDelegateArgsDecoder(): Decoder<DelegateArgs> {
function getDelegateArgsCodec (line 321) | function getDelegateArgsCodec(): Codec<DelegateArgsArgs, DelegateArgs> {
function delegateArgs (line 446) | function delegateArgs<K extends DelegateArgsArgs['__kind'], Data>(
function isDelegateArgs (line 455) | function isDelegateArgs<K extends DelegateArgs['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/escrowAuthority.ts
type EscrowAuthority (line 29) | type EscrowAuthority =
type EscrowAuthorityArgs (line 33) | type EscrowAuthorityArgs = EscrowAuthority;
function getEscrowAuthorityEncoder (line 35) | function getEscrowAuthorityEncoder(): Encoder<EscrowAuthorityArgs> {
function getEscrowAuthorityDecoder (line 45) | function getEscrowAuthorityDecoder(): Decoder<EscrowAuthority> {
function getEscrowAuthorityCodec (line 55) | function getEscrowAuthorityCodec(): Codec<
function escrowAuthority (line 74) | function escrowAuthority<K extends EscrowAuthorityArgs['__kind'], Data>(
function isEscrowAuthority (line 83) | function isEscrowAuthority<K extends EscrowAuthority['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/key.ts
type Key (line 18) | enum Key {
type KeyArgs (line 36) | type KeyArgs = Key;
function getKeyEncoder (line 38) | function getKeyEncoder(): Encoder<KeyArgs> {
function getKeyDecoder (line 42) | function getKeyDecoder(): Decoder<Key> {
function getKeyCodec (line 46) | function getKeyCodec(): Codec<KeyArgs, Key> {
FILE: packages/gill/src/programs/token-metadata/generated/types/mintArgs.ts
type MetadataMintArgs (line 34) | type MetadataMintArgs = {
type MintArgsArgs (line 40) | type MintArgsArgs = {
function getMintArgsEncoder (line 46) | function getMintArgsEncoder(): Encoder<MintArgsArgs> {
function getMintArgsDecoder (line 58) | function getMintArgsDecoder(): Decoder<MetadataMintArgs> {
function getMintArgsCodec (line 70) | function getMintArgsCodec(): Codec<MintArgsArgs, MetadataMintArgs> {
function mintArgs (line 79) | function mintArgs<K extends MintArgsArgs["__kind"], Data>(kind: K, data?...
function isMintArgs (line 83) | function isMintArgs<K extends MetadataMintArgs["__kind"]>(
FILE: packages/gill/src/programs/token-metadata/generated/types/payload.ts
type Payload (line 32) | type Payload = { map: Map<string, PayloadType> };
type PayloadArgs (line 34) | type PayloadArgs = { map: Map<string, PayloadTypeArgs> };
function getPayloadEncoder (line 36) | function getPayloadEncoder(): Encoder<PayloadArgs> {
function getPayloadDecoder (line 48) | function getPayloadDecoder(): Decoder<Payload> {
function getPayloadCodec (line 60) | function getPayloadCodec(): Codec<PayloadArgs, Payload> {
FILE: packages/gill/src/programs/token-metadata/generated/types/payloadType.ts
type PayloadType (line 39) | type PayloadType =
type PayloadTypeArgs (line 45) | type PayloadTypeArgs =
function getPayloadTypeEncoder (line 51) | function getPayloadTypeEncoder(): Encoder<PayloadTypeArgs> {
function getPayloadTypeDecoder (line 72) | function getPayloadTypeDecoder(): Decoder<PayloadType> {
function getPayloadTypeCodec (line 93) | function getPayloadTypeCodec(): Codec<PayloadTypeArgs, PayloadType> {
function payloadType (line 130) | function payloadType<K extends PayloadTypeArgs['__kind'], Data>(
function isPayloadType (line 139) | function isPayloadType<K extends PayloadType['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/printSupply.ts
type PrintSupply (line 28) | type PrintSupply =
type PrintSupplyArgs (line 33) | type PrintSupplyArgs =
function getPrintSupplyEncoder (line 38) | function getPrintSupplyEncoder(): Encoder<PrintSupplyArgs> {
function getPrintSupplyDecoder (line 49) | function getPrintSupplyDecoder(): Decoder<PrintSupply> {
function getPrintSupplyCodec (line 60) | function getPrintSupplyCodec(): Codec<PrintSupplyArgs, PrintSupply> {
function printSupply (line 79) | function printSupply<K extends PrintSupplyArgs['__kind'], Data>(
function isPrintSupply (line 88) | function isPrintSupply<K extends PrintSupply['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/programmableConfig.ts
type ProgrammableConfig (line 29) | type ProgrammableConfig = { __kind: 'V1'; ruleSet: Option<Address> };
type ProgrammableConfigArgs (line 31) | type ProgrammableConfigArgs = {
function getProgrammableConfigEncoder (line 36) | function getProgrammableConfigEncoder(): Encoder<ProgrammableConfigArgs> {
function getProgrammableConfigDecoder (line 45) | function getProgrammableConfigDecoder(): Decoder<ProgrammableConfig> {
function getProgrammableConfigCodec (line 54) | function getProgrammableConfigCodec(): Codec<
function programmableConfig (line 73) | function programmableConfig<
function isProgrammableConfig (line 82) | function isProgrammableConfig<K extends ProgrammableConfig['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/proofInfo.ts
type ProofInfo (line 25) | type ProofInfo = { proof: Array<ReadonlyUint8Array> };
type ProofInfoArgs (line 27) | type ProofInfoArgs = ProofInfo;
function getProofInfoEncoder (line 29) | function getProofInfoEncoder(): Encoder<ProofInfoArgs> {
function getProofInfoDecoder (line 35) | function getProofInfoDecoder(): Decoder<ProofInfo> {
function getProofInfoCodec (line 41) | function getProofInfoCodec(): Codec<ProofInfoArgs, ProofInfo> {
FILE: packages/gill/src/programs/token-metadata/generated/types/reservation.ts
type Reservation (line 23) | type Reservation = {
type ReservationArgs (line 29) | type ReservationArgs = {
function getReservationEncoder (line 35) | function getReservationEncoder(): Encoder<ReservationArgs> {
function getReservationDecoder (line 43) | function getReservationDecoder(): Decoder<Reservation> {
function getReservationCodec (line 51) | function getReservationCodec(): Codec<ReservationArgs, Reservation> {
FILE: packages/gill/src/programs/token-metadata/generated/types/ruleSetToggle.ts
type RuleSetToggle (line 29) | type RuleSetToggle =
type RuleSetToggleArgs (line 34) | type RuleSetToggleArgs = RuleSetToggle;
function getRuleSetToggleEncoder (line 36) | function getRuleSetToggleEncoder(): Encoder<RuleSetToggleArgs> {
function getRuleSetToggleDecoder (line 47) | function getRuleSetToggleDecoder(): Decoder<RuleSetToggle> {
function getRuleSetToggleCodec (line 58) | function getRuleSetToggleCodec(): Codec<
function ruleSetToggle (line 80) | function ruleSetToggle<K extends RuleSetToggleArgs['__kind'], Data>(
function isRuleSetToggle (line 89) | function isRuleSetToggle<K extends RuleSetToggle['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/seedsVec.ts
type SeedsVec (line 27) | type SeedsVec = { seeds: Array<ReadonlyUint8Array> };
type SeedsVecArgs (line 29) | type SeedsVecArgs = SeedsVec;
function getSeedsVecEncoder (line 31) | function getSeedsVecEncoder(): Encoder<SeedsVecArgs> {
function getSeedsVecDecoder (line 40) | function getSeedsVecDecoder(): Decoder<SeedsVec> {
function getSeedsVecCodec (line 49) | function getSeedsVecCodec(): Codec<SeedsVecArgs, SeedsVec> {
FILE: packages/gill/src/programs/token-metadata/generated/types/tokenStandard.ts
type TokenStandard (line 11) | enum TokenStandard {
type TokenStandardArgs (line 20) | type TokenStandardArgs = TokenStandard;
function getTokenStandardEncoder (line 22) | function getTokenStandardEncoder(): Encoder<TokenStandardArgs> {
function getTokenStandardDecoder (line 26) | function getTokenStandardDecoder(): Decoder<TokenStandard> {
function getTokenStandardCodec (line 30) | function getTokenStandardCodec(): Codec<TokenStandardArgs, TokenStandard> {
FILE: packages/gill/src/programs/token-metadata/generated/types/updateArgs.ts
type UpdateArgs (line 61) | type UpdateArgs =
type UpdateArgsArgs (line 126) | type UpdateArgsArgs =
function getUpdateArgsEncoder (line 191) | function getUpdateArgsEncoder(): Encoder<UpdateArgsArgs> {
function getUpdateArgsDecoder (line 277) | function getUpdateArgsDecoder(): Decoder<UpdateArgs> {
function getUpdateArgsCodec (line 363) | function getUpdateArgsCodec(): Codec<UpdateArgsArgs, UpdateArgs> {
function updateArgs (line 464) | function updateArgs<K extends UpdateArgsArgs['__kind'], Data>(
function isUpdateArgs (line 473) | function isUpdateArgs<K extends UpdateArgs['__kind']>(
FILE: packages/gill/src/programs/token-metadata/generated/types/useMethod.ts
type UseMethod (line 18) | enum UseMethod {
type UseMethodArgs (line 24) | type UseMethodArgs = UseMethod;
function getUseMethodEncoder (line 26) | function getUseMethodEncoder(): Encoder<UseMethodArgs> {
function getUseMethodDecoder (line 30) | function getUseMethodDecoder(): Decoder<UseMethod> {
function getUseMethodCodec (line 34) | function getUseMethodCodec(): Codec<UseMethodArgs, UseMethod> {
FILE: packages/gill/src/programs/token-metadata/generated/types/uses.ts
type Uses (line 26) | type Uses = { useMethod: UseMethod; remaining: bigint; total: bigint };
type UsesArgs (line 28) | type UsesArgs = {
function getUsesEncoder (line 34) | function getUsesEncoder(): Encoder<UsesArgs> {
function getUsesDecoder (line 42) | function getUsesDecoder(): Decoder<Uses> {
function getUsesCodec (line 50) | function getUsesCodec(): Codec<UsesArgs, Uses> {
FILE: packages/gill/src/programs/token-metadata/generated/types/usesToggle.ts
type UsesToggle (line 27) | type UsesToggle =
type UsesToggleArgs (line 32) | type UsesToggleArgs =
function getUsesToggleEncoder (line 37) | function getUsesToggleEncoder(): Encoder<UsesToggleArgs> {
function getUsesToggleDecoder (line 48) | function getUsesToggleDecoder(): Decoder<UsesToggle> {
function getUsesToggleCodec (line 59) | function getUsesToggleCodec(): Codec<UsesToggleArgs, UsesToggle> {
function usesToggle (line 78) | function usesToggle<K extends UsesToggleArgs['__kind'], Data>(
function isUsesToggle (line 87) | function isUsesToggle<K extends UsesToggle['__kind']>(
FILE: packages/gill/src/programs/token/addresses.ts
type LegacyTokenProgramMonikers (line 5) | type LegacyTokenProgramMonikers = "legacy" | "token";
type TokenExtensionProgramMonikers (line 7) | type TokenExtensionProgramMonikers = "token22" | "tokenExtension" | "tok...
type TokenProgramMonikers (line 9) | type TokenProgramMonikers = LegacyTokenProgramMonikers | TokenExtensionP...
constant TOKEN_PROGRAM_ADDRESS (line 11) | const TOKEN_PROGRAM_ADDRESS =
function getAssociatedTokenAccountAddress (line 24) | async function getAssociatedTokenAccountAddress(
function parseTokenProgramAddressOrMoniker (line 38) | function parseTokenProgramAddressOrMoniker(tokenProgram: Address | Token...
function assertIsSupportedTokenProgram (line 60) | function assertIsSupportedTokenProgram(
function checkedTokenProgramAddress (line 77) | function checkedTokenProgramAddress(tokenProgram?: Address | TokenProgra...
FILE: packages/gill/src/programs/token/assert-is-mint.ts
function assertIsMint (line 10) | function assertIsMint<TAddress extends string = string>(
FILE: packages/gill/src/programs/token/fetch-token-accounts.ts
type OriginalConfigParam (line 8) | type OriginalConfigParam = NonNullable<Parameters<GetTokenAccountsByOwne...
type FetchTokenAccountsConfig (line 10) | type FetchTokenAccountsConfig = Simplify<
function fetchTokenAccounts (line 29) | async function fetchTokenAccounts<TMintAddress extends string = string, ...
FILE: packages/gill/src/programs/token/instructions/create-token.ts
type GetCreateTokenInstructionsArgs (line 17) | type GetCreateTokenInstructionsArgs = TokenInstructionBase<KeyPairSigner...
function getCreateTokenInstructions (line 78) | function getCreateTokenInstructions(args: GetCreateTokenInstructionsArgs...
FILE: packages/gill/src/programs/token/instructions/mint-tokens.ts
type GetMintTokensInstructionsArgs (line 8) | type GetMintTokensInstructionsArgs = TokenInstructionBase & {
function getMintTokensInstructions (line 58) | function getMintTokensInstructions(args: GetMintTokensInstructionsArgs):...
FILE: packages/gill/src/programs/token/instructions/transfer-tokens.ts
type GetTransferTokensInstructionsArgs (line 8) | type GetTransferTokensInstructionsArgs = TokenInstructionBase & {
function getTransferTokensInstructions (line 67) | function getTransferTokensInstructions(args: GetTransferTokensInstructio...
FILE: packages/gill/src/programs/token/instructions/types.ts
type TokenInstructionBase (line 5) | type TokenInstructionBase<TMint = KeyPairSigner | Address> = {
FILE: packages/gill/src/programs/token/transactions/create-token.ts
type GetCreateTokenTransactionInput (line 16) | type GetCreateTokenTransactionInput = Simplify<
function buildCreateTokenTransaction (line 64) | async function buildCreateTokenTransaction<
FILE: packages/gill/src/programs/token/transactions/mint-tokens.ts
type GetCreateTokenTransactionInput (line 14) | type GetCreateTokenTransactionInput = Simplify<
function buildMintTokensTransaction (line 66) | async function buildMintTokensTransaction<
FILE: packages/gill/src/programs/token/transactions/transfer-tokens.ts
type GetTransferTokensTransactionInput (line 14) | type GetTransferTokensTransactionInput = Simplify<
function buildTransferTokensTransaction (line 68) | async function buildTransferTokensTransaction<
FILE: packages/gill/src/programs/token/transactions/types.ts
type TransactionBuilderInput (line 9) | type TransactionBuilderInput<
FILE: packages/gill/src/programs/token/ui-amount.ts
function tokenUiAmountToAmount (line 7) | function tokenUiAmountToAmount(uiAmount: number, decimals: number): bigi...
function tokenAmountToUiAmount (line 52) | function tokenAmountToUiAmount(amount: bigint, decimals: number): number {
FILE: packages/gill/src/types/explorer.ts
type ExplorerLinkAccount (line 3) | type ExplorerLinkAccount = {
type ExplorerLinkTransaction (line 6) | type ExplorerLinkTransaction = {
type ExplorerLinkBlock (line 9) | type ExplorerLinkBlock = {
type GetExplorerLinkArgs (line 16) | type GetExplorerLinkArgs = {
FILE: packages/gill/src/types/index.ts
type Simplify (line 5) | type Simplify<T> = {
FILE: packages/gill/src/types/rpc.ts
type SolanaClusterMoniker (line 18) | type SolanaClusterMoniker = "devnet" | "localnet" | "mainnet" | "testnet";
type LocalnetUrl (line 20) | type LocalnetUrl = string & { "~cluster": "localnet" };
type GenericUrl (line 22) | type GenericUrl = string & {};
type ModifiedClusterUrl (line 24) | type ModifiedClusterUrl = DevnetUrl | GenericUrl | LocalnetUrl | Mainnet...
type SolanaClientUrlOrMoniker (line 26) | type SolanaClientUrlOrMoniker = ModifiedClusterUrl | SolanaClusterMonike...
type CreateSolanaClientArgs (line 28) | type CreateSolanaClientArgs<TClusterUrl extends SolanaClientUrlOrMoniker...
type SolanaClient (line 37) | type SolanaClient<TClusterUrl extends ModifiedClusterUrl | string = stri...
FILE: packages/gill/src/types/transactions.ts
type CreateTransactionInput (line 14) | type CreateTransactionInput<
type FullTransaction (line 43) | type FullTransaction<
FILE: packages/react/src/const.ts
constant GILL_NAME (line 4) | const GILL_NAME = "gill";
constant GILL_HOOK_CLIENT_KEY (line 6) | const GILL_HOOK_CLIENT_KEY = "gill-client";
FILE: packages/react/src/hooks/account.ts
type RpcConfig (line 11) | type RpcConfig = Simplify<Omit<FetchAccountConfig, "abortSignal">>;
type UseAccountResponse (line 13) | type UseAccountResponse<TAddress extends string = string, TData extends ...
type UseAccountInput (line 20) | type UseAccountInput<
function useAccount (line 39) | function useAccount<
FILE: packages/react/src/hooks/balance.ts
type RpcConfig (line 9) | type RpcConfig = Simplify<Parameters<GetBalanceApi["getBalance"]>>[1];
type UseBalanceResponse (line 11) | type UseBalanceResponse = ReturnType<GetBalanceApi["getBalance"]>["value"];
type UseBalanceInput (line 13) | type UseBalanceInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpc...
function useBalance (line 24) | function useBalance<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/client.ts
function useSolanaClient (line 9) | function useSolanaClient(): SolanaClient {
function useUpdateSolanaClient (line 25) | function useUpdateSolanaClient() {
FILE: packages/react/src/hooks/latest-blockhash.ts
type RpcConfig (line 10) | type RpcConfig = Simplify<Parameters<GetLatestBlockhashApi["getLatestBlo...
type UseLatestBlockhashResponse (line 12) | type UseLatestBlockhashResponse = ReturnType<GetLatestBlockhashApi["getL...
type UseLatestBlockhashInput (line 14) | type UseLatestBlockhashInput<TConfig extends RpcConfig = RpcConfig> = Gi...
function useLatestBlockhash (line 22) | function useLatestBlockhash<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/multiple-accounts.ts
type RpcConfig (line 11) | type RpcConfig = Simplify<Omit<FetchAccountsConfig, "abortSignal">>;
type UseMultipleAccountsInput (line 13) | type UseMultipleAccountsInput<
type UseMultipleAccountsResponse (line 28) | type UseMultipleAccountsResponse<TAddress extends string = string, TDeco...
function useMultipleAccounts (line 38) | function useMultipleAccounts<
FILE: packages/react/src/hooks/program-accounts.ts
type Encoding (line 20) | type Encoding = "base64" | "base64+zstd" | "jsonParsed";
type RpcConfig (line 22) | type RpcConfig = Simplify<
type UseProgramAccountsInput (line 29) | type UseProgramAccountsInput<TConfig extends RpcConfig = RpcConfig> = Gi...
type UseProgramAccountsResponse (line 37) | type UseProgramAccountsResponse<TConfig extends RpcConfig> = TConfig ext...
function useProgramAccounts (line 59) | function useProgramAccounts<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/recent-prioritization-fees.ts
type UseRecentPrioritizationFeesInput (line 10) | type UseRecentPrioritizationFeesInput = Simplify<
type UseRecentPrioritizationFeesResponse (line 16) | type UseRecentPrioritizationFeesResponse = ReturnType<GetRecentPrioritiz...
function useRecentPrioritizationFees (line 22) | function useRecentPrioritizationFees({
FILE: packages/react/src/hooks/signature-statuses.ts
type RpcConfig (line 10) | type RpcConfig = Simplify<Parameters<GetSignatureStatusesApi["getSignatu...
type UseSignatureStatusesInput (line 12) | type UseSignatureStatusesInput<TConfig extends RpcConfig = RpcConfig> = ...
type UseSignatureStatusesResponse (line 20) | type UseSignatureStatusesResponse = ReturnType<GetSignatureStatusesApi["...
function useSignatureStatuses (line 26) | function useSignatureStatuses<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/signatures-for-address.ts
type RpcConfig (line 10) | type RpcConfig = Simplify<Parameters<GetSignaturesForAddressApi["getSign...
type UseSignaturesForAddressInput (line 12) | type UseSignaturesForAddressInput<TConfig extends RpcConfig = RpcConfig>...
type UseSignaturesForAddressResponse (line 19) | type UseSignaturesForAddressResponse = ReturnType<GetSignaturesForAddres...
function useSignaturesForAddress (line 27) | function useSignaturesForAddress<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/simulate-transaction.ts
type RpcConfig (line 8) | type RpcConfig = Simplify<Parameters<SimulateTransactionApi["simulateTra...
constant DEFAULT_CONFIG (line 10) | const DEFAULT_CONFIG: RpcConfig = {
type UseSimulateTransactionInput (line 17) | type UseSimulateTransactionInput<TConfig extends RpcConfig = RpcConfig> ...
type UseSimulateTransactionResponse (line 25) | type UseSimulateTransactionResponse = ReturnType<SimulateTransactionApi[...
function useSimulateTransaction (line 31) | function useSimulateTransaction<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/slot.ts
type RpcConfig (line 10) | type RpcConfig = Simplify<Parameters<GetSlotApi["getSlot"]>>[0];
type UseSlotResponse (line 12) | type UseSlotResponse = ReturnType<GetSlotApi["getSlot"]>;
type UseSlotInput (line 14) | type UseSlotInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHoo...
function useSlot (line 22) | function useSlot<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/token-account-balance.ts
type RpcConfig (line 9) | type RpcConfig = Simplify<Parameters<GetTokenAccountBalanceApi["getToken...
type UseTokenAccountBalanceInput (line 11) | type UseTokenAccountBalanceInput<TConfig extends RpcConfig = RpcConfig> ...
type UseTokenAccountBalanceResponse (line 15) | type UseTokenAccountBalanceResponse = ReturnType<GetTokenAccountBalanceA...
function useTokenAccountBalance (line 17) | function useTokenAccountBalance<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/token-account.ts
type RpcConfig (line 18) | type RpcConfig = Simplify<Omit<FetchAccountConfig, "abortSignal">>;
type UseTokenAccountResponse (line 20) | type UseTokenAccountResponse<TAddress extends Address = Address> = Simpl...
type TokenAccountInputWithDeclaredAta (line 26) | type TokenAccountInputWithDeclaredAta<TAddress extends Address = Address...
type TokenAccountInputWithDerivedAtaDetails (line 33) | type TokenAccountInputWithDerivedAtaDetails = {
type UseTokenAccountInput (line 51) | type UseTokenAccountInput<
function hasDeclaredAta (line 56) | function hasDeclaredAta(
function useTokenAccount (line 66) | function useTokenAccount<TConfig extends RpcConfig = RpcConfig, TAddress...
FILE: packages/react/src/hooks/token-mint.ts
type RpcConfig (line 12) | type RpcConfig = Simplify<Omit<FetchAccountConfig, "abortSignal">>;
type UseTokenMintResponse (line 14) | type UseTokenMintResponse<TAddress extends string = string> = Simplify<
type UseTokenMintInput (line 20) | type UseTokenMintInput<
function useTokenMint (line 33) | function useTokenMint<TConfig extends RpcConfig = RpcConfig, TAddress ex...
FILE: packages/react/src/hooks/transaction.ts
type RpcConfig (line 10) | type RpcConfig = Simplify<Parameters<GetTransactionApi["getTransaction"]...
type UseTransactionResponse (line 12) | type UseTransactionResponse = ReturnType<GetTransactionApi["getTransacti...
type UseTransactionInput (line 14) | type UseTransactionInput<TConfig extends RpcConfig = RpcConfig> = GillUs...
function useTransaction (line 29) | function useTransaction<TConfig extends RpcConfig = RpcConfig>({
FILE: packages/react/src/hooks/types.ts
type OmittedUseQueryFields (line 4) | type OmittedUseQueryFields = "queryKey" | "queryFn";
type GillUseQueryDefaultOptions (line 6) | type GillUseQueryDefaultOptions = Omit<Parameters<typeof useQuery>[0], O...
type GillUseRpcHook (line 8) | type GillUseRpcHook<TConfig, TOptions extends GillUseQueryDefaultOptions...
FILE: packages/react/src/index.ts
type BigInt (line 2) | interface BigInt {
FILE: packages/react/src/providers.tsx
function SolanaProvider (line 11) | function SolanaProvider({
FILE: packages/solana-pay/src/__tests__/fetchers.ts
function mockFetch (line 9) | function mockFetch(response: any, ok = true, status = 200, statusText = ...
function restoreFetch (line 19) | function restoreFetch() {
FILE: packages/solana-pay/src/__typetests__/response.ts
type _GetWireKeys (line 12) | type _GetWireKeys = keyof SolanaPayTransactionRequestGetResponse;
type _GetParsedKeys (line 13) | type _GetParsedKeys = keyof SolanaPayTransactionRequestGetResponseParsed;
type _PostWireKeys (line 20) | type _PostWireKeys = keyof SolanaPayTransactionRequestPostResponse;
type _PostParsedKeys (line 21) | type _PostParsedKeys = keyof SolanaPayTransactionRequestPostResponseParsed;
FILE: packages/solana-pay/src/constants.ts
constant SOLANA_PAY_PROTOCOL (line 2) | const SOLANA_PAY_PROTOCOL = "solana:";
FILE: packages/solana-pay/src/encode-url.ts
type SolanaPayTransactionRequestURLFields (line 7) | interface SolanaPayTransactionRequestURLFields {
type SolanaPayTransferRequestURLFields (line 19) | interface SolanaPayTransferRequestURLFields {
function encodeSolanaPayURL (line 41) | function encodeSolanaPayURL(
function encodeTransactionRequestURL (line 47) | function encodeTransactionRequestURL({ link, label, message }: SolanaPay...
function encodeTransferRequestURL (line 69) | function encodeTransferRequestURL({
FILE: packages/solana-pay/src/fetchers.ts
function fetchSolanaPayRequest (line 24) | async function fetchSolanaPayRequest<TResponse = unknown>(
function fetchSolanaPayGetRequest (line 99) | async function fetchSolanaPayGetRequest(
function fetchSolanaPayPostRequest (line 132) | async function fetchSolanaPayPostRequest(
FILE: packages/solana-pay/src/parse-url.ts
type SolanaPayTransactionRequestURL (line 8) | interface SolanaPayTransactionRequestURL {
type SolanaPayTransferRequestURL (line 20) | interface SolanaPayTransferRequestURL {
class SolanaPayParseURLError (line 40) | class SolanaPayParseURLError extends Error {
function parseSolanaPayURL (line 51) | function parseSolanaPayURL(url: string | URL): SolanaPayTransactionReque...
function parseTransactionRequestURL (line 63) | function parseTransactionRequestURL({ pathname, searchParams }: URL): So...
function parseTransferRequestURL (line 77) | function parseTransferRequestURL({ pathname, searchParams }: URL): Solan...
FILE: packages/solana-pay/src/request.ts
type SolanaPayTransactionRequestGetRequest (line 3) | interface SolanaPayTransactionRequestGetRequest {
type SolanaPayTransactionRequestPostRequest (line 7) | interface SolanaPayTransactionRequestPostRequest {
function validateSolanaPayRequestUrl (line 11) | function validateSolanaPayRequestUrl(url: URL): void {
FILE: packages/solana-pay/src/response.ts
class SolanaPayResponseError (line 3) | class SolanaPayResponseError extends Error {
type SolanaPayTransactionRequestGetResponse (line 7) | interface SolanaPayTransactionRequestGetResponse {
type SolanaPayTransactionRequestPostResponse (line 12) | interface SolanaPayTransactionRequestPostResponse {
type SolanaPayTransactionRequestGetResponseParsed (line 17) | interface SolanaPayTransactionRequestGetResponseParsed {
type SolanaPayTransactionRequestPostResponseParsed (line 22) | interface SolanaPayTransactionRequestPostResponseParsed {
function parseSolanaPayGetResponse (line 32) | function parseSolanaPayGetResponse(data: any): SolanaPayTransactionReque...
function parseSolanaPayPostResponse (line 71) | function parseSolanaPayPostResponse(data: any): SolanaPayTransactionRequ...
FILE: packages/test-config/browser-environment.ts
class BrowserEnvironment (line 3) | class BrowserEnvironment extends TestEnvironment {
method setup (line 4) | async setup() {
FILE: typedoc.plugin.mjs
function load (line 12) | function load(app) {
function insertAfterFrontmatter (line 57) | function insertAfterFrontmatter(markdownText, textToInsert) {
Condensed preview — 416 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,153K chars).
[
{
"path": ".bundlemonrc.json",
"chars": 272,
"preview": "{\n \"baseDir\": \"./packages\",\n \"files\": [\n {\n \"friendlyName\": \"gill production bundle\",\n \"path\": \"gill/dist"
},
{
"path": ".changeset/README.md",
"chars": 510,
"preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
},
{
"path": ".changeset/config.json",
"chars": 501,
"preview": "{\n \"$schema\": \"https://unpkg.com/@changesets/config@3.0.4/schema.json\",\n \"access\": \"public\",\n \"baseBranch\": \"master\","
},
{
"path": ".changeset/gold-chicken-rhyme.md",
"chars": 124,
"preview": "---\n\"@gillsdk/solana-pay\": minor\n---\n\nmade explicit types for parsed and non parsed solana pay transaction request respo"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 1881,
"preview": "---\nname: Bug report\nabout: If you've already confirmed something is broken within the gill sdk itself, create a bug rep"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 28,
"preview": "blank_issues_enabled: false\n"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 1626,
"preview": "---\nname: Feature Request\nabout: Suggest an idea for the gill sdk\ntitle: \"[FEATURE] \"\nlabels: \"enhancement\"\nassignees: \""
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 48,
"preview": "### Problem\n\n\n\n### Summary of Changes\n\n\n\nFixes #"
},
{
"path": ".github/workflows/actions/install-dependencies/action.yml",
"chars": 518,
"preview": "name: Install Dependencies\ndescription: Sets up Node and its package manager, then installs all dependencies\n\ninputs:\n "
},
{
"path": ".github/workflows/bundlesize.yml",
"chars": 555,
"preview": "name: Compare bundle size\n\non:\n push:\n branches: [master]\n paths-ignore:\n - 'docs/**'\n pull_request:\n ty"
},
{
"path": ".github/workflows/preview-docs.yml",
"chars": 2604,
"preview": "name: Preview Documentation\n\non:\n pull_request:\n paths:\n - \"docs/**\"\n\npermissions:\n contents: read\n\nenv:\n # A"
},
{
"path": ".github/workflows/publish-canary-releases.yml",
"chars": 2354,
"preview": "name: Publish Canary Releases\n\non:\n workflow_dispatch:\n branches:\n - master\n pull_request:\n types: [opened,"
},
{
"path": ".github/workflows/publish-docs.yml",
"chars": 1583,
"preview": "name: Publish Documentation\n\non:\n workflow_dispatch:\n branches:\n - master\n push:\n branches:\n - master\n"
},
{
"path": ".github/workflows/publish-packages.yml",
"chars": 2250,
"preview": "name: Version & Publish Packages\n\non:\n workflow_dispatch:\n branches:\n - master\n paths-ignore:\n - 'docs/"
},
{
"path": ".github/workflows/pull-requests.yml",
"chars": 1204,
"preview": "name: Pull requests\n\non:\n pull_request:\n paths-ignore:\n - \"docs/**\"\n\nenv:\n # Among other things, opts out of T"
},
{
"path": ".gitignore",
"chars": 441,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n.pnp\n"
},
{
"path": ".prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": ".prettierrc",
"chars": 205,
"preview": "{\n \"tabWidth\": 2,\n \"useTabs\": false,\n \"singleQuote\": false,\n \"bracketSpacing\": true,\n \"semi\": true,\n \"trailingComm"
},
{
"path": ".vscode/settings.json",
"chars": 1405,
"preview": "{\n \"eslint.workingDirectories\": [\n {\n \"mode\": \"auto\"\n }\n ],\n \"editor.formatOnSave\": true,\n \"editor.codeAc"
},
{
"path": "CONTRIBUTING.md",
"chars": 2409,
"preview": "# Contributing\n\n## Bug fixes\n\nIf you've found a bug in gill that you'd like to fix, please [open an issue](https://githu"
},
{
"path": "LICENSE",
"chars": 1060,
"preview": "Copyright (c) 2023 Solana Foundation\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of th"
},
{
"path": "MAINTAINERS.md",
"chars": 6659,
"preview": "# Maintainers\n\nIn this document, you can find various pieces of information about the gill sdk and its associated packag"
},
{
"path": "README.md",
"chars": 4715,
"preview": "<h1 align=\"center\">\n gill sdk\n</h1>\n\n<p align=\"center\">\n javascript/typescript client library for interacting with the"
},
{
"path": "docs/.eslintrc.json",
"chars": 118,
"preview": "{\n \"extends\": [\"next/core-web-vitals\", \"next/typescript\"],\n \"rules\": {\n \"@next/next/no-img-element\": \"off\"\n }\n}\n"
},
{
"path": "docs/.gitignore",
"chars": 379,
"preview": "# deps\n/node_modules\n\n# generated content\n.contentlayer\n.content-collections\n.source\n\n# api content\n.docs\ncontent/api/\n!"
},
{
"path": "docs/.npmrc",
"chars": 31,
"preview": "enable-pre-post-scripts = true\n"
},
{
"path": "docs/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "docs/.prettierrc",
"chars": 205,
"preview": "{\n \"tabWidth\": 2,\n \"useTabs\": false,\n \"singleQuote\": false,\n \"bracketSpacing\": true,\n \"semi\": true,\n \"trailingComm"
},
{
"path": "docs/README.md",
"chars": 1141,
"preview": "# gill documentation\n\nDocumentation website for gill, built with [Fumadocs](https://github.com/fuma-nama/fumadocs).\n\n## "
},
{
"path": "docs/build-api-docs.sh",
"chars": 86,
"preview": "#!/usr/bin/env bash\nset -euo pipefail\n\ncd ..\npnpm compile:docs --output-logs=hash-only"
},
{
"path": "docs/content/api/index.mdx",
"chars": 1218,
"preview": "---\ntitle: API Reference\ndescription:\n \"Explore the functions, variables, types, and more that are included within the "
},
{
"path": "docs/content/api/meta.json",
"chars": 77,
"preview": "{\n \"title\": \"API Reference\",\n \"root\": true,\n \"pages\": [\"!index\", \"...\"]\n}\n"
},
{
"path": "docs/content/docs/compare/kit.mdx",
"chars": 6959,
"preview": "---\ntitle: gill vs @solana/kit\ndescription:\n \"Explore a side-by-side comparison of gill and @solana/kit (formerly known"
},
{
"path": "docs/content/docs/compare/meta.json",
"chars": 66,
"preview": "{\n \"title\": \"Comparisons\",\n \"pages\": [\"kit\", \"web3js\", \"...\"]\n}\n"
},
{
"path": "docs/content/docs/debug-mode.mdx",
"chars": 3024,
"preview": "---\ntitle: Debug Mode\ndescription:\n \"Understand how to use gill's debug mode to more easily debug your Solana applicati"
},
{
"path": "docs/content/docs/examples.mdx",
"chars": 3802,
"preview": "---\ntitle: Examples\ndescription:\n Collection of example scripts and code snippets on how to use gill, the Solana JavaSc"
},
{
"path": "docs/content/docs/getting-started/client.mdx",
"chars": 7907,
"preview": "---\ntitle: Create a Solana client\ndescription: Create a client connection to the Solana blockchain to perform Solana RPC"
},
{
"path": "docs/content/docs/getting-started/meta.json",
"chars": 97,
"preview": "{\n \"title\": \"Getting Started\",\n \"defaultOpen\": true,\n \"pages\": [\"client\", \"signers\", \"...\"]\n}\n"
},
{
"path": "docs/content/docs/getting-started/signers.mdx",
"chars": 3419,
"preview": "---\ntitle: Generate a signer\ndescription: Create a new keypair signer that can perform Solana signing operations.\n---\n\nF"
},
{
"path": "docs/content/docs/guides/codama.mdx",
"chars": 8157,
"preview": "---\ntitle: Generate Solana program clients with Codama\ndescription:\n \"Step-by-step guide on how to use Codama to genera"
},
{
"path": "docs/content/docs/guides/index.mdx",
"chars": 2775,
"preview": "---\ntitle: Guides\ndescription: \"Collection of helpful task-based references and code snippets for Solana developers.\"\n--"
},
{
"path": "docs/content/docs/guides/loading-and-saving-keypairs.mdx",
"chars": 12884,
"preview": "---\ntitle: Loading and Saving Keypairs\ndescription:\n Guide on loading and saving keypairs from files and environment va"
},
{
"path": "docs/content/docs/guides/meta.json",
"chars": 54,
"preview": "{\n \"title\": \"Guides\",\n \"pages\": [\"tokens\", \"...\"]\n}\n"
},
{
"path": "docs/content/docs/guides/reference-keys.mdx",
"chars": 7884,
"preview": "---\ntitle: Reference Keys\ndescription: \"Guide on how to insert reference keys into Solana transactions.\"\n---\n\nOn Solana,"
},
{
"path": "docs/content/docs/guides/solana-pay.mdx",
"chars": 12144,
"preview": "---\ntitle: Solana Pay\ndescription: \"Guide on how to utilize the Solana Pay protocol using the gill sdk.\"\n---\n\nSolana Pay"
},
{
"path": "docs/content/docs/guides/tokens/burn-tokens.mdx",
"chars": 5724,
"preview": "---\ntitle: Burn Tokens\ndescription: Learn how to burn tokens from a wallet using the gill JavaScript library.\n---\n\nBurni"
},
{
"path": "docs/content/docs/guides/tokens/create-token.mdx",
"chars": 5991,
"preview": "---\ntitle: Create a Token with Metadata\ndescription:\n Learn how to create a new Solana token, with metadata, using the "
},
{
"path": "docs/content/docs/guides/tokens/get-token-metadata.mdx",
"chars": 5971,
"preview": "---\ntitle: Get Token Metadata\ndescription:\n Learn how to read and parse token metadata from the Solana blockchain using"
},
{
"path": "docs/content/docs/guides/tokens/index.mdx",
"chars": 1939,
"preview": "---\ntitle: Tokens on Solana\ndescription: \"Learn the basics of creating and working with Solana tokens.\"\n---\n\nTokens are "
},
{
"path": "docs/content/docs/guides/tokens/meta.json",
"chars": 120,
"preview": "{\n \"root\": false,\n \"pages\": [\"create-token\", \"mint-tokens\", \"get-token-metadata\", \"transfer-tokens\", \"burn-tokens\"]\n}\n"
},
{
"path": "docs/content/docs/guides/tokens/mint-tokens.mdx",
"chars": 6705,
"preview": "---\ntitle: Mint Tokens\ndescription: Learn how to mint new token supply to a wallet using the gill JavaScript library.\n--"
},
{
"path": "docs/content/docs/guides/tokens/transfer-tokens.mdx",
"chars": 6678,
"preview": "---\ntitle: Transfer Tokens\ndescription: Learn how to transfer tokens between wallets using the gill JavaScript library.\n"
},
{
"path": "docs/content/docs/index.mdx",
"chars": 8579,
"preview": "---\ntitle: Installation\ndescription: Get started with gill, the new JavaScript client for Solana developers.\n---\n\nGill i"
},
{
"path": "docs/content/docs/meta.json",
"chars": 368,
"preview": "{\n \"title\": \"Documentation\",\n \"defaultOpen\": true,\n \"root\": true,\n \"pages\": [\n \"---Introduction---\",\n \"index\","
},
{
"path": "docs/content/docs/react/examples.mdx",
"chars": 8165,
"preview": "---\ntitle: Examples\ndescription: Real-world examples of using @gillsdk/react in your applications\n---\n\nLearn how to use "
},
{
"path": "docs/content/docs/react/getting-started.mdx",
"chars": 7430,
"preview": "---\ntitle: Getting Started with @gillsdk/react\ndescription: Learn how to set up and configure @gillsdk/react in your Rea"
},
{
"path": "docs/content/docs/react/hooks/client.mdx",
"chars": 6286,
"preview": "---\ntitle: Client Management Hooks\ndescription: Hooks for managing and accessing the Solana client connection\n---\n\nThese"
},
{
"path": "docs/content/docs/react/hooks/data-fetching.mdx",
"chars": 10786,
"preview": "---\ntitle: Data Fetching Hooks\ndescription: Hooks for fetching data from the Solana blockchain\n---\n\nThese hooks provide "
},
{
"path": "docs/content/docs/react/hooks/index.mdx",
"chars": 4486,
"preview": "---\ntitle: React Hooks Reference\ndescription: Complete reference for all available hooks in @gillsdk/react\n---\n\n`@gillsd"
},
{
"path": "docs/content/docs/react/hooks/meta.json",
"chars": 112,
"preview": "{\n \"title\": \"Hooks\",\n \"defaultOpen\": false,\n \"pages\": [\"index\", \"client\", \"data-fetching\", \"transactions\"]\n}\n"
},
{
"path": "docs/content/docs/react/hooks/transactions.mdx",
"chars": 3502,
"preview": "---\ntitle: Transaction Hooks\ndescription: Hooks for sending and managing Solana transactions\n---\n\n<Callout type=\"info\">\n"
},
{
"path": "docs/content/docs/react/index.mdx",
"chars": 3202,
"preview": "---\ntitle: React Hooks for Solana\ndescription:\n A React hooks library for easily interacting with the Solana blockchain"
},
{
"path": "docs/content/docs/react/meta.json",
"chars": 109,
"preview": "{\n \"title\": \"React\",\n \"defaultOpen\": false,\n \"pages\": [\"index\", \"getting-started\", \"hooks\", \"examples\"]\n}\n"
},
{
"path": "docs/content/docs/typescript.mdx",
"chars": 3166,
"preview": "---\ntitle: TypeScript Support\ndescription:\n The gill library is TypeScript first and heavily typed to improve your Sola"
},
{
"path": "docs/generic.d.ts",
"chars": 855,
"preview": "type Option<T> = Some<T> | None;\n\ntype Entries<T> = {\n [K in keyof T]: [K, T[K]];\n}[keyof T][];\n\ntype SearchParams<TKey"
},
{
"path": "docs/next.config.mjs",
"chars": 324,
"preview": "import { createMDX } from 'fumadocs-mdx/next';\n\nconst withMDX = createMDX();\n\n/** @type {import('next').NextConfig} */\nc"
},
{
"path": "docs/package.json",
"chars": 1591,
"preview": "{\n \"name\": \"@gillsdk/docs\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"scripts\": {\n \"update:gill\": \"pnpm add --igno"
},
{
"path": "docs/postcss.config.mjs",
"chars": 78,
"preview": "export default {\n plugins: {\n '@tailwindcss/postcss': {},\n },\n};\n"
},
{
"path": "docs/public/site.webmanifest",
"chars": 263,
"preview": "{\"name\":\"\",\"short_name\":\"\",\"icons\":[{\"src\":\"/android-chrome-192x192.png\",\"sizes\":\"192x192\",\"type\":\"image/png\"},{\"src\":\"/"
},
{
"path": "docs/source.config.ts",
"chars": 1009,
"preview": "import { rehypeCodeDefaultOptions } from \"fumadocs-core/mdx-plugins\";\nimport { remarkInstall } from \"fumadocs-docgen\";\ni"
},
{
"path": "docs/src/app/(home)/layout.tsx",
"chars": 284,
"preview": "import type { ReactNode } from \"react\";\nimport { HomeLayout } from \"fumadocs-ui/layouts/home\";\nimport { baseOptions } fr"
},
{
"path": "docs/src/app/(home)/page.tsx",
"chars": 2073,
"preview": "import { FooterLinks } from \"@/components/footer-links\";\nimport { PackageBadges } from \"@/components/package-badges\";\nim"
},
{
"path": "docs/src/app/api/[[...slug]]/page.tsx",
"chars": 2451,
"preview": "import { getPageTreePeers } from \"fumadocs-core/server\";\nimport { Popup, PopupContent, PopupTrigger } from \"fumadocs-two"
},
{
"path": "docs/src/app/api/layout.tsx",
"chars": 635,
"preview": "import { DocsLayout } from \"fumadocs-ui/layouts/docs\";\nimport type { ReactNode } from \"react\";\nimport { baseOptions } fr"
},
{
"path": "docs/src/app/api/search/route.ts",
"chars": 161,
"preview": "import { docsSource } from \"@/lib/source\";\nimport { createFromSource } from \"fumadocs-core/search/server\";\n\nexport const"
},
{
"path": "docs/src/app/docs/[[...slug]]/page.tsx",
"chars": 2652,
"preview": "import { docsSource } from \"@/lib/source\";\nimport { Spread } from \"@/lib/Spread\";\nimport { getPageTreePeers } from \"fuma"
},
{
"path": "docs/src/app/docs/layout.tsx",
"chars": 376,
"preview": "import { DocsLayout } from \"fumadocs-ui/layouts/docs\";\nimport type { ReactNode } from \"react\";\nimport { baseOptions } fr"
},
{
"path": "docs/src/app/docs/og/[...slug]/og.tsx",
"chars": 3842,
"preview": "import { ImageResponse } from \"next/og\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { ImageRespon"
},
{
"path": "docs/src/app/docs/og/[...slug]/route.tsx",
"chars": 1062,
"preview": "import { readFileSync } from \"node:fs\";\nimport { generateOGImage } from \"./og\";\nimport { docsSource } from \"@/lib/source"
},
{
"path": "docs/src/app/global.css",
"chars": 654,
"preview": "@import \"tailwindcss\";\n\n/* Fumadocs imports. */\n@import \"fumadocs-ui/css/neutral.css\";\n@import \"fumadocs-ui/css/preset.c"
},
{
"path": "docs/src/app/layout.config.tsx",
"chars": 1078,
"preview": "import type { BaseLayoutProps } from \"fumadocs-ui/layouts/shared\";\nimport { BookTextIcon, CodeXmlIcon, ShapesIcon } from"
},
{
"path": "docs/src/app/layout.tsx",
"chars": 1027,
"preview": "import { siteConfig } from \"@/const\";\nimport { RootProvider } from \"fumadocs-ui/provider\";\nimport type { Metadata } from"
},
{
"path": "docs/src/app/not-found.tsx",
"chars": 831,
"preview": "import { FooterLinks } from \"@/components/footer-links\";\nimport { Metadata } from \"next\";\nimport Link from \"next/link\";\n"
},
{
"path": "docs/src/app/styles/brand.css",
"chars": 129,
"preview": "@theme {\n /* Colors */\n --color-primary-50: #fff7f1;\n\n /* Containers */\n --container-5xs: 12rem;\n --container-4xs: "
},
{
"path": "docs/src/app/styles/fumadocs-overrides.css",
"chars": 1452,
"preview": "/* Colours. */\n\n/* @theme {\n --color-fd-background: #fff7f1;\n --color-fd-border: #6d5d6e;\n\n --color-fd-background: hs"
},
{
"path": "docs/src/app/styles/typography.css",
"chars": 405,
"preview": "#nd-page .prose {\n font-size: 1.05rem;\n}\n\n/* .prose :where(h2):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *,"
},
{
"path": "docs/src/components/fathom-analytics.tsx",
"chars": 962,
"preview": "\"use client\";\nimport { useEffect, Suspense } from \"react\";\nimport { load, trackPageview } from \"fathom-client\";\nimport {"
},
{
"path": "docs/src/components/footer-links.tsx",
"chars": 954,
"preview": "import { BookTextIcon, CodeXmlIcon, MoveRightIcon, ShapesIcon } from \"lucide-react\";\nimport Link from \"next/link\";\n\nexpo"
},
{
"path": "docs/src/components/package-badges.tsx",
"chars": 1195,
"preview": "import { cn } from \"fumadocs-ui/utils/cn\";\n\ninterface ComponentProps extends React.HTMLAttributes<HTMLDivElement> {\n pa"
},
{
"path": "docs/src/const.ts",
"chars": 442,
"preview": "export const siteConfig: SiteConfig = {\n name: \"gill\",\n domain: \"gillsdk.com\",\n description:\n \"gill is a modern ja"
},
{
"path": "docs/src/lib/Spread.tsx",
"chars": 265,
"preview": "import type { ReactNode } from \"react\";\n\nexport function Spread({ children }: { children: ReactNode }) {\n return (\n "
},
{
"path": "docs/src/lib/source.ts",
"chars": 273,
"preview": "import { api, docs } from \"@/.source\";\nimport { loader } from \"fumadocs-core/source\";\n\nexport const docsSource = loader("
},
{
"path": "docs/tsconfig.json",
"chars": 734,
"preview": "{\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"target\": \"ESNext\",\n \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n \""
},
{
"path": "docs/typedoc-data.mjs",
"chars": 1341,
"preview": "// @ts-check\n\n/**\n * Declare data and information to be injected into the\n * TypeDoc generated API reference's index fil"
},
{
"path": "docs/vercel.json",
"chars": 88,
"preview": "{\n \"github\": {\n \"silent\": true\n },\n \"git\": {\n \"deploymentEnabled\": false\n }\n}\n"
},
{
"path": "e2e/imports/.gitignore",
"chars": 500,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.ca"
},
{
"path": "e2e/imports/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "e2e/imports/.prettierrc",
"chars": 204,
"preview": "{\n \"tabWidth\": 2,\n \"useTabs\": false,\n \"singleQuote\": false,\n \"bracketSpacing\": true,\n \"semi\": true,\n \"trailingComm"
},
{
"path": "e2e/imports/package.json",
"chars": 706,
"preview": "{\n \"name\": \"@gillsdk/tests-e2e\",\n \"license\": \"MIT\",\n \"private\": true,\n \"type\": \"module\",\n \"version\": \"0.1.0\",\n \"sc"
},
{
"path": "e2e/imports/src/imports.js",
"chars": 1881,
"preview": "/**\n * Import and log one of each type of symbol from the reexported or generated program clients\n */\n\n/**\n * SPL System"
},
{
"path": "e2e/imports/src/imports.ts",
"chars": 3462,
"preview": "/**\n * Import and log one of each type of symbol from the reexported or generated program clients\n */\n\n/**\n * SPL System"
},
{
"path": "e2e/imports/tsconfig.json",
"chars": 201,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es2022\",\n \"module\": \"NodeNext\",\n \"esModuleInterop\": true,\n \"forceConsis"
},
{
"path": "examples/get-started/.gitignore",
"chars": 500,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.ca"
},
{
"path": "examples/get-started/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "examples/get-started/.prettierrc",
"chars": 204,
"preview": "{\n \"tabWidth\": 2,\n \"useTabs\": false,\n \"singleQuote\": false,\n \"bracketSpacing\": true,\n \"semi\": true,\n \"trailingComm"
},
{
"path": "examples/get-started/README.md",
"chars": 4449,
"preview": "# gill examples\n\nGill is aimed at abstracting away many of the complexities and boilerplate\nrequired to perform common i"
},
{
"path": "examples/get-started/package.json",
"chars": 958,
"preview": "{\n \"name\": \"@gillsdk/examples-basics\",\n \"license\": \"MIT\",\n \"private\": true,\n \"version\": \"0.1.0\",\n \"type\": \"module\","
},
{
"path": "examples/get-started/src/airdrop.ts",
"chars": 1414,
"preview": "import {\n address,\n airdropFactory,\n createSolanaClient,\n lamports,\n SolanaClusterMoniker,\n} from \"gill\";\n\n/**\n * D"
},
{
"path": "examples/get-started/src/basic-compare.ts",
"chars": 2629,
"preview": "/**\n * The purpose of this script is to compare some of the differences\n * of using `gill` as a single entrypoint vs `@s"
},
{
"path": "examples/get-started/src/basic.ts",
"chars": 1454,
"preview": "/**\n * The purpose of this script is to compare some of the differences\n * of using `gill` as a single entrypoint vs `@s"
},
{
"path": "examples/get-started/src/intro.ts",
"chars": 3034,
"preview": "import {\n createSolanaClient,\n createTransaction,\n getExplorerLink,\n getSignatureFromTransaction,\n signTransactionM"
},
{
"path": "examples/get-started/src/reference-keys.ts",
"chars": 2746,
"preview": "/**\n * This script demonstrates the process to add a reference key into a transaction.\n *\n * Adding reference keys to tr"
},
{
"path": "examples/get-started/src/tokens.ts",
"chars": 8672,
"preview": "import {\n address,\n createSolanaClient,\n generateKeyPairSigner,\n getExplorerLink,\n getSignatureFromTransaction,\n s"
},
{
"path": "examples/get-started/tsconfig.json",
"chars": 170,
"preview": "{\n \"$schema\": \"https://json.schemastore.org/tsconfig\",\n \"extends\": \"../../packages/tsconfig/base.json\",\n \"display\": \""
},
{
"path": "examples/tokens/.gitignore",
"chars": 500,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.ca"
},
{
"path": "examples/tokens/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "examples/tokens/.prettierrc",
"chars": 205,
"preview": "{\n \"tabWidth\": 2,\n \"useTabs\": false,\n \"singleQuote\": false,\n \"bracketSpacing\": true,\n \"semi\": true,\n \"trailingComm"
},
{
"path": "examples/tokens/README.md",
"chars": 1796,
"preview": "# gill examples - tokens\n\nGill is aimed at abstracting away many of the complexities and boilerplate required to perform"
},
{
"path": "examples/tokens/package.json",
"chars": 481,
"preview": "{\n \"name\": \"@gillsdk/examples-tokens\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"type\": \"module\",\n \"author\": \"nick"
},
{
"path": "examples/tokens/src/1.intro.ts",
"chars": 2748,
"preview": "import {\n createSolanaClient,\n createTransaction,\n getExplorerLink,\n getSignatureFromTransaction,\n signTransactionM"
},
{
"path": "examples/tokens/src/2.create-token-mint.ts",
"chars": 2500,
"preview": "import {\n createSolanaClient,\n createTransaction,\n generateKeyPairSigner,\n getExplorerLink,\n getMinimumBalanceForRe"
},
{
"path": "examples/tokens/src/3.create-token-mint-builder.ts",
"chars": 1355,
"preview": "import {\n createSolanaClient,\n generateKeyPairSigner,\n getExplorerLink,\n getSignatureFromTransaction,\n signTransact"
},
{
"path": "examples/tokens/src/4.mint-tokens.ts",
"chars": 1639,
"preview": "import {\n address,\n createSolanaClient,\n createTransaction,\n getExplorerLink,\n getSignatureFromTransaction,\n signT"
},
{
"path": "examples/tokens/src/5.mint-tokens-builder.ts",
"chars": 1124,
"preview": "import {\n address,\n createSolanaClient,\n getExplorerLink,\n getSignatureFromTransaction,\n signTransactionMessageWith"
},
{
"path": "examples/tokens/src/6.transfer-tokens.ts",
"chars": 1876,
"preview": "import {\n address,\n createSolanaClient,\n createTransaction,\n getExplorerLink,\n getSignatureFromTransaction,\n signT"
},
{
"path": "examples/tokens/src/7.transfer-tokens-builder.ts",
"chars": 1222,
"preview": "import {\n address,\n createSolanaClient,\n getExplorerLink,\n getSignatureFromTransaction,\n signTransactionMessageWith"
},
{
"path": "examples/tokens/tsconfig.json",
"chars": 170,
"preview": "{\n \"$schema\": \"https://json.schemastore.org/tsconfig\",\n \"extends\": \"../../packages/tsconfig/base.json\",\n \"display\": \""
},
{
"path": "idls/build-codama-clients.sh",
"chars": 313,
"preview": "#!/usr/bin/env bash\nset -euo pipefail\n\n# generate all the codama clients (per their respective config files)\npnpm codama"
},
{
"path": "idls/token_metadata/codama.json",
"chars": 186,
"preview": "{\n \"idl\": \"idl.json\",\n \"before\": [],\n \"scripts\": {\n \"js\": {\n \"from\": \"@codama/renderers-js\",\n \"args\": [\""
},
{
"path": "idls/token_metadata/idl.json",
"chars": 166194,
"preview": "{\n \"version\": \"1.14.0\",\n \"name\": \"token_metadata\",\n \"instructions\": [\n {\n \"name\": \"CreateMetadataAccount\",\n "
},
{
"path": "package.json",
"chars": 3264,
"preview": "{\n \"name\": \"gillsdk\",\n \"license\": \"MIT\",\n \"private\": true,\n \"workspaces\": [\n \"packages/*\"\n ],\n \"repository\": {\n"
},
{
"path": "packages/build-scripts/.npmrc",
"chars": 19,
"preview": "engine-strict=true\n"
},
{
"path": "packages/build-scripts/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "packages/build-scripts/CHANGELOG.md",
"chars": 280,
"preview": "# @gillsdk/build-scripts\n\n## 0.0.1\n\n### Patch Changes\n\n- [#53](https://github.com/gillsdk/gill/pull/53)\n [`452359c`](ht"
},
{
"path": "packages/build-scripts/README.md",
"chars": 94,
"preview": "# `build-scripts`\n\nThis is the base build script shared across all packages in this monorepo.\n"
},
{
"path": "packages/build-scripts/dev-flag.ts",
"chars": 1308,
"preview": "import { readFile } from \"fs/promises\";\nimport jscodeshift from \"jscodeshift\";\nimport type { Options } from \"tsup\";\n\ntyp"
},
{
"path": "packages/build-scripts/getBaseConfig.ts",
"chars": 2748,
"preview": "import { env } from \"node:process\";\n\nimport browsersListToEsBuild from \"browserslist-to-esbuild\";\nimport type { Format, "
},
{
"path": "packages/build-scripts/package.json",
"chars": 389,
"preview": "{\n \"name\": \"@gillsdk/build-scripts\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"license\": \"MIT\",\n \"files\": [\n \"reg"
},
{
"path": "packages/build-scripts/register-node-globals.cjs",
"chars": 124,
"preview": "globalThis.__DEV__ = false;\nglobalThis.__BROWSER = false;\nglobalThis.__NODEJS__ = true;\nglobalThis.__REACTNATIVE__ = fal"
},
{
"path": "packages/build-scripts/tsconfig.json",
"chars": 175,
"preview": "{\n \"$schema\": \"https://json.schemastore.org/tsconfig\",\n \"compilerOptions\": {\n \"types\": [\"node\"]\n },\n \"display\": \""
},
{
"path": "packages/build-scripts/tsup.config.browser.ts",
"chars": 186,
"preview": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\n\nexport default defineConfig((opt"
},
{
"path": "packages/build-scripts/tsup.config.library.ts",
"chars": 687,
"preview": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\nimport packageConfigOrConfigsOrPr"
},
{
"path": "packages/build-scripts/tsup.config.package.ts",
"chars": 292,
"preview": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\n\nexport default defineConfig((opt"
},
{
"path": "packages/config-eslint/base.mjs",
"chars": 1308,
"preview": "import solanaConfig from '@solana/eslint-config-solana';\nimport solanaJestConfig from '@solana/eslint-config-solana/jest"
},
{
"path": "packages/config-eslint/package.json",
"chars": 421,
"preview": "{\n \"name\": \"@gillsdk/config-eslint\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"license\": \"MIT\",\n \"exports\": {\n \"."
},
{
"path": "packages/gill/.gitignore",
"chars": 6,
"preview": "dist/\n"
},
{
"path": "packages/gill/.npmrc",
"chars": 19,
"preview": "engine-strict=true\n"
},
{
"path": "packages/gill/.prettierignore",
"chars": 201,
"preview": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n."
},
{
"path": "packages/gill/CHANGELOG.md",
"chars": 22837,
"preview": "# gill\n\n## 0.14.0\n\n### Minor Changes\n\n- [#334](https://github.com/gillsdk/gill/pull/334)\n [`e345aa9`](https://github.co"
},
{
"path": "packages/gill/README.md",
"chars": 29809,
"preview": "<h1 align=\"center\">\n gill\n</h1>\n\n<p align=\"center\">\n javascript/typescript client library for interacting with the Sol"
},
{
"path": "packages/gill/eslint.config.mjs",
"chars": 120,
"preview": "import config from \"@gillsdk/config-eslint/base\";\n\n/** @type {import(\"eslint\").Linter.Config} */\nexport default config;\n"
},
{
"path": "packages/gill/generate-reexports.ts",
"chars": 1530,
"preview": "#!/usr/bin/env node\nimport fs from \"fs\";\n\ntype ReexportSettings = {\n package: string;\n outputFile: string;\n};\n\nconst p"
},
{
"path": "packages/gill/package.json",
"chars": 4901,
"preview": "{\n \"name\": \"gill\",\n \"license\": \"MIT\",\n \"version\": \"0.14.0\",\n \"description\": \"a modern javascript/typescript client l"
},
{
"path": "packages/gill/src/__tests__/accounts.ts",
"chars": 1344,
"preview": "import assert from \"node:assert\";\n\nimport { getMinimumBalanceForRentExemption } from \"../core\";\n\n/**\n * Note: Each of th"
},
{
"path": "packages/gill/src/__tests__/addresses.ts",
"chars": 4121,
"preview": "import { Address } from \"@solana/kit\";\nimport { TOKEN_2022_PROGRAM_ADDRESS } from \"@solana-program/token-2022\";\nimport {"
},
{
"path": "packages/gill/src/__tests__/base64-bytes-to.ts",
"chars": 5348,
"preview": "import { Address, getBase58Encoder, getBase64Decoder, Signature } from \"@solana/kit\";\nimport { base64BytesToAddress, bas"
},
{
"path": "packages/gill/src/__tests__/base64-transactions.ts",
"chars": 2959,
"preview": "import { address, blockhash, createKeyPairSignerFromPrivateKeyBytes, type KeyPairSigner } from \"@solana/kit\";\nimport { c"
},
{
"path": "packages/gill/src/__tests__/create-codama.config.ts",
"chars": 2359,
"preview": "import { createCodamaConfig } from \"../core\";\n\ndescribe(\"createCodamaConfig\", () => {\n const idl = \"anchor/target/idl/c"
},
{
"path": "packages/gill/src/__tests__/create-solana-client.ts",
"chars": 926,
"preview": "import assert from \"node:assert\";\n\nimport { createSolanaClient } from \"../core\";\n\ndescribe(\"createSolanaClient\", () => {"
},
{
"path": "packages/gill/src/__tests__/create-token-instructions.ts",
"chars": 15554,
"preview": "import { getCreateAccountInstruction } from \"@solana-program/system\";\nimport type { Address, Instruction, KeyPairSigner "
},
{
"path": "packages/gill/src/__tests__/create-transaction.ts",
"chars": 8726,
"preview": "import assert from \"node:assert\";\n\nimport { type Address, blockhash, generateKeyPairSigner, isKeyPairSigner, type KeyPai"
},
{
"path": "packages/gill/src/__tests__/debug.ts",
"chars": 7051,
"preview": "import { debug, isDebugEnabled } from \"../core\";\n\nconst DEFAULT_PREFIX = \"[GILL]\";\n\ndescribe(\"isDebugEnabled\", () => {\n "
},
{
"path": "packages/gill/src/__tests__/explorer.ts",
"chars": 5253,
"preview": "import assert from \"node:assert\";\nimport { getSignatureFromTransaction, ReadonlyUint8Array, SignaturesMap, TransactionMe"
},
{
"path": "packages/gill/src/__tests__/get-oldest-signature.ts",
"chars": 5893,
"preview": "import { Address, isSolanaError, Signature, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN } from \"@solana/kit\";\nimport { getO"
},
{
"path": "packages/gill/src/__tests__/keypairs-base58.ts",
"chars": 3463,
"preview": "import { blockhash, createKeyPairFromBytes, createSignerFromKeyPair } from \"@solana/kit\";\nimport {\n createKeypairFromBa"
},
{
"path": "packages/gill/src/__tests__/mint-tokens-instructions.ts",
"chars": 5333,
"preview": "import {\n getCreateAssociatedTokenIdempotentInstruction,\n getMintToInstruction,\n TOKEN_2022_PROGRAM_ADDRESS,\n} from \""
},
{
"path": "packages/gill/src/__tests__/reference-keys.ts",
"chars": 8308,
"preview": "import { AccountRole, Address, BaseTransactionMessage, SolanaError } from \"@solana/kit\";\nimport { insertReferenceKeysToT"
},
{
"path": "packages/gill/src/__tests__/rpc.ts",
"chars": 1640,
"preview": "import assert from \"node:assert\";\n\nimport { getPublicSolanaRpcUrl } from \"../core\";\n\ndescribe(\"getPublicSolanaRpcUrl\", ("
},
{
"path": "packages/gill/src/__tests__/token/assert-is-mint.ts",
"chars": 2432,
"preview": "import type { Mint } from \"@solana-program/token-2022\";\nimport type { Account, Address, Lamports } from \"@solana/kit\";\ni"
},
{
"path": "packages/gill/src/__tests__/token/fetch-token-accounts.ts",
"chars": 8501,
"preview": "import type { Mint, Token } from \"@solana-program/token-2022\";\nimport { decodeToken, fetchMint } from \"@solana-program/t"
},
{
"path": "packages/gill/src/__tests__/transfer-tokens-instructions.ts",
"chars": 6124,
"preview": "import {\n getCreateAssociatedTokenIdempotentInstruction,\n getTransferInstruction,\n TOKEN_2022_PROGRAM_ADDRESS,\n} from"
},
{
"path": "packages/gill/src/__tests__/ui-amount.ts",
"chars": 5128,
"preview": "import { tokenAmountToUiAmount, tokenUiAmountToAmount } from \"../programs/token\";\n\ndescribe(\"Token Amount Conversion Fun"
},
{
"path": "packages/gill/src/__tests__/utils.ts",
"chars": 3203,
"preview": "import { GENESIS_HASH, getMonikerFromGenesisHash, lamportsToSol } from \"../core\";\n\ndescribe(\"getMonikerFromGenesisHash\","
},
{
"path": "packages/gill/src/__tests__/verify-signature.ts",
"chars": 2519,
"preview": "import { generateKeyPairSigner, getBase58Decoder, KeyPairSigner, signBytes } from \"@solana/kit\";\nimport { verifySignatur"
},
{
"path": "packages/gill/src/__typetests__/create-solana-client.ts",
"chars": 5329,
"preview": "import type {\n RequestAirdropApi,\n Rpc,\n RpcDevnet,\n RpcMainnet,\n RpcTestnet,\n SolanaRpcApi,\n SolanaRpcApiMainnet"
},
{
"path": "packages/gill/src/__typetests__/create-token-transaction.ts",
"chars": 1902,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type { BaseTransactionMessage, KeyPairSigner, Transaction"
},
{
"path": "packages/gill/src/__typetests__/create-transaction.ts",
"chars": 4587,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type {\n Address,\n BaseTransactionMessage,\n Instruction,"
},
{
"path": "packages/gill/src/__typetests__/mint-tokens-transaction.ts",
"chars": 2214,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n Address,\n KeyPairSigner,\n BaseTransactionMessa"
},
{
"path": "packages/gill/src/__typetests__/prepare-transaction.ts",
"chars": 1348,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n BaseTransactionMessage,\n TransactionMessageWith"
},
{
"path": "packages/gill/src/__typetests__/send-and-confirm-transaction-with-signers-typetests.ts",
"chars": 5980,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n GetEpochInfoApi,\n GetLatestBlockhashApi,\n GetSignatu"
},
{
"path": "packages/gill/src/__typetests__/simulate-transaction.ts",
"chars": 1516,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n FullySignedTransaction,\n Rpc,\n RpcDevnet,\n Rp"
},
{
"path": "packages/gill/src/__typetests__/transfer-tokens-transaction.ts",
"chars": 2121,
"preview": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n Address,\n BaseTransactionMessage,\n KeyPairSign"
},
{
"path": "packages/gill/src/core/base64-bytes-to.ts",
"chars": 1056,
"preview": "import type { Address, Signature } from \"@solana/kit\";\nimport { assertIsAddress, assertIsSignature, getBase58Decoder, ge"
},
{
"path": "packages/gill/src/core/base64-from-transaction.ts",
"chars": 582,
"preview": "import { getBase64Encoder, getTransactionDecoder, type Transaction } from \"@solana/kit\";\nimport type { transactionToBase"
},
{
"path": "packages/gill/src/core/base64-to-transaction.ts",
"chars": 1322,
"preview": "import type {\n Base64EncodedWireTransaction,\n TransactionMessage,\n TransactionMessageWithFeePayer,\n Transaction,\n} f"
},
{
"path": "packages/gill/src/core/const.ts",
"chars": 343,
"preview": "/** 1 billion lamports per SOL */\nexport const LAMPORTS_PER_SOL = 1_000_000_000;\n\n/**\n * Genesis hash for Solana network"
},
{
"path": "packages/gill/src/core/create-codama-config.ts",
"chars": 1472,
"preview": "/**\n * Codama dependency map to utilize gill imports\n */\nexport const GILL_EXTERNAL_MODULE_MAP: Record<string, string> ="
},
{
"path": "packages/gill/src/core/create-solana-client.ts",
"chars": 3129,
"preview": "import type { DevnetUrl, MainnetUrl, TestnetUrl } from \"@solana/kit\";\nimport { createSolanaRpc, createSolanaRpcSubscript"
},
{
"path": "packages/gill/src/core/create-transaction.ts",
"chars": 5226,
"preview": "import { getSetComputeUnitLimitInstruction, getSetComputeUnitPriceInstruction } from \"@solana-program/compute-budget\";\ni"
},
{
"path": "packages/gill/src/core/debug.ts",
"chars": 2400,
"preview": "/**\n *\n */\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst GILL_LOG_LEVELS: Record<LogLevel, number> = {\n "
},
{
"path": "packages/gill/src/core/explorer.ts",
"chars": 1016,
"preview": "import type { GetExplorerLinkArgs } from \"../types\";\n\n/**\n * Craft a Solana Explorer link on any cluster\n */\nexport func"
},
{
"path": "packages/gill/src/core/get-oldest-signature.ts",
"chars": 1632,
"preview": "import type { Simplify } from \"../types/index\";\n\nimport type { Address, GetSignaturesForAddressApi, Rpc } from \"@solana/"
},
{
"path": "packages/gill/src/core/get-signature-from-bytes.ts",
"chars": 416,
"preview": "import type { Signature, SignatureBytes } from \"@solana/kit\";\nimport { getBase58Decoder } from \"@solana/kit\";\n\n/**\n * Co"
},
{
"path": "packages/gill/src/core/index.ts",
"chars": 787,
"preview": "export { debug, isDebugEnabled } from \"./debug\";\n\nexport * from \"./base64-bytes-to\";\nexport * from \"./base64-from-transa"
},
{
"path": "packages/gill/src/core/insert-reference-key.ts",
"chars": 2169,
"preview": "import type { Address, BaseTransactionMessage } from \"@solana/kit\";\nimport { AccountRole, SOLANA_ERROR__INSTRUCTION_ERRO"
},
{
"path": "packages/gill/src/core/keypairs-base58.ts",
"chars": 630,
"preview": "import { createKeyPairFromBytes, createSignerFromKeyPair, getBase58Encoder, type KeyPairSigner } from \"@solana/kit\";\n\n/*"
},
{
"path": "packages/gill/src/core/keypairs-extractable.ts",
"chars": 3238,
"preview": "import { assertKeyExporterIsAvailable, assertKeyGenerationIsAvailable } from \"@solana/assertions\";\nimport type { KeyPair"
},
{
"path": "packages/gill/src/core/prepare-transaction.ts",
"chars": 4768,
"preview": "import { COMPUTE_BUDGET_PROGRAM_ADDRESS, getSetComputeUnitLimitInstruction } from \"@solana-program/compute-budget\";\nimpo"
},
{
"path": "packages/gill/src/core/rent.ts",
"chars": 1264,
"preview": "/**\n * Calculate the total rent needed for to create an account, with or without extra data stored in it\n */\nexport func"
},
{
"path": "packages/gill/src/core/rpc.ts",
"chars": 1021,
"preview": "import type { DevnetUrl, MainnetUrl, TestnetUrl } from \"@solana/kit\";\nimport type { LocalnetUrl, ModifiedClusterUrl, Sol"
}
]
// ... and 216 more files (download for full content)
About this extraction
This page contains the full source code of the solana-foundation/gill GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 416 files (1.0 MB), approximately 278.7k tokens, and a symbol index with 481 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.