[
  {
    "path": ".bundlemonrc.json",
    "content": "{\n  \"baseDir\": \"./packages\",\n  \"files\": [\n    {\n      \"friendlyName\": \"gill production bundle\",\n      \"path\": \"gill/dist/index.production.min.js\"\n    },\n    {\n      \"path\": \"**/dist/**/index.*.mjs\"\n    }\n  ],\n  \"includeCommitMessage\": true,\n  \"reportOutput\": [\"github\"]\n}\n"
  },
  {
    "path": ".changeset/README.md",
    "content": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works\nwith multi-package repos, or single-package repos to help you version and publish your code. You can\nfind the full documentation for it [in our repository](https://github.com/changesets/changesets)\n\nWe have a quick list of common questions to get you started engaging with this project in\n[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@3.0.4/schema.json\",\n  \"access\": \"public\",\n  \"baseBranch\": \"master\",\n  \"changelog\": [\n    \"@changesets/changelog-github\",\n    {\n      \"repo\": \"gillsdk/gill\"\n    }\n  ],\n  \"commit\": false,\n  \"ignore\": [\n    \"@gillsdk/vue\", \"@gillsdk/svelte\", \n    \"@gillsdk/tsconfig\", \"@gillsdk/build-scripts\", \"@gillsdk/test-config\"\n  ],\n  \"fixed\": [[\"@gillsdk/!({build-scripts,config-*,test-*,tsconfig})\"]],\n  \"linked\": [],\n  \"updateInternalDependencies\": \"patch\"\n}\n"
  },
  {
    "path": ".changeset/gold-chicken-rhyme.md",
    "content": "---\n\"@gillsdk/solana-pay\": minor\n---\n\nmade explicit types for parsed and non parsed solana pay transaction request response\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: If you've already confirmed something is broken within the gill sdk itself, create a bug report.\ntitle: \"[BUG] \"\nlabels: \"\"\nassignees: \"\"\n---\n\n<!-- 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. -->\n\n**Which gill sdk packages are you having issues with?**\n\nFor example: gill, @gillsdk/react\n\n**What versions of these packages are you using?**\n\nFor example: v0.11.0\n\n**What build tool (or framework if it abstracts the build tool) are you using?**\n\nFor example: Next.js 15.1.7, Vite 6.1.0\n\n**What version of NodeJS (or other server runtime) are you using?**\n\nFor example: NodeJS v20.0.0, Bun v1.2.1\n\n**What package manager (and version) are you using?**\n\nFor example: pnpm v9.1.0, npm v11.4.2\n\n**What browser are you using?**\n\nFor example: Chrome, Brave, Safari, or N/A\n\n**What operating system are you using?**\n\nFor example: Ubuntu, PopOS, Fedora, MacOS, Windows, etc\n\n**Reproduction URL**\n\nA public GitHub repo that includes a minimal reproduction of the bug. **Please do not link to your actual project**,\nwhat we need instead is a _minimal_ reproduction in a fresh project without any unnecessary code. This means it doesn't\nmatter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways.\n\nA reproduction is **required** when filing a bug report — any bug report opened without a reproduction will be closed\nand 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\nvolume of issues we receive if we need to reproduce each issue from scratch ourselves.\n\n**Describe your issue**\n\nDescribe the problem you're seeing, any important steps to reproduce and what behavior you expect instead.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature Request\nabout: Suggest an idea for the gill sdk\ntitle: \"[FEATURE] \"\nlabels: \"enhancement\"\nassignees: \"\"\n---\n\n## Summary\n\n<!-- A clear and concise description of what you want to happen. -->\n\n## Problem Statement\n\n**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem\nis.\n\n## Proposed Solution\n\n**Describe the solution you'd like** A clear and concise description of what you want to happen.\n\n## Alternatives Considered\n\n**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features\nyou've considered.\n\n## Use Cases\n\n**Who would benefit from this feature?**\n\n- [ ] End users\n- [ ] Developers\n- [ ] System administrators\n- [ ] Other: \\***\\*\\_\\_\\_\\*\\***\n\n**How would this feature be used?** Provide specific examples or user stories.\n\n## Implementation Details\n\n**Do you have any ideas on how this could be implemented?**\n\n- Technical approach suggestions\n- Dependencies or requirements\n- Breaking changes (if any)\n\n## Additional Context\n\n**Add any other context or screenshots about the feature request here.**\n\n- Screenshots\n- Mockups\n- References to similar features in other projects\n- Links to relevant documentation\n\n## Acceptance Criteria\n\n**What would need to be true for this feature to be considered complete?**\n\n- [ ] Criterion 1\n- [ ] Criterion 2\n- [ ] Criterion 3\n\n## Priority\n\n**How important is this feature to you?** Select one.\n\n- [ ] Critical - Blocking my work\n- [ ] High - Would significantly improve my workflow\n- [ ] Medium - Nice to have\n- [ ] Low - Minor improvement\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "### Problem\n\n\n\n### Summary of Changes\n\n\n\nFixes #"
  },
  {
    "path": ".github/workflows/actions/install-dependencies/action.yml",
    "content": "name: Install Dependencies\ndescription: Sets up Node and its package manager, then installs all dependencies\n\ninputs:\n  version:\n    default: 'lts/*'\n    type: string\n\nruns:\n  using: composite\n  steps:\n    - name: Install package manager\n      uses: pnpm/action-setup@v3\n      with:\n        version: 9.1.0\n\n    - name: Setup Node\n      uses: actions/setup-node@v4\n      with:\n        node-version: ${{ inputs.version }}\n        cache: 'pnpm'\n\n    - name: Install dependencies\n      shell: bash\n      run: pnpm install\n"
  },
  {
    "path": ".github/workflows/bundlesize.yml",
    "content": "name: Compare bundle size\n\non:\n  push:\n    branches: [master]\n    paths-ignore:\n      - 'docs/**'\n  pull_request:\n    types: [synchronize, opened, reopened]\n    paths-ignore:\n      - 'docs/**'\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n        with:\n          version: current\n\n      - name: Build\n        run: pnpm build\n\n      - name: BundleMon\n        uses: lironer/bundlemon-action@v1"
  },
  {
    "path": ".github/workflows/preview-docs.yml",
    "content": "name: Preview Documentation\n\non:\n  pull_request:\n    paths:\n      - \"docs/**\"\n\npermissions:\n  contents: read\n\nenv:\n  # Among other things, opts out of Turborepo telemetry\n  # See https://consoledonottrack.com/\n  DO_NOT_TRACK: \"1\"\n  NEXT_TELEMETRY_DISABLED: \"1\"\n  VERCEL_TELEMETRY_DISABLED: \"1\"\n  # Some tasks slow down considerably on GitHub Actions runners when concurrency is high\n  TURBO_CONCURRENCY: 1\n  # Enables Turborepo Remote Caching.\n  TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}\n  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n  TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n\njobs:\n  preview-docs:\n    if: github.actor != 'dependabot[bot]'\n    permissions:\n      pull-requests: write\n    runs-on: ubuntu-latest\n    name: Build Documentation Preview\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n\n      - name: Install Isolated Docs Dependencies\n        working-directory: ./docs/\n        shell: bash\n        run: pnpm install --ignore-workspace\n\n      - name: Install Vercel CLI\n        run: pnpm install -g vercel\n\n      - name: Deploy to Vercel\n        shell: bash\n        id: vercel_deploy\n        env:\n          BRANCH_NAME: ${{ github.head_ref }}\n          PR_NUMBER: ${{ github.event.pull_request.number }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n        run: |\n          vercel pull --token=\"$VERCEL_TOKEN\" --yes --environment=preview\n          vercel build --token=\"$VERCEL_TOKEN\" --target=preview\n          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)\n          DEPLOY_EXIT_CODE=$?\n          if [ $DEPLOY_EXIT_CODE -ne 0 ]; then\n            echo \"Vercel deploy failed:\"\n            echo \"$DEPLOY_OUTPUT\"\n            exit $DEPLOY_EXIT_CODE\n          fi\n          DEPLOY_URL=$(echo \"$DEPLOY_OUTPUT\" | grep -o 'https://[a-zA-Z0-9.-]*\\.vercel\\.app' | tail -1)\n          echo \"preview_url=$DEPLOY_URL\" >> $GITHUB_OUTPUT\n\n      - name: Comment on PR with Preview URL\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PR_NUMBER: ${{ github.event.pull_request.number }}\n          PREVIEW_URL: \"${{ steps.vercel_deploy.outputs.preview_url }}\"\n        run: |\n          gh pr comment $PR_NUMBER --body \"Documentation Preview: $PREVIEW_URL\" --create-if-none --edit-last\n"
  },
  {
    "path": ".github/workflows/publish-canary-releases.yml",
    "content": "name: Publish Canary Releases\n\non:\n  workflow_dispatch:\n    branches:\n      - master\n  pull_request:\n    types: [opened, synchronize, labeled]\n\npermissions:\n  contents: read\n\nenv:\n  # Among other things, opts out of Turborepo telemetry\n  # See https://consoledonottrack.com/\n  DO_NOT_TRACK: '1'\n  # Some tasks slow down considerably on GitHub Actions runners when concurrency is high\n  TURBO_CONCURRENCY: 1\n  # Enables Turborepo Remote Caching.\n  TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}\n  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n  TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n\njobs:\n  build-and-publish-snapshots-to-npm:\n    permissions:\n      pull-requests: write\n    runs-on: ubuntu-latest\n    # Only run if it's a push to master, manual dispatch, or PR with 'canary' label\n    if: |\n      github.event_name == 'push' ||\n      github.event_name == 'workflow_dispatch' ||\n      (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'canary'))\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n\n      - name: Run Build Step (force)\n        run: pnpm turbo build --force=true\n\n      - name: Configure NPM token\n        run: |\n          pnpm config set '//registry.npmjs.org/:_authToken' \"${NPM_TOKEN}\"\n        env:\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n\n      - name: Publish Canary Releases\n        run: |\n          find packages/* -maxdepth 0 -type d -print0 | \\\n            xargs -t0 -n 1 -I {} \\\n              sh -c 'cd {} && pnpm pkg delete devDependencies'\n          pnpm changeset version --snapshot canary\n          pnpm turbo publish-packages --concurrency=${TURBO_CONCURRENCY:-1}\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n          PUBLISH_TAG: canary\n\n      - name: Remove canary label from PR\n        if: github.event_name == 'pull_request'\n        uses: actions/github-script@v7\n        with:\n          script: |\n            github.rest.issues.removeLabel({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: context.issue.number,\n              name: 'canary'\n            });"
  },
  {
    "path": ".github/workflows/publish-docs.yml",
    "content": "name: Publish Documentation\n\non:\n  workflow_dispatch:\n    branches:\n      - master\n  push:\n    branches:\n      - master\n    paths:\n      - 'docs/**'\n\npermissions:\n  contents: read\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\nenv:\n  # Among other things, opts out of Turborepo telemetry\n  # See https://consoledonottrack.com/\n  DO_NOT_TRACK: '1'\n  NEXT_TELEMETRY_DISABLED: '1'\n  VERCEL_TELEMETRY_DISABLED: '1'\n  # Enables Turborepo Remote Caching.\n  TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}\n  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n  TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n\njobs:\n  deploy-docs:\n    runs-on: ubuntu-latest\n    name: Deploy Documentation\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n\n      - name: Install Isolated Docs Dependencies\n        working-directory: ./docs/\n        shell: bash\n        run: pnpm install --ignore-workspace\n\n      - name: Install Vercel CLI\n        run: pnpm install -g vercel\n\n      - name: Deploy to Vercel\n        shell: bash\n        env:\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n        run: |\n          vercel pull --token=\"$VERCEL_TOKEN\" --yes --environment=production\n          vercel build --token=\"$VERCEL_TOKEN\" --prod\n          vercel deploy --token=\"$VERCEL_TOKEN\" --archive=tgz --prebuilt --prod\n"
  },
  {
    "path": ".github/workflows/publish-packages.yml",
    "content": "name: Version & Publish Packages\n\non:\n  workflow_dispatch:\n    branches:\n      - master\n    paths-ignore:\n      - 'docs/**'\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - 'docs/**'\n\nenv:\n  # Among other things, opts out of Turborepo telemetry\n  # See https://consoledonottrack.com/\n  DO_NOT_TRACK: \"1\"\n  # Some tasks slow down considerably on GitHub Actions runners when concurrency is high\n  TURBO_CONCURRENCY: 1\n  # Enables Turborepo Remote Caching.\n  TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}\n  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n  TURBO_TEAM: ${{ secrets.TURBO_TEAM }}\n\njobs:\n  build-and-publish-to-npm:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n\n      - name: Configure NPM token\n        run: |\n          pnpm config set '//registry.npmjs.org/:_authToken' \"${NPM_TOKEN}\"\n        env:\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n\n      - name: Create Changesets Pull Request or Trigger an NPM Publish\n        id: changesets\n        uses: changesets/action@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Run Pre-Build Step\n        run: pnpm prebuild --force=true\n\n      - name: Choose Build Step\n        id: build-step-decider\n        run:\n          echo \"step-name=${{ steps.changesets.outputs.hasChangesets == 'false' && 'publish-packages\n          --concurrency=${TURBO_CONCURRENCY:-1}' || 'build' }}\" >> $GITHUB_OUTPUT\n\n      - name: Run Build Step (force)\n        run: pnpm turbo ${{ steps.build-step-decider.outputs.step-name }} --force=true\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n          PUBLISH_TAG: next\n\n      # - name: Push Git Tag\n      #   if: steps.changesets.outputs.hasChangesets == 'false'\n      #   run: |\n      #     VERSION_TAG=v$(cd packages/library/ && pnpm pkg get version | sed -n '2p' | grep -o '\"\\([^\"]\\)\\+\"$' | tr -d \\\")\n      #     if ! git ls-remote --tags | grep -q \"$VERSION_TAG\"; then git tag $VERSION_TAG && git push --tags; fi\n      #   env:\n      #     GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/pull-requests.yml",
    "content": "name: Pull requests\n\non:\n  pull_request:\n    paths-ignore:\n      - \"docs/**\"\n\nenv:\n  # Among other things, opts out of Turborepo telemetry\n  # See https://consoledonottrack.com/\n  DO_NOT_TRACK: \"1\"\n  # Some tasks slow down considerably on GitHub Actions runners when concurrency is high\n  TURBO_CONCURRENCY: 1\n\njobs:\n  # Needed for grouping check-web3 strategies into one check for mergify\n  all-pr-checks:\n    runs-on: ubuntu-latest\n    needs: build-and-test\n    steps:\n      - run: echo \"Done\"\n\n  build-and-test:\n    runs-on: ubuntu-latest\n\n    strategy:\n      matrix:\n        node:\n          # !stopping builds on current since node v25.2.0 breaks things with `localStorage`\n          # - \"current\"\n          - \"lts/*\"\n\n    name: Build & Test on Node ${{ matrix.node }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n\n      - name: Install Dependencies\n        uses: ./.github/workflows/actions/install-dependencies\n        with:\n          version: ${{ matrix.node }}\n\n      - name: Build (with prebuild)\n        run: pnpm build # Don't add --concurrency here; it's already baked in\n\n      - name: Test\n        run: pnpm test # Don't add --concurrency here; it's already baked in\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n.pnp\n.pnp.js\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n.pnpm-debug.log*\n\n# turbo\n.turbo\n\n# typedocs output\n.docs\n\n# Sapling SCM\n.sl\n\n# `solana-test-validator`\n.agave/\n.cache\ntest-ledger\n\n# coverage reports\ncoverage\n\n# GitHub Pages deploy directory\n.ghpages-deploy\n\n*.env*\n*.local*\n.vercel"
  },
  {
    "path": ".prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"proseWrap\": \"always\",\n  \"arrowParens\": \"always\",\n  \"printWidth\": 120\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"eslint.workingDirectories\": [\n    {\n      \"mode\": \"auto\"\n    }\n  ],\n  \"editor.formatOnSave\": true,\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll\": \"explicit\",\n    \"source.organizeImports\": \"explicit\",\n    \"source.sortMembers\": \"explicit\"\n  },\n  \"editor.formatOnPaste\": true,\n  \"editor.formatOnType\": false,\n  \"typescript.preferences.organizeImports\": true,\n  \"javascript.preferences.organizeImports\": true,\n  \"typescript.preferences.importModuleSpecifierEnding\": \"js\",\n\n  // Set Prettier as the default formatter\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n\n  // Language-specific formatters (optional overrides)\n  \"[javascript]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[typescript]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[javascriptreact]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[typescriptreact]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[json]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[html]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[css]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[scss]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[markdown]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n\n  // Ensure consistent line endings\n  \"files.eol\": \"\\n\"\n}\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# 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://github.com/gillsdk/gill/issues/new)\nbefore working on specific code changes to ensure it is within scope and desire for this library. Once approved,\n[submit a pull request](https://github.com/gillsdk/gill/pulls) with your changes. Include a helpful description of the\nproblem and how your changes address it, and provide tests so we can verify the fix works as expected.\n\n## New features\n\nIf there's a new feature you'd like to see added to gill, please\n[open an issue](https://github.com/gillsdk/gill/issues/new) before working on specific code changes to ensure it is\nwithin scope and desire for this library.\n\nContributions are welcome and loved, but it's best to discuss major changes before investing time in implementation.\n\n## System requirements\n\nBefore getting started, ensure your system has access to the following tools:\n\n- [Node.js](https://nodejs.org/)\n- [pnpm](https://pnpm.io/)\n\n## Getting started\n\nClone and prepare the repo locally:\n\n```sh\ngit clone https://github.com/gillsdk/gill.git\ncd gill\npnpm install\n```\n\nBuild all the packages in parallel (via Turborepo):\n\n```sh\npnpm build\n```\n\n> Note: You must run the build command the first time manually before running the test commands detailed below.\n\nTo build a specific package, use the `--filter` flag:\n\n```sh\npnpm build --filter=gill\npnpm build --filter=@gillsdk/react\n# or multiple specific packages\npnpm build --filter=gill --filter=@gillsdk/react\n```\n\n## Running tests\n\nAll unit tests can be run at the same time (including rebuilding):\n\n```sh\npnpm test\n```\n\n> Note: You must run the build command the first time manually before running the `test` command.\n\nPlease ensure that all tests are passing when submitting a pull request. If you're adding new features to the gill sdk,\nalways include tests.\n\n## Pull request process\n\nWhen submitting a pull request:\n\n- Ensure the pull request title and description explain the changes you made and why you made them.\n- Include a test plan section that outlines how you tested your contributions. We do not accept contributions without\n  tests.\n- Ensure all tests pass.\n\nWhen a pull request is created, gill maintainers will be notified automatically.\n\n## Communication\n\n- **GitHub issues**: For bug reports and feature requests\n- **GitHub pull requests**: For code contributions\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2023 Solana Foundation\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "MAINTAINERS.md",
    "content": "# Maintainers\n\nIn this document, you can find various pieces of information about the gill sdk and its associated packages. From\narchitecture and build steps to foot-guns and gotchas.\n\nThis should be a living document to describe in detail anything the maintainers of this repository feel the need should\nbe specifically elaborated on.\n\n# Publishing and versioning\n\nThis monorepo contains many the many packages that constitute the \"gill sdk\". Including `gill` and those scoped within\n`@gillsdk` (e.g. `@gillsdk/react`).\n\n## Versioning\n\nThis repo uses [changesets](https://github.com/changesets/changesets) to aid in versioning and auto generating the\nvarious package changelog documents.\n\nOn each PR that requires a version bump (major, minor, or patch), simply run the `pnpm changeset` command. This will\nautomatically detect which packages had code files changed and requiring a version bump.\n\nThe `changeset` command will create a markdown file in the [.changeset](./.changeset/) directory which will be auto\ndetected by the Changeset bot when PRs are pushed to github.\n\n## Publishing new versions\n\nAll package versions are published by the [publish-packages](./.github/workflows/publish-packages.yml) action.\n\nWhen a PR is merged to the `master` branch, this github action will do one of two things:\n\n1. Read all the available changeset files and create/update a \"Version Packages\" PR that details all the changes since\n   the last version bump, generate changelog entries for them, and perform appropriate version bumps.\n   ([See example here](https://github.com/gillsdk/gill/pull/218)).\n2. If the last merge to the `master` branch was a \"Version Packages\" PR, the actions will publish all the changed\n   packages.\n\nThis repo has an NPM token stored in it for the [`gill-maintainers`](https://www.npmjs.com/~gill-maintainers) NPM user\nwhich is the CI bot account for publishing. This account should be the only authorized user to publish these packages,\nhelping to mitigate various supply chain attacks that have become so common :/\n\n# Multiple import paths\n\nThe core `gill` library is constructed in such a way to have multiple \"import paths\" to access different functionality.\nIncluding:\n\n```ts\nimport { ... } from \"gill\";\nimport { ... } from \"gill/programs\";\nimport { ... } from \"gill/node\";\n```\n\nTo achieve this, the `gill` package includes the following configurations:\n\n- \"exports\" fields in the [`package.json`](./packages/gill/package.json) for each of these paths\n- TSUP entries for each desired paths ([see here](./packages/gill/tsup.config.package.ts))\n- tsconfig settings for each path ([see here](./packages/gill/tsconfig.declarations.json))\n\nAltering (or removing these) configuration settings will break these \"import paths\" for consumers of the `gill` package\nin different ways.\n\nFor example, altering the tsconfig declarations from:\n\n```json\n{\n    ...\n    \"include\": [\"src/programs/token/index.ts\", \"src/programs/index.ts\", \"src/node/index.ts\", \"src/index.ts\", \"src/types\"]\n}\n```\n\nto\n\n```json\n{\n    ...\n    \"include\": [\"src\"]\n}\n```\n\nwill break developer experience by removing all the types from the different paths.\n\n# Docs\n\nWhen building the docs for production, the `build-api-docs.sh` script is run which will run the `compile:docs` script\nfor each of the configured submodule packages. This includes building the submodule itself, generating typedocs for it,\nand moving those typedocs into the `docs/content/api` directory in a sub-directory for each submodule.\n\nThis process utilizes the `typedoc-data.mjs` to know where specifically to put each submodule's docs and what to insert\ninto its respective `index.mdx` to ensure we have nice looking docs.\n\n## Submodule API references\n\nTo include any submodule in the gill docs' [API references section](https://www.gillsdk.com/api), each submodules must\nbe properly configured.\n\nsteps to update include a submodule package in the api docs:\n\nIn the `docs` directory:\n\n1. install the submodule into the docs themselves (required for use by `twoslash` to get prettier code blocks)\n\n```shell\npnpm add @gillsdk/react@latest --ignore-workspace\n```\n\n2. update the docs' `update:gill` script to include the new package (allow maintainers to update all packages at once)\n3. update the `typedoc-data.mjs` to include the key and frontmatter details for the submodules, following existing\n   patterns\n\nIn the respective submodule's source code directory:\n\n1. Setup the submodule's typedoc configuration via a `typedoc.json` file in the submodules's directory (along side it's\n   `package.json`)\n1. Create a `compile:docs` script command that will compile the typedocs\n   - See `@gillsdk/react` [here](/packages/react/package.json) for an example of a submodule with a single import path\n   - See `gill` [here](/packages/gill/package.json) for an example of a submodule with a multiple import paths\n1. Create a `move:docs` script command that will relocate the compiled typedocs from its submodule specific build\n   location to the actual gill docs content directory\n1. Create a `clean:docs` script command that can purge the existing submodule docs (ensures the docs build is fresh)\n\n> Note: The `docs/content/api` subdirectories are intentionally git ignored to ensure they are built fresh on docs\n> deployments. This also allows the docs site to load much faster when running locally (by removing the submodule api\n> references directory) since we rarely need to view these locally. But you can still build the api references and view\n> them if you need too. Flexibility :)\n\n# Token Metadata program client\n\nThe included Token Metadata program client was generated using [Codama](https://github.com/codama-idl/codama).\n\n## Minimal functionality\n\nGiven 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\nwe (manually) removed it. Gill intentionally only ships a minimal amount of Token Metadata functionality to get most\nusers by with core uses (namely attaching metadata to legacy SPL tokens)\n\nCare should be taken when regenerating this program client. Especially to prevent the `gill` package size from\nballooning (and therefore developer applications from ballooning.)\n\n## Naming collisions\n\nThere is a naming collision between the Token Metadata program and the SPL Token/Token22 program clients for the\n`MintArgs` type.\n\nSince gill ships a generated client for Token Metadata, and reexports the Token22 client from its source package, the\nToken Metadata's `MintArgs` were renamed to `MetadataMintArgs`.\n\nSee\n[token-metadata/generated/types/mintArgs.ts](./packages/gill/src/programs/token-metadata/generated/types/mintArgs.ts)\n"
  },
  {
    "path": "README.md",
    "content": "<h1 align=\"center\">\n  gill sdk\n</h1>\n\n<p align=\"center\">\n  javascript/typescript client library for interacting with the Solana blockchain\n</p>\n\n<p align=\"center\">\n  <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>\n  <a href=\"https://www.npmjs.com/package/gill\"><img src=\"https://img.shields.io/npm/v/gill?logo=npm&color=377CC0\" /></a>\n  <a href=\"https://www.npmjs.com/package/gill\"><img src=\"https://img.shields.io/npm/dm/gill?color=377CC0\" /></a>\n</p>\n\n<p align=\"center\">\n  <img width=\"600\" alt=\"gill\" src=\"https://raw.githubusercontent.com/gillsdk/gill/refs/heads/master/docs/public/cover.png\" />\n</p>\n\n## Overview\n\nWelcome to the gill sdk, a JavaScript/TypeScript client library for interacting with the [Solana](http://solana.com/)\nblockchain. You can use it to build Solana apps in Node, web, React Native, or just about any other JavaScript\nenvironment.\n\nGill is built on top of the modern javascript libraries for Solana built by Anza called\n[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as \"web3.js v2\"). By utilizing the same types and\nfunctions under the hood, `gill` is compatible with `kit`. See [Replacing Kit with gill](#replace-kit-with-gill).\n\n> For a comparison of using gill vs `@solana/kit`, take a look at the\n> [gill vs @solana/kit comparison docs](https://gillsdk.com/docs/compare/kit) and the\n> [comparison examples](https://github.com/gillsdk/gill/tree/master/examples/get-started#comparison-of-gill-vs-solanakit-aka-web3js-v2).\n\n## Documentation\n\nYou can find the gill library docs here:\n\n- [gill docs site](https://gillsdk.com)\n- [gill setup guide](https://gillsdk.com/docs#quick-start)\n- [gill API references](https://gillsdk.com/api)\n\n## Packages\n\nThe following packages are published from within this repo, collectively known as the \"gill sdk\":\n\n| Package               | Description                                   | Version                                                                                                                                 | Source                                                                    |\n| :-------------------- | :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |\n| `gill`                | SDK for building on the Solana blockchain     | [![npm](https://img.shields.io/npm/v/gill.svg?logo=npm&color=377CC0)](https://www.npmjs.com/package/gill)                               | [Source](https://github.com/gillsdk/gill/tree/master/packages/gill)       |\n| `@gillsdk/react`      | React hooks library for the Solana blockchain | [![npm](https://img.shields.io/npm/v/@gillsdk/react.svg?logo=npm&color=377CC0)](https://www.npmjs.com/package/@gillsdk/react)           | [Source](https://github.com/gillsdk/gill/tree/master/packages/react)      |\n| `@gillsdk/solana-pay` | Modern Solana Pay protocol client library     | [![npm](https://img.shields.io/npm/v/@gillsdk/solana-pay.svg?logo=npm&color=377CC0)](https://www.npmjs.com/package/@gillsdk/solana-pay) | [Source](https://github.com/gillsdk/gill/tree/master/packages/solana-pay) |\n\n## Development\n\n### Environment setup\n\n1. Install [NodeJS](https://nodejs.org/en)\n2. Install [pnpm](https://pnpm.io/installation)\n\nClone and prepare this repo locally:\n\n```shell\ngit clone https://github.com/gillsdk/gill.git\ncd gill\npnpm install\n```\n\n### Build\n\nTo build all the packages in parallel (via Turborepo):\n\n```shell\npnpm build\n```\n\n> Note: You must run the build command the first time manually before running the test commands detailed below.\n\nTo build a specific package, use the `--filter` flag:\n\n```shell\npnpm build --filter=gill\npnpm build --filter=@gillsdk/react\n# or multiple specific packages\npnpm build --filter=gill --filter=@gillsdk/react\n```\n\n### Testing\n\nAll unit tests can be run at the same time (including rebuilding):\n\n```shell\npnpm test\n```\n\n> Note: You must run the build command the first time manually before running the `test` command.\n\n## Contributing\n\nContributions are welcome and loved! Please [open an issue](https://github.com/gillsdk/gill/issues/new) before working\non specific code changes to ensure it is within scope and desire for this library.\n\nSee the [CONTRIBUTING.md](./CONTRIBUTING.md) document for full details.\n\nSeriously. Read (and follow) this document if you want to contribute.\n\n## Maintainers\n\nSee the [MAINTAINERS.md](./MAINTAINERS.md) document for full details.\n"
  },
  {
    "path": "docs/.eslintrc.json",
    "content": "{\n  \"extends\": [\"next/core-web-vitals\", \"next/typescript\"],\n  \"rules\": {\n    \"@next/next/no-img-element\": \"off\"\n  }\n}\n"
  },
  {
    "path": "docs/.gitignore",
    "content": "# deps\n/node_modules\n\n# generated content\n.contentlayer\n.content-collections\n.source\n\n# api content\n.docs\ncontent/api/\n!./content/api/index.mdx\n!./content/api/meta.json\n\n# test & build\n/coverage\n/.next/\n/out/\n/build\n*.tsbuildinfo\n\n# misc\n.DS_Store\n*.pem\n/.pnp\n.pnp.js\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# others\n.env*.local\n.vercel\nnext-env.d.ts\n\n# Turborepo\n.turbo\n"
  },
  {
    "path": "docs/.npmrc",
    "content": "enable-pre-post-scripts = true\n"
  },
  {
    "path": "docs/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "docs/.prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"proseWrap\": \"always\",\n  \"arrowParens\": \"always\",\n  \"printWidth\": 100\n}\n"
  },
  {
    "path": "docs/README.md",
    "content": "# gill documentation\n\nDocumentation website for gill, built with [Fumadocs](https://github.com/fuma-nama/fumadocs).\n\n## Install dependencies\n\nInstall using the `--ignore-workspace` flag to ensure the dependencies of the documentation website\nare separate from the library dependencies.\n\n```bash\npnpm install --ignore-workspace\n```\n\n## Run development server\n\n```bash\npnpm dev\n```\n\nOpen http://localhost:3000 with your browser to see the result.\n\n## Generating the API references documentation\n\nThe docs have a `prebuild` command that will generate API docs (via TypeDoc) for the library's\npackages.\n\n> When working locally, it is not required to build these in order to test the local docs site.\n\nYou can manually trigger building the API references using the following command:\n\n```shell\npnpm prebuild\n```\n\n## Learn more\n\nTo learn more about Next.js and Fumadocs, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs\n"
  },
  {
    "path": "docs/build-api-docs.sh",
    "content": "#!/usr/bin/env bash\nset -euo pipefail\n\ncd ..\npnpm compile:docs --output-logs=hash-only"
  },
  {
    "path": "docs/content/api/index.mdx",
    "content": "---\ntitle: API Reference\ndescription:\n  \"Explore the functions, variables, types, and more that are included within the gill library, the\n  new Solana developer JavaScript SDK.\"\n---\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\n## Importing from gill\n\nThe `gill` library has a few different import paths to help segment the code within library and\nimprove compatibility in different environments (i.e. browser vs server).\n\nTo utilize the core functionality in either browser or server environments, you can import directly\nfrom `gill` as expected:\n\n```ts\nimport { ... } from \"gill\"\n```\n\n### Import program clients\n\nThe `gill` package includes several Solana program clients including Token/Token22, System, Compute\nBudget, and several others. The available program clients can be imported from the `gill/programs`\npath as follows:\n\n```ts\nimport { ... } from \"gill/programs\"\n```\n\n### Import server only utilities\n\nThe `gill` package includes some \"server only\" functionality that is only usable in JavaScript\nserver runtimes like NodeJs and Bun. To utilize this specific functionality, you can import from\n`gill/node` as follows:\n\n```ts\nimport { ... } from \"gill/node\"\n```\n"
  },
  {
    "path": "docs/content/api/meta.json",
    "content": "{\n  \"title\": \"API Reference\",\n  \"root\": true,\n  \"pages\": [\"!index\", \"...\"]\n}\n"
  },
  {
    "path": "docs/content/docs/compare/kit.mdx",
    "content": "---\ntitle: gill vs @solana/kit\ndescription:\n  \"Explore a side-by-side comparison of gill and @solana/kit (formerly known as web3js v2)\"\n---\n\nThe gill library is built directly on top of\n[`@solana/kit`](https://www.npmjs.com/package/@solana/kit), the new JavaScript primitives developed\nby [Anza](https://anza.xyz) as a more performant replacement for the old\n[`@solana/web3.js`](https://www.npmjs.com/package/@solana/web3.js). Since Kit only ships these new\nlow level primitives, developers are forced into a single experience of manually crafting everything\nand ballooning their applications with verbose boilerplate.\n\nGill is able to ship **both** the same low level primitives as Kit **and** lightly opinionated\nabstractions to simplify common tasks, all from a single compatible interface. By simplifying across\nthe board with gill, developers can focus more time on their application's business logic and not\nverbose boilerplate.\n\n<Callout>\n  `@solana/kit` was formerly know as \"web3.js v2\" as it was originally published as the version\n  `2.x` release of `@solana/web3.js`. Anza engineers noted this to complicate and confuse the\n  upgrade path for the new technologies, so they decided to publish under the new package name of\n  `@solana/kit`.\n</Callout>\n\nYou can find the complete scripts that the example code snippets were created from in the gill repo\n[here](https://github.com/gillsdk/gill/tree/master/examples/get-started#comparison-of-gill-vs-solanakit-aka-web3js-v2).\nBoth are written with honest intentions, best practices, and attempt to be as concise as possible in\naccomplishing the same task.\n\n## Connecting to the blockchain\n\nEvery application will need to create a connection to the blockchain. A complete and usable\nconnection consists of the following three parts (at a minimum):\n\n1. `rpc` - used to send [Solana RPC](https://solana.com/docs/rpc) requests over HTTP (the most\n   common way)\n2. `rpcSubscriptions` - used to make certain RPC requests over websockets\n3. `sendAndConfirmTransaction` - function used to actually send a complete transaction to the\n   blockchain for confirmation\n\nThe following code snippets demonstrate how to instantiate all three of these connection pieces for\neach of the libraries:\n\n```ts tab=\"gill\"\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n```\n\n```ts tab=\"@solana/kit\"\nimport {\n  devnet,\n  createSolanaRpc,\n  createSolanaRpcSubscriptions,\n  sendAndConfirmTransactionFactory,\n} from \"@solana/kit\";\n\nconst rpc = createSolanaRpc(devnet(\"https://api.devnet.solana.com\"));\n\nconst rpcSubscriptions = createSolanaRpcSubscriptions(devnet(\"wss://api.devnet.solana.com\"));\n\nconst sendAndConfirmTransaction = sendAndConfirmTransactionFactory({\n  rpc,\n  rpcSubscriptions,\n});\n```\n\n## Making RPC requests\n\nFor both `@solana/kit` and `gill`, making standard Solana RPC requests is the same: use the\npreviously created `rpc` object.\n\n```ts\n// get slot\nconst slot = await rpc.getSlot().send();\n\n// get the latest blockhash\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\n## Loading a signer\n\nThere are many different ways to obtain a keypair that is capable of performing the Solana specific\nsigning operations (aka a \"signer\"). This will look different for frontend and backend applications.\n\nFor local scripts, JavaScript server runtimes (like NodeJS and Bun), and backend applications it's\ncommon to load a keypair from the file system or an ENV variable. The following is how to accomplish\nthis for both libraries:\n\n```ts tab=\"gill\"\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\nconst signer = await loadKeypairSignerFromFile();\n```\n\n```ts tab=\"@solana/kit\"\nimport { readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { resolve } from \"node:path\";\nimport { createKeyPairFromBytes } from \"@solana/kit\";\n\nconst keypairFilePath = \"~/.config/solana/id.json\";\n\nconst resolvedKeypairPath = resolve(keypairFilePath.replace(\"~\", homedir()));\n\nconst keypair = await createKeyPairFromBytes(\n  Uint8Array.from(JSON.parse(readFileSync(resolvedKeypairPath, \"utf8\"))),\n);\n```\n\nNote that `@solana/kit` has no specific functionality for loading keypairs from files or ENV\nvariables, so developers must implement the file/ENV reading operations themselves.\n\nWhereas gill includes multiple functions to handle these very scenarios:\n\n- [`loadKeypairSignerFromFile()`](/api/gill-node/functions/loadKeypairSignerFromFile)\n- [`loadKeypairSignerFromEnvironment()`](/api/gill-node/functions/loadKeypairSignerFromEnvironment)\n- [`loadKeypairSignerFromEnvironmentBase58()`](/api/gill-node/functions/loadKeypairSignerFromEnvironmentBase58)\n\n<Callout>\n  The `loadKeypairSignerFromFile()` function defaults to the Solana CLI's keypair path\n  (`~/.config/solana/id.json`). If you wish to load a different keypair file, provide the path in as\n  an argument.\n</Callout>\n\n## Creating a transaction\n\nAfter connecting to the blockchain and making RPC requests, the next most common tasks is actually\ncreating transactions.\n\nThe following are examples of how to create a simple Memo transaction that includes basic\noptimizations (via compute budget instructions):\n\n```ts tab=\"gill\"\nimport { createTransaction } from \"gill\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\nconst transaction = createTransaction({\n  version: \"legacy\",\n  feePayer: signer,\n  instructions: [\n    getAddMemoInstruction({\n      memo: \"gm world!\",\n    }),\n  ],\n  latestBlockhash,\n  computeUnitLimit: 5000,\n  computeUnitPrice: 1000,\n});\n```\n\n```ts tab=\"@solana/kit\"\nimport {\n  pipe,\n  createTransactionMessage,\n  setTransactionMessageFeePayerSigner,\n  appendTransactionMessageInstructions,\n  setTransactionMessageLifetimeUsingBlockhash,\n} from \"@solana/kit\";\nimport { getAddMemoInstruction } from \"@solana-program/memo\";\nimport {\n  getSetComputeUnitLimitInstruction,\n  getSetComputeUnitPriceInstruction,\n} from \"@solana-program/compute-budget\";\n\nconst transaction = pipe(\n  createTransactionMessage({ version: \"legacy\" }),\n  (tx) => setTransactionMessageFeePayerSigner(signer, tx),\n  (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n  (tx) =>\n    appendTransactionMessageInstructions(\n      [\n        getAddMemoInstruction({\n          memo: \"gm world!\",\n        }),\n        getSetComputeUnitLimitInstruction({ units: 5000 }),\n        getSetComputeUnitPriceInstruction({ microLamports: 1000 }),\n      ],\n      tx,\n    ),\n);\n```\n\nNotice that the `@solana/kit` based example above requires manually installing two additional\npackages: `@solana-program/compute-budget` and `@solana-program/memo`.\n\nWhereas gill takes a different approach:\n\n- `createTransaction` natively supports setting the same compute budget instructions\n- the included Memo program client is directly accessible via the `gill/programs` import path\n  without having to manually install the package\n"
  },
  {
    "path": "docs/content/docs/compare/meta.json",
    "content": "{\n  \"title\": \"Comparisons\",\n  \"pages\": [\"kit\", \"web3js\", \"...\"]\n}\n"
  },
  {
    "path": "docs/content/docs/debug-mode.mdx",
    "content": "---\ntitle: Debug Mode\ndescription:\n  \"Understand how to use gill's debug mode to more easily debug your Solana applications.\"\n---\n\nWithin `gill`, you can enable \"debug mode\" to automatically log additional information that will be\nhelpful in troubleshooting your Solana applications (especially failing transactions).\n\n[Debug mode](./debug-mode) is disabled by default to minimize additional logs for your application.\nBut with its flexible debug controller, you can enable it from the most common places your code will\nbe run. Including your code itself, NodeJS backends, serverless functions, and even the in web\nbrowser console itself.\n\nSome examples of the existing debug logs that `gill` has sprinkled in:\n\n- log the Solana Explorer link for transactions as you are sending them via\n  `sendAndConfirmTransaction`\n- log the base64 transaction string for further troubleshooting using\n  [`mucho inspect`](https://github.com/solana-developers/mucho?tab=readme-ov-file#inspect) or the\n  Solana Explorer's [Transaction Inspector](https://explorer.solana.com/tx/inspector)\n\n## How to enable debug mode\n\nTo enable debug mode, set any of the following to `true` or `1`:\n\n- `process.env.GILL_DEBUG`\n- `global.__GILL_DEBUG__`\n- `window.__GILL_DEBUG__` (i.e. in your web browser's console)\n- or manually set any debug log level (see below)\n\n```ts\nimport { ... } from \"gill\"\n\n/** Turn on debug mode */\nglobal.__GILL_DEBUG__ = true;\n```\n\n<Callout title=\"Pro Tip\">\n  Set the `GILL_DEBUG` environment variable in your applications' preview/staging environments to\n  improve your logging and troubleshooting workflows.\n</Callout>\n\n## How to set a debug level\n\nTo set a desired level of logs to be output in your application, set the value of one of the\nfollowing (default: `info`):\n\n- `process.env.GILL_DEBUG_LEVEL`\n- `global.__GILL_DEBUG_LEVEL__`\n- `window.__GILL_DEBUG_LEVEL__` (i.e. in your web browser's console)\n\n```ts\nimport { ... } from \"gill\"\n\n/** Set the debug mode log level (default: `info`) */\nglobal.__GILL_DEBUG_LEVEL__ = \"debug\";\n```\n\nThe log levels supported (in order of priority):\n\n1. `debug` (lowest)\n2. `info` (default)\n3. `warn`\n4. `error`\n\n## Custom debug logs\n\nGill also exports the same debug functions it uses internally, allowing you to implement your own\ndebug logic related to your Solana application and use the same controller for it as `gill` does.\n\nThese functions include:\n\n- `isDebugEnabled()` - check if debug mode is enabled or not\n- `debug()` - print debug message if the set log level is reached\n\n```typescript\nimport { debug, isDebugEnabled } from \"gill\";\n\nif (isDebugEnabled()) {\n  // your custom logic\n}\n\n// log this message if the \"info\" or above log level is enabled\ndebug(\"custom message\");\n\n// log this message if the \"debug\" or above log level is enabled\ndebug(\"custom message\", \"debug\");\n\n// log this message if the \"warn\" or above log level is enabled\ndebug(\"custom message\", \"warn\");\n\n// log this message if the \"warn\" or above log level is enabled\ndebug(\"custom message\", \"warn\");\n```\n"
  },
  {
    "path": "docs/content/docs/examples.mdx",
    "content": "---\ntitle: Examples\ndescription:\n  Collection of example scripts and code snippets on how to use gill, the Solana JavaScript SDK.\n---\n\nListed here and in gill's open source repository, you can find a collection of example scripts and\ncode snippets that demonstrate how to accomplish various common tasks for Solana developers.\n\n[github.com/gillsdk/gill/tree/master/examples](https://github.com/gillsdk/gill/tree/master/examples)\n\n## Get started with the basics\n\nInside of the gill repository, you can find the `get-started` directory that contains gill examples\nscripts on the following:\n\n### intro.ts\n\n<Callout title=\"Source Code Link\">\n  https://github.com/gillsdk/gill/blob/master/examples/get-started/src/intro.ts\n</Callout>\n\nA brief introduction to the `gill` library. Demonstrating and explaining the commonly used tasks\ninvolved to interact with the Solana blockchain, including:\n\n- load a keypair signer from the local filesystem\n- create an rpc connection to the blockchain\n- creating basic instructions (like the memo instruction)\n- getting the latest blockhash\n- building a complete transaction\n- signing the transaction with the loaded local keypair signer\n- getting the signature of a transaction (even before it is sent)\n- logging Solana Explorer links\n- sending and confirming a transaction\n\nThese are all the most basic tasks required for any application sending transaction to the Solana\nblockchain.\n\n### airdrop.ts\n\n<Callout title=\"Source Code Link\">\n  https://github.com/gillsdk/gill/blob/master/examples/get-started/src/airdrop.ts\n</Callout>\n\nDemonstrates how to create a client connection to the Solana blockchain on a test cluster (e.g.\n`devnet`, `testnet`, or `localnet`) and request airdrops of testing SOL tokens to a wallet address.\n\n### tokens.ts\n\n<Callout title=\"Source Code Link\">\n  https://github.com/gillsdk/gill/blob/master/examples/get-started/src/tokens.ts\n</Callout>\n\nDemonstrates how to use gill's \"transaction builders\" to create a brand new Solana token (with\nonchain metadata) and then mint tokens to another user's wallet:\n\n- load a keypair signer from the local filesystem\n- create an rpc connection to the blockchain\n- getting the latest blockhash\n- build an optimized transaction to create a token\n- sign, send, and confirm that \"create token\" transaction\n- build an optimized transaction to mint\n- sign, send, and confirm that \"mint tokens\" transaction\n\n### reference-keys.ts\n\n<Callout title=\"Source Code Link\">\n  https://github.com/gillsdk/gill/blob/master/examples/get-started/src/reference-keys.ts\n</Callout>\n\nThis script demonstrates the process to add a reference key into a transaction.\n\nAdding reference keys to transactions allows developers to be able track the completion of\ntransactions given to users, without knowing the signature ahead of time. Then, perform any desired\nlogic after detection of the reference keyed transaction landing onchain.\n\nMost notably utilized within SolanaPay and Blinks.\n\nSee also: the gill docs for [Reference Keys](https://gillsdk.com/docs/guides/reference-keys) for\nmore information.\n\n### Comparison between @solana/kit and gill\n\nYou can find comparison scripts that demonstrates some of the differences between\n[gill](https://github.com/gillsdk/gill) and [@solana/kit](https://github.com/anza-xyz/kit) (formerly\nknown as \"web3.js v2\").\n\n<Callout>\n  Find a more comprehensive comparison in [gill vs @solana/kit comparison\n  docs](https://gillsdk.com/docs/compare/kit)\n</Callout>\n\nBoth scripts accomplish the same task: send an optimized transaction to the Solana blockchain.\n\n- Using gill -\n  [`basic.ts`](https://github.com/gillsdk/gill/blob/master/examples/get-started/src/basic.ts)\n- Using web3js v2 -\n  [`basic-compare.ts`](https://github.com/gillsdk/gill/blob/master/examples/get-started/src/basic-compare.ts)\n"
  },
  {
    "path": "docs/content/docs/getting-started/client.mdx",
    "content": "---\ntitle: Create a Solana client\ndescription: Create a client connection to the Solana blockchain to perform Solana RPC requests.\n---\n\nSetting up a client connection to the Solana blockchain is a very important part of your\napplication. This client connection is how your application will be sending and receiving data from\nthe Solana JSON RPC layer, including [fetching accounts](#fetch-an-account) and sending\ntransactions.\n\nGill considers the \"Solana client\" to be (at a minimum) the following pieces:\n\n- `rpc` - used to interact with the your [Solana JSON RPC](https://solana.com/docs/rpc/http)\n  provider (typically via HTTP)\n- `rpcSubscriptions` - used to interact with the Solana RPC over websockets\n- `sendAndConfirmTransaction` - used to send and confirm a Solana transaction over the RPC\n  connections\n\n<Callout>\n  If you are familiar with the `Connection` class from the older `@solana/web3.js` library, gill's\n  `createSolanaClient` is similar. But more bare-bones and lightweight.\n</Callout>\n\nMost client applications will need to initialize the above functionality in their codebase. Within\ngill, there are two primary ways to create a Solana client:\n\n1. using the [`createSolanaClient()`](#create-a-solana-rpc-connection) function (recommended in\n   order to reduce application boilerplate)\n2. manually initialize them all individually\n\n## Create a Solana RPC connection\n\nCreate the Solana client connections (i.e. `rpc` and `rpcSubscriptions`) from any RPC URL or\nstandard Solana network moniker (i.e. `devnet`, `localnet`, `mainnet` etc) using the\n`createSolanaClient()` function.\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"mainnet\",\n});\n```\n\nUsing the Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\nand should not be used in production applications. Applications should find their own RPC provider\nand use the URL provided by them.\n\n### Solana client for localnet\n\nDevelopers can also connect to a local test validator (like\n[`solana-test-validator`](https://solana.com/docs/intro/installation#run-local-validator)) running\non your computer.\n\nTo create a Solana client for your local test validator:\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"localnet\",\n});\n```\n\n<Callout>\n  The `urlOrMoniker` value of `localnet` will utilize the default test validator address and port of\n  `http://127.0.0.1:8899`. If you need to connect to a different address/port, then simply pass in\n  its entire URL. See [custom RPC URL](#solana-client-for-a-custom-rpc-url) below.\n</Callout>\n\n### Solana client for a custom RPC URL\n\nTo create an RPC client for an custom RPC provider or service:\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"https://private-solana-rpc-provider.com\",\n});\n```\n\n## Making Solana RPC calls\n\nAfter you have a Solana `rpc` connection, you can make all the\n[JSON RPC method](https://solana.com/docs/rpc) calls directly off of it. Most commonly to get the\n[latest blockhash](#get-the-latest-blockhash) or [fetching a specific account](#fetch-an-account).\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// get slot\nconst slot = await rpc.getSlot().send();\n\n// get the latest blockhash\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\nThe `rpc` client requires you to call `.send()` on the RPC method in order to actually send the\nrequest to your RPC provider and get a response.\n\n#### Destructure and renaming response values\n\nMany of the Solana RPC responses will return a generic `value` attribute containing the typed\nresponse payload. It is a common practice to\n[destructure](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring)\nthis generic `value` into a more aptly named variable, such as `latestBlockhash` (as demonstrated in\nthe example below).\n\n### Get the latest blockhash\n\nOn Solana, the latest blockhash is uses as a sort of \"recent timestamp\" check within the\ntransaction.\n\nTo get the latest blockhash from your RPC:\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// get the latest blockhash\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\n<Callout title=\"Pro tip\">\n  Only request this value *just before* you are going to use it your code. Since latest blockhashes\n  are only valid for approximately 1-2 minutes, requesting it at the latest possible time in your\n  codebase can help improve transaction landing rates.\n</Callout>\n\n### Fetch an account\n\nAll the data stored on the Solana blockchain is stored in\n[accounts](https://solana.com/docs/core/accounts), including native SOL balance, tokens, and\nprograms. The structure of an account's data and associated metadata information is called an\n`AccountInfo`.\n\nTo get an account's `AccountInfo` from your RPC:\n\n```typescript twoslash\nimport { createSolanaClient, address } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\nconst accountToFetch = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\n// get the `AccountInfo` with (default) `base58` encoding for the data\nconst { value: accountInfo } = await rpc.getAccountInfo(accountToFetch).send();\n```\n\n<Callout title=\"\" type=\"error\">\n  By default, the `getAccountInfo` RPC method will utilize the `base58` encoding for the `data`\n  within the account itself. This is fine for accounts with small amounts of data stored in them,\n  but fetching accounts with larger amounts of `data` will result in an error with the `base58`\n  encoding.\n</Callout>\n\nIt is **strongly** recommended to utilize `base64` encoding when fetching accounts from the\nblockchain to avoid the common errors when fetching with the default `base58` encoding.\n\n```typescript twoslash\nimport { createSolanaClient, address } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\nconst accountToFetch = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\n// get the `AccountInfo` with `base64` encoding for the data\nconst { value: accountInfo } = await rpc\n  .getAccountInfo(accountToFetch, { encoding: \"base64\" })\n  .send();\n```\n\nAn even better solution is to utilize the `fetchEncodedAccount()` function to fetch accounts, which\nalways utilizes the `base64` encoding.\n\n```typescript twoslash\nimport { createSolanaClient, address, fetchEncodedAccount } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\nconst accountToFetch = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\nconst account = await fetchEncodedAccount(rpc, accountToFetch);\n```\n\nThese encoded accounts can then easily be decoded by the correct `Decoder` for the structure of the\naccount's `data`.\n\n### Using AbortControllers\n\nYou can also include custom configuration settings on your RPC calls, like using a JavaScript\n[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController), by passing them\ninto `send()`:\n\n```typescript twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// Create a new AbortController.\nconst abortController = new AbortController();\n\n// Abort the request when the user navigates away from the current page.\nfunction onUserNavigateAway() {\n  abortController.abort();\n}\n\n// The request will be aborted if and only if the user navigates away from the page.\nconst slot = await rpc.getSlot().send({ abortSignal: abortController.signal });\n```\n"
  },
  {
    "path": "docs/content/docs/getting-started/meta.json",
    "content": "{\n  \"title\": \"Getting Started\",\n  \"defaultOpen\": true,\n  \"pages\": [\"client\", \"signers\", \"...\"]\n}\n"
  },
  {
    "path": "docs/content/docs/getting-started/signers.mdx",
    "content": "---\ntitle: Generate a signer\ndescription: Create a new keypair signer that can perform Solana signing operations.\n---\n\nFor most typical Solana transaction signing operations, you will be utilizing a `TransactionSigner`.\nThis object type is capable of being \"attached\" to instructions and transaction to perform signing\noperations.\n\nThe most common of which is a `KeyPairSigner`, which is able to be passed around to the various\nfunctions within gill to satisfies any `TransactionSigner` type requirements, like when building\ninstructions or creating transactions.\n\n<Callout>\n  Unless otherwise specifically noted in the gill documentation, the term \"signer\" refers to\n  `TransactionSigner` and usually a `KeyPairSigner`.\n</Callout>\n\n## Generating a keypair signer\n\nFor various Solana development tasks, you may need to generate a new signer. Including when creating\na new account, generating reference keys for transactions, or\n[creating tokens](/docs/guides/tokens/create-token).\n\nThe `generateKeyPairSigner()` function allows you to generate a new random `KeyPairSigner` (which\nsatisfies the `TransactionSigner` type) to perform signing operations.\n\n```typescript twoslash\nimport { generateKeyPairSigner, type KeyPairSigner } from \"gill\";\n\nconst signer = await generateKeyPairSigner();\n```\n\n### Non-extractable by default\n\nUnder the hood, a `KeyPairSigner` utilize the\n[Web Crypto APIs](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) to improve\nsecurity.\n\nThese signers are non-extractable by default; meaning there is no way to get the secret key material\nout of the instance. This is a more secure practice and highly recommended to be used over\nextractable keypairs, unless you REALLY need to be able to save the keypair for some reason.\n\n## Generating extractable keypairs and signers\n\nExtractable keypairs are less secure and should not be used unless you REALLY need to\n[save a keypair](/docs/guides/loading-and-saving-keypairs) for some reason. Since there are a few\nuseful cases for saving these keypairs, gill contains a separate explicit function to generate these\nextractable keypairs.\n\nTo generate a random, **extractable** `KeyPairSigner`:\n\n```typescript twoslash\nimport { generateExtractableKeyPairSigner } from \"gill\";\n\nconst signer = await generateExtractableKeyPairSigner();\n```\n\n<Callout title=\"WARNING\" type=\"error\">\n  Using **extractable** keypairs are inherently less-secure, since they allow the secret key\n  material to be extracted. Obviously. As such, they should only be used sparingly and ONLY when you\n  have an explicit reason you need extract the key material (like if you are going to save the key\n  to a file or environment variable).\n</Callout>\n\n## Create a signer without the secret key\n\nIf your Solana application allows users to sign transaction's by way of connecting their wallet\n(e.g. Backpack, Phantom, Solflare, etc) to your app, you will not have access to their secret key\nmaterial.\n\nYou will need to create a \"noop signer\" in order to satisfy the `TransactionSigner` type, such as\nthe `createTransaction()` functions's `feePayer`:\n\n```typescript twoslash\nimport { createNoopSigner, type Address, createTransaction } from \"gill\";\n\nconst wallet = \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address;\n\nconst signer = createNoopSigner(wallet);\n\nconst transaction = createTransaction({\n  version: \"legacy\",\n  feePayer: signer,\n  instructions: [],\n});\n```\n"
  },
  {
    "path": "docs/content/docs/guides/codama.mdx",
    "content": "---\ntitle: Generate Solana program clients with Codama\ndescription:\n  \"Step-by-step guide on how to use Codama to generate a Solana program client from an IDL.\"\n---\n\n[Codama](https://github.com/codama-idl/codama) is a tool that allows developers to take a Solana\nprogram's IDL and generate client libraries (e.g. JavaScript, Rust, etc) for use by other\napplications. Codama handles all the complexities of crafting Solana instructions into an IDL, a\nconfig file, and importing a function.\n\nCodama is quickly becoming part of the defacto standard tooling for Solana developers. Even the new\nSolana Program Library (SPL) program clients are now generated using Codama. See the\n[solana-program](https://github.com/solana-program) organization on GitHub.\n\nThis guide will walk you through the step-by-step of taking a Solana program IDL and generating a\nJavaScript/TypeScript client library that utilizes the `gill` library. Afterwards, you can import\nthe various functions, types, and more into your application and easily interact with the specific\nSolana program your IDL is from.\n\n<Callout>\n  This guide was written using `v1.1.1` of the Codama CLI. If you experience any issues or\n  discrepancies on newer versions, please [open an\n  issue](https://github.com/gillsdk/gill/issues/new?title=%5BCodama%5D%20) on the gill repo here so\n  we can investigate and update this guide.\n</Callout>\n\n<Steps>\n<Step>\n\n## Install the Codama CLI\n\nTo get started, you first need to install the\n[Codama CLI](https://github.com/codama-idl/codama/tree/main/packages/cli) inside your repo:\n\n```package-install\n@codama/cli\n```\n\n<Callout type=\"warn\">\n  The Codama CLI is **not** meant to be installed globally, but rather version controlled with your\n  repo. Ensuring your generated program client will continue to be compatible with the rest of your\n  code base (should breaking changes happen in the future).\n</Callout>\n\nThis will allow you to execute the Codama CLI via your package manager's \"run\" command:\n\n```shell\nnpx codama --version\n# output: 1.1.1\n```\n\n</Step>\n\n<Step>\n\n## Create a Codama config\n\nThe Codama CLI utilizes a config file to declare which \"renderers\" should be used and other assorted\nlogic. Gill provides the `createCodamaConfig()` helper function to simplify this setup.\n\n<Callout>\n  Utilizing a JavaScript Codama config file (e.g. `codama.js`) is recommended for use with gill. If\n  you need more control, you can always fallback to [manually initializing your Codama\n  config](#manually-initialize-a-codama-config) using a JSON file.\n</Callout>\n\nCreate a `codama.js` file to utilize the `createCodamaConfig()` function, providing your program\nspecific configuration:\n\n```ts\nimport { createCodamaConfig } from \"gill\";\n\nexport default createCodamaConfig({\n  idl: \"program/idl.json\",\n  clientJs: \"clients/js/src/generated\",\n});\n```\n\n- `idl` - should be the relative path to your program's IDL JSON file\n- `clientJs` - should be the relative path to where your generated program client should be stored\n  within your repo\n\n<Callout>\n  It's recommended to store your generated program client in a `generated` directory. This will\n  allow you to easily co-locate other manually crafted functions. See [this\n  example](https://github.com/solana-program/token-2022/tree/main/clients/js/src) of the SPL Token\n  Extension program client doing exactly this.\n</Callout>\n\n</Step>\n\n<Step>\n\n## Generate your program client with Codama\n\nWith your Codama config file setup, you can use the `run` command to generate your\nJavaScript/TypeScript client, storing the generated output in your configured destination:\n\n```shell\nnpx codama run js\n```\n\nYou can now import your newly generated client library from anywhere in your code base or publish as\nan installable package for any application to easily consume and interact with your program.\n\n</Step>\n\n</Steps>\n\n## Multiple program clients in a single repo\n\nAt the time of writing this guide, the latest Codama CLI (`v1.1.1`) does not support multiple\nprogram clients in a single Codama config file.\n\nIf you have multiple Solana program IDLs in a single repo, you will need to create a separate config\nfile for each. We recommend creating a shell script to generate all the program clients with a\nsingle command.\n\nFor example, the gill library itself utilizes a shell script similar to this one:\n\n```shell\n#!/usr/bin/env bash\nset -euo pipefail\n\n# generate all the codama clients (per their respective config files)\nnpx codama run js --config ./idls/token_metadata/codama.js\nnpx codama run js --config ./idls/another_program/codama.js\n\n# run the repo's prettier settings on the generated files\nnpx prettier --write './packages/gill/src/programs/**/generated/{*,**/*}.{ts,js}'\n```\n\nThis script will execute the `codama run js` command for each program by explicitly passing in the\nconfig file to each. Then you can easily execute any additional commands you desire, like performing\nyour standard prettier formatting operations.\n\n<Callout title=\"Use gill's source code as a reference\">\n  You can find the [exact shell\n  script](https://github.com/gillsdk/gill/blob/master/idls/build-codama-clients.sh) that gill uses\n  in our repo to ship some of the program clients gill includes.\n</Callout>\n\n## Manually initialize a Codama config\n\nFor more complex scenarios, you may desire to have more control over the Codama config file. In this\ncase, use the `codama.json` file and manually configure it to your needs.\n\n<Steps>\n<Step>\n\n### Create a codama.json file\n\nRun the Codama `init` command and follow the prompts to scaffold your `codama.json` config file:\n\n```shell\nnpx codama init\n```\n\nYou will be asked a few questions in order to generate the config file for your IDL:\n\n- location of the IDL within your repo (e.g. `program/idl.json`)\n- the type of clients to generate (make sure to select \"JavaScript client\")\n- where your generated JavaScript client should be output to (e.g. `clients/js/src/generated`)\n\n<Callout>\n  It's recommended to store your generated program client in a `generated` directory. This will\n  allow you to easily co-locate other manually crafted functions. See [this\n  example](https://github.com/solana-program/token-2022/tree/main/clients/js/src) of the SPL Token\n  Extension program client doing exactly this.\n</Callout>\n\nYour newly created `codama.json` config file should look something like this:\n\n```json\n{\n  \"idl\": \"program/idl.json\",\n  \"before\": [],\n  \"scripts\": {\n    \"js\": {\n      \"from\": \"@codama/renderers-js\",\n      \"args\": [\"clients/js/src/generated\"]\n    }\n  }\n}\n```\n\n<Callout>\n  At the time of writing this guide, the latest Codama CLI version of `v1.1.1` does not support\n  multiple program clients in a single `codama.json` config file. You will have to create a separate\n  config file for each Solana program. See [Multiple program clients in a single\n  repo](#multiple-program-clients-in-a-single-repo) for more info.\n</Callout>\n\n</Step>\n<Step>\n\n### Replace @solana/kit imports with gill\n\nBy default, Codama will utilize the `@solana/kit` package for the imported symbols within the\ngenerated client. Since the gill library includes Kit (so you do not have to manually install it),\nwe need to instruct Codama to utilize `gill` instead.\n\nUpdate your `codama.json` config file to include the following `dependencyMap` settings by passing\nthe following object as the **second value** of the JavaScript renderer's `args` array:\n\n```json\n{\n  \"idl\": \"program/idl.json\",\n  \"before\": [],\n  \"scripts\": {\n    \"js\": {\n      \"from\": \"@codama/renderers-js\",\n      \"args\": [\n        \"clients/js/src/generated\",\n        {\n          \"dependencyMap\": {\n            \"solanaAccounts\": \"gill\",\n            \"solanaAddresses\": \"gill\",\n            \"solanaCodecsCore\": \"gill\",\n            \"solanaCodecsDataStructures\": \"gill\",\n            \"solanaCodecsNumbers\": \"gill\",\n            \"solanaCodecsStrings\": \"gill\",\n            \"solanaErrors\": \"gill\",\n            \"solanaInstructions\": \"gill\",\n            \"solanaOptions\": \"gill\",\n            \"solanaPrograms\": \"gill\",\n            \"solanaRpcTypes\": \"gill\",\n            \"solanaSigners\": \"gill\"\n          }\n        }\n      ]\n    }\n  }\n}\n```\n\n</Step>\n\n</Steps>\n"
  },
  {
    "path": "docs/content/docs/guides/index.mdx",
    "content": "---\ntitle: Guides\ndescription: \"Collection of helpful task-based references and code snippets for Solana developers.\"\n---\n\n## Wallet & Keys\n\nLearn how to manage Solana keypairs and signers in your applications, from loading existing wallets\nto creating and saving new ones.\n\n<Cards>\n\n<Card href=\"/docs/guides/loading-and-saving-keypairs\" title=\"Loading and Saving Keypairs\">\n  Load and save Solana keypairs from files and environment variables in Node.js, perfect for backend\n  applications, serverless functions, and CI/CD pipelines.\n</Card>\n\n</Cards>\n\n## Tokens on Solana\n\nThe following [Solana token guides](/docs/guides/tokens) demonstrate the most common tasks when\nworking with SPL tokens on Solana.\n\n<Cards>\n\n<Card href=\"/docs/guides/tokens/create-token\" title=\"Create a Token with Metadata\">\n  Learn how to create a new Solana token, with metadata, using either the legacy Token Program or\n  Token Extensions program.\n</Card>\n\n<Card href=\"/docs/guides/tokens/mint-tokens\" title=\"Mint Tokens\">\n  Learn how to mint new token supply to a wallet using the mint authority, including automatically\n  creating the destination's Associated Token Account.\n</Card>\n\n<Card href=\"/docs/guides/tokens/transfer-tokens\" title=\"Transfer Tokens\">\n  Learn how to transfer tokens between wallets using the token authority, including automatically\n  creating the destination's Associated Token Account.\n</Card>\n\n<Card href=\"/docs/guides/tokens/burn-tokens\" title=\"Burn Tokens\">\n  Learn how to permanently remove tokens from circulation by burning them from a wallet's Associated\n  Token Account.\n</Card>\n\n<Card href=\"/docs/guides/tokens/get-token-metadata\" title=\"Get Token Metadata\">\n  Learn how to read and parse token metadata from the Solana blockchain, including both legacy Token\n  Metadata Program accounts and Token Extensions (Token22) inline metadata.\n</Card>\n\n</Cards>\n\n## Transactions\n\nMaster advanced transaction techniques including reference keys for priority fees and implementing\nSolana Pay for payment flows.\n\n<Cards>\n\n<Card href=\"/docs/guides/reference-keys\" title=\"Reference Keys\">\n  Learn how to insert reference keys into Solana transactions to enable priority fees and improve\n  transaction processing.\n</Card>\n\n<Card href=\"/docs/guides/solana-pay\" title=\"Solana Pay\">\n  Implement the Solana Pay protocol in your applications to create payment requests, transfer\n  requests, and transaction requests.\n</Card>\n\n</Cards>\n\n## Developer Tools\n\nStreamline your Solana development workflow with code generation and automation tools.\n\n<Cards>\n\n<Card href=\"/docs/guides/codama\" title=\"Generate Solana Program Clients with Codama\">\n  Use Codama to automatically generate type-safe Solana program clients from IDL files, saving time\n  and reducing errors.\n</Card>\n\n</Cards>\n"
  },
  {
    "path": "docs/content/docs/guides/loading-and-saving-keypairs.mdx",
    "content": "---\ntitle: Loading and Saving Keypairs\ndescription:\n  Guide on loading and saving keypairs from files and environment variables in server-side\n  environments.\n---\n\nWhen building server-side applications, backend services, or CLI tools, you'll often need to manage\nkeypairs for signing transactions. The `gill/node` package provides utilities for loading keypairs\nfrom the filesystem or environment variables, and even simplifies saving them for later use.\n\nThis guide covers the essential functions for keypair management in JavaScript server environments\nincluding Node.js, Bun, and others.\n\n## Installation\n\nTo get started, install the `gill` package:\n\n```package-install\ngill\n```\n\nThe server-side keypair utilities are available under the `gill/node` export path:\n\n```ts\nimport { loadKeypairSignerFromFile, saveKeypairSignerToFile } from \"gill/node\";\n```\n\n## Available Functions\n\nThe `gill/node` package provides the following keypair management functions:\n\n**Loading functions:**\n\n- `loadKeypairSignerFromFile()` - Load a keypair signer from a filesystem JSON file (defaults to\n  Solana CLI path)\n- `loadKeypairSignerFromEnvironment()` - Load a keypair signer from an environment variable (JSON\n  array format)\n- `loadKeypairSignerFromEnvironmentBase58()` - Load a keypair signer from an environment variable\n  (base58 format)\n\n**Saving functions:**\n\n- `saveKeypairSignerToFile()` - Save an extractable keypair signer to a filesystem JSON file\n- `saveKeypairSignerToEnvFile()` - Save an extractable keypair signer to a `.env` file\n\nAll functions also have non-`Signer` variants (e.g., `loadKeypairFromFile`) that work with raw\n`CryptoKeyPair` objects instead of `KeyPairSigner` objects. See the\n[Related Functions](#related-functions) section for more details.\n\n## Loading Keypairs from Environment Variables\n\nEnvironment variables are the recommended approach for loading Solana keypairs in production\nenvironments, serverless functions, and CI/CD pipelines. This method provides better security and\nportability compared to storing private keys in files on disk.\n\nWhen you load a keypair from an environment variable, the keypair data is stored as a string value\nin your system's environment (like `process.env` in Node.js). This approach is particularly useful\nin cloud deployments, containerized applications, GitHub Actions, and other automated workflows\nwhere file system access may be limited or where secrets are managed through environment\nconfiguration.\n\n### JSON Array Format\n\nThe most common format for storing keypairs in environment variables is the JSON array format (a\nstringified array of 64 numbers representing the keypair bytes). This is the same format as the\nkeypairs generated and used by the Solana CLI.\n\n```ts twoslash\nimport { loadKeypairSignerFromEnvironment } from \"gill/node\";\n\n// Expects process.env.MY_KEYPAIR to contain: [123,45,67,89,...]\nconst signer = await loadKeypairSignerFromEnvironment(\"MY_KEYPAIR\");\n\nconsole.log(\"Loaded signer:\", signer.address);\n```\n\nYour `.env` file would look like this:\n\n```bash\nMY_KEYPAIR=[123,45,67,89,...]\n# or\nMY_KEYPAIR=\"[123,45,67,89,...]\"\n```\n\n### Base58 Format\n\nSome Solana wallets, browser extensions, and third-party tools export keypairs as base58-encoded\nstrings instead of JSON arrays. The base58 format is a compact string representation that's easier\nto copy and paste, and is commonly used in certain wallet applications.\n\nUse `loadKeypairSignerFromEnvironmentBase58()` when your keypair is stored in this format:\n\n```ts twoslash\nimport { loadKeypairSignerFromEnvironmentBase58 } from \"gill/node\";\n\n// Expects process.env.MY_KEYPAIR to contain a base58 string\nconst signer = await loadKeypairSignerFromEnvironmentBase58(\"MY_KEYPAIR\");\n\nconsole.log(\"Loaded signer:\", signer.address);\n```\n\nYour `.env` file with base58 format would look like this:\n\n```bash\nMY_KEYPAIR=5J7WTMRm9FG6TvmzJkKp3qQ...\n# or\nMY_KEYPAIR=\"5J7WTMRm9FG6TvmzJkKp3qQ...\"\n```\n\n<Callout type=\"warn\">\n  Both environment variable loading functions will throw an error if the specified environment\n  variable is not set. Make sure your environment variables are properly configured before running\n  your application.\n</Callout>\n\n## Saving Keypairs to Environment Files\n\nWhen setting up a server-side application or preparing configuration for deployment, you may need to\ngenerate new keypairs and save them to environment files for later use. The\n`saveKeypairSignerToEnvFile()` function generates a `.env` file entry that you can use in\ndevelopment or copy to your production environment's secret management system.\n\nThis is particularly useful for:\n\n- Initial project setup when you need to create a new Solana wallet for your backend\n- Local development configurations\n- Generating keypairs that will be deployed to cloud platforms (AWS, Google Cloud, Vercel, etc.)\n- CI/CD pipeline configuration\n\n<Callout type=\"error\">\n  **Security Warning**: Only [**extractable**\n  keypairs](/docs/getting-started/signers#generating-extractable-keypairs-and-signers) can be saved\n  to environment files. You must generate keypairs using `generateExtractableKeyPairSigner()`\n  instead of the regular `generateKeyPairSigner()`. This is a deliberate security feature - regular\n  keypairs keep the private key material locked in memory and cannot be exported.\n</Callout>\n\nHere's how to generate and save a keypair to a `.env` file:\n\n```ts twoslash\nimport { generateExtractableKeyPairSigner } from \"gill\";\nimport { saveKeypairSignerToEnvFile } from \"gill/node\";\n\n// Generate an extractable keypair\nconst signer = await generateExtractableKeyPairSigner();\n\n// Save to .env file (defaults to ./.env)\nawait saveKeypairSignerToEnvFile(signer, \"MY_KEYPAIR\");\n\nconsole.log(\"Keypair saved to .env file\");\n```\n\nThis will append to your `.env` file with a helpful comment showing the public address:\n\n```bash\n# Solana Address: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\nMY_KEYPAIR=[123,45,67,89,...]\n```\n\n### Custom .env File Path\n\nYou can specify a custom path for the environment file:\n\n```ts twoslash\nimport { generateExtractableKeyPairSigner } from \"gill\";\nimport { saveKeypairSignerToEnvFile } from \"gill/node\";\n\nconst signer = await generateExtractableKeyPairSigner();\n\n// Save to a custom .env file\nawait saveKeypairSignerToEnvFile(signer, \"MY_KEYPAIR\", \"./config/.env.production\");\n```\n\n<Callout type=\"warn\">\n  The function will throw an error if the environment variable name already exists in `process.env`.\n  This prevents accidentally overwriting existing configuration.\n</Callout>\n\n## Loading Keypairs from Files\n\nFor local development, testing, and CLI tools, loading Solana keypairs from JSON files on your\nfilesystem is often the most convenient approach. The Solana CLI (Command Line Interface) stores\nkeypairs as JSON files by default, making this method seamlessly compatible with existing Solana\ntooling.\n\nFile-based keypair loading is ideal for:\n\n- **Local development** - Working on your laptop or development machine\n- **Solana CLI integration** - Using keypairs generated with `solana-keygen`\n- **CLI tools and scripts** - Node.js or Bun scripts that interact with Solana\n- **Testing and debugging** - Quick iteration without managing environment variables\n\nThe keypair files contain a JSON array of 64 bytes (numbers from 0-255) representing the full\nkeypair.\n\n### Using the Default Solana CLI Path\n\nBy default, `loadKeypairSignerFromFile()` loads the keypair from the default Solana CLI keypair path\n(`~/.config/solana/id.json`):\n\n```ts twoslash\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\nconst signer = await loadKeypairSignerFromFile();\n\nconsole.log(\"Loaded signer:\", signer.address);\n```\n\n### Using a Custom File Path\n\nYou can also specify a custom path to load keypairs from other locations:\n\n```ts twoslash\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\nconst signer = await loadKeypairSignerFromFile(\"./my-keypair.json\");\n\nconsole.log(\"Loaded signer:\", signer.address);\n```\n\nThe file should contain a JSON array of 64 numbers (the standard Solana CLI format):\n\n```json\n[123, 45, 67, 89, ...]\n```\n\n<Callout type=\"info\">\n  The `loadKeypairSignerFromFile()` function supports tilde (`~`) expansion in file paths, so you\n  can use paths like `~/wallets/my-keypair.json`.\n</Callout>\n\n## Saving Keypairs to Files\n\nWhen building CLI tools, development scripts, or testing utilities, you may need to generate new\nSolana keypairs and save them as JSON files on your local filesystem. The\n`saveKeypairSignerToFile()` function makes this easy by creating Solana CLI-compatible keypair files\nthat can be used across your development workflow.\n\nCommon use cases for saving keypairs to files include:\n\n- **Generating test wallets** - Creating throwaway keypairs for development and testing on\n  devnet/testnet\n- **CLI tool development** - Building tools that need to create and manage multiple wallets\n- **Development automation** - Scripts that set up local development environments\n- **Backup and portability** - Creating keypair files that can be easily copied or backed up\n\n<Callout type=\"error\">\n  **Important Security Consideration**: Only [**extractable**\n  keypairs](/docs/getting-started/signers#generating-extractable-keypairs-and-signers) can be saved\n  to files or environment variables. Regular keypairs generated with `generateKeyPairSigner()` are\n  **non-extractable** by design for security reasons - the private key material is locked in memory\n  and cannot be exported. To save a keypair, you must use `generateExtractableKeyPairSigner()`\n  instead.\n</Callout>\n\n### Generating and Saving an Extractable Keypair\n\n```ts twoslash\nimport { generateExtractableKeyPairSigner } from \"gill\";\nimport { saveKeypairSignerToFile } from \"gill/node\";\n\n// Generate an extractable keypair\nconst signer = await generateExtractableKeyPairSigner();\n\nconsole.log(\"Generated signer:\", signer.address);\n\n// Save to a JSON file\nconst saved = await saveKeypairSignerToFile(signer, \"./my-new-keypair.json\");\n\nif (saved) {\n  console.log(\"Keypair saved successfully!\");\n}\n```\n\nThe function validates the save by attempting to reload the file, returning `true` if successful.\n\n<Callout type=\"info\">\n  The file path must end with `.json` extension. The function will create the file if it doesn't\n  exist, or overwrite it if it does.\n</Callout>\n\n## Best Practices\n\n### Development vs Production\n\n- **Development**: Use `loadKeypairSignerFromFile()` to load from the Solana CLI default path or\n  project-specific files\n- **Production**: Use `loadKeypairSignerFromEnvironment()` or\n  `loadKeypairSignerFromEnvironmentBase58()` to load from environment variables\n\n### Security Considerations\n\n<Callout type=\"error\">\n  Never commit keypair files or `.env` files containing private keys to version control. Add them to\n  your `.gitignore` file immediately.\n</Callout>\n\nHere are some security best practices:\n\n1. **Use extractable keypairs only when necessary**: Regular (non-extractable) keypairs are more\n   secure because the private key material cannot be extracted from memory. Only use extractable\n   keypairs when you actually need to save or export them.\n\n2. **Protect your files**: If you must store keypairs in files, ensure they have appropriate file\n   permissions (e.g., `chmod 600` on Unix systems).\n\n3. **Use environment variables in production**: Environment variables are generally more secure than\n   files for production deployments, as they don't persist on disk and can be managed by secret\n   management systems.\n\n4. **Rotate keys regularly**: Implement a key rotation strategy, especially for production systems.\n\n5. **Use secret management services**: For production environments, consider using dedicated secret\n   management services like AWS Secrets Manager, Google Secret Manager, or HashiCorp Vault instead\n   of plain environment variables.\n\n### Common Patterns\n\nHere's a typical pattern for a backend service that works in both development and production:\n\n```ts twoslash\nimport { loadKeypairSignerFromFile, loadKeypairSignerFromEnvironment } from \"gill/node\";\n\n// Load keypair based on environment\nconst signer =\n  process.env.NODE_ENV === \"production\"\n    ? await loadKeypairSignerFromEnvironment(\"KEYPAIR\")\n    : await loadKeypairSignerFromFile(); // Uses Solana CLI default\n\nconsole.log(\"Loaded signer for\", process.env.NODE_ENV, \":\", signer.address);\n```\n\n## Related Functions\n\nIf you need to work with raw `CryptoKeyPair` objects instead of `KeyPairSigner` objects, the\nfollowing functions are also available:\n\n- `loadKeypairFromFile()` - Returns `CryptoKeyPair`\n- `loadKeypairFromEnvironment()` - Returns `CryptoKeyPair`\n- `loadKeypairFromEnvironmentBase58()` - Returns `CryptoKeyPair`\n- `saveKeypairToFile()` - Accepts `CryptoKeyPair`\n- `saveKeypairToEnvFile()` - Accepts `CryptoKeyPair`\n\nThe `*Signer` variants are recommended for most use cases as they return ready-to-use signers for\ntransactions.\n"
  },
  {
    "path": "docs/content/docs/guides/meta.json",
    "content": "{\n  \"title\": \"Guides\",\n  \"pages\": [\"tokens\", \"...\"]\n}\n"
  },
  {
    "path": "docs/content/docs/guides/reference-keys.mdx",
    "content": "---\ntitle: Reference Keys\ndescription: \"Guide on how to insert reference keys into Solana transactions.\"\n---\n\nOn Solana, a \"reference key\" is a unique, single-use, non-signer address that is put inside of a\ntransaction in order to track its completion on the network. This is a common technique used within\nthe [Solana Pay](https://docs.solanapay.com/spec#reference) and\n[Blockchain Link (Blink)](https://solana.com/solutions/actions) specifications.\n\nUntil a Solana transaction is signed by the \"fee payer\", it does not have a signature; making it\ndifficult to determine if and when the transaction has landed on-chain. Inserting a reference key\ninto the transaction allows developers to programmatically call the\n[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress) RPC method to\ndetermine if the transaction has landed. Triggering any desired business logic in their application.\n\n## Add a reference key to a transaction\n\nInserting a reference key inside of a transaction can be accomplished by adding the desired address\nas a \"non-signer\" account key in any supporting instruction.\n\nWithin gill, there are two functions for inserting reference keys:\n\n1. `insertReferenceKeyToTransactionMessage()` - insert just one reference key\n2. `insertReferenceKeysToTransactionMessage()` - insert multiple reference keys\n\nUnder the hood, these \"insert reference key\" functions search the instructions inside the\ntransaction and manually inserts the reference key address as a non-signer on the\n[first supported instruction](#program-errors-due-to-reference-keys).\n\nThe following is an example of constructing a transaction using the `createTransaction()` then\ninserting the reference key using the \"pipe method\". This is the most recommended way to perform\nthis:\n\n```ts twoslash\n// @noErrors\nimport {\n  pipe,\n  createTransaction,\n  generateKeyPairSigner,\n  insertReferenceKeysToTransactionMessage,\n} from \"gill\";\n\n// generate a reference key address\nconst { address: reference } = await generateKeyPairSigner();\n\nconst transaction = pipe(\n  createTransaction({\n    version: \"legacy\",\n    feePayer: signer,\n    instructions: [\n      getAddMemoInstruction({\n        memo: \"gm world!\",\n      }),\n    ],\n    latestBlockhash,\n    // setting a CU limit ensures there is at least one non-memo instruction\n    computeUnitLimit: 5000,\n  }),\n  (tx) => insertReferenceKeysToTransactionMessage([reference], tx),\n);\n```\n\nThe above transaction will have two instructions in it:\n\n1. SPL memo instruction (via the `getAddMemoInstruction` function)\n2. compute unit limit instruction (via the `computeUnitLimit` value)\n\n<Callout type=\"warn\" title=\"At least one non-memo instruction is required\">\n  To insert a reference key into a transaction, the transaction **must** have at least one non-memo\n  instruction. See [Program errors due to reference keys](#program-errors-due-to-reference-keys)\n  below for details.\n</Callout>\n\nThis transaction can be signed and sent to the network. Then anyone can\n[monitor for the reference key](#monitoring-for-a-reference-key) and trigger their desired business\nlogic.\n\n### Add to an existing transaction\n\nIf your application is not directly creating the transaction, like when consuming external APIs, you\ncan still add a reference key to the transaction.\n\nFirst fetch the transaction from your desired external source, then insert the reference key as\nfollows:\n\n```ts twoslash\n// @noErrors\nimport {\n  createTransaction,\n  generateKeyPairSigner,\n  insertReferenceKeysToTransactionMessage\n} from \"gill\";\n\n// note: `transaction` is mutable here so we can modify it later to insert the reference key\nlet { transaction } = await fetchTransactionFromExternalSource(...);\n\n// ... [your other business logic here]\n\n// generate a reference key address\nconst { address: reference } = await generateKeyPairSigner();\n\ntransaction = insertReferenceKeysToTransactionMessage([reference], transaction);\n```\n\n<Callout type=\"warn\" title=\"Notice for already signed transactions\">\n  If the transaction obtained from an external source or API is already signed, you cannot modify\n  the transaction to insert a reference key. Your only option is to wipe the existing signatures,\n  insert the reference key, and resign. Or encourage your external API provider to accept a\n  reference key input to their API endpoints that return signed transactions.\n</Callout>\n\nThis transaction can be signed and sent to the network. Then anyone can\n[monitor for the reference key](#monitoring-for-a-reference-key) and trigger their desired business\nlogic.\n\n## Program errors due to reference keys\n\nSome programs on the Solana network do not allow adding additional non-signer accounts due to the\nway they are coded. Often times, these programs expect all provided account keys to be writable or a\nsigner. If they receive additional or unexpected accounts, they will error.\n\nAs such, gill's \"insert reference key\" functions attempt to prevent these errors by skipping\ninstructions from these programs. The following programs are known to fall into this condition and\nare skipped when inserting reference keys:\n\n- `MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr` - SPL memo program\n\n<Callout title=\"Know of another program?\">\n  If you locate another commonly used program that results in errors due to inserting additional\n  account keys, please [open an\n  issue](https://github.com/gillsdk/gill/issues?title=%5BReference%20Key%20Program%5D%20) and share\n  with the community.\n</Callout>\n\n## Monitoring for a reference key\n\nAfter a reference key has been inserted into a transaction, and that transaction is expected to have\nbeen signed then sent to the network for confirmation, you use the\n[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress) RPC method to\ndetermine if the transaction has been confirmed.\n\nUsing gill's `getOldestSignatureForAddress()` function, we can easily fetch the oldest signature\nthat includes the reference key. If the reference key is not found, it will throw an error.\n\n```ts twoslash\n// @noErrors\nimport { createSolanaClient, address, getOldestSignatureForAddress } from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst reference = address(\"...\");\n\ntry {\n  const { signature } = await getOldestSignatureForAddress(rpc, reference);\n\n  const transaction = await rpc.getTransaction(signature).send();\n\n  // ... [validate the `transaction` performed the expected actions on-chain]\n\n  // perform business logic for a successful transaction\n} catch (err) {\n  // handle errors\n}\n```\n\n<Callout type=\"warn\">\n  While you can utilize the raw response from the `getSignaturesForAddress` RPC method, your\n  application will need to manually handle recursively fetching signatures until you locate the\n  oldest one (i.e. the only one we care about).\n</Callout>\n\nYour application can then fetch and process the transaction with the signature returned by\n`getOldestSignatureForAddress()`, validating the transaction is as expected.\n\nAfter your application validates the oldest transaction accomplishes the expected on-chain actions\n(e.g. correct token balance changes, etc), you can proceed with any of your \"success case\" business\nlogic and handle errors accordingly.\n\n### Security concerns\n\n<Callout type=\"error\" title=\"Reference keys can be easily spoofed in transactions\">\n  Due to the architecture of Solana transactions, reference keys can be easily spoofed inside of\n  transactions (i.e. anyone can insert them into transactions). Just because your reference key was\n  located in a confirmed transaction, does **NOT** mean the transaction is what you expect it to be.\n</Callout>\n\nIt is crucially important that your application validates the transaction associated with the oldest\nsignature obtained. Otherwise, your application can be vulnerable to various attacks.\n"
  },
  {
    "path": "docs/content/docs/guides/solana-pay.mdx",
    "content": "---\ntitle: Solana Pay\ndescription: \"Guide on how to utilize the Solana Pay protocol using the gill sdk.\"\n---\n\nSolana Pay is a standardized protocol for encoding transaction requests within URLs, enabling\npayments and other blockchain interactions across the Solana ecosystem. The protocol supports both\nsimple transfer requests for direct payments and interactive \"transaction requests\" for more complex\nuse cases like merchant checkouts or scenarios where you need a non-user controlled keypair to\npre-sign a transaction.\n\nThe gill SDK provides a complete, type-safe implementation of the\n[Solana Pay specification](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md) with\ncomprehensive validation and error handling. This guide covers how to create, parse, and validate\nSolana Pay URLs using [`@gillsdk/solana-pay`](https://www.npmjs.com/package/@gillsdk/solana-pay).\n\n## Request Types\n\nSolana Pay supports two distinct request types, each suited for different use cases:\n\n**Transfer Requests:**\n\n- Non-interactive request for SOL or SPL token transfer\n- All payment details encoded directly in the URL\n- Wallet constructs and submits transaction immediately\n- Best for simple payments, invoices, and QR code payments\n- No server infrastructure required\n\n```text\nsolana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.5&label=Coffee+Shop\n```\n\n**Transaction Requests:**\n\n- Interactive, multi-step checkout flow\n- URL points to an HTTPS endpoint that provides transaction details\n- Requires GET request for merchant info, then POST request for transaction\n- Best for complex transactions, server signers, dynamic pricing, and merchant integrations\n- Requires server-side implementation and HTTPS\n\n```\nsolana:https://checkout.usedecal.com/api/solana-pay-transaction\n```\n\n## Install the Solana Pay SDK\n\nThis guide requires both the `gill` SDK and the\n[`@gillsdk/solana-pay`](https://www.npmjs.com/package/@gillsdk/solana-pay) package.\n\n```package-install\ngill @gillsdk/solana-pay\n```\n\n## Transfer Requests\n\nTransfer requests are non-interactive URLs that encode all SOL or SPL token transfer details\ndirectly in the URL parameters. When a wallet app scans or receives a transfer request URL, it can\nconstruct and submit the transaction without any additional network requests.\n\n<Callout>\n  \nThe Solana Pay Transfer Request's `amount` parameter is used to denote how many tokens are\nrequested in the transfer transaction. Crucially, this `amount` is the UI amount (aka\nhuman-readable amount), not the raw blockchain amount.\n\n- For SOL, this means SOL (not lamports)\n- For SPL tokens, this means the token's display amount (not the raw token amount)\n\n</Callout>\n\n### Basic SOL Transfer\n\nThe simplest transfer request specifies only a recipient address:\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\nconst url = encodeSolanaPayURL({ recipient });\n// → \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\"\n```\n\nTo specify a specific amount of tokens to be transferred by the user, add the `amount` parameter.\nThe `amount` field is the UI amount (human-readable amount), not the raw blockchain amount. For SOL,\nthis means SOL (not lamports). For SPL tokens, this means the token's display amount (not the raw\ntoken amount).\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\n// Request 1.5 SOL\nconst url = encodeSolanaPayURL({\n  recipient,\n  amount: 1.5,\n});\n// → \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.5\"\n```\n\n### SPL Token Transfers\n\nTo request a token transfer instead of SOL, specify the `splToken` parameter with the token mint\naddress. The `amount` is still the UI amount based on the token's decimals (not the raw token\namount).\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconst usdcMint = address(\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\");\n\n// Request 100 USDC\nconst url = encodeSolanaPayURL({\n  recipient,\n  amount: 100,\n  splToken: usdcMint,\n});\n```\n\nWhen `splToken` is specified, the wallet will create a token transfer instruction using the\nAssociated Token Account convention.\n\n### Reference Keys\n\nReference keys enable transaction tracking by including one or more public keys as read-only keys in\nthe transaction. This allows you to query for specific transactions using the\n`getSignaturesForAddress` RPC method.\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconst referenceKey = address(\"Href9m18T7a9TKgS21e9Y9Aa1yce1Sw3TjXbRJ9Exm5P\");\n\nconst url = encodeSolanaPayURL({\n  recipient,\n  amount: 1,\n  reference: referenceKey,\n});\n```\n\nYou can include multiple reference keys by passing an array:\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconst ref1 = address(\"Href9m18T7a9TKgS21e9Y9Aa1yce1Sw3TjXbRJ9Exm5P\");\nconst ref2 = address(\"2nT8kNX7YvTBMekVWKqpRdDKQ7z9r8FVq4VNSS3bH4Qo\");\n\nconst url = encodeSolanaPayURL({\n  recipient,\n  amount: 1,\n  reference: [ref1, ref2],\n});\n```\n\nFor more details on generating and using reference keys, see the\n[Reference Keys guide](/docs/guides/reference-keys).\n\n### Labels, Messages, and Memos\n\nSolana Pay Transfer requests support additional metadata to provide context:\n\n- **label**: Describes the source of the request (e.g., merchant name)\n- **message**: Describes the nature of the transfer (e.g., what's being purchased)\n- **memo**: Text included in an SPL Memo instruction in the transaction\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst recipient = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconst usdcMint = address(\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\");\n\nconst url = encodeSolanaPayURL({\n  recipient,\n  amount: 9.67,\n  label: \"Coffee Shop\",\n  message: \"Payment for espresso and croissant\",\n  memo: \"Order #12345\",\n  splToken: usdcMint,\n});\n```\n\n<Callout type=\"warn\">\n  Memo data is recorded publicly onchain and should not contain sensitive information.\n</Callout>\n\n## Transaction Requests\n\nTransaction requests are interactive URLs that point to an HTTPS endpoint. Unlike transfer requests,\ntransaction requests require the wallet app to make HTTP requests to fetch transaction details from\na server.\n\n### Creating Transaction Request URLs\n\nTransaction requests require an HTTPS URL and optionally include `label` and `message` metadata:\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\n\nconst url = encodeSolanaPayURL({\n  link: new URL(\"https://merchant.example.com/checkout\"),\n  label: \"Example Merchant\",\n  message: \"Purchase item #42\",\n});\n// → \"solana:https%3A%2F%2Fmerchant.example.com%2Fcheckout?label=Example+Merchant&message=Purchase+item+%2342\"\n```\n\n<Callout type=\"error\">\n  Transaction request links MUST use HTTPS. The `@gillsdk/solana-pay` SDK validates this requirement\n  and will throw an error for non-HTTPS URLs.\n</Callout>\n\nIf your link includes query parameters, they will be properly URL-encoded:\n\n```ts twoslash\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\n\nconst url = encodeSolanaPayURL({\n  link: new URL(\"https://merchant.example.com/api?item=123&quantity=2\"),\n});\n```\n\n### Fetching Merchant Information (GET Request)\n\nWhen a wallet receives a transaction request URL, it first makes a GET request to fetch the\nmerchant's label and icon:\n\n```ts twoslash\nimport { solanaPayTransactionRequest } from \"@gillsdk/solana-pay\";\n\nconst response = await solanaPayTransactionRequest.get(new URL(\"https://merchant.example.com/api\"));\n\nconsole.log(response.label); // \"Example Merchant\"\nconsole.log(response.icon); // \"https://merchant.example.com/icon.svg\"\n```\n\nThe icon URL must point to an SVG, PNG, WebP, JPG, or JPEG file.\n\n### Requesting a Transaction (POST Request)\n\nAfter displaying the merchant information to the user, the wallet makes a POST request with the\nuser's account to receive the transaction to sign:\n\n```ts\nimport { solanaPayTransactionRequest } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\nconst userAccount = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\n\nconst response = await solanaPayTransactionRequest.post(\n  new URL(\"https://merchant.example.com/api\"),\n  { account: userAccount },\n);\n\nconst transaction = response.transaction;\nconst message = response.message; // Optional message to display\n```\n\nThe underlying response contains a base64-encoded transaction that the wallet will present to the\nuser for signing. The `@gillsdk/solana-pay` sdk will automatically decode and deserialize this\ntransaction from a `string` to a ready to sign `Transaction`.\n\n## Parsing Solana Pay URLs\n\nThe `parseSolanaPayURL` function parses any Solana Pay URL and returns the appropriate typed\nstructure:\n\n```ts twoslash\nimport { parseSolanaPayURL } from \"@gillsdk/solana-pay\";\n\nconst url = \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1\";\nconst parsed = parseSolanaPayURL(url);\n\n// Use a type guard to determine the request type\nif (\"link\" in parsed) {\n  // Transaction request\n  const { link, label, message } = parsed;\n  console.log(\"Transaction request to:\", link.href);\n} else {\n  // Transfer request\n  const { recipient, amount, splToken, reference, label, message, memo } = parsed;\n  console.log(\"Transfer request for:\", amount, \"to\", recipient);\n}\n```\n\nThe parser automatically validates the URL format and throws a `SolanaPayParseURLError` if the URL\nis invalid.\n\n## Response Validation\n\nFor advanced use cases where you need to manually validate API responses, the SDK provides\nvalidation functions:\n\n### Validating GET Responses\n\n```ts twoslash\nimport { parseSolanaPayGetResponse } from \"@gillsdk/solana-pay\";\n\nconst data = await fetch(\"https://merchant.example.com/api\").then((r) => r.json());\nconst validated = parseSolanaPayGetResponse(data);\n// Ensures data has required 'label' and 'icon' fields with correct formats\n```\n\n### Validating POST Responses\n\n```ts twoslash\nimport { parseSolanaPayPostResponse } from \"@gillsdk/solana-pay\";\n\nconst data = await fetch(\"https://merchant.example.com/api\", {\n  method: \"POST\",\n  body: JSON.stringify({ account: \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" }),\n}).then((r) => r.json());\n\nconst validated = parseSolanaPayPostResponse(data);\n// Ensures data has required 'transaction' field and optional 'message'\n```\n\nBoth functions throw a `SolanaPayResponseError` if validation fails.\n\n<Callout title=\"Security Considerations\">\nThe gill SDK enforces several security measures:\n\n- **HTTPS Requirement**: Transaction request links must use HTTPS to prevent man-in-the-middle\n  attacks\n- **URL Length Validation**: URLs are limited to 2048 characters\n- **Comprehensive Input Validation**: All addresses, amounts, and other parameters are validated\n  before encoding\n- **Transaction Validation**: Wallets should validate all transaction details before prompting the\n  user to sign\n\nAlways validate transactions received from untrusted sources and never sign transactions without\nuser review.\n\n</Callout>\n\n## Summary\n\nThe `@gillsdk/solana-pay` package provides everything needed to implement Solana Pay in your\napplication:\n\n- **Transfer Requests**: Create payment URLs for SOL and SPL tokens with optional reference tracking\n- **Transaction Requests**: Build interactive checkout flows with HTTPS endpoints\n- **URL Parsing**: Parse and validate any Solana Pay URL with full type safety\n- **Response Handling**: Fetch and validate merchant information and transactions\n\nFor more information on the Solana Pay protocol, refer to the\n[official specification](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md).\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/burn-tokens.mdx",
    "content": "---\ntitle: Burn Tokens\ndescription: Learn how to burn tokens from a wallet using the gill JavaScript library.\n---\n\nBurning tokens permanently removes them from circulation by destroying them from a wallet's\nAssociated Token Account (ATA). The token account `authority` (owner) must sign the transaction to\nauthorize the burn.\n\nThis guide demonstrates how to burn tokens using the\n[`gill` package](https://www.npmjs.com/package/gill) with the `getBurnCheckedInstruction` from\n`gill/programs`.\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\nimport { PackageBadges } from \"@/components/package-badges\";\n\n<PackageBadges packageName=\"gill\" />\n\n## Create an RPC connection\n\nIn order to send transactions and/or fetch data from the Solana blockchain, you will need a client\nconnection. You can easily create a Solana client connection using the `createSolanaClient()`\nfunction.\n\nThe `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or\na full URL of your RPC provider.\n\n```ts twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\", // `mainnet`, `localnet`, etc\n});\n```\n\n<Callout title=\"Public RPC endpoints are subject to rate limits\">\n  Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\n  and should not be used in production applications. Applications should find their own RPC provider\n  and the URL provided from them.\n</Callout>\n\n## Prepare a Signer\n\nEvery Solana transaction requires at least one \"signer\" to be the fee payer for the transaction.\nWhen burning tokens, the `authority` (the token account owner) must also be a signer to authorize\nthe burn.\n\n### Load a signer from a local keypair file\n\nFor backend scripts and some server environments, you can load a signer from your local filesystem:\n\n```ts twoslash\nimport { type KeyPairSigner } from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\n// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\nconst signer: KeyPairSigner = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n```\n\n## Understanding token amounts\n\nWhen burning tokens, the `amount` you provide is in raw base units, not human-readable units. The\nconversion depends on the `decimals` value of your token mint.\n\nFor example, if your token has `decimals = 9` (the most common for fungible tokens):\n\n- `1_000_000_000` (1e9) = **1 token**\n- `5_000_000_000` (5e9) = **5 tokens**\n- `1_000_000` (1e6) = **0.001 tokens**\n\n<Callout title=\"Decimals matter\">\n  With `decimals = 9`, to burn **100 tokens** you would set `amount` to `100_000_000_000` (100e9).\n  With `decimals = 6`, to burn **100 tokens** you would set `amount` to `100_000_000` (100e6).\n  Always check your token's decimals to calculate the correct raw amount.\n</Callout>\n\n## Build the burn transaction\n\nTo burn tokens, use the `getBurnCheckedInstruction()` from `gill/programs`. This is the recommended\nburn instruction because it validates the token's decimals for safety.\n\nFirst, derive the ATA for the wallet that holds the tokens to burn:\n\n```ts\nimport { getAssociatedTokenAccountAddress } from \"gill/programs\";\n\nconst ata = await getAssociatedTokenAccountAddress(mint, signer.address);\n```\n\nThen create the burn instruction and build the transaction:\n\n```ts\nimport { createTransaction } from \"gill\";\nimport { getBurnCheckedInstruction } from \"gill/programs\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst burnIx = getBurnCheckedInstruction({\n  account: ata,\n  mint,\n  authority: signer,\n  amount: 1_000_000_000, // 1 token (with decimals=9)\n  decimals: 9,\n});\n\nconst transaction = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions: [burnIx],\n  latestBlockhash,\n});\n```\n\nWhere `mint` is the address of the token mint and `signer` is the owner of the token account.\n\n## Sign and send the transaction\n\nWith your transaction fully created, you can now sign and send it:\n\n```ts\nimport {\n  signTransactionMessageWithSigners,\n  getSignatureFromTransaction,\n  getExplorerLink,\n} from \"gill\";\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n```\n\nIf your transaction is already fully signed or has all signers available, you can send and confirm\nit on the blockchain:\n\n```ts\nawait sendAndConfirmTransaction(signedTransaction);\n```\n\n<Callout title=\"Pro Tip\">\n  If you do not need to know the transaction signature prior to sending the transaction AND all\n  signers are attached to the transaction, you can pass a fully signable transaction to the\n  `sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then\n  perform the signing operations prior to sending and confirming.\n</Callout>\n\n## Using Token Extensions (Token22)\n\nIf your token was created with the Token Extensions program (Token22), pass the `programAddress` in\nthe config to `getBurnCheckedInstruction()` and the `tokenProgram` to\n`getAssociatedTokenAccountAddress()`:\n\n```ts\nimport {\n  TOKEN_2022_PROGRAM_ADDRESS,\n  getAssociatedTokenAccountAddress,\n  getBurnCheckedInstruction,\n} from \"gill/programs\";\n\nconst ata = await getAssociatedTokenAccountAddress(\n  mint,\n  signer.address,\n  TOKEN_2022_PROGRAM_ADDRESS,\n);\n\nconst burnIx = getBurnCheckedInstruction(\n  {\n    account: ata,\n    mint,\n    authority: signer,\n    amount: 1_000_000_000,\n    decimals: 9,\n  },\n  { programAddress: TOKEN_2022_PROGRAM_ADDRESS },\n);\n```\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/create-token.mdx",
    "content": "---\ntitle: Create a Token with Metadata\ndescription:\n  Learn how to create a new Solana token, with metadata, using the gill JavaScript library.\n---\n\nTokens are digital assets that represent ownership over diverse categories of assets. Tokenization\nenables the digitalization of property rights. Tokens on Solana are referred to as SPL\n([Solana Program Library](https://github.com/solana-program)) Tokens.\n\nThis article will demonstrate [how to create a new SPL token](./create-token) using the\n[`gill` package](https://www.npmjs.com/package/gill), including attaching metadata to the token for\nusers to see and applications to display.\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\nimport { PackageBadges } from \"@/components/package-badges\";\n\n<PackageBadges packageName=\"gill\" />\n\n## Create an RPC connection\n\nIn order to send transactions and/or fetch data from the Solana blockchain, you will need an client\nconnection. You can easily create a Solana client connection using the `createSolanaClient()`\nfunction.\n\nThe `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or\na full URL of your RPC provider.\n\n```ts twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\", // `mainnet`, `localnet`, etc\n});\n```\n\n<Callout title=\"Public RPC endpoints are subject to rate limits\">\n  Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\n  and should not be used in production applications. Applications should find their own RPC provider\n  and the URL provided from them.\n</Callout>\n\n## Prepare a Signer\n\nEvery Solana transaction requires at least one \"signer\" to be the fee payer for the transaction. The\nfollowing are common practices:\n\n- load a signer from a local keypair file (like `~/.config/solana/id.json`, the one used by the\n  Solana CLI)\n- loading the signer from an ENV variable (e.g. `process.env.SERVER_SIGNER`)\n- having a user's wallet be the signer via a front end application\n\n### Load a signer from a local keypair file\n\nFor backend scripts and some server environments, you can load a signer from your local filesystem:\n\n```ts twoslash\nimport { type KeyPairSigner } from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\n// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\nconst signer: KeyPairSigner = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n```\n\n## Decide which Token Program to use\n\nTo use the legacy Token Program:\n\n```ts twoslash\nimport { TOKEN_PROGRAM_ADDRESS } from \"gill/programs\";\n\nconst tokenProgram = TOKEN_PROGRAM_ADDRESS;\n```\n\nTo use the Token Extensions Program (aka Token22):\n\n```ts twoslash\nimport { TOKEN_2022_PROGRAM_ADDRESS } from \"gill/programs\";\n\nconst tokenProgram = TOKEN_2022_PROGRAM_ADDRESS;\n```\n\n## Generate a Mint and metadata address\n\n```ts twoslash\nimport { generateKeyPairSigner } from \"gill\";\n\nconst mint = await generateKeyPairSigner();\n```\n\nIf you are using the legacy Token Program, you will need to derive the \"metadata address\" from\nMetaplex's Token Metadata program.\n\n```ts twoslash\nimport { generateKeyPairSigner } from \"gill\";\nimport { getTokenMetadataAddress } from \"gill/programs\";\n\nconst mint = await generateKeyPairSigner();\nconst metadataAddress = await getTokenMetadataAddress(mint);\n```\n\n## Get the latest blockhash\n\n```ts\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\n## Create a transaction that creates a token\n\n<Callout>\n  Instead of manually crafting all of these instructions, you can also use gill's instruction\n  builder function: `getCreateTokenInstructions()`\n</Callout>\n\n```ts\nimport { createTransaction } from \"gill\";\nimport { getMintSize } from \"gill/programs\";\n\nconst space = getMintSize();\n\nconst transaction = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions: [\n    getCreateAccountInstruction({\n      space,\n      lamports: getMinimumBalanceForRentExemption(space),\n      newAccount: mint,\n      payer: signer,\n      programAddress: tokenProgram,\n    }),\n    getInitializeMintInstruction(\n      {\n        mint: mint.address,\n        mintAuthority: signer.address,\n        freezeAuthority: signer.address,\n        decimals: 9,\n      },\n      {\n        programAddress: tokenProgram,\n      },\n    ),\n    getCreateMetadataAccountV3Instruction({\n      collectionDetails: null,\n      isMutable: true,\n      updateAuthority: signer,\n      mint: mint.address,\n      metadata: metadataAddress,\n      mintAuthority: signer,\n      payer: signer,\n      data: {\n        sellerFeeBasisPoints: 0,\n        collection: null,\n        creators: null,\n        uses: null,\n        name: \"super sweet token\",\n        symbol: \"SST\",\n        uri: \"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json\",\n      },\n    }),\n  ],\n  latestBlockhash,\n});\n```\n\n## Sign and send the transaction\n\nWith your transaction fully created, you can now sign the transaction to\n\n```ts\nimport { signTransactionMessageWithSigners } from \"gill\";\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n```\n\nIf your transaction is already fully signed or has all signer's available, you can send and confirm\nit on the blockchain.\n\n```ts\nawait sendAndConfirmTransaction(signedTransaction);\n```\n\n<Callout title=\"Pro Tip\">\n  If you do not need to know the transaction signature prior to sending the transaction AND you all\n  signers are attached to the transaction, you can pass a fully signable transaction to the\n  `sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then\n  perform the signing operations prior to sending and confirming.\n</Callout>\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/get-token-metadata.mdx",
    "content": "---\ntitle: Get Token Metadata\ndescription:\n  Learn how to read and parse token metadata from the Solana blockchain using the gill JavaScript\n  library.\n---\n\nEvery Solana token can have metadata associated with it, including a name, symbol, URI pointing to\noff-chain data, and more. The approach to reading this metadata depends on which token program was\nused to create the token:\n\n- **Token Metadata Program (legacy):** Metadata lives in a separate PDA account managed by the\n  Metaplex Token Metadata program.\n- **Token Extensions (Token22):** Metadata is stored inline on the mint account as an extension.\n\nThis guide demonstrates how to fetch token metadata using the\n[`gill` package](https://www.npmjs.com/package/gill), covering both approaches.\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\nimport { PackageBadges } from \"@/components/package-badges\";\n\n<PackageBadges packageName=\"gill\" />\n\n## Create an RPC connection\n\nIn order to fetch data from the Solana blockchain, you will need a client connection. You can easily\ncreate a Solana client connection using the `createSolanaClient()` function.\n\nThe `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or\na full URL of your RPC provider.\n\n```ts twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({\n  urlOrMoniker: \"mainnet\", // `devnet`, `localnet`, etc\n});\n```\n\n<Callout title=\"Public RPC endpoints are subject to rate limits\">\n  Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\n  and should not be used in production applications. Applications should find their own RPC provider\n  and the URL provided from them.\n</Callout>\n\n## Token Metadata Program (legacy tokens)\n\nFor tokens created with the original Token Program and the Metaplex Token Metadata program, metadata\nis stored in a separate PDA account derived from the token's mint address.\n\n### Derive the metadata address\n\nUse `getTokenMetadataAddress()` from `gill/programs` to derive the metadata PDA from the mint\naddress:\n\n```ts\nimport { address } from \"gill\";\nimport { getTokenMetadataAddress } from \"gill/programs\";\n\nconst mint = address(\"So11111111111111111111111111111111111111112\");\n\nconst metadataAddress = await getTokenMetadataAddress(mint);\n```\n\n### Fetch the metadata account\n\nUse `fetchMetadata()` from `gill/programs` to fetch and decode the metadata account:\n\n```ts\nimport { fetchMetadata } from \"gill/programs\";\n\nconst metadata = await fetchMetadata(rpc, metadataAddress);\n\nconsole.log(\"Name:\", metadata.data.name);\nconsole.log(\"Symbol:\", metadata.data.symbol);\nconsole.log(\"URI:\", metadata.data.uri);\nconsole.log(\"Seller fee:\", metadata.data.sellerFeeBasisPoints);\nconsole.log(\"Creators:\", metadata.data.creators);\n```\n\nThe metadata account also contains additional fields:\n\n```ts\nconsole.log(\"Update authority:\", metadata.updateAuthority);\nconsole.log(\"Is mutable:\", metadata.isMutable);\nconsole.log(\"Collection:\", metadata.collection);\nconsole.log(\"Token standard:\", metadata.tokenStandard);\n```\n\n<Callout title=\"Use fetchMaybeMetadata for optional lookups\">\n  If you are unsure whether a metadata account exists for a given mint, use `fetchMaybeMetadata()`\n  instead. It returns `null` if the account does not exist, rather than throwing an error.\n</Callout>\n\n```ts\nimport { fetchMaybeMetadata } from \"gill/programs\";\n\nconst maybeMeta = await fetchMaybeMetadata(rpc, metadataAddress);\n\nif (maybeMeta.exists) {\n  console.log(\"Name:\", maybeMeta.data.name);\n} else {\n  console.log(\"No metadata account found\");\n}\n```\n\n## Token Extensions (Token22)\n\nFor tokens created with the Token Extensions program (Token22), metadata can be stored directly on\nthe mint account as an extension. No separate PDA is needed.\n\n### Fetch the mint account\n\nUse `fetchMint()` from `gill/programs` to fetch the mint account, which includes any extensions:\n\n```ts\nimport { address } from \"gill\";\nimport { fetchMint } from \"gill/programs\";\n\nconst mint = address(\"your-token22-mint-address\");\n\nconst mintAccount = await fetchMint(rpc, mint);\n```\n\n### Find the TokenMetadata extension\n\nThe mint account's `extensions` array contains all enabled extensions. Use the `isExtension()` type\nguard from `gill/programs` to find the `TokenMetadata` extension:\n\n```ts\nimport { fetchMint, isExtension } from \"gill/programs\";\n\nconst mintAccount = await fetchMint(rpc, mint);\nconst tokenMetadata = mintAccount.data.extensions?.find((ext) => isExtension(\"TokenMetadata\", ext));\n\nif (tokenMetadata && tokenMetadata.__kind === \"TokenMetadata\") {\n  console.log(\"Name:\", tokenMetadata.name);\n  console.log(\"Symbol:\", tokenMetadata.symbol);\n  console.log(\"URI:\", tokenMetadata.uri);\n  console.log(\"Update authority:\", tokenMetadata.updateAuthority);\n  console.log(\"Additional metadata:\", tokenMetadata.additionalMetadata);\n}\n```\n\n<Callout title=\"Token22 metadata differences\">\n  Token Extensions metadata includes an `additionalMetadata` field, which is a `Map` of arbitrary\n  key-value string pairs. This is different from the legacy Token Metadata Program, which uses\n  structured fields like `creators` and `collection`.\n</Callout>\n\n## Fetching the off-chain JSON metadata\n\nBoth the legacy Token Metadata Program and Token Extensions store a `uri` field that points to an\noff-chain JSON file. This JSON typically contains the token's image, description, attributes, and\nother rich metadata.\n\nFetching this data is a standard HTTP request, not a Solana RPC call:\n\n```ts\nconst response = await fetch(uri);\nconst offChainMetadata = await response.json();\n\nconsole.log(\"Image:\", offChainMetadata.image);\nconsole.log(\"Description:\", offChainMetadata.description);\n```\n\nThe off-chain JSON format generally follows the\n[Metaplex Token Metadata Standard](https://developers.metaplex.com/token-metadata/token-standard),\nwhich includes fields like `image`, `description`, `attributes`, `external_url`, and more.\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/index.mdx",
    "content": "---\ntitle: Tokens on Solana\ndescription: \"Learn the basics of creating and working with Solana tokens.\"\n---\n\nTokens are digital assets that represent ownership over diverse categories of assets. Tokenization\nenables the digitalization of property rights. Tokens on Solana are referred to as SPL\n([Solana Program Library](https://github.com/solana-program)) Tokens.\n\nThe following guides demonstrate the most common tasks a Solana developer should be familiar with if\nbuilding an application that utilizes tokens.\n\n<Steps>\n\n<Step>\n\n### Create a token with metadata\n\nLearn how to create a new Solana token, with metadata, using either the legacy Token Program or\nToken Extensions program.\n\nRead the full guide here on [how to create an SPL token on Solana](/docs/guides/tokens/create-token)\n\n</Step>\n\n<Step>\n\n### Mint tokens\n\nLearn how to mint new token supply to a wallet using the mint authority, including automatically\ncreating the destination's Associated Token Account.\n\nRead the full guide here on [how to mint tokens on Solana](/docs/guides/tokens/mint-tokens)\n\n</Step>\n\n<Step>\n\n### Get token metadata\n\nLearn how to read and parse token metadata from the Solana blockchain, including both legacy Token\nMetadata Program accounts and Token Extensions (Token22) inline metadata.\n\nRead the full guide here on\n[how to get token metadata on Solana](/docs/guides/tokens/get-token-metadata)\n\n</Step>\n\n<Step>\n\n### Transfer tokens\n\nLearn how to transfer tokens between wallets using the token authority, including automatically\ncreating the destination's Associated Token Account.\n\nRead the full guide here on [how to transfer tokens on Solana](/docs/guides/tokens/transfer-tokens)\n\n</Step>\n\n<Step>\n\n### Burn tokens\n\nLearn how to permanently remove tokens from circulation by burning them from a wallet's Associated\nToken Account.\n\nRead the full guide here on [how to burn tokens on Solana](/docs/guides/tokens/burn-tokens)\n\n</Step>\n\n</Steps>\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/meta.json",
    "content": "{\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",
    "content": "---\ntitle: Mint Tokens\ndescription: Learn how to mint new token supply to a wallet using the gill JavaScript library.\n---\n\nMinting tokens creates new supply of an existing token and sends it to a wallet via its Associated\nToken Account (ATA). Only the mint authority signer can authorize minting new tokens.\n\nThis guide demonstrates how to mint tokens using the\n[`gill` package](https://www.npmjs.com/package/gill), including automatically creating the\ndestination wallet's ATA if it does not already exist.\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\nimport { PackageBadges } from \"@/components/package-badges\";\n\n<PackageBadges packageName=\"gill\" />\n\n## Create an RPC connection\n\nIn order to send transactions and/or fetch data from the Solana blockchain, you will need a client\nconnection. You can easily create a Solana client connection using the `createSolanaClient()`\nfunction.\n\nThe `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or\na full URL of your RPC provider.\n\n```ts twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\", // `mainnet`, `localnet`, etc\n});\n```\n\n<Callout title=\"Public RPC endpoints are subject to rate limits\">\n  Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\n  and should not be used in production applications. Applications should find their own RPC provider\n  and the URL provided from them.\n</Callout>\n\n## Prepare a Signer\n\nEvery Solana transaction requires at least one \"signer\" to be the fee payer for the transaction.\nWhen minting tokens, the `mintAuthority` must also be a signer to authorize the mint.\n\n### Load a signer from a local keypair file\n\nFor backend scripts and some server environments, you can load a signer from your local filesystem:\n\n```ts twoslash\nimport { type KeyPairSigner } from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\n// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\nconst signer: KeyPairSigner = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n```\n\n## Understanding token amounts\n\nWhen minting tokens, the `amount` you provide is in raw base units, not human-readable units. The\nconversion depends on the `decimals` value of your token mint.\n\nFor example, if your token has `decimals = 9` (the most common for fungible tokens):\n\n- `1_000_000_000` (1e9) = **1 token**\n- `5_000_000_000` (5e9) = **5 tokens**\n- `1_000_000` (1e6) = **0.001 tokens**\n\n<Callout title=\"Decimals matter\">\n  With `decimals = 9`, to mint **100 tokens** you would set `amount` to `100_000_000_000` (100e9).\n  With `decimals = 6`, to mint **100 tokens** you would set `amount` to `100_000_000` (100e6).\n  Always check your token's decimals to calculate the correct raw amount.\n</Callout>\n\n## Build the mint transaction\n\nThe simplest way to mint tokens is using the `buildMintTokensTransaction()` helper from\n`gill/programs`. It automatically derives the destination wallet's ATA and sets compute unit limits.\n\n```ts\nimport { buildMintTokensTransaction } from \"gill/programs\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst transaction = await buildMintTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  mint: mint.address,\n  mintAuthority: signer,\n  destination: destinationWallet,\n  amount: 1_000_000_000, // 1 token (with decimals=9)\n});\n```\n\nWhere `mint.address` is the address of the token mint you previously created and `destinationWallet`\nis the wallet address that should receive the tokens.\n\n## Manually create the mint instructions\n\nIf you need more control over the transaction, you can use `getMintTokensInstructions()` to get the\nindividual instructions and compose the transaction yourself.\n\nFirst, derive the ATA for the destination wallet:\n\n```ts\nimport { getAssociatedTokenAccountAddress } from \"gill/programs\";\n\nconst ata = await getAssociatedTokenAccountAddress(mint.address, destinationWallet);\n```\n\nThen create the instructions and build the transaction:\n\n```ts\nimport { createTransaction } from \"gill\";\nimport { getMintTokensInstructions } from \"gill/programs\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst instructions = getMintTokensInstructions({\n  feePayer: signer,\n  mint: mint.address,\n  mintAuthority: signer,\n  destination: destinationWallet,\n  ata,\n  amount: 1_000_000_000, // 1 token (with decimals=9)\n});\n\nconst transaction = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions,\n  latestBlockhash,\n});\n```\n\nThis gives you the same two instructions that `buildMintTokensTransaction()` creates under the hood:\n\n1. **Create ATA** (idempotent) — creates the destination's Associated Token Account if it does not\n   already exist\n2. **Mint to** — mints the specified amount of tokens to the ATA\n\n## Sign and send the transaction\n\nWith your transaction fully created, you can now sign and send it:\n\n```ts\nimport {\n  signTransactionMessageWithSigners,\n  getSignatureFromTransaction,\n  getExplorerLink,\n} from \"gill\";\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n```\n\nIf your transaction is already fully signed or has all signers available, you can send and confirm\nit on the blockchain:\n\n```ts\nawait sendAndConfirmTransaction(signedTransaction);\n```\n\n<Callout title=\"Pro Tip\">\n  If you do not need to know the transaction signature prior to sending the transaction AND all\n  signers are attached to the transaction, you can pass a fully signable transaction to the\n  `sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then\n  perform the signing operations prior to sending and confirming.\n</Callout>\n\n## Using Token Extensions (Token22)\n\nIf your token was created with the Token Extensions program (Token22), pass the `tokenProgram`\nparameter to ensure the correct program is used:\n\n```ts\nimport { TOKEN_2022_PROGRAM_ADDRESS, buildMintTokensTransaction } from \"gill/programs\";\n\nconst transaction = await buildMintTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  mint: mint.address,\n  mintAuthority: signer,\n  destination: destinationWallet,\n  amount: 1_000_000_000,\n  tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n});\n```\n\nThe same `tokenProgram` parameter is available on `getMintTokensInstructions()` and\n`getAssociatedTokenAccountAddress()` as well.\n"
  },
  {
    "path": "docs/content/docs/guides/tokens/transfer-tokens.mdx",
    "content": "---\ntitle: Transfer Tokens\ndescription: Learn how to transfer tokens between wallets using the gill JavaScript library.\n---\n\nTransferring tokens sends existing token supply from one wallet to another via their Associated\nToken Accounts (ATAs). The source wallet's `authority` must sign the transaction to authorize the\ntransfer.\n\nThis guide demonstrates how to transfer tokens using the\n[`gill` package](https://www.npmjs.com/package/gill), including automatically creating the\ndestination wallet's ATA if it does not already exist.\n\n## Install gill\n\nInstall gill using the core `gill` library:\n\n```package-install\ngill\n```\n\nimport { PackageBadges } from \"@/components/package-badges\";\n\n<PackageBadges packageName=\"gill\" />\n\n## Create an RPC connection\n\nIn order to send transactions and/or fetch data from the Solana blockchain, you will need a client\nconnection. You can easily create a Solana client connection using the `createSolanaClient()`\nfunction.\n\nThe `urlOrMoniker` can be either a Solana network moniker (e.g. `devnet`, `mainnet`, `localnet`) or\na full URL of your RPC provider.\n\n```ts twoslash\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\", // `mainnet`, `localnet`, etc\n});\n```\n\n<Callout title=\"Public RPC endpoints are subject to rate limits\">\n  Using a Solana moniker will connect to the public RPC endpoints. These are subject to rate limits\n  and should not be used in production applications. Applications should find their own RPC provider\n  and the URL provided from them.\n</Callout>\n\n## Prepare a Signer\n\nEvery Solana transaction requires at least one \"signer\" to be the fee payer for the transaction.\nWhen transferring tokens, the `authority` (the source wallet's owner) must also be a signer to\nauthorize the transfer.\n\n### Load a signer from a local keypair file\n\nFor backend scripts and some server environments, you can load a signer from your local filesystem:\n\n```ts twoslash\nimport { type KeyPairSigner } from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\n// This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\nconst signer: KeyPairSigner = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n```\n\n## Understanding token amounts\n\nWhen transferring tokens, the `amount` you provide is in raw base units, not human-readable units.\nThe conversion depends on the `decimals` value of your token mint.\n\nFor example, if your token has `decimals = 9` (the most common for fungible tokens):\n\n- `1_000_000_000` (1e9) = **1 token**\n- `5_000_000_000` (5e9) = **5 tokens**\n- `1_000_000` (1e6) = **0.001 tokens**\n\n<Callout title=\"Decimals matter\">\n  With `decimals = 9`, to transfer **100 tokens** you would set `amount` to `100_000_000_000`\n  (100e9). With `decimals = 6`, to transfer **100 tokens** you would set `amount` to `100_000_000`\n  (100e6). Always check your token's decimals to calculate the correct raw amount.\n</Callout>\n\n## Build the transfer transaction\n\nThe simplest way to transfer tokens is using the `buildTransferTokensTransaction()` helper from\n`gill/programs`. It automatically derives the source and destination wallet's ATAs and sets compute\nunit limits (default 31,000 CU).\n\n```ts\nimport { buildTransferTokensTransaction } from \"gill/programs\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst transaction = await buildTransferTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  mint: mint.address,\n  authority: signer,\n  destination: destinationWallet,\n  amount: 1_000_000_000, // 1 token (with decimals=9)\n});\n```\n\nWhere `mint.address` is the address of the token mint and `destinationWallet` is the wallet address\nthat should receive the tokens.\n\n## Manually create the transfer instructions\n\nIf you need more control over the transaction, you can use `getTransferTokensInstructions()` to get\nthe individual instructions and compose the transaction yourself.\n\nFirst, derive the ATAs for both the source and destination wallets:\n\n```ts\nimport { getAssociatedTokenAccountAddress } from \"gill/programs\";\n\nconst sourceAta = await getAssociatedTokenAccountAddress(mint.address, signer.address);\nconst destinationAta = await getAssociatedTokenAccountAddress(mint.address, destinationWallet);\n```\n\nThen create the instructions and build the transaction:\n\n```ts\nimport { createTransaction } from \"gill\";\nimport { getTransferTokensInstructions } from \"gill/programs\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst instructions = getTransferTokensInstructions({\n  feePayer: signer,\n  mint: mint.address,\n  authority: signer,\n  sourceAta,\n  destination: destinationWallet,\n  destinationAta,\n  amount: 1_000_000_000, // 1 token (with decimals=9)\n});\n\nconst transaction = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions,\n  latestBlockhash,\n});\n```\n\n## Sign and send the transaction\n\nWith your transaction fully created, you can now sign and send it:\n\n```ts\nimport {\n  signTransactionMessageWithSigners,\n  getSignatureFromTransaction,\n  getExplorerLink,\n} from \"gill\";\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n```\n\nIf your transaction is already fully signed or has all signers available, you can send and confirm\nit on the blockchain:\n\n```ts\nawait sendAndConfirmTransaction(signedTransaction);\n```\n\n<Callout title=\"Pro Tip\">\n  If you do not need to know the transaction signature prior to sending the transaction AND all\n  signers are attached to the transaction, you can pass a fully signable transaction to the\n  `sendAndConfirmTransaction()` function initialized from `createSolanaClient()`. It will then\n  perform the signing operations prior to sending and confirming.\n</Callout>\n\n## Using Token Extensions (Token22)\n\nIf your token was created with the Token Extensions program (Token22), pass the `tokenProgram`\nparameter to ensure the correct program is used:\n\n```ts\nimport { TOKEN_2022_PROGRAM_ADDRESS, buildTransferTokensTransaction } from \"gill/programs\";\n\nconst transaction = await buildTransferTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  mint: mint.address,\n  authority: signer,\n  destination: destinationWallet,\n  amount: 1_000_000_000,\n  tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n});\n```\n\nThe same `tokenProgram` parameter is available on `getTransferTokensInstructions()` and\n`getAssociatedTokenAccountAddress()` as well.\n"
  },
  {
    "path": "docs/content/docs/index.mdx",
    "content": "---\ntitle: Installation\ndescription: Get started with gill, the new JavaScript client for Solana developers.\n---\n\nGill is a modern javascript/typescript client library for interacting with the\n[Solana](http://solana.com/) blockchain. You can use it to build Solana apps in NodeJS, web\nbrowsers, React Native, and just about any other JavaScript environment.\n\nGill is built on top of the Solana JavaScript libraries built by Anza:\n[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as \"web3.js v2\"). By utilizing the\nsame types and functions under the hood, `gill` is compatible with `@solana/kit`. All `@solana/kit`\nimports can even be directly replaced with `gill` for one-to-one compatibility, plus unlocking the\nvarious quality-of-life improvements that gill provides.\n\n## Install gill\n\nInstall the core `gill` library in your project:\n\n```package-install\ngill\n```\n\n<Callout title=\"Coming from Kit?\">\n  All imports from the `@solana/kit` library can be directly replaces with `gill` to achieve the\n  exact same functionality. Plus unlock the additional functionality only included in gill, like\n  `createTransaction`.\n</Callout>\n\n## Quick start\n\nAfter [installing gill](#install-gill), follow these simple steps to install and get started with\nthe `gill` library:\n\n<Steps>\n\n<Step>\n\n### Create a Solana RPC connection\n\nCreate a Solana `rpc` and `rpcSubscriptions` client connection from any RPC URL or standard Solana\nnetwork moniker (i.e. `devnet`, `localnet`, `mainnet` etc).\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"mainnet\",\n});\n```\n\nThe above snippet demonstrates how to use the public Solana RPC endpoints. These are great for quick\nlocal testing, but they are (rightfully) subject to heavy rate limits.\n\nWhen you are ready to ship your application to production, you will need to utilize a production\nready RPC provider.\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"https://private-solana-rpc-provider.com\",\n});\n```\n\n</Step>\n\n<Step>\n\n### Make Solana RPC requests\n\nAfter you have a Solana `rpc` connection, you can make all the\n[JSON RPC method](https://solana.com/docs/rpc) calls directly off of it.\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// get slot\nconst slot = await rpc.getSlot().send();\n\n// get the latest blockhash\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\n<Callout>\n  The `rpc` client requires you to call `.send()` on the RPC method in order to actually send the\n  request to your RPC provider and get a response.\n</Callout>\n\n</Step>\n\n<Step>\n\n### Create a transaction\n\nYou can easily create transactions using the `createTransaction()` function. It accepts a single\nobject argument that is fully typed for all the required (and optional) pieces of a Solana\ntransaction.\n\nWhen creating a Solana transaction, you will need several pieces of information:\n\n- version - `legacy` works well for every task, unless you need Address Lookup Tables (then use `0`)\n- latest blockhash - This is like a recent timestamp check that the blockchain uses. Simply request\n  it from your `rpc`.\n- instructions - Instructs the Solana runtime which programs and logic to execute onchain.\n- fee payer - The signer that will cover the small fee collected by the network to execute the\n  transaction.\n\n<Callout>\n  For simplicity, the following examples utilize `loadKeypairSignerFromFile()` to load a Solana\n  keypair file from the local file system. Specifically the Solana CLI's default file path:\n  `~/.config/solana/id.json`. This can work well for running local scripts, but not for frontend\n  applications where users will need to sign using their wallets. See [Creating a signer without a\n  secret key](/docs/getting-started/signers#create-a-signer-without-the-secret-key) for details.\n</Callout>\n\n```ts twoslash\nimport { createTransaction, createSolanaClient } from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\n/**\n * load the Solana CLI's default keypair file (`~/.config/solana/id.json`)\n * as a signer into your script\n */\nconst signer = await loadKeypairSignerFromFile();\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst transaction = createTransaction({\n  version: \"legacy\", // or `0` if using address lookup tables\n  feePayer: signer,\n  instructions: [\n    getAddMemoInstruction({\n      memo: \"gm world!\",\n    }),\n  ],\n  latestBlockhash,\n  // computeUnitLimit, // optional, but highly recommend to set\n  // computeUnitPrice, // optional, but highly recommend to set\n});\n```\n\nIn the example above, we are loading a signer from the local file system to act as our fee payer and\nonly signer. The transaction itself has a single \"memo instruction\" in it to log a simple message\nonchain.\n\nYou can now [sign the transaction](#signing-transactions) and send it to the blockchain for\nconfirmation.\n\n<Callout title=\"Optimizing transactions\">\n  You can (and should) optimize your Solana transactions by including a compute unit limit and\n  compute unit price instructions within your transaction. The `createTransaction()` function\n  supports easily adding these instructions via the `computeUnitLimit` and `computeUnitPrice`\n  arguments.\n</Callout>\n\n</Step>\n\n<Step>\n\n### Signing transactions\n\nOnce you have a transaction that is ready to be signed, you can call\n`signTransactionMessageWithSigners()` to perform the signing operations with all the available\nsigners. This function will also assert that the transaction is fully signed.\n\n<Callout type=\"warn\">\n  If your transaction cannot be fully signed at this time (because you only have some of the signers\n  available and attached), you can call `partiallySignTransactionMessageWithSigners()` to partially\n  sign the transaction. Then the remaining signatures can be added later.\n</Callout>\n\n```ts twoslash\n// @noErrors\nimport {\n  createTransaction,\n  createSolanaClient,\n  signTransactionMessageWithSigners,\n} from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\n// ... [other business logic here]\n\nconst transaction = createTransaction({...});\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconst signature = getSignatureFromTransaction(signedTransaction);\n```\n\nAfter a transaction has been signed by the `feePayer`, you can obtain its transaction signature\nusing the `getSignatureFromTransaction()` function (yes, even before sending it to the network).\n\nOnce you have a fully signed transaction, `signedTransaction` in the example above, you can now send\nit to the blockchain network for confirmation.\n\n</Step>\n\n<Step>\n\n### Send and confirm transactions\n\nWhen your transaction is ready and signed, you can send it to the network via your RPC provider\nusing the `sendAndConfirmTransaction()` function initialized via gill's `createSolanaClient()`:\n\n```ts twoslash\n// @noErrors\nimport {\n  createTransaction,\n  createSolanaClient,\n  signTransactionMessageWithSigners,\n} from \"gill\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\n// ... [other business logic here]\n\nconst transaction = createTransaction({...});\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconst signature = getSignatureFromTransaction(signedTransaction);\n\ntry {\n  console.log(\"Sending transaction:\", signature);\n\n  await sendAndConfirmTransaction(signedTransaction);\n\n  console.log(\"Transaction confirmed!\");\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n```\n\n<Callout>\n  The `sendAndConfirmTransaction()` function performs a check to ensure all required signatures are\n  present (aka the transactions is \"fully signed\") before attempting to send it to the network. If\n  any signatures are missing, it will throw an error.\n</Callout>\n\n</Step>\n\n</Steps>\n\nCongratulations! You now understand the basics of using the `gill` library to perform create and\nsend Solana transactions.\n\n## Example source code\n\nYou can find the well-commented source code file for the above code snippets in gill's open source\nrepo here: https://github.com/gillsdk/gill/blob/master/examples/get-started/src/intro.ts\n"
  },
  {
    "path": "docs/content/docs/meta.json",
    "content": "{\n  \"title\": \"Documentation\",\n  \"defaultOpen\": true,\n  \"root\": true,\n  \"pages\": [\n    \"---Introduction---\",\n    \"index\",\n    \"typescript\",\n    \"examples\",\n    \"---Getting Started---\",\n    \"...getting-started\",\n    \"---React---\",\n    \"...react\",\n    \"---Comparisons---\",\n    \"...compare\",\n    \"---Guides---\",\n    \"...guides\",\n    \"---Miscellaneous---\",\n    \"...\"\n  ]\n}\n"
  },
  {
    "path": "docs/content/docs/react/examples.mdx",
    "content": "---\ntitle: Examples\ndescription: Real-world examples of using @gillsdk/react in your applications\n---\n\nLearn how to use `@gillsdk/react` through practical examples that demonstrate common patterns and\nuse cases.\n\n## Basic Examples\n\n### Display Wallet Balance\n\nA simple component to display a wallet's SOL balance:\n\n```tsx\n\"use client\";\n\nimport { lamportsToSol } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nexport function WalletBalance({ address }: { address: string }) {\n  const { balance, isLoading, isError, error } = useBalance({\n    address,\n    refetchInterval: 10000, // Refetch every 10 seconds\n  });\n\n  if (isLoading) return <div>Loading balance...</div>;\n  if (isError) return <div>Error: {error?.message}</div>;\n\n  return (\n    <div className=\"p-4 border rounded\">\n      <h3 className=\"font-bold\">Wallet Balance</h3>\n      <p className=\"text-2xl\">{lamportsToSol(balance)} SOL</p>\n    </div>\n  );\n}\n```\n\n### Token Balance Display\n\nDisplay a specific SPL token balance:\n\n```tsx\n\"use client\";\n\nimport { useTokenAccount, useTokenMint } from \"@gillsdk/react\";\nimport { tokenAmountToUiAmount } from \"@gillsdk/programs\";\n\nexport function TokenBalance({ mint, owner }: { mint: string; owner: string }) {\n  const { account: tokenAccount, isLoading: loadingAccount } = useTokenAccount({\n    mint,\n    owner,\n  });\n\n  const { account: mintAccount, isLoading: loadingMint } = useTokenMint({\n    mint,\n  });\n\n  if (loadingAccount || loadingMint) return <div>Loading...</div>;\n\n  const decimals = mintAccount?.data?.decimals || 0;\n  const amount = tokenAccount?.data?.amount || 0n;\n  const displayAmount = tokenAmountToUiAmount(amount, decimals);\n\n  return (\n    <div className=\"p-4 border rounded\">\n      <h3 className=\"font-bold\">Token Balance</h3>\n      <p className=\"text-2xl\">{displayAmount.toLocaleString()}</p>\n    </div>\n  );\n}\n```\n\n## Advanced Examples\n\n### Transaction History\n\nDisplay recent transactions for an address:\n\n```tsx\n\"use client\";\n\nimport { useSignaturesForAddress } from \"@gillsdk/react\";\n\nexport function TransactionHistory({ address }: { address: string }) {\n  const { signatures, isLoading, refetch } = useSignaturesForAddress({\n    address,\n    config: {\n      limit: 10,\n    },\n  });\n\n  if (isLoading) return <div>Loading transactions...</div>;\n\n  return (\n    <div className=\"space-y-2\">\n      <div className=\"flex justify-between items-center\">\n        <h3 className=\"font-bold\">Recent Transactions</h3>\n        <button onClick={() => refetch()} className=\"px-3 py-1 bg-blue-500 text-white rounded\">\n          Refresh\n        </button>\n      </div>\n\n      {signatures?.map((sig) => (\n        <div key={sig.signature} className=\"p-3 border rounded\">\n          <p className=\"font-mono text-sm truncate\">{sig.signature}</p>\n          <div className=\"flex justify-between text-sm text-gray-600\">\n            <span>Slot: {sig.slot}</span>\n            <span>{sig.blockTime && new Date(sig.blockTime * 1000).toLocaleString()}</span>\n          </div>\n          {sig.err && <p className=\"text-red-500 text-sm\">Error: {JSON.stringify(sig.err)}</p>}\n        </div>\n      ))}\n    </div>\n  );\n}\n```\n\n## Integration Examples\n\n### With Next.js App Router\n\nCreate a providers file:\n\n```tsx filename=\"app/providers.tsx\"\n\"use client\";\n\nimport { createSolanaClient } from \"gill\";\nimport { SolanaProvider } from \"@gillsdk/react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 60 * 1000, // 1 minute\n      cacheTime: 10 * 60 * 1000, // 10 minutes\n    },\n  },\n});\n\nconst solanaClient = createSolanaClient({\n  urlOrMoniker: process.env.NEXT_PUBLIC_RPC_URL || \"mainnet\",\n});\n\nexport function Providers({ children }: { children: React.ReactNode }) {\n  return (\n    <QueryClientProvider client={queryClient}>\n      <SolanaProvider client={solanaClient}>{children}</SolanaProvider>\n    </QueryClientProvider>\n  );\n}\n```\n\nUse in layout:\n\n```tsx filename=\"app/layout.tsx\"\nimport { Providers } from \"./providers\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  return (\n    <html lang=\"en\">\n      <body>\n        <Providers>{children}</Providers>\n      </body>\n    </html>\n  );\n}\n```\n\n### With Wallet Adapter\n\nCombine `@gillsdk/react` with Solana wallet adapter:\n\n```tsx\n\"use client\";\n\nimport { useWallet } from \"@solana/wallet-adapter-react\";\nimport { useBalance } from \"@gillsdk/react\";\nimport { lamportsToSol } from \"gill\";\n\nexport function ConnectedWalletInfo() {\n  const { publicKey, connected } = useWallet();\n\n  const { balance, isLoading } = useBalance({\n    address: publicKey?.toString() || \"\",\n    enabled: !!publicKey, // Only fetch when wallet is connected\n  });\n\n  if (!connected) {\n    return <div>Please connect your wallet</div>;\n  }\n\n  return (\n    <div className=\"p-4 border rounded\">\n      <p className=\"text-sm text-gray-600\">Connected Wallet</p>\n      <p className=\"font-mono truncate\">{publicKey?.toString()}</p>\n      {isLoading ? (\n        <p>Loading balance...</p>\n      ) : (\n        <p className=\"text-xl font-bold\">{lamportsToSol(balance)} SOL</p>\n      )}\n    </div>\n  );\n}\n```\n\n## Performance Patterns\n\n### Dependent Queries\n\nFetch data conditionally based on other data:\n\n```tsx\n\"use client\";\n\nimport { useAccount, useTokenAccount } from \"@gillsdk/react\";\n\nexport function ConditionalTokenBalance({ address }: { address: string }) {\n  // First, check if the address exists\n  const { account, isLoading: loadingAccount } = useAccount({\n    address,\n  });\n\n  // Only fetch token balance if account exists\n  const { account: tokenAccount, isLoading: loadingToken } = useTokenAccount({\n    mint: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\", // USDC\n    owner: address,\n    enabled: !!account, // Only fetch if account exists\n  });\n\n  if (loadingAccount) return <div>Checking account...</div>;\n  if (!account) return <div>Account not found</div>;\n  if (loadingToken) return <div>Loading token balance...</div>;\n\n  return (\n    <div>\n      <p>USDC Balance: {tokenAccount?.data?.amount.toString()}</p>\n    </div>\n  );\n}\n```\n\n### Optimistic Updates\n\nUpdate UI immediately while transaction confirms:\n\n```tsx\n\"use client\";\n\nimport { useBalance } from \"@gillsdk/react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport function OptimisticBalance({ address }: { address: string }) {\n  const queryClient = useQueryClient();\n  const { balance } = useBalance({ address });\n\n  const handleTransfer = async (amount: bigint) => {\n    // Optimistically update the balance\n    queryClient.setQueryData([\"gill\", \"balance\", address], (old: bigint) => old - amount);\n\n    try {\n      // Send transaction...\n      // await sendTransaction(...)\n\n      // Refetch to get real balance\n      queryClient.invalidateQueries({\n        queryKey: [\"gill\", \"balance\", address],\n      });\n    } catch (error) {\n      // Revert optimistic update on error\n      queryClient.invalidateQueries({\n        queryKey: [\"gill\", \"balance\", address],\n      });\n    }\n  };\n\n  return (\n    <div>\n      <p>Balance: {balance?.toString()}</p>\n      {/* Transfer UI */}\n    </div>\n  );\n}\n```\n\n## Error Handling\n\n### Global Error Boundary\n\n```tsx\n\"use client\";\n\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { useQueryErrorResetBoundary } from \"@tanstack/react-query\";\n\nfunction ErrorFallback({ error, resetErrorBoundary }) {\n  return (\n    <div className=\"p-4 bg-red-50 border border-red-200 rounded\">\n      <h2 className=\"text-red-800 font-bold\">Something went wrong</h2>\n      <pre className=\"text-sm\">{error.message}</pre>\n      <button onClick={resetErrorBoundary} className=\"mt-2 px-4 py-2 bg-red-600 text-white rounded\">\n        Try again\n      </button>\n    </div>\n  );\n}\n\nexport function AppWithErrorBoundary({ children }) {\n  const { reset } = useQueryErrorResetBoundary();\n\n  return (\n    <ErrorBoundary FallbackComponent={ErrorFallback} onReset={reset}>\n      {children}\n    </ErrorBoundary>\n  );\n}\n```\n\n## Resources\n\n- [gill sdk Documentation](/docs) - Core `gill` library documentation\n- [TanStack Query Docs](https://tanstack.com/query) - Learn more about React Query\n"
  },
  {
    "path": "docs/content/docs/react/getting-started.mdx",
    "content": "---\ntitle: Getting Started with @gillsdk/react\ndescription: Learn how to set up and configure @gillsdk/react in your React application\n---\n\nThis guide will walk you through setting up `@gillsdk/react` in your React application, including\nconfiguration for Next.js App Router, Remix, and other frameworks that support React Server\nComponents.\n\n## Prerequisites\n\nBefore you begin, make sure you have:\n\n1. A React application (Create React App, Next.js, Vite, etc.)\n2. Node.js LTS (v22 or later) installed\n3. Basic knowledge of React hooks\n\n## Setup Steps\n\n<Steps>\n\n<Step>\n\n### Install Dependencies\n\nFirst, install `@gillsdk/react` along with its peer dependencies:\n\n```package-install\ngill @gillsdk/react @tanstack/react-query\n```\n\n</Step>\n\n<Step>\n\n### Create a Solana Client\n\nCreate a Solana client using gill's `createSolanaClient` function:\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst client = createSolanaClient({\n  urlOrMoniker: \"devnet\", // or \"mainnet\", \"testnet\", or a custom RPC URL\n});\n```\n\n<Callout type=\"warn\">\n  The public Solana RPC endpoints are subject to rate limits and should not be used in production.\n  For production applications, use a dedicated RPC provider like Helius, QuickNode, or Alchemy.\n</Callout>\n\n</Step>\n\n<Step>\n\n### Wrap Your App with SolanaProvider\n\nThe `SolanaProvider` is a React context provider that makes the Solana client available to all\n`@gillsdk/react` hooks in your component tree.\n\n#### For Standard React Apps\n\n```tsx\nimport { createSolanaClient } from \"gill\";\nimport { SolanaProvider } from \"@gillsdk/react\";\n\nconst client = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nfunction App() {\n  return <SolanaProvider client={client}>{/* Your app components */}</SolanaProvider>;\n}\n\nexport default App;\n```\n\n#### For Next.js App Router and React Server Components\n\nFor applications that use React Server Components (like Next.js App Router, Remix, or other\nRSC-enabled frameworks), you need to create a client-side wrapper component.\n\n<Callout type=\"info\" title='What is the \"use client\" directive?'>\n  \n  The `\"use client\"` directive tells the bundler that this\n  component and its children should run on the client side (in the browser) rather than on the\n  server. This is necessary because:\n  \n  - `@gillsdk/react` uses React hooks (`useState`, `useEffect`, etc.)\n  which only work on the client\n  - The provider creates and hooks consume React context, which is a\n  client-side feature\n  - Without this directive, you'll get errors about using hooks in Server Components.\n\n</Callout>\n\nHere's how to create a client-side provider wrapper:\n\n```tsx filename=\"app/providers/solana-provider.tsx\"\n\"use client\"; // Required - marks this as a Client Component\n\nimport { createSolanaClient } from \"gill\";\nimport { SolanaProvider } from \"@gillsdk/react\";\n\nconst client = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nexport function SolanaProviderClient({ children }: { children: React.ReactNode }) {\n  return <SolanaProvider client={client}>{children}</SolanaProvider>;\n}\n```\n\nThen wrap your app in the root layout with this `SolanaProviderClient` component:\n\n```tsx filename=\"app/layout.tsx\"\nimport { SolanaProviderClient } from \"@/providers/solana-provider\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  return (\n    <html lang=\"en\">\n      <body>\n        <SolanaProviderClient>{children}</SolanaProviderClient>\n      </body>\n    </html>\n  );\n}\n```\n\n</Step>\n\n<Step>\n\n### Use @gillsdk/react Hooks\n\nNow you can use any `@gillsdk/react` hook in your components. When using frameworks with React\nServer Components (like Next.js App Router), remember to add the `\"use client\"` directive to any\ncomponent that uses `@gillsdk/react` hooks:\n\n```tsx filename=\"app/components/balance.tsx\"\n\"use client\"; // Required when using React Server Components\n\nimport { lamportsToSol } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nexport function WalletBalance() {\n  const { balance, isLoading, isError, error } = useBalance({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  if (isLoading) return <div>Loading balance...</div>;\n  if (isError) return <div>Error: {error?.message}</div>;\n\n  return (\n    <div>\n      <p>Balance: {lamportsToSol(balance)} SOL</p>\n    </div>\n  );\n}\n```\n\n</Step>\n\n</Steps>\n\n## Configuration Options\n\n### Custom RPC Endpoints\n\nFor production applications, configure a dedicated RPC endpoint:\n\n```typescript\nconst client = createSolanaClient({\n  urlOrMoniker: \"https://your-rpc-provider.com/your-api-key\",\n});\n```\n\n### Popular RPC Providers\n\n- [Helius](https://helius.dev)\n- [QuickNode](https://quicknode.com)\n- [Alchemy](https://alchemy.com)\n- [Triton](https://triton.one)\n- [Syndica](https://syndica.io)\n\n### Multiple Clients\n\nYou can manage multiple Solana clients using the `useUpdateSolanaClient` hook:\n\n```tsx\n\"use client\";\n\nimport { createSolanaClient } from \"gill\";\nimport { useUpdateSolanaClient } from \"@gillsdk/react\";\n\nfunction NetworkSwitcher() {\n  const { mutate: updateClient } = useUpdateSolanaClient();\n\n  const switchToMainnet = () => {\n    const mainnetClient = createSolanaClient({\n      urlOrMoniker: \"mainnet\",\n    });\n    updateClient(mainnetClient);\n  };\n\n  return <button onClick={switchToMainnet}>Switch to Mainnet</button>;\n}\n```\n\n## TypeScript Configuration\n\n`@gillsdk/react` is fully typed out of the box. No additional TypeScript configuration is required.\nHowever, ensure your `tsconfig.json` has:\n\n```json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"jsx\": \"react-jsx\" // or \"preserve\" for Next.js\n  }\n}\n```\n\n## Troubleshooting\n\n### \"use client\" Errors\n\nIf you see errors like \"You're importing a component that needs useEffect. It only works in a Client\nComponent\" or \"useState only works in Client Components\", this means you're trying to use\n`@gillsdk/react` in a Server Component. (which NextJS App router does by default unless the\n`\"use client\"` directive is explicitly used).\n\n**Why this happens:**\n\n- React Server Components run on the server during build/request time\n- `@gillsdk/react` uses browser-specific features like React hooks and Web APIs\n- The Solana client needs to make RPC calls from the browser\n\n**To fix:**\n\n1. Add `\"use client\"` at the top of any file using `@gillsdk/react` hooks\n2. Ensure your `SolanaProvider` wrapper has `\"use client\"` at the top\n3. Make sure the provider is properly wrapped around your component tree\n\n**Common scenarios:**\n\n- Forgot to add `\"use client\"` to a component using\n  [`useBalance`](/docs/react/hooks/data-fetching#usebalance),\n  [`useAccount`](/docs/react/hooks/data-fetching#useaccount), etc.\n- Trying to use `@gillsdk/react` hooks directly in a `page.tsx` without the directive\n- Importing a Client Component into a Server Component without proper boundaries\n\n### RPC Rate Limiting\n\nIf you're hitting rate limits:\n\n1. Switch from public endpoints to a dedicated RPC provider\n2. Implement request batching and caching strategies\n3. Consider using the `staleTime` and `cacheTime` options in hooks\n\n### Bundle Size\n\nTo minimize bundle size:\n\n1. Import only the hooks you need\n2. Ensure tree-shaking is enabled in your bundler\n3. Use dynamic imports for heavy components\n\n---\n\nReady to start using `@gillsdk/react`? Check out the [available hooks](/docs/react/hooks) to begin\nfetching blockchain data in your React application.\n"
  },
  {
    "path": "docs/content/docs/react/hooks/client.mdx",
    "content": "---\ntitle: Client Management Hooks\ndescription: Hooks for managing and accessing the Solana client connection\n---\n\nThese hooks allow you to access and manage the Solana client configured in your `SolanaProvider`.\n\n## useSolanaClient\n\nGet the current Solana client configured in the `SolanaProvider`, including the `rpc` and\n`rpcSubscriptions` connections.\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useSolanaClient } from \"@gillsdk/react\";\n\nexport function MyComponent() {\n  const { rpc, rpcSubscriptions } = useSolanaClient();\n\n  // You can now use rpc to access any Solana JSON RPC methods\n  const getSlot = async () => {\n    const slot = await rpc.getSlot().send();\n    console.log(\"Current slot:\", slot);\n  };\n\n  return <button onClick={getSlot}>Get Current Slot</button>;\n}\n```\n\n### Return Value\n\n```typescript\ninterface SolanaClient {\n  rpc: SolanaRpc;\n  rpcSubscriptions: SolanaRpcSubscriptions;\n  sendAndConfirmTransaction: SendAndConfirmTransaction;\n}\n```\n\n### Advanced Example\n\nUsing the client to make custom RPC calls:\n\n```tsx\n\"use client\";\n\nimport { useSolanaClient } from \"@gillsdk/react\";\nimport type { Address } from \"gill\";\n\nexport function AccountExplorer({ accountAddress }: { accountAddress: Address }) {\n  const { rpc } = useSolanaClient();\n  const [accountInfo, setAccountInfo] = useState(null);\n\n  const fetchAccountInfo = async () => {\n    try {\n      const info = await rpc\n        .getAccountInfo(accountAddress, {\n          encoding: \"base64\",\n        })\n        .send();\n\n      setAccountInfo(info);\n    } catch (error) {\n      console.error(\"Failed to fetch account info:\", error);\n    }\n  };\n\n  return (\n    <div>\n      <button onClick={fetchAccountInfo}>Fetch Account Info</button>\n      {accountInfo && <pre>{JSON.stringify(accountInfo, null, 2)}</pre>}\n    </div>\n  );\n}\n```\n\n## useUpdateSolanaClient\n\nUpdate the current Solana client in the `SolanaProvider`. This is useful for switching between\ndifferent networks or RPC endpoints.\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { createSolanaClient } from \"gill\";\nimport type { SolanaClusterMoniker } from \"gill\";\nimport { useUpdateSolanaClient } from \"@gillsdk/react\";\n\nexport function NetworkSwitcher() {\n  const updateClient = useUpdateSolanaClient();\n\n  const switchNetwork = (network: SolanaClusterMoniker) => {\n    const newClient = createSolanaClient({\n      urlOrMoniker: network,\n    });\n    updateClient(newClient);\n  };\n\n  return (\n    <div>\n      <button onClick={() => switchNetwork(\"mainnet\")}>Mainnet</button>\n      <button onClick={() => switchNetwork(\"devnet\")}>Devnet</button>\n      <button onClick={() => switchNetwork(\"testnet\")}>Testnet</button>\n    </div>\n  );\n}\n```\n\n### Parameters\n\n```typescript\nupdateClient(client: SolanaClient): void\n```\n\n- `client` - The new Solana client to set\n\n### Advanced Example\n\nSwitching to a custom RPC endpoint with error handling:\n\n```tsx\n\"use client\";\n\nimport { createSolanaClient } from \"gill\";\nimport type { SolanaClientUrlOrMoniker } from \"gill\";\nimport { useUpdateSolanaClient, useSolanaClient } from \"@gillsdk/react\";\n\nexport function CustomRPCManager() {\n  const currentClient = useSolanaClient();\n  const updateClient = useUpdateSolanaClient();\n  const [rpcUrl, setRpcUrl] = useState(\"\");\n  const [isConnecting, setIsConnecting] = useState(false);\n\n  const connectToCustomRPC = async () => {\n    if (!rpcUrl) return;\n\n    setIsConnecting(true);\n    try {\n      const newClient = createSolanaClient({\n        urlOrMoniker: rpcUrl,\n      });\n\n      // Test the connection\n      await newClient.rpc.getSlot().send();\n\n      // If successful, update the client\n      updateClient(newClient);\n      alert(\"Successfully connected to custom RPC!\");\n    } catch (error) {\n      alert(`Failed to connect: ${error.message}`);\n    } finally {\n      setIsConnecting(false);\n    }\n  };\n\n  return (\n    <div>\n      <input\n        type=\"text\"\n        value={rpcUrl}\n        onChange={(e) => setRpcUrl(e.target.value)}\n        placeholder=\"Enter custom RPC URL\"\n      />\n      <button onClick={connectToCustomRPC} disabled={isConnecting}>\n        {isConnecting ? \"Connecting...\" : \"Connect\"}\n      </button>\n    </div>\n  );\n}\n```\n\n## Best Practices\n\n### Client Initialization\n\nInitialize your client with appropriate configuration for your use case:\n\n```typescript\n// Development\nconst devClient = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\n// Production with custom RPC\nconst prodClient = createSolanaClient({\n  urlOrMoniker: process.env.NEXT_PUBLIC_RPC_URL || \"mainnet\",\n});\n\n// With custom configuration\nconst customClient = createSolanaClient({\n  urlOrMoniker: \"https://your-rpc.com\",\n  config: {\n    commitment: \"confirmed\",\n    wsEndpoint: \"wss://your-rpc.com/ws\",\n  },\n});\n```\n\n### Network Switching\n\nWhen implementing network switching, consider:\n\n1. **Clear caches** when switching networks to avoid stale data\n2. **Update wallet connections** if using wallet adapters\n3. **Notify users** of network changes\n4. **Persist preferences** in local storage\n\n```tsx\nfunction NetworkManager() {\n  const updateClient = useUpdateSolanaClient();\n  const queryClient = useQueryClient();\n\n  const switchNetwork = async (network: SolanaClientUrlOrMoniker) => {\n    // Create new client\n    const newClient = createSolanaClient({\n      urlOrMoniker: network,\n    });\n\n    // Update client\n    updateClient(newClient);\n\n    // Clear all cached queries\n    await queryClient.invalidateQueries();\n\n    // Save preference\n    localStorage.setItem(\"preferred-network\", network);\n  };\n\n  // ... rest of component\n}\n```\n\n## Troubleshooting\n\n### Client Not Available\n\nIf `useSolanaClient` returns undefined, ensure:\n\n1. Your component is wrapped in `SolanaProvider`\n2. The provider is properly initialized with a client\n3. You're not calling the hook during SSR (use `\"use client\"` directive)\n\n### RPC Connection Issues\n\nWhen updating clients, handle connection failures gracefully:\n\n```tsx\nconst updateClientSafely = async (url: SolanaClientUrlOrMoniker) => {\n  try {\n    const newClient = createSolanaClient({ urlOrMoniker: url });\n    // Test connection\n    await newClient.rpc.getHealth().send();\n    updateClient(newClient);\n  } catch (error) {\n    console.error(\"Failed to connect to RPC:\", error);\n    // Fallback to previous client or default\n  }\n};\n```\n"
  },
  {
    "path": "docs/content/docs/react/hooks/data-fetching.mdx",
    "content": "---\ntitle: Data Fetching Hooks\ndescription: Hooks for fetching data from the Solana blockchain\n---\n\nThese hooks provide easy access to common Solana blockchain data with automatic caching, refetching,\nand error handling.\n\n## useAccount\n\nGet the account info for an address using the Solana RPC method\n[`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo).\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useAccount } from \"@gillsdk/react\";\n\nexport function AccountInfo() {\n  const { account, isLoading, isError, error } = useAccount({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  if (isLoading) return <div>Loading...</div>;\n  if (isError) return <div>Error: {error?.message}</div>;\n\n  return (\n    <div>\n      <pre>{JSON.stringify(account, null, 2)}</pre>\n    </div>\n  );\n}\n```\n\n### With Decoder\n\nFetch and decode an account's data into a typed object using an appropriate `decoder` function:\n\n```tsx\n\"use client\";\n\nimport { useAccount } from \"@gillsdk/react\";\nimport { getMintDecoder } from \"gill/programs\";\n\nexport function MintInfo() {\n  const { account, isLoading } = useAccount({\n    // USDC mint account on mainnet\n    address: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n    decoder: getMintDecoder(),\n  });\n\n  if (isLoading) return <div>Loading...</div>;\n\n  return (\n    <div>\n      <p>Supply: {account?.data?.supply.toString()}</p>\n      <p>Decimals: {account?.data?.decimals}</p>\n    </div>\n  );\n}\n```\n\n### Parameters\n\n```typescript\ninterface UseAccountOptions {\n  address: Address | string;\n  decoder?: Decoder<T>;\n  commitment?: Commitment;\n  minContextSlot?: number;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useBalance\n\nGet an account's balance in lamports using\n[`getBalance`](https://solana.com/docs/rpc/http/getbalance).\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { lamportsToSol } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nexport function WalletBalance() {\n  const { balance, isLoading, isError, error } = useBalance({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  if (isLoading) return <div>Loading...</div>;\n  if (isError) return <div>Error: {error?.message}</div>;\n\n  return (\n    <div>\n      <p>Balance: {lamportsToSol(balance)} SOL</p>\n    </div>\n  );\n}\n```\n\n### With Automatic Refetch\n\n```tsx\nconst { balance } = useBalance({\n  address: walletAddress,\n  refetchInterval: 5000, // Refetch every 5 seconds\n  refetchOnWindowFocus: true,\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseBalanceOptions {\n  address: Address | string;\n  commitment?: Commitment;\n  minContextSlot?: number;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useLatestBlockhash\n\nGet the latest blockhash using\n[`getLatestBlockhash`](https://solana.com/docs/rpc/http/getlatestblockhash).\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useLatestBlockhash } from \"@gillsdk/react\";\n\nexport function BlockhashDisplay() {\n  const { latestBlockhash, isLoading } = useLatestBlockhash();\n\n  if (isLoading) return <div>Loading...</div>;\n\n  return (\n    <div>\n      <p>Blockhash: {latestBlockhash?.blockhash}</p>\n      <p>Last Valid Height: {latestBlockhash?.lastValidBlockHeight}</p>\n    </div>\n  );\n}\n```\n\n### For Transactions\n\n```tsx\nconst { latestBlockhash } = useLatestBlockhash();\n\n// Use in transaction\nconst transaction = createTransaction({\n  blockhash: latestBlockhash.blockhash,\n  // ... other transaction params\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseLatestBlockhashOptions {\n  commitment?: Commitment;\n  minContextSlot?: number;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useSignatureStatuses\n\nGet the statuses of signatures using\n[`getSignatureStatuses`](https://solana.com/docs/rpc/http/getSignatureStatuses).\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useSignatureStatuses } from \"@gillsdk/react\";\n\nexport function TransactionStatus({ signature }) {\n  const { statuses, isLoading } = useSignatureStatuses({\n    signatures: [signature],\n  });\n\n  if (isLoading) return <div>Checking status...</div>;\n\n  const status = statuses?.[0];\n  return (\n    <div>\n      <p>Confirmed: {status?.confirmationStatus}</p>\n      <p>Confirmations: {status?.confirmations}</p>\n      {status?.err && <p>Error: {JSON.stringify(status.err)}</p>}\n    </div>\n  );\n}\n```\n\n### Multiple Signatures\n\n```tsx\nconst { statuses } = useSignatureStatuses({\n  signatures: [sig1, sig2, sig3],\n  searchTransactionHistory: true,\n});\n\nstatuses?.forEach((status, index) => {\n  console.log(`Signature ${index}:`, status);\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseSignatureStatusesOptions {\n  signatures: string[];\n  searchTransactionHistory?: boolean;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useSignaturesForAddress\n\nGet signatures for confirmed transactions using\n[`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress).\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useSignaturesForAddress } from \"@gillsdk/react\";\n\nexport function TransactionHistory({ address }) {\n  const { signatures, isLoading } = useSignaturesForAddress({\n    address,\n    config: {\n      limit: 10,\n    },\n  });\n\n  if (isLoading) return <div>Loading history...</div>;\n\n  return (\n    <ul>\n      {signatures?.map((sig) => (\n        <li key={sig.signature}>\n          <p>Signature: {sig.signature}</p>\n          <p>Slot: {sig.slot}</p>\n          <p>Time: {new Date(sig.blockTime * 1000).toLocaleString()}</p>\n        </li>\n      ))}\n    </ul>\n  );\n}\n```\n\n### With Pagination\n\n```tsx\nconst { signatures, refetch } = useSignaturesForAddress({\n  address,\n  config: {\n    limit: 20,\n    before: lastSignature, // For pagination\n    until: firstSignature,\n  },\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseSignaturesForAddressOptions {\n  address: Address | string;\n  config?: {\n    limit?: number;\n    before?: string;\n    until?: string;\n    commitment?: Commitment;\n  };\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useProgramAccounts\n\nGet all accounts owned by a program using the\n[`getProgramAccounts`](https://solana.com/docs/rpc/http/getProgramAccounts) RPC method.\n\n<Callout type=\"warn\" title=\"Important getProgramAccounts (GPA) Limitations\">\n\n- `getProgramAccounts` can return large amounts of data and is resource-intensive\n- Many RPC providers return errors or have rate limits due to the system load\n- Public RPC endpoints often have `getProgramAccounts` disabled entirely\n- Consider using filters to reduce the data returned and always use a paid RPC provider for\n  production\n- For large programs, consider alternative approaches like indexers or specialized APIs\n\n</Callout>\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useProgramAccounts } from \"@gillsdk/react\";\n\nexport function ProgramAccounts() {\n  const { accounts, isLoading } = useProgramAccounts({\n    program: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n    config: {\n      encoding: \"base64\",\n      filters: [\n        { dataSize: 165n }, // Token account size\n      ],\n    },\n  });\n\n  if (isLoading) return <div>Loading accounts...</div>;\n\n  return (\n    <div>\n      <p>Found {accounts?.length} accounts</p>\n    </div>\n  );\n}\n```\n\n### With Memcmp Filter\n\n```tsx\nconst { accounts } = useProgramAccounts({\n  program: programId,\n  config: {\n    filters: [\n      {\n        memcmp: {\n          offset: 0n,\n          bytes: base58.encode(ownerPubkey),\n          encoding: \"base58\",\n        },\n      },\n    ],\n  },\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseProgramAccountsOptions {\n  program: Address | string;\n  config?: {\n    encoding?: \"base64\" | \"jsonParsed\";\n    filters?: Filter[];\n    commitment?: Commitment;\n    minContextSlot?: number;\n    withContext?: boolean;\n  };\n  decoder?: Decoder<T>;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useTokenMint\n\nGet a decoded [Mint account](https://solana.com/docs/tokens#mint-account) for a token.\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useTokenMint } from \"@gillsdk/react\";\n\nexport function TokenInfo() {\n  const { account, isLoading } = useTokenMint({\n    // USDC mint on mainnet\n    mint: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n  });\n\n  if (isLoading) return <div>Loading...</div>;\n\n  const mintData = account?.data;\n  return (\n    <div>\n      <p>Supply: {mintData?.supply.toString()}</p>\n      <p>Decimals: {mintData?.decimals}</p>\n      <p>Mint Authority: {mintData?.mintAuthority?.toString()}</p>\n    </div>\n  );\n}\n```\n\n### Parameters\n\n```typescript\ninterface UseTokenMintOptions {\n  mint: Address | string;\n  commitment?: Commitment;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## useTokenAccount\n\nGet the decoded [Token Account](https://solana.com/docs/tokens#token-account) for a given mint and\nowner, automatically deriving the Associated Token Account (ATA) address:\n\n### Usage\n\n```tsx\n\"use client\";\n\nimport { useTokenAccount } from \"@gillsdk/react\";\n\nexport function TokenBalance() {\n  const { account, isLoading } = useTokenAccount({\n    mint: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n    owner: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  if (isLoading) return <div>Loading...</div>;\n\n  const tokenData = account?.data;\n  return (\n    <div>\n      <p>Balance: {tokenData?.amount.toString()}</p>\n      <p>Delegated: {tokenData?.delegatedAmount.toString()}</p>\n    </div>\n  );\n}\n```\n\n### With ATA Address\n\nIf you need to fetch and decode a specific Token Account's address (like for ancillary token\naccounts), you can manually derive the address and provide it to the hook:\n\n```tsx\nconst { account } = useTokenAccount({\n  ata: \"CCMCWh4FudPEmY6Q1AVi5o8mQMXkHYkJUmZfzRGdcJ9P\",\n});\n```\n\n### Parameters\n\n```typescript\ninterface UseTokenAccountOptions {\n  // Option 1: Provide mint and owner\n  mint?: Address | string;\n  owner?: Address | string;\n\n  // Option 2: Provide ATA address directly\n  ata?: Address | string;\n\n  commitment?: Commitment;\n  enabled?: boolean;\n  // ... other TanStack Query options\n}\n```\n\n## Performance Optimization\n\n### Conditional Fetching\n\n```tsx\nconst { balance } = useBalance({\n  address: walletAddress,\n  enabled: !!walletAddress, // Only fetch if address exists\n});\n```\n\n### Stale Time Configuration\n\n```tsx\nconst { account } = useAccount({\n  address,\n  options: {\n    staleTime: 30000, // Consider data fresh for 30 seconds\n    cacheTime: 300000, // Keep in cache for 5 minutes\n  },\n});\n```\n\n### Query Invalidation\n\n```tsx\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nfunction RefreshButton() {\n  const queryClient = useQueryClient();\n\n  const refreshAll = () => {\n    // Invalidate all `@gillsdk/react` queries\n    queryClient.invalidateQueries({ queryKey: [\"gill\"] });\n  };\n\n  return <button onClick={refreshAll}>Refresh All</button>;\n}\n```\n"
  },
  {
    "path": "docs/content/docs/react/hooks/index.mdx",
    "content": "---\ntitle: React Hooks Reference\ndescription: Complete reference for all available hooks in @gillsdk/react\n---\n\n`@gillsdk/react` provides a comprehensive set of React hooks for interacting with the Solana\nblockchain. All hooks are built on top of TanStack Query, providing automatic caching, background\nrefetching, and error handling.\n\n## Hook Categories\n\n### Client Management\n\nHooks for managing and accessing the Solana client connection:\n\n- [`useSolanaClient`](/docs/react/hooks/client#usesolanaclient) - Get the current Solana client\n- [`useUpdateSolanaClient`](/docs/react/hooks/client#useupdatesolanaclient) - Update the Solana\n  client\n\n### Data Fetching\n\nHooks for fetching data from the Solana blockchain:\n\n- [`useAccount`](/docs/react/hooks/data-fetching#useaccount) - Get account info and data\n- [`useBalance`](/docs/react/hooks/data-fetching#usebalance) - Get an account's balance\n- [`useLatestBlockhash`](/docs/react/hooks/data-fetching#uselatestblockhash) - Get the latest\n  blockhash\n- [`useSignatureStatuses`](/docs/react/hooks/data-fetching#usesignaturestatuses) - Get the statuses\n  of signatures\n- [`useSignaturesForAddress`](/docs/react/hooks/data-fetching#usesignaturesforaddress) - Get\n  signatures for an address\n- [`useProgramAccounts`](/docs/react/hooks/data-fetching#useprogramaccounts) - Get all accounts\n  owned by a program\n- [`useTokenMint`](/docs/react/hooks/data-fetching#usetokenmint) - Get a token mint account\n- [`useTokenAccount`](/docs/react/hooks/data-fetching#usetokenaccount) - Get a token account\n\n### Transaction Handling\n\nHooks for sending and managing transactions (coming soon):\n\n- `useSendTransaction` - Send transactions with automatic confirmation\n- `useSimulateTransaction` - Simulate transactions before sending\n\n## Common Hook Options\n\nAll data fetching hooks in `@gillsdk/react` accept standard TanStack Query options:\n\n```typescript\ninterface HookOptions {\n  // Query key for caching\n  queryKey?: QueryKey;\n\n  // How often to refetch in milliseconds\n  refetchInterval?: number;\n\n  // Whether to refetch on window focus\n  refetchOnWindowFocus?: boolean;\n\n  // Whether to refetch on reconnect\n  refetchOnReconnect?: boolean;\n\n  // Time in milliseconds before data is considered stale\n  staleTime?: number;\n\n  // Time in milliseconds to keep data in cache\n  cacheTime?: number;\n\n  // Whether to enable the query\n  enabled?: boolean;\n\n  // Retry configuration\n  retry?: boolean | number | RetryConfig;\n}\n```\n\n## Common Return Values\n\nAll data fetching hooks return a consistent shape based on TanStack Query:\n\n```typescript\ninterface HookResult<T> {\n  // The fetched data - hooks return specific field names like `account`, `balance`, etc. instead of generic `data`\n  account?: T; // or balance, signatures, etc. depending on the hook\n\n  // Loading state\n  isLoading: boolean;\n  isFetching: boolean;\n\n  // Error state\n  isError: boolean;\n  error: Error | null;\n\n  // Success state\n  isSuccess: boolean;\n\n  // Refetch function\n  refetch: () => void;\n\n  // Query status\n  status: \"loading\" | \"error\" | \"success\" | \"idle\";\n}\n```\n\n## Error Handling\n\nAll hooks provide built-in error handling. You can handle errors at the component level:\n\n```tsx\nfunction MyComponent() {\n  const { balance, isError, error } = useBalance({\n    address: \"...\",\n  });\n\n  if (isError) {\n    return <div>Error: {error?.message}</div>;\n  }\n\n  // ... rest of component\n}\n```\n\nOr configure global error handling through TanStack Query:\n\n```tsx\nimport { QueryClient } from \"@tanstack/react-query\";\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      onError: (error) => {\n        console.error(\"Query error:\", error);\n        // Handle error globally\n      },\n    },\n  },\n});\n```\n\n## Performance Tips\n\n1. **Use `staleTime` wisely** - Set appropriate stale times to reduce unnecessary refetches\n2. **Enable queries conditionally** - Use the `enabled` option to prevent unnecessary queries\n3. **Batch requests** - Multiple hooks can share the same query key to deduplicate requests\n4. **Implement pagination** - For large datasets, use pagination parameters\n\n## TypeScript Support\n\nAll hooks are fully typed with TypeScript. Import types from `gill` for complete type safety:\n\n```typescript\nimport type { Address, Lamports } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nfunction Balance({ address }: { address: Address }) {\n  const { balance } = useBalance({ address });\n  // balance is typed as `Lamports | undefined`\n}\n```\n"
  },
  {
    "path": "docs/content/docs/react/hooks/meta.json",
    "content": "{\n  \"title\": \"Hooks\",\n  \"defaultOpen\": false,\n  \"pages\": [\"index\", \"client\", \"data-fetching\", \"transactions\"]\n}\n"
  },
  {
    "path": "docs/content/docs/react/hooks/transactions.mdx",
    "content": "---\ntitle: Transaction Hooks\ndescription: Hooks for sending and managing Solana transactions\n---\n\n<Callout type=\"info\">\n  Transaction hooks are coming soon to `@gillsdk/react`. This page documents the planned API.\n</Callout>\n\nThese hooks will provide an easy way to send, confirm, and manage Solana transactions with automatic\nerror handling and retry logic.\n\n## Planned Hooks\n\n### useSendTransaction\n\nSend and confirm transactions with automatic retry and confirmation handling.\n\n```tsx\n// Coming soon\nconst { sendTransaction, isLoading, error } = useSendTransaction();\n\nconst handleTransfer = async () => {\n  const signature = await sendTransaction({\n    transaction,\n    signers: [keypair],\n    options: {\n      skipPreflight: false,\n      commitment: \"confirmed\",\n    },\n  });\n};\n```\n\n### useSimulateTransaction\n\nSimulate transactions before sending to check for errors.\n\n```tsx\n// Coming soon\nconst { simulate, result } = useSimulateTransaction();\n\nconst checkTransaction = async () => {\n  const simulation = await simulate({\n    transaction,\n    signers: [keypair],\n  });\n\n  if (simulation.err) {\n    console.error(\"Transaction would fail:\", simulation.err);\n  }\n};\n```\n\n### useTransactionStatus\n\nMonitor transaction confirmation status in real-time.\n\n```tsx\n// Coming soon\nconst { status, confirmations } = useTransactionStatus({\n  signature: \"...\",\n  targetConfirmations: 10,\n});\n```\n\n## Current Approach\n\nUntil transaction hooks are available, you can use the Solana client directly:\n\n```tsx\n\"use client\";\n\nimport { useSolanaClient } from \"@gillsdk/react\";\nimport { createTransaction } from \"gill\";\n\nexport function SendTransaction() {\n  const { rpc, sendAndConfirmTransaction } = useSolanaClient();\n  const [isLoading, setIsLoading] = useState(false);\n\n  const handleSend = async () => {\n    setIsLoading(true);\n    try {\n      // Create your transaction\n      const transaction = createTransaction({\n        // ... transaction params\n      });\n\n      // Send and confirm\n      const signature = await sendAndConfirmTransaction(transaction, { commitment: \"confirmed\" });\n\n      console.log(\"Transaction confirmed:\", signature);\n    } catch (error) {\n      console.error(\"Transaction failed:\", error);\n    } finally {\n      setIsLoading(false);\n    }\n  };\n\n  return (\n    <button onClick={handleSend} disabled={isLoading}>\n      {isLoading ? \"Sending...\" : \"Send Transaction\"}\n    </button>\n  );\n}\n```\n\n## With Wallet Adapter\n\nIf you're using a wallet adapter, combine it with `@gillsdk/react`:\n\n```tsx\n\"use client\";\n\nimport { useWallet } from \"@solana/wallet-adapter-react\";\nimport { useSolanaClient } from \"@gillsdk/react\";\nimport { createTransaction } from \"gill\";\n\nexport function WalletTransaction() {\n  const { publicKey, signTransaction } = useWallet();\n  const { rpc } = useSolanaClient();\n\n  const sendTransaction = async () => {\n    if (!publicKey || !signTransaction) return;\n\n    // Create transaction\n    const transaction = createTransaction({\n      // ... params\n    });\n\n    // Sign with wallet\n    const signedTx = await signTransaction(transaction);\n\n    // Send via RPC\n    const signature = await rpc.sendTransaction(signedTx, { skipPreflight: false }).send();\n\n    console.log(\"Sent:\", signature);\n  };\n\n  // ... rest of component\n}\n```\n\n## Contributing\n\nTransaction hooks are actively being developed. If you have suggestions or want to contribute,\nplease check out the\n[`@gillsdk/react` repository](https://github.com/gillsdk/gill/tree/master/packages/react) on GitHub.\n"
  },
  {
    "path": "docs/content/docs/react/index.mdx",
    "content": "---\ntitle: React Hooks for Solana\ndescription:\n  A React hooks library for easily interacting with the Solana blockchain, built on top of gill\n---\n\nWelcome to `@gillsdk/react`, a React hooks library for easily interacting with the\n[Solana](http://solana.com/) blockchain.\n\n<Callout type=\"info\">\n  `@gillsdk/react` is in active development. All APIs are subject to change until reaching the first\n  major version (v1.0.0).\n</Callout>\n\nThis React hooks library is built on top of two core libraries:\n\n1. [`gill`](https://www.npmjs.com/package/gill) - modern JavaScript/TypeScript library for\n   interacting with the Solana blockchain.\n2. [`@tanstack/react-query`](https://www.npmjs.com/package/@tanstack/react-query) - popular and\n   powerful asynchronous state management for React.\n\n## Installation\n\nInstall `@gillsdk/react` with your package manager of choice:\n\n```package-install\ngill @gillsdk/react @tanstack/react-query\n```\n\n<Callout>\n  `gill` and `@tanstack/react-query` are peer dependencies of `@gillsdk/react` so you need to\n  explicitly install them. This allows you have more control over managing dependencies yourself.\n</Callout>\n\n## Key Features\n\n- **Type-safe hooks** - Full TypeScript support with proper typing for all Solana data\n- **Built on TanStack Query** - Leverages the power of React Query for caching, background\n  refetching, and optimistic updates\n- **Easy to use** - Simple, intuitive API that follows React best practices\n- **Server component ready** - Works with Next.js and other React Server Component frameworks\n- **Lightweight** - Minimal bundle size with tree-shaking support\n\n## Available Hooks\n\n### Client Management\n\n- [`useSolanaClient`](/docs/react/hooks/client#usesolanaclient) - Get the current Solana client\n- [`useUpdateSolanaClient`](/docs/react/hooks/client#useupdatesolanaclient) - Update the Solana\n  client\n\n### Data Fetching\n\n- [`useAccount`](/docs/react/hooks/data-fetching#useaccount) - Get account info and data\n- [`useBalance`](/docs/react/hooks/data-fetching#usebalance) - Get an account's balance in lamports\n- [`useLatestBlockhash`](/docs/react/hooks/data-fetching#uselatestblockhash) - Get the latest\n  blockhash\n- [`useSignatureStatuses`](/docs/react/hooks/data-fetching#usesignaturestatuses) - Get the statuses\n  of signatures\n- [`useSignaturesForAddress`](/docs/react/hooks/data-fetching#usesignaturesforaddress) - Get\n  signatures for an address\n- [`useProgramAccounts`](/docs/react/hooks/data-fetching#useprogramaccounts) - Get all accounts\n  owned by a program (GPA)\n- [`useTokenMint`](/docs/react/hooks/data-fetching#usetokenmint) - Get a decoded token's Mint\n  account\n- [`useTokenAccount`](/docs/react/hooks/data-fetching#usetokenaccount) - Get a token account for a\n  mint and owner\n\n## Quick Example\n\n```tsx\nimport { lamportsToSol } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nexport function WalletBalance({ address }: { address: string }) {\n  const { balance, isLoading, isError, error } = useBalance({ address });\n\n  if (isLoading) return <div>Loading...</div>;\n  if (isError) return <div>Error: {error?.message}</div>;\n\n  return (\n    <div>\n      <p>Balance: {lamportsToSol(balance)} SOL</p>\n    </div>\n  );\n}\n```\n"
  },
  {
    "path": "docs/content/docs/react/meta.json",
    "content": "{\n  \"title\": \"React\",\n  \"defaultOpen\": false,\n  \"pages\": [\"index\", \"getting-started\", \"hooks\", \"examples\"]\n}\n"
  },
  {
    "path": "docs/content/docs/typescript.mdx",
    "content": "---\ntitle: TypeScript Support\ndescription:\n  The gill library is TypeScript first and heavily typed to improve your Solana developer\n  experience.\n---\n\nGill is a heavily typed library to improve developer experience. After completing the\n[simple installation guide](/docs#install-gill) to get your Solana application setup, everything\n_should_ work out of the box for most common application configurations.\n\nHowever, there may be some configuration your codebase may require in order to utilize the gill\nlibrary and avoid TypeScript issues, either in your editor, runtime, or build time.\n\n<Callout title=\"Having TypeScript issues?\">\n  If your codebase is experiencing TypeScript related issues not covered by this document, please\n  [open an issue here](https://github.com/gillsdk/gill/issues/new?title=%5BTypeScript%5D%20) to\n  describe your scenario. Please also include a simple reproduction to aid in troubleshooting by\n  this library's maintainers.\n</Callout>\n\n## Running \\*.ts files with NodeJS\n\nMore recent versions of NodeJS support TypeScript natively, either out of the box or requiring using\nthe `--experimental-strip-types` flag. Allowing you to run `.ts` files using the `node` command.\n\n```shell\nnode --version\n# output: v24.1.0\nnode ./file.ts\n```\n\nHowever, due to the differences in how NodeJS handles these types you may experience runtime errors\nwhen attempting to run `.ts` files. The following is an example error message you may experience:\n\n```\nfile:///home/gill/code/file.ts:22\n  SolanaClusterMoniker,\n  ^^^^^^^^^^^^^^^^^^^^\nSyntaxError: The requested module 'gill' does not provide an export named 'SolanaClusterMoniker'\n```\n\n### Solution\n\n<Steps>\n\n<Step>\n\nUpdate your project's `tsconfig.json` file to utilize the\n[verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax) compiler\noption. This will ensure your editor and build system will correctly show errors when codes does not\nexplicitly annotate imported types/interfaces with the `type` keyword.\n\n```ts\n{\n  \"compilerOptions\": {\n    \"verbatimModuleSyntax\": true,\n  }\n}\n```\n\n</Step>\n\n<Step>\n\nYou will then need to update all your `import` statements to annotate which imported symbols are\ntypes by explicitly using the `type` keyword. This is required for all TypeScript types **AND**\ninterfaces.\n\nFor example, `SolanaClusterMoniker` is a type export from `gill`:\n\n```ts\nimport { createSolanaClient, SolanaClusterMoniker } from \"gill\";\n```\n\nIt should be updated to be explicitly imported as a `type` (for both TypeScript's types and\ninterfaces):\n\n```ts tab=\"Option 1 (recommended)\"\nimport { createSolanaClient } from \"gill\";\nimport type { SolanaClusterMoniker } from \"gill\";\n```\n\n```ts tab=\"Option 2\"\nimport { createSolanaClient, type SolanaClusterMoniker } from \"gill\";\n```\n\n<Callout title=\"Pro Tip\">\n  If you declare two different imports from the same library, one with the `type` keyword and one\n  without. Most code editors will correct import new types into the \"type import\" statement when\n  performing tab completion. Making it so you do not have to manually add the `type` annotation to\n  each individual imported type.\n</Callout>\n\n</Step>\n</Steps>\n"
  },
  {
    "path": "docs/generic.d.ts",
    "content": "type Option<T> = Some<T> | None;\n\ntype Entries<T> = {\n  [K in keyof T]: [K, T[K]];\n}[keyof T][];\n\ntype SearchParams<TKeys extends string = string> = Promise<\n  Record<TKeys, string | string[] | undefined>\n>;\n\ntype SiteConfig = {\n  name: string;\n  domain: string;\n  description: string;\n  url: string;\n  ogImage: string;\n  links: {\n    twitter?: string;\n    github?: string;\n    docs?: string;\n    changelog?: string;\n  };\n  twitterHandle?: string;\n  twitterId?: string;\n};\n\ntype NotFoundResponse = { notFound: true };\n\ntype SimpleComponentProps = {\n  children?: React.ReactNode;\n  className?: string;\n};\n\ntype ImageSize = {\n  width: number;\n  height: number;\n};\n\ntype LinkDetails = {\n  title: string;\n  href: string;\n  description?: React.ReactNode;\n  icon?: string;\n  subLinks?: SubLinkDetails[];\n};\n\ntype SubLinkDetails = Omit<LinkDetails, \"subLinks\">;\n"
  },
  {
    "path": "docs/next.config.mjs",
    "content": "import { createMDX } from 'fumadocs-mdx/next';\n\nconst withMDX = createMDX();\n\n/** @type {import('next').NextConfig} */\nconst config = {\n    experimental: {\n        webpackMemoryOptimizations: true,\n    },\n    reactStrictMode: true,\n    serverExternalPackages: ['twoslash', 'typescript'],\n};\n\nexport default withMDX(config);\n"
  },
  {
    "path": "docs/package.json",
    "content": "{\n  \"name\": \"@gillsdk/docs\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"update:gill\": \"pnpm add --ignore-workspace gill@latest @gillsdk/react@latest @gillsdk/solana-pay@latest\",\n    \"prebuild\": \"./build-api-docs.sh\",\n    \"build\": \"next build\",\n    \"dev\": \"next dev --turbo\",\n    \"start\": \"next start\",\n    \"postinstall\": \"fumadocs-mdx\",\n    \"clean\": \"rimraf coverage dist build node_modules .turbo .next .docs ./content/api/gill*\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\",\n    \"lint\": \"eslint src\",\n    \"lint:fix\": \"eslint --fix src\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\",\n    \"npm\": \"please-use-pnpm\",\n    \"pnpm\": \"^9\",\n    \"yarn\": \"please-use-pnpm\"\n  },\n  \"dependencies\": {\n    \"@gillsdk/react\": \"^0.6.2\",\n    \"@gillsdk/solana-pay\": \"^0.6.2\",\n    \"fathom-client\": \"^3.7.2\",\n    \"fumadocs-core\": \"15.8.5\",\n    \"fumadocs-docgen\": \"^2.1.0\",\n    \"fumadocs-mdx\": \"13.0.8\",\n    \"fumadocs-twoslash\": \"^3.1.14\",\n    \"fumadocs-ui\": \"15.8.5\",\n    \"gill\": \"0.14.0\",\n    \"lucide-react\": \"^0.513.0\",\n    \"next\": \"15.3.9\",\n    \"react\": \"^19.0.0\",\n    \"react-dom\": \"^19.0.0\",\n    \"twoslash\": \"^0.3.1\"\n  },\n  \"devDependencies\": {\n    \"@tailwindcss/postcss\": \"^4.1.4\",\n    \"@types/mdx\": \"^2.0.13\",\n    \"@types/node\": \"22.13.8\",\n    \"@types/react\": \"^19.0.10\",\n    \"@types/react-dom\": \"^19.0.4\",\n    \"eslint\": \"^8\",\n    \"eslint-config-next\": \"15.3.9\",\n    \"postcss\": \"^8.5.3\",\n    \"prettier\": \"^3.3\",\n    \"tailwindcss\": \"^4.1.4\",\n    \"typescript\": \"^5.8.3\"\n  },\n  \"packageManager\": \"pnpm@9.1.0\"\n}\n"
  },
  {
    "path": "docs/postcss.config.mjs",
    "content": "export default {\n    plugins: {\n        '@tailwindcss/postcss': {},\n    },\n};\n"
  },
  {
    "path": "docs/public/site.webmanifest",
    "content": "{\"name\":\"\",\"short_name\":\"\",\"icons\":[{\"src\":\"/android-chrome-192x192.png\",\"sizes\":\"192x192\",\"type\":\"image/png\"},{\"src\":\"/android-chrome-512x512.png\",\"sizes\":\"512x512\",\"type\":\"image/png\"}],\"theme_color\":\"#ffffff\",\"background_color\":\"#ffffff\",\"display\":\"standalone\"}"
  },
  {
    "path": "docs/source.config.ts",
    "content": "import { rehypeCodeDefaultOptions } from \"fumadocs-core/mdx-plugins\";\nimport { remarkInstall } from \"fumadocs-docgen\";\nimport { defineConfig, defineDocs } from \"fumadocs-mdx/config\";\nimport { transformerTwoslash } from \"fumadocs-twoslash\";\n\nexport default defineConfig({\n  mdxOptions: {\n    rehypeCodeOptions: {\n      langs: [\n        // FIXME(#403): If a popup itself contains a code fence in any language other than\n        // `ts`, the Shiki highlighter will throw an error that it hasn't loaded that\n        // language. Until we figure this out, preemptively load the `js` language.\n        \"js\",\n      ],\n      themes: {\n        dark: \"github-dark\",\n        light: \"github-light\",\n      },\n      transformers: [...(rehypeCodeDefaultOptions.transformers ?? []), transformerTwoslash()],\n    },\n    remarkPlugins: [() => remarkInstall({ persist: { id: \"package-install\" } })],\n  },\n});\n\nexport const docs = defineDocs({\n  dir: \"content/docs\",\n});\n\nexport const api = defineDocs({\n  dir: \"content/api\",\n});\n"
  },
  {
    "path": "docs/src/app/(home)/layout.tsx",
    "content": "import type { ReactNode } from \"react\";\nimport { HomeLayout } from \"fumadocs-ui/layouts/home\";\nimport { baseOptions } from \"@/app/layout.config\";\n\nexport default function Layout({ children }: { children: ReactNode }) {\n  return <HomeLayout {...baseOptions}>{children}</HomeLayout>;\n}\n"
  },
  {
    "path": "docs/src/app/(home)/page.tsx",
    "content": "import { FooterLinks } from \"@/components/footer-links\";\nimport { PackageBadges } from \"@/components/package-badges\";\nimport { siteConfig } from \"@/const\";\nimport icon from \"@@/public/icon-black.svg\";\nimport { CodeBlock, Pre } from \"fumadocs-ui/components/codeblock\";\nimport { Tab, Tabs } from \"fumadocs-ui/components/tabs\";\nimport Image from \"next/image\";\nimport Link from \"next/link\";\n\nexport default function Page() {\n  return (\n    <main className=\"flex flex-col justify-center flex-1 p-4 space-y-6\">\n      <h1 className=\"mx-auto mb-4 text-5xl font-bold\">\n        <Link href={\"/\"} className=\"inline-flex items-center gap-2\">\n          <Image src={icon} alt={\"\"} className=\"dark:invert size-16\"></Image> {siteConfig.name}\n        </Link>\n      </h1>\n\n      <section className=\"mx-auto space-y-3 text-center\">\n        <p className=\"max-w-md text-fd-muted-foreground\">\n          gill is a modern javascript/typescript client library for interacting with the Solana\n          blockchain\n        </p>\n\n        <PackageBadges packageName=\"gill\" />\n      </section>\n\n      <Tabs\n        items={[\"npm\", \"pnpm\", \"yarn\", \"bun\"]}\n        className=\"fd-codeblock w-full max-w-md mx-auto rounded-lg\"\n      >\n        <Tab value=\"npm\">\n          <CodeBlock className=\"rounded-none\">\n            <Pre className=\"px-4\">npm install gill</Pre>\n          </CodeBlock>\n        </Tab>\n        <Tab value=\"pnpm\">\n          <CodeBlock className=\"rounded-none\">\n            <Pre className=\"px-4\">pnpm add gill</Pre>\n          </CodeBlock>\n        </Tab>\n        <Tab value=\"yarn\">\n          <CodeBlock className=\"rounded-none\">\n            <Pre className=\"px-4\">yarn add gill</Pre>\n          </CodeBlock>\n        </Tab>\n        <Tab value=\"bun\">\n          <CodeBlock className=\"rounded-none\">\n            <Pre className=\"px-4\">bun install gill</Pre>\n          </CodeBlock>\n        </Tab>\n      </Tabs>\n\n      <Link href=\"/docs\" className=\"inline-flex items-center justify-center gap-2 text-center link\">\n        Read the quickstart guide\n      </Link>\n\n      <FooterLinks />\n    </main>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/api/[[...slug]]/page.tsx",
    "content": "import { getPageTreePeers } from \"fumadocs-core/server\";\nimport { Popup, PopupContent, PopupTrigger } from \"fumadocs-twoslash/ui\";\nimport { Card, Cards } from \"fumadocs-ui/components/card\";\nimport { ImageZoom } from \"fumadocs-ui/components/image-zoom\";\nimport { Step, Steps } from \"fumadocs-ui/components/steps\";\nimport { Tab, Tabs } from \"fumadocs-ui/components/tabs\";\nimport defaultMdxComponents from \"fumadocs-ui/mdx\";\nimport { DocsBody, DocsDescription, DocsPage, DocsTitle } from \"fumadocs-ui/page\";\nimport type { Metadata } from \"next\";\nimport { notFound } from \"next/navigation\";\n\nimport { apiSource } from \"@/lib/source\";\nimport { Spread } from \"@/lib/Spread\";\n\nexport async function generateStaticParams() {\n  return apiSource.generateParams();\n}\n\nexport async function generateMetadata(props: {\n  params: Promise<{ slug?: string[] }>;\n}): Promise<Metadata> {\n  const { slug = [\"\"] } = await props.params;\n  const page = apiSource.getPage(slug);\n  if (!page) notFound();\n\n  const image = {\n    url: `/images/og/api_references.png`,\n    width: 1200,\n    height: 630,\n  };\n\n  return {\n    title: page.data.title,\n    description: page.data.description,\n    openGraph: {\n      url: `/api/${page.slugs.join(\"/\")}`,\n      images: [image],\n    },\n    twitter: {\n      images: [image],\n    },\n  };\n}\n\nexport default async function Page(props: { params: Promise<{ slug?: string[] }> }) {\n  const params = await props.params;\n  const page = apiSource.getPage(params.slug);\n  if (!page) notFound();\n\n  const MDX = page.data.body;\n  const hasCategory = page.file.name === \"index\" && page.slugs.length > 0;\n\n  return (\n    <DocsPage toc={page.data.toc} full={page.data.full}>\n      <DocsTitle>{page.data.title}</DocsTitle>\n      <DocsDescription className=\"mb-16\">{page.data.description}</DocsDescription>\n      <DocsBody>\n        <MDX\n          components={{\n            ...defaultMdxComponents,\n            img: (props) => <ImageZoom {...props} />,\n            Popup,\n            PopupContent,\n            PopupTrigger,\n            Spread,\n            Step,\n            Steps,\n            Tab,\n            Tabs,\n          }}\n        />\n      </DocsBody>\n      {hasCategory && (\n        <Cards>\n          {getPageTreePeers(apiSource.pageTree, page.url).map((peer) => (\n            <Card key={peer.url} title={peer.name} href={peer.url}>\n              {peer.description}\n            </Card>\n          ))}\n        </Cards>\n      )}\n    </DocsPage>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/api/layout.tsx",
    "content": "import { DocsLayout } from \"fumadocs-ui/layouts/docs\";\nimport type { ReactNode } from \"react\";\nimport { baseOptions } from \"@/app/layout.config\";\nimport { apiSource } from \"@/lib/source\";\nimport { Metadata } from \"next\";\nimport { siteConfig } from \"@/const\";\n\nexport const metadata: Metadata = {\n  title: {\n    default: `${siteConfig.name} API References`,\n    template: `%s | ${siteConfig.name} API`,\n  },\n  description: siteConfig.description,\n};\n\nexport default function Layout({ children }: { children: ReactNode }) {\n  return (\n    <DocsLayout tree={apiSource.pageTree} {...baseOptions}>\n      {children}\n    </DocsLayout>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/api/search/route.ts",
    "content": "import { docsSource } from \"@/lib/source\";\nimport { createFromSource } from \"fumadocs-core/search/server\";\n\nexport const { GET } = createFromSource(docsSource);\n"
  },
  {
    "path": "docs/src/app/docs/[[...slug]]/page.tsx",
    "content": "import { docsSource } from \"@/lib/source\";\nimport { Spread } from \"@/lib/Spread\";\nimport { getPageTreePeers } from \"fumadocs-core/server\";\nimport { Popup, PopupContent, PopupTrigger } from \"fumadocs-twoslash/ui\";\nimport { Card, Cards } from \"fumadocs-ui/components/card\";\nimport { ImageZoom } from \"fumadocs-ui/components/image-zoom\";\nimport { Step, Steps } from \"fumadocs-ui/components/steps\";\nimport { Tab, Tabs } from \"fumadocs-ui/components/tabs\";\nimport defaultMdxComponents from \"fumadocs-ui/mdx\";\nimport { DocsBody, DocsDescription, DocsPage, DocsTitle } from \"fumadocs-ui/page\";\nimport type { Metadata } from \"next\";\nimport { notFound } from \"next/navigation\";\n\nexport async function generateStaticParams() {\n  return docsSource.generateParams();\n}\n\nexport async function generateMetadata(props: {\n  params: Promise<{ slug?: string[] }>;\n}): Promise<Metadata> {\n  const { slug = [\"\"] } = await props.params;\n  const page = docsSource.getPage(slug);\n  if (!page) notFound();\n\n  const image = {\n    url: [\"/docs/og\", ...slug, \"image.png\"].join(\"/\") + `?ref=${Date.now()}`,\n    width: 1200,\n    height: 630,\n  };\n\n  return {\n    title: page.data.title,\n    description: page.data.description,\n    openGraph: {\n      url: `/docs/${page.slugs.join(\"/\")}`,\n      images: [image],\n    },\n    twitter: {\n      images: [image],\n    },\n  };\n}\n\nexport default async function Page(props: { params: Promise<{ slug?: string[] }> }) {\n  const params = await props.params;\n  const page = docsSource.getPage(params.slug);\n  if (!page) notFound();\n\n  const MDX = page.data.body;\n  const hasCategory = page.file.name === \"index\" && page.slugs.length > 0;\n  // Don't show cards for the React section index page\n  const isReactIndex = page.slugs.join(\"/\") === \"react\";\n  const showCards = !isReactIndex;\n\n  return (\n    <DocsPage toc={page.data.toc} full={page.data.full}>\n      <DocsTitle>{page.data.title}</DocsTitle>\n      <DocsDescription className=\"mb-16\">{page.data.description}</DocsDescription>\n      <DocsBody>\n        <MDX\n          components={{\n            ...defaultMdxComponents,\n            img: (props) => <ImageZoom {...props} />,\n            Popup,\n            PopupContent,\n            PopupTrigger,\n            Spread,\n            Step,\n            Steps,\n            Tab,\n            Tabs,\n          }}\n        />\n      </DocsBody>\n      {hasCategory && showCards && (\n        <Cards>\n          {getPageTreePeers(docsSource.pageTree, page.url).map((peer) => (\n            <Card key={peer.url} title={peer.name} href={peer.url}>\n              {peer.description}\n            </Card>\n          ))}\n        </Cards>\n      )}\n    </DocsPage>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/docs/layout.tsx",
    "content": "import { DocsLayout } from \"fumadocs-ui/layouts/docs\";\nimport type { ReactNode } from \"react\";\nimport { baseOptions } from \"@/app/layout.config\";\nimport { docsSource } from \"@/lib/source\";\n\nexport default function Layout({ children }: { children: ReactNode }) {\n  return (\n    <DocsLayout tree={docsSource.pageTree} {...baseOptions}>\n      {children}\n    </DocsLayout>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/docs/og/[...slug]/og.tsx",
    "content": "import { ImageResponse } from \"next/og\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { ImageResponseOptions } from \"next/dist/compiled/@vercel/og/types\";\n\ninterface GenerateProps {\n  title: ReactNode;\n  description?: ReactNode;\n  primaryTextColor?: string;\n}\n\nexport function generateOGImage(options: GenerateProps & ImageResponseOptions): ImageResponse {\n  const { title, description, primaryTextColor, ...rest } = options;\n\n  return new ImageResponse(\n    generate({\n      title,\n      description,\n      primaryTextColor,\n    }),\n    {\n      width: 1200,\n      height: 630,\n      ...rest,\n    },\n  );\n}\n\nexport function generate({\n  primaryTextColor = \"rgb(255,150,255)\",\n  ...props\n}: GenerateProps): ReactElement {\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        flexDirection: \"column\",\n        width: \"100%\",\n        height: \"100%\",\n        color: \"white\",\n        backgroundColor: \"#121212\",\n      }}\n    >\n      <div\n        style={{\n          display: \"flex\",\n          flexDirection: \"column\",\n          width: \"100%\",\n          height: \"100%\",\n          padding: \"4rem\",\n        }}\n      >\n        <p\n          style={{\n            fontWeight: 600,\n            fontSize: \"76px\",\n          }}\n        >\n          {props.title}\n        </p>\n        <p\n          style={{\n            fontSize: \"48px\",\n            color: \"rgba(240,240,240,0.7)\",\n          }}\n        >\n          {props.description}\n        </p>\n        <div\n          style={{\n            display: \"flex\",\n            flexDirection: \"row\",\n            alignItems: \"center\",\n            justifyContent: \"space-between\",\n            marginTop: \"auto\",\n            width: \"100%\",\n          }}\n        >\n          <div\n            style={{\n              display: \"flex\",\n              flexDirection: \"row\",\n              alignItems: \"center\",\n              gap: \"24px\",\n              marginTop: \"auto\",\n              color: primaryTextColor,\n            }}\n          >\n            <svg viewBox=\"0 0 50 50\" width=\"75\" height=\"75\">\n              <g transform=\"translate(0 0) scale(0.5)\">\n                <g fill=\"#FFFFFF\">\n                  <path d=\"M85.293 52.445c0-5.717 3.197-10.954 8.505-15.021a17.637 17.637 0 0 0-8.505-2.168c-6.982 0-13.009 4.025-15.811 9.843-4.624-6.324-14.526-11.306-23.713-13.423.932-3.056 2.678-5.605 4.905-7.228-1.664-1.206-3.594-1.896-5.652-1.896-4.505 0-8.395 3.306-10.219 8.092-13.164.929-27.985 10.334-27.985 21.801 0 3.731 1.571 7.245 4.143 10.319.038-.002.075-.007.113-.01 1.878 2.216 4.276 4.198 6.98 5.868-.029.027-.056.057-.085.084 5.626 3.49 12.586 5.616 18.937 5.616 4.243 0 9.259-.949 14.155-2.62 2.063 3.485 5.366 5.744 9.09 5.744 2.067 0 4.005-.696 5.672-1.912-2.465-1.786-4.342-4.708-5.185-8.195 3.647-2.156 6.773-4.718 8.844-7.548 2.802 5.818 8.828 9.843 15.811 9.843 3.087 0 5.987-.787 8.505-2.169-5.308-4.065-8.505-9.302-8.505-15.02zm-64.466-.127a3.516 3.516 0 1 1 0-7.032 3.516 3.516 0 0 1 0 7.032zm20.191.956a4.515 4.515 0 0 1-3.538 4.406 4.517 4.517 0 1 1-2.295 8.729 4.517 4.517 0 0 0 0-8.641c.107-.033.217-.062.328-.086a5.09 5.09 0 0 1-.328-.086 4.517 4.517 0 0 0 .404-8.495 5.073 5.073 0 0 1-.404-.101l.066-.023c-.023-.008-.044-.017-.066-.023.131-.04.266-.072.402-.1a4.518 4.518 0 0 0-.403-8.496 4.516 4.516 0 0 1 2.703 8.619 4.515 4.515 0 0 1 3.131 4.297z\"></path>\n                </g>\n              </g>\n            </svg>\n            <p\n              style={{\n                fontSize: \"46px\",\n                fontWeight: 600,\n              }}\n            >\n              gill\n            </p>\n          </div>\n\n          <p\n            style={{\n              fontSize: \"24px\",\n              fontWeight: 400,\n              color: \"rgba(240,240,240,0.7)\",\n            }}\n          >\n            https://gillsdk.com\n          </p>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/docs/og/[...slug]/route.tsx",
    "content": "import { readFileSync } from \"node:fs\";\nimport { generateOGImage } from \"./og\";\nimport { docsSource } from \"@/lib/source\";\nimport { notFound } from \"next/navigation\";\n\nconst font = readFileSync(\"./src/app/docs/og/[...slug]/Inter_24pt-Regular.ttf\");\nconst fontBold = readFileSync(\"./src/app/docs/og/[...slug]/Inter_24pt-SemiBold.ttf\");\n\nexport async function GET(_req: Request, { params }: { params: Promise<{ slug: string[] }> }) {\n  const { slug } = await params;\n  const page = docsSource.getPage(slug.slice(0, -1));\n  if (!page) notFound();\n\n  return generateOGImage({\n    primaryTextColor: \"rgb(240,240,240)\",\n    title: page.data.title,\n    description: page.data.description,\n    fonts: [\n      {\n        name: \"Regular\",\n        data: font,\n        weight: 400,\n      },\n      {\n        name: \"Regular\",\n        data: fontBold,\n        weight: 600,\n      },\n    ],\n  });\n}\n\nexport function generateStaticParams(): {\n  slug: string[];\n}[] {\n  return docsSource.generateParams().map((page) => ({\n    ...page,\n    slug: [...page.slug, \"image.png\"],\n  }));\n}\n"
  },
  {
    "path": "docs/src/app/global.css",
    "content": "@import \"tailwindcss\";\n\n/* Fumadocs imports. */\n@import \"fumadocs-ui/css/neutral.css\";\n@import \"fumadocs-ui/css/preset.css\";\n@import \"fumadocs-twoslash/twoslash.css\";\n@source '../../node_modules/fumadocs-ui/dist/**/*.js';\n\n/* App imports. */\n@import \"../../src/app/styles/brand.css\";\n@import \"../../src/app/styles/typography.css\";\n@import \"../../src/app/styles/fumadocs-overrides.css\";\n\n@layer base {\n  button:not(:disabled),\n  [role=\"button\"]:not(:disabled) {\n    cursor: pointer;\n  }\n\n  .underline {\n    @apply underline-offset-4;\n  }\n\n  .link {\n    @apply underline underline-offset-4;\n    /* @apply text-primary hover:text-accent underline; */\n  }\n}\n"
  },
  {
    "path": "docs/src/app/layout.config.tsx",
    "content": "import type { BaseLayoutProps } from \"fumadocs-ui/layouts/shared\";\nimport { BookTextIcon, CodeXmlIcon, ShapesIcon } from \"lucide-react\";\nimport Image from \"next/image\";\n\nimport icon from \"@@/public/icon-black.svg\";\nimport { siteConfig } from \"@/const\";\n\n/**\n * Shared layout configurations\n *\n * you can customize layouts individually from:\n * Home Layout: app/(home)/layout.tsx\n * Docs Layout: app/docs/layout.tsx\n */\nexport const baseOptions: BaseLayoutProps = {\n  githubUrl: siteConfig.links.github,\n  nav: {\n    title: (\n      <>\n        <Image src={icon} alt=\"\" className=\"dark:invert size-9\"></Image>{\" \"}\n        <span className=\"text-xl font-bold\">{siteConfig.name}</span>\n      </>\n    ),\n  },\n  links: [\n    {\n      text: \"Documentation\",\n      url: \"/docs\",\n      active: \"nested-url\",\n      icon: <BookTextIcon />,\n    },\n    {\n      text: \"Guides\",\n      url: \"/docs/guides\",\n      active: \"nested-url\",\n      icon: <ShapesIcon />,\n    },\n    {\n      text: \"API Reference\",\n      url: \"/api\",\n      active: \"nested-url\",\n      icon: <CodeXmlIcon />,\n    },\n  ],\n};\n"
  },
  {
    "path": "docs/src/app/layout.tsx",
    "content": "import { siteConfig } from \"@/const\";\nimport { RootProvider } from \"fumadocs-ui/provider\";\nimport type { Metadata } from \"next\";\nimport { Inter } from \"next/font/google\";\nimport type { ReactNode } from \"react\";\nimport \"./global.css\";\nimport FathomAnalytics from \"@/components/fathom-analytics\";\n\nconst inter = Inter({\n  subsets: [\"latin\"],\n});\n\nexport const metadata: Metadata = {\n  title: {\n    default: `${siteConfig.name} - Solana JavaScript SDK`,\n    template: `%s | ${siteConfig.name} Solana SDK`,\n  },\n  metadataBase: new URL(siteConfig.url),\n  description: siteConfig.description,\n  openGraph: {\n    images: {\n      url: \"/cover.png\",\n    },\n  },\n  twitter: {\n    card: \"summary_large_image\",\n  },\n};\n\nexport default function Layout({ children }: { children: ReactNode }) {\n  return (\n    <html lang=\"en\" className={inter.className} suppressHydrationWarning>\n      <body className=\"flex flex-col min-h-screen\">\n        <FathomAnalytics />\n        <RootProvider>{children}</RootProvider>\n      </body>\n    </html>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/not-found.tsx",
    "content": "import { FooterLinks } from \"@/components/footer-links\";\nimport { Metadata } from \"next\";\nimport Link from \"next/link\";\n\nexport const metadata: Metadata = {\n  title: \"Page not found\",\n};\n\nexport default function Page() {\n  return (\n    <main className=\"flex flex-col justify-center flex-1 p-4 space-y-6\">\n      <h1 className=\"mx-auto mb-4 text-5xl font-bold\">Page not found</h1>\n\n      <section className=\"mx-auto space-y-3 text-center\">\n        <p className=\"max-w-md text-fd-muted-foreground\">\n          The page you are looking for was not found. Instead, try exploring one of these links\n          below.\n        </p>\n      </section>\n\n      <Link href=\"/docs\" className=\"inline-flex items-center justify-center gap-2 text-center link\">\n        Read the quickstart guide\n      </Link>\n\n      <FooterLinks />\n    </main>\n  );\n}\n"
  },
  {
    "path": "docs/src/app/styles/brand.css",
    "content": "@theme {\n  /* Colors */\n  --color-primary-50: #fff7f1;\n\n  /* Containers */\n  --container-5xs: 12rem;\n  --container-4xs: 14rem;\n}\n"
  },
  {
    "path": "docs/src/app/styles/fumadocs-overrides.css",
    "content": "/* Colours. */\n\n/* @theme {\n  --color-fd-background: #fff7f1;\n  --color-fd-border: #6d5d6e;\n\n  --color-fd-background: hsl(0, 0%, 96%);\n  --color-fd-foreground: hsl(0, 0%, 3.9%);\n  --color-fd-muted: hsl(0, 0%, 96.1%);\n  --color-fd-muted-foreground: hsl(0, 0%, 45.1%);\n  --color-fd-popover: hsl(0, 0%, 98%);\n  --color-fd-popover-foreground: hsl(0, 0%, 15.1%);\n  --color-fd-card: hsl(0, 0%, 94.7%);\n  --color-fd-card-foreground: hsl(0, 0%, 3.9%);\n  --color-fd-border: hsl(0, 0%, 89.8%);\n  --color-fd-primary: hsl(0, 0%, 9%);\n  --color-fd-primary-foreground: hsl(0, 0%, 98%);\n  --color-fd-secondary: hsl(0, 0%, 93.1%);\n  --color-fd-secondary-foreground: hsl(0, 0%, 9%);\n  --color-fd-accent: hsl(0, 0%, 90.1%);\n  --color-fd-accent-foreground: hsl(0, 0%, 9%);\n  --color-fd-ring: hsl(0, 0%, 63.9%);\n  --spacing-fd-container: 1400px;\n  --fd-sidebar-width: 0px;\n  --fd-toc-width: 0px;\n  --fd-layout-width: 100vw;\n  --fd-banner-height: 0px;\n  --fd-nav-height: 0px;\n  --fd-tocnav-height: 0px;\n  --fd-diff-remove-color: rgba(200, 10, 100, 0.12);\n  --fd-diff-remove-symbol-color: rgb(230, 10, 100);\n  --fd-diff-add-color: rgba(14, 180, 100, 0.12);\n  --fd-diff-add-symbol-color: rgb(10, 200, 100);\n} */\n\n/* @variant dark {\n  --color-fd-background: #2a2834;\n  --color-fd-border: #a190a2;\n} */\n\n/* Sidebar. */\n\n/* #nd-sidebar {\n  background-color: #fff7f1;\n\n  @variant dark {\n    background-color: #2a2834;\n  }\n}\n\n#nd-sidebar > div {\n  border-color: transparent;\n} */\n"
  },
  {
    "path": "docs/src/app/styles/typography.css",
    "content": "#nd-page .prose {\n  font-size: 1.05rem;\n}\n\n/* .prose :where(h2):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *, :first-child)) {\n  margin-top: 4em;\n} */\n\n/* .prose :where(h3):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n  margin-top: 3em;\n} */\n\nfigure.shiki pre > *,\n.prose :where(code):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n  font-size: 0.9rem !important;\n}\n"
  },
  {
    "path": "docs/src/components/fathom-analytics.tsx",
    "content": "\"use client\";\nimport { useEffect, Suspense } from \"react\";\nimport { load, trackPageview } from \"fathom-client\";\nimport { usePathname, useSearchParams } from \"next/navigation\";\n\nfunction TrackPageView() {\n  const pathname = usePathname();\n  const searchParams = useSearchParams();\n\n  useEffect(() => {\n    if (process?.env?.NODE_ENV !== \"production\" || !process.env.NEXT_PUBLIC_FATHOM_ID) {\n      return;\n    }\n\n    load(process.env.NEXT_PUBLIC_FATHOM_ID, {\n      auto: false,\n      // includedDomains: [SITE.domain, `www.${SITE.domain}`],\n    });\n  }, []);\n\n  // Record a page view when route changes (including params)\n  useEffect(() => {\n    if (!pathname) return;\n\n    trackPageview({\n      url: pathname + searchParams.toString(),\n      referrer: document.referrer,\n    });\n  }, [pathname, searchParams]);\n\n  return null;\n}\n\nexport default function FathomAnalytics() {\n  return (\n    <Suspense fallback={null}>\n      <TrackPageView />\n    </Suspense>\n  );\n}\n"
  },
  {
    "path": "docs/src/components/footer-links.tsx",
    "content": "import { BookTextIcon, CodeXmlIcon, MoveRightIcon, ShapesIcon } from \"lucide-react\";\nimport Link from \"next/link\";\n\nexport function FooterLinks() {\n  return (\n    <footer className=\"row-start-3 flex flex-wrap items-center justify-center gap-[24px]\">\n      <Link\n        className=\"inline-flex items-center gap-2 hover:underline hover:underline-offset-4\"\n        href=\"/api\"\n      >\n        <CodeXmlIcon strokeWidth={1.0} size={18} />\n        API Reference\n      </Link>\n      <Link\n        className=\"flex items-center gap-2 hover:underline hover:underline-offset-4\"\n        href=\"/docs/guides\"\n      >\n        <ShapesIcon strokeWidth={1.0} size={18} />\n        Guides\n      </Link>\n      <Link\n        className=\"flex items-center gap-2 hover:underline hover:underline-offset-4\"\n        href=\"/docs\"\n      >\n        <BookTextIcon strokeWidth={1.0} size={18} />\n        Docs\n        <MoveRightIcon strokeWidth={1.0} />\n      </Link>\n    </footer>\n  );\n}\n"
  },
  {
    "path": "docs/src/components/package-badges.tsx",
    "content": "import { cn } from \"fumadocs-ui/utils/cn\";\n\ninterface ComponentProps extends React.HTMLAttributes<HTMLDivElement> {\n  packageName: string;\n}\n\nexport function PackageBadges({ packageName, className, ...props }: ComponentProps) {\n  return (\n    <div {...props} className={cn(\"inline-flex items-center gap-2 mx-auto\", className)}>\n      <a\n        className=\"!p-0 !m-0\"\n        href={`https://github.com/gillsdk/gill/actions/workflows/publish-packages.yml`}\n      >\n        <img\n          className=\"!p-0 !m-0\"\n          alt=\"\"\n          src={`https://img.shields.io/github/actions/workflow/status/gillsdk/gill/publish-packages.yml?logo=GitHub&label=tests`}\n        />\n      </a>\n      <a className=\"!p-0 !m-0\" href={`https://www.npmjs.com/package/${packageName}`}>\n        <img\n          alt=\"\"\n          className=\"!p-0 !m-0\"\n          src={`https://img.shields.io/npm/v/${packageName}?logo=npm&color=377CC0`}\n        />\n      </a>\n      <a className=\"!p-0 !m-0\" href={`https://www.npmjs.com/package/${packageName}`}>\n        <img\n          alt=\"\"\n          className=\"!p-0 !m-0\"\n          src={`https://img.shields.io/npm/dm/${packageName}?color=377CC0`}\n        />\n      </a>\n    </div>\n  );\n}\n"
  },
  {
    "path": "docs/src/const.ts",
    "content": "export const siteConfig: SiteConfig = {\n  name: \"gill\",\n  domain: \"gillsdk.com\",\n  description:\n    \"gill is a modern javascript/typescript client library for interacting with the Solana blockchain.\",\n  url: \"https://gillsdk.com\",\n  ogImage: \"https://gillsdk.com/og.png\",\n  links: {\n    github: \"https://github.com/gillsdk/gill\",\n    twitter: \"https://x.com/gillsdk\",\n    // docs: \"\",\n  },\n  twitterHandle: \"gillsdk\",\n  // twitterId: \"0\",\n};\n"
  },
  {
    "path": "docs/src/lib/Spread.tsx",
    "content": "import type { ReactNode } from \"react\";\n\nexport function Spread({ children }: { children: ReactNode }) {\n  return (\n    <div className=\"2xl:-mx-[min(8em,calc(calc(100vw-100%-var(--fd-sidebar-width)-var(--fd-toc-width)-8em)/2))]\">\n      {children}\n    </div>\n  );\n}\n"
  },
  {
    "path": "docs/src/lib/source.ts",
    "content": "import { api, docs } from \"@/.source\";\nimport { loader } from \"fumadocs-core/source\";\n\nexport const docsSource = loader({\n  baseUrl: \"/docs\",\n  source: docs.toFumadocsSource(),\n});\n\nexport const apiSource = loader({\n  baseUrl: \"/api\",\n  source: api.toFumadocsSource(),\n});\n"
  },
  {
    "path": "docs/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"target\": \"ESNext\",\n    \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noEmit\": true,\n    \"esModuleInterop\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"jsx\": \"preserve\",\n    \"incremental\": true,\n    \"paths\": {\n      \"@/.source\": [\"./.source/index.ts\"],\n      \"@/*\": [\"./src/*\"],\n      \"@@/*\": [\"./*\"]\n    },\n    \"plugins\": [\n      {\n        \"name\": \"next\"\n      }\n    ]\n  },\n  \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\", \".next/types/**/*.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "docs/typedoc-data.mjs",
    "content": "// @ts-check\n\n/**\n * Declare data and information to be injected into the\n * TypeDoc generated API reference's index files\n */\nexport const typedocPageIndexData = {\n  gill: {\n    frontmatter: {\n      title: \"gill\",\n      description:\n        \"A modern JavaScript/TypeScript client library for interacting with the Solana blockchain.\",\n    },\n  },\n  \"gill-node\": {\n    frontmatter: {\n      title: \"gill/node\",\n      description:\n        \"Functions and utilities designed for interacting with the Solana blockchain using JavaScript server backends and runtimes.\",\n    },\n  },\n  \"gill-programs\": {\n    frontmatter: {\n      title: \"gill/programs\",\n      description:\n        \"Utilize the compatible Solana program clients that ship directly within gill. Including common programs from the official Solana Program Library (SPL), Metaplex, and others.\",\n    },\n  },\n  react: {\n    frontmatter: {\n      title: \"@gillsdk/react\",\n      description:\n        \"A React hooks library for easily interacting with the Solana blockchain. Built on top of gill and TanStack Query.\",\n    },\n  },\n  \"solana-pay\": {\n    frontmatter: {\n      title: \"@gillsdk/solana-pay\",\n      description:\n        \"A complete, type-safe implementation of the Solana Pay specification for creating, parsing, and validating transfer and transaction request URLs.\",\n    },\n  },\n};\n"
  },
  {
    "path": "docs/vercel.json",
    "content": "{\n  \"github\": {\n    \"silent\": true\n  },\n  \"git\": {\n    \"deploymentEnabled\": false\n  }\n}\n"
  },
  {
    "path": "e2e/imports/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.cache\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n/dist\n/bin\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# local env files\n.env\n!.env.example\n\n# vercel\n.vercel\n\n# contentlayer\n.contentlayer\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\n\n# sitemaps / robots\npublic/sitemap*\npublic/robot*\n\ntest-ledger\ntemp\n\n.cache"
  },
  {
    "path": "e2e/imports/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "e2e/imports/.prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"proseWrap\": \"always\",\n  \"arrowParens\": \"always\",\n  \"printWidth\": 80\n}\n"
  },
  {
    "path": "e2e/imports/package.json",
    "content": "{\n  \"name\": \"@gillsdk/tests-e2e\",\n  \"license\": \"MIT\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} pnpm start:tsx && pnpm start:node\",\n    \"start:tsx\": \"pnpm tsx ./src/imports.ts\",\n    \"start:node\": \"node ./src/imports.js\",\n    \"start:tsc\": \"tsc ./src/imports.ts --outFile ./src/imports-tsc.js && node ./src/imports-tsc.js\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\"\n  },\n  \"dependencies\": {\n    \"gill\": \"workspace:*\"\n  },\n  \"devDependencies\": {\n    \"tsx\": \"^4.19.4\",\n    \"typescript\": \"^5.8.3\"\n  }\n}\n"
  },
  {
    "path": "e2e/imports/src/imports.js",
    "content": "/**\n * Import and log one of each type of symbol from the reexported or generated program clients\n */\n\n/**\n * SPL System program client\n */\nimport { SYSTEM_PROGRAM_ADDRESS } from \"gill/programs\";\nSYSTEM_PROGRAM_ADDRESS;\n\nimport { getTransferSolInstruction } from \"gill/programs\";\ngetTransferSolInstruction;\n\n/**\n * SPL Address Lookup Table program client\n */\nimport { ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS } from \"gill/programs\";\nADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;\n\nimport { getAddressLookupTableDecoder } from \"gill/programs\";\ngetAddressLookupTableDecoder;\n\n/**\n * SPL Compute Budget program client\n */\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from \"gill/programs\";\nCOMPUTE_BUDGET_PROGRAM_ADDRESS;\n\nimport { getSetComputeUnitLimitInstruction } from \"gill/programs\";\ngetSetComputeUnitLimitInstruction;\n\n// !this is a custom symbol that gill provides\nimport { isSetComputeLimitInstruction } from \"gill/programs\";\nisSetComputeLimitInstruction;\n\n/**\n * !SPL Memo program is generated and vendored in\n */\nimport { MEMO_PROGRAM_ADDRESS } from \"gill/programs\";\nMEMO_PROGRAM_ADDRESS;\n\nimport { getAddMemoInstruction } from \"gill/programs\";\ngetAddMemoInstruction;\n\n/**\n * ! Metaplex's Token Metadata client is generated and vendored in\n */\nimport { TOKEN_METADATA_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_METADATA_PROGRAM_ADDRESS;\n\nimport { getMetadataCodec } from \"gill/programs\";\ngetMetadataCodec;\n\n/**\n * SPL Token 2022 program client\n */\nimport { TOKEN_2022_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_2022_PROGRAM_ADDRESS;\n\nimport { getMintToInstruction } from \"gill/programs\";\ngetMintToInstruction;\n\n// !this is a custom symbol that gill provides\nimport { getAssociatedTokenAccountAddress } from \"gill/programs\";\ngetAssociatedTokenAccountAddress;\n\n// !this is a custom symbol that gill provides\nimport { TOKEN_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_PROGRAM_ADDRESS;\n"
  },
  {
    "path": "e2e/imports/src/imports.ts",
    "content": "/**\n * Import and log one of each type of symbol from the reexported or generated program clients\n */\n\n/**\n * SPL System program client\n */\nimport { SYSTEM_PROGRAM_ADDRESS } from \"gill/programs\";\nSYSTEM_PROGRAM_ADDRESS;\n\nimport type { ParsedSystemInstruction } from \"gill/programs\";\nnull as unknown as ParsedSystemInstruction;\n\nimport { getTransferSolInstruction } from \"gill/programs\";\ngetTransferSolInstruction;\n\n/**\n * SPL Address Lookup Table program client\n */\nimport { ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS } from \"gill/programs\";\nADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;\n\nimport type { ParsedAddressLookupTableInstruction } from \"gill/programs\";\nnull as unknown as ParsedAddressLookupTableInstruction;\n\nimport { getAddressLookupTableDecoder } from \"gill/programs\";\ngetAddressLookupTableDecoder;\n\n/**\n * SPL Compute Budget program client\n */\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from \"gill/programs\";\nCOMPUTE_BUDGET_PROGRAM_ADDRESS;\n\nimport type { ParsedComputeBudgetInstruction } from \"gill/programs\";\nnull as unknown as ParsedComputeBudgetInstruction;\n\nimport { getSetComputeUnitLimitInstruction } from \"gill/programs\";\ngetSetComputeUnitLimitInstruction;\n\n// !this is a custom symbol that gill provides\nimport { isSetComputeLimitInstruction } from \"gill/programs\";\nisSetComputeLimitInstruction;\n\n/**\n * !SPL Memo program is generated and vendored in\n */\nimport { MEMO_PROGRAM_ADDRESS } from \"gill/programs\";\nMEMO_PROGRAM_ADDRESS;\n\n// see Token Metadata's `MAINTAINERS.md` file about this type being renamed from `MintArgs` to `MetadataMintArgs`\nimport type { MetadataMintArgs } from \"gill/programs\";\nnull as unknown as MetadataMintArgs;\n\nimport { getAddMemoInstruction } from \"gill/programs\";\ngetAddMemoInstruction;\n\n/**\n * ! Metaplex's Token Metadata client is generated and vendored in\n */\nimport { TOKEN_METADATA_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_METADATA_PROGRAM_ADDRESS;\n\nimport type { ParsedMemoInstruction } from \"gill/programs\";\nnull as unknown as ParsedMemoInstruction;\n\nimport { getMetadataCodec } from \"gill/programs\";\ngetMetadataCodec;\n\n/**\n * SPL Token 2022 program client\n */\nimport { TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS_token } from \"gill/programs\";\nTOKEN_2022_PROGRAM_ADDRESS_token;\n\nimport { getMintToInstruction as getMintToInstruction_token } from \"gill/programs\";\ngetMintToInstruction_token;\n\nimport type { ParsedToken2022Instruction as ParsedToken2022Instruction_token } from \"gill/programs\";\nnull as unknown as ParsedToken2022Instruction_token;\n\n// !this is a custom symbol that gill provides\nimport { getAssociatedTokenAccountAddress as getAssociatedTokenAccountAddress_token } from \"gill/programs\";\ngetAssociatedTokenAccountAddress_token;\n\n// !this is a custom symbol that gill provides\nimport { TOKEN_PROGRAM_ADDRESS as TOKEN_PROGRAM_ADDRESS_token } from \"gill/programs\";\nTOKEN_PROGRAM_ADDRESS_token;\n\n/**\n * SPL Token 2022 program client\n */\nimport { TOKEN_2022_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_2022_PROGRAM_ADDRESS;\n\nimport { getMintToInstruction } from \"gill/programs\";\ngetMintToInstruction;\n\nimport type { ParsedToken2022Instruction } from \"gill/programs\";\nnull as unknown as ParsedToken2022Instruction;\n\n// !this is a custom symbol that gill provides\nimport { getAssociatedTokenAccountAddress } from \"gill/programs\";\ngetAssociatedTokenAccountAddress;\n\n// !this is a custom symbol that gill provides\nimport { TOKEN_PROGRAM_ADDRESS } from \"gill/programs\";\nTOKEN_PROGRAM_ADDRESS;\n"
  },
  {
    "path": "e2e/imports/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es2022\",\n    \"module\": \"NodeNext\",\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"strict\": true,\n    \"skipLibCheck\": true\n  }\n}\n"
  },
  {
    "path": "examples/get-started/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.cache\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n/dist\n/bin\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# local env files\n.env\n!.env.example\n\n# vercel\n.vercel\n\n# contentlayer\n.contentlayer\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\n\n# sitemaps / robots\npublic/sitemap*\npublic/robot*\n\ntest-ledger\ntemp\n\n.cache"
  },
  {
    "path": "examples/get-started/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "examples/get-started/.prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"proseWrap\": \"always\",\n  \"arrowParens\": \"always\",\n  \"printWidth\": 80\n}\n"
  },
  {
    "path": "examples/get-started/README.md",
    "content": "# gill examples\n\nGill is aimed at abstracting away many of the complexities and boilerplate\nrequired to perform common interactions with the Solana blockchain, while still\noffering the low level \"escape hatches\" when developers need (or want)\nfine-grain control.\n\nTake a look through these examples to see how gill works and even\n[how it compares](#comparison-of-gill-vs-solanakit-aka-web3js-v2) to using the\nvanilla web3js v2 library.\n\n## Tech stack used\n\n- TypeScript and NodeJS\n- Package manger: `pnpm`\n- Running the scripts: `esrun`\n\n## Setup locally\n\n1. Clone this repo to your local system\n2. Install the packages via `pnpm  install`\n3. Change into this directory: `cd examples/get-started`\n\n### Running the included scripts with esrun\n\nOnce setup locally, you will be able to run the scripts included within this\nrepo using `esrun`:\n\n```shell\nnpx esrun ./src/<script>\npnpx esrun ./src/<script>\n```\n\n> From the [esrun](https://www.npmjs.com/package/esrun) readme:\n>\n> esrun is a \"work out of the box\" library to execute Typescript (as well as\n> modern Javascript with decorators and stuff) without having to use a bundler.\n> This is useful for quick demonstrations or when launching your tests written\n> in Typescript.\n\n## Recommended flow to explore this repo\n\nAfter getting setup locally, we recommend exploring the code of the following\nfiles (in order):\n\n- [`intro.ts`](./src/intro.ts)\n- [`airdrop.ts`](./src/airdrop.ts)\n- [`tokens.ts`](./src/tokens.ts)\n- [`reference-keys.ts`](./src/reference-keys.ts)\n\n#### `intro.ts`\n\nA brief introduction to the `gill` library. Demonstrating and explaining the\ncommonly used tasks involved to interact with the Solana blockchain, including:\n\n- load a keypair signer from the local filesystem\n- create an rpc connection to the blockchain\n- creating basic instructions (like the memo instruction)\n- getting the latest blockhash\n- building a complete transaction\n- signing the transaction with the loaded local keypair signer\n- getting the signature of a transaction (even before it is sent)\n- logging Solana Explorer links\n- sending and confirming a transaction\n\nThese are all the most basic tasks required for any application sending\ntransaction to the Solana blockchain.\n\n#### `airdrop.ts`\n\nDemonstrates how to create a client connection to the Solana blockchain on a\ntest cluster (e.g. `devnet`, `testnet`, or `localnet`) and request airdrops of\ntesting SOL tokens to a wallet address.\n\n#### `tokens.ts`\n\nDemonstrates how to use gill's \"transaction builders\" to create a brand new\nSolana token (with onchain metadata) and then mint tokens to another user's\nwallet:\n\n- load a keypair signer from the local filesystem\n- create an rpc connection to the blockchain\n- getting the latest blockhash\n- build an optimized transaction to create a token\n- sign, send, and confirm that \"create token\" transaction\n- build an optimized transaction to mint\n- sign, send, and confirm that \"mint tokens\" transaction\n\n> For more examples interacting with Tokens on Solana, see the\n> [token examples examples here](../tokens/README.md)\n\n### `reference-keys.ts`\n\nThis script demonstrates the process to add a reference key into a transaction.\n\n> See the gill docs for\n> [Reference Keys](https://gillsdk.com/docs/guides/reference-keys) for more\n> information.\n\nAdding reference keys to transactions allows developers to be able track the\ncompletion of transactions given to users, without knowing the signature ahead\nof time. Then, perform any desired logic after detection of the reference keyed\ntransaction landing onchain.\n\nMost notably utilized within SolanaPay and Blinks.\n\n## Comparison of gill vs @solana/kit (aka web3js v2)\n\nYou can find comparison scripts that demonstrates some of the differences\nbetween [gill](https://github.com/gillsdk/gill) and\n[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as \"web3.js v2\").\n\n> Find a more comprehensive comparison in\n> [gill vs @solana/kit comparison docs](https://gillsdk.com/docs/compare/kit)\n\nBoth scripts accomplish the same task: send an optimized transaction to the\nSolana blockchain.\n\n- Using gill - [`basic.ts`](./src/basic.ts)\n- Using web3js v2 - [`basic-compare.ts`](./src/basic-compare.ts)\n\nBoth will load a keypair file from your local filesystem (the one used by the\nSolana CLI).\n\nBoth are written with honest intentions, best practices, and attempt to be as\nconcise as possible in accomplishing the same task.\n\nYou decide which you prefer :)\n"
  },
  {
    "path": "examples/get-started/package.json",
    "content": "{\n  \"name\": \"@gillsdk/examples-basics\",\n  \"license\": \"MIT\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"airdrop\": \"ts-node src/airdrop.ts\",\n    \"basic-compare\": \"ts-node src/basic-compare.ts\",\n    \"basic\": \"ts-node src/basic.ts\",\n    \"intro\": \"ts-node src/intro.ts\",\n    \"reference-keys\": \"ts-node src/reference-keys.ts\",\n    \"tokens\": \"ts-node src/tokens.ts\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"dependencies\": {\n    \"@solana-program/compute-budget\": \"^0.11.0\",\n    \"@solana-program/memo\": \"^0.10.0\",\n    \"@solana/kit\": \"^5.0.0\",\n    \"dotenv\": \"^16.4.5\",\n    \"fastestsmallesttextencoderdecoder\": \"^1.0.22\",\n    \"gill\": \"workspace:*\",\n    \"ws\": \"^8.18.0\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^22.9.0\",\n    \"typescript\": \"^5.6.3\"\n  }\n}\n"
  },
  {
    "path": "examples/get-started/src/airdrop.ts",
    "content": "import {\n  address,\n  airdropFactory,\n  createSolanaClient,\n  lamports,\n  SolanaClusterMoniker,\n} from \"gill\";\n\n/**\n * Define the address to request a SOL airdrop to\n *\n * Note: this address does not need to sign this transaction\n */\nconst wallet = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconsole.log(\"wallet:\", wallet);\n\n/**\n * Declare what Solana network cluster we want our code to interact with\n */\nconst cluster: SolanaClusterMoniker = \"devnet\";\n\n/**\n * Create a client connection to the Solana blockchain\n *\n * Note: `urlOrMoniker` can be either a Solana network moniker or a full URL of your RPC provider\n */\nconst { rpc, rpcSubscriptions } = createSolanaClient({\n  urlOrMoniker: cluster,\n});\n\n/**\n * Get the current lamport balance of the `wallet`\n */\nconst { value: initialBalance } = await rpc.getBalance(wallet).send();\nconsole.log(\"Initial balance:\", initialBalance);\n\n/**\n * Request an airdrop of testing tokens to the `wallet` address\n *\n * Note: devnet and testnet are subject to rate limits.\n * it is strongly recommended to use `localnet` and the local test validator\n */\nawait airdropFactory({ rpc, rpcSubscriptions })({\n  commitment: \"confirmed\",\n  lamports: lamports(100n),\n  recipientAddress: wallet,\n});\n\n/**\n * Get the current new lamport balance of the `wallet`\n */\nconst { value: newBalance } = await rpc.getBalance(wallet).send();\nconsole.log(\"New balance:\", newBalance);\n"
  },
  {
    "path": "examples/get-started/src/basic-compare.ts",
    "content": "/**\n * The purpose of this script is to compare some of the differences\n * of using `gill` as a single entrypoint vs `@solana/kit`\n * (and the various `@solana-program/*` packages).\n *\n * This script is the `@solana/kit` version of the comparison.\n * See the `gill` version in the ./basic.ts file\n */\nimport {\n  getSetComputeUnitLimitInstruction,\n  getSetComputeUnitPriceInstruction,\n} from \"@solana-program/compute-budget\";\nimport { getAddMemoInstruction } from \"@solana-program/memo\";\nimport {\n  appendTransactionMessageInstructions,\n  createKeyPairFromBytes,\n  createSignerFromKeyPair,\n  createSolanaRpc,\n  createSolanaRpcSubscriptions,\n  createTransactionMessage,\n  devnet,\n  getSignatureFromTransaction,\n  pipe,\n  sendAndConfirmTransactionFactory,\n  setTransactionMessageFeePayerSigner,\n  setTransactionMessageLifetimeUsingBlockhash,\n  signTransactionMessageWithSigners,\n} from \"@solana/kit\";\nimport { readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { resolve } from \"node:path\";\n\nconst rpc = createSolanaRpc(devnet(\"https://api.devnet.solana.com\"));\n\nconst rpcSubscriptions = createSolanaRpcSubscriptions(\n  devnet(\"wss://api.devnet.solana.com\"),\n);\n\nconst sendAndConfirmTransaction = sendAndConfirmTransactionFactory({\n  rpc,\n  rpcSubscriptions,\n});\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst keypairFilePath = \"~/.config/solana/id.json\";\n\nconst resolvedKeypairPath = resolve(keypairFilePath.replace(\"~\", homedir()));\n\nconst keypair = await createKeyPairFromBytes(\n  Uint8Array.from(JSON.parse(readFileSync(resolvedKeypairPath, \"utf8\"))),\n);\n\nconst signer = await createSignerFromKeyPair(keypair);\n\nconst tx = pipe(\n  createTransactionMessage({ version: \"legacy\" }),\n  (tx) => setTransactionMessageFeePayerSigner(signer, tx),\n  (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n  (tx) =>\n    appendTransactionMessageInstructions(\n      [\n        getAddMemoInstruction({\n          memo: \"gm world!\",\n        }),\n        getSetComputeUnitLimitInstruction({ units: 5000 }),\n        getSetComputeUnitPriceInstruction({ microLamports: 1000 }),\n      ],\n      tx,\n    ),\n);\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\ntry {\n  console.log(\n    \"Sending transaction:\",\n    `https://explorer.solana.com/tx/${getSignatureFromTransaction(signedTransaction)}?cluster=devnet`,\n  );\n\n  await sendAndConfirmTransaction(signedTransaction, {\n    commitment: \"confirmed\",\n  });\n\n  console.log(\"Transaction confirmed!\");\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n"
  },
  {
    "path": "examples/get-started/src/basic.ts",
    "content": "/**\n * The purpose of this script is to compare some of the differences\n * of using `gill` as a single entrypoint vs `@solana/kit`\n * (and the various `@solana-program/*` packages).\n *\n * This script is the `gill` version of the comparison.\n * See the `@solana/kit` version in the ./basic-compare.ts file\n */\nimport {\n  createSolanaClient,\n  createTransaction,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst signer = await loadKeypairSignerFromFile();\n\nconst tx = createTransaction({\n  feePayer: signer,\n  instructions: [\n    getAddMemoInstruction({\n      memo: \"gm world!\",\n    }),\n  ],\n  latestBlockhash,\n  computeUnitLimit: 5000,\n  computeUnitPrice: 1000,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\ntry {\n  console.log(\n    \"Sending transaction:\",\n    getExplorerLink({\n      cluster: \"devnet\",\n      transaction: getSignatureFromTransaction(signedTransaction),\n    }),\n  );\n\n  await sendAndConfirmTransaction(signedTransaction);\n\n  console.log(\"Transaction confirmed!\");\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n"
  },
  {
    "path": "examples/get-started/src/intro.ts",
    "content": "import {\n  createSolanaClient,\n  createTransaction,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n  SolanaClusterMoniker,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\n/**\n * Load a keypair signer from the local filesystem\n *\n * This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\n */\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"address:\", signer.address);\n\n/**\n * Declare what Solana network cluster we want our code to interact with\n */\nconst cluster: SolanaClusterMoniker = \"devnet\";\n\n/**\n * Create a client connection to the Solana blockchain\n *\n * Note: `urlOrMoniker` can be either a Solana network moniker or a full URL of your RPC provider\n */\nconst { rpc, sendAndConfirmTransaction, simulateTransaction } =\n  createSolanaClient({\n    urlOrMoniker: cluster,\n  });\n\n/**\n * Create a memo instruction to post a simple message onchain\n * (the simplest of instruction types!)\n */\nconst memoIx = getAddMemoInstruction({\n  memo: \"gm world!\",\n});\n\n/**\n * Get the latest blockhash (aka transaction lifetime). This acts as a recent timestamp\n * for the blockchain to key on when processing your transaction\n *\n * Pro tip: only request this value just before you are going to use it your code\n */\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\nconsole.log(\"latestBlockhash:\", latestBlockhash);\n\n/**\n * Create a transaction to be sent to the blockchain\n */\nconst tx = createTransaction({\n  feePayer: signer,\n  instructions: [memoIx],\n  latestBlockhash,\n});\nconsole.log(\"Transaction:\");\nconsole.log(tx);\n\n/**\n * Simulate the transaction\n *\n * Note: This is not required to be performed in your application,\n * but can help catch errors during troubleshooting\n */\nconst simulation = await simulateTransaction(tx);\nconsole.log(\"transaction simulation:\");\nconsole.log(simulation);\n\n/**\n * Sign the transaction with the provided `signer` when it was created\n */\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\nconsole.log(\"signedTransaction:\");\nconsole.log(signedTransaction);\n\n/**\n * Get the transaction signature after it has been signed by the `feePayer`\n */\nconst signature = getSignatureFromTransaction(signedTransaction);\n\n/**\n * Log the Solana Explorer link for the\n */\nconsole.log(\"Explorer Link:\");\nconsole.log(\n  getExplorerLink({\n    cluster,\n    transaction: signature,\n  }),\n);\n\ntry {\n  /**\n   * Actually send the transaction to the blockchain and confirm it\n   */\n  await sendAndConfirmTransaction(signedTransaction);\n\n  // you can also manually define additional settings for sending your transaction\n  // await sendAndConfirmTransaction(signedTransaction, {\n  //   commitment: \"confirmed\",\n  //   skipPreflight: true,\n  //   maxRetries: 10n,\n  // });\n\n  console.log(\"Transaction confirmed!\", signature);\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n"
  },
  {
    "path": "examples/get-started/src/reference-keys.ts",
    "content": "/**\n * This script demonstrates the process to add a reference key into a transaction.\n *\n * Adding reference keys to transactions allows developers to be able track the completion\n * of transactions given to users, without knowing the signature ahead of time. Then, perform\n * any desired logic after detection of the reference keyed transaction landing onchain.\n *\n * Most notably utilized within SolanaPay and Blinks.\n */\nimport {\n  createSolanaClient,\n  createTransaction,\n  generateKeyPairSigner,\n  getExplorerLink,\n  getOldestSignatureForAddress,\n  getSignatureFromTransaction,\n  insertReferenceKeysToTransactionMessage,\n  pipe,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst { address: reference } = await generateKeyPairSigner();\n\nconsole.warn(\"[reference key]\");\nconsole.log(reference);\n\nconst signer = await loadKeypairSignerFromFile();\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\n/**\n * !NOTICE!\n *\n * Inserting reference keys to transactions (aka attaching addresses to instructions)\n * involves\n *\n * The SPL Memo program (`MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr`) does NOT allow\n * accounts added to its instructions unless they are actually signing the transaction.\n * Even if the address is marked as a \"non-signer\" on the instruction.\n *\n * Therefore, transactions must have at least one other instruction other than a Memo\n * instruction. Adding a single Compute Budget instruction can satisfy this requirement.\n */\nconst tx = pipe(\n  createTransaction({\n    feePayer: signer,\n    instructions: [\n      getAddMemoInstruction({\n        memo: \"gm world!\",\n      }),\n    ],\n    latestBlockhash,\n    // setting a CU limit ensures their is at least one non-memo instruction\n    computeUnitLimit: 5000,\n  }),\n  (tx) => insertReferenceKeysToTransactionMessage([reference], tx),\n);\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\ntry {\n  const sig = getSignatureFromTransaction(signedTransaction);\n\n  console.log(\n    \"Sending transaction:\",\n    getExplorerLink({\n      cluster: \"devnet\",\n      transaction: sig,\n    }),\n  );\n\n  await sendAndConfirmTransaction(signedTransaction);\n\n  console.log(\"Transaction confirmed!\");\n\n  const { signature } = await getOldestSignatureForAddress(rpc, reference);\n\n  console.log(\"oldest signature:\", signature);\n  console.log(\n    \"does the oldest signature match the original signature:\",\n    sig === signature,\n  );\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n"
  },
  {
    "path": "examples/get-started/src/tokens.ts",
    "content": "import {\n  address,\n  createSolanaClient,\n  generateKeyPairSigner,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n  SolanaClusterMoniker,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport {\n  buildCreateTokenTransaction,\n  buildMintTokensTransaction,\n  buildTransferTokensTransaction,\n  getAssociatedTokenAccountAddress,\n  TOKEN_2022_PROGRAM_ADDRESS,\n} from \"gill/programs\";\n\n/** Turn on debug mode */\nglobal.__GILL_DEBUG__ = true;\n\n/** Set the debug mode log level (default: `info`) */\nglobal.__GILL_DEBUG_LEVEL__ = \"debug\";\n\n/**\n * With debug mode enabled and the log level of `debug`:\n *\n * `sendAndConfirmTransaction` will now auto log the following:\n * - explorer link to view the transaction\n * - serialized base64 transaction, to inspect on the Solana Explorer's Inspector\n *   https://explorer.solana.com/tx/inspector\n *\n * This can greatly assist troubleshooting efforts\n */\n\n/**\n * Load a keypair signer from the local filesystem\n *\n * This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\n */\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"address:\", signer.address);\n\n/**\n * Declare what Solana network cluster we want our code to interact with\n */\nconst cluster: SolanaClusterMoniker = \"devnet\";\n\n/**\n * Create a client connection to the Solana blockchain\n *\n * Note: `urlOrMoniker` can be either a Solana network moniker or a full URL of your RPC provider\n */\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: cluster,\n});\n\n/**\n * Declare our token mint and desired token program\n */\nconst tokenProgram = TOKEN_2022_PROGRAM_ADDRESS;\n// const tokenProgram = TOKEN_PROGRAM_ADDRESS;\nconst mint = await generateKeyPairSigner();\n\n/**\n * Get the latest blockhash (aka transaction lifetime). This acts as a recent timestamp\n * for the blockchain to key on when processing your transaction\n *\n * Pro tip: only request this value just before you are going to use it your code\n */\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\nconsole.log(\"latestBlockhash:\", latestBlockhash);\n\n/**\n * Create a transaction that will create a new token (with metadata)\n *\n * - this will use the original SPL token by default (`TOKEN_PROGRAM_ADDRESS`)\n */\nconst createTokenTx = await buildCreateTokenTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  // mintAuthority, // default=same as the `feePayer`\n  metadata: {\n    isMutable: true, // if the `updateAuthority` can change this metadata in the future\n    name: \"Only Possible On Solana\",\n    symbol: \"OPOS\",\n    uri: \"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json\",\n  },\n  // updateAuthority, // default=same as the `feePayer`\n  decimals: 2, // default=9,\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS, token22 also supported\n  // default cu limit set to be optimized, but can be overridden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n\n/**\n * Sign the transaction with the provided `signer` from when it was created\n */\nlet signedTransaction = await signTransactionMessageWithSigners(createTokenTx);\nconsole.log(\"signedTransaction:\");\nconsole.log(signedTransaction);\n\n/**\n * Get the transaction signature after it has been signed by the `feePayer`\n */\nlet signature = getSignatureFromTransaction(signedTransaction);\n\n/**\n * Log the Solana Explorer link for the transaction we are about to send\n */\nconsole.log(\"\\nExplorer Link (for creating the mint):\");\nconsole.log(\n  getExplorerLink({\n    cluster,\n    transaction: signature,\n  }),\n);\n\n/**\n * Actually send the transaction to the blockchain and confirm it\n */\nawait sendAndConfirmTransaction(signedTransaction);\n\n/**\n * Declare the wallet address that we want to mint the tokens to\n */\nconst mintToDestination = address(\n  \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n);\n\n/**\n * Create a transaction that mints new tokens to the `destination` wallet address\n * (raising the token's overall supply)\n *\n * - be sure to use the correct token program that the `mint` was created with\n * - ensure the `mintAuthority` is the correct signer in order to actually mint new tokens\n */\nconst mintTokensTx = await buildMintTokensTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  mintAuthority: signer,\n  amount: 2000, // note: be sure to consider the mint's `decimals` value\n  // if decimals=2 => this will mint 20.00 tokens\n  // if decimals=4 => this will mint 0.200 tokens\n  destination: mintToDestination,\n  // use the correct token program for the `mint`\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS\n  // default cu limit set to be optimized, but can be overridden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n\nconsole.log(\"Transaction to mint tokens:\");\nconsole.log(mintTokensTx);\n\n/**\n * Sign the transaction with the provided `signer` from when it was created\n */\nsignedTransaction = await signTransactionMessageWithSigners(mintTokensTx);\nsignature = getSignatureFromTransaction(signedTransaction);\n\nconsole.log(\n  \"\\nExplorer Link (for minting the tokens to the destination wallet):\",\n);\nconsole.log(\n  getExplorerLink({\n    cluster,\n    transaction: signature,\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n\n/**\n * Get the token balance of a wallet's associated token account (ata)\n *\n * In this case, we are checking our original wallet's ata\n */\nlet { value: postMintBalance } = await rpc\n  .getTokenAccountBalance(\n    await getAssociatedTokenAccountAddress(\n      mint,\n      mintToDestination,\n      tokenProgram,\n    ),\n  )\n  .send();\n\nconsole.log(\n  \"token balance after minting to 'mintToDestination':\",\n  postMintBalance,\n);\n\n/**\n * We will generate a new, random wallet in order to show that this wallet's ata\n * will be automatically created during the token transfer transaction\n */\nconst transferToDestination = await generateKeyPairSigner();\nconsole.log(\"transfer to destination:\", transferToDestination.address);\n\n/**\n * The `authority` address that can authorize the token transfer.\n * This is usually the user's wallet or the delegated authority\n */\nconst authority = address(\"7sZoCrE3cGgEpNgxcPnGffDeWfTewKnk6wWdLxmYA7Cy\");\n\n/**\n * Create a transaction that mints new tokens to the `destination` wallet address\n * (raising the token's overall supply)\n *\n * - be sure to use the correct token program that the `mint` was created with\n * - ensure the `mintAuthority` is the correct signer in order to actually mint new tokens\n */\nconst transferTokensTx = await buildTransferTokensTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  authority,\n  amount: 900, // note: be sure to consider the mint's `decimals` value\n  // if decimals=2 => this will mint 9.00 tokens\n  // if decimals=4 => this will mint 0.090 tokens\n  destination: transferToDestination,\n  // use the correct token program for the `mint`\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS\n  // default cu limit set to be optimized, but can be overridden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n\n/**\n * Sign the transaction with the provided `signer` from when it was created\n */\nsignedTransaction = await signTransactionMessageWithSigners(transferTokensTx);\nsignature = getSignatureFromTransaction(signedTransaction);\n\nconsole.log(\"\\nExplorer Link (for transferring tokens to the new wallet):\");\nconsole.log(\n  getExplorerLink({\n    cluster,\n    transaction: signature,\n  }),\n);\n\n// process.exit();\n\nawait sendAndConfirmTransaction(signedTransaction);\n\n/**\n * Now that we have transferred tokens FROM the source (in this example, the `signer`),\n * we can check this wallets current balance by deriving the ATA\n */\n\nconst sourceAta = await getAssociatedTokenAccountAddress(\n  mint,\n  authority,\n  tokenProgram,\n);\nconst { value: updatedBalance } = await rpc\n  .getTokenAccountBalance(sourceAta)\n  .send();\n\nconsole.log(\"new token balance for original source/authority\", updatedBalance);\n\n/**\n * We can also check the destination wallet's balance,\n * including that their ATA was created automatically!\n */\nconst destinationAta = await getAssociatedTokenAccountAddress(\n  mint,\n  transferToDestination,\n  tokenProgram,\n);\n\nconst { value: destinationWalletBalance } = await rpc\n  .getTokenAccountBalance(destinationAta)\n  .send();\n\nconsole.log(\"token balance for destination wallet:\", destinationWalletBalance);\n\nconsole.log(\"Complete.\");\n"
  },
  {
    "path": "examples/get-started/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"extends\": \"../../packages/tsconfig/base.json\",\n  \"display\": \"@gillsdk/examples-basics\",\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "examples/tokens/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.cache\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n/dist\n/bin\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# local env files\n.env\n!.env.example\n\n# vercel\n.vercel\n\n# contentlayer\n.contentlayer\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\n\n# sitemaps / robots\npublic/sitemap*\npublic/robot*\n\ntest-ledger\ntemp\n\n.cache"
  },
  {
    "path": "examples/tokens/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "examples/tokens/.prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"proseWrap\": \"always\",\n  \"arrowParens\": \"always\",\n  \"printWidth\": 100\n}\n"
  },
  {
    "path": "examples/tokens/README.md",
    "content": "# gill examples - tokens\n\nGill is aimed at abstracting away many of the complexities and boilerplate required to perform\ncommon interactions with the Solana blockchain, while still offering the low level \"escape hatches\"\nwhen developers need (or want) fine-grain control.\n\nTake a look through these examples to see how gill works and even\n[how it compares](../get-started/README.md#comparison-of-gill-vs-solanakit-aka-web3js-v2) to using\nthe vanilla web3js v2 library.\n\n## Tech stack used\n\n- TypeScript and NodeJS\n- Package manger: `pnpm`\n- Running the scripts: `esrun`\n\n## Setup locally\n\n1. Clone this repo to your local system\n2. Install the packages via `pnpm  install`\n3. Change into this directory: `cd examples/tokens`\n\n### Running the included scripts with esrun\n\nOnce setup locally, you will be able to run the scripts included within this repo using `esrun`:\n\n```shell\nnpx esrun ./src/<script>\npnpx esrun ./src/<script>\n```\n\n> From the [esrun](https://www.npmjs.com/package/esrun) readme:\n>\n> esrun is a \"work out of the box\" library to execute Typescript (as well as modern Javascript with\n> decorators and stuff) without having to use a bundler. This is useful for quick demonstrations or\n> when launching your tests written in Typescript.\n\n## Recommended flow to explore this repo\n\nAfter getting setup locally, we recommend exploring the code of the following files (in order):\n\n- [`1.intro.ts`](./src/1.intro.ts)\n- [`2.create-token-mint.ts`](./src/2.create-token-mint.ts)\n- [`3.create-token-mint-builder.ts`](./src/3.create-token-mint-builder.ts)\n- [`4.mint-tokens.ts`](./src/4.mint-tokens.ts)\n- [`5.mint-tokens-builder.ts`](./src/5.mint-tokens-builder.ts)\n- [`6.transfer-tokens.ts`](./src/6.transfer-tokens.ts)\n- [`7.transfer-tokens-builder.ts`](./src/7.transfer-tokens-builder.ts)\n"
  },
  {
    "path": "examples/tokens/package.json",
    "content": "{\n  \"name\": \"@gillsdk/examples-tokens\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"author\": \"nickfrosty\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^16.4.5\",\n    \"esrun\": \"^3.2.26\",\n    \"gill\": \"workspace:*\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^22.9.0\",\n    \"typescript\": \"^5.6.3\"\n  }\n}\n"
  },
  {
    "path": "examples/tokens/src/1.intro.ts",
    "content": "import {\n  createSolanaClient,\n  createTransaction,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n  SolanaClusterMoniker,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { getAddMemoInstruction } from \"gill/programs\";\n\n/**\n * Load a keypair signer from the local filesystem\n *\n * This defaults to the file path used by the Solana CLI: `~/.config/solana/id.json`\n */\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"address:\", signer.address);\n\n/**\n * Declare what Solana network cluster we want our code to interact with\n */\nconst cluster: SolanaClusterMoniker = \"devnet\";\n\n/**\n * Create a client connection to the Solana blockchain\n *\n * Note: `urlOrMoniker` can be either a Solana network moniker or a full URL of your RPC provider\n */\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: cluster,\n});\n\n/**\n * Create a memo instruction to post a simple message onchain\n * (the simplest of instruction types!)\n */\nconst memoIx = getAddMemoInstruction({\n  memo: \"gm world!\",\n});\n\n/**\n * Get the latest blockhash (aka transaction lifetime). This acts as a recent timestamp\n * for the blockchain to key on when processing your transaction\n *\n * Pro tip: only request this value just before you are going to use it your code\n */\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\nconsole.log(\"latestBlockhash:\", latestBlockhash);\n\n/**\n * Create a transaction to be sent to the blockchain\n */\nlet tx = createTransaction({\n  version: \"legacy\",\n  feePayer: signer,\n  instructions: [memoIx],\n  latestBlockhash,\n});\nconsole.log(\"Transaction:\");\nconsole.log(tx);\n\n/**\n * Sign the transaction with the provided `signer` when it was created\n */\nlet signedTransaction = await signTransactionMessageWithSigners(tx);\nconsole.log(\"signedTransaction:\");\nconsole.log(signedTransaction);\n\n/**\n * Get the transaction signature after it has been signed by the `feePayer`\n */\nlet signature = getSignatureFromTransaction(signedTransaction);\n\n/**\n * Log the Solana Explorer link for the\n */\nconsole.log(\"Explorer Link:\");\nconsole.log(\n  getExplorerLink({\n    cluster,\n    transaction: signature,\n  }),\n);\n\ntry {\n  /**\n   * Actually send the transaction to the blockchain and confirm it\n   */\n  await sendAndConfirmTransaction(signedTransaction);\n\n  // you can also manually define additional settings for sending your transaction\n  // await sendAndConfirmTransaction(signedTransaction, {\n  //   commitment: \"confirmed\",\n  //   skipPreflight: true,\n  //   maxRetries: 10n,\n  // });\n\n  console.log(\"Transaction confirmed!\", signature);\n} catch (err) {\n  console.error(\"Unable to send and confirm the transaction\");\n  console.error(err);\n}\n"
  },
  {
    "path": "examples/tokens/src/2.create-token-mint.ts",
    "content": "import {\n  createSolanaClient,\n  createTransaction,\n  generateKeyPairSigner,\n  getExplorerLink,\n  getMinimumBalanceForRentExemption,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport {\n  getCreateAccountInstruction,\n  getCreateMetadataAccountV3Instruction,\n  getInitializeMintInstruction,\n  getMintSize,\n  getTokenMetadataAddress,\n  TOKEN_PROGRAM_ADDRESS,\n} from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst tokenProgram = TOKEN_PROGRAM_ADDRESS;\nconst mint = await generateKeyPairSigner();\nconsole.log(\"mint:\", mint.address);\n\nconst space = getMintSize();\n\nconst metadataAddress = await getTokenMetadataAddress(mint);\n\n/**\n * instead of manually crafting the `instructions` below and deriving addresses above:\n * you could use the `getCreateTokenInstructions()` function to simplify this code\n */\nconst tx = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions: [\n    getCreateAccountInstruction({\n      space,\n      lamports: getMinimumBalanceForRentExemption(space),\n      newAccount: mint,\n      payer: signer,\n      programAddress: tokenProgram,\n    }),\n    getInitializeMintInstruction(\n      {\n        mint: mint.address,\n        mintAuthority: signer.address,\n        freezeAuthority: signer.address,\n        decimals: 9,\n      },\n      {\n        programAddress: tokenProgram,\n      },\n    ),\n    getCreateMetadataAccountV3Instruction({\n      collectionDetails: null,\n      isMutable: true,\n      updateAuthority: signer,\n      mint: mint.address,\n      metadata: metadataAddress,\n      mintAuthority: signer,\n      payer: signer,\n      data: {\n        sellerFeeBasisPoints: 0,\n        collection: null,\n        creators: null,\n        uses: null,\n        name: \"super sweet token\",\n        symbol: \"SST\",\n        uri: \"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json\",\n      },\n    }),\n  ],\n  latestBlockhash,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/src/3.create-token-mint-builder.ts",
    "content": "import {\n  createSolanaClient,\n  generateKeyPairSigner,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { buildCreateTokenTransaction, TOKEN_2022_PROGRAM_ADDRESS } from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst tokenProgram = TOKEN_2022_PROGRAM_ADDRESS;\nconst mint = await generateKeyPairSigner();\nconsole.log(\"mint:\", mint.address);\n\nconst tx = await buildCreateTokenTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  decimals: 9,\n  metadata: {\n    isMutable: true,\n    name: \"super sweet token\",\n    symbol: \"SST\",\n    uri: \"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json\",\n  },\n  mint,\n  latestBlockhash,\n  // defaults to `TOKEN_PROGRAM_ADDRESS`\n  tokenProgram,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/src/4.mint-tokens.ts",
    "content": "import {\n  address,\n  createSolanaClient,\n  createTransaction,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport {\n  getAssociatedTokenAccountAddress,\n  getCreateAssociatedTokenIdempotentInstruction,\n  getMintToInstruction,\n  TOKEN_PROGRAM_ADDRESS,\n} from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst mint = address(\"HwxZNMkZbZMeiu9Xnmc6Rg8jYgNsJB47jwabHGUebW4F\");\n\nconst owner = address(\"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\");\n\nconst ata = await getAssociatedTokenAccountAddress(mint, owner, TOKEN_PROGRAM_ADDRESS);\n\nconst tx = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions: [\n    getCreateAssociatedTokenIdempotentInstruction({\n      mint,\n      owner,\n      payer: signer,\n      tokenProgram: TOKEN_PROGRAM_ADDRESS,\n      ata,\n    }),\n    getMintToInstruction(\n      {\n        mint,\n        mintAuthority: signer,\n        token: ata,\n        amount: 1_000_000_000,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    ),\n  ],\n  latestBlockhash,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/src/5.mint-tokens-builder.ts",
    "content": "import {\n  address,\n  createSolanaClient,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { buildMintTokensTransaction } from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"signer:\", signer.address);\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst mint = address(\"HwxZNMkZbZMeiu9Xnmc6Rg8jYgNsJB47jwabHGUebW4F\");\n\nconst owner = address(\"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\");\n\nconst tx = await buildMintTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  amount: 1_000_000_000,\n  destination: owner,\n  mint,\n  mintAuthority: signer,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/src/6.transfer-tokens.ts",
    "content": "import {\n  address,\n  createSolanaClient,\n  createTransaction,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport {\n  getAssociatedTokenAccountAddress,\n  getCreateAssociatedTokenIdempotentInstruction,\n  getTransferInstruction,\n  TOKEN_PROGRAM_ADDRESS,\n} from \"gill/programs\";\n\nconst signer = await loadKeypairSignerFromFile();\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\", // or `mainnet`, `localnet`, etc\n});\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst mint = address(\"HwxZNMkZbZMeiu9Xnmc6Rg8jYgNsJB47jwabHGUebW4F\");\nconst tokenProgram = TOKEN_PROGRAM_ADDRESS; // use the correct program for the `mint`\n\nconst destination = address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\");\nconst destinationAta = await getAssociatedTokenAccountAddress(mint, destination, tokenProgram);\nconst sourceAta = await getAssociatedTokenAccountAddress(mint, signer, tokenProgram);\n\nconst transaction = createTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  instructions: [\n    // create idempotent will gracefully fail if the ata already exists. this is the gold standard!\n    getCreateAssociatedTokenIdempotentInstruction({\n      mint,\n      payer: signer,\n      tokenProgram,\n      owner: destination,\n      ata: destinationAta,\n    }),\n    getTransferInstruction({\n      source: sourceAta,\n      authority: signer,\n      destination: destinationAta,\n      amount: 1000n,\n    }),\n  ],\n  latestBlockhash,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/src/7.transfer-tokens-builder.ts",
    "content": "import {\n  address,\n  createSolanaClient,\n  getExplorerLink,\n  getSignatureFromTransaction,\n  signTransactionMessageWithSigners,\n} from \"gill\";\nimport { loadKeypairSignerFromFile } from \"gill/node\";\nimport { buildTransferTokensTransaction, TOKEN_PROGRAM_ADDRESS } from \"gill/programs\";\n\nconst { rpc, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nconst signer = await loadKeypairSignerFromFile();\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst mint = address(\"HwxZNMkZbZMeiu9Xnmc6Rg8jYgNsJB47jwabHGUebW4F\");\nconst tokenProgram = TOKEN_PROGRAM_ADDRESS; // use the correct program for the `mint`\n\nconst destination = address(\"7sZoCrE3cGgEpNgxcPnGffDeWfTewKnk6wWdLxmYA7Cy\");\n\nconst tx = await buildTransferTokensTransaction({\n  feePayer: signer,\n  version: \"legacy\",\n  latestBlockhash,\n  amount: 1_000_000,\n  authority: signer,\n  destination: destination,\n  mint,\n  tokenProgram,\n});\n\nconst signedTransaction = await signTransactionMessageWithSigners(tx);\n\nconsole.log(\n  \"Explorer:\",\n  getExplorerLink({\n    cluster: \"devnet\",\n    transaction: getSignatureFromTransaction(signedTransaction),\n  }),\n);\n\nawait sendAndConfirmTransaction(signedTransaction);\n"
  },
  {
    "path": "examples/tokens/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"extends\": \"../../packages/tsconfig/base.json\",\n  \"display\": \"@gillsdk/examples-tokens\",\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "idls/build-codama-clients.sh",
    "content": "#!/usr/bin/env bash\nset -euo pipefail\n\n# generate all the codama clients (per their respective config files)\npnpm codama run js --config ./idls/token_metadata/codama.json\n\n# run the repo's prettier settings on the generated files\npnpm prettier --write './packages/gill/src/programs/**/generated/{*,**/*}.{ts,js}'\n"
  },
  {
    "path": "idls/token_metadata/codama.json",
    "content": "{\n  \"idl\": \"idl.json\",\n  \"before\": [],\n  \"scripts\": {\n    \"js\": {\n      \"from\": \"@codama/renderers-js\",\n      \"args\": [\"packages/gill/src/programs/token-metadata/generated\"]\n    }\n  }\n}\n"
  },
  {
    "path": "idls/token_metadata/idl.json",
    "content": "{\n  \"version\": \"1.14.0\",\n  \"name\": \"token_metadata\",\n  \"instructions\": [\n    {\n      \"name\": \"CreateMetadataAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"update authority info\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 0\n      }\n    },\n    {\n      \"name\": \"UpdateMetadataAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority key\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 1\n      }\n    },\n    {\n      \"name\": \"DeprecatedCreateMasterEdition\",\n      \"accounts\": [\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Unallocated edition V1 account with address as pda of ['metadata', program id, mint, 'edition']\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata mint\"]\n        },\n        {\n          \"name\": \"printingMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"Printing mint - A mint you control that can mint tokens that can be exchanged for limited editions of your master edition via the MintNewEditionFromMasterEditionViaToken endpoint\"\n          ]\n        },\n        {\n          \"name\": \"oneTimePrintingAuthorizationMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"One time authorization printing mint - A mint you control that prints tokens that gives the bearer permission to mint any number of tokens from the printing mint one time via an endpoint with the token-metadata program for your metadata. Also burns the token.\"\n          ]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Current Update authority key\"]\n        },\n        {\n          \"name\": \"printingMintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Printing mint authority - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY.\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        },\n        {\n          \"name\": \"oneTimePrintingAuthorizationMintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\n            \"One time authorization printing mint authority - must be provided if using max supply. THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY.\"\n          ]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 2\n      }\n    },\n    {\n      \"name\": \"DeprecatedMintNewEditionFromMasterEditionViaPrintingToken\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Edition V1 (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority of new mint\"]\n        },\n        {\n          \"name\": \"printingMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Printing Mint of master record edition\"]\n        },\n        {\n          \"name\": \"masterTokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account containing Printing mint token to be transferred\"]\n        },\n        {\n          \"name\": \"editionMarker\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number])\"\n          ]\n        },\n        {\n          \"name\": \"burnAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Burn authority for this token\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"masterUpdateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"update authority info for new metadata account\"]\n        },\n        {\n          \"name\": \"masterMetadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master record metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        },\n        {\n          \"name\": \"reservationList\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\n            \"Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list.\"\n          ]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 3\n      }\n    },\n    {\n      \"name\": \"UpdatePrimarySaleHappenedViaToken\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Owner on the token account\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Account containing tokens from the metadata's mint\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 4\n      }\n    },\n    {\n      \"name\": \"DeprecatedSetReservationList\",\n      \"accounts\": [\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"reservationList\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]\"\n          ]\n        },\n        {\n          \"name\": \"resource\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"The resource you tied the reservation list too\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 5\n      }\n    },\n    {\n      \"name\": \"DeprecatedCreateReservationList\",\n      \"accounts\": [\n        {\n          \"name\": \"reservationList\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"PDA for ReservationList of ['metadata', program id, master edition key, 'reservation', resource-key]\"\n          ]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\" Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"resource\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\n            \"A resource you wish to tie the reservation list to. This is so your later visitors who come to redeem can derive your reservation list PDA with something they can easily get at. You choose what this should be.\"\n          ]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 6\n      }\n    },\n    {\n      \"name\": \"SignMetadata\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"creator\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Creator\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 7\n      }\n    },\n    {\n      \"name\": \"DeprecatedMintPrintingTokensViaToken\",\n      \"accounts\": [\n        {\n          \"name\": \"destination\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Destination account\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account containing one time authorization token\"]\n        },\n        {\n          \"name\": \"oneTimePrintingAuthorizationMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"One time authorization mint\"]\n        },\n        {\n          \"name\": \"printingMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Printing mint\"]\n        },\n        {\n          \"name\": \"burnAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Burn authority\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 8\n      }\n    },\n    {\n      \"name\": \"DeprecatedMintPrintingTokens\",\n      \"accounts\": [\n        {\n          \"name\": \"destination\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Destination account\"]\n        },\n        {\n          \"name\": \"printingMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Printing mint\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master Edition V1 key (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 9\n      }\n    },\n    {\n      \"name\": \"CreateMasterEdition\",\n      \"accounts\": [\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata mint\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 10\n      }\n    },\n    {\n      \"name\": \"MintNewEditionFromMasterEditionViaToken\",\n      \"accounts\": [\n        {\n          \"name\": \"newMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"newEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Edition (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"newMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"editionMarkPda\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE).\"\n          ]\n        },\n        {\n          \"name\": \"newMintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority of new mint\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"tokenAccountOwner\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"owner of token account containing master token (#8)\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"token account containing token from master metadata mint\"]\n        },\n        {\n          \"name\": \"newMetadataUpdateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Update authority info for new metadata\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master record metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"mintNewEditionFromMasterEditionViaTokenArgs\",\n          \"type\": {\n            \"defined\": \"MintNewEditionFromMasterEditionViaTokenArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 11\n      }\n    },\n    {\n      \"name\": \"ConvertMasterEditionV1ToV2\",\n      \"accounts\": [\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"oneTimeAuth\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"One time authorization mint\"]\n        },\n        {\n          \"name\": \"printingMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Printing mint\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 12\n      }\n    },\n    {\n      \"name\": \"MintNewEditionFromMasterEditionViaVaultProxy\",\n      \"accounts\": [\n        {\n          \"name\": \"newMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"newEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Edition (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']\"]\n        },\n        {\n          \"name\": \"newMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"editionMarkPda\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE).\"\n          ]\n        },\n        {\n          \"name\": \"newMintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority of new mint\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"vaultAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Vault authority\"]\n        },\n        {\n          \"name\": \"safetyDepositStore\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Safety deposit token store account\"]\n        },\n        {\n          \"name\": \"safetyDepositBox\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Safety deposit box\"]\n        },\n        {\n          \"name\": \"vault\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Vault\"]\n        },\n        {\n          \"name\": \"newMetadataUpdateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Update authority info for new metadata\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master record metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"tokenVaultProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token vault program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"mintNewEditionFromMasterEditionViaTokenArgs\",\n          \"type\": {\n            \"defined\": \"MintNewEditionFromMasterEditionViaTokenArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 13\n      }\n    },\n    {\n      \"name\": \"PuffMetadata\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 14\n      }\n    },\n    {\n      \"name\": \"UpdateMetadataAccountV2\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority key\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"updateMetadataAccountArgsV2\",\n          \"type\": {\n            \"defined\": \"UpdateMetadataAccountArgsV2\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 15\n      }\n    },\n    {\n      \"name\": \"CreateMetadataAccountV2\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"update authority info\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 16\n      }\n    },\n    {\n      \"name\": \"CreateMasterEditionV3\",\n      \"accounts\": [\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata mint\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"createMasterEditionArgs\",\n          \"type\": {\n            \"defined\": \"CreateMasterEditionArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 17\n      }\n    },\n    {\n      \"name\": \"VerifyCollection\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 18\n      }\n    },\n    {\n      \"name\": \"Utilize\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token Account Of NFT\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Metadata\"]\n        },\n        {\n          \"name\": \"useAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"A Use Authority / Can be the current Owner of the NFT\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Owner\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"ataProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Associated Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Rent info\"]\n        },\n        {\n          \"name\": \"useAuthorityRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Use Authority Record PDA If present the program Assumes a delegated use authority\"]\n        },\n        {\n          \"name\": \"burner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Program As Signer (Burner)\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"utilizeArgs\",\n          \"type\": {\n            \"defined\": \"UtilizeArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 19\n      }\n    },\n    {\n      \"name\": \"ApproveUseAuthority\",\n      \"accounts\": [\n        {\n          \"name\": \"useAuthorityRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Use Authority Record PDA\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Owner\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"user\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"A Use Authority\"]\n        },\n        {\n          \"name\": \"ownerTokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Owned Token Account Of Mint\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of Metadata\"]\n        },\n        {\n          \"name\": \"burner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Program As Signer (Burner)\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"approveUseAuthorityArgs\",\n          \"type\": {\n            \"defined\": \"ApproveUseAuthorityArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 20\n      }\n    },\n    {\n      \"name\": \"RevokeUseAuthority\",\n      \"accounts\": [\n        {\n          \"name\": \"useAuthorityRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Use Authority Record PDA\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Owner\"]\n        },\n        {\n          \"name\": \"user\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"A Use Authority\"]\n        },\n        {\n          \"name\": \"ownerTokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Owned Token Account Of Mint\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of Metadata\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 21\n      }\n    },\n    {\n      \"name\": \"UnverifyCollection\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Authority\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 22\n      }\n    },\n    {\n      \"name\": \"ApproveCollectionAuthority\",\n      \"accounts\": [\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        },\n        {\n          \"name\": \"newCollectionAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"A Collection Authority\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Update Authority of Collection NFT\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Collection Metadata account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of Collection Metadata\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 23\n      }\n    },\n    {\n      \"name\": \"RevokeCollectionAuthority\",\n      \"accounts\": [\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        },\n        {\n          \"name\": \"delegateAuthority\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Delegated Collection Authority\"]\n        },\n        {\n          \"name\": \"revokeAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Update Authority, or Delegated Authority, of Collection NFT\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of Metadata\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 24\n      }\n    },\n    {\n      \"name\": \"SetAndVerifyCollection\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Update Authority of Collection NFT and NFT\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 25\n      }\n    },\n    {\n      \"name\": \"FreezeDelegatedAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"delegate\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Delegate\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account to freeze\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Edition\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token mint\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token Program\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 26\n      }\n    },\n    {\n      \"name\": \"ThawDelegatedAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"delegate\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Delegate\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account to thaw\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Edition\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token mint\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token Program\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 27\n      }\n    },\n    {\n      \"name\": \"RemoveCreatorVerification\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"creator\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Creator\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 28\n      }\n    },\n    {\n      \"name\": \"BurnNft\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"NFT owner\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the NFT\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account to close\"]\n        },\n        {\n          \"name\": \"masterEditionAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 of the NFT\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Metadata of the Collection\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 29\n      }\n    },\n    {\n      \"name\": \"VerifySizedCollectionItem\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 30\n      }\n    },\n    {\n      \"name\": \"UnverifySizedCollectionItem\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 31\n      }\n    },\n    {\n      \"name\": \"SetAndVerifySizedCollectionItem\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Update Authority of Collection NFT and NFT\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collection\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEditionAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 32\n      }\n    },\n    {\n      \"name\": \"CreateMetadataAccountV3\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"mintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptionalSigner\": true,\n          \"docs\": [\"update authority info\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"rent\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Rent info\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"createMetadataAccountArgsV3\",\n          \"type\": {\n            \"defined\": \"CreateMetadataAccountArgsV3\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 33\n      }\n    },\n    {\n      \"name\": \"SetCollectionSize\",\n      \"accounts\": [\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Collection Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"setCollectionSizeArgs\",\n          \"type\": {\n            \"defined\": \"SetCollectionSizeArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 34\n      }\n    },\n    {\n      \"name\": \"SetTokenStandard\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Metadata update authority\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition account\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 35\n      }\n    },\n    {\n      \"name\": \"BubblegumSetCollectionSize\",\n      \"accounts\": [\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Collection Metadata account\"]\n        },\n        {\n          \"name\": \"collectionAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Collection Update authority\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"bubblegumSigner\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Signing PDA of Bubblegum program\"]\n        },\n        {\n          \"name\": \"collectionAuthorityRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Collection Authority Record PDA\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"setCollectionSizeArgs\",\n          \"type\": {\n            \"defined\": \"SetCollectionSizeArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 36\n      }\n    },\n    {\n      \"name\": \"BurnEditionNft\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"owner\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"NFT owner\"]\n        },\n        {\n          \"name\": \"printEditionMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the print edition NFT\"]\n        },\n        {\n          \"name\": \"masterEditionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of the original/master NFT\"]\n        },\n        {\n          \"name\": \"printEditionTokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account the print edition NFT is in\"]\n        },\n        {\n          \"name\": \"masterEditionTokenAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account the Master Edition NFT is in\"]\n        },\n        {\n          \"name\": \"masterEditionAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"MasterEdition2 of the original NFT\"]\n        },\n        {\n          \"name\": \"printEditionAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Print Edition account of the NFT\"]\n        },\n        {\n          \"name\": \"editionMarkerAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Edition Marker PDA of the NFT\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token Program\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 37\n      }\n    },\n    {\n      \"name\": \"CreateEscrowAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"escrow\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Escrow account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account of the token\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Wallet paying for the transaction and new account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"isOptional\": true,\n          \"docs\": [\"Authority/creator of the escrow account\"]\n        }\n      ],\n      \"args\": [],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 38\n      }\n    },\n    {\n      \"name\": \"CloseEscrowAccount\",\n      \"accounts\": [\n        {\n          \"name\": \"escrow\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Escrow account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"tokenAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Wallet paying for the transaction and new account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 39\n      }\n    },\n    {\n      \"name\": \"TransferOutOfEscrow\",\n      \"accounts\": [\n        {\n          \"name\": \"escrow\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Escrow account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Wallet paying for the transaction and new account\"]\n        },\n        {\n          \"name\": \"attributeMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account for the new attribute\"]\n        },\n        {\n          \"name\": \"attributeSrc\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account source for the new attribute\"]\n        },\n        {\n          \"name\": \"attributeDst\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account, owned by TM, destination for the new attribute\"]\n        },\n        {\n          \"name\": \"escrowMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account that the escrow is attached\"]\n        },\n        {\n          \"name\": \"escrowAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account that holds the token the escrow is attached to\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"ataProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Associated Token program\"]\n        },\n        {\n          \"name\": \"tokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"isOptional\": true,\n          \"docs\": [\"Authority/creator of the escrow account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"transferOutOfEscrowArgs\",\n          \"type\": {\n            \"defined\": \"TransferOutOfEscrowArgs\"\n          }\n        }\n      ],\n      \"legacyOptionalAccountsStrategy\": true,\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 40\n      }\n    },\n    {\n      \"name\": \"Burn\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Asset owner or Utility delegate\"]\n        },\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Metadata of the Collection\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition of the asset\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account to close\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master edition account\"]\n        },\n        {\n          \"name\": \"masterEditionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master edition mint of the asset\"]\n        },\n        {\n          \"name\": \"masterEditionToken\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master edition token account\"]\n        },\n        {\n          \"name\": \"editionMarker\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition marker account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token Program\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"burnArgs\",\n          \"type\": {\n            \"defined\": \"BurnArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 41\n      }\n    },\n    {\n      \"name\": \"Create\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Unallocated metadata account with address as pda of ['metadata', program id, mint id]\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition']\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Update authority for the metadata account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token program\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"createArgs\",\n          \"type\": {\n            \"defined\": \"CreateArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 42\n      }\n    },\n    {\n      \"name\": \"Mint\",\n      \"accounts\": [\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token or Associated Token account\"]\n        },\n        {\n          \"name\": \"tokenOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Owner of the token account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master Edition account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"(Mint or Update) authority\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Metadata delegate record\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token program\"]\n        },\n        {\n          \"name\": \"splAtaProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Associated Token Account program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"mintArgs\",\n          \"type\": {\n            \"defined\": \"MintArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 43\n      }\n    },\n    {\n      \"name\": \"Delegate\",\n      \"accounts\": [\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record account\"]\n        },\n        {\n          \"name\": \"delegate\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Owner of the delegated account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master Edition account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of metadata\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token account of mint\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority or token owner\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System Program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"delegateArgs\",\n          \"type\": {\n            \"defined\": \"DelegateArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 44\n      }\n    },\n    {\n      \"name\": \"Revoke\",\n      \"accounts\": [\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record account\"]\n        },\n        {\n          \"name\": \"delegate\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Owner of the delegated account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master Edition account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of metadata\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token account of mint\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority or token owner\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System Program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"revokeArgs\",\n          \"type\": {\n            \"defined\": \"RevokeArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 45\n      }\n    },\n    {\n      \"name\": \"Lock\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Delegate or freeze authority\"]\n        },\n        {\n          \"name\": \"tokenOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token owner account\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"lockArgs\",\n          \"type\": {\n            \"defined\": \"LockArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 46\n      }\n    },\n    {\n      \"name\": \"Unlock\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Delegate or freeze authority\"]\n        },\n        {\n          \"name\": \"tokenOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token owner account\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"unlockArgs\",\n          \"type\": {\n            \"defined\": \"UnlockArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 47\n      }\n    },\n    {\n      \"name\": \"Migrate\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"tokenOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account owner\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority\"]\n        },\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Collection metadata account\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Delegate record account\"]\n        },\n        {\n          \"name\": \"tokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instruction sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 48\n      }\n    },\n    {\n      \"name\": \"Transfer\",\n      \"accounts\": [\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"tokenOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token account owner\"]\n        },\n        {\n          \"name\": \"destination\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Destination token account\"]\n        },\n        {\n          \"name\": \"destinationOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Destination token account owner\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition of token asset\"]\n        },\n        {\n          \"name\": \"ownerTokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Owner token record account\"]\n        },\n        {\n          \"name\": \"destinationTokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Destination token record account\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Transfer authority (token owner or delegate)\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System Program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"splAtaProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Associated Token Account program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"transferArgs\",\n          \"type\": {\n            \"defined\": \"TransferArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 49\n      }\n    },\n    {\n      \"name\": \"Update\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Update authority or delegate\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record PDA\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"updateArgs\",\n          \"type\": {\n            \"defined\": \"UpdateArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 50\n      }\n    },\n    {\n      \"name\": \"Use\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Token owner or delegate\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record PDA\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token account\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint account\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Edition account\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Payer\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"SPL Token Program\"]\n        },\n        {\n          \"name\": \"authorizationRulesProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules Program\"]\n        },\n        {\n          \"name\": \"authorizationRules\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token Authorization Rules account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"useArgs\",\n          \"type\": {\n            \"defined\": \"UseArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 51\n      }\n    },\n    {\n      \"name\": \"Verify\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Creator to verify, collection update authority or delegate\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record PDA\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMasterEdition\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Master Edition Account of the Collection Token\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"verificationArgs\",\n          \"type\": {\n            \"defined\": \"VerificationArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 52\n      }\n    },\n    {\n      \"name\": \"Unverify\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Creator to verify, collection (or metadata if parent burned) update authority or delegate\"]\n        },\n        {\n          \"name\": \"delegateRecord\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Delegate record PDA\"]\n        },\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata account\"]\n        },\n        {\n          \"name\": \"collectionMint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Mint of the Collection\"]\n        },\n        {\n          \"name\": \"collectionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Metadata Account of the Collection\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"verificationArgs\",\n          \"type\": {\n            \"defined\": \"VerificationArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 53\n      }\n    },\n    {\n      \"name\": \"Collect\",\n      \"accounts\": [\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Authority to collect fees\"]\n        },\n        {\n          \"name\": \"recipient\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"The account to transfer collected fees to\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 54\n      }\n    },\n    {\n      \"name\": \"Print\",\n      \"accounts\": [\n        {\n          \"name\": \"editionMetadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Metadata key (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"New Edition (pda of ['metadata', program id, mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"editionMint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY\"]\n        },\n        {\n          \"name\": \"editionTokenAccountOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Owner of the token account of new token\"]\n        },\n        {\n          \"name\": \"editionTokenAccount\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Token account of new token\"]\n        },\n        {\n          \"name\": \"editionMintAuthority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Mint authority of new mint\"]\n        },\n        {\n          \"name\": \"editionTokenRecord\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token record account\"]\n        },\n        {\n          \"name\": \"masterEdition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])\"]\n        },\n        {\n          \"name\": \"editionMarkerPda\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE).\"\n          ]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": true,\n          \"docs\": [\"payer\"]\n        },\n        {\n          \"name\": \"masterTokenAccountOwner\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptionalSigner\": true,\n          \"docs\": [\"owner of token account containing master token\"]\n        },\n        {\n          \"name\": \"masterTokenAccount\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"token account containing token from master metadata mint\"]\n        },\n        {\n          \"name\": \"masterMetadata\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Master record metadata account\"]\n        },\n        {\n          \"name\": \"updateAuthority\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"The update authority of the master edition.\"]\n        },\n        {\n          \"name\": \"splTokenProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Token program\"]\n        },\n        {\n          \"name\": \"splAtaProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"SPL Associated Token Account program\"]\n        },\n        {\n          \"name\": \"sysvarInstructions\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Instructions sysvar account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"printArgs\",\n          \"type\": {\n            \"defined\": \"PrintArgs\"\n          }\n        }\n      ],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 55\n      }\n    },\n    {\n      \"name\": \"Resize\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"The metadata account of the digital asset\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\n            \"The master edition or edition account of the digital asset, an uninitialized account for fungible assets\"\n          ]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"payer\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"isOptionalSigner\": true,\n          \"docs\": [\"The recipient of the excess rent and authority if the authority account is not present\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"isOptional\": true,\n          \"docs\": [\"Owner of the asset for (p)NFTs, or mint authority for fungible assets, if different from the payer\"]\n        },\n        {\n          \"name\": \"token\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"isOptional\": true,\n          \"docs\": [\"Token or Associated Token account\"]\n        },\n        {\n          \"name\": \"systemProgram\",\n          \"isMut\": false,\n          \"isSigner\": false,\n          \"docs\": [\"System program\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 56\n      }\n    },\n    {\n      \"name\": \"CloseAccounts\",\n      \"accounts\": [\n        {\n          \"name\": \"metadata\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Metadata (pda of ['metadata', program id, mint id])\"]\n        },\n        {\n          \"name\": \"edition\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Edition of the asset\"]\n        },\n        {\n          \"name\": \"mint\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"Mint of token asset\"]\n        },\n        {\n          \"name\": \"authority\",\n          \"isMut\": false,\n          \"isSigner\": true,\n          \"docs\": [\"Authority to close ownerless accounts\"]\n        },\n        {\n          \"name\": \"destination\",\n          \"isMut\": true,\n          \"isSigner\": false,\n          \"docs\": [\"The destination account that will receive the rent.\"]\n        }\n      ],\n      \"args\": [],\n      \"discriminant\": {\n        \"type\": \"u8\",\n        \"value\": 57\n      }\n    }\n  ],\n  \"accounts\": [\n    {\n      \"name\": \"CollectionAuthorityRecord\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          },\n          {\n            \"name\": \"updateAuthority\",\n            \"type\": {\n              \"option\": \"publicKey\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MetadataDelegateRecord\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          },\n          {\n            \"name\": \"mint\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"delegate\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"updateAuthority\",\n            \"type\": \"publicKey\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"HolderDelegateRecord\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          },\n          {\n            \"name\": \"mint\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"delegate\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"updateAuthority\",\n            \"type\": \"publicKey\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Edition\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"parent\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"edition\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"EditionMarker\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"ledger\",\n            \"type\": {\n              \"array\": [\"u8\", 31]\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"EditionMarkerV2\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"ledger\",\n            \"type\": \"bytes\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TokenOwnedEscrow\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"baseToken\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"authority\",\n            \"type\": {\n              \"defined\": \"EscrowAuthority\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MasterEditionV2\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"supply\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"maxSupply\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MasterEditionV1\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"supply\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"maxSupply\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          },\n          {\n            \"name\": \"printingMint\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"oneTimePrintingAuthorizationMint\",\n            \"type\": \"publicKey\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Metadata\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"updateAuthority\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"mint\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"data\",\n            \"type\": {\n              \"defined\": \"Data\"\n            }\n          },\n          {\n            \"name\": \"primarySaleHappened\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"isMutable\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"editionNonce\",\n            \"type\": {\n              \"option\": \"u8\"\n            }\n          },\n          {\n            \"name\": \"tokenStandard\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"TokenStandard\"\n              }\n            }\n          },\n          {\n            \"name\": \"collection\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Collection\"\n              }\n            }\n          },\n          {\n            \"name\": \"uses\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Uses\"\n              }\n            }\n          },\n          {\n            \"name\": \"collectionDetails\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"CollectionDetails\"\n              }\n            }\n          },\n          {\n            \"name\": \"programmableConfig\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"ProgrammableConfig\"\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TokenRecord\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          },\n          {\n            \"name\": \"state\",\n            \"type\": {\n              \"defined\": \"TokenState\"\n            }\n          },\n          {\n            \"name\": \"ruleSetRevision\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          },\n          {\n            \"name\": \"delegate\",\n            \"type\": {\n              \"option\": \"publicKey\"\n            }\n          },\n          {\n            \"name\": \"delegateRole\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"TokenDelegateRole\"\n              }\n            }\n          },\n          {\n            \"name\": \"lockedTransfer\",\n            \"type\": {\n              \"option\": \"publicKey\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ReservationListV2\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"masterEdition\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"supplySnapshot\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          },\n          {\n            \"name\": \"reservations\",\n            \"type\": {\n              \"vec\": {\n                \"defined\": \"Reservation\"\n              }\n            }\n          },\n          {\n            \"name\": \"totalReservationSpots\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"currentReservationSpots\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ReservationListV1\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"masterEdition\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"supplySnapshot\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          },\n          {\n            \"name\": \"reservations\",\n            \"type\": {\n              \"vec\": {\n                \"defined\": \"ReservationV1\"\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UseAuthorityRecord\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"key\",\n            \"type\": {\n              \"defined\": \"Key\"\n            }\n          },\n          {\n            \"name\": \"allowedUses\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    }\n  ],\n  \"types\": [\n    {\n      \"name\": \"SetCollectionSizeArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"size\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CreateMasterEditionArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"maxSupply\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MintNewEditionFromMasterEditionViaTokenArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"edition\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TransferOutOfEscrowArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"amount\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CreateMetadataAccountArgsV3\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"data\",\n            \"type\": {\n              \"defined\": \"DataV2\"\n            }\n          },\n          {\n            \"name\": \"isMutable\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"collectionDetails\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"CollectionDetails\"\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UpdateMetadataAccountArgsV2\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"data\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"DataV2\"\n              }\n            }\n          },\n          {\n            \"name\": \"updateAuthority\",\n            \"type\": {\n              \"option\": \"publicKey\"\n            }\n          },\n          {\n            \"name\": \"primarySaleHappened\",\n            \"type\": {\n              \"option\": \"bool\"\n            }\n          },\n          {\n            \"name\": \"isMutable\",\n            \"type\": {\n              \"option\": \"bool\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ApproveUseAuthorityArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"numberOfUses\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UtilizeArgs\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"numberOfUses\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"AuthorizationData\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"payload\",\n            \"type\": {\n              \"defined\": \"Payload\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"AssetData\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"name\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"symbol\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"uri\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"sellerFeeBasisPoints\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"creators\",\n            \"type\": {\n              \"option\": {\n                \"vec\": {\n                  \"defined\": \"Creator\"\n                }\n              }\n            }\n          },\n          {\n            \"name\": \"primarySaleHappened\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"isMutable\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"tokenStandard\",\n            \"type\": {\n              \"defined\": \"TokenStandard\"\n            }\n          },\n          {\n            \"name\": \"collection\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Collection\"\n              }\n            }\n          },\n          {\n            \"name\": \"uses\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Uses\"\n              }\n            }\n          },\n          {\n            \"name\": \"collectionDetails\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"CollectionDetails\"\n              }\n            }\n          },\n          {\n            \"name\": \"ruleSet\",\n            \"type\": {\n              \"option\": \"publicKey\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Collection\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"verified\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"key\",\n            \"type\": \"publicKey\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Creator\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"address\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"verified\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"share\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Data\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"name\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"symbol\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"uri\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"sellerFeeBasisPoints\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"creators\",\n            \"type\": {\n              \"option\": {\n                \"vec\": {\n                  \"defined\": \"Creator\"\n                }\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"DataV2\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"name\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"symbol\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"uri\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"sellerFeeBasisPoints\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"creators\",\n            \"type\": {\n              \"option\": {\n                \"vec\": {\n                  \"defined\": \"Creator\"\n                }\n              }\n            }\n          },\n          {\n            \"name\": \"collection\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Collection\"\n              }\n            }\n          },\n          {\n            \"name\": \"uses\",\n            \"type\": {\n              \"option\": {\n                \"defined\": \"Uses\"\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Reservation\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"address\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"spotsRemaining\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"totalSpots\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ReservationV1\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"address\",\n            \"type\": \"publicKey\"\n          },\n          {\n            \"name\": \"spotsRemaining\",\n            \"type\": \"u8\"\n          },\n          {\n            \"name\": \"totalSpots\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"SeedsVec\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"seeds\",\n            \"type\": {\n              \"vec\": \"bytes\"\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ProofInfo\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"proof\",\n            \"type\": {\n              \"vec\": {\n                \"array\": [\"u8\", 32]\n              }\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Payload\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"map\",\n            \"type\": {\n              \"hashMap\": [\n                \"string\",\n                {\n                  \"defined\": \"PayloadType\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Uses\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"useMethod\",\n            \"type\": {\n              \"defined\": \"UseMethod\"\n            }\n          },\n          {\n            \"name\": \"remaining\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"total\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"BurnArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"DelegateArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"CollectionV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"SaleV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"TransferV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"DataV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"UtilityV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"StakingV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"StandardV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              }\n            ]\n          },\n          {\n            \"name\": \"LockedTransferV1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"locked_address\",\n                \"type\": \"publicKey\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"ProgrammableConfigV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AuthorityItemV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"DataItemV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"CollectionItemV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"ProgrammableConfigItemV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"PrintDelegateV1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"RevokeArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"CollectionV1\"\n          },\n          {\n            \"name\": \"SaleV1\"\n          },\n          {\n            \"name\": \"TransferV1\"\n          },\n          {\n            \"name\": \"DataV1\"\n          },\n          {\n            \"name\": \"UtilityV1\"\n          },\n          {\n            \"name\": \"StakingV1\"\n          },\n          {\n            \"name\": \"StandardV1\"\n          },\n          {\n            \"name\": \"LockedTransferV1\"\n          },\n          {\n            \"name\": \"ProgrammableConfigV1\"\n          },\n          {\n            \"name\": \"MigrationV1\"\n          },\n          {\n            \"name\": \"AuthorityItemV1\"\n          },\n          {\n            \"name\": \"DataItemV1\"\n          },\n          {\n            \"name\": \"CollectionItemV1\"\n          },\n          {\n            \"name\": \"ProgrammableConfigItemV1\"\n          },\n          {\n            \"name\": \"PrintDelegateV1\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MetadataDelegateRole\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"AuthorityItem\"\n          },\n          {\n            \"name\": \"Collection\"\n          },\n          {\n            \"name\": \"Use\"\n          },\n          {\n            \"name\": \"Data\"\n          },\n          {\n            \"name\": \"ProgrammableConfig\"\n          },\n          {\n            \"name\": \"DataItem\"\n          },\n          {\n            \"name\": \"CollectionItem\"\n          },\n          {\n            \"name\": \"ProgrammableConfigItem\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"HolderDelegateRole\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"PrintDelegate\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CreateArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"asset_data\",\n                \"type\": {\n                  \"defined\": \"AssetData\"\n                }\n              },\n              {\n                \"name\": \"decimals\",\n                \"type\": {\n                  \"option\": \"u8\"\n                }\n              },\n              {\n                \"name\": \"print_supply\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"PrintSupply\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MintArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TransferArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"amount\",\n                \"type\": \"u64\"\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UpdateArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"new_update_authority\",\n                \"type\": {\n                  \"option\": \"publicKey\"\n                }\n              },\n              {\n                \"name\": \"data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"Data\"\n                  }\n                }\n              },\n              {\n                \"name\": \"primary_sale_happened\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"is_mutable\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"collection\",\n                \"type\": {\n                  \"defined\": \"CollectionToggle\"\n                }\n              },\n              {\n                \"name\": \"collection_details\",\n                \"type\": {\n                  \"defined\": \"CollectionDetailsToggle\"\n                }\n              },\n              {\n                \"name\": \"uses\",\n                \"type\": {\n                  \"defined\": \"UsesToggle\"\n                }\n              },\n              {\n                \"name\": \"rule_set\",\n                \"type\": {\n                  \"defined\": \"RuleSetToggle\"\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsUpdateAuthorityV2\",\n            \"fields\": [\n              {\n                \"name\": \"new_update_authority\",\n                \"type\": {\n                  \"option\": \"publicKey\"\n                }\n              },\n              {\n                \"name\": \"data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"Data\"\n                  }\n                }\n              },\n              {\n                \"name\": \"primary_sale_happened\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"is_mutable\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"collection\",\n                \"type\": {\n                  \"defined\": \"CollectionToggle\"\n                }\n              },\n              {\n                \"name\": \"collection_details\",\n                \"type\": {\n                  \"defined\": \"CollectionDetailsToggle\"\n                }\n              },\n              {\n                \"name\": \"uses\",\n                \"type\": {\n                  \"defined\": \"UsesToggle\"\n                }\n              },\n              {\n                \"name\": \"rule_set\",\n                \"type\": {\n                  \"defined\": \"RuleSetToggle\"\n                }\n              },\n              {\n                \"name\": \"token_standard\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"TokenStandard\"\n                  }\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsAuthorityItemDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"new_update_authority\",\n                \"type\": {\n                  \"option\": \"publicKey\"\n                }\n              },\n              {\n                \"name\": \"primary_sale_happened\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"is_mutable\",\n                \"type\": {\n                  \"option\": \"bool\"\n                }\n              },\n              {\n                \"name\": \"token_standard\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"TokenStandard\"\n                  }\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsCollectionDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"collection\",\n                \"type\": {\n                  \"defined\": \"CollectionToggle\"\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsDataDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"Data\"\n                  }\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsProgrammableConfigDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"rule_set\",\n                \"type\": {\n                  \"defined\": \"RuleSetToggle\"\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsDataItemDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"Data\"\n                  }\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsCollectionItemDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"collection\",\n                \"type\": {\n                  \"defined\": \"CollectionToggle\"\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          },\n          {\n            \"name\": \"AsProgrammableConfigItemDelegateV2\",\n            \"fields\": [\n              {\n                \"name\": \"rule_set\",\n                \"type\": {\n                  \"defined\": \"RuleSetToggle\"\n                }\n              },\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CollectionToggle\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"None\"\n          },\n          {\n            \"name\": \"Clear\"\n          },\n          {\n            \"name\": \"Set\",\n            \"fields\": [\n              {\n                \"defined\": \"Collection\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UsesToggle\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"None\"\n          },\n          {\n            \"name\": \"Clear\"\n          },\n          {\n            \"name\": \"Set\",\n            \"fields\": [\n              {\n                \"defined\": \"Uses\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CollectionDetailsToggle\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"None\"\n          },\n          {\n            \"name\": \"Clear\"\n          },\n          {\n            \"name\": \"Set\",\n            \"fields\": [\n              {\n                \"defined\": \"CollectionDetails\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"RuleSetToggle\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"None\"\n          },\n          {\n            \"name\": \"Clear\"\n          },\n          {\n            \"name\": \"Set\",\n            \"fields\": [\"publicKey\"]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"PrintArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"edition\",\n                \"type\": \"u64\"\n              }\n            ]\n          },\n          {\n            \"name\": \"V2\",\n            \"fields\": [\n              {\n                \"name\": \"edition\",\n                \"type\": \"u64\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"LockArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UnlockArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UseArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"authorization_data\",\n                \"type\": {\n                  \"option\": {\n                    \"defined\": \"AuthorizationData\"\n                  }\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"VerificationArgs\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"CreatorV1\"\n          },\n          {\n            \"name\": \"CollectionV1\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TokenStandard\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"NonFungible\"\n          },\n          {\n            \"name\": \"FungibleAsset\"\n          },\n          {\n            \"name\": \"Fungible\"\n          },\n          {\n            \"name\": \"NonFungibleEdition\"\n          },\n          {\n            \"name\": \"ProgrammableNonFungible\"\n          },\n          {\n            \"name\": \"ProgrammableNonFungibleEdition\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Key\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Uninitialized\"\n          },\n          {\n            \"name\": \"EditionV1\"\n          },\n          {\n            \"name\": \"MasterEditionV1\"\n          },\n          {\n            \"name\": \"ReservationListV1\"\n          },\n          {\n            \"name\": \"MetadataV1\"\n          },\n          {\n            \"name\": \"ReservationListV2\"\n          },\n          {\n            \"name\": \"MasterEditionV2\"\n          },\n          {\n            \"name\": \"EditionMarker\"\n          },\n          {\n            \"name\": \"UseAuthorityRecord\"\n          },\n          {\n            \"name\": \"CollectionAuthorityRecord\"\n          },\n          {\n            \"name\": \"TokenOwnedEscrow\"\n          },\n          {\n            \"name\": \"TokenRecord\"\n          },\n          {\n            \"name\": \"MetadataDelegate\"\n          },\n          {\n            \"name\": \"EditionMarkerV2\"\n          },\n          {\n            \"name\": \"HolderDelegate\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"CollectionDetails\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"size\",\n                \"type\": \"u64\"\n              }\n            ]\n          },\n          {\n            \"name\": \"V2\",\n            \"fields\": [\n              {\n                \"name\": \"padding\",\n                \"type\": {\n                  \"array\": [\"u8\", 8]\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"EscrowAuthority\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"TokenOwner\"\n          },\n          {\n            \"name\": \"Creator\",\n            \"fields\": [\"publicKey\"]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"PrintSupply\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Zero\"\n          },\n          {\n            \"name\": \"Limited\",\n            \"fields\": [\"u64\"]\n          },\n          {\n            \"name\": \"Unlimited\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ProgrammableConfig\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"V1\",\n            \"fields\": [\n              {\n                \"name\": \"rule_set\",\n                \"type\": {\n                  \"option\": \"publicKey\"\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"MigrationType\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"CollectionV1\"\n          },\n          {\n            \"name\": \"ProgrammableV1\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TokenState\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Unlocked\"\n          },\n          {\n            \"name\": \"Locked\"\n          },\n          {\n            \"name\": \"Listed\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"TokenDelegateRole\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Sale\"\n          },\n          {\n            \"name\": \"Transfer\"\n          },\n          {\n            \"name\": \"Utility\"\n          },\n          {\n            \"name\": \"Staking\"\n          },\n          {\n            \"name\": \"Standard\"\n          },\n          {\n            \"name\": \"LockedTransfer\"\n          },\n          {\n            \"name\": \"Migration\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"AuthorityType\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"None\"\n          },\n          {\n            \"name\": \"Metadata\"\n          },\n          {\n            \"name\": \"Holder\"\n          },\n          {\n            \"name\": \"MetadataDelegate\"\n          },\n          {\n            \"name\": \"TokenDelegate\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"PayloadKey\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Amount\"\n          },\n          {\n            \"name\": \"Authority\"\n          },\n          {\n            \"name\": \"AuthoritySeeds\"\n          },\n          {\n            \"name\": \"Delegate\"\n          },\n          {\n            \"name\": \"DelegateSeeds\"\n          },\n          {\n            \"name\": \"Destination\"\n          },\n          {\n            \"name\": \"DestinationSeeds\"\n          },\n          {\n            \"name\": \"Holder\"\n          },\n          {\n            \"name\": \"Source\"\n          },\n          {\n            \"name\": \"SourceSeeds\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"PayloadType\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Pubkey\",\n            \"fields\": [\"publicKey\"]\n          },\n          {\n            \"name\": \"Seeds\",\n            \"fields\": [\n              {\n                \"defined\": \"SeedsVec\"\n              }\n            ]\n          },\n          {\n            \"name\": \"MerkleProof\",\n            \"fields\": [\n              {\n                \"defined\": \"ProofInfo\"\n              }\n            ]\n          },\n          {\n            \"name\": \"Number\",\n            \"fields\": [\"u64\"]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UseMethod\",\n      \"type\": {\n        \"kind\": \"enum\",\n        \"variants\": [\n          {\n            \"name\": \"Burn\"\n          },\n          {\n            \"name\": \"Multiple\"\n          },\n          {\n            \"name\": \"Single\"\n          }\n        ]\n      }\n    }\n  ],\n  \"errors\": [\n    {\n      \"code\": 0,\n      \"name\": \"InstructionUnpackError\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 1,\n      \"name\": \"InstructionPackError\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 2,\n      \"name\": \"NotRentExempt\",\n      \"msg\": \"Lamport balance below rent-exempt threshold\"\n    },\n    {\n      \"code\": 3,\n      \"name\": \"AlreadyInitialized\",\n      \"msg\": \"Already initialized\"\n    },\n    {\n      \"code\": 4,\n      \"name\": \"Uninitialized\",\n      \"msg\": \"Uninitialized\"\n    },\n    {\n      \"code\": 5,\n      \"name\": \"InvalidMetadataKey\",\n      \"msg\": \" Metadata's key must match seed of ['metadata', program id, mint] provided\"\n    },\n    {\n      \"code\": 6,\n      \"name\": \"InvalidEditionKey\",\n      \"msg\": \"Edition's key must match seed of ['metadata', program id, name, 'edition'] provided\"\n    },\n    {\n      \"code\": 7,\n      \"name\": \"UpdateAuthorityIncorrect\",\n      \"msg\": \"Update Authority given does not match\"\n    },\n    {\n      \"code\": 8,\n      \"name\": \"UpdateAuthorityIsNotSigner\",\n      \"msg\": \"Update Authority needs to be signer to update metadata\"\n    },\n    {\n      \"code\": 9,\n      \"name\": \"NotMintAuthority\",\n      \"msg\": \"You must be the mint authority and signer on this transaction\"\n    },\n    {\n      \"code\": 10,\n      \"name\": \"InvalidMintAuthority\",\n      \"msg\": \"Mint authority provided does not match the authority on the mint\"\n    },\n    {\n      \"code\": 11,\n      \"name\": \"NameTooLong\",\n      \"msg\": \"Name too long\"\n    },\n    {\n      \"code\": 12,\n      \"name\": \"SymbolTooLong\",\n      \"msg\": \"Symbol too long\"\n    },\n    {\n      \"code\": 13,\n      \"name\": \"UriTooLong\",\n      \"msg\": \"URI too long\"\n    },\n    {\n      \"code\": 14,\n      \"name\": \"UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 15,\n      \"name\": \"MintMismatch\",\n      \"msg\": \"Mint given does not match mint on Metadata\"\n    },\n    {\n      \"code\": 16,\n      \"name\": \"EditionsMustHaveExactlyOneToken\",\n      \"msg\": \"Editions must have exactly one token\"\n    },\n    {\n      \"code\": 17,\n      \"name\": \"MaxEditionsMintedAlready\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 18,\n      \"name\": \"TokenMintToFailed\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 19,\n      \"name\": \"MasterRecordMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 20,\n      \"name\": \"DestinationMintMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 21,\n      \"name\": \"EditionAlreadyMinted\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 22,\n      \"name\": \"PrintingMintDecimalsShouldBeZero\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 23,\n      \"name\": \"OneTimePrintingAuthorizationMintDecimalsShouldBeZero\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 24,\n      \"name\": \"EditionMintDecimalsShouldBeZero\",\n      \"msg\": \"EditionMintDecimalsShouldBeZero\"\n    },\n    {\n      \"code\": 25,\n      \"name\": \"TokenBurnFailed\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 26,\n      \"name\": \"TokenAccountOneTimeAuthMintMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 27,\n      \"name\": \"DerivedKeyInvalid\",\n      \"msg\": \"Derived key invalid\"\n    },\n    {\n      \"code\": 28,\n      \"name\": \"PrintingMintMismatch\",\n      \"msg\": \"The Printing mint does not match that on the master edition!\"\n    },\n    {\n      \"code\": 29,\n      \"name\": \"OneTimePrintingAuthMintMismatch\",\n      \"msg\": \"The One Time Printing Auth mint does not match that on the master edition!\"\n    },\n    {\n      \"code\": 30,\n      \"name\": \"TokenAccountMintMismatch\",\n      \"msg\": \"The mint of the token account does not match the Printing mint!\"\n    },\n    {\n      \"code\": 31,\n      \"name\": \"TokenAccountMintMismatchV2\",\n      \"msg\": \"The mint of the token account does not match the master metadata mint!\"\n    },\n    {\n      \"code\": 32,\n      \"name\": \"NotEnoughTokens\",\n      \"msg\": \"Not enough tokens to mint a limited edition\"\n    },\n    {\n      \"code\": 33,\n      \"name\": \"PrintingMintAuthorizationAccountMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 34,\n      \"name\": \"AuthorizationTokenAccountOwnerMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 35,\n      \"name\": \"Disabled\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 36,\n      \"name\": \"CreatorsTooLong\",\n      \"msg\": \"Creators list too long\"\n    },\n    {\n      \"code\": 37,\n      \"name\": \"CreatorsMustBeAtleastOne\",\n      \"msg\": \"Creators must be at least one if set\"\n    },\n    {\n      \"code\": 38,\n      \"name\": \"MustBeOneOfCreators\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 39,\n      \"name\": \"NoCreatorsPresentOnMetadata\",\n      \"msg\": \"This metadata does not have creators\"\n    },\n    {\n      \"code\": 40,\n      \"name\": \"CreatorNotFound\",\n      \"msg\": \"This creator address was not found\"\n    },\n    {\n      \"code\": 41,\n      \"name\": \"InvalidBasisPoints\",\n      \"msg\": \"Basis points cannot be more than 10000\"\n    },\n    {\n      \"code\": 42,\n      \"name\": \"PrimarySaleCanOnlyBeFlippedToTrue\",\n      \"msg\": \"Primary sale can only be flipped to true and is immutable\"\n    },\n    {\n      \"code\": 43,\n      \"name\": \"OwnerMismatch\",\n      \"msg\": \"Owner does not match that on the account given\"\n    },\n    {\n      \"code\": 44,\n      \"name\": \"NoBalanceInAccountForAuthorization\",\n      \"msg\": \"This account has no tokens to be used for authorization\"\n    },\n    {\n      \"code\": 45,\n      \"name\": \"ShareTotalMustBe100\",\n      \"msg\": \"Share total must equal 100 for creator array\"\n    },\n    {\n      \"code\": 46,\n      \"name\": \"ReservationExists\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 47,\n      \"name\": \"ReservationDoesNotExist\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 48,\n      \"name\": \"ReservationNotSet\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 49,\n      \"name\": \"ReservationAlreadyMade\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 50,\n      \"name\": \"BeyondMaxAddressSize\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 51,\n      \"name\": \"NumericalOverflowError\",\n      \"msg\": \"NumericalOverflowError\"\n    },\n    {\n      \"code\": 52,\n      \"name\": \"ReservationBreachesMaximumSupply\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 53,\n      \"name\": \"AddressNotInReservation\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 54,\n      \"name\": \"CannotVerifyAnotherCreator\",\n      \"msg\": \"You cannot unilaterally verify another creator, they must sign\"\n    },\n    {\n      \"code\": 55,\n      \"name\": \"CannotUnverifyAnotherCreator\",\n      \"msg\": \"You cannot unilaterally unverify another creator\"\n    },\n    {\n      \"code\": 56,\n      \"name\": \"SpotMismatch\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 57,\n      \"name\": \"IncorrectOwner\",\n      \"msg\": \"Incorrect account owner\"\n    },\n    {\n      \"code\": 58,\n      \"name\": \"PrintingWouldBreachMaximumSupply\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 59,\n      \"name\": \"DataIsImmutable\",\n      \"msg\": \"Data is immutable\"\n    },\n    {\n      \"code\": 60,\n      \"name\": \"DuplicateCreatorAddress\",\n      \"msg\": \"No duplicate creator addresses\"\n    },\n    {\n      \"code\": 61,\n      \"name\": \"ReservationSpotsRemainingShouldMatchTotalSpotsAtStart\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 62,\n      \"name\": \"InvalidTokenProgram\",\n      \"msg\": \"Invalid token program\"\n    },\n    {\n      \"code\": 63,\n      \"name\": \"DataTypeMismatch\",\n      \"msg\": \"Data type mismatch\"\n    },\n    {\n      \"code\": 64,\n      \"name\": \"BeyondAlottedAddressSize\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 65,\n      \"name\": \"ReservationNotComplete\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 66,\n      \"name\": \"TriedToReplaceAnExistingReservation\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 67,\n      \"name\": \"InvalidOperation\",\n      \"msg\": \"Invalid operation\"\n    },\n    {\n      \"code\": 68,\n      \"name\": \"InvalidOwner\",\n      \"msg\": \"Invalid Owner\"\n    },\n    {\n      \"code\": 69,\n      \"name\": \"PrintingMintSupplyMustBeZeroForConversion\",\n      \"msg\": \"Printing mint supply must be zero for conversion\"\n    },\n    {\n      \"code\": 70,\n      \"name\": \"OneTimeAuthMintSupplyMustBeZeroForConversion\",\n      \"msg\": \"One Time Auth mint supply must be zero for conversion\"\n    },\n    {\n      \"code\": 71,\n      \"name\": \"InvalidEditionIndex\",\n      \"msg\": \"You tried to insert one edition too many into an edition mark pda\"\n    },\n    {\n      \"code\": 72,\n      \"name\": \"ReservationArrayShouldBeSizeOne\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 73,\n      \"name\": \"IsMutableCanOnlyBeFlippedToFalse\",\n      \"msg\": \"Is Mutable can only be flipped to false\"\n    },\n    {\n      \"code\": 74,\n      \"name\": \"CollectionCannotBeVerifiedInThisInstruction\",\n      \"msg\": \"Collection cannot be verified in this instruction\"\n    },\n    {\n      \"code\": 75,\n      \"name\": \"Removed\",\n      \"msg\": \"This instruction was deprecated in a previous release and is now removed\"\n    },\n    {\n      \"code\": 76,\n      \"name\": \"MustBeBurned\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 77,\n      \"name\": \"InvalidUseMethod\",\n      \"msg\": \"This use method is invalid\"\n    },\n    {\n      \"code\": 78,\n      \"name\": \"CannotChangeUseMethodAfterFirstUse\",\n      \"msg\": \"Cannot Change Use Method after the first use\"\n    },\n    {\n      \"code\": 79,\n      \"name\": \"CannotChangeUsesAfterFirstUse\",\n      \"msg\": \"Cannot Change Remaining or Available uses after the first use\"\n    },\n    {\n      \"code\": 80,\n      \"name\": \"CollectionNotFound\",\n      \"msg\": \"Collection Not Found on Metadata\"\n    },\n    {\n      \"code\": 81,\n      \"name\": \"InvalidCollectionUpdateAuthority\",\n      \"msg\": \"Collection Update Authority is invalid\"\n    },\n    {\n      \"code\": 82,\n      \"name\": \"CollectionMustBeAUniqueMasterEdition\",\n      \"msg\": \"Collection Must Be a Unique Master Edition v2\"\n    },\n    {\n      \"code\": 83,\n      \"name\": \"UseAuthorityRecordAlreadyExists\",\n      \"msg\": \"The Use Authority Record Already Exists, to modify it Revoke, then Approve\"\n    },\n    {\n      \"code\": 84,\n      \"name\": \"UseAuthorityRecordAlreadyRevoked\",\n      \"msg\": \"The Use Authority Record is empty or already revoked\"\n    },\n    {\n      \"code\": 85,\n      \"name\": \"Unusable\",\n      \"msg\": \"This token has no uses\"\n    },\n    {\n      \"code\": 86,\n      \"name\": \"NotEnoughUses\",\n      \"msg\": \"There are not enough Uses left on this token.\"\n    },\n    {\n      \"code\": 87,\n      \"name\": \"CollectionAuthorityRecordAlreadyExists\",\n      \"msg\": \"This Collection Authority Record Already Exists.\"\n    },\n    {\n      \"code\": 88,\n      \"name\": \"CollectionAuthorityDoesNotExist\",\n      \"msg\": \"This Collection Authority Record Does Not Exist.\"\n    },\n    {\n      \"code\": 89,\n      \"name\": \"InvalidUseAuthorityRecord\",\n      \"msg\": \"This Use Authority Record is invalid.\"\n    },\n    {\n      \"code\": 90,\n      \"name\": \"InvalidCollectionAuthorityRecord\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 91,\n      \"name\": \"InvalidFreezeAuthority\",\n      \"msg\": \"Metadata does not match the freeze authority on the mint\"\n    },\n    {\n      \"code\": 92,\n      \"name\": \"InvalidDelegate\",\n      \"msg\": \"All tokens in this account have not been delegated to this user.\"\n    },\n    {\n      \"code\": 93,\n      \"name\": \"CannotAdjustVerifiedCreator\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 94,\n      \"name\": \"CannotRemoveVerifiedCreator\",\n      \"msg\": \"Verified creators cannot be removed.\"\n    },\n    {\n      \"code\": 95,\n      \"name\": \"CannotWipeVerifiedCreators\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 96,\n      \"name\": \"NotAllowedToChangeSellerFeeBasisPoints\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 97,\n      \"name\": \"EditionOverrideCannotBeZero\",\n      \"msg\": \"Edition override cannot be zero\"\n    },\n    {\n      \"code\": 98,\n      \"name\": \"InvalidUser\",\n      \"msg\": \"Invalid User\"\n    },\n    {\n      \"code\": 99,\n      \"name\": \"RevokeCollectionAuthoritySignerIncorrect\",\n      \"msg\": \"Revoke Collection Authority signer is incorrect\"\n    },\n    {\n      \"code\": 100,\n      \"name\": \"TokenCloseFailed\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 101,\n      \"name\": \"UnsizedCollection\",\n      \"msg\": \"Can't use this function on unsized collection\"\n    },\n    {\n      \"code\": 102,\n      \"name\": \"SizedCollection\",\n      \"msg\": \"Can't use this function on a sized collection\"\n    },\n    {\n      \"code\": 103,\n      \"name\": \"MissingCollectionMetadata\",\n      \"msg\": \"Missing collection metadata account\"\n    },\n    {\n      \"code\": 104,\n      \"name\": \"NotAMemberOfCollection\",\n      \"msg\": \"This NFT is not a member of the specified collection.\"\n    },\n    {\n      \"code\": 105,\n      \"name\": \"NotVerifiedMemberOfCollection\",\n      \"msg\": \"This NFT is not a verified member of the specified collection.\"\n    },\n    {\n      \"code\": 106,\n      \"name\": \"NotACollectionParent\",\n      \"msg\": \"This NFT is not a collection parent NFT.\"\n    },\n    {\n      \"code\": 107,\n      \"name\": \"CouldNotDetermineTokenStandard\",\n      \"msg\": \"Could not determine a TokenStandard type.\"\n    },\n    {\n      \"code\": 108,\n      \"name\": \"MissingEditionAccount\",\n      \"msg\": \"This mint account has an edition but none was provided.\"\n    },\n    {\n      \"code\": 109,\n      \"name\": \"NotAMasterEdition\",\n      \"msg\": \"This edition is not a Master Edition\"\n    },\n    {\n      \"code\": 110,\n      \"name\": \"MasterEditionHasPrints\",\n      \"msg\": \"This Master Edition has existing prints\"\n    },\n    {\n      \"code\": 111,\n      \"name\": \"BorshDeserializationError\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 112,\n      \"name\": \"CannotUpdateVerifiedCollection\",\n      \"msg\": \"Cannot update a verified collection in this command\"\n    },\n    {\n      \"code\": 113,\n      \"name\": \"CollectionMasterEditionAccountInvalid\",\n      \"msg\": \"Edition account doesnt match collection \"\n    },\n    {\n      \"code\": 114,\n      \"name\": \"AlreadyVerified\",\n      \"msg\": \"Item is already verified.\"\n    },\n    {\n      \"code\": 115,\n      \"name\": \"AlreadyUnverified\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 116,\n      \"name\": \"NotAPrintEdition\",\n      \"msg\": \"This edition is not a Print Edition\"\n    },\n    {\n      \"code\": 117,\n      \"name\": \"InvalidMasterEdition\",\n      \"msg\": \"Invalid Master Edition\"\n    },\n    {\n      \"code\": 118,\n      \"name\": \"InvalidPrintEdition\",\n      \"msg\": \"Invalid Print Edition\"\n    },\n    {\n      \"code\": 119,\n      \"name\": \"InvalidEditionMarker\",\n      \"msg\": \"Invalid Edition Marker\"\n    },\n    {\n      \"code\": 120,\n      \"name\": \"ReservationListDeprecated\",\n      \"msg\": \"Reservation List is Deprecated\"\n    },\n    {\n      \"code\": 121,\n      \"name\": \"PrintEditionDoesNotMatchMasterEdition\",\n      \"msg\": \"Print Edition does not match Master Edition\"\n    },\n    {\n      \"code\": 122,\n      \"name\": \"EditionNumberGreaterThanMaxSupply\",\n      \"msg\": \"Edition Number greater than max supply\"\n    },\n    {\n      \"code\": 123,\n      \"name\": \"MustUnverify\",\n      \"msg\": \"Must unverify before migrating collections.\"\n    },\n    {\n      \"code\": 124,\n      \"name\": \"InvalidEscrowBumpSeed\",\n      \"msg\": \"Invalid Escrow Account Bump Seed\"\n    },\n    {\n      \"code\": 125,\n      \"name\": \"MustBeEscrowAuthority\",\n      \"msg\": \"Must Escrow Authority\"\n    },\n    {\n      \"code\": 126,\n      \"name\": \"InvalidSystemProgram\",\n      \"msg\": \"Invalid System Program\"\n    },\n    {\n      \"code\": 127,\n      \"name\": \"MustBeNonFungible\",\n      \"msg\": \"Must be a Non Fungible Token\"\n    },\n    {\n      \"code\": 128,\n      \"name\": \"InsufficientTokens\",\n      \"msg\": \"Insufficient tokens for transfer\"\n    },\n    {\n      \"code\": 129,\n      \"name\": \"BorshSerializationError\",\n      \"msg\": \"Borsh Serialization Error\"\n    },\n    {\n      \"code\": 130,\n      \"name\": \"NoFreezeAuthoritySet\",\n      \"msg\": \"Cannot create NFT with no Freeze Authority.\"\n    },\n    {\n      \"code\": 131,\n      \"name\": \"InvalidCollectionSizeChange\",\n      \"msg\": \"Invalid collection size change\"\n    },\n    {\n      \"code\": 132,\n      \"name\": \"InvalidBubblegumSigner\",\n      \"msg\": \"Invalid bubblegum signer\"\n    },\n    {\n      \"code\": 133,\n      \"name\": \"EscrowParentHasDelegate\",\n      \"msg\": \"Escrow parent cannot have a delegate\"\n    },\n    {\n      \"code\": 134,\n      \"name\": \"MintIsNotSigner\",\n      \"msg\": \"Mint needs to be signer to initialize the account\"\n    },\n    {\n      \"code\": 135,\n      \"name\": \"InvalidTokenStandard\",\n      \"msg\": \"Invalid token standard\"\n    },\n    {\n      \"code\": 136,\n      \"name\": \"InvalidMintForTokenStandard\",\n      \"msg\": \"Invalid mint account for specified token standard\"\n    },\n    {\n      \"code\": 137,\n      \"name\": \"InvalidAuthorizationRules\",\n      \"msg\": \"Invalid authorization rules account\"\n    },\n    {\n      \"code\": 138,\n      \"name\": \"MissingAuthorizationRules\",\n      \"msg\": \"Missing authorization rules account\"\n    },\n    {\n      \"code\": 139,\n      \"name\": \"MissingProgrammableConfig\",\n      \"msg\": \"Missing programmable configuration\"\n    },\n    {\n      \"code\": 140,\n      \"name\": \"InvalidProgrammableConfig\",\n      \"msg\": \"Invalid programmable configuration\"\n    },\n    {\n      \"code\": 141,\n      \"name\": \"DelegateAlreadyExists\",\n      \"msg\": \"Delegate already exists\"\n    },\n    {\n      \"code\": 142,\n      \"name\": \"DelegateNotFound\",\n      \"msg\": \"Delegate not found\"\n    },\n    {\n      \"code\": 143,\n      \"name\": \"MissingAccountInBuilder\",\n      \"msg\": \"Required account not set in instruction builder\"\n    },\n    {\n      \"code\": 144,\n      \"name\": \"MissingArgumentInBuilder\",\n      \"msg\": \"Required argument not set in instruction builder\"\n    },\n    {\n      \"code\": 145,\n      \"name\": \"FeatureNotSupported\",\n      \"msg\": \"Feature not supported currently\"\n    },\n    {\n      \"code\": 146,\n      \"name\": \"InvalidSystemWallet\",\n      \"msg\": \"Invalid system wallet\"\n    },\n    {\n      \"code\": 147,\n      \"name\": \"OnlySaleDelegateCanTransfer\",\n      \"msg\": \"Only the sale delegate can transfer while its set\"\n    },\n    {\n      \"code\": 148,\n      \"name\": \"MissingTokenAccount\",\n      \"msg\": \"Missing token account\"\n    },\n    {\n      \"code\": 149,\n      \"name\": \"MissingSplTokenProgram\",\n      \"msg\": \"Missing SPL token program\"\n    },\n    {\n      \"code\": 150,\n      \"name\": \"MissingAuthorizationRulesProgram\",\n      \"msg\": \"Missing authorization rules program\"\n    },\n    {\n      \"code\": 151,\n      \"name\": \"InvalidDelegateRoleForTransfer\",\n      \"msg\": \"Invalid delegate role for transfer\"\n    },\n    {\n      \"code\": 152,\n      \"name\": \"InvalidTransferAuthority\",\n      \"msg\": \"Invalid transfer authority\"\n    },\n    {\n      \"code\": 153,\n      \"name\": \"InstructionNotSupported\",\n      \"msg\": \"Instruction not supported for ProgrammableNonFungible assets\"\n    },\n    {\n      \"code\": 154,\n      \"name\": \"KeyMismatch\",\n      \"msg\": \"Public key does not match expected value\"\n    },\n    {\n      \"code\": 155,\n      \"name\": \"LockedToken\",\n      \"msg\": \"Token is locked\"\n    },\n    {\n      \"code\": 156,\n      \"name\": \"UnlockedToken\",\n      \"msg\": \"Token is unlocked\"\n    },\n    {\n      \"code\": 157,\n      \"name\": \"MissingDelegateRole\",\n      \"msg\": \"Missing delegate role\"\n    },\n    {\n      \"code\": 158,\n      \"name\": \"InvalidAuthorityType\",\n      \"msg\": \"Invalid authority type\"\n    },\n    {\n      \"code\": 159,\n      \"name\": \"MissingTokenRecord\",\n      \"msg\": \"Missing token record account\"\n    },\n    {\n      \"code\": 160,\n      \"name\": \"MintSupplyMustBeZero\",\n      \"msg\": \"Mint supply must be zero for programmable assets\"\n    },\n    {\n      \"code\": 161,\n      \"name\": \"DataIsEmptyOrZeroed\",\n      \"msg\": \"Data is empty or zeroed\"\n    },\n    {\n      \"code\": 162,\n      \"name\": \"MissingTokenOwnerAccount\",\n      \"msg\": \"Missing token owner\"\n    },\n    {\n      \"code\": 163,\n      \"name\": \"InvalidMasterEditionAccountLength\",\n      \"msg\": \"Master edition account has an invalid length\"\n    },\n    {\n      \"code\": 164,\n      \"name\": \"IncorrectTokenState\",\n      \"msg\": \"Incorrect token state\"\n    },\n    {\n      \"code\": 165,\n      \"name\": \"InvalidDelegateRole\",\n      \"msg\": \"Invalid delegate role\"\n    },\n    {\n      \"code\": 166,\n      \"name\": \"MissingPrintSupply\",\n      \"msg\": \"Print supply is required for non-fungibles\"\n    },\n    {\n      \"code\": 167,\n      \"name\": \"MissingMasterEditionAccount\",\n      \"msg\": \"Missing master edition account\"\n    },\n    {\n      \"code\": 168,\n      \"name\": \"AmountMustBeGreaterThanZero\",\n      \"msg\": \"Amount must be greater than zero\"\n    },\n    {\n      \"code\": 169,\n      \"name\": \"InvalidDelegateArgs\",\n      \"msg\": \"Invalid delegate args\"\n    },\n    {\n      \"code\": 170,\n      \"name\": \"MissingLockedTransferAddress\",\n      \"msg\": \"Missing address for locked transfer\"\n    },\n    {\n      \"code\": 171,\n      \"name\": \"InvalidLockedTransferAddress\",\n      \"msg\": \"Invalid destination address for locked transfer\"\n    },\n    {\n      \"code\": 172,\n      \"name\": \"DataIncrementLimitExceeded\",\n      \"msg\": \"Exceeded account realloc increase limit\"\n    },\n    {\n      \"code\": 173,\n      \"name\": \"CannotUpdateAssetWithDelegate\",\n      \"msg\": \"Cannot update the rule set of a programmable asset that has a delegate\"\n    },\n    {\n      \"code\": 174,\n      \"name\": \"InvalidAmount\",\n      \"msg\": \"Invalid token amount for this operation or token standard\"\n    },\n    {\n      \"code\": 175,\n      \"name\": \"MissingMasterEditionMintAccount\",\n      \"msg\": \"Missing master edition mint account\"\n    },\n    {\n      \"code\": 176,\n      \"name\": \"MissingMasterEditionTokenAccount\",\n      \"msg\": \"Missing master edition token account\"\n    },\n    {\n      \"code\": 177,\n      \"name\": \"MissingEditionMarkerAccount\",\n      \"msg\": \"Missing edition marker account\"\n    },\n    {\n      \"code\": 178,\n      \"name\": \"CannotBurnWithDelegate\",\n      \"msg\": \"Cannot burn while persistent delegate is set\"\n    },\n    {\n      \"code\": 179,\n      \"name\": \"MissingEdition\",\n      \"msg\": \"Missing edition account\"\n    },\n    {\n      \"code\": 180,\n      \"name\": \"InvalidAssociatedTokenAccountProgram\",\n      \"msg\": \"Invalid Associated Token Account Program\"\n    },\n    {\n      \"code\": 181,\n      \"name\": \"InvalidInstructionsSysvar\",\n      \"msg\": \"Invalid InstructionsSysvar\"\n    },\n    {\n      \"code\": 182,\n      \"name\": \"InvalidParentAccounts\",\n      \"msg\": \"Invalid or Unneeded parent accounts\"\n    },\n    {\n      \"code\": 183,\n      \"name\": \"InvalidUpdateArgs\",\n      \"msg\": \"Authority cannot apply all update args\"\n    },\n    {\n      \"code\": 184,\n      \"name\": \"InsufficientTokenBalance\",\n      \"msg\": \"Token account does not have enough tokens\"\n    },\n    {\n      \"code\": 185,\n      \"name\": \"MissingCollectionMint\",\n      \"msg\": \"Missing collection account\"\n    },\n    {\n      \"code\": 186,\n      \"name\": \"MissingCollectionMasterEdition\",\n      \"msg\": \"Missing collection master edition account\"\n    },\n    {\n      \"code\": 187,\n      \"name\": \"InvalidTokenRecord\",\n      \"msg\": \"Invalid token record account\"\n    },\n    {\n      \"code\": 188,\n      \"name\": \"InvalidCloseAuthority\",\n      \"msg\": \"The close authority needs to be revoked by the Utility Delegate\"\n    },\n    {\n      \"code\": 189,\n      \"name\": \"InvalidInstruction\",\n      \"msg\": \"Invalid or removed instruction\"\n    },\n    {\n      \"code\": 190,\n      \"name\": \"MissingDelegateRecord\",\n      \"msg\": \"Missing delegate record\"\n    },\n    {\n      \"code\": 191,\n      \"name\": \"InvalidFeeAccount\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 192,\n      \"name\": \"InvalidMetadataFlags\",\n      \"msg\": \"\"\n    },\n    {\n      \"code\": 193,\n      \"name\": \"CannotChangeUpdateAuthorityWithDelegate\",\n      \"msg\": \"Cannot change the update authority with a delegate\"\n    },\n    {\n      \"code\": 194,\n      \"name\": \"InvalidMintExtensionType\",\n      \"msg\": \"Invalid mint extension type\"\n    },\n    {\n      \"code\": 195,\n      \"name\": \"InvalidMintCloseAuthority\",\n      \"msg\": \"Invalid mint close authority\"\n    },\n    {\n      \"code\": 196,\n      \"name\": \"InvalidMetadataPointer\",\n      \"msg\": \"Invalid metadata pointer\"\n    },\n    {\n      \"code\": 197,\n      \"name\": \"InvalidTokenExtensionType\",\n      \"msg\": \"Invalid token extension type\"\n    },\n    {\n      \"code\": 198,\n      \"name\": \"MissingImmutableOwnerExtension\",\n      \"msg\": \"Missing immutable owner extension\"\n    },\n    {\n      \"code\": 199,\n      \"name\": \"ExpectedUninitializedAccount\",\n      \"msg\": \"Expected account to be uninitialized\"\n    },\n    {\n      \"code\": 200,\n      \"name\": \"InvalidEditionAccountLength\",\n      \"msg\": \"Edition account has an invalid length\"\n    },\n    {\n      \"code\": 201,\n      \"name\": \"AccountAlreadyResized\",\n      \"msg\": \"Account has already been resized\"\n    },\n    {\n      \"code\": 202,\n      \"name\": \"ConditionsForClosingNotMet\",\n      \"msg\": \"Conditions for closing not met\"\n    }\n  ],\n  \"metadata\": {\n    \"origin\": \"shank\",\n    \"address\": \"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s\",\n    \"binaryVersion\": \"0.3.0\",\n    \"libVersion\": \"0.3.0\"\n  }\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"gillsdk\",\n  \"license\": \"MIT\",\n  \"private\": true,\n  \"workspaces\": [\n    \"packages/*\"\n  ],\n  \"repository\": {\n    \"name\": \"gillsdk/gill\",\n    \"type\": \"git\",\n    \"url\": \"https://github.com/gillsdk/gill\"\n  },\n  \"scripts\": {\n    \"clean\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} clean && pnpm clean:root\",\n    \"clean:root\": \"rimraf coverage dist build node_modules .turbo\",\n    \"prebuild\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} build --filter=gill\",\n    \"coverage\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} coverage:open\",\n    \"build\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} build\",\n    \"codama:generate\": \"./idls/build-codama-clients.sh\",\n    \"compile:docs\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} compile:docs\",\n    \"test\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test\",\n    \"test:typecheck\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:typecheck\",\n    \"test:unit:node\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:unit:node\",\n    \"test:unit:browser\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:unit:browser\",\n    \"test:treeshakability:native\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:treeshakability:native\",\n    \"test:treeshakability:browser\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:treeshakability:browser\",\n    \"test:treeshakability:node\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} test:treeshakability:node\",\n    \"style:check\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} style:check\",\n    \"style:fix\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} style:fix\",\n    \"lint\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} lint\",\n    \"lint:fix\": \"turbo run --concurrency=${TURBO_CONCURRENCY:-95.84%} lint:fix\"\n  },\n  \"version\": \"0.0.1\",\n  \"description\": \"\",\n  \"engines\": {\n    \"node\": \">=20.18.0\",\n    \"npm\": \"please-use-pnpm\",\n    \"pnpm\": \"^9\",\n    \"yarn\": \"please-use-pnpm\"\n  },\n  \"devDependencies\": {\n    \"@changesets/changelog-github\": \"^0.5.0\",\n    \"@changesets/cli\": \"^2.27.10\",\n    \"@codama/cli\": \"^1.1.1\",\n    \"@swc/jest\": \"^0.2.37\",\n    \"@types/jest\": \"^29.5.14\",\n    \"@types/jscodeshift\": \"^0.12.0\",\n    \"@types/node\": \"^22\",\n    \"agadoo\": \"^3.0.0\",\n    \"browserslist-to-esbuild\": \"^2.1.1\",\n    \"bundlemon\": \"^3.1.0\",\n    \"eslint\": \"^9.14.0\",\n    \"jest\": \"^30.0.0-alpha.6\",\n    \"jest-environment-jsdom\": \"^30.0.0-alpha.6\",\n    \"jest-runner-eslint\": \"^2.2.1\",\n    \"jest-runner-prettier\": \"^1.0.0\",\n    \"jest-watch-master\": \"^1.0.0\",\n    \"jest-watch-select-projects\": \"^2.0.0\",\n    \"jest-watch-typeahead\": \"^2.2.2\",\n    \"jscodeshift\": \"^17.1.1\",\n    \"prettier\": \"^3.3\",\n    \"rimraf\": \"5.0.10\",\n    \"ts-node\": \"^10.9.2\",\n    \"tsup\": \"^8.3.5\",\n    \"turbo\": \"^2.3.1\",\n    \"typedoc\": \"^0.28.4\",\n    \"typedoc-plugin-frontmatter\": \"^1.3.0\",\n    \"typedoc-plugin-markdown\": \"^4.6.3\",\n    \"typedoc-plugin-mdn-links\": \"^5.0.2\"\n  },\n  \"packageManager\": \"pnpm@9.1.0\",\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"contributors\": [\n    {\n      \"name\": \"Nick Frostbutter\",\n      \"url\": \"https://github.com/nickfrosty\"\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/build-scripts/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/build-scripts/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/build-scripts/CHANGELOG.md",
    "content": "# @gillsdk/build-scripts\n\n## 0.0.1\n\n### Patch Changes\n\n- [#53](https://github.com/gillsdk/gill/pull/53)\n  [`452359c`](https://github.com/gillsdk/gill/commit/452359c08c5fd089fb1f1e7959e70fb34e148697) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - declare imports as type\n"
  },
  {
    "path": "packages/build-scripts/README.md",
    "content": "# `build-scripts`\n\nThis is the base build script shared across all packages in this monorepo.\n"
  },
  {
    "path": "packages/build-scripts/dev-flag.ts",
    "content": "import { readFile } from \"fs/promises\";\nimport jscodeshift from \"jscodeshift\";\nimport type { Options } from \"tsup\";\n\ntype Loader = NonNullable<\n  NonNullable<\n    Awaited<NonNullable<ReturnType<Parameters<Parameters<Plugin[\"setup\"]>[0][\"onLoad\"]>[1]>>>\n  >[\"loader\"]\n>;\ntype Plugin = NonNullable<Options[\"esbuildPlugins\"]>[number];\n\nfunction replaceDev(source: string): string {\n  if (/__DEV__/.test(source) !== true) {\n    return source;\n  }\n  const j = jscodeshift.withParser(\"tsx\");\n  const root = j(source);\n  root\n    .find(j.Identifier, { name: \"__DEV__\" })\n    .replaceWith(() =>\n      j.binaryExpression(\n        \"!==\",\n        j.memberExpression(\n          j.memberExpression(j.identifier(\"process\"), j.identifier(\"env\")),\n          j.identifier(\"NODE_ENV\"),\n        ),\n        j.stringLiteral(\"production\"),\n      ),\n    );\n  return root.toSource();\n}\n\nexport const DevFlagPlugin: Plugin = {\n  name: \"dev-flag-plugin\",\n  setup(build) {\n    build.onLoad({ filter: /\\.(t|j)sx?$/, namespace: \"file\" }, async ({ path }) => {\n      const contents = await readFile(path, \"utf-8\");\n      const ext = path.slice(path.lastIndexOf(\".\") + 1);\n      const loader = (ext.match(/(j|t)sx?$/) ? ext : \"js\") as Loader;\n      return {\n        contents: replaceDev(contents),\n        loader,\n      };\n    });\n  },\n};\n"
  },
  {
    "path": "packages/build-scripts/getBaseConfig.ts",
    "content": "import { env } from \"node:process\";\n\nimport browsersListToEsBuild from \"browserslist-to-esbuild\";\nimport type { Format, Options } from \"tsup\";\n\nimport { DevFlagPlugin } from \"./dev-flag\";\n\ntype Platform =\n  | \"browser\"\n  // React Native\n  | \"native\"\n  | \"node\";\n\nconst BROWSERSLIST_TARGETS = browsersListToEsBuild();\n\nexport function getBaseConfig(\n  platform: Platform,\n  formats: Format[],\n  optionsInput: Options,\n): Options[] {\n  return [true, false]\n    .flatMap<Options | null>((isDebugBuild) =>\n      formats.map((format) =>\n        format !== \"iife\" && isDebugBuild\n          ? null // We don't build debug builds for packages; only for the iife bundle.\n          : {\n              define: {\n                __BROWSER__: `${platform === \"browser\"}`,\n                __NODEJS__: `${platform === \"node\"}`,\n                __REACTNATIVE__: `${platform === \"native\"}`,\n                __VERSION__: `\"${env.npm_package_version}\"`,\n              },\n              dts: true, // This enables .d.ts file generation\n              entry: optionsInput.entry ? optionsInput.entry : [`./src/index.ts`],\n              esbuildOptions(options, context) {\n                const { format } = context;\n                options.minify = format === \"iife\" && !isDebugBuild;\n                if (format === \"iife\") {\n                  options.define = {\n                    ...options.define,\n                    __DEV__: `${isDebugBuild}`,\n                  };\n                  options.target = BROWSERSLIST_TARGETS;\n                } else {\n                  options.define = {\n                    ...options.define,\n                    // Preserve `process.env.NODE_ENV` in the output without\n                    // replacing it. This allows consumers' bundlers to replace it\n                    // as they see fit.\n                    \"process.env.NODE_ENV\": \"process.env.NODE_ENV\",\n                  };\n                }\n              },\n              esbuildPlugins: [DevFlagPlugin],\n              format,\n              globalName: \"globalThis.gill\",\n              name: platform,\n              outExtension({ format }) {\n                let extension;\n                if (format === \"iife\") {\n                  extension = `.${isDebugBuild ? \"development\" : \"production.min\"}.js`;\n                } else {\n                  extension = `.${platform}.${format === \"cjs\" ? \"cjs\" : \"mjs\"}`;\n                }\n                return {\n                  js: extension,\n                };\n              },\n              platform: platform === \"node\" ? \"node\" : \"browser\",\n              pure: [\"process\"],\n              sourcemap: format !== \"iife\" || isDebugBuild,\n              treeshake: true,\n            },\n      ),\n    )\n    .filter(Boolean) as Options[];\n}\n"
  },
  {
    "path": "packages/build-scripts/package.json",
    "content": "{\n  \"name\": \"@gillsdk/build-scripts\",\n  \"version\": \"0.0.1\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"files\": [\n    \"register-node-globals.mjs\",\n    \"tsup.config.library.ts\",\n    \"tsup.config.package.ts\"\n  ],\n  \"devDependencies\": {\n    \"@types/jscodeshift\": \"^0.12.0\",\n    \"browserslist-to-esbuild\": \"^2.1.1\",\n    \"jscodeshift\": \"^17.1.1\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/build-scripts/register-node-globals.cjs",
    "content": "globalThis.__DEV__ = false;\nglobalThis.__BROWSER = false;\nglobalThis.__NODEJS__ = true;\nglobalThis.__REACTNATIVE__ = false;\n"
  },
  {
    "path": "packages/build-scripts/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"compilerOptions\": {\n    \"types\": [\"node\"]\n  },\n  \"display\": \"Build Scripts\",\n  \"extends\": \"../tsconfig/base.json\"\n}\n"
  },
  {
    "path": "packages/build-scripts/tsup.config.browser.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\n\nexport default defineConfig((options) => [...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options)]);\n"
  },
  {
    "path": "packages/build-scripts/tsup.config.library.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\nimport packageConfigOrConfigsOrPromiseGetterForSame from \"./tsup.config.package\";\n\nexport default defineConfig(async (options) => {\n  const packageConfigOptionOrOptions =\n    typeof packageConfigOrConfigsOrPromiseGetterForSame === \"function\"\n      ? await packageConfigOrConfigsOrPromiseGetterForSame(options)\n      : packageConfigOrConfigsOrPromiseGetterForSame;\n  const packageConfigOptions = Array.isArray(packageConfigOptionOrOptions)\n    ? packageConfigOptionOrOptions\n    : [packageConfigOptionOrOptions];\n  return [...packageConfigOptions, ...getBaseConfig(\"browser\", [\"iife\"], options)];\n});\n"
  },
  {
    "path": "packages/build-scripts/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"./getBaseConfig\";\n\nexport default defineConfig((options) => [\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"native\", [\"esm\"], options),\n]);\n"
  },
  {
    "path": "packages/config-eslint/base.mjs",
    "content": "import solanaConfig from '@solana/eslint-config-solana';\nimport solanaJestConfig from '@solana/eslint-config-solana/jest';\n\nexport default [\n    ...solanaConfig,\n    ...solanaJestConfig,\n    {\n        languageOptions: {\n            parserOptions: {\n                projectService: true,\n            },\n        },\n        rules: {\n            '@typescript-eslint/no-base-to-string': 'off',\n            '@typescript-eslint/no-unsafe-argument': 'off',\n            '@typescript-eslint/no-unsafe-assignment': 'off',\n            '@typescript-eslint/no-unsafe-call': 'off',\n            '@typescript-eslint/no-unsafe-enum-comparison': 'off',\n            '@typescript-eslint/no-unsafe-member-access': 'off',\n            '@typescript-eslint/no-unsafe-return': 'off',\n            '@typescript-eslint/only-throw-error': 'off',\n            '@typescript-eslint/prefer-promise-reject-errors': 'off',\n            '@typescript-eslint/restrict-plus-operands': 'off',\n            '@typescript-eslint/restrict-template-expressions': 'off',\n            '@typescript-eslint/unbound-method': 'off',\n            'jest/expect-expect': [\n                'error',\n                {\n                    assertFunctionNames: ['expect', 'expectNewPreOffset', 'expectNewPostOffset'],\n                },\n            ],\n        },\n    },\n];\n"
  },
  {
    "path": "packages/config-eslint/package.json",
    "content": "{\n  \"name\": \"@gillsdk/config-eslint\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"exports\": {\n    \"./base\": \"./base.mjs\"\n  },\n  \"devDependencies\": {\n    \"@solana/eslint-config-solana\": \"^4.0.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^8.16.0\",\n    \"@typescript-eslint/parser\": \"^8.16.0\",\n    \"eslint\": \"^9.15.0\",\n    \"eslint-plugin-jest\": \"^28.9.0\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/gill/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "packages/gill/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/gill/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/gill/CHANGELOG.md",
    "content": "# gill\n\n## 0.14.0\n\n### Minor Changes\n\n- [#334](https://github.com/gillsdk/gill/pull/334)\n  [`e345aa9`](https://github.com/gillsdk/gill/commit/e345aa9977513ce9f8635543bad3d5ed392365d5) Thanks\n  [@beeman](https://github.com/beeman)! - move @gillsdk/config-eslint to devDependencies\n\n- [#335](https://github.com/gillsdk/gill/pull/335)\n  [`0ea4c93`](https://github.com/gillsdk/gill/commit/0ea4c93d0f2a812b2fcceb2b467f8c9bb8b3afb8) Thanks\n  [@beeman](https://github.com/beeman)! - update @solana-program dependencies\n\n## 0.13.0\n\n### Minor Changes\n\n- [#328](https://github.com/gillsdk/gill/pull/328)\n  [`157dc22`](https://github.com/gillsdk/gill/commit/157dc221655d5fa56fc035d9fbaad58caa48af19) Thanks\n  [@datasalaryman](https://github.com/datasalaryman)! - update solana kit to v5\n\n## 0.12.0\n\n### Minor Changes\n\n- [#219](https://github.com/gillsdk/gill/pull/219)\n  [`55e5628`](https://github.com/gillsdk/gill/commit/55e562846a0865c0c9773f638e5a48b35e89ed5b) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add optional decimal places to `lamportsToSol` - from @GuiBibeau via\n  https://github.com/gillsdk/gill/pull/208\n\n- [#193](https://github.com/gillsdk/gill/pull/193)\n  [`2efea9f`](https://github.com/gillsdk/gill/commit/2efea9fde46aca6c030c6bcc07ae2aee4f359ea8) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add `fetchTokenAccounts` function\n\n- [#267](https://github.com/gillsdk/gill/pull/267)\n  [`459e9a7`](https://github.com/gillsdk/gill/commit/459e9a778b1316374c7028144dd41cde0c5c2455) Thanks\n  [@tobeycodes](https://github.com/tobeycodes)! - fix: update solana client race condition\n\n- [#301](https://github.com/gillsdk/gill/pull/301)\n  [`54e2e96`](https://github.com/gillsdk/gill/commit/54e2e96f87192d36080ececfba0cc3b64c608485) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added \"base64 bytes to X\" functions\n\n- [#246](https://github.com/gillsdk/gill/pull/246)\n  [`8a50e71`](https://github.com/gillsdk/gill/commit/8a50e7151da1b1f270850b25127ac0a671fe6aa5) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `verifySignatureForAddress` function\n\n### Patch Changes\n\n- [#222](https://github.com/gillsdk/gill/pull/222)\n  [`8849226`](https://github.com/gillsdk/gill/commit/8849226d153f9a2660796b829ad44b5e37bae1a0) Thanks\n  [@macalinao](https://github.com/macalinao)! - Adds getSignatureFromBytes helper function\n\n- [#264](https://github.com/gillsdk/gill/pull/264)\n  [`9c22897`](https://github.com/gillsdk/gill/commit/9c228971124c7e711cbbad15b7298fca5dec4c62) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - updated token program imports from \"gill/programs/token\" to\n  \"gill/programs\"\n\n- [#257](https://github.com/gillsdk/gill/pull/257)\n  [`b94c6f4`](https://github.com/gillsdk/gill/commit/b94c6f4cf0f83bfea550b19580d930fbde908911) Thanks\n  [@zsh28](https://github.com/zsh28)! - Solves: Users no longer need to specify a transaction version; transactions are\n  validated automatically.\n\n- [#213](https://github.com/gillsdk/gill/pull/213)\n  [`ee23f2a`](https://github.com/gillsdk/gill/commit/ee23f2a3fbabd31c3ca040e7def970aa552afdf9) Thanks\n  [@Kym0211](https://github.com/Kym0211)! - update kit imports to not use deprecated \"I\" symbols\n\n## 0.11.0\n\n### Minor Changes\n\n- [#197](https://github.com/gillsdk/gill/pull/197)\n  [`7f77aa4`](https://github.com/gillsdk/gill/commit/7f77aa47385680bfb331e36f4f2a8d6a0c8aa250) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - allow transactions without a latest blockhash and auto fetch them when\n  not provided in `sendAndConfirmTransactionWithSignersFactory`\n\n### Patch Changes\n\n- [#196](https://github.com/gillsdk/gill/pull/196)\n  [`a828da0`](https://github.com/gillsdk/gill/commit/a828da0b2e4e87436d254062d339167fed3db8ab) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - make `version` optional (default of `legacy`) in `createTransaction`\n\n## 0.10.3\n\n### Patch Changes\n\n- [#178](https://github.com/gillsdk/gill/pull/178)\n  [`0473034`](https://github.com/gillsdk/gill/commit/0473034aaac424195b120e939d6501bfd6a24a9d) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add rust client support for the `createCodamaConfig` function\n\n- [#191](https://github.com/gillsdk/gill/pull/191)\n  [`37b88f1`](https://github.com/gillsdk/gill/commit/37b88f1a3951db73e46d0969e2c0a2d400ba0579) Thanks\n  [@gitteri](https://github.com/gitteri)! - updated `@solana/kit` and `@solana-program/token-2022`\n\n- [#179](https://github.com/gillsdk/gill/pull/179)\n  [`b9e1027`](https://github.com/gillsdk/gill/commit/b9e102793b30b0bf8a5c8e512ecc20f04a1e6ddc) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - update repo location\n\n- [#164](https://github.com/gillsdk/gill/pull/164)\n  [`e1c47e9`](https://github.com/gillsdk/gill/commit/e1c47e9a84340bed35d5b33298c600a3b23628ff) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added typedoc comment to createCodamaConfig\n\n## 0.10.2\n\n### Patch Changes\n\n- [#153](https://github.com/gillsdk/gill/pull/153)\n  [`29b0b02`](https://github.com/gillsdk/gill/commit/29b0b0260b03ad2434a2e838204d248061e0fdfa) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactor program client exports to be explicit\n\n- [#161](https://github.com/gillsdk/gill/pull/161)\n  [`81c6bed`](https://github.com/gillsdk/gill/commit/81c6beddc314a98b75180e5241c7808da16c4f42) Thanks\n  [@beeman](https://github.com/beeman)! - add create-codama-config function\n\n## 0.10.1\n\n### Patch Changes\n\n- [#149](https://github.com/gillsdk/gill/pull/149)\n  [`c3f7b64`](https://github.com/gillsdk/gill/commit/c3f7b64ce7e2c2ed045ede39885e36c054fa1403) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - manually fix gill version to deprecate the broken gill@0.10.0 version\n  see https://github.com/gillsdk/gill/pull/140\n\n- [#145](https://github.com/gillsdk/gill/pull/145)\n  [`2571cec`](https://github.com/gillsdk/gill/commit/2571ceca9efab70fbe8b7e451a3be35db106dfd6) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - rename token metadata mint args and fixed type reexports\n\n## 0.9.2\n\n### Patch Changes\n\n- [#143](https://github.com/gillsdk/gill/pull/143)\n  [`0be650e`](https://github.com/gillsdk/gill/commit/0be650e92c1f8de1011e6fdbde0a66aaf07cc120) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactor system program reexports\n\n## 0.9.1\n\n### Patch Changes\n\n- [#140](https://github.com/gillsdk/gill/pull/140)\n  [`537c26d`](https://github.com/gillsdk/gill/commit/537c26daa62519f9061891103862e902e1605a25) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - bump @solana/kit and @solana-program/\\*\n\n- [#142](https://github.com/gillsdk/gill/pull/142)\n  [`ebbc4d6`](https://github.com/gillsdk/gill/commit/ebbc4d6f5b8e616d600fd3542226a201a5d5df40) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - manually add to declarations\n\n## 0.9.0\n\n### Minor Changes\n\n- [#119](https://github.com/gillsdk/gill/pull/119)\n  [`4bac16e`](https://github.com/gillsdk/gill/commit/4bac16ef9d11a11ca59bf2ffa99d23ad77e8bd21) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added token ui amount helpers for converting token's `amount` based on\n  the mint's `decimals`\n\n- [#106](https://github.com/gillsdk/gill/pull/106)\n  [`3f456f2`](https://github.com/gillsdk/gill/commit/3f456f297f4a656edc6d47c2bbcaf3350fb0cdf9) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added the `getOldestSignatureForAddress` function\n\n- [#115](https://github.com/gillsdk/gill/pull/115)\n  [`7dedc33`](https://github.com/gillsdk/gill/commit/7dedc33397a0346a8a56344d77a719e7238ef930) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added typed Node ENV variable name support for the keypair loader\n  functions\n\n- [#120](https://github.com/gillsdk/gill/pull/120)\n  [`7e51f34`](https://github.com/gillsdk/gill/commit/7e51f34002e5ac5e54bf54f2a86d4c8a0149392d) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `insertReferenceKeysToTransactionMessage` and\n  `insertReferenceKeyToTransactionMessage` functions to insert reference keys into transactions\n\n### Patch Changes\n\n- [#114](https://github.com/gillsdk/gill/pull/114)\n  [`90f7a8e`](https://github.com/gillsdk/gill/commit/90f7a8eeb9fbce3b4dd815912438075e3c6852ac) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix (and test for) creating tokens using custom `decimals` input\n\n  note: the fix was added in [PR #113](https://github.com/gillsdk/gill/pull/113) by\n  [@0xIchigo](https://github.com/0xIchigo)\n\n## 0.8.3\n\n### Patch Changes\n\n- [#101](https://github.com/gillsdk/gill/pull/101)\n  [`6f547ff`](https://github.com/gillsdk/gill/commit/6f547fff0731bd7530b1266f8a5c15eac2e80d32) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fixed token builders to accept address or signer as fee payer\n\n- [#104](https://github.com/gillsdk/gill/pull/104)\n  [`56a7af8`](https://github.com/gillsdk/gill/commit/56a7af87878b914275f5189d99ea7c2674f45c0c) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - removed the ts-ignore on create token as it is no longer needed\n\n- [#89](https://github.com/gillsdk/gill/pull/89)\n  [`1314cda`](https://github.com/gillsdk/gill/commit/1314cda705d9734d4cdf1a42c985f25ae3737a92) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - clarify the readme and examples on getting the signature from a singed\n  transaction\n\n## 0.8.2\n\n### Patch Changes\n\n- [#84](https://github.com/gillsdk/gill/pull/84)\n  [`93b875a`](https://github.com/gillsdk/gill/commit/93b875a088a4830ef39e8084d3d5e6038c8a96cc) Thanks\n  [@hwsimmons17](https://github.com/hwsimmons17)! - Fix bug with converting https -> wss\n\n## 0.8.1\n\n### Patch Changes\n\n- [#83](https://github.com/gillsdk/gill/pull/83)\n  [`b99ac65`](https://github.com/gillsdk/gill/commit/b99ac65a6de6d379e5f0f65b80c1f2a1a492d061) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fixed ts config module resolution\n\n## 0.8.0\n\n### Minor Changes\n\n- [#75](https://github.com/gillsdk/gill/pull/75)\n  [`2cb27d5`](https://github.com/gillsdk/gill/commit/2cb27d5b2450002038bf6501015c259eb4c43ee6) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added multiple \"keypair from base58\" functions\n\n### Patch Changes\n\n- [#74](https://github.com/gillsdk/gill/pull/74)\n  [`6415cd7`](https://github.com/gillsdk/gill/commit/6415cd774ea333135756863a227613d8d075fa8a) Thanks\n  [@jim4067](https://github.com/jim4067)! - fix broken link in tsdoc comment\n\n- [#72](https://github.com/gillsdk/gill/pull/72)\n  [`6b24c98`](https://github.com/gillsdk/gill/commit/6b24c982a7cd00b71be82ef65753d0cce074b868) Thanks\n  [@mcintyre94](https://github.com/mcintyre94)! - Refactor `lamportsPerSol` to use scientific format\n\n## 0.7.0\n\n### Minor Changes\n\n- [#64](https://github.com/gillsdk/gill/pull/64)\n  [`523c2a2`](https://github.com/gillsdk/gill/commit/523c2a2995a00ee995d2f227a406ba5ca393c63f) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add a parser for token program monikers\n\n- [#68](https://github.com/gillsdk/gill/pull/68)\n  [`a320da8`](https://github.com/gillsdk/gill/commit/a320da828dc0a36dd2eb020fd88a15117b5f9d65) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - consume kit instead of manually reexporting\n\n### Patch Changes\n\n- [#66](https://github.com/gillsdk/gill/pull/66)\n  [`8819f14`](https://github.com/gillsdk/gill/commit/8819f149cb41d4d47e51c9daa9f11fa39da2e7a0) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - accept 'localhost' in the public endpoint getter\n\n- [#70](https://github.com/gillsdk/gill/pull/70)\n  [`134027c`](https://github.com/gillsdk/gill/commit/134027c391fea4b2881e15e93fdc0b64a9804da3) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added more token metadata helpers for parsing metadata accounts\n\n- [#69](https://github.com/gillsdk/gill/pull/69)\n  [`bc03847`](https://github.com/gillsdk/gill/commit/bc03847092b4f2ada01ab16cf5a03b4d3bb575e6) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - remove the submodule imports and use kit when possible\n\n- [#71](https://github.com/gillsdk/gill/pull/71)\n  [`b046783`](https://github.com/gillsdk/gill/commit/b0467839e9366f6a6f2b0787d082933d413bfb4c) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add tsdoc comments to the debug globals\n\n## 0.6.0\n\n### Minor Changes\n\n- [#60](https://github.com/gillsdk/gill/pull/60)\n  [`2b1f604`](https://github.com/gillsdk/gill/commit/2b1f604ff0b538cfa81138e1f25f8cd48c908fad) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - export the `fetchLookupTables` function\n\n- [#63](https://github.com/gillsdk/gill/pull/63)\n  [`bf67203`](https://github.com/gillsdk/gill/commit/bf6720391dc62056d734f7e1d46ac19484d2b2e7) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `simulateTransaction` and factory\n\n- [#62](https://github.com/gillsdk/gill/pull/62)\n  [`c8205fb`](https://github.com/gillsdk/gill/commit/c8205fb80950aa3d61f7a573b5e59e3c7a087002) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - replace web3js v2 with kit\n\n## 0.5.0\n\n### Minor Changes\n\n- [#54](https://github.com/gillsdk/gill/pull/54)\n  [`8139481`](https://github.com/gillsdk/gill/commit/813948162c84e7ddad12493ed78f9190182b99bf) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - allow `sendAndConfirmTransaction` to also handle signing\n\n- [#52](https://github.com/gillsdk/gill/pull/52)\n  [`9e01463`](https://github.com/gillsdk/gill/commit/9e01463d7d38ca9b073fbb96472093dd6ccf379c) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `lamportsToSol` function\n\n- [#56](https://github.com/gillsdk/gill/pull/56)\n  [`3439498`](https://github.com/gillsdk/gill/commit/343949824950f700e572ada151b4dc07fd68d229) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `transactionFromBase64` function\n\n### Patch Changes\n\n- [#58](https://github.com/gillsdk/gill/pull/58)\n  [`7c997f7`](https://github.com/gillsdk/gill/commit/7c997f7cde676beeeb89200fe389c79dba708082) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactored client type names\n\n- [#53](https://github.com/gillsdk/gill/pull/53)\n  [`452359c`](https://github.com/gillsdk/gill/commit/452359c08c5fd089fb1f1e7959e70fb34e148697) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - declare imports as type\n\n- [#50](https://github.com/gillsdk/gill/pull/50)\n  [`5dd8366`](https://github.com/gillsdk/gill/commit/5dd8366084727541394d90e5044e030fdcfc246c) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add `localhost` support to explorer urls\n\n- [#55](https://github.com/gillsdk/gill/pull/55)\n  [`7e1ce79`](https://github.com/gillsdk/gill/commit/7e1ce79e05793c0b0422de05d1b7505e6fdca864) Thanks\n  [@metasal1](https://github.com/metasal1)! - remove duplicate entry from changelog\n\n- [#59](https://github.com/gillsdk/gill/pull/59)\n  [`585bdc7`](https://github.com/gillsdk/gill/commit/585bdc788d8291d6712e4df704f97c50034b484f) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - forced resolutions for web3js and kit\n\n## 0.4.0\n\n### Minor Changes\n\n- [#40](https://github.com/gillsdk/gill/pull/40)\n  [`9ae5ee8`](https://github.com/gillsdk/gill/commit/9ae5ee8c3549c15df5c71a072bd9686b55afeb1a) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added transfer token transaction/instruction builders\n\n- [#43](https://github.com/gillsdk/gill/pull/43)\n  [`b9491e4`](https://github.com/gillsdk/gill/commit/b9491e43ed0841c08b6de0d37a3e06df8161ce46) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added transactionToBase64WithSigners to sign and base64 encode\n\n- [#44](https://github.com/gillsdk/gill/pull/44)\n  [`e18fc1b`](https://github.com/gillsdk/gill/commit/e18fc1bf78b68eff089f61e93444f222f5374b90) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added functions for generating extractable keypairs, saving keypairs\n  to files, and loading/saving keypairs to env variables\n\n### Patch Changes\n\n- [#42](https://github.com/gillsdk/gill/pull/42)\n  [`7a220bc`](https://github.com/gillsdk/gill/commit/7a220bc67c6987e30105f3bdab24ff86ee6328ee) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix createSolanaClient to accept port numbers and set the localnet\n  port\n\n- [#49](https://github.com/gillsdk/gill/pull/49)\n  [`64d138a`](https://github.com/gillsdk/gill/commit/64d138a03e3c09b340c54273455b44ae582ff0c6) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - vendor in spl memo\n\n- [#48](https://github.com/gillsdk/gill/pull/48)\n  [`18a8eec`](https://github.com/gillsdk/gill/commit/18a8eecba39d4c133e90c90905a5bb87f4eb7ba9) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix create token instructions to correctly handle desired token\n  program\n\n## 0.3.0\n\n### Minor Changes\n\n- [#30](https://github.com/gillsdk/gill/pull/30)\n  [`446a9d1`](https://github.com/gillsdk/gill/commit/446a9d1a4ce1a74ce7e9d25865166bc1c08699a5) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added create token helpers\n\n- [#34](https://github.com/gillsdk/gill/pull/34)\n  [`dc635bb`](https://github.com/gillsdk/gill/commit/dc635bb83a930ff12aea22ab2b81a2c5fd1476e7) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - removed token client but keep the program address\n\n- [#27](https://github.com/gillsdk/gill/pull/27)\n  [`93674ab`](https://github.com/gillsdk/gill/commit/93674ab32c9b25baccf7293775e84c0253130419) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added genesis hash constant and to moniker function\n\n- [#25](https://github.com/gillsdk/gill/pull/25)\n  [`a7c3ee4`](https://github.com/gillsdk/gill/commit/a7c3ee44dfb4b0a97dcf71ae9f47d82b69da706e) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add the address lookup table program as a reexport\n\n- [#29](https://github.com/gillsdk/gill/pull/29)\n  [`94c1210`](https://github.com/gillsdk/gill/commit/94c12107ca22d07c1ffb59879c81a0027ebf10de) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added client for Metaplex's Token Metadata program\n\n- [#33](https://github.com/gillsdk/gill/pull/33)\n  [`be3110d`](https://github.com/gillsdk/gill/commit/be3110d21652f3d31e238a55962a872f65f63faf) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added mint token functions\n\n### Patch Changes\n\n- [#35](https://github.com/gillsdk/gill/pull/35)\n  [`a1e342a`](https://github.com/gillsdk/gill/commit/a1e342adfcd556ea6d51b8e345a19317a217d775) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactor common type and use `feePayer` vs `payer` for consistency\n\n- [#28](https://github.com/gillsdk/gill/pull/28)\n  [`e28620c`](https://github.com/gillsdk/gill/commit/e28620c075206c0df29e29406c3eaec2eb4008d2) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - allow `getExplorerLink` to return the base transaction url for each\n  cluster\n\n- [#37](https://github.com/gillsdk/gill/pull/37)\n  [`c489242`](https://github.com/gillsdk/gill/commit/c489242ac71327fb70b08a83590a43e90daf5558) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - document transaction builders in the readme\n\n- [#32](https://github.com/gillsdk/gill/pull/32)\n  [`7bf0137`](https://github.com/gillsdk/gill/commit/7bf0137159e503c42241bc1ce7d25b30a240f726) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix prepareTransaction to correct return type to always have a\n  blockhash\n\n## 0.2.0\n\n### Minor Changes\n\n- [#21](https://github.com/gillsdk/gill/pull/21)\n  [`cdefdcd`](https://github.com/gillsdk/gill/commit/cdefdcd112b28a207b08b38aed810772a993bc4c) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added the `debug` logger to facilitate common debug patterns\n\n- [#20](https://github.com/gillsdk/gill/pull/20)\n  [`ee28853`](https://github.com/gillsdk/gill/commit/ee288539b631b7e215421a217abc7156263b03fd) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `transactionToBase64` function\n\n- [#17](https://github.com/gillsdk/gill/pull/17)\n  [`f59381b`](https://github.com/gillsdk/gill/commit/f59381b0b87e7670fd7e6debbd7827c0b98e73bd) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - re-export token and token22\n\n- [#22](https://github.com/gillsdk/gill/pull/22)\n  [`3495a3c`](https://github.com/gillsdk/gill/commit/3495a3cf70a6ae7933616059d54f40501712b931) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `sendAndConfirmTransaction` to the client creator\n\n- [#23](https://github.com/gillsdk/gill/pull/23)\n  [`f0044ad`](https://github.com/gillsdk/gill/commit/f0044aded5b1d5b86194361c0f5865f4d6475ffd) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - easily add compute budget instructions when creating a transaction\n\n### Patch Changes\n\n- [#18](https://github.com/gillsdk/gill/pull/18)\n  [`4b139da`](https://github.com/gillsdk/gill/commit/4b139dab06a274777e15ff47c92fec001c2f6e93) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - getExplorerUrl to return a string and accepted a signed transaction\n\n- [#13](https://github.com/gillsdk/gill/pull/13)\n  [`1727586`](https://github.com/gillsdk/gill/commit/17275861d0bbbfd1daf74a31e7445373c9612117) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fixed types for the solana client and added tests\n\n- [#16](https://github.com/gillsdk/gill/pull/16)\n  [`33e8974`](https://github.com/gillsdk/gill/commit/33e8974d0dc1ad5f877827a7964a61d02737048f) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fixed types for createTransaction\n\n- [#19](https://github.com/gillsdk/gill/pull/19)\n  [`81cbff6`](https://github.com/gillsdk/gill/commit/81cbff68a44e569141ad844cb4e661b57da2b8c7) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactor getExplorerLink to not accept a signed transaction\n\n## 0.1.0\n\n### Minor Changes\n\n- [#10](https://github.com/gillsdk/gill/pull/10)\n  [`0c03cb8`](https://github.com/gillsdk/gill/commit/0c03cb8ce794a2a79d2eee7a56d98caa3007fc8a) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added a `getMinimumBalanceForRentExemption` function that does not\n  make an rpc call\n\n### Patch Changes\n\n- [#7](https://github.com/gillsdk/gill/pull/7)\n  [`d3e7220`](https://github.com/gillsdk/gill/commit/d3e7220c8f7d23cc2bc1e583887ef45ef621134e) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - make the `latestBlockhash` in `createTransaction` optional\n\n- [#8](https://github.com/gillsdk/gill/pull/8)\n  [`5de7acb`](https://github.com/gillsdk/gill/commit/5de7acbc7500fe76d2592b1f989f156f477e85f5) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added readme\n\n- [`acf3df9`](https://github.com/gillsdk/gill/commit/acf3df98c49cbc82af2a4655a9979f1bc4471c9e) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added tests for createTransaction\n\n## 0.0.4\n\n### Patch Changes\n\n- [`6ae676f`](https://github.com/gillsdk/gill/commit/6ae676f0f06c0ab07af8b2d03fd2e0f3fb051916) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix rpc functions\n\n- [#6](https://github.com/gillsdk/gill/pull/6)\n  [`1438ba7`](https://github.com/gillsdk/gill/commit/1438ba7fbf1a572d7c8c7936b70ba85e775d2cf0) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added the `createTransaction` function\n"
  },
  {
    "path": "packages/gill/README.md",
    "content": "<h1 align=\"center\">\n  gill\n</h1>\n\n<p align=\"center\">\n  javascript/typescript client library for interacting with the Solana blockchain\n</p>\n\n<p align=\"center\">\n  <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>\n  <a href=\"https://www.npmjs.com/package/gill\"><img src=\"https://img.shields.io/npm/v/gill?logo=npm&color=377CC0\" /></a>\n  <a href=\"https://www.npmjs.com/package/gill\"><img src=\"https://img.shields.io/npm/dm/gill?color=377CC0\" /></a>\n</p>\n\n<p align=\"center\">\n  <img width=\"600\" alt=\"gill\" src=\"https://raw.githubusercontent.com/gillsdk/gill/refs/heads/master/docs/public/cover.png\" />\n</p>\n\n## Overview\n\nWelcome to `gill`, a JavaScript/TypeScript client library for interacting with the [Solana](http://solana.com/)\nblockchain. You can use it to build Solana apps in Node, web, React Native, or just about any other JavaScript\nenvironment.\n\nGill is built on top of the modern javascript libraries for Solana built by Anza called\n[@solana/kit](https://github.com/anza-xyz/kit) (formerly known as \"web3.js v2\"). By utilizing the same types and\nfunctions under the hood, `gill` is compatible with `kit`. See [Replacing Kit with gill](#replace-kit-with-gill).\n\n> For a comparison of using gill vs `@solana/kit`, take a look at the\n> [gill vs @solana/kit comparison docs](https://gillsdk.com/docs/compare/kit) and the\n> [comparison examples](https://github.com/gillsdk/gill/tree/master/examples/get-started#comparison-of-gill-vs-solanakit-aka-web3js-v2).\n\n## Documentation\n\nYou can find the gill library docs here:\n\n- [gill docs site](https://gillsdk.com)\n- [gill setup guide](https://gillsdk.com/docs#quick-start)\n- [gill API references](https://gillsdk.com/api)\n\n## Installation\n\nInstall `gill` with your package manager of choice:\n\n```shell\nnpm install gill\n```\n\n```shell\npnpm add gill\n```\n\n```shell\nyarn add gill\n```\n\n### Replace Kit with gill\n\nAll imports from the `@solana/kit` library can be directly replaces with `gill` to achieve the exact same functionality.\nPlus unlock the additional functionality only included in Gill, like `createSolanaTransaction`.\n\nSimply [install gill](#installation) and replace your imports\n\n## Quick start\n\n> Find a collection of example code snippets using `gill` inside the\n> [`/examples` directory](https://github.com/gillsdk/gill/tree/master/examples), including\n> [basic operations](https://github.com/gillsdk/gill/tree/master/examples/get-started) and common\n> [token operations](https://github.com/gillsdk/gill/tree/master/examples/tokens).\n\n- [Create a Solana RPC connection](#create-a-solana-rpc-connection)\n- [Making Solana RPC calls](#making-solana-rpc-calls)\n- [Create a transaction](#create-a-transaction)\n- [Signing transactions](#signing-transactions)\n- [Simulating transactions](#simulating-transactions)\n- [Sending and confirming transaction](#sending-and-confirming-transactions)\n- [Get a transaction signature](#get-the-signature-from-a-signed-transaction)\n- [Get a Solana Explorer link](#get-a-solana-explorer-link-for-transactions-accounts-or-blocks)\n- [Calculate minimum rent balance for an account](#calculate-minimum-rent-for-an-account)\n- [Generating keypairs and signers](#generating-keypairs-and-signers)\n- [Generating extractable keypairs and signers](#generating-extractable-keypairs-and-signers)\n\nYou can also find some [NodeJS specific helpers](#node-specific-imports) like:\n\n- [Loading a keypair from a file](#loading-a-keypair-from-a-file)\n- [Saving a keypair to a file](#saving-a-keypair-to-a-file)\n- [Loading a keypair from an environment variable](#loading-a-keypair-from-an-environment-variable)\n- [Saving a keypair to an environment variable file](#saving-a-keypair-to-an-environment-file)\n- [Loading a base58 keypair from an environment variable](#loading-a-base58-keypair-from-an-environment-variable)\n\nYou can find [transaction builders](#transaction-builders) for common tasks, including:\n\n- [Creating a token with metadata](#create-a-token-with-metadata)\n- [Minting tokens to a destination wallet](#mint-tokens-to-a-destination-wallet)\n- [Transfer tokens to a destination wallet](#transfer-tokens-to-a-destination-wallet)\n\nFor troubleshooting and debugging your Solana transactions, see [Debug mode](#debug-mode) below and the gill docs for\n[Debug Mode](https://gillsdk.com/docs/debug-mode).\n\n> You can also consult the documentation for Anza's [JavaScript client](https://github.com/anza-xyz/solana-web3.js)\n> library for more information and helpful resources.\n\n### Generating keypairs and signers\n\nSee also: the docs on\n[Generating a keypair signer](https://gillsdk.com/docs/getting-started/signers#generating-a-keypair-signer).\n\nFor most \"signing\" operations, you will need a `KeyPairSigner` instance, which can be used to sign transactions and\nmessages.\n\nTo generate a random `KeyPairSigner`:\n\n```typescript\nimport { generateKeyPairSigner } from \"gill\";\n\nconst signer: KeyPairSigner = await generateKeyPairSigner();\n```\n\n> Note: These Signers are non-extractable, meaning there is no way to get the secret key material out of the instance.\n> This is a more secure practice and highly recommended to be used over extractable keypairs, unless you REALLY need to\n> be able to save the keypair for some reason.\n\n### Generating extractable keypairs and signers\n\nSee also: the docs on\n[Generating extractable keypairs and signers](https://gillsdk.com/docs/getting-started/signers#generating-extractable-keypairs-and-signers).\n\nExtractable keypairs are less secure and should not be used unless you REALLY need to save the key for some reason.\nSince there are a few useful cases for saving these keypairs, gill contains a separate explicit function to generate\nthese extractable keypairs.\n\nTo generate a random, **extractable** `KeyPairSigner`:\n\n```typescript\nimport { generateExtractableKeyPairSigner } from \"gill\";\n\nconst signer: KeyPairSigner = await generateExtractableKeyPairSigner();\n```\n\n> WARNING: Using **extractable** keypairs are inherently less-secure, since they allow the secret key material to be\n> extracted. Obviously. As such, they should only be used sparingly and ONLY when you have an explicit reason you need\n> extract the key material (like if you are going to save the key to a file).\n\n### Create a Solana RPC connection\n\nSee also: the docs on [how to create a Solana client](https://gillsdk.com/docs/getting-started/client)\n\nCreate a Solana `rpc` and `rpcSubscriptions` client for any RPC URL or standard Solana network moniker (i.e. `devnet`,\n`localnet`, `mainnet` etc).\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"mainnet\",\n});\n```\n\n> Using the Solana moniker will connect to the public RPC endpoints. These are subject to rate limits and should not be\n> used in production applications. Applications should find their own RPC provider and the URL provided from them.\n\nTo create an RPC client for your local test validator:\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"localnet\",\n});\n```\n\nTo create an RPC client for an custom RPC provider or service:\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc, rpcSubscriptions, sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"https://private-solana-rpc-provider.com\",\n});\n```\n\n### Making Solana RPC calls\n\nAfter you have a Solana `rpc` connection, you can make all the [JSON RPC method](https://solana.com/docs/rpc) calls\ndirectly off of it.\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// get slot\nconst slot = await rpc.getSlot().send();\n\n// get the latest blockhash\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n```\n\n> The `rpc` client requires you to call `.send()` on the RPC method in order to actually send the request to your RPC\n> provider and get a response.\n\nYou can also include custom configuration settings on your RPC calls, like using a JavaScript\n[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController), by passing it into `send()`:\n\n```typescript\nimport { createSolanaClient } from \"gill\";\n\nconst { rpc } = createSolanaClient({ urlOrMoniker: \"devnet\" });\n\n// Create a new AbortController.\nconst abortController = new AbortController();\n\n// Abort the request when the user navigates away from the current page.\nfunction onUserNavigateAway() {\n  abortController.abort();\n}\n\n// The request will be aborted if and only if the user navigates away from the page.\nconst slot = await rpc.getSlot().send({ abortSignal: abortController.signal });\n```\n\n### Create a transaction\n\nQuickly create a Solana transaction:\n\n> Note: The `feePayer` can be either an `Address` or `TransactionSigner`.\n\n```typescript\nimport { createTransaction } from \"gill\";\n\nconst transaction = createTransaction({\n  version,\n  feePayer,\n  instructions,\n  // the compute budget values are HIGHLY recommend to be set in order to maximize your transaction landing rate\n  // computeUnitLimit: number,\n  // computeUnitPrice: number,\n});\n```\n\nTo create a transaction while setting the latest blockhash:\n\n```typescript\nimport { createTransaction } from \"gill\";\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst transaction = createTransaction({\n  version,\n  feePayer,\n  instructions,\n  latestBlockhash,\n  // the compute budget values are HIGHLY recommend to be set in order to maximize your transaction landing rate\n  // computeUnitLimit: number,\n  // computeUnitPrice: number,\n});\n```\n\n### Signing transactions\n\nIf your transaction already has the latest blockhash lifetime set via `createTransaction`:\n\n```typescript\nimport { createTransaction, signTransactionMessageWithSigners } from \"gill\";\n\nconst transaction = createTransaction(...);\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\n```\n\nIf your transaction does NOT have the latest blockhash lifetime set via `createTransaction`, you must set the latest\nblockhash lifetime before (or during) the signing operation:\n\n```typescript\nimport {\n  createTransaction,\n  createSolanaClient,\n  signTransactionMessageWithSigners,\n  setTransactionMessageLifetimeUsingBlockhash,\n} from \"gill\";\n\nconst { rpc } = createSolanaClient(...);\nconst transaction = createTransaction(...);\n\nconst { value: latestBlockhash } = await rpc.getLatestBlockhash().send();\n\nconst signedTransaction = await signTransactionMessageWithSigners(\n  setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, transaction),\n);\n```\n\n### Simulating transactions\n\nTo simulate a transaction on the blockchain, you can use the `simulateTransaction()` function initialized from\n`createSolanaClient()`.\n\n```typescript\nimport { ... } from \"gill\";\n\nconst { simulateTransaction } = createSolanaClient({\n  urlOrMoniker: \"mainnet\",\n});\n\nconst transaction = createTransaction(...);\n\nconst simulation = await simulateTransaction(transaction)\n```\n\nThe transaction provided to `simulateTransaction()` can either be signed or not.\n\n### Sending and confirming transactions\n\nTo send and confirm a transaction to the blockchain, you can use the `sendAndConfirmTransaction` function initialized\nfrom `createSolanaClient()`.\n\n```typescript\nimport { ... } from \"gill\";\n\nconst { sendAndConfirmTransaction } = createSolanaClient({\n  urlOrMoniker: \"mainnet\",\n});\n\nconst transaction = createTransaction(...);\n\nconst signedTransaction = await signTransactionMessageWithSigners(transaction);\nconst signature: string = getSignatureFromTransaction(signedTransaction);\n\nconsole.log(getExplorerLink({ transaction: signature }));\n\n// default commitment level of `confirmed`\nawait sendAndConfirmTransaction(signedTransaction)\n```\n\nIf you would like more fine grain control over the configuration of the `sendAndConfirmTransaction` functionality, you\ncan include configuration settings:\n\n```typescript\nawait sendAndConfirmTransaction(signedTransaction, {\n  commitment: \"confirmed\",\n  skipPreflight: true,\n  maxRetries: 10n,\n  ...\n});\n```\n\n### Get the signature from a signed transaction\n\nAfter you have a transaction signed by the `feePayer` (either a partially or fully signed transaction), you can get the\ntransaction signature as follows:\n\n```typescript\nimport { getSignatureFromTransaction } from \"gill\";\n\nconst signature: string = getSignatureFromTransaction(signedTransaction);\nconsole.log(signature);\n// Example output: 4nzNU7YxPtPsVzeg16oaZvLz4jMPtbAzavDfEFmemHNv93iYXKKYAaqBJzFCwEVxiULqTYYrbjPwQnA1d9ZCTELg\n```\n\n> Note: After a transaction has been signed by the fee payer, it will have a transaction signature (aka transaction id).\n> This is due to Solana transaction ids are the first item in the transaction's `signatures` array. Therefore, client\n> applications can potentially know the signature before it is even sent to the network for confirmation.\n\n### Get a Solana Explorer link for transactions, accounts, or blocks\n\nCraft a Solana Explorer link for transactions, accounts, or blocks on any cluster.\n\n> When no `cluster` is provided in the `getExplorerLink` function, it defaults to `mainnet`.\n\n#### Get a Solana Explorer link for a transaction\n\nTo get an explorer link for a transaction's signature (aka transaction id):\n\n```typescript\nimport { getExplorerLink } from \"gill\";\n\nconst link: string = getExplorerLink({\n  transaction: \"4nzNU7YxPtPsVzeg16oaZvLz4jMPtbAzavDfEFmemHNv93iYXKKYAaqBJzFCwEVxiULqTYYrbjPwQnA1d9ZCTELg\",\n});\n```\n\nIf you have a partially or fully signed transaction, you can get the Explorer link before even sending the transaction\nto the network:\n\n```typescript\nimport {\n  getExplorerLink,\n  getSignatureFromTransaction\n  signTransactionMessageWithSigners,\n} from \"gill\";\n\nconst signedTransaction = await signTransactionMessageWithSigners(...);\nconst link: string = getExplorerLink({\n  transaction: getSignatureFromTransaction(signedTransaction),\n});\n```\n\n#### Get a Solana Explorer link for an account\n\nTo get an explorer link for an account on Solana's devnet:\n\n```typescript\nimport { getExplorerLink } from \"gill\";\n\nconst link: string = getExplorerLink({\n  cluster: \"devnet\",\n  account: \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\",\n});\n```\n\nTo get an explorer link for an account on your local test validator:\n\n```typescript\nimport { getExplorerLink } from \"gill\";\n\nconst link: string = getExplorerLink({\n  cluster: \"localnet\",\n  account: \"11111111111111111111111111111111\",\n});\n```\n\n#### Get a Solana Explorer link for a block\n\nTo get an explorer link for a block:\n\n```typescript\nimport { getExplorerLink } from \"gill\";\n\nconst link: string = getExplorerLink({\n  cluster: \"mainnet\",\n  block: \"242233124\",\n});\n```\n\n### Calculate minimum rent for an account\n\nTo calculate the minimum rent balance for an account (aka data storage deposit fee):\n\n```typescript\nimport { getMinimumBalanceForRentExemption } from \"gill\";\n\n// when not `space` argument is provided: defaults to `0`\nconst rent: bigint = getMinimumBalanceForRentExemption();\n// Expected value: 890_880n\n\n// same as\n// getMinimumBalanceForRentExemption(0);\n\n// same as, but this requires a network call\n// const rent = await rpc.getMinimumBalanceForRentExemption(0n).send();\n```\n\n```typescript\nimport { getMinimumBalanceForRentExemption } from \"gill\";\n\nconst rent: bigint = getMinimumBalanceForRentExemption(50 /* 50 bytes */);\n// Expected value: 1_238_880n\n\n// same as, but this requires a network call\n// const rent = await rpc.getMinimumBalanceForRentExemption(50n).send();\n```\n\n> Note: At this time, the minimum rent amount for an account is calculated based on static values in the Solana runtime.\n> While you can use the `getMinimumBalanceForRentExemption` RPC call on your\n> [connection](#create-a-solana-rpc-connection) to fetch this value, it will result in a network call and subject to\n> latency.\n\n## Node specific imports\n\nThe `gill` package has specific imports for use in NodeJS server backends and/or serverless environments which have\naccess to Node specific APIs (like the file system via `node:fs`).\n\n```typescript\nimport { ... } from \"gill/node\"\n```\n\n### Loading a keypair from a file\n\n```typescript\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\n// default file path: ~/.config/solana/id.json\nconst signer = await loadKeypairSignerFromFile();\nconsole.log(\"address:\", signer.address);\n```\n\nLoad a `KeyPairSigner` from a filesystem wallet json file, like those output from the\n[Solana CLI](https://solana.com/docs/intro/installation#install-the-solana-cli) (i.e. a JSON array of numbers).\n\nBy default, the keypair file loaded is the Solana CLI's default keypair: `~/.config/solana/id.json`\n\nTo load a Signer from a specific filepath:\n\n```typescript\nimport { loadKeypairSignerFromFile } from \"gill/node\";\n\nconst signer = await loadKeypairSignerFromFile(\"/path/to/your/keypair.json\");\nconsole.log(\"address:\", signer.address);\n```\n\n### Saving a keypair to a file\n\n> See [`saveKeypairSignerToEnvFile`](#saving-a-keypair-to-an-environment-file) for saving to an env file.\n\nSave an **extractable** `KeyPairSigner` to a local json file (e.g. `keypair.json`).\n\n```typescript\nimport { ... } from \"gill/node\";\nconst extractableSigner = generateExtractableKeyPairSigner();\nawait saveKeypairSignerToFile(extractableSigner, filePath);\n```\n\nSee [`loadKeypairSignerFromFile`](#loading-a-keypair-from-a-file) for how to load keypairs from the local filesystem.\n\n### Loading a keypair from an environment variable\n\nLoad a `KeyPairSigner` from the bytes stored in the environment process (e.g. `process.env[variableName]`)\n\n```typescript\nimport { loadKeypairSignerFromEnvironment } from \"gill/node\";\n\n// loads signer from bytes stored at `process.env[variableName]`\nconst signer = await loadKeypairSignerFromEnvironment(variableName);\nconsole.log(\"address:\", signer.address);\n```\n\n### Saving a keypair to an environment file\n\nSave an **extractable** `KeyPairSigner` to a local environment variable file (e.g. `.env`).\n\n```typescript\nimport { ... } from \"gill/node\";\nconst extractableSigner = generateExtractableKeyPairSigner();\n// default: envPath = `.env` (in your current working directory)\nawait saveKeypairSignerToEnvFile(extractableSigner, variableName, envPath);\n```\n\nSee [`loadKeypairSignerFromEnvironment`](#loading-a-keypair-from-an-environment-variable) for how to load keypairs from\nenvironment variables.\n\n### Loading a base58 keypair from an environment variable\n\nLoad a `KeyPairSigner` from the bytes stored in the environment process (e.g. `process.env[variableName]`)\n\n```typescript\nimport { loadKeypairSignerFromEnvironmentBase58 } from \"gill/node\";\n\n// loads signer from base58 keypair stored at `process.env[variableName]`\nconst signer = await loadKeypairSignerFromEnvironmentBase58(variableName);\nconsole.log(\"address:\", signer.address);\n```\n\n## Transaction builders\n\nTo simplify the creation of common transactions, gill includes various \"transaction builders\" to help easily assemble\nready-to-sign transactions for these tasks, which often interact with multiple programs at once.\n\nSince each transaction builder is scoped to a single task, they can easily abstract away various pieces of boilerplate\nwhile also helping to create an optimized transaction, including:\n\n- sets/recommends a default compute unit limit (easily overridable of course) to optimize the transaction and improve\n  landing rates\n- auto derive required address where needed\n- generally recommend safe defaults and fallback settings\n\nAll of the auto-filled information can also be manually overriden to ensure you always have escape hatches to achieve\nyour desired functionality.\n\nAs these transaction builders may not be for everyone, gill exposes a related \"instruction builder\" function for each\nwhich is used under the hood to craft the respective transactions. Developers can also completely forgo these builder\nabstractions and manually craft the same functionality.\n\n### Create a token with metadata\n\nBuild a transaction that can create a token with metadata, either using the\n[original token](https://github.com/solana-program/token) or\n[token extensions (token22)](https://github.com/solana-program/token-2022) program.\n\n- Tokens created with the original token program (`TOKEN_PROGRAM_ADDRESS`, default) will use Metaplex's Token Metadata\n  program for onchain metadata\n- Tokens created with the token extensions program (`TOKEN_2022_PROGRAM_ADDRESS`) will use the metadata pointer\n  extensions\n\nRelated instruction builder: `getCreateTokenInstructions`\n\n```typescript\nimport { buildCreateTokenTransaction } from \"gill/programs\";\n\nconst createTokenTx = await buildCreateTokenTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  // mintAuthority, // default=same as the `feePayer`\n  metadata: {\n    isMutable: true, // if the `updateAuthority` can change this metadata in the future\n    name: \"Only Possible On Solana\",\n    symbol: \"OPOS\",\n    uri: \"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/Climate/metadata.json\",\n  },\n  // updateAuthority, // default=same as the `feePayer`\n  decimals: 2, // default=9,\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS, token22 also supported\n  // default cu limit set to be optimized, but can be overriden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n```\n\n### Mint tokens to a destination wallet\n\nBuild a transaction that mints new tokens to the `destination` wallet address (raising the token's overall supply).\n\n- ensure you set the correct `tokenProgram` used by the `mint` itself\n- if the `destination` owner does not have an associated token account (ata) created for the `mint`, one will be\n  auto-created for them\n- ensure you take into account the `decimals` for the `mint` when setting the `amount` in this transaction\n\nRelated instruction builder: `getMintTokensInstructions`\n\n```typescript\nimport { buildMintTokensTransaction } from \"gill/programs\";\n\nconst mintTokensTx = await buildMintTokensTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  mintAuthority: signer,\n  amount: 1000, // note: be sure to consider the mint's `decimals` value\n  // if decimals=2 => this will mint 10.00 tokens\n  // if decimals=4 => this will mint 0.100 tokens\n  destination,\n  // use the correct token program for the `mint`\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS\n  // default cu limit set to be optimized, but can be overriden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n```\n\n### Transfer tokens to a destination wallet\n\nBuild a transaction that transfers tokens to the `destination` wallet address from the `source` (aka from `sourceAta` to\n`destinationAta`).\n\n- ensure you set the correct `tokenProgram` used by the `mint` itself\n- if the `destination` owner does not have an associated token account (ata) created for the `mint`, one will be\n  auto-created for them\n- ensure you take into account the `decimals` for the `mint` when setting the `amount` in this transaction\n\nRelated instruction builder: `getTransferTokensInstructions`\n\n```typescript\nimport { buildTransferTokensTransaction } from \"gill/programs\";\n\nconst transferTokensTx = await buildTransferTokensTransaction({\n  feePayer: signer,\n  latestBlockhash,\n  mint,\n  authority: signer,\n  // sourceAta, // default=derived from the `authority`.\n  /**\n   * if the `sourceAta` is not derived from the `authority` (like for multi-sig wallets),\n   * manually derive with `getAssociatedTokenAccountAddress()`\n  */\n  amount: 900, // note: be sure to consider the mint's `decimals` value\n  // if decimals=2 => this will transfer 9.00 tokens\n  // if decimals=4 => this will transfer 0.090 tokens\n  destination: address(...),\n  // use the correct token program for the `mint`\n  tokenProgram, // default=TOKEN_PROGRAM_ADDRESS\n  // default cu limit set to be optimized, but can be overriden here\n  // computeUnitLimit?: number,\n  // obtain from your favorite priority fee api\n  // computeUnitPrice?: number, // no default set\n});\n```\n\n## Debug mode\n\nSee also: the docs for [Debug Mode](https://gillsdk.com/docs/debug-mode)\n\nWithin `gill`, you can enable \"debug mode\" to automatically log additional information that will be helpful in\ntroubleshooting your transactions.\n\nDebug mode is disabled by default to minimize additional logs for your application. But with its flexible debug\ncontroller, you can enable it from the most common places your code will be run. Including your code itself, NodeJS\nbackends, serverless functions, and even the in web browser console itself.\n\nSome examples of the existing debug logs that `gill` has sprinkled in:\n\n- log the Solana Explorer link for transactions as you are sending them\n- log the base64 transaction string to troubleshoot via\n  [`mucho inspect`](https://github.com/solana-developers/mucho?tab=readme-ov-file#inspect) or Solana Explorer's\n  [Transaction Inspector](https://explorer.solana.com/tx/inspector)\n\n### How to enable debug mode\n\nTo enable debug mode, set any of the following to `true` or `1`:\n\n- `process.env.GILL_DEBUG`\n- `global.__GILL_DEBUG__`\n- `window.__GILL_DEBUG__` (i.e. in your web browser's console)\n- or manually set any debug log level (see below)\n\nTo set a desired level of logs to be output in your application, set the value of one of the following (default:\n`info`):\n\n- `process.env.GILL_DEBUG_LEVEL`\n- `global.__GILL_DEBUG_LEVEL__`\n- `window.__GILL_DEBUG_LEVEL__` (i.e. in your web browser's console)\n\nThe log levels supported (in order of priority):\n\n- `debug` (lowest)\n- `info` (default)\n- `warn`\n- `error`\n\n### Custom debug logs\n\nGill also exports the same debug functions it uses internally, allowing you to implement your own debug logic related to\nyour Solana transactions and use the same controller for it as `gill` does.\n\n- `isDebugEnabled()` - check if debug mode is enabled or not\n- `debug()` - print debug message if the set log level is reached\n\n```typescript\nimport { debug, isDebugEnabled } from \"gill\";\n\nif (isDebugEnabled()) {\n  // your custom logic\n}\n\n// log this message if the \"info\" or above log level is enabled\ndebug(\"custom message\");\n\n// log this message if the \"debug\" or above log level is enabled\ndebug(\"custom message\", \"debug\");\n\n// log this message if the \"warn\" or above log level is enabled\ndebug(\"custom message\", \"warn\");\n\n// log this message if the \"warn\" or above log level is enabled\ndebug(\"custom message\", \"warn\");\n```\n\n## Program clients\n\nWith `gill` you can also import some of the most commonly used clients for popular programs. These are also fully\ntree-shakable, so if you do not import them inside your project they will be removed by your JavaScript bundler at build\ntime (i.e. Webpack).\n\nTo import any of these program clients:\n\n```typescript\nimport { ... } from \"gill/programs\";\nimport { ... } from \"gill/programs\";\n```\n\n> Note: Some client re-exported client program clients have a naming collision. As a result, they may be re-exported\n> under a subpath of `gill/programs`. For example, `gill/programs`.\n\nThe program clients included inside `gill` are:\n\n- System program - re-exported from [`@solana-program/system`](https://github.com/solana-program/system)\n- Compute Budget program- re-exported from\n  [`@solana-program/compute-budget`](https://github.com/solana-program/compute-budget)\n- Memo program - re-exported from [`@solana-program/memo`](https://github.com/solana-program/memo)\n- Token Program and Token Extensions program (aka Token22) - re-exported from\n  [`@solana-program/token-2022`](https://github.com/solana-program/token-2022), which is a fully backwards compatible\n  client with the original Token Program\n- Address Lookup Table program - re-exported from\n  [`@solana-program/address-lookup-table`](https://github.com/solana-program/address-lookup-table)\n- Token Metadata program from Metaplex (only the v3 functionality) - generated via Codama their IDL\n  ([source](https://github.com/metaplex-foundation/mpl-token-metadata))\n\nIf one of the existing clients are not being exported from `gill/programs` or a subpath therein, you can of course\nmanually add their compatible client to your repo.\n\n> Note: Since the Token Extensions program client is fully compatible with the original Token Program client, `gill`\n> only ships the `@solana-program/token-2022` client and the `TOKEN_PROGRAM_ADDRESS` in order to remove all that\n> redundant code from the library.\n>\n> To use the original Token Program, simply pass the `TOKEN_PROGRAM_ADDRESS` as the the program address for any\n> instructions\n\n### Other compatible program clients\n\nFrom the [solana-program](https://github.com/solana-program/token) GitHub organization, formerly known as the Solana\nProgram Library (SPL), you can find various other client libraries for specific programs. Install their respective\npackage to use in conjunction with gill:\n\n- [Stake program](https://github.com/solana-program/stake) - `@solana-program/stake`\n- [Vote program](https://github.com/solana-program/vote) - `@solana-program/vote`\n\n### Generate a program client from an IDL\n\nSee also: this official gill docs and guide on\n[how to generate a program client with codama](https://gillsdk.com/docs/guides/codama)\n\nIf you want to easily interact with any custom program with this library, you can use\n[Codama](https://github.com/codama-idl/codama) to generate a compatible JavaScript/TypeScript client using its IDL. You\ncan either store the generated client inside your repo or publish it as a NPM package for others to easily consume.\n"
  },
  {
    "path": "packages/gill/eslint.config.mjs",
    "content": "import config from \"@gillsdk/config-eslint/base\";\n\n/** @type {import(\"eslint\").Linter.Config} */\nexport default config;\n"
  },
  {
    "path": "packages/gill/generate-reexports.ts",
    "content": "#!/usr/bin/env node\nimport fs from \"fs\";\n\ntype ReexportSettings = {\n  package: string;\n  outputFile: string;\n};\n\nconst packages: ReexportSettings[] = [\n  {\n    package: \"@solana-program/system\",\n    outputFile: \"./src/programs/system/reexports.ts\",\n  },\n  {\n    package: \"@solana-program/address-lookup-table\",\n    outputFile: \"./src/programs/address-lookup-table/reexports.ts\",\n  },\n  {\n    package: \"@solana-program/compute-budget\",\n    outputFile: \"./src/programs/compute-budget/reexports.ts\",\n  },\n  {\n    package: \"@solana-program/token-2022\",\n    outputFile: \"./src/programs/token/reexports.ts\",\n  },\n];\n\nasync function generateExports() {\n  for (const pkg of packages) {\n    let exports = \"\";\n    try {\n      // Import the package to get its exports\n      const module = await import(pkg.package);\n      const exportNames = Object.keys(module).filter((key) => key !== \"default\");\n\n      if (exportNames.length > 0) {\n        exports += `// Re-exports from ${pkg.package}\\n`;\n        exports += `export {\\n`;\n        exports += exportNames.map((name) => `  ${name},`).join(\"\\n\");\n        exports += `\\n} from \"${pkg.package}\";\\n\\n`;\n        exports += `export type * from \"${pkg.package}\";\\n`;\n      }\n\n      // Write to output file\n      fs.writeFileSync(pkg.outputFile, exports);\n      console.log(`✓ Generated exports for ${pkg.package}: ${exportNames.length} exports`);\n    } catch (error) {\n      console.error(`✗ Failed to process ${pkg.package}:`, error.message);\n    }\n  }\n}\n\ngenerateExports().catch(console.error);\n"
  },
  {
    "path": "packages/gill/package.json",
    "content": "{\n  \"name\": \"gill\",\n  \"license\": \"MIT\",\n  \"version\": \"0.14.0\",\n  \"description\": \"a modern javascript/typescript client library for interacting with the Solana blockchain\",\n  \"scripts\": {\n    \"clean\": \"rimraf coverage dist build node_modules .turbo .docs\",\n    \"clean:docs\": \"rimraf ../../docs/content/api/gill*\",\n    \"generate-reexports\": \"npx esrun ./generate-reexports.ts\",\n    \"compile:docs-core\": \"typedoc --options typedoc.core.json\",\n    \"compile:docs-node\": \"typedoc --options typedoc.node.json\",\n    \"compile:docs-programs\": \"typedoc --options typedoc.programs.json\",\n    \"compile:docs\": \"pnpm compile:docs-core && pnpm compile:docs-node && pnpm compile:docs-programs && pnpm move:docs\",\n    \"move:docs\": \"pnpm clean:docs && cp -rf ./.docs/* ../../docs/content/api/\",\n    \"prebuild\": \"rimraf dist\",\n    \"compile:js\": \"tsup --config ./tsup.config.package.ts\",\n    \"compile:typedefs\": \"tsc -p ./tsconfig.declarations.json\",\n    \"prepublishOnly\": \"pnpm pkg delete devDependencies\",\n    \"publish-impl\": \"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \\\"$PUBLISH_TAG\\\" != \\\"canary\\\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))\",\n    \"publish-packages\": \"pnpm prepublishOnly && pnpm publish-impl\",\n    \"coverage\": \"pnpm test:unit:node --coverage\",\n    \"coverage:open\": \"export BROWSER=brave && xdg-open ./coverage/lcov-report/index.html > /dev/null\",\n    \"test:typecheck\": \"tsc --noEmit\",\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.node.ts --rootDir . --silent\",\n    \"test:unit:browser\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.browser.ts --rootDir . --silent\",\n    \"test:treeshakability:browser\": \"agadoo dist/index.browser.mjs\",\n    \"test:treeshakability:native\": \"agadoo dist/index.native.mjs\",\n    \"test:treeshakability:node\": \"agadoo dist/index.node.mjs && agadoo dist/node/index.node.mjs\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\",\n    \"lint\": \"eslint src\",\n    \"lint:fix\": \"eslint --fix src\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"./edge-light\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"./workerd\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"./browser\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.browser.mjs\",\n      \"require\": \"./dist/index.browser.cjs\"\n    },\n    \"./react-native\": \"./dist/index.native.mjs\",\n    \"./node\": {\n      \"types\": \"./dist/node/index.d.ts\",\n      \"import\": \"./dist/node/index.node.mjs\",\n      \"require\": \"./dist/node/index.node.cjs\"\n    },\n    \"./programs/token\": {\n      \"types\": \"./dist/programs/token/index.d.ts\",\n      \"import\": \"./dist/programs/token/index.node.mjs\",\n      \"require\": \"./dist/programs/token/index.node.cjs\"\n    },\n    \"./programs\": {\n      \"types\": \"./dist/programs/index.d.ts\",\n      \"import\": \"./dist/programs/index.node.mjs\",\n      \"require\": \"./dist/programs/index.node.cjs\"\n    },\n    \"./types\": \"./dist/index.d.ts\"\n  },\n  \"browser\": {\n    \"./dist/index.node.cjs\": \"./dist/index.browser.cjs\",\n    \"./dist/index.node.mjs\": \"./dist/index.browser.mjs\"\n  },\n  \"main\": \"./dist/index.node.cjs\",\n  \"module\": \"./dist/index.node.mjs\",\n  \"react-native\": \"./dist/index.native.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"type\": \"commonjs\",\n  \"files\": [\n    \"./dist/\"\n  ],\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"blockchain\",\n    \"solana\",\n    \"web3\",\n    \"web3js v2\",\n    \"solana kit\",\n    \"wallet\",\n    \"dapps\",\n    \"solana helpers\",\n    \"@solana/web3.js\",\n    \"@solana/kit\",\n    \"@solana-developers/helpers\",\n    \"treeshake\"\n  ],\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"browserslist\": [\n    \"supports bigint and not dead\",\n    \"maintained node versions\"\n  ],\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  },\n  \"dependencies\": {\n    \"@solana-program/address-lookup-table\": \"^0.10.0\",\n    \"@solana-program/compute-budget\": \"^0.11.0\",\n    \"@solana-program/system\": \"^0.10.0\",\n    \"@solana-program/token-2022\": \"^0.6.1\",\n    \"@solana/assertions\": \"^5.0.0\",\n    \"@solana/codecs\": \"^5.0.0\",\n    \"@solana/kit\": \"^5.0.0\",\n    \"@solana/transaction-confirmation\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"@gillsdk/config-eslint\": \"workspace:*\"\n  },\n  \"peerDependencies\": {\n    \"typescript\": \">=5\"\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/__tests__/accounts.ts",
    "content": "import assert from \"node:assert\";\n\nimport { getMinimumBalanceForRentExemption } from \"../core\";\n\n/**\n * Note: Each of the values checked against were obtained directly from the\n * `getMinimumBalanceForRentExemption` RPC call\n */\n\ndescribe(\"getMinimumBalanceForRentExemption\", () => {\n  test(\"default lamports (no extra space)\", () => {\n    const lamports = getMinimumBalanceForRentExemption();\n    assert.equal(lamports, 890_880n);\n  });\n  test(\"0 bytes (explicitly passed)\", () => {\n    const lamports = getMinimumBalanceForRentExemption(0);\n    assert.equal(lamports, 890_880n);\n  });\n  test(\"1 byte of space (as number)\", () => {\n    const lamports = getMinimumBalanceForRentExemption(1);\n    assert.equal(lamports, 897_840n);\n  });\n  test(\"1 byte of space (as bigint)\", () => {\n    const lamports = getMinimumBalanceForRentExemption(1n);\n    assert.equal(lamports, 897_840n);\n  });\n  test(\"50 bytes of space (as number)\", () => {\n    const lamports = getMinimumBalanceForRentExemption(50);\n    assert.equal(lamports, 1_238_880n);\n  });\n  test(\"50 bytes of space (as bigint)\", () => {\n    const lamports = getMinimumBalanceForRentExemption(50n);\n    assert.equal(lamports, 1_238_880n);\n  });\n  test(\"1k bytes of space\", () => {\n    const lamports = getMinimumBalanceForRentExemption(1_000);\n    assert.equal(lamports, 7_850_880n);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/addresses.ts",
    "content": "import { Address } from \"@solana/kit\";\nimport { TOKEN_2022_PROGRAM_ADDRESS } from \"@solana-program/token-2022\";\nimport {\n  assertIsSupportedTokenProgram,\n  checkedTokenProgramAddress,\n  parseTokenProgramAddressOrMoniker,\n  TOKEN_PROGRAM_ADDRESS,\n} from \"../programs/token\";\n\ndescribe(\"parseTokenProgramAddressOrMoniker\", () => {\n  it(\"should return TOKEN_PROGRAM_ADDRESS for 'legacy' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"legacy\");\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_PROGRAM_ADDRESS for 'token' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"token\");\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_PROGRAM_ADDRESS for direct address\", () => {\n    const result = parseTokenProgramAddressOrMoniker(TOKEN_PROGRAM_ADDRESS);\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_2022_PROGRAM_ADDRESS for 'token22' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"token22\");\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_2022_PROGRAM_ADDRESS for 'token2022' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"token2022\");\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_2022_PROGRAM_ADDRESS for 'tokenExtension' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"tokenExtension\");\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_2022_PROGRAM_ADDRESS for 'tokenExtensions' moniker\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"tokenExtensions\");\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n  });\n\n  it(\"should handle case insensitivity for monikers\", () => {\n    const result = parseTokenProgramAddressOrMoniker(\"TOKEN22\" as any);\n    const result2 = parseTokenProgramAddressOrMoniker(\"tokenextension\" as any);\n    const result3 = parseTokenProgramAddressOrMoniker(\"tokenextensions\" as any);\n    const result4 = parseTokenProgramAddressOrMoniker(\"LEGACY\" as any);\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n    expect(result2).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n    expect(result3).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n    expect(result4).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should throw error for unsupported token program\", () => {\n    expect(() => {\n      parseTokenProgramAddressOrMoniker(\"unsupported\" as any);\n    }).toThrow(\"Unsupported token program\");\n  });\n});\n\ndescribe(\"assertIsSupportedTokenProgram\", () => {\n  it(\"should not throw for TOKEN_PROGRAM_ADDRESS\", () => {\n    expect(() => {\n      assertIsSupportedTokenProgram(TOKEN_PROGRAM_ADDRESS);\n    }).not.toThrow();\n  });\n\n  it(\"should not throw for TOKEN_2022_PROGRAM_ADDRESS\", () => {\n    expect(() => {\n      assertIsSupportedTokenProgram(TOKEN_2022_PROGRAM_ADDRESS);\n    }).not.toThrow();\n  });\n\n  it(\"should throw for unsupported address\", () => {\n    expect(() => {\n      assertIsSupportedTokenProgram(\"unsupported-address\" as Address);\n    }).toThrow(\"Unsupported token program\");\n  });\n});\n\ndescribe(\"checkedTokenProgramAddress\", () => {\n  it(\"should return TOKEN_PROGRAM_ADDRESS when no program is provided\", () => {\n    const result = checkedTokenProgramAddress();\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_PROGRAM_ADDRESS for 'legacy' moniker\", () => {\n    const result = checkedTokenProgramAddress(\"legacy\");\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should return TOKEN_2022_PROGRAM_ADDRESS for 'token22' moniker\", () => {\n    const result = checkedTokenProgramAddress(\"token22\");\n    expect(result).toBe(TOKEN_2022_PROGRAM_ADDRESS);\n  });\n\n  it(\"should pass through valid address\", () => {\n    const result = checkedTokenProgramAddress(TOKEN_PROGRAM_ADDRESS);\n    expect(result).toBe(TOKEN_PROGRAM_ADDRESS);\n  });\n\n  it(\"should throw for unsupported token program\", () => {\n    expect(() => {\n      checkedTokenProgramAddress(\"unsupported\" as any);\n    }).toThrow(\"Unsupported token program\");\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/base64-bytes-to.ts",
    "content": "import { Address, getBase58Encoder, getBase64Decoder, Signature } from \"@solana/kit\";\nimport { base64BytesToAddress, base64BytesToSignature, base64BytesToString } from \"../core/base64-bytes-to\";\n\nconst base64Decoder = getBase64Decoder();\nconst base58Decoder = getBase58Encoder();\n\ndescribe(\"base64BytesToAddress\", () => {\n  const address = \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address;\n  const base64BytesForAddress: string = base64Decoder.decode(base58Decoder.encode(address));\n\n  it(\"should convert valid base64 encoded address bytes to Address\", () => {\n    const result = base64BytesToAddress(base64BytesForAddress);\n    expect(result).toBeDefined();\n    expect(typeof result).toBe(\"string\");\n  });\n\n  it(\"should throw error for invalid base64 string\", () => {\n    expect(() => base64BytesToAddress(\"invalid-base64!!!\")).toThrow();\n  });\n\n  it(\"should throw error for base64 string with incorrect length\", () => {\n    // Base64 of only 16 bytes instead of required 32\n    const shortBase64 = \"AAAAAAAAAAAAAAAAAAAAAA==\";\n    expect(() => base64BytesToAddress(shortBase64)).toThrow();\n  });\n\n  it(\"should throw error for empty string\", () => {\n    expect(() => base64BytesToAddress(\"\")).toThrow();\n  });\n\n  it(\"should throw error for base64 of invalid address format\", () => {\n    // Base64 of 32 bytes but not a valid address format\n    const invalidAddressBase64 = \"/////////////////////////////////////w==\";\n    expect(() => base64BytesToAddress(invalidAddressBase64)).toThrow();\n  });\n});\n\ndescribe(\"base64BytesToSignature\", () => {\n  const singature =\n    \"4SJT9r8g3ea98CsdagyDSf2pMYjUQrxd9y1DeG5fNFqaQ3gH9N7bhqYUKsn4pZCLKgmhtQek5BFGSnfs2ieS9TMp\" as Signature;\n  const base64BytesForSignature: string = base64Decoder.decode(base58Decoder.encode(singature));\n\n  it(\"should convert valid base64 encoded signature bytes to Signature\", () => {\n    const result = base64BytesToSignature(base64BytesForSignature);\n    expect(result).toBeDefined();\n    expect(typeof result).toBe(\"string\");\n  });\n\n  it(\"should throw error on invalid base64 encoded signature bytes to Signature\", () => {\n    // Base64 of 64 bytes with some data, but not a valid Signature\n    const signatureBase64 =\n      \"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgID\";\n    expect(() => base64BytesToSignature(signatureBase64)).toThrow();\n  });\n\n  it(\"should throw error for invalid base64 string\", () => {\n    expect(() => base64BytesToSignature(\"invalid-base64!!!\")).toThrow();\n  });\n\n  it(\"should throw error for base64 string with incorrect length\", () => {\n    // Base64 of only 32 bytes instead of required 64\n    const shortBase64 = \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\";\n    expect(() => base64BytesToSignature(shortBase64)).toThrow();\n  });\n\n  it(\"should throw error for empty string\", () => {\n    expect(() => base64BytesToSignature(\"\")).toThrow();\n  });\n\n  it(\"should throw error for base64 of invalid signature format\", () => {\n    // Base64 of 64 bytes but potentially invalid signature format\n    const invalidSignatureBase64 =\n      \"//////////////////////////////////////////////////////////////////////////////////////////8=\";\n    expect(() => base64BytesToSignature(invalidSignatureBase64)).toThrow();\n  });\n});\n\ndescribe(\"base64BytesToString\", () => {\n  it(\"should convert base64 encoded string bytes to UTF-8 string\", () => {\n    const testString = \"Hello, World!\" as string;\n    const base64BytesForTestString: string = getBase64Decoder().decode(new TextEncoder().encode(testString));\n\n    const result = base64BytesToString(base64BytesForTestString);\n    expect(result).toBe(testString);\n  });\n\n  it(\"should convert base64 encoded empty string\", () => {\n    // Base64 of empty string\n    const emptyBase64 = \"\";\n    const result = base64BytesToString(emptyBase64);\n    expect(result).toBe(\"\");\n  });\n\n  it(\"should convert base64 encoded single character\", () => {\n    // Base64 of \"A\"\n    const singleCharBase64 = \"QQ==\";\n    const result = base64BytesToString(singleCharBase64);\n    expect(result).toBe(\"A\");\n  });\n\n  it(\"should convert base64 encoded Unicode characters\", () => {\n    // Base64 of \"🚀\" (rocket emoji)\n    const unicodeBase64 = \"8J+agA==\";\n    const result = base64BytesToString(unicodeBase64);\n    expect(result).toBe(\"🚀\");\n  });\n\n  it(\"should convert base64 encoded multi-byte UTF-8 characters\", () => {\n    // Base64 of \"Café\"\n    const cafeBase64 = \"Q2Fmw6k=\";\n    const result = base64BytesToString(cafeBase64);\n    expect(result).toBe(\"Café\");\n  });\n\n  it(\"should convert base64 encoded Japanese characters\", () => {\n    // Base64 of \"こんにちは\" (hello in Japanese)\n    const japaneseBase64 = \"44GT44KT44Gr44Gh44Gv\";\n    const result = base64BytesToString(japaneseBase64);\n    expect(result).toBe(\"こんにちは\");\n  });\n\n  it(\"should convert base64 encoded numbers and special characters\", () => {\n    // Base64 of \"123!@#$%^&*()\"\n    const specialCharsBase64 = \"MTIzIUAjJCVeJiooKQ==\";\n    const result = base64BytesToString(specialCharsBase64);\n    expect(result).toBe(\"123!@#$%^&*()\");\n  });\n\n  it(\"should handle base64 encoded newlines and whitespace\", () => {\n    // Base64 of \"Line 1\\nLine 2\\t\\r\"\n    const whitespaceBase64 = \"TGluZSAxCkxpbmUgMgkN\";\n    const result = base64BytesToString(whitespaceBase64);\n    expect(result).toBe(\"Line 1\\nLine 2\\t\\r\");\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/base64-transactions.ts",
    "content": "import { address, blockhash, createKeyPairSignerFromPrivateKeyBytes, type KeyPairSigner } from \"@solana/kit\";\nimport { createTransaction, transactionFromBase64, transactionToBase64, transactionToBase64WithSigners } from \"../core\";\n\n// initialize a sample transaction\nconst tx = createTransaction({\n  version: \"legacy\",\n  feePayer: address(\"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\"),\n  instructions: [],\n  latestBlockhash: {\n    blockhash: blockhash(\"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\"),\n    lastValidBlockHeight: 0n,\n  },\n});\n\n// Corresponds to address `2xRiSnKRWfFwwtkBPewQ6E4QA2SK9kzypVukLh35hiS8`\nconst MOCK_PRIVATE_KEY_BYTES = new Uint8Array([\n  0xeb, 0xfa, 0x65, 0xeb, 0x93, 0xdc, 0x79, 0x15, 0x7a, 0xba, 0xde, 0xa2, 0xf7, 0x94, 0x37, 0x9d, 0xfc, 0x07, 0x1d,\n  0x68, 0x86, 0x87, 0x37, 0x6d, 0xc5, 0xd5, 0xa0, 0x54, 0x12, 0x1d, 0x34, 0x4a,\n]);\n\ndescribe(\"transactionToBase64\", () => {\n  test(\"can base64 encode an unsigned transaction\", () => {\n    const expected =\n      \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABC7YxPJkVXZH3qqq8Nq1nwYa5Pm6+M9ZeObND0CCtBLXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n    const result = transactionToBase64(tx);\n\n    expect(result).toBe(expected);\n  });\n});\n\ndescribe(\"transactionToBase64WithSigners\", () => {\n  let mockSigner: KeyPairSigner;\n\n  beforeAll(async () => {\n    mockSigner = await createKeyPairSignerFromPrivateKeyBytes(MOCK_PRIVATE_KEY_BYTES);\n  });\n\n  test(\"can base64 encode a transaction without signers\", async () => {\n    const expected =\n      \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABC7YxPJkVXZH3qqq8Nq1nwYa5Pm6+M9ZeObND0CCtBLXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n    const result = await transactionToBase64WithSigners(tx);\n\n    expect(result).toBe(expected);\n  });\n\n  test(\"can base64 encode a transaction with signer\", async () => {\n    const expected =\n      \"Ace42d/o4XA3NGfL6hslysKyc8kB0ILDUT6diotxWdxP1cdt+oNWGztxEPb5t0F797swnV7NLCguh94nGqetQwABAAABHQ6Thk3MgV/D8oYYCRHQCj/SBt4xoclCh8tD8F/J8rXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n    const tx = createTransaction({\n      version: \"legacy\",\n      feePayer: mockSigner,\n      instructions: [],\n      latestBlockhash: {\n        blockhash: blockhash(\"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\"),\n        lastValidBlockHeight: 0n,\n      },\n    });\n\n    const result = await transactionToBase64WithSigners(tx);\n\n    expect(result).toBe(expected);\n  });\n});\n\ndescribe(\"transactionFromBase64\", () => {\n  test(\"can decode base64 an unsigned transaction\", () => {\n    const input =\n      \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABC7YxPJkVXZH3qqq8Nq1nwYa5Pm6+M9ZeObND0CCtBLXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n    const tx = transactionFromBase64(input);\n\n    const result = transactionToBase64(tx);\n\n    expect(result).toBe(input);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/create-codama.config.ts",
    "content": "import { createCodamaConfig } from \"../core\";\n\ndescribe(\"createCodamaConfig\", () => {\n  const idl = \"anchor/target/idl/counter.json\";\n  const clientJs = \"anchor/src/client/js\";\n  const clientRust = \"anchor/src/client/rust\";\n\n  it(\"should return accept minimal arguments\", () => {\n    const config = createCodamaConfig({\n      clientJs,\n      idl,\n    });\n\n    expect(config).toMatchObject({\n      idl,\n      scripts: {\n        js: {\n          args: [\n            clientJs,\n            {\n              dependencyMap: {\n                solanaAccounts: \"gill\",\n                solanaAddresses: \"gill\",\n                solanaCodecsCore: \"gill\",\n                solanaCodecsDataStructures: \"gill\",\n                solanaCodecsNumbers: \"gill\",\n                solanaCodecsStrings: \"gill\",\n                solanaErrors: \"gill\",\n                solanaInstructions: \"gill\",\n                solanaOptions: \"gill\",\n                solanaPrograms: \"gill\",\n                solanaRpcTypes: \"gill\",\n                solanaSigners: \"gill\",\n              },\n            },\n          ],\n          from: \"@codama/renderers-js\",\n        },\n      },\n    });\n    expect(config.scripts).not.toHaveProperty(\"rust\");\n  });\n\n  it(\"should return accept rust client\", () => {\n    const config = createCodamaConfig({\n      idl,\n      clientJs,\n      clientRust,\n    });\n\n    expect(config).toMatchObject({\n      idl,\n      scripts: {\n        js: {\n          args: [\n            clientJs,\n            {\n              dependencyMap: {\n                solanaAccounts: \"gill\",\n                solanaAddresses: \"gill\",\n                solanaCodecsCore: \"gill\",\n                solanaCodecsDataStructures: \"gill\",\n                solanaCodecsNumbers: \"gill\",\n                solanaCodecsStrings: \"gill\",\n                solanaErrors: \"gill\",\n                solanaInstructions: \"gill\",\n                solanaOptions: \"gill\",\n                solanaPrograms: \"gill\",\n                solanaRpcTypes: \"gill\",\n                solanaSigners: \"gill\",\n              },\n            },\n          ],\n          from: \"@codama/renderers-js\",\n        },\n        rust: {\n          from: \"@codama/renderers-rust\",\n          args: [\n            clientRust,\n            {\n              crateFolder: \"clients/rust\",\n              formatCode: true,\n            },\n          ],\n        },\n      },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/create-solana-client.ts",
    "content": "import assert from \"node:assert\";\n\nimport { createSolanaClient } from \"../core\";\n\ndescribe(\"createSolanaClient\", () => {\n  test(\"supports major cluster monikers and urls\", () => {\n    assert.doesNotThrow(() => {\n      createSolanaClient({ urlOrMoniker: \"mainnet\" });\n      createSolanaClient({ urlOrMoniker: \"devnet\" });\n      createSolanaClient({ urlOrMoniker: \"testnet\" });\n      createSolanaClient({ urlOrMoniker: \"localnet\" });\n      createSolanaClient({ urlOrMoniker: \"https://example-rpc.com\" });\n    });\n  });\n  test(\"throws on invalid moniker\", () => {\n    assert.throws(() => createSolanaClient({ urlOrMoniker: \"invalid\" }), \"Invalid moniker\");\n  });\n  test(\"throws on invalid and unsupported urls\", () => {\n    assert.throws(() => createSolanaClient({ urlOrMoniker: \"http//invalid\" }), \"Invalid url\");\n    assert.throws(() => createSolanaClient({ urlOrMoniker: \"ftp://invalid\" }), \"Unsupported protocol\");\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/create-token-instructions.ts",
    "content": "import { getCreateAccountInstruction } from \"@solana-program/system\";\nimport type { Address, Instruction, KeyPairSigner } from \"@solana/kit\";\nimport { generateKeyPairSigner } from \"@solana/kit\";\nimport { getMinimumBalanceForRentExemption } from \"../core\";\nimport { getCreateTokenInstructions, GetCreateTokenInstructionsArgs, TOKEN_PROGRAM_ADDRESS } from \"../programs/token\";\nimport { getCreateMetadataAccountV3Instruction } from \"../programs/token-metadata\";\n\nimport {\n  getInitializeMetadataPointerInstruction,\n  getInitializeMintInstruction,\n  getInitializeTokenMetadataInstruction,\n  getMintSize,\n  TOKEN_2022_PROGRAM_ADDRESS,\n} from \"@solana-program/token-2022\";\n\nconst MOCK_SPACE = 122n;\nconst MOCK_RENT = 10000n;\n\njest.mock(\"../core\", () => ({\n  // preserve all real implementations to only change the desired ones\n  ...jest.requireActual(\"../core\"),\n  getMinimumBalanceForRentExemption: jest.fn(),\n}));\n\njest.mock(\"../programs/token-metadata\", () => ({\n  // preserve all real implementations to only change the desired ones\n  ...jest.requireActual(\"../programs/token-metadata\"),\n  getCreateMetadataAccountV3Instruction: jest.fn(),\n}));\n\njest.mock(\"@solana-program/system\", () => ({\n  getCreateAccountInstruction: jest.fn(),\n}));\n\njest.mock(\"@solana-program/token-2022\", () => ({\n  // preserve all real implementations to only change the desired ones\n  ...jest.requireActual(\"@solana-program/token-2022\"),\n  getMintSize: jest.fn(),\n  getInitializeMintInstruction: jest.fn(),\n  getInitializeMetadataPointerInstruction: jest.fn(),\n  getInitializeTokenMetadataInstruction: jest.fn(),\n}));\n\ndescribe(\"getCreateTokenInstructions\", () => {\n  let mockPayer: KeyPairSigner;\n  let mockMint: KeyPairSigner;\n\n  let mockMetadataAddress = \"mockMetadataAddress\" as Address;\n\n  let mockMintAuthority: KeyPairSigner;\n  let mockFreezeAuthority: KeyPairSigner;\n\n  let mockCreateAccountInstruction: Instruction;\n  let mockInitializeMintInstruction: Instruction;\n  let mockCreateMetadataInstruction: Instruction;\n\n  let mockInitializeMetadataPointerInstruction: Instruction;\n  let mockInitializeTokenMetadataInstruction: Instruction;\n\n  const metadata: GetCreateTokenInstructionsArgs[\"metadata\"] = {\n    name: \"Test Token\",\n    symbol: \"TEST\",\n    uri: \"https://example.com/metadata.json\",\n    isMutable: true,\n  };\n\n  beforeAll(async () => {\n    [mockPayer, mockMint, mockMintAuthority, mockFreezeAuthority] = await Promise.all([\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n    ]);\n  });\n\n  beforeEach(() => {\n    mockCreateAccountInstruction = {\n      programAddress: \"system\" as Address,\n      data: new Uint8Array([1]),\n    };\n    mockInitializeMintInstruction = {\n      programAddress: \"tokenProgram\" as Address,\n      data: new Uint8Array([2]),\n    };\n    mockCreateMetadataInstruction = {\n      programAddress: \"metadata\" as Address,\n      data: new Uint8Array([4]),\n    };\n    mockInitializeTokenMetadataInstruction = {\n      programAddress: \"initMetadata\" as Address,\n      data: new Uint8Array([5]),\n    };\n    mockInitializeMetadataPointerInstruction = {\n      programAddress: \"initMetadataPointer\" as Address,\n      data: new Uint8Array([6]),\n    };\n\n    (getCreateAccountInstruction as jest.Mock).mockReturnValue(mockCreateAccountInstruction);\n    (getInitializeMintInstruction as jest.Mock).mockReturnValue(mockInitializeMintInstruction);\n    (getCreateMetadataAccountV3Instruction as jest.Mock).mockReturnValue(mockCreateMetadataInstruction);\n    (getInitializeMetadataPointerInstruction as jest.Mock).mockReturnValue(mockInitializeMetadataPointerInstruction);\n    (getInitializeTokenMetadataInstruction as jest.Mock).mockReturnValue(mockInitializeTokenMetadataInstruction);\n\n    (getMinimumBalanceForRentExemption as jest.Mock).mockReturnValue(MOCK_RENT);\n    (getMintSize as jest.Mock).mockReturnValue(MOCK_SPACE);\n  });\n\n  afterEach(() => {\n    jest.clearAllMocks();\n  });\n\n  it(\"should create basic token instructions with default values\", () => {\n    const args: GetCreateTokenInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint,\n      metadataAddress: mockMetadataAddress,\n      metadata,\n    };\n\n    const instructions = getCreateTokenInstructions(args);\n\n    expect(instructions).toHaveLength(3);\n    expect(instructions[0]).toBe(mockCreateAccountInstruction);\n    expect(instructions[1]).toBe(mockInitializeMintInstruction);\n    expect(instructions[2]).toBe(mockCreateMetadataInstruction);\n\n    expect(getCreateAccountInstruction).toHaveBeenCalledWith({\n      payer: mockPayer,\n      newAccount: mockMint,\n      lamports: MOCK_RENT,\n      space: MOCK_SPACE,\n      programAddress: TOKEN_PROGRAM_ADDRESS,\n    });\n\n    expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n      {\n        mint: mockMint.address,\n        decimals: 9,\n        mintAuthority: mockPayer.address,\n        freezeAuthority: null,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n\n    expect(getCreateMetadataAccountV3Instruction).toHaveBeenCalledWith(\n      expect.objectContaining({\n        metadata: mockMetadataAddress,\n        mint: mockMint.address,\n        mintAuthority: mockPayer,\n        payer: mockPayer,\n        updateAuthority: mockPayer,\n        data: {\n          name: metadata.name,\n          symbol: metadata.symbol,\n          uri: metadata.uri,\n          sellerFeeBasisPoints: 0,\n          creators: null,\n          collection: null,\n          uses: null,\n        },\n        isMutable: true,\n        collectionDetails: null,\n      }),\n    );\n  });\n\n  it(\"should throw error for unsupported token program\", () => {\n    const args: GetCreateTokenInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint,\n      metadataAddress: mockMetadataAddress,\n      metadata,\n      tokenProgram: \"UnsupportedProgramId\" as Address,\n    };\n\n    expect(() => getCreateTokenInstructions(args)).toThrow(\n      \"Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'\",\n    );\n  });\n\n  describe(\"should use original token program\", () => {\n    it(\"should use original token program when specified\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMetadataAddress,\n        tokenProgram: TOKEN_PROGRAM_ADDRESS,\n        metadata,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getCreateAccountInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          space: MOCK_SPACE,\n          programAddress: TOKEN_PROGRAM_ADDRESS,\n        }),\n      );\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n        }),\n        {\n          programAddress: TOKEN_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should use custom decimals when provided\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        metadataAddress: mockMetadataAddress,\n        mint: mockMint,\n        decimals: 6,\n        metadata,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          decimals: 6,\n        }),\n        {\n          programAddress: TOKEN_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should allow custom decimals of 0 when provided, not the default of 9\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        metadataAddress: mockMetadataAddress,\n        mint: mockMint,\n        decimals: 0,\n        metadata,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          decimals: 0,\n        }),\n        {\n          programAddress: TOKEN_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should use custom mint and freeze authorities when provided\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMetadataAddress,\n        metadata,\n        mintAuthority: mockMintAuthority,\n        freezeAuthority: mockFreezeAuthority.address,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mintAuthority: mockMintAuthority.address,\n          freezeAuthority: mockFreezeAuthority.address,\n        }),\n        {\n          programAddress: TOKEN_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should add metadata instruction when metadata is provided\", () => {\n      const metadata: GetCreateTokenInstructionsArgs[\"metadata\"] = {\n        name: \"Test Token\",\n        symbol: \"TEST\",\n        uri: \"https://example.com/metadata.json\",\n        isMutable: false,\n      };\n\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMetadataAddress,\n        metadata,\n      };\n\n      const instructions = getCreateTokenInstructions(args);\n\n      expect(instructions).toHaveLength(3);\n      expect(instructions[2]).toBe(mockCreateMetadataInstruction);\n\n      expect(getCreateMetadataAccountV3Instruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          metadata: mockMetadataAddress,\n          mint: mockMint.address,\n          mintAuthority: mockPayer,\n          payer: mockPayer,\n          updateAuthority: mockPayer,\n          data: {\n            name: metadata.name,\n            symbol: metadata.symbol,\n            uri: metadata.uri,\n            sellerFeeBasisPoints: 0,\n            creators: null,\n            collection: null,\n            uses: null,\n          },\n          isMutable: false,\n          collectionDetails: null,\n        }),\n      );\n    });\n\n    it(\"should use custom metadata update authority\", () => {\n      const customUpdateAuthority = { address: \"customUpdateAuth\" } as KeyPairSigner;\n\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMetadataAddress,\n        updateAuthority: customUpdateAuthority,\n        metadata,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getCreateMetadataAccountV3Instruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          updateAuthority: customUpdateAuthority,\n        }),\n      );\n    });\n  });\n\n  describe(\"should use token22 program\", () => {\n    it(\"should use Token-2022 program when specified\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMint.address,\n        tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n        metadata,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getCreateAccountInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          space: MOCK_SPACE,\n          programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n        }),\n      );\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n        }),\n        {\n          programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should use custom decimals when provided\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMint.address,\n        decimals: 6,\n        metadata,\n        tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          decimals: 6,\n        }),\n        {\n          programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should use custom mint and freeze authorities when provided\", () => {\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMint.address,\n        metadata,\n        mintAuthority: mockMintAuthority,\n        freezeAuthority: mockFreezeAuthority.address,\n        tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n      };\n\n      getCreateTokenInstructions(args);\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mintAuthority: mockMintAuthority.address,\n          freezeAuthority: mockFreezeAuthority.address,\n        }),\n        {\n          programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n        },\n      );\n    });\n\n    it(\"should add metadata instruction when metadata is provided\", () => {\n      const metadata: GetCreateTokenInstructionsArgs[\"metadata\"] = {\n        name: \"Test Token22\",\n        symbol: \"TEST\",\n        uri: \"https://example.com/metadata.json\",\n        isMutable: false,\n      };\n\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMint.address,\n        metadata,\n        tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n      };\n\n      const instructions = getCreateTokenInstructions(args);\n\n      expect(instructions).toHaveLength(4);\n      expect(instructions[1]).toBe(mockInitializeMetadataPointerInstruction);\n      expect(instructions[3]).toBe(mockInitializeTokenMetadataInstruction);\n\n      expect(getInitializeMetadataPointerInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          metadataAddress: mockMint.address,\n          authority: mockPayer.address,\n        }),\n      );\n\n      expect(getInitializeMintInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          mintAuthority: mockPayer.address,\n        }),\n        {\n          programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n        },\n      );\n\n      expect(getInitializeTokenMetadataInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          metadata: mockMint.address,\n          mintAuthority: mockPayer,\n          updateAuthority: mockPayer.address,\n          name: metadata.name,\n          symbol: metadata.symbol,\n          uri: metadata.uri,\n        }),\n      );\n    });\n\n    it(\"should use custom metadata update authority\", () => {\n      const customUpdateAuthority = { address: \"customUpdateAuth\" } as KeyPairSigner;\n\n      const args: GetCreateTokenInstructionsArgs = {\n        feePayer: mockPayer,\n        mint: mockMint,\n        metadataAddress: mockMint.address,\n        updateAuthority: customUpdateAuthority,\n        metadata,\n        tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n      };\n\n      const instructions = getCreateTokenInstructions(args);\n\n      expect(instructions).toHaveLength(4);\n      expect(instructions[1]).toBe(mockInitializeMetadataPointerInstruction);\n      expect(instructions[3]).toBe(mockInitializeTokenMetadataInstruction);\n\n      expect(getInitializeMetadataPointerInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          mint: mockMint.address,\n          metadataAddress: mockMint.address,\n        }),\n      );\n\n      expect(getInitializeTokenMetadataInstruction).toHaveBeenCalledWith(\n        expect.objectContaining({\n          updateAuthority: customUpdateAuthority.address,\n        }),\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/create-transaction.ts",
    "content": "import assert from \"node:assert\";\n\nimport { type Address, blockhash, generateKeyPairSigner, isKeyPairSigner, type KeyPairSigner } from \"@solana/kit\";\n\nimport { createTransaction } from \"../core\";\nimport { hasSetComputeLimitInstruction, hasSetComputeUnitPriceInstruction } from \"../programs\";\n\ndescribe(\"createTransaction\", () => {\n  let signer: KeyPairSigner;\n\n  beforeAll(async () => {\n    signer = await generateKeyPairSigner();\n  });\n\n  it(\"create a legacy transaction with a signer as the feePayer\", () => {\n    const tx = createTransaction({\n      feePayer: signer,\n      instructions: [],\n      latestBlockhash: {\n        blockhash: blockhash(\"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\"),\n        lastValidBlockHeight: 0n,\n      },\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n    assert.equal(tx.feePayer.address, signer.address);\n    assert.equal(isKeyPairSigner(tx.feePayer), true);\n    assert.equal(tx.instructions.length, 0);\n    assert.equal(Object.hasOwn(tx, \"lifetimeConstraint\"), true);\n    assert.equal(tx.lifetimeConstraint.blockhash, \"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\");\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n  });\n\n  it(\"create a version 0 transaction with a signer as the feePayer\", () => {\n    const tx = createTransaction({\n      feePayer: signer,\n      instructions: [],\n      version: 0,\n    });\n\n    assert.equal(tx.version, 0);\n    assert.equal(tx.feePayer.address, signer.address);\n    assert.equal(isKeyPairSigner(tx.feePayer), true);\n    assert.equal(tx.instructions.length, 0);\n    assert.equal(Object.hasOwn(tx, \"lifetimeConstraint\"), false);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n  });\n\n  it(\"create a legacy transaction with an `Address` as the feePayer\", () => {\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [],\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n    assert.equal(tx.feePayer.address, signer.address);\n    assert.equal(isKeyPairSigner(tx.feePayer), false);\n    assert.equal(tx.instructions.length, 0);\n    assert.equal(Object.hasOwn(tx, \"lifetimeConstraint\"), false);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n  });\n\n  it(\"create a legacy transaction with a compute unit limit instruction\", () => {\n    const tx = createTransaction({\n      computeUnitLimit: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n    assert.equal(tx.instructions.length, 1);\n    assert.equal(hasSetComputeLimitInstruction(tx), true);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n  });\n\n  it(\"create a legacy transaction with a compute unit price instruction\", () => {\n    const tx = createTransaction({\n      computeUnitPrice: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n    assert.equal(tx.instructions.length, 1);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), true);\n  });\n\n  it(\"create a legacy transaction with both compute budget instructions\", () => {\n    const tx = createTransaction({\n      computeUnitLimit: 0,\n      computeUnitPrice: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n    assert.equal(tx.instructions.length, 2);\n    assert.equal(hasSetComputeLimitInstruction(tx), true);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), true);\n  });\n\n  it(\"create a version 0 transaction with an `Address` as the feePayer\", () => {\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [],\n      latestBlockhash: {\n        blockhash: blockhash(\"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\"),\n        lastValidBlockHeight: 0n,\n      },\n      version: 0,\n    });\n\n    assert.equal(tx.version, 0);\n    assert.equal(tx.feePayer.address, signer.address);\n    assert.equal(isKeyPairSigner(tx.feePayer), false);\n    assert.equal(tx.instructions.length, 0);\n    assert.equal(Object.hasOwn(tx, \"lifetimeConstraint\"), true);\n    assert.equal(tx.lifetimeConstraint.blockhash, \"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\");\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n  });\n\n  it(\"create a version 0 transaction with a compute unit limit instruction\", () => {\n    const tx = createTransaction({\n      computeUnitLimit: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: 0,\n    });\n\n    assert.equal(tx.version, 0);\n    assert.equal(tx.instructions.length, 1);\n    assert.equal(hasSetComputeLimitInstruction(tx), true);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), false);\n  });\n\n  it(\"create a version 0 transaction with a compute unit price instruction\", () => {\n    const tx = createTransaction({\n      computeUnitPrice: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: 0,\n    });\n\n    assert.equal(tx.version, 0);\n    assert.equal(tx.instructions.length, 1);\n    assert.equal(hasSetComputeLimitInstruction(tx), false);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), true);\n  });\n\n  it(\"create a version 0 transaction with both compute budget instructions\", () => {\n    const tx = createTransaction({\n      computeUnitLimit: 0,\n      computeUnitPrice: 0,\n      feePayer: signer.address,\n      instructions: [],\n      version: 0,\n    });\n\n    assert.equal(tx.version, 0);\n    assert.equal(tx.instructions.length, 2);\n    assert.equal(hasSetComputeLimitInstruction(tx), true);\n    assert.equal(hasSetComputeUnitPriceInstruction(tx), true);\n  });\n\n  it(\"auto-detects legacy version when no ALT is used\", () => {\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [],\n    });\n\n    assert.equal(tx.version, \"legacy\");\n  });\n\n  it(\"auto-detects v0 version when ALT is detected in instructions\", () => {\n    const instructionWithALT = {\n      accounts: [],\n      addressTableLookup: {\n        lookupTableAddress: \"22222222222222222222222222222222\" as Address,\n        readableIndices: [],\n        writableIndices: [],\n      },\n      data: new Uint8Array(),\n      programAddress: \"11111111111111111111111111111111\" as Address,\n    };\n\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [instructionWithALT],\n    });\n\n    assert.equal(tx.version, 0);\n  });\n\n  it(\"auto-detects v0 version when addressTableLookups is present\", () => {\n    const instructionWithALTs = {\n      accounts: [],\n      addressTableLookups: [\n        {\n          lookupTableAddress: \"22222222222222222222222222222222\" as Address,\n          readableIndices: [],\n          writableIndices: [],\n        },\n      ],\n      data: new Uint8Array(),\n      programAddress: \"11111111111111111111111111111111\" as Address,\n    };\n\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [instructionWithALTs],\n    });\n\n    assert.equal(tx.version, 0);\n  });\n\n  it(\"explicit version overrides auto-detection\", () => {\n    const instructionWithALT = {\n      accounts: [],\n      addressTableLookup: {\n        lookupTableAddress: \"22222222222222222222222222222222\" as Address,\n        readableIndices: [],\n        writableIndices: [],\n      },\n      data: new Uint8Array(),\n      programAddress: \"11111111111111111111111111111111\" as Address,\n    };\n\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [instructionWithALT],\n      version: \"legacy\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n  });\n\n  it(\"explicit auto version behaves same as no version\", () => {\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [],\n      version: \"auto\",\n    });\n\n    assert.equal(tx.version, \"legacy\");\n  });\n\n  it(\"explicit auto version with ALT detects v0\", () => {\n    const instructionWithALT = {\n      accounts: [],\n      addressTableLookup: {\n        lookupTableAddress: \"22222222222222222222222222222222\" as Address,\n        readableIndices: [],\n        writableIndices: [],\n      },\n      data: new Uint8Array(),\n      programAddress: \"11111111111111111111111111111111\" as Address,\n    };\n\n    const tx = createTransaction({\n      feePayer: signer.address,\n      instructions: [instructionWithALT],\n      version: \"auto\",\n    });\n\n    assert.equal(tx.version, 0);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/debug.ts",
    "content": "import { debug, isDebugEnabled } from \"../core\";\n\nconst DEFAULT_PREFIX = \"[GILL]\";\n\ndescribe(\"isDebugEnabled\", () => {\n  // Store original env and global values\n  const originalEnv = process.env;\n\n  beforeEach(() => {\n    // Reset env and global before each test\n    jest.resetModules();\n    process.env = { ...originalEnv };\n    global.__GILL_DEBUG__ = undefined;\n    global.__GILL_DEBUG_LEVEL__ = undefined;\n\n    // Clear window if it exists\n    if (typeof window !== \"undefined\") {\n      (window as any).__GILL_DEBUG__ = undefined;\n    }\n  });\n\n  afterEach(() => {\n    // Restore original env and global after each test\n    process.env = originalEnv;\n    global.__GILL_DEBUG__ = undefined;\n    global.__GILL_DEBUG_LEVEL__ = undefined;\n  });\n\n  it(\"should return false when no debug flags are set\", () => {\n    expect(isDebugEnabled()).toBe(false);\n  });\n\n  it(\"should return true when GILL_DEBUG_LEVEL is set\", () => {\n    process.env.GILL_DEBUG_LEVEL = \"debug\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return true when global.__GILL_DEBUG_LEVEL__ is set\", () => {\n    global.__GILL_DEBUG_LEVEL__ = \"info\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it('should return true when GILL_DEBUG env is \"true\"', () => {\n    process.env.GILL_DEBUG = \"true\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it('should return true when GILL_DEBUG env is \"1\"', () => {\n    process.env.GILL_DEBUG = \"1\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return true when global.__GILL_DEBUG__ is true\", () => {\n    global.__GILL_DEBUG__ = true;\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return true when global.__GILL_DEBUG_LEVEL__ is set\", () => {\n    global.__GILL_DEBUG_LEVEL__ = \"debug\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return true when global.__GILL_DEBUG_LEVEL__ is set\", () => {\n    global.__GILL_DEBUG_LEVEL__ = \"debug\";\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return true when global.__GILL_DEBUG_LEVEL__ is set with any value\", () => {\n    global.__GILL_DEBUG_LEVEL__ = \"any\" as any;\n    expect(isDebugEnabled()).toBe(true);\n  });\n\n  it(\"should return false for falsy values\", () => {\n    process.env.GILL_DEBUG = \"false\";\n    global.__GILL_DEBUG__ = false;\n    global.__GILL_DEBUG_LEVEL__ = undefined;\n    expect(isDebugEnabled()).toBe(false);\n  });\n\n  it(\"should return true when multiple debug flags are set\", () => {\n    process.env.GILL_DEBUG = \"false\"; // This one is false\n    global.__GILL_DEBUG__ = true; // But this one is true\n    expect(isDebugEnabled()).toBe(true);\n  });\n});\n\ndescribe(\"debug logger\", () => {\n  // Store original console methods and env\n  const originalConsole = { ...console };\n  const originalEnv = process.env;\n  // const originalGlobal = global;\n\n  // Mock all console methods\n  beforeEach(() => {\n    console.log = jest.fn();\n    console.debug = jest.fn();\n    console.info = jest.fn();\n    console.warn = jest.fn();\n    console.error = jest.fn();\n\n    // Reset env and global\n    jest.resetModules();\n    process.env = { ...originalEnv };\n    global.__GILL_DEBUG__ = undefined;\n    global.__GILL_DEBUG_LEVEL__ = undefined;\n  });\n\n  // Restore original console methods and env\n  afterEach(() => {\n    console.log = originalConsole.log;\n    console.debug = originalConsole.debug;\n    console.info = originalConsole.info;\n    console.warn = originalConsole.warn;\n    console.error = originalConsole.error;\n\n    process.env = originalEnv;\n    global.__GILL_DEBUG__ = undefined;\n    global.__GILL_DEBUG_LEVEL__ = undefined;\n  });\n\n  describe(\"when debug is enabled\", () => {\n    beforeEach(() => {\n      global.__GILL_DEBUG__ = true;\n      global.__GILL_DEBUG_LEVEL__ = \"debug\";\n    });\n\n    it(\"should call console.log for debug level\", () => {\n      debug(\"test message\", \"debug\");\n      expect(console.log).toHaveBeenCalledWith(DEFAULT_PREFIX, \"test message\");\n      expect(console.debug).not.toHaveBeenCalled();\n      expect(console.info).not.toHaveBeenCalled();\n      expect(console.warn).not.toHaveBeenCalled();\n      expect(console.error).not.toHaveBeenCalled();\n    });\n\n    it(\"should call console.info for info level\", () => {\n      debug(\"test message\", \"info\");\n      expect(console.log).not.toHaveBeenCalled();\n      expect(console.debug).not.toHaveBeenCalled();\n      expect(console.info).toHaveBeenCalledWith(DEFAULT_PREFIX, \"test message\");\n      expect(console.warn).not.toHaveBeenCalled();\n      expect(console.error).not.toHaveBeenCalled();\n    });\n\n    it(\"should call console.warn for warn level\", () => {\n      debug(\"test message\", \"warn\");\n      expect(console.log).not.toHaveBeenCalled();\n      expect(console.debug).not.toHaveBeenCalled();\n      expect(console.info).not.toHaveBeenCalled();\n      expect(console.warn).toHaveBeenCalledWith(DEFAULT_PREFIX, \"test message\");\n      expect(console.error).not.toHaveBeenCalled();\n    });\n\n    it(\"should call console.error for error level\", () => {\n      debug(\"test message\", \"error\");\n      expect(console.log).not.toHaveBeenCalled();\n      expect(console.debug).not.toHaveBeenCalled();\n      expect(console.info).not.toHaveBeenCalled();\n      expect(console.warn).not.toHaveBeenCalled();\n      expect(console.error).toHaveBeenCalledWith(DEFAULT_PREFIX, \"test message\");\n    });\n\n    it(\"should stringify objects\", () => {\n      const obj = { test: \"value\" };\n      debug(obj, \"info\");\n      expect(console.info).toHaveBeenCalledWith(DEFAULT_PREFIX, JSON.stringify(obj, null, 2));\n    });\n  });\n\n  describe(\"log level filtering\", () => {\n    beforeEach(() => {\n      global.__GILL_DEBUG__ = true;\n    });\n\n    it(\"should not log debug when level is info\", () => {\n      global.__GILL_DEBUG_LEVEL__ = \"info\";\n      debug(\"test message\", \"debug\");\n      expect(console.log).not.toHaveBeenCalled();\n      expect(console.debug).not.toHaveBeenCalled();\n    });\n\n    it(\"should not log info when level is warn\", () => {\n      global.__GILL_DEBUG_LEVEL__ = \"warn\";\n      debug(\"test message\", \"info\");\n      expect(console.info).not.toHaveBeenCalled();\n    });\n\n    it(\"should not log warn when level is error\", () => {\n      global.__GILL_DEBUG_LEVEL__ = \"error\";\n      debug(\"test message\", \"warn\");\n      expect(console.warn).not.toHaveBeenCalled();\n    });\n\n    it(\"should log error regardless of level\", () => {\n      global.__GILL_DEBUG_LEVEL__ = \"error\";\n      debug(\"test message\", \"error\");\n      expect(console.error).toHaveBeenCalled();\n    });\n  });\n\n  describe(\"when debug is disabled\", () => {\n    beforeEach(() => {\n      global.__GILL_DEBUG__ = false;\n    });\n\n    it(\"should not log anything\", () => {\n      debug(\"test message\", \"debug\");\n      debug(\"test message\", \"info\");\n      debug(\"test message\", \"warn\");\n      debug(\"test message\", \"error\");\n\n      expect(console.log).not.toHaveBeenCalled();\n      expect(console.debug).not.toHaveBeenCalled();\n      expect(console.info).not.toHaveBeenCalled();\n      expect(console.warn).not.toHaveBeenCalled();\n      expect(console.error).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/explorer.ts",
    "content": "import assert from \"node:assert\";\nimport { getSignatureFromTransaction, ReadonlyUint8Array, SignaturesMap, TransactionMessageBytes } from \"@solana/kit\";\n\nimport { getExplorerLink } from \"../core\";\n\ndescribe(\"getExplorerLink\", () => {\n  test(\"getExplorerLink returns the base explorer url\", () => {\n    const link = getExplorerLink();\n    assert.equal(link, \"https://explorer.solana.com/\");\n  });\n\n  test(\"getExplorerLink returns the base explorer url for mainnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"mainnet\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/\");\n  });\n\n  test(\"getExplorerLink returns the base explorer url for mainnet-beta\", () => {\n    const link = getExplorerLink({\n      cluster: \"mainnet-beta\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/\");\n  });\n\n  test(\"getExplorerLink returns the base explorer url for devnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"devnet\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/?cluster=devnet\");\n  });\n\n  test(\"getExplorerLink returns the base explorer url for testnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"testnet\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/?cluster=testnet\");\n  });\n\n  test(\"getExplorerLink returns the base explorer url for localnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"localnet\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/?cluster=custom&customUrl=http%3A%2F%2Flocalhost%3A8899\");\n  });\n\n  test(\"getExplorerLink works for a block on mainnet when no network is supplied\", () => {\n    const link = getExplorerLink({\n      block: \"242233124\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/block/242233124\");\n  });\n\n  test(\"getExplorerLink works for a block on mainnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"mainnet-beta\",\n      block: \"242233124\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/block/242233124\");\n  });\n\n  test(\"getExplorerLink works for a block on mainnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"mainnet\",\n      block: \"242233124\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/block/242233124\");\n  });\n\n  test(\"getExplorerLink works for an address on mainnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"mainnet-beta\",\n      address: \"dDCQNnDmNbFVi8cQhKAgXhyhXeJ625tvwsunRyRc7c8\",\n    });\n    assert.equal(link, \"https://explorer.solana.com/address/dDCQNnDmNbFVi8cQhKAgXhyhXeJ625tvwsunRyRc7c8\");\n  });\n\n  test(\"getExplorerLink works for an address on devnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"devnet\",\n      address: \"dDCQNnDmNbFVi8cQhKAgXhyhXeJ625tvwsunRyRc7c8\",\n    });\n    assert.equal(\n      link,\n      \"https://explorer.solana.com/address/dDCQNnDmNbFVi8cQhKAgXhyhXeJ625tvwsunRyRc7c8?cluster=devnet\",\n    );\n  });\n\n  test(\"getExplorerLink works for a transaction signature\", () => {\n    const link = getExplorerLink({\n      transaction: \"2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX\",\n    });\n    assert.equal(\n      link,\n      \"https://explorer.solana.com/tx/2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX\",\n    );\n  });\n\n  test(\"getExplorerLink works for a signed transaction\", () => {\n    const signedTx = {\n      signatures: {\n        nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c: [\n          77, 92, 24, 170, 25, 33, 200, 153, 230, 77, 49, 85, 252, 160, 42, 192, 68, 242, 160, 20, 64, 71, 154, 190, 6,\n          63, 124, 101, 224, 127, 147, 238, 138, 252, 144, 23, 49, 97, 73, 118, 118, 94, 32, 147, 76, 228, 241, 244,\n          182, 223, 244, 135, 175, 158, 129, 227, 23, 49, 177, 159, 227, 46, 23, 10,\n        ],\n      } as SignaturesMap,\n      messageBytes: new Uint8Array() as ReadonlyUint8Array as TransactionMessageBytes,\n    };\n\n    const signature = getSignatureFromTransaction(signedTx);\n    assert.equal(signature, \"2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX\");\n\n    const link = getExplorerLink({\n      transaction: signature,\n    });\n    assert.equal(\n      link,\n      \"https://explorer.solana.com/tx/2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX\",\n    );\n  });\n\n  test(\"getExplorerLink works for a transaction on devnet\", () => {\n    const link = getExplorerLink({\n      cluster: \"devnet\",\n      transaction: \"2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX\",\n    });\n    assert.equal(\n      link,\n      \"https://explorer.solana.com/tx/2YhzivV92fw9oT6RjTBWSdqR8Sc9FTWxzPMwAzeqiWutXfEgiwhXz3iCnayt9P8nmKwwGn2wDYsGRCSdeoxTJCDX?cluster=devnet\",\n    );\n  });\n\n  test(\"getExplorerLink provides a localnet URL\", () => {\n    const link = getExplorerLink({\n      cluster: \"localnet\",\n      transaction: \"2QC8BkDVZgaPHUXG9HuPw7aE5d6kN5DTRXLe2inT1NzurkYTCFhraSEo883CPNe18BZ2peJC1x1nojZ5Jmhs94pL\",\n    });\n    assert.equal(\n      link,\n      \"https://explorer.solana.com/tx/2QC8BkDVZgaPHUXG9HuPw7aE5d6kN5DTRXLe2inT1NzurkYTCFhraSEo883CPNe18BZ2peJC1x1nojZ5Jmhs94pL?cluster=custom&customUrl=http%3A%2F%2Flocalhost%3A8899\",\n    );\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/get-oldest-signature.ts",
    "content": "import { Address, isSolanaError, Signature, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN } from \"@solana/kit\";\nimport { getOldestSignatureForAddress } from \"../core\";\n\ndescribe(\"getOldestSignatureForAddress\", () => {\n  // Sample test data\n  const mockAddress = \"mockAddress123\" as Address;\n  const mockSignature1 = { signature: \"sig1\" as Signature, slot: 100, blockTime: 1000 };\n  const mockSignature2 = { signature: \"sig2\" as Signature, slot: 90, blockTime: 900 };\n  const mockSignature3 = { signature: \"sig3\" as Signature, slot: 80, blockTime: 800 };\n  const mockSignature4 = { signature: \"sig4\" as Signature, slot: 70, blockTime: 700 };\n\n  // Reset mocks before each test\n  beforeEach(() => {\n    jest.clearAllMocks();\n  });\n\n  it(\"returns the oldest signature when there are signatures and less than the limit\", async () => {\n    const mockRpc = {\n      getSignaturesForAddress: jest.fn().mockReturnValue({\n        send: jest.fn().mockResolvedValue([mockSignature1, mockSignature2, mockSignature3]),\n      }),\n    };\n\n    const result = await getOldestSignatureForAddress(mockRpc as any, mockAddress);\n\n    expect(mockRpc.getSignaturesForAddress).toHaveBeenCalledWith(mockAddress, undefined);\n    expect(result).toEqual(mockSignature3);\n  });\n\n  it(\"recursively fetches more signatures when limit is reached\", async () => {\n    // Create a mock that returns different results for different calls\n    const mockRpc = {\n      getSignaturesForAddress: jest\n        .fn()\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockResolvedValue(\n            Array(1000)\n              .fill(null)\n              .map((_, i) => ({\n                signature: `sig${i}`,\n                slot: 1000 - i,\n                blockTime: 10000 - i * 10,\n              })),\n          ),\n        }))\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockResolvedValue([mockSignature4]),\n        })),\n    };\n\n    const result = await getOldestSignatureForAddress(mockRpc as any, mockAddress);\n\n    // First call without before parameter\n    expect(mockRpc.getSignaturesForAddress).toHaveBeenNthCalledWith(1, mockAddress, undefined);\n\n    // Second call with before parameter set to the oldest signature from first batch\n    expect(mockRpc.getSignaturesForAddress).toHaveBeenNthCalledWith(\n      2,\n      mockAddress,\n      expect.objectContaining({\n        before: \"sig999\", // The oldest from the first call has index 999\n      }),\n    );\n\n    expect(result).toEqual(mockSignature4);\n  });\n\n  it(\"throws SolanaError when no signatures are found\", async () => {\n    const mockRpc = {\n      getSignaturesForAddress: jest.fn().mockReturnValue({\n        send: jest.fn().mockResolvedValue([]),\n      }),\n    };\n\n    try {\n      await getOldestSignatureForAddress(mockRpc as any, mockAddress);\n      fail(\"Expected function to throw, but it did not\");\n    } catch (err) {\n      expect(isSolanaError(err, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN)).toBe(true);\n      expect((err as any).context.errorName).toBe(\"OldestSignatureNotFound\");\n    }\n  });\n\n  it(\"returns the oldest signature from first batch if recursive call fails with 'not found'\", async () => {\n    const mockRpc = {\n      getSignaturesForAddress: jest\n        .fn()\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockResolvedValue(\n            Array(1000)\n              .fill(null)\n              .map((_, i) => ({\n                signature: `sig${i}`,\n                slot: 1000 - i,\n                blockTime: 10000 - i * 10,\n              })),\n          ),\n        }))\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockResolvedValue([]),\n        })),\n    };\n\n    const result = await getOldestSignatureForAddress(mockRpc as any, mockAddress);\n\n    expect(result).toEqual({\n      signature: \"sig999\",\n      slot: 1,\n      blockTime: 10,\n    });\n  });\n\n  it(\"passes the abort signal to the RPC call\", async () => {\n    const abortSignal = new AbortController().signal;\n\n    const mockSendFn = jest.fn().mockResolvedValue([mockSignature1]);\n    const mockRpc = {\n      getSignaturesForAddress: jest.fn().mockReturnValue({\n        send: mockSendFn,\n      }),\n    };\n\n    await getOldestSignatureForAddress(mockRpc as any, mockAddress, { abortSignal });\n\n    expect(mockRpc.getSignaturesForAddress).toHaveBeenCalledWith(mockAddress, expect.objectContaining({ abortSignal }));\n    expect(mockSendFn).toHaveBeenCalledWith({ abortSignal });\n  });\n\n  it(\"passes through other config options correctly\", async () => {\n    const mockRpc = {\n      getSignaturesForAddress: jest.fn().mockReturnValue({\n        send: jest.fn().mockResolvedValue([mockSignature1]),\n      }),\n    };\n\n    const config = {\n      limit: 50,\n      before: \"someSig\" as Signature,\n      until: \"untilSig\" as Signature,\n      abortSignal: new AbortController().signal,\n    };\n\n    await getOldestSignatureForAddress(mockRpc as any, mockAddress, config);\n\n    expect(mockRpc.getSignaturesForAddress).toHaveBeenCalledWith(\n      mockAddress,\n      expect.objectContaining({\n        limit: 50,\n        before: \"someSig\",\n        until: \"untilSig\",\n        abortSignal: config.abortSignal,\n      }),\n    );\n  });\n\n  it(\"rethrows unknown errors\", async () => {\n    const mockRpc = {\n      getSignaturesForAddress: jest\n        .fn()\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockResolvedValue(\n            Array(1000)\n              .fill(null)\n              .map((_, i) => ({\n                signature: `sig${i}`,\n                slot: 1000 - i,\n                blockTime: 10000 - i * 10,\n              })),\n          ),\n        }))\n        .mockImplementationOnce(() => ({\n          send: jest.fn().mockRejectedValue(new Error(\"Network error\")),\n        })),\n    };\n\n    await expect(getOldestSignatureForAddress(mockRpc as any, mockAddress)).rejects.toEqual(new Error(\"Network error\"));\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/keypairs-base58.ts",
    "content": "import { blockhash, createKeyPairFromBytes, createSignerFromKeyPair } from \"@solana/kit\";\nimport {\n  createKeypairFromBase58,\n  createKeypairSignerFromBase58,\n  createTransaction,\n  transactionToBase64WithSigners,\n} from \"../core\";\n\nconst EXPECTED_ADDRESS = \"5CxWcsm9h3NfCM8WPM6eaw8LnnSmnYyEHf8BQQ56YJGK\";\n\n// Corresponds to address `5CxWcsm9h3NfCM8WPM6eaw8LnnSmnYyEHf8BQQ56YJGK`\nconst MOCK_KEY_BYTES = new Uint8Array([\n  158, 162, 68, 53, 7, 160, 11, 228, 121, 212, 9, 20, 153, 66, 181, 218, 221, 151, 133, 191, 47, 200, 42, 248, 9, 193,\n  87, 242, 138, 52, 78, 247, 62, 126, 231, 24, 61, 119, 89, 115, 57, 124, 71, 221, 150, 117, 118, 44, 234, 134, 91, 100,\n  152, 80, 11, 142, 29, 0, 122, 146, 140, 107, 174, 196,\n]);\n\n// Corresponds to address `5CxWcsm9h3NfCM8WPM6eaw8LnnSmnYyEHf8BQQ56YJGK`\nconst MOCK_KEY_BASE58 = \"4AxFzQaPR6N9dWP5K3GdZRLuWJcdgPznM4h42ASqByP3c6vywVLKs32rwPPsuvsJh1E6fLjkAbe8dzhTj3w173Ky\";\n\ndescribe(\"createKeypairFromBase58\", () => {\n  test(\"creates a valid CryptoKeyPair from a base58 encoded secret key\", async () => {\n    const [keypair, referenceKeypair] = await Promise.all([\n      createKeypairFromBase58(MOCK_KEY_BASE58),\n      createKeyPairFromBytes(MOCK_KEY_BYTES),\n    ]);\n\n    const [signer, referenceSigner] = await Promise.all([\n      createSignerFromKeyPair(keypair),\n      createSignerFromKeyPair(referenceKeypair),\n    ]);\n\n    expect(signer.address.toString()).toBe(EXPECTED_ADDRESS);\n    expect(signer.address.toString()).toBe(referenceSigner.address.toString());\n  });\n\n  test(\"throws error when given invalid base58 string\", async () => {\n    const invalidBase58 = \"INVALID-BASE58-O0l\";\n\n    await expect(createKeypairFromBase58(invalidBase58)).rejects.toThrow();\n  });\n\n  test(\"throws error when given base58 address\", async () => {\n    await expect(createKeypairFromBase58(EXPECTED_ADDRESS)).rejects.toThrow();\n  });\n});\n\ndescribe(\"createKeypairSignerFromBase58\", () => {\n  test(\"creates a valid CryptoKeyPair from a base58 encoded secret key\", async () => {\n    const referenceKeypair = await createKeyPairFromBytes(MOCK_KEY_BYTES);\n\n    const [signer, referenceSigner] = await Promise.all([\n      createKeypairSignerFromBase58(MOCK_KEY_BASE58),\n      createSignerFromKeyPair(referenceKeypair),\n    ]);\n\n    expect(signer.address.toString()).toBe(EXPECTED_ADDRESS);\n    expect(signer.address.toString()).toBe(referenceSigner.address.toString());\n  });\n\n  test(\"throws error when given invalid base58 string\", async () => {\n    const invalidBase58 = \"INVALID-BASE58-O0l\";\n\n    await expect(createKeypairSignerFromBase58(invalidBase58)).rejects.toThrow();\n  });\n\n  test(\"throws error when given base58 address\", async () => {\n    await expect(createKeypairSignerFromBase58(EXPECTED_ADDRESS)).rejects.toThrow();\n  });\n\n  test(\"can sign transactions\", async () => {\n    const signer = await createKeypairSignerFromBase58(MOCK_KEY_BASE58);\n\n    const expected =\n      \"AVwKxtJbYr4VoTGC59X+au7C6zMKOfBh6eWU8f293dCDZY0qVEDBz+7zPFUiDb5eF7Z/1oeB11+6edzGR4vyIQgBAAABPn7nGD13WXM5fEfdlnV2LOqGW2SYUAuOHQB6koxrrsTjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n    const tx = createTransaction({\n      version: \"legacy\",\n      feePayer: signer,\n      instructions: [],\n      latestBlockhash: {\n        blockhash: blockhash(\"GK1nopeF3P8J46dGqq4KfaEWopZU7K65F6CKQXuUdr3z\"),\n        lastValidBlockHeight: 0n,\n      },\n    });\n\n    const result = await transactionToBase64WithSigners(tx);\n\n    expect(result).toBe(expected);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/mint-tokens-instructions.ts",
    "content": "import {\n  getCreateAssociatedTokenIdempotentInstruction,\n  getMintToInstruction,\n  TOKEN_2022_PROGRAM_ADDRESS,\n} from \"@solana-program/token-2022\";\nimport { generateKeyPairSigner, type Address, type KeyPairSigner } from \"@solana/kit\";\nimport { getMintTokensInstructions, GetMintTokensInstructionsArgs, TOKEN_PROGRAM_ADDRESS } from \"../programs/token\";\n\n// Mock the imported functions\njest.mock(\"@solana-program/token-2022\", () => ({\n  // preserve all real implementations to only change the desired ones\n  ...jest.requireActual(\"@solana-program/token-2022\"),\n\n  getCreateAssociatedTokenIdempotentInstruction: jest.fn(),\n  getMintToInstruction: jest.fn(),\n}));\n\ndescribe(\"getMintTokensInstructions\", () => {\n  let mockPayer: KeyPairSigner;\n  let mockMint: KeyPairSigner;\n  let mockMintAuthority: KeyPairSigner;\n  let mockDestination: KeyPairSigner;\n\n  const mockAta = \"mockAtaAddress\" as Address;\n  const mockAmount = BigInt(1000);\n\n  beforeAll(async () => {\n    [mockPayer, mockMint, mockMintAuthority, mockDestination] = await Promise.all([\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n    ]);\n  });\n\n  beforeEach(() => {\n    (getCreateAssociatedTokenIdempotentInstruction as jest.Mock).mockReturnValue({\n      instruction: \"mockCreateAtaInstruction\",\n    });\n\n    (getMintToInstruction as jest.Mock).mockReturnValue({\n      instruction: \"mockMintToInstruction\",\n    });\n  });\n\n  afterEach(() => {\n    jest.clearAllMocks();\n  });\n\n  it(\"should create instructions with default token program\", () => {\n    const args: GetMintTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      mintAuthority: mockMintAuthority,\n      destination: mockDestination.address,\n      ata: mockAta,\n      amount: mockAmount,\n    };\n\n    const instructions = getMintTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: mockDestination.address,\n      mint: mockMint.address,\n      ata: mockAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_PROGRAM_ADDRESS,\n    });\n\n    expect(getMintToInstruction).toHaveBeenCalledWith(\n      {\n        mint: mockMint.address,\n        mintAuthority: mockMintAuthority,\n        token: mockAta,\n        amount: mockAmount,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should create instructions with Token-2022 program\", () => {\n    const args: GetMintTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      mintAuthority: mockMintAuthority,\n      destination: mockDestination.address,\n      ata: mockAta,\n      amount: mockAmount,\n      tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n    };\n\n    const instructions = getMintTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: mockDestination.address,\n      mint: mockMint.address,\n      ata: mockAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n    });\n  });\n\n  it(\"should accept Address type for mint, mintAuthority, and destination\", () => {\n    const args: GetMintTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: \"mintAddress\" as Address,\n      mintAuthority: \"mintAuthorityAddress\" as Address,\n      destination: \"ownerAddress\" as Address,\n      ata: mockAta,\n      amount: mockAmount,\n    };\n\n    const instructions = getMintTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: args.destination,\n      mint: args.mint,\n      ata: mockAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_PROGRAM_ADDRESS,\n    });\n\n    expect(getMintToInstruction).toHaveBeenCalledWith(\n      {\n        mint: \"mintAddress\",\n        mintAuthority: \"mintAuthorityAddress\",\n        token: mockAta,\n        amount: mockAmount,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should accept number type for amount\", () => {\n    const args: GetMintTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      mintAuthority: mockMintAuthority,\n      destination: mockDestination.address,\n      ata: mockAta,\n      amount: 1000,\n    };\n\n    const instructions = getMintTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n    expect(getMintToInstruction).toHaveBeenCalledWith(\n      {\n        mint: mockMint.address,\n        mintAuthority: mockMintAuthority,\n        token: mockAta,\n        amount: 1000,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should throw error for unsupported token program\", () => {\n    const args: GetMintTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      mintAuthority: mockMintAuthority,\n      destination: mockDestination.address,\n      ata: mockAta,\n      amount: mockAmount,\n      tokenProgram: \"UnsupportedProgramId\" as Address,\n    };\n\n    expect(() => getMintTokensInstructions(args)).toThrow(\n      \"Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'\",\n    );\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/reference-keys.ts",
    "content": "import { AccountRole, Address, BaseTransactionMessage, SolanaError } from \"@solana/kit\";\nimport { insertReferenceKeysToTransactionMessage, insertReferenceKeyToTransactionMessage } from \"../core\";\n\n// Mock for BaseTransactionMessage\nconst createMockTransaction = (instructions: any[]): BaseTransactionMessage => {\n  return Object.freeze({\n    instructions: Object.freeze(instructions),\n    // Add other required properties of BaseTransactionMessage interface if needed\n  }) as unknown as BaseTransactionMessage;\n};\n\ndescribe(\"insertReferenceKeyToTransactionMessage\", () => {\n  const referenceKey = \"someReferenceAddress\" as Address;\n\n  const memoInstruction = {\n    programAddress: \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\" as Address,\n    accounts: [],\n  };\n\n  it(\"should insert a single reference key into transaction message\", () => {\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([nonMemoInstruction]);\n\n    const result = insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n\n    expect(result).not.toBe(transaction); // Should return a new object (immutability)\n    expect(result.instructions.length).toBe(1);\n    expect(result.instructions[0].accounts).toHaveLength(2);\n    expect(result.instructions[0].accounts?.[1]).toEqual({\n      address: referenceKey,\n      role: AccountRole.READONLY,\n    });\n  });\n\n  it(\"should throw an error if transaction has no instructions\", () => {\n    const transaction = createMockTransaction([]);\n\n    expect(() => {\n      insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n    }).toThrow(SolanaError);\n  });\n\n  it(\"should throw an error if transaction has only memo instructions\", () => {\n    const transaction = createMockTransaction([memoInstruction]);\n\n    expect(() => {\n      insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n    }).toThrow(SolanaError);\n  });\n\n  it(\"should modify the first non-memo instruction when when memo is first\", () => {\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([memoInstruction, nonMemoInstruction]);\n\n    const result = insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n\n    expect(result.instructions.length).toBe(2);\n    expect(result.instructions[0]).toEqual(memoInstruction); // First instruction unchanged\n    expect(result.instructions[1].accounts).toHaveLength(2);\n    expect(result.instructions[1].accounts?.[1]).toEqual({\n      address: referenceKey,\n      role: AccountRole.READONLY,\n    });\n  });\n\n  it(\"should modify the first non-memo instruction when when memo is NOT first\", () => {\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([nonMemoInstruction, memoInstruction]);\n\n    const result = insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n\n    expect(result.instructions.length).toBe(2);\n    expect(result.instructions[1]).toEqual(memoInstruction); // First instruction unchanged\n    expect(result.instructions[0].accounts).toHaveLength(2);\n    expect(result.instructions[0].accounts?.[1]).toEqual({\n      address: referenceKey,\n      role: AccountRole.READONLY,\n    });\n  });\n\n  it(\"should handle instructions without existing accounts array\", () => {\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      // No accounts array\n    };\n    const transaction = createMockTransaction([nonMemoInstruction]);\n\n    const result = insertReferenceKeyToTransactionMessage(referenceKey, transaction);\n\n    expect(result.instructions[0].accounts).toHaveLength(1);\n    expect(result.instructions[0].accounts?.[0]).toEqual({\n      address: referenceKey,\n      role: AccountRole.READONLY,\n    });\n  });\n});\n\ndescribe(\"insertReferenceKeysToTransactionMessage\", () => {\n  it(\"should insert multiple reference keys into transaction message\", () => {\n    const referenceKeys = [\n      \"referenceAddress1\" as Address,\n      \"referenceAddress2\" as Address,\n      \"referenceAddress3\" as Address,\n    ];\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([nonMemoInstruction]);\n\n    const result = insertReferenceKeysToTransactionMessage(referenceKeys, transaction);\n\n    expect(result.instructions[0].accounts).toHaveLength(4); // 1 original + 3 references\n\n    expect(result.instructions[0].accounts?.[1]).toEqual({\n      address: referenceKeys[0],\n      role: AccountRole.READONLY,\n    });\n    expect(result.instructions[0].accounts?.[2]).toEqual({\n      address: referenceKeys[1],\n      role: AccountRole.READONLY,\n    });\n    expect(result.instructions[0].accounts?.[3]).toEqual({\n      address: referenceKeys[2],\n      role: AccountRole.READONLY,\n    });\n  });\n\n  it(\"should handle empty reference keys array\", () => {\n    const referenceKeys: Address[] = [];\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([nonMemoInstruction]);\n\n    const result = insertReferenceKeysToTransactionMessage(referenceKeys, transaction);\n\n    expect(result.instructions[0].accounts).toHaveLength(1); // No changes to accounts\n    expect(result).not.toBe(transaction); // Still returns a new object\n  });\n\n  it(\"should throw an error if transaction has no instructions\", () => {\n    const referenceKeys = [\"someReferenceAddress\" as Address];\n    const transaction = createMockTransaction([]);\n\n    expect(() => {\n      insertReferenceKeysToTransactionMessage(referenceKeys, transaction);\n    }).toThrow(SolanaError);\n  });\n\n  it(\"should preserve transaction immutability\", () => {\n    const referenceKeys = [\"referenceAddress1\" as Address];\n    const originalInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [{ address: \"account1\" as Address, role: AccountRole.READONLY }],\n    };\n    const transaction = createMockTransaction([originalInstruction]);\n    const originalInstructionsLength = transaction.instructions.length;\n    const originalAccountsLength = transaction.instructions[0].accounts?.length || 0;\n\n    const result = insertReferenceKeysToTransactionMessage(referenceKeys, transaction);\n\n    expect(transaction.instructions.length).toBe(originalInstructionsLength);\n    expect(transaction.instructions[0].accounts?.length).toBe(originalAccountsLength);\n    expect(result.instructions[0].accounts?.length).toBe(originalAccountsLength + 1);\n  });\n\n  it(\"should handle instruction with different account roles\", () => {\n    const referenceKeys = [\"referenceAddress1\" as Address];\n    const nonMemoInstruction = {\n      programAddress: \"SomeProgram\",\n      accounts: [\n        { address: \"account1\" as Address, role: AccountRole.READONLY },\n        { address: \"account2\" as Address, role: AccountRole.WRITABLE },\n        { address: \"account3\" as Address, role: AccountRole.READONLY_SIGNER },\n        { address: \"account4\" as Address, role: AccountRole.WRITABLE_SIGNER },\n      ],\n    };\n    const transaction = createMockTransaction([nonMemoInstruction]);\n\n    const result = insertReferenceKeysToTransactionMessage(referenceKeys, transaction);\n\n    expect(result.instructions[0].accounts).toHaveLength(5);\n    // Original accounts are preserved with their roles\n    expect(result.instructions[0].accounts?.[0].role).toBe(AccountRole.READONLY);\n    expect(result.instructions[0].accounts?.[1].role).toBe(AccountRole.WRITABLE);\n    expect(result.instructions[0].accounts?.[2].role).toBe(AccountRole.READONLY_SIGNER);\n    expect(result.instructions[0].accounts?.[3].role).toBe(AccountRole.WRITABLE_SIGNER);\n    // New reference is added with READONLY role\n    expect(result.instructions[0].accounts?.[4].address).toBe(referenceKeys[0]);\n    expect(result.instructions[0].accounts?.[4].role).toBe(AccountRole.READONLY);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/rpc.ts",
    "content": "import assert from \"node:assert\";\n\nimport { getPublicSolanaRpcUrl } from \"../core\";\n\ndescribe(\"getPublicSolanaRpcUrl\", () => {\n  test(\"getPublicSolanaRpcUrl returns mainnet-beta url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"mainnet-beta\");\n    assert.equal(rpcUrl, \"https://api.mainnet-beta.solana.com\");\n  });\n  test(\"getPublicSolanaRpcUrl returns mainnet url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"mainnet\");\n    assert.equal(rpcUrl, \"https://api.mainnet-beta.solana.com\");\n  });\n  test(\"getPublicSolanaRpcUrl returns devnet url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"devnet\");\n    assert.equal(rpcUrl, \"https://api.devnet.solana.com\");\n  });\n  test(\"getPublicSolanaRpcUrl returns testnet url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"testnet\");\n    assert.equal(rpcUrl, \"https://api.testnet.solana.com\");\n  });\n  test(\"getPublicSolanaRpcUrl returns localnet url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"localnet\");\n    assert.equal(rpcUrl, \"http://127.0.0.1:8899\");\n  });\n  test(\"getPublicSolanaRpcUrl returns localhost url\", () => {\n    const rpcUrl = getPublicSolanaRpcUrl(\"localhost\");\n    assert.equal(rpcUrl, \"http://127.0.0.1:8899\");\n  });\n  test(\"getPublicSolanaRpcUrl show throw error on unsupported moniker\", () => {\n    // @ts-expect-error - `not-supported` is not a valid moniker\n    assert.throws(() => getPublicSolanaRpcUrl(\"not-supported\"), Error);\n  });\n  test(\"getPublicSolanaRpcUrl show throw error on a url provided\", () => {\n    // @ts-expect-error - urls are not supported\n    assert.throws(() => getPublicSolanaRpcUrl(\"https://google.com\"), Error);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/token/assert-is-mint.ts",
    "content": "import type { Mint } from \"@solana-program/token-2022\";\nimport type { Account, Address, Lamports } from \"@solana/kit\";\nimport {\n  SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND,\n  SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT,\n  SolanaError,\n} from \"@solana/kit\";\nimport { assertIsMint } from \"../../programs\";\n\ndescribe(\"assertIsMint\", () => {\n  it(\"should throw ACCOUNT_NOT_FOUND error when given an address\", () => {\n    const address = \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address;\n\n    expect(() => assertIsMint(address)).toThrow(SolanaError);\n    expect(() => assertIsMint(address)).toThrow(\n      expect.objectContaining({\n        context: expect.objectContaining({\n          __code: SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND,\n          address: address,\n        }),\n      }),\n    );\n  });\n\n  it(\"should throw FAILED_TO_DECODE_ACCOUNT error when account has no data property\", () => {\n    const invalidAccount = { address: \"test\" } as any;\n\n    expect(() => assertIsMint(invalidAccount)).toThrow(SolanaError);\n    expect(() => assertIsMint(invalidAccount)).toThrow(\n      expect.objectContaining({\n        context: expect.objectContaining({\n          __code: SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT,\n        }),\n      }),\n    );\n  });\n\n  it(\"should throw FAILED_TO_DECODE_ACCOUNT error when account data has no mintAuthority property\", () => {\n    const invalidAccount = {\n      address: \"test\" as Address,\n      data: { someOtherProperty: true },\n    } as any;\n\n    expect(() => assertIsMint(invalidAccount)).toThrow(SolanaError);\n    expect(() => assertIsMint(invalidAccount)).toThrow(\n      expect.objectContaining({\n        context: expect.objectContaining({\n          __code: SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT,\n        }),\n      }),\n    );\n  });\n\n  it(\"should not throw when given a valid Mint account\", () => {\n    const validMintAccount: Account<Mint> = {\n      address: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address,\n      data: {\n        mintAuthority: \"authority\" as any,\n        supply: 1000000n,\n        decimals: 6,\n        isInitialized: true,\n        freezeAuthority: null as any,\n        extensions: [] as any,\n      },\n      executable: false,\n      lamports: 1461600n as Lamports,\n      programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n      space: 0n,\n    };\n\n    expect(() => assertIsMint(validMintAccount)).not.toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/token/fetch-token-accounts.ts",
    "content": "import type { Mint, Token } from \"@solana-program/token-2022\";\nimport { decodeToken, fetchMint } from \"@solana-program/token-2022\";\nimport type {\n  Account,\n  Address,\n  Commitment,\n  GetAccountInfoApi,\n  GetTokenAccountsByOwnerApi,\n  Lamports,\n  Rpc,\n} from \"@solana/kit\";\nimport { none, parseBase64RpcAccount, some } from \"@solana/kit\";\nimport { fetchTokenAccounts, FetchTokenAccountsConfig } from \"../../programs\";\n\n// Mock the dependencies\njest.mock(\"@solana-program/token-2022\", () => ({\n  ...jest.requireActual(\"@solana-program/token-2022\"),\n  fetchMint: jest.fn(),\n  decodeToken: jest.fn(),\n}));\njest.mock(\"@solana/kit\", () => ({\n  ...jest.requireActual(\"@solana/kit\"),\n  parseBase64RpcAccount: jest.fn(),\n}));\n\ndescribe(\"fetchTokenAccounts\", () => {\n  let mockRpc: jest.Mocked<Rpc<GetTokenAccountsByOwnerApi & GetAccountInfoApi>>;\n  let mockSend: jest.MockedFunction<any>;\n  let mockGetTokenAccountsByOwner: jest.MockedFunction<any>;\n  let mockGetAccountInfo: jest.MockedFunction<any>;\n\n  const mockFetchMint = fetchMint as jest.MockedFunction<typeof fetchMint>;\n  const mockDecodeToken = decodeToken as jest.MockedFunction<typeof decodeToken>;\n  const mockParseBase64RpcAccount = parseBase64RpcAccount as jest.MockedFunction<typeof parseBase64RpcAccount>;\n  const commitment: Commitment = \"confirmed\";\n\n  const mockBase64EncodedRpcAccount = {\n    address: \"TokenAccount1\" as Address,\n    data: \"parsedData\" as any,\n    executable: false,\n    lamports: 2039280n as Lamports,\n    exists: true,\n    space: 0n,\n    programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n  };\n\n  const mockRpcResponse = {\n    value: [\n      {\n        pubkey: \"TokenAccount1\" as Address,\n        account: {\n          data: \"base64EncodedData\",\n          executable: false,\n          lamports: 2039280,\n          programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n        },\n      },\n    ],\n  };\n\n  const mockMintAccount: Account<Mint> = {\n    address: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address,\n    data: {\n      mintAuthority: some(\"authority\" as Address),\n      supply: 1000000n,\n      decimals: 6,\n      isInitialized: true,\n      freezeAuthority: none(),\n      extensions: none(),\n    },\n    executable: false,\n    lamports: 1461600n as Lamports,\n    programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n    space: 0n,\n  };\n\n  const mockTokenAccount: Account<Token> & { exists: true } = {\n    address: \"TokenAccount1\" as Address,\n    data: {\n      mint: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address,\n      owner: \"GQuioVe2yA6KZfstgmirAvugfUZBcdxSi7sHK7JGk3gk\" as Address,\n      amount: 500000n,\n      delegate: none(),\n      state: 1,\n      isNative: none(),\n      delegatedAmount: 0n,\n      closeAuthority: none(),\n      extensions: none(),\n    },\n    executable: false,\n    lamports: 2039280n as Lamports,\n    programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n    space: 0n,\n    exists: true,\n  };\n\n  const ownerAddress = \"GQuioVe2yA6KZfstgmirAvugfUZBcdxSi7sHK7JGk3gk\" as Address;\n\n  beforeEach(() => {\n    jest.clearAllMocks();\n\n    mockSend = jest.fn();\n    mockGetTokenAccountsByOwner = jest.fn().mockReturnValue({ send: mockSend });\n    mockGetAccountInfo = jest.fn();\n    mockRpc = {\n      getTokenAccountsByOwner: mockGetTokenAccountsByOwner,\n      getAccountInfo: mockGetAccountInfo,\n    } as any;\n  });\n\n  it(\"should fetch token accounts when mint is provided as Address\", async () => {\n    const mintAddress = \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address;\n\n    mockFetchMint.mockResolvedValue(mockMintAccount);\n    mockDecodeToken.mockReturnValue(mockTokenAccount);\n    mockParseBase64RpcAccount.mockReturnValue(mockBase64EncodedRpcAccount);\n\n    mockSend.mockResolvedValue(mockRpcResponse);\n\n    const result = await fetchTokenAccounts(mockRpc, mintAddress, ownerAddress);\n\n    expect(mockFetchMint).toHaveBeenCalledWith(mockRpc, mintAddress);\n    expect(mockRpc.getTokenAccountsByOwner).toHaveBeenCalledWith(\n      ownerAddress,\n      { mint: mockMintAccount.address },\n      { encoding: \"base64\" },\n    );\n    expect(result).toEqual({\n      mint: mockMintAccount,\n      totalBalance: 500000n,\n      accounts: [mockTokenAccount],\n    });\n  });\n\n  it(\"should fetch token accounts when mint is provided as Account\", async () => {\n    mockDecodeToken.mockReturnValue(mockTokenAccount);\n    mockSend.mockResolvedValue(mockRpcResponse);\n    mockParseBase64RpcAccount.mockReturnValue(mockBase64EncodedRpcAccount);\n\n    const result = await fetchTokenAccounts(mockRpc, mockMintAccount, ownerAddress);\n\n    expect(mockFetchMint).not.toHaveBeenCalled();\n    expect(mockRpc.getTokenAccountsByOwner).toHaveBeenCalledWith(\n      ownerAddress,\n      { mint: mockMintAccount.address },\n      { encoding: \"base64\" },\n    );\n    expect(result).toEqual({\n      mint: mockMintAccount,\n      totalBalance: 500000n,\n      accounts: [mockTokenAccount],\n    });\n  });\n\n  it(\"should handle multiple token accounts and calculate total balance\", async () => {\n    const mockTokenAccount2: Account<Token> & { exists: true } = {\n      ...mockTokenAccount,\n      address: \"TokenAccount2\" as Address,\n      data: { ...mockTokenAccount.data, amount: 750000n },\n    };\n\n    const mockRpcResponse = {\n      value: [\n        {\n          pubkey: \"TokenAccount1\" as Address,\n          account: {\n            data: \"base64EncodedData1\",\n            executable: false,\n            lamports: 2039280,\n            programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n          },\n        },\n        {\n          pubkey: \"TokenAccount2\" as Address,\n          account: {\n            data: \"base64EncodedData2\",\n            executable: false,\n            lamports: 2039280,\n            programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n          },\n        },\n      ],\n    };\n\n    mockSend.mockResolvedValue(mockRpcResponse);\n    mockParseBase64RpcAccount\n      .mockReturnValueOnce({\n        address: \"TokenAccount1\" as Address,\n        account: {\n          data: \"parsedData1\",\n          executable: false,\n          lamports: 2039280n,\n          programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n        },\n      } as any)\n      .mockReturnValueOnce({\n        address: \"TokenAccount2\" as Address,\n        account: {\n          data: \"parsedData2\",\n          executable: false,\n          lamports: 2039280n,\n          programAddress: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address,\n        },\n      } as any);\n\n    mockDecodeToken.mockReturnValueOnce(mockTokenAccount).mockReturnValueOnce(mockTokenAccount2);\n\n    const result = await fetchTokenAccounts(mockRpc, mockMintAccount, ownerAddress);\n\n    expect(result.totalBalance).toBe(1250000n); // 500000 + 750000\n    expect(result.accounts).toHaveLength(2);\n    expect(result.accounts).toEqual([mockTokenAccount, mockTokenAccount2]);\n  });\n\n  it(\"should pass config options to RPC call\", async () => {\n    const config: FetchTokenAccountsConfig = {\n      commitment,\n      minContextSlot: 123456n,\n    };\n\n    const mockRpcResponse = { value: [] };\n    mockSend.mockResolvedValue(mockRpcResponse);\n\n    await fetchTokenAccounts(mockRpc, mockMintAccount, ownerAddress, config);\n\n    expect(mockRpc.getTokenAccountsByOwner).toHaveBeenCalledWith(\n      ownerAddress,\n      { mint: mockMintAccount.address },\n      { commitment, minContextSlot: 123456n, encoding: \"base64\" },\n    );\n  });\n\n  it(\"should accept abortSignal in config\", async () => {\n    const abortController = new AbortController();\n    const config: FetchTokenAccountsConfig = {\n      abortSignal: abortController.signal,\n      commitment,\n    };\n\n    const mockRpcResponse = { value: [] };\n    mockSend.mockResolvedValue(mockRpcResponse);\n\n    await fetchTokenAccounts(mockRpc, mockMintAccount, ownerAddress, config);\n\n    expect(mockRpc.getTokenAccountsByOwner).toHaveBeenCalledWith(\n      ownerAddress,\n      { mint: mockMintAccount.address },\n      { commitment, encoding: \"base64\" },\n    );\n    expect(mockSend).toHaveBeenCalledWith({ abortSignal: abortController.signal });\n  });\n\n  it(\"should handle empty token accounts response\", async () => {\n    const mockRpcResponse = { value: [] };\n    mockSend.mockResolvedValue(mockRpcResponse);\n\n    const result = await fetchTokenAccounts(mockRpc, mockMintAccount, ownerAddress);\n\n    expect(result).toEqual({\n      mint: mockMintAccount,\n      totalBalance: 0n,\n      accounts: [],\n    });\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/transfer-tokens-instructions.ts",
    "content": "import {\n  getCreateAssociatedTokenIdempotentInstruction,\n  getTransferInstruction,\n  TOKEN_2022_PROGRAM_ADDRESS,\n} from \"@solana-program/token-2022\";\nimport { generateKeyPairSigner, type Address, type KeyPairSigner } from \"@solana/kit\";\nimport {\n  getTransferTokensInstructions,\n  GetTransferTokensInstructionsArgs,\n  TOKEN_PROGRAM_ADDRESS,\n} from \"../programs/token\";\n\n// Mock the imported functions\njest.mock(\"@solana-program/token-2022\", () => ({\n  // preserve all real implementations to only change the desired ones\n  ...jest.requireActual(\"@solana-program/token-2022\"),\n\n  getCreateAssociatedTokenIdempotentInstruction: jest.fn(),\n  getTransferInstruction: jest.fn(),\n}));\n\ndescribe(\"getTransferTokensInstructions\", () => {\n  let mockPayer = { address: \"payer\" } as KeyPairSigner;\n  let mockMint = { address: \"mint\" } as KeyPairSigner;\n  let mockAuthority = { address: \"authority\" } as KeyPairSigner;\n  let mockDestination = { address: \"destination\" } as KeyPairSigner;\n  const mockDestinationAta = \"destinationAta\" as Address;\n  const mockSourceAta = \"sourceAta\" as Address;\n\n  const mockAmount = BigInt(1000);\n\n  beforeAll(async () => {\n    [mockPayer, mockMint, mockAuthority, mockDestination] = await Promise.all([\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n      generateKeyPairSigner(),\n    ]);\n  });\n\n  beforeEach(() => {\n    (getCreateAssociatedTokenIdempotentInstruction as jest.Mock).mockReturnValue({\n      instruction: \"mockCreateAtaInstruction\",\n    });\n\n    (getTransferInstruction as jest.Mock).mockReturnValue({\n      instruction: \"mockTransferInstruction\",\n    });\n  });\n\n  afterEach(() => {\n    jest.clearAllMocks();\n  });\n\n  it(\"should create instructions with default token program\", () => {\n    const args: GetTransferTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      amount: mockAmount,\n      authority: mockAuthority,\n      sourceAta: mockSourceAta,\n      destination: mockDestination.address,\n      destinationAta: mockDestinationAta,\n    };\n\n    const instructions = getTransferTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: mockDestination.address,\n      mint: mockMint.address,\n      ata: mockDestinationAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_PROGRAM_ADDRESS,\n    });\n\n    expect(getTransferInstruction).toHaveBeenCalledWith(\n      {\n        authority: mockAuthority,\n        source: mockSourceAta,\n        amount: mockAmount,\n        destination: mockDestinationAta,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should create instructions with Token-2022 program\", () => {\n    const args: GetTransferTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      authority: mockAuthority,\n      sourceAta: mockSourceAta,\n      amount: mockAmount,\n      destination: mockDestination.address,\n      destinationAta: mockDestinationAta,\n      tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n    };\n\n    const instructions = getTransferTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: mockDestination.address,\n      mint: mockMint.address,\n      ata: mockDestinationAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n    });\n\n    expect(getTransferInstruction).toHaveBeenCalledWith(\n      {\n        authority: mockAuthority,\n        source: mockSourceAta,\n        amount: mockAmount,\n        destination: mockDestinationAta,\n      },\n      {\n        programAddress: TOKEN_2022_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should accept Address type for mint, authority, and destination\", () => {\n    const args: GetTransferTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      authority: mockAuthority.address,\n      amount: mockAmount,\n      destination: mockDestination.address,\n      destinationAta: mockDestinationAta,\n      sourceAta: mockSourceAta,\n    };\n\n    const instructions = getTransferTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getCreateAssociatedTokenIdempotentInstruction).toHaveBeenCalledWith({\n      owner: args.destination,\n      mint: args.mint,\n      ata: mockDestinationAta,\n      payer: mockPayer,\n      tokenProgram: TOKEN_PROGRAM_ADDRESS,\n    });\n\n    expect(getTransferInstruction).toHaveBeenCalledWith(\n      {\n        authority: mockAuthority.address,\n        source: mockSourceAta,\n        amount: mockAmount,\n        destination: mockDestinationAta,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should accept number type for amount\", () => {\n    const args: GetTransferTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      authority: mockAuthority,\n      amount: 1000,\n      destination: mockDestination.address,\n      destinationAta: mockDestinationAta,\n      sourceAta: mockSourceAta,\n    };\n\n    const instructions = getTransferTokensInstructions(args);\n\n    expect(instructions).toHaveLength(2);\n\n    expect(getTransferInstruction).toHaveBeenCalledWith(\n      {\n        authority: mockAuthority,\n        source: mockSourceAta,\n        amount: 1000,\n        destination: mockDestinationAta,\n      },\n      {\n        programAddress: TOKEN_PROGRAM_ADDRESS,\n      },\n    );\n  });\n\n  it(\"should throw error for unsupported token program\", () => {\n    const args: GetTransferTokensInstructionsArgs = {\n      feePayer: mockPayer,\n      mint: mockMint.address,\n      authority: mockAuthority,\n      amount: mockAmount,\n      tokenProgram: \"UnsupportedProgramId\" as Address,\n      destination: mockDestination.address,\n      destinationAta: mockDestinationAta,\n      sourceAta: mockSourceAta,\n    };\n\n    expect(() => getTransferTokensInstructions(args)).toThrow(\n      \"Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'\",\n    );\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/ui-amount.ts",
    "content": "import { tokenAmountToUiAmount, tokenUiAmountToAmount } from \"../programs/token\";\n\ndescribe(\"Token Amount Conversion Functions\", () => {\n  describe(\"tokenUiAmountToAmount\", () => {\n    test(\"converts whole numbers correctly\", () => {\n      expect(tokenUiAmountToAmount(1, 6)).toBe(1000000n);\n      expect(tokenUiAmountToAmount(100, 9)).toBe(100000000000n);\n      expect(tokenUiAmountToAmount(0, 6)).toBe(0n);\n    });\n\n    test(\"converts decimal numbers correctly\", () => {\n      expect(tokenUiAmountToAmount(1.5, 6)).toBe(1500000n);\n      expect(tokenUiAmountToAmount(0.05, 6)).toBe(50000n);\n      expect(tokenUiAmountToAmount(0.000001, 6)).toBe(1n);\n    });\n\n    test(\"handles more decimal places than specified\", () => {\n      expect(tokenUiAmountToAmount(1.123456789, 6)).toBe(1123457n);\n      expect(tokenUiAmountToAmount(0.0000019999, 6)).toBe(2n);\n    });\n\n    test(\"handles fewer decimal places than specified\", () => {\n      expect(tokenUiAmountToAmount(1.1, 6)).toBe(1100000n);\n      expect(tokenUiAmountToAmount(1.1, 9)).toBe(1100000000n);\n    });\n\n    test(\"handles large numbers correctly\", () => {\n      expect(tokenUiAmountToAmount(123456789, 6)).toBe(123456789000000n);\n      expect(tokenUiAmountToAmount(987654321.123456, 6)).toBe(987654321123456n);\n    });\n\n    test(\"handles very small decimals correctly\", () => {\n      expect(tokenUiAmountToAmount(0.000000001, 9)).toBe(1n);\n      // Very small number that would normally trigger scientific notation\n      expect(tokenUiAmountToAmount(0.0000001, 6)).toBe(0n);\n      // Another extreme small case\n      expect(tokenUiAmountToAmount(1e-10, 6)).toBe(0n);\n    });\n\n    test(\"handles zero decimal places\", () => {\n      expect(tokenUiAmountToAmount(5, 0)).toBe(5n);\n      expect(tokenUiAmountToAmount(5.9, 0)).toBe(6n);\n      expect(tokenUiAmountToAmount(5.99, 1)).toBe(60n);\n    });\n\n    test(\"handles extreme cases\", () => {\n      // Large number of decimals (but within reasonable limits)\n      expect(tokenUiAmountToAmount(1.5, 15)).toBe(1500000000000000n);\n\n      // Edge cases with JS number precision\n      expect(tokenUiAmountToAmount(0.1 + 0.2, 6)).toBe(300000n); // JS floating point issue handled\n    });\n  });\n\n  describe(\"tokenAmountToUiAmount\", () => {\n    test(\"converts whole numbers correctly\", () => {\n      expect(tokenAmountToUiAmount(1000000n, 6)).toBe(1);\n      expect(tokenAmountToUiAmount(100000000000n, 9)).toBe(100);\n      expect(tokenAmountToUiAmount(0n, 6)).toBe(0);\n    });\n\n    test(\"converts decimal amounts correctly\", () => {\n      expect(tokenAmountToUiAmount(1500000n, 6)).toBe(1.5);\n      expect(tokenAmountToUiAmount(50000n, 6)).toBe(0.05);\n      expect(tokenAmountToUiAmount(1n, 6)).toBe(0.000001);\n    });\n\n    test(\"handles small amounts correctly\", () => {\n      expect(tokenAmountToUiAmount(1n, 9)).toBe(0.000000001);\n      expect(tokenAmountToUiAmount(123n, 6)).toBe(0.000123);\n    });\n\n    test(\"handles large amounts correctly\", () => {\n      expect(tokenAmountToUiAmount(123456789000000n, 6)).toBe(123456789);\n      expect(tokenAmountToUiAmount(987654321123456n, 6)).toBe(987654321.123456);\n    });\n\n    test(\"handles amounts with fewer digits than decimals\", () => {\n      expect(tokenAmountToUiAmount(5n, 6)).toBe(0.000005);\n      expect(tokenAmountToUiAmount(42n, 9)).toBe(0.000000042);\n    });\n\n    test(\"handles zero decimal places\", () => {\n      expect(tokenAmountToUiAmount(5n, 0)).toBe(5);\n      expect(tokenAmountToUiAmount(0n, 0)).toBe(0);\n    });\n\n    test(\"handles extreme cases\", () => {\n      // Large number of decimals (but within reasonable limits)\n      expect(tokenAmountToUiAmount(1500000000000000n, 15)).toBe(1.5);\n\n      // Reasonably large amount that won't exceed JavaScript's number precision\n      const largeAmount = BigInt(\"12345678901234567890\");\n      expect(tokenAmountToUiAmount(largeAmount, 9)).toBe(12345678901.23456789);\n    });\n  });\n\n  describe(\"Round-trip conversions\", () => {\n    test(\"UI amount -> raw amount -> UI amount preserves value\", () => {\n      const original = 1.234567;\n      const decimals = 6;\n\n      const rawAmount = tokenUiAmountToAmount(original, decimals);\n      const roundTrip = tokenAmountToUiAmount(rawAmount, decimals);\n\n      // Using toBeCloseTo instead of toBe due to potential floating point precision issues\n      expect(roundTrip).toBeCloseTo(1.234567, decimals - 1);\n    });\n\n    test(\"UI amount with excess precision gets truncated appropriately\", () => {\n      const original = 1.2345678901;\n      const decimals = 6;\n\n      const rawAmount = tokenUiAmountToAmount(original, decimals);\n      const roundTrip = tokenAmountToUiAmount(rawAmount, decimals);\n\n      // Using toBeCloseTo instead of toBe due to potential floating point precision issues\n      expect(roundTrip).toBeCloseTo(1.234567, decimals - 1);\n    });\n\n    test(\"raw amount -> UI amount -> raw amount preserves value\", () => {\n      const original = 1234567n;\n      const decimals = 6;\n\n      const uiAmount = tokenAmountToUiAmount(original, decimals);\n      const roundTrip = tokenUiAmountToAmount(uiAmount, decimals);\n\n      expect(roundTrip).toBe(original);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/utils.ts",
    "content": "import { GENESIS_HASH, getMonikerFromGenesisHash, lamportsToSol } from \"../core\";\n\ndescribe(\"getMonikerFromGenesisHash\", () => {\n  it(\"should return 'mainnet' for mainnet genesis hash\", () => {\n    const result = getMonikerFromGenesisHash(GENESIS_HASH.mainnet);\n    expect(result).toBe(\"mainnet\");\n  });\n\n  it(\"should return 'devnet' for devnet genesis hash\", () => {\n    const result = getMonikerFromGenesisHash(GENESIS_HASH.devnet);\n    expect(result).toBe(\"devnet\");\n  });\n\n  it(\"should return 'testnet' for testnet genesis hash\", () => {\n    const result = getMonikerFromGenesisHash(GENESIS_HASH.testnet);\n    expect(result).toBe(\"testnet\");\n  });\n\n  it(\"should return 'unknown' for unrecognized hash\", () => {\n    const result = getMonikerFromGenesisHash(\"unknown-hash-value\");\n    expect(result).toBe(\"unknown\");\n  });\n});\n\ndescribe(\"lamportsToSol\", () => {\n  it(\"should convert correctly to 1 SOL\", () => {\n    const result = lamportsToSol(1_000_000_000);\n    expect(result).toBe(\"1\");\n  });\n\n  it(\"should convert correctly to 0.5 SOL\", () => {\n    const result = lamportsToSol(500_000_000);\n    expect(result).toBe(\"0.5\");\n  });\n\n  it(\"should convert correctly to 0.000000001 SOL\", () => {\n    const result = lamportsToSol(1);\n    expect(result).toBe(\"0.000000001\");\n  });\n\n  it(\"should convert correctly to 0 SOL\", () => {\n    const result = lamportsToSol(0);\n    expect(result).toBe(\"0\");\n  });\n\n  it(\"should convert a BigInt correctly\", () => {\n    // Max safe number value is 9_007_199_254_740_991\n    const result = lamportsToSol(10_000_000_333_333_333n);\n    expect(result).toBe(\"10,000,000.333333332\");\n  });\n\n  it(\"should format with custom decimal places\", () => {\n    const lamports = 1_234_567_890;\n    expect(lamportsToSol(lamports, 0)).toBe(\"1\");\n    expect(lamportsToSol(lamports, 1)).toBe(\"1.2\");\n    expect(lamportsToSol(lamports, 2)).toBe(\"1.23\");\n    expect(lamportsToSol(lamports, 3)).toBe(\"1.235\");\n    expect(lamportsToSol(lamports, 4)).toBe(\"1.2346\");\n    expect(lamportsToSol(lamports, 5)).toBe(\"1.23457\");\n    expect(lamportsToSol(lamports, 6)).toBe(\"1.234568\");\n    expect(lamportsToSol(lamports, 7)).toBe(\"1.2345679\");\n    expect(lamportsToSol(lamports, 8)).toBe(\"1.23456789\");\n    expect(lamportsToSol(lamports, 9)).toBe(\"1.23456789\");\n  });\n\n  it(\"should handle decimals parameter greater than 9\", () => {\n    const lamports = 1_234_567_890;\n    expect(lamportsToSol(lamports, 10)).toBe(\"1.23456789\");\n    expect(lamportsToSol(lamports, 15)).toBe(\"1.23456789\");\n  });\n\n  it(\"should remove trailing zeros with custom decimals\", () => {\n    const lamports = 1_500_000_000;\n    expect(lamportsToSol(lamports, 2)).toBe(\"1.5\");\n    expect(lamportsToSol(lamports, 3)).toBe(\"1.5\");\n    expect(lamportsToSol(lamports, 9)).toBe(\"1.5\");\n  });\n\n  it(\"should handle very small amounts with custom decimals\", () => {\n    const lamports = 123;\n    expect(lamportsToSol(lamports, 0)).toBe(\"0\");\n    expect(lamportsToSol(lamports, 3)).toBe(\"0\");\n    expect(lamportsToSol(lamports, 6)).toBe(\"0\");\n    expect(lamportsToSol(lamports, 7)).toBe(\"0.0000001\");\n    expect(lamportsToSol(lamports, 8)).toBe(\"0.00000012\");\n    expect(lamportsToSol(lamports, 9)).toBe(\"0.000000123\");\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__tests__/verify-signature.ts",
    "content": "import { generateKeyPairSigner, getBase58Decoder, KeyPairSigner, signBytes } from \"@solana/kit\";\nimport { verifySignatureForAddress } from \"../core/verify-signature\";\n\ndescribe(\"verifySignatureForAddress\", () => {\n  let testKeyPair: KeyPairSigner;\n  const testMessage: string = \"Hello, Solana!\";\n  const messageBytes = new TextEncoder().encode(testMessage);\n\n  beforeAll(async () => {\n    testKeyPair = await generateKeyPairSigner();\n  });\n\n  it(\"should return true for valid signature with SignatureBytes\", async () => {\n    const randomBytes = new Uint8Array(32);\n    crypto.getRandomValues(randomBytes);\n    const signedData = await signBytes(testKeyPair.keyPair.privateKey, randomBytes);\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signedData, randomBytes);\n\n    expect(isValid).toBe(true);\n  });\n\n  it(\"should return true for valid signature with string message\", async () => {\n    const signature = await signBytes(testKeyPair.keyPair.privateKey, messageBytes);\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signature, testMessage);\n\n    expect(isValid).toBe(true);\n  });\n\n  it(\"should return true for valid signature with Uint8Array message\", async () => {\n    const signature = await signBytes(testKeyPair.keyPair.privateKey, messageBytes);\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signature, messageBytes);\n\n    expect(isValid).toBe(true);\n  });\n\n  it(\"should return false for invalid signature\", async () => {\n    const signature = await signBytes(testKeyPair.keyPair.privateKey, messageBytes);\n    const differentMessage = \"Different message\";\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signature, differentMessage);\n\n    expect(isValid).toBe(false);\n  });\n\n  it(\"should return false for signature from different key pair\", async () => {\n    const differentKeyPair = await generateKeyPairSigner();\n    const signature = await signBytes(differentKeyPair.keyPair.privateKey, messageBytes);\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signature, testMessage);\n\n    expect(isValid).toBe(false);\n  });\n\n  it(\"should handle string signature input\", async () => {\n    const signature = await signBytes(testKeyPair.keyPair.privateKey, messageBytes);\n    const signatureString = getBase58Decoder().decode(signature);\n\n    const isValid = await verifySignatureForAddress(testKeyPair.address, signatureString, testMessage);\n\n    expect(isValid).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/gill/src/__typetests__/create-solana-client.ts",
    "content": "import type {\n  RequestAirdropApi,\n  Rpc,\n  RpcDevnet,\n  RpcMainnet,\n  RpcTestnet,\n  SolanaRpcApi,\n  SolanaRpcApiMainnet,\n} from \"@solana/kit\";\nimport { sendAndConfirmDurableNonceTransactionFactory, sendAndConfirmTransactionFactory } from \"@solana/kit\";\nimport { createSolanaClient } from \"../core\";\n\n// [DESCRIBE] createSolanaClient\n{\n  // Mainnet cluster typechecks when the providing the moniker\n  {\n    const {\n      rpc: mainnetRpc,\n      rpcSubscriptions: mainnetRpcSubscriptions,\n      simulateTransaction,\n    } = createSolanaClient({\n      urlOrMoniker: \"mainnet\",\n    });\n    mainnetRpc satisfies Rpc<SolanaRpcApiMainnet>;\n    mainnetRpc satisfies RpcMainnet<SolanaRpcApiMainnet>;\n    //@ts-expect-error Should not have `requestAirdrop` method\n    mainnetRpc satisfies Rpc<RequestAirdropApi>;\n    //@ts-expect-error Should not be a devnet RPC\n    mainnetRpc satisfies RpcDevnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a testnet RPC\n    mainnetRpc satisfies RpcTestnet<SolanaRpcApi>;\n\n    // should have access to `simulateTransaction`\n    simulateTransaction;\n\n    sendAndConfirmTransactionFactory({\n      rpc: mainnetRpc,\n      rpcSubscriptions: mainnetRpcSubscriptions,\n    });\n    sendAndConfirmDurableNonceTransactionFactory({\n      rpc: mainnetRpc,\n      rpcSubscriptions: mainnetRpcSubscriptions,\n    });\n  }\n\n  // Devnet cluster typechecks when the providing the moniker\n  {\n    const {\n      rpc: devnetRpc,\n      rpcSubscriptions: devnetRpcSubscriptions,\n      simulateTransaction,\n    } = createSolanaClient({\n      urlOrMoniker: \"devnet\",\n    });\n    devnetRpc satisfies Rpc<SolanaRpcApi>;\n    devnetRpc satisfies Rpc<RequestAirdropApi>;\n    devnetRpc satisfies RpcDevnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a testnet RPC\n    devnetRpc satisfies RpcTestnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a mainnet RPC\n    devnetRpc satisfies RpcMainnet<SolanaRpcApiMainnet>;\n\n    // should have access to `simulateTransaction`\n    simulateTransaction;\n\n    sendAndConfirmTransactionFactory({\n      rpc: devnetRpc,\n      rpcSubscriptions: devnetRpcSubscriptions,\n    });\n    sendAndConfirmDurableNonceTransactionFactory({\n      rpc: devnetRpc,\n      rpcSubscriptions: devnetRpcSubscriptions,\n    });\n  }\n\n  // Testnet cluster typechecks when the providing the moniker\n  {\n    const {\n      rpc: testnetRpc,\n      rpcSubscriptions: testnetRpcSubscriptions,\n      simulateTransaction,\n    } = createSolanaClient({\n      urlOrMoniker: \"testnet\",\n    });\n    testnetRpc satisfies Rpc<SolanaRpcApi>;\n    testnetRpc satisfies Rpc<RequestAirdropApi>;\n    testnetRpc satisfies RpcTestnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a devnet RPC\n    testnetRpc satisfies RpcDevnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a mainnet RPC\n    testnetRpc satisfies RpcMainnet<SolanaRpcApiMainnet>;\n\n    // should have access to `simulateTransaction`\n    simulateTransaction;\n\n    sendAndConfirmTransactionFactory({\n      rpc: testnetRpc,\n      rpcSubscriptions: testnetRpcSubscriptions,\n    });\n    sendAndConfirmDurableNonceTransactionFactory({\n      rpc: testnetRpc,\n      rpcSubscriptions: testnetRpcSubscriptions,\n    });\n  }\n\n  // Localnet cluster typechecks when the providing the moniker\n  {\n    const {\n      rpc: localnetRpc,\n      rpcSubscriptions: localnetRpcSubscriptions,\n      simulateTransaction,\n    } = createSolanaClient({\n      urlOrMoniker: \"localnet\",\n    });\n    localnetRpc satisfies Rpc<SolanaRpcApi>;\n    localnetRpc satisfies Rpc<RequestAirdropApi>;\n    //@ts-expect-error Should not be a testnet RPC\n    localnetRpc satisfies RpcTestnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a devnet RPC\n    localnetRpc satisfies RpcDevnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a mainnet RPC\n    localnetRpc satisfies RpcMainnet<SolanaRpcApiMainnet>;\n\n    // should have access to `simulateTransaction`\n    simulateTransaction;\n\n    sendAndConfirmTransactionFactory({\n      rpc: localnetRpc,\n      // @ts-ignore - kit does not yet support `localnet` as a cluster\n      rpcSubscriptions: localnetRpcSubscriptions,\n    });\n    sendAndConfirmDurableNonceTransactionFactory({\n      rpc: localnetRpc,\n      // @ts-ignore - kit does not yet support `localnet` as a cluster\n      rpcSubscriptions: localnetRpcSubscriptions,\n    });\n  }\n\n  // Localnet cluster typechecks when the providing the moniker\n  {\n    const {\n      rpc: genericRpc,\n      rpcSubscriptions: genericRpcSubscriptions,\n      simulateTransaction,\n    } = createSolanaClient({\n      urlOrMoniker: \"https://example-rpc.com\",\n    });\n    genericRpc satisfies Rpc<SolanaRpcApi>;\n    genericRpc satisfies Rpc<RequestAirdropApi>;\n    //@ts-expect-error Should not be a testnet RPC\n    genericRpc satisfies RpcTestnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a devnet RPC\n    genericRpc satisfies RpcDevnet<SolanaRpcApi>;\n    //@ts-expect-error Should not be a mainnet RPC\n    genericRpc satisfies RpcMainnet<SolanaRpcApiMainnet>;\n\n    // should have access to `simulateTransaction`\n    simulateTransaction;\n\n    sendAndConfirmTransactionFactory({\n      rpc: genericRpc,\n      rpcSubscriptions: genericRpcSubscriptions,\n    });\n    sendAndConfirmDurableNonceTransactionFactory({\n      rpc: genericRpc,\n      rpcSubscriptions: genericRpcSubscriptions,\n    });\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/__typetests__/create-token-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type { BaseTransactionMessage, KeyPairSigner, TransactionMessageWithBlockhashLifetime } from \"@solana/kit\";\nimport { signTransactionMessageWithSigners } from \"@solana/kit\";\nimport { GetCreateTokenInstructionsArgs, buildCreateTokenTransaction } from \"../programs/token\";\n\n// [DESCRIBE] buildCreateTokenTransaction\nasync () => {\n  const mint = null as unknown as KeyPairSigner;\n  const signer = null as unknown as KeyPairSigner;\n  const latestBlockhash = null as unknown as TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"];\n  const metadata = {} as unknown as GetCreateTokenInstructionsArgs[\"metadata\"];\n\n  // Legacy transaction\n  {\n    (await buildCreateTokenTransaction({\n      feePayer: signer,\n      mint,\n      metadata,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    (await buildCreateTokenTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      metadata,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    const txSignable = (await buildCreateTokenTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      metadata,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n\n  // Version 0 transaction\n  {\n    (await buildCreateTokenTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      metadata,\n    })) satisfies BaseTransactionMessage<0>;\n\n    const txSignable = (await buildCreateTokenTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      metadata,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<0> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n};\n"
  },
  {
    "path": "packages/gill/src/__typetests__/create-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type {\n  Address,\n  BaseTransactionMessage,\n  Instruction,\n  KeyPairSigner,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionMessageWithFeePayer,\n  TransactionMessageWithFeePayerSigner,\n} from \"@solana/kit\";\nimport { signTransactionMessageWithSigners } from \"@solana/kit\";\n\nimport { createTransaction } from \"../core\";\n\n// [DESCRIBE] createTransaction\n{\n  const feePayer = null as unknown as Address;\n  const signer = null as unknown as KeyPairSigner;\n  const latestBlockhash = null as unknown as TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"];\n\n  const ix = null as unknown as Instruction;\n\n  // Legacy transactions\n  {\n    createTransaction({\n      // version: \"legacy\", // no `version` set should result in a legacy transaction\n      feePayer: feePayer,\n      instructions: [ix],\n      computeUnitLimit: 0,\n      computeUnitPrice: 0,\n    }) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithFeePayer;\n\n    createTransaction({\n      version: \"legacy\",\n      feePayer: feePayer,\n      instructions: [ix],\n      computeUnitLimit: 0,\n      computeUnitPrice: 0,\n    }) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithFeePayer;\n\n    createTransaction({\n      version: \"legacy\",\n      feePayer: signer,\n      instructions: [ix],\n    }) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithFeePayerSigner;\n\n    createTransaction({\n      version: \"legacy\",\n      feePayer: feePayer,\n      instructions: [ix],\n      // @ts-expect-error Should not have a Lifetime\n    }) satisfies TransactionMessageWithBlockhashLifetime;\n\n    // Should be legacy with a Lifetime and Signer\n    createTransaction({\n      version: \"legacy\",\n      feePayer: signer,\n      instructions: [ix],\n      latestBlockhash,\n    }) satisfies BaseTransactionMessage<\"legacy\"> &\n      TransactionMessageWithBlockhashLifetime &\n      TransactionMessageWithFeePayerSigner;\n\n    createTransaction({\n      // version: \"legacy\", // no `version` set should result in a legacy transaction\n      feePayer: signer,\n      instructions: [ix],\n      latestBlockhash,\n    }) satisfies BaseTransactionMessage<\"legacy\"> &\n      TransactionMessageWithBlockhashLifetime &\n      TransactionMessageWithFeePayerSigner;\n\n    // Should be legacy with a Lifetime and address (aka non Signer)\n    const txSignable = createTransaction({\n      version: \"legacy\",\n      feePayer: feePayer,\n      instructions: [ix],\n      latestBlockhash,\n    }) satisfies BaseTransactionMessage<\"legacy\"> &\n      TransactionMessageWithBlockhashLifetime &\n      TransactionMessageWithFeePayer;\n\n    createTransaction({\n      version: \"legacy\",\n      feePayer: feePayer,\n      instructions: [ix],\n      latestBlockhash,\n      // @ts-expect-error Should not be a \"fee payer signer\"\n    }) satisfies TransactionMessageWithFeePayerSigner;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n\n  // Version 0 transactions\n  {\n    createTransaction({\n      version: 0,\n      feePayer: feePayer,\n      instructions: [ix],\n      computeUnitLimit: 0,\n      computeUnitPrice: 0,\n    }) satisfies BaseTransactionMessage<0> & TransactionMessageWithFeePayer;\n\n    createTransaction({\n      version: 0,\n      feePayer: signer,\n      instructions: [ix],\n    }) satisfies BaseTransactionMessage<0> & TransactionMessageWithFeePayerSigner;\n\n    createTransaction({\n      version: 0,\n      feePayer: signer,\n      instructions: [ix],\n      // @ts-expect-error Should not have a Lifetime\n    }) satisfies TransactionMessageWithBlockhashLifetime;\n\n    // Should be version 0 with a Lifetime and Signer\n    createTransaction({\n      version: 0,\n      feePayer: signer,\n      instructions: [ix],\n      latestBlockhash,\n    }) satisfies BaseTransactionMessage<0> &\n      TransactionMessageWithBlockhashLifetime &\n      TransactionMessageWithFeePayerSigner;\n\n    // Should be version 0 with a Lifetime and address (aka non Signer)\n    const txSignable = createTransaction({\n      version: 0,\n      feePayer: feePayer,\n      instructions: [ix],\n      latestBlockhash,\n    }) satisfies BaseTransactionMessage<0> & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayer;\n\n    createTransaction({\n      version: 0,\n      feePayer: feePayer,\n      instructions: [ix],\n      latestBlockhash,\n      // @ts-expect-error Should not be a \"fee payer signer\"\n    }) satisfies TransactionMessageWithFeePayerSigner;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/__typetests__/mint-tokens-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n  Address,\n  KeyPairSigner,\n  BaseTransactionMessage,\n  TransactionMessageWithBlockhashLifetime,\n} from \"@solana/kit\";\nimport { signTransactionMessageWithSigners } from \"@solana/kit\";\nimport { buildMintTokensTransaction } from \"../programs/token\";\n\n// [DESCRIBE] buildMintTokensTransaction\nasync () => {\n  const signer = null as unknown as KeyPairSigner;\n  const latestBlockhash = null as unknown as TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"];\n\n  const mint = null as unknown as KeyPairSigner;\n  const destination = null as unknown as Address;\n  const ata = null as unknown as Address;\n  const mintAuthority = null as unknown as KeyPairSigner;\n\n  // Legacy transaction\n  {\n    (await buildMintTokensTransaction({\n      feePayer: signer,\n      mint,\n      destination,\n      amount: 0,\n      ata,\n      mintAuthority,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    (await buildMintTokensTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      destination,\n      amount: 0n,\n      ata,\n      mintAuthority,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    const txSignable = (await buildMintTokensTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      destination,\n      amount: 0,\n      ata,\n      mintAuthority,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n\n  // Version 0 transaction\n  {\n    (await buildMintTokensTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      destination,\n      amount: 0,\n      ata,\n      mintAuthority,\n    })) satisfies BaseTransactionMessage<0>;\n\n    const txSignable = (await buildMintTokensTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      destination,\n      amount: 0n,\n      ata,\n      mintAuthority,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<0> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n};\n"
  },
  {
    "path": "packages/gill/src/__typetests__/prepare-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n  BaseTransactionMessage,\n  TransactionMessageWithFeePayer,\n  Rpc,\n  SolanaRpcApi,\n  TransactionMessageWithBlockhashLifetime,\n} from \"@solana/kit\";\nimport { signTransactionMessageWithSigners } from \"@solana/kit\";\nimport { prepareTransaction } from \"../core\";\n\n// [DESCRIBE] prepareTransaction\nasync () => {\n  const rpc = null as unknown as Rpc<SolanaRpcApi>;\n\n  const transactionWithoutBlockhash = null as unknown as BaseTransactionMessage<\"legacy\"> &\n    TransactionMessageWithFeePayer;\n\n  const transactionWithBlockhash = null as unknown as BaseTransactionMessage<\"legacy\"> &\n    TransactionMessageWithFeePayer &\n    TransactionMessageWithBlockhashLifetime;\n\n  // @ts-expect-error Base transaction should not be a signable\n  signTransactionMessageWithSigners(transaction);\n\n  signTransactionMessageWithSigners(transactionWithBlockhash);\n\n  // Supports input transactions without a blockhash\n  {\n    const newTx = await prepareTransaction({\n      rpc,\n      transaction: transactionWithoutBlockhash,\n    });\n\n    signTransactionMessageWithSigners(newTx);\n  }\n\n  // Supports input transactions with a blockhash\n  {\n    const newTx = await prepareTransaction({\n      rpc,\n      transaction: transactionWithBlockhash,\n    });\n\n    signTransactionMessageWithSigners(newTx);\n  }\n};\n"
  },
  {
    "path": "packages/gill/src/__typetests__/send-and-confirm-transaction-with-signers-typetests.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n  GetEpochInfoApi,\n  GetLatestBlockhashApi,\n  GetSignatureStatusesApi,\n  Instruction,\n  Rpc,\n  RpcDevnet,\n  RpcMainnet,\n  RpcSubscriptions,\n  RpcSubscriptionsDevnet,\n  RpcSubscriptionsMainnet,\n  RpcSubscriptionsTestnet,\n  RpcTestnet,\n  SendTransactionApi,\n  SignatureNotificationsApi,\n  signTransactionMessageWithSigners,\n  SlotNotificationsApi,\n  TransactionSigner,\n  TransactionWithBlockhashLifetime,\n  TransactionWithDurableNonceLifetime,\n} from \"@solana/kit\";\nimport { createTransaction } from \"../core\";\nimport { sendAndConfirmTransactionWithSignersFactory } from \"../core/send-and-confirm-transaction-with-signers\";\n\nconst rpc = null as unknown as Rpc<\n  GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi\n>;\nconst rpcDevnet = null as unknown as RpcDevnet<\n  GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi\n>;\nconst rpcTestnet = null as unknown as RpcTestnet<\n  GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi\n>;\nconst rpcMainnet = null as unknown as RpcMainnet<\n  GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi\n>;\n\nconst rpcSubscriptions = null as unknown as RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>;\nconst rpcSubscriptionsDevnet = null as unknown as RpcSubscriptionsDevnet<\n  SignatureNotificationsApi & SlotNotificationsApi\n>;\nconst rpcSubscriptionsMainnet = null as unknown as RpcSubscriptionsMainnet<\n  SignatureNotificationsApi & SlotNotificationsApi\n>;\nconst rpcSubscriptionsTestnet = null as unknown as RpcSubscriptionsTestnet<\n  SignatureNotificationsApi & SlotNotificationsApi\n>;\n\nconst signer = \"\" as unknown as TransactionSigner;\nconst instruction = \"\" as unknown as Instruction;\nconst latestBlockhash = \"\" as unknown as ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n\n// [DESCRIBE] sendAndConfirmTransactionWithSignersFactory\n{\n  {\n    // It typechecks when the RPC clusters match.\n    sendAndConfirmTransactionWithSignersFactory({ rpc, rpcSubscriptions });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcDevnet, rpcSubscriptions: rpcSubscriptionsDevnet });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcTestnet, rpcSubscriptions: rpcSubscriptionsTestnet });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcMainnet, rpcSubscriptions: rpcSubscriptionsMainnet });\n  }\n  {\n    // It typechecks when either RPC is generic.\n    sendAndConfirmTransactionWithSignersFactory({ rpc, rpcSubscriptions });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcDevnet, rpcSubscriptions });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcTestnet, rpcSubscriptions });\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcMainnet, rpcSubscriptions });\n  }\n  {\n    // It fails to typecheck when explicit RPC clusters mismatch.\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcDevnet, rpcSubscriptions: rpcSubscriptionsTestnet });\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcDevnet, rpcSubscriptions: rpcSubscriptionsMainnet });\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcTestnet, rpcSubscriptions: rpcSubscriptionsMainnet });\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcTestnet, rpcSubscriptions: rpcSubscriptionsDevnet });\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcMainnet, rpcSubscriptions: rpcSubscriptionsDevnet });\n    // @ts-expect-error\n    sendAndConfirmTransactionWithSignersFactory({ rpc: rpcMainnet, rpcSubscriptions: rpcSubscriptionsTestnet });\n  }\n\n  {\n    const sendAndConfirmTransaction = sendAndConfirmTransactionWithSignersFactory({ rpc, rpcSubscriptions });\n\n    const signedTransactionWithBlockhashLifetime = \"\" as unknown as Awaited<\n      ReturnType<typeof signTransactionMessageWithSigners>\n    > &\n      TransactionWithBlockhashLifetime;\n\n    // Should accept a signed transaction with a blockhash based lifetime\n    sendAndConfirmTransaction(signedTransactionWithBlockhashLifetime);\n\n    const signedTransactionWithNonceLifetime = \"\" as unknown as Awaited<\n      ReturnType<typeof signTransactionMessageWithSigners>\n    > &\n      TransactionWithDurableNonceLifetime;\n\n    // todo: add support for nonce based transactions\n    sendAndConfirmTransaction(signedTransactionWithNonceLifetime);\n\n    // Should accept a legacy transaction, with or without a latest blockhash\n    {\n      const transactionWithoutLatestBlockhash = createTransaction({\n        version: \"legacy\",\n        feePayer: signer,\n        instructions: [instruction],\n      });\n\n      const transactionWithLatestBlockhash = createTransaction({\n        version: \"legacy\",\n        feePayer: signer,\n        instructions: [instruction],\n        latestBlockhash,\n      });\n\n      // Should accept a signable transaction WITHOUT the latest blockhash\n      sendAndConfirmTransaction(transactionWithoutLatestBlockhash);\n\n      // Should accept a signable transaction WITH the latest blockhash\n      sendAndConfirmTransaction(transactionWithLatestBlockhash);\n    }\n\n    // Should accept a versioned transaction, with or without a latest blockhash\n    {\n      const transactionWithoutLatestBlockhash = createTransaction({\n        version: 0,\n        feePayer: signer,\n        instructions: [instruction],\n      });\n\n      const transactionWithLatestBlockhash = createTransaction({\n        version: 0,\n        feePayer: signer,\n        instructions: [instruction],\n        latestBlockhash,\n      });\n\n      // Should accept a signable transaction WITHOUT the latest blockhash\n      sendAndConfirmTransaction(transactionWithoutLatestBlockhash);\n\n      // Should accept a signable transaction WITH the latest blockhash\n      sendAndConfirmTransaction(transactionWithLatestBlockhash);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/__typetests__/simulate-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n  FullySignedTransaction,\n  Rpc,\n  RpcDevnet,\n  RpcMainnet,\n  RpcTestnet,\n  SimulateTransactionApi,\n  Transaction,\n  TransactionMessage,\n  TransactionMessageWithFeePayer,\n} from \"@solana/kit\";\nimport { simulateTransactionFactory } from \"../core/simulate-transaction\";\n\nconst rpc = null as unknown as Rpc<SimulateTransactionApi>;\nconst rpcDevnet = null as unknown as RpcDevnet<SimulateTransactionApi>;\nconst rpcTestnet = null as unknown as RpcTestnet<SimulateTransactionApi>;\nconst rpcMainnet = null as unknown as RpcMainnet<SimulateTransactionApi>;\n\nconst baseTransaction = null as unknown as Transaction;\nconst compilableTransaction = null as unknown as TransactionMessage & TransactionMessageWithFeePayer;\nconst signedTransaction = null as unknown as Transaction & FullySignedTransaction;\n\n// [DESCRIBE] simulateTransactionFactory\n{\n  {\n    // It typechecks when either RPC is generic.\n    simulateTransactionFactory({ rpc });\n    // It typechecks when the RPC clusters match.\n    simulateTransactionFactory({ rpc: rpcDevnet });\n    simulateTransactionFactory({ rpc: rpcTestnet });\n    simulateTransactionFactory({ rpc: rpcMainnet });\n  }\n  {\n    const simulateTransaction = simulateTransactionFactory({ rpc });\n\n    // It can accept a compilable transaction\n    simulateTransaction(compilableTransaction);\n    simulateTransaction(baseTransaction);\n\n    // It can accepted a signed transaction\n    simulateTransaction(signedTransaction);\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/__typetests__/transfer-tokens-transaction.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\n\nimport type {\n  Address,\n  BaseTransactionMessage,\n  KeyPairSigner,\n  TransactionMessageWithBlockhashLifetime,\n} from \"@solana/kit\";\nimport { signTransactionMessageWithSigners } from \"@solana/kit\";\nimport { buildTransferTokensTransaction } from \"../programs/token\";\n\n// [DESCRIBE] buildTransferTokensTransaction\nasync () => {\n  const signer = null as unknown as KeyPairSigner;\n  const latestBlockhash = null as unknown as TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"];\n\n  const mint = null as unknown as KeyPairSigner;\n  const destination = null as unknown as Address;\n  const authority = null as unknown as KeyPairSigner;\n\n  // Legacy transaction\n  {\n    (await buildTransferTokensTransaction({\n      feePayer: signer,\n      mint,\n      destination,\n      amount: 0,\n      authority,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    (await buildTransferTokensTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      destination,\n      amount: 0n,\n      authority,\n    })) satisfies BaseTransactionMessage<\"legacy\">;\n\n    const txSignable = (await buildTransferTokensTransaction({\n      feePayer: signer,\n      version: \"legacy\",\n      mint,\n      destination,\n      amount: 0,\n      authority,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<\"legacy\"> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n\n  // Version 0 transaction\n  {\n    (await buildTransferTokensTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      destination,\n      amount: 0,\n      authority,\n    })) satisfies BaseTransactionMessage<0>;\n\n    const txSignable = (await buildTransferTokensTransaction({\n      feePayer: signer,\n      version: 0,\n      mint,\n      destination,\n      amount: 0n,\n      authority,\n      latestBlockhash,\n    })) satisfies BaseTransactionMessage<0> & TransactionMessageWithBlockhashLifetime;\n\n    // Should be a signable transaction\n    signTransactionMessageWithSigners(txSignable);\n  }\n};\n"
  },
  {
    "path": "packages/gill/src/core/base64-bytes-to.ts",
    "content": "import type { Address, Signature } from \"@solana/kit\";\nimport { assertIsAddress, assertIsSignature, getBase58Decoder, getBase64Encoder } from \"@solana/kit\";\n\n/**\n * Takes a base64 encoded string of a byte array, parses, then asserts it as an {@link Address}\n */\nexport function base64BytesToAddress(base64Bytes: string): Address {\n  const maybeAddress = getBase58Decoder().decode(getBase64Encoder().encode(base64Bytes));\n  assertIsAddress(maybeAddress);\n  return maybeAddress;\n}\n\n/**\n * Takes a base64 encoded string of a byte array, parses, then asserts it as an {@link Signature}\n */\nexport function base64BytesToSignature(base64Bytes: string): Signature {\n  const maybeSignature = getBase58Decoder().decode(getBase64Encoder().encode(base64Bytes));\n  assertIsSignature(maybeSignature);\n  return maybeSignature;\n}\n\n/**\n * Takes a base64 encoded string of a byte array, parses, then returns as a utf8 string\n */\nexport function base64BytesToString(base64Bytes: string): string {\n  return new TextDecoder().decode(getBase64Encoder().encode(base64Bytes));\n}\n"
  },
  {
    "path": "packages/gill/src/core/base64-from-transaction.ts",
    "content": "import { getBase64Encoder, getTransactionDecoder, type Transaction } from \"@solana/kit\";\nimport type { transactionToBase64, transactionToBase64WithSigners } from \"./base64-to-transaction\";\n\n/**\n * Convert a base64 encoded transaction string into compiled transaction\n *\n * Use {@link transactionToBase64} or {@link transactionToBase64WithSigners} to create the base64 encoded transaction string\n */\nexport function transactionFromBase64(base64EncodedTransaction: string): Transaction {\n  return getTransactionDecoder().decode(getBase64Encoder().encode(base64EncodedTransaction));\n}\n"
  },
  {
    "path": "packages/gill/src/core/base64-to-transaction.ts",
    "content": "import type {\n  Base64EncodedWireTransaction,\n  TransactionMessage,\n  TransactionMessageWithFeePayer,\n  Transaction,\n} from \"@solana/kit\";\nimport {\n  compileTransaction,\n  getBase64EncodedWireTransaction,\n  partiallySignTransactionMessageWithSigners,\n  pipe,\n} from \"@solana/kit\";\n\n/**\n * Compile a transaction to a base64 string\n *\n * Note: This will NOT attempt to sign the transaction,\n * so it will be missing `signatures` from any of the attached Signers\n *\n * Use {@link transactionToBase64WithSignatures} sign and base64 encode\n */\nexport function transactionToBase64(\n  tx: (TransactionMessage & TransactionMessageWithFeePayer) | Transaction,\n): Base64EncodedWireTransaction {\n  if (\"messageBytes\" in tx) return pipe(tx, getBase64EncodedWireTransaction);\n  else return pipe(tx, compileTransaction, getBase64EncodedWireTransaction);\n}\n\n/**\n * Compile a transaction to a base64 string and sign it with all attached Signers\n *\n * See also {@link partiallySignTransactionMessageWithSigners}\n */\nexport async function transactionToBase64WithSigners(\n  tx: (TransactionMessage & TransactionMessageWithFeePayer) | Transaction,\n): Promise<Base64EncodedWireTransaction> {\n  if (\"messageBytes\" in tx) return transactionToBase64(tx);\n  else return transactionToBase64(await partiallySignTransactionMessageWithSigners(tx));\n}\n"
  },
  {
    "path": "packages/gill/src/core/const.ts",
    "content": "/** 1 billion lamports per SOL */\nexport const LAMPORTS_PER_SOL = 1_000_000_000;\n\n/**\n * Genesis hash for Solana network clusters\n */\nexport const GENESIS_HASH = {\n  mainnet: \"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d\",\n  devnet: \"EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG\",\n  testnet: \"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY\",\n};\n"
  },
  {
    "path": "packages/gill/src/core/create-codama-config.ts",
    "content": "/**\n * Codama dependency map to utilize gill imports\n */\nexport const GILL_EXTERNAL_MODULE_MAP: Record<string, string> = {\n  solanaAccounts: \"gill\",\n  solanaAddresses: \"gill\",\n  solanaCodecsCore: \"gill\",\n  solanaCodecsDataStructures: \"gill\",\n  solanaCodecsNumbers: \"gill\",\n  solanaCodecsStrings: \"gill\",\n  solanaErrors: \"gill\",\n  solanaInstructions: \"gill\",\n  solanaOptions: \"gill\",\n  solanaPrograms: \"gill\",\n  solanaRpcTypes: \"gill\",\n  solanaSigners: \"gill\",\n};\n\n/**\n * Create a Codama CLI configuration to generate a program client from an IDL.\n * Normally saved to `codama.js`.\n *\n * @example\n * ```ts\n * import { createCodamaConfig } from \"gill\";\n *\n * export default createCodamaConfig({\n *  idl: \"program/idl.json\",\n *  clientJs: \"clients/js/src/generated\",\n *  // clientRust: \"clients/rust/src/generated\",\n * });\n * ```\n */\nexport function createCodamaConfig({\n  idl,\n  clientJs,\n  clientRust,\n  dependencyMap = GILL_EXTERNAL_MODULE_MAP,\n}: {\n  idl: string;\n  clientJs: string;\n  clientRust?: string;\n  dependencyMap?: Record<string, string>;\n}) {\n  return {\n    idl,\n    scripts: {\n      js: {\n        args: [clientJs, { dependencyMap }],\n        from: \"@codama/renderers-js\",\n      },\n      ...(clientRust && {\n        rust: {\n          from: \"@codama/renderers-rust\",\n          args: [\n            clientRust,\n            {\n              crateFolder: \"clients/rust\",\n              formatCode: true,\n            },\n          ],\n        },\n      }),\n    },\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/core/create-solana-client.ts",
    "content": "import type { DevnetUrl, MainnetUrl, TestnetUrl } from \"@solana/kit\";\nimport { createSolanaRpc, createSolanaRpcSubscriptions } from \"@solana/kit\";\n\nimport type { CreateSolanaClientArgs, LocalnetUrl, ModifiedClusterUrl, SolanaClient } from \"../types/rpc\";\nimport { getPublicSolanaRpcUrl } from \"./rpc\";\nimport { sendAndConfirmTransactionWithSignersFactory } from \"./send-and-confirm-transaction-with-signers\";\nimport { simulateTransactionFactory } from \"./simulate-transaction\";\n\n/**\n * Create a Solana `rpc` and `rpcSubscriptions` client\n */\nexport function createSolanaClient(\n  props: Omit<CreateSolanaClientArgs<MainnetUrl | \"mainnet\">, \"urlOrMoniker\"> & {\n    urlOrMoniker: \"mainnet\";\n  },\n): SolanaClient<MainnetUrl>;\nexport function createSolanaClient(\n  props: Omit<CreateSolanaClientArgs<DevnetUrl | \"devnet\">, \"urlOrMoniker\"> & {\n    urlOrMoniker: \"devnet\";\n  },\n): SolanaClient<DevnetUrl>;\nexport function createSolanaClient(\n  props: Omit<CreateSolanaClientArgs<TestnetUrl | \"testnet\">, \"urlOrMoniker\"> & {\n    urlOrMoniker: \"testnet\";\n  },\n): SolanaClient<TestnetUrl>;\nexport function createSolanaClient(\n  props: Omit<CreateSolanaClientArgs<LocalnetUrl | \"localnet\">, \"urlOrMoniker\"> & {\n    urlOrMoniker: \"localnet\";\n  },\n): SolanaClient<LocalnetUrl>;\nexport function createSolanaClient<TClusterUrl extends ModifiedClusterUrl>(\n  props: CreateSolanaClientArgs<TClusterUrl>,\n): SolanaClient<TClusterUrl>;\nexport function createSolanaClient<TCluster extends ModifiedClusterUrl>({\n  urlOrMoniker,\n  rpcConfig,\n  rpcSubscriptionsConfig,\n}: CreateSolanaClientArgs<TCluster>) {\n  if (!urlOrMoniker) throw new Error(\"Cluster url or moniker is required\");\n  if (urlOrMoniker instanceof URL == false) {\n    try {\n      urlOrMoniker = new URL(urlOrMoniker.toString());\n    } catch (err) {\n      try {\n        urlOrMoniker = new URL(getPublicSolanaRpcUrl(urlOrMoniker.toString() as any));\n      } catch (err) {\n        throw new Error(\"Invalid URL or cluster moniker\");\n      }\n    }\n  }\n\n  if (!urlOrMoniker.protocol.match(/^https?/i)) {\n    throw new Error(\"Unsupported protocol. Only HTTP and HTTPS are supported\");\n  }\n\n  if (rpcConfig?.port) {\n    urlOrMoniker.port = rpcConfig.port.toString();\n  }\n\n  const rpc = createSolanaRpc<TCluster>(urlOrMoniker.toString() as TCluster, rpcConfig);\n\n  urlOrMoniker.protocol = urlOrMoniker.protocol.replace(\"http\", \"ws\");\n\n  if (rpcSubscriptionsConfig?.port) {\n    urlOrMoniker.port = rpcSubscriptionsConfig.port.toString();\n  } else if (urlOrMoniker.hostname == \"localhost\" || urlOrMoniker.hostname.startsWith(\"127\")) {\n    urlOrMoniker.port = \"8900\";\n  }\n\n  const rpcSubscriptions = createSolanaRpcSubscriptions<TCluster>(\n    urlOrMoniker.toString() as TCluster,\n    rpcSubscriptionsConfig,\n  );\n\n  return {\n    rpc,\n    rpcSubscriptions,\n    sendAndConfirmTransaction: sendAndConfirmTransactionWithSignersFactory({\n      // @ts-ignore - TODO(FIXME:nick)\n      rpc,\n      // @ts-ignore - TODO(FIXME:nick)\n      rpcSubscriptions,\n    }),\n    // @ts-ignore\n    simulateTransaction: simulateTransactionFactory({ rpc }),\n    urlOrMoniker: urlOrMoniker.toString() as TCluster,\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/core/create-transaction.ts",
    "content": "import { getSetComputeUnitLimitInstruction, getSetComputeUnitPriceInstruction } from \"@solana-program/compute-budget\";\nimport type {\n  Address,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionMessageWithFeePayer,\n  TransactionMessageWithFeePayerSigner,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\nimport {\n  appendTransactionMessageInstruction,\n  appendTransactionMessageInstructions,\n  createTransactionMessage,\n  isTransactionSigner,\n  pipe,\n  setTransactionMessageFeePayer,\n  setTransactionMessageFeePayerSigner,\n  setTransactionMessageLifetimeUsingBlockhash,\n} from \"@solana/kit\";\nimport type { Simplify } from \"../types\";\nimport type { CreateTransactionInput, FullTransaction } from \"../types/transactions\";\n\n/**\n * Simple interface for creating a Solana transaction\n */\nexport function createTransaction<TVersion extends TransactionVersion | \"auto\", TFeePayer extends TransactionSigner>(\n  props: CreateTransactionInput<TVersion, TFeePayer>,\n): FullTransaction<TVersion extends \"auto\" ? TransactionVersion : TVersion, TransactionMessageWithFeePayerSigner>;\nexport function createTransaction<TVersion extends TransactionVersion | \"auto\", TFeePayer extends Address>(\n  props: CreateTransactionInput<TVersion, TFeePayer>,\n): FullTransaction<TVersion extends \"auto\" ? TransactionVersion : TVersion, TransactionMessageWithFeePayer>;\nexport function createTransaction<\n  TVersion extends TransactionVersion | \"auto\",\n  TFeePayer extends TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  props: CreateTransactionInput<TVersion, TFeePayer, TLifetimeConstraint>,\n): Simplify<\n  FullTransaction<\n    TVersion extends \"auto\" ? TransactionVersion : TVersion,\n    TransactionMessageWithFeePayerSigner,\n    TransactionMessageWithBlockhashLifetime\n  >\n>;\nexport function createTransaction<\n  TVersion extends TransactionVersion | \"auto\",\n  TFeePayer extends Address,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  props: CreateTransactionInput<TVersion, TFeePayer, TLifetimeConstraint>,\n): Simplify<\n  FullTransaction<\n    TVersion extends \"auto\" ? TransactionVersion : TVersion,\n    TransactionMessageWithFeePayer,\n    TransactionMessageWithBlockhashLifetime\n  >\n>;\nexport function createTransaction<\n  TVersion extends TransactionVersion | \"auto\",\n  TFeePayer extends Address | TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  props: CreateTransactionInput<TVersion, TFeePayer, TLifetimeConstraint>,\n): Simplify<\n  FullTransaction<\n    TVersion extends \"auto\" ? TransactionVersion : TVersion,\n    TransactionMessageWithFeePayer,\n    TransactionMessageWithBlockhashLifetime\n  >\n>;\nexport function createTransaction<\n  TVersion extends TransactionVersion | \"auto\",\n  TFeePayer extends Address | TransactionSigner,\n>({\n  version,\n  feePayer,\n  instructions,\n  latestBlockhash,\n  computeUnitLimit,\n  computeUnitPrice,\n}: CreateTransactionInput<TVersion, TFeePayer>): FullTransaction<\n  TVersion extends \"auto\" ? TransactionVersion : TVersion,\n  TransactionMessageWithFeePayer | TransactionMessageWithFeePayerSigner\n> {\n  return pipe(\n    // Auto-select version: if any provided instruction appears to use an Address Lookup Table (ALT),\n    // choose `0`. Otherwise default to `legacy`. If the caller explicitly provides `version`, use it.\n    (() => {\n      let selectedVersion: TransactionVersion;\n\n      if (version === undefined || version === \"auto\") {\n        selectedVersion = instructions.some(\n          (ix) =>\n            (\"addressTableLookup\" in ix && ix.addressTableLookup != null) ||\n            (\"addressTableLookups\" in ix && Array.isArray(ix.addressTableLookups) && ix.addressTableLookups.length > 0),\n        )\n          ? 0\n          : \"legacy\";\n      } else {\n        selectedVersion = version;\n      }\n\n      return createTransactionMessage({ version: selectedVersion });\n    })(),\n    (tx) => {\n      const withLifetime = latestBlockhash ? setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx) : tx;\n      if (typeof feePayer !== \"string\" && \"address\" in feePayer && isTransactionSigner(feePayer)) {\n        return setTransactionMessageFeePayerSigner(feePayer, withLifetime);\n      } else return setTransactionMessageFeePayer(feePayer, withLifetime);\n    },\n    (tx) => {\n      const withComputeLimit =\n        typeof computeUnitLimit !== \"undefined\"\n          ? appendTransactionMessageInstruction(\n              getSetComputeUnitLimitInstruction({ units: Number(computeUnitLimit) }),\n              tx,\n            )\n          : tx;\n\n      const withComputePrice =\n        typeof computeUnitPrice !== \"undefined\"\n          ? appendTransactionMessageInstruction(\n              getSetComputeUnitPriceInstruction({ microLamports: Number(computeUnitPrice) }),\n              withComputeLimit,\n            )\n          : withComputeLimit;\n\n      return appendTransactionMessageInstructions(instructions, withComputePrice);\n    },\n  ) as FullTransaction<\n    TVersion extends \"auto\" ? TransactionVersion : TVersion,\n    TransactionMessageWithFeePayer | TransactionMessageWithFeePayerSigner\n  >;\n}\n"
  },
  {
    "path": "packages/gill/src/core/debug.ts",
    "content": "/**\n *\n */\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst GILL_LOG_LEVELS: Record<LogLevel, number> = {\n  debug: 0,\n  info: 1,\n  warn: 2,\n  error: 3,\n};\n\ndeclare global {\n  /**\n   * Whether or not to enable debug mode. When enabled, default log level of `info`\n   */\n  var __GILL_DEBUG__: boolean | undefined;\n  /**\n   * Set the a desired level of logs to be output in the application\n   *\n   * - Default: `info`\n   * - Options: `debug` | `info` | `warn` | `error`\n   */\n  var __GILL_DEBUG_LEVEL__: LogLevel | undefined;\n}\n\nconst getMinLogLevel = (): LogLevel =>\n  (process.env.GILL_DEBUG_LEVEL as LogLevel) ||\n  global.__GILL_DEBUG_LEVEL__ ||\n  (typeof window !== \"undefined\" && (window as any).__GILL_DEBUG_LEVEL__) ||\n  \"info\";\n\n/**\n * Check if the `gill` debug logger is enabled or not\n */\nexport const isDebugEnabled = (): boolean =>\n  Boolean(\n    process.env.GILL_DEBUG_LEVEL ||\n      global.__GILL_DEBUG_LEVEL__ ||\n      process.env.GILL_DEBUG === \"true\" ||\n      process.env.GILL_DEBUG === \"1\" ||\n      global.__GILL_DEBUG__ === true ||\n      (typeof window !== \"undefined\" && (window as any).__GILL_DEBUG__ === true),\n  );\n\n/**\n * Log debug messages based on the desired application's logging level.\n *\n * @param message - the message contents to be logged\n * @param level - default: `info` (see: {@link GILL_LOG_LEVELS})\n * @param prefix - default: `[GILL]`\n *\n * To enable gill's debug logger, set any of the following to `true`:\n * - `process.env.GILL_DEBUG`\n * - `global.__GILL_DEBUG__`\n * - `window.__GILL_DEBUG__`\n *\n * To set a desired level of logs to be output in the application, set the value of one of the following:\n * - `process.env.GILL_DEBUG_LEVEL`\n * - `global.__GILL_DEBUG_LEVEL__`\n * - `window.__GILL_DEBUG_LEVEL__`\n */\nexport function debug(message: unknown, level: LogLevel = \"info\", prefix: string = \"[GILL]\") {\n  if (!isDebugEnabled()) return;\n\n  if (GILL_LOG_LEVELS[level] < GILL_LOG_LEVELS[getMinLogLevel()]) return;\n\n  const formattedMessage = typeof message === \"string\" ? message : JSON.stringify(message, null, 2);\n\n  switch (level) {\n    case \"debug\":\n      console.log(prefix, formattedMessage);\n      break;\n    case \"info\":\n      console.info(prefix, formattedMessage);\n      break;\n    case \"warn\":\n      console.warn(prefix, formattedMessage);\n      break;\n    case \"error\":\n      console.error(prefix, formattedMessage);\n      break;\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/core/explorer.ts",
    "content": "import type { GetExplorerLinkArgs } from \"../types\";\n\n/**\n * Craft a Solana Explorer link on any cluster\n */\nexport function getExplorerLink(props: GetExplorerLinkArgs = {}): string {\n  let url = new URL(\"https://explorer.solana.com\");\n\n  // default to mainnet / mainnet-beta\n  if (!props.cluster || props.cluster == \"mainnet\") props.cluster = \"mainnet-beta\";\n\n  if (\"address\" in props) {\n    url.pathname = `/address/${props.address}`;\n  } else if (\"transaction\" in props) {\n    url.pathname = `/tx/${props.transaction}`;\n  } else if (\"block\" in props) {\n    url.pathname = `/block/${props.block}`;\n  }\n\n  if (props.cluster !== \"mainnet-beta\") {\n    if (props.cluster === \"localnet\" || props.cluster === \"localhost\") {\n      // localnet technically isn't a cluster, so requires special handling\n      url.searchParams.set(\"cluster\", \"custom\");\n      url.searchParams.set(\"customUrl\", \"http://localhost:8899\");\n    } else {\n      url.searchParams.set(\"cluster\", props.cluster);\n    }\n  }\n\n  return url.toString();\n}\n"
  },
  {
    "path": "packages/gill/src/core/get-oldest-signature.ts",
    "content": "import type { Simplify } from \"../types/index\";\n\nimport type { Address, GetSignaturesForAddressApi, Rpc } from \"@solana/kit\";\nimport { isSolanaError, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN, SolanaError } from \"@solana/kit\";\n\ntype GetOldestSignatureForAddressRpc<TCluster> = Rpc<GetSignaturesForAddressApi> & {\n  \"~cluster\"?: TCluster;\n};\n\ntype GetOldestSignatureForAddressConfig = Simplify<\n  Parameters<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>[1]\n> & { abortSignal?: AbortSignal };\n\n/**\n * Get the oldest signature for the provided `address`\n */\nexport async function getOldestSignatureForAddress<TCluster>(\n  rpc: GetOldestSignatureForAddressRpc<TCluster>,\n  address: Address,\n  config?: GetOldestSignatureForAddressConfig,\n): Promise<ReturnType<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>[0]> {\n  const signatures = await rpc.getSignaturesForAddress(address, config).send({ abortSignal: config?.abortSignal });\n\n  if (!signatures.length) {\n    throw new SolanaError(SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN, {\n      errorName: \"OldestSignatureNotFound\",\n    });\n  }\n\n  const oldest = signatures[signatures.length - 1];\n  if (signatures.length < (config?.limit || 1000)) return oldest;\n\n  try {\n    // if signatures are found to the limit, recurse for find the oldest\n    return await getOldestSignatureForAddress(rpc, address, { ...config, before: oldest.signature });\n  } catch (err) {\n    // if signatures found were exactly at the limit, there will be no more to find, so we return the oldest\n    if (isSolanaError(err, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN)) return oldest;\n    throw err;\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/core/get-signature-from-bytes.ts",
    "content": "import type { Signature, SignatureBytes } from \"@solana/kit\";\nimport { getBase58Decoder } from \"@solana/kit\";\n\n/**\n * Converts signature bytes to a {@link Signature} string.\n * @param sigBytes - The signature bytes to convert\n * @returns The base58-encoded signature string\n */\nexport function getSignatureFromBytes(sigBytes: SignatureBytes): Signature {\n  return getBase58Decoder().decode(sigBytes) as Signature;\n}\n"
  },
  {
    "path": "packages/gill/src/core/index.ts",
    "content": "export { debug, isDebugEnabled } from \"./debug\";\n\nexport * from \"./base64-bytes-to\";\nexport * from \"./base64-from-transaction\";\nexport * from \"./base64-to-transaction\";\nexport * from \"./const\";\nexport * from \"./create-codama-config\";\nexport * from \"./create-solana-client\";\nexport * from \"./create-transaction\";\nexport * from \"./explorer\";\nexport * from \"./get-oldest-signature\";\nexport * from \"./get-signature-from-bytes\";\nexport * from \"./insert-reference-key\";\nexport * from \"./keypairs-base58\";\nexport * from \"./keypairs-extractable\";\nexport * from \"./prepare-transaction\";\nexport * from \"./rent\";\nexport * from \"./rpc\";\nexport * from \"./send-and-confirm-transaction-with-signers\";\nexport * from \"./simulate-transaction\";\nexport * from \"./utils\";\nexport * from \"./verify-signature\";\n"
  },
  {
    "path": "packages/gill/src/core/insert-reference-key.ts",
    "content": "import type { Address, BaseTransactionMessage } from \"@solana/kit\";\nimport { AccountRole, SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR, SolanaError } from \"@solana/kit\";\nimport type { getOldestSignatureForAddress } from \"./get-oldest-signature\";\n\n/**\n * Insert a single of reference key {@link Address} into a transaction message\n *\n * Use {@link getOldestSignatureForAddress} to locate the oldest signature for a reference key's address\n *\n * Note: The `transaction` must have at least one non-memo instruction.\n */\nexport function insertReferenceKeyToTransactionMessage<TTransaction extends BaseTransactionMessage>(\n  reference: Address,\n  transaction: TTransaction,\n): TTransaction {\n  return insertReferenceKeysToTransactionMessage([reference], transaction);\n}\n\n/**\n * Insert multiple reference key {@link Address | Addresses} into a transaction message\n *\n * Use {@link getOldestSignatureForAddress} to locate the oldest signature for a reference key's address\n *\n * Note: The `transaction` must have at least one non-memo instruction.\n */\nexport function insertReferenceKeysToTransactionMessage<TTransaction extends BaseTransactionMessage>(\n  references: Address[],\n  transaction: TTransaction,\n): TTransaction {\n  const nonMemoIndex = transaction.instructions.findIndex(\n    (ix) => ix.programAddress !== \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\",\n  );\n\n  if (transaction.instructions.length == 0 || nonMemoIndex == -1) {\n    throw new SolanaError(SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR, {\n      index: transaction.instructions.length || nonMemoIndex,\n      cause: \"At least one non-memo instruction is required\",\n    });\n  }\n\n  const modifiedIx = {\n    ...transaction.instructions[nonMemoIndex],\n    accounts: [\n      ...(transaction.instructions[nonMemoIndex].accounts || []),\n      // actually insert the reference keys\n      ...references.map((ref) => ({\n        address: ref,\n        role: AccountRole.READONLY,\n      })),\n    ],\n  };\n\n  const instructions = [...transaction.instructions];\n  instructions.splice(nonMemoIndex, 1, modifiedIx);\n\n  return Object.freeze({\n    ...transaction,\n    instructions: Object.freeze(instructions),\n  });\n}\n"
  },
  {
    "path": "packages/gill/src/core/keypairs-base58.ts",
    "content": "import { createKeyPairFromBytes, createSignerFromKeyPair, getBase58Encoder, type KeyPairSigner } from \"@solana/kit\";\n\n/**\n * Create a `CryptoKeyPair` from as base58 encoded secret key\n */\nexport async function createKeypairFromBase58(punitiveSecretKey: string): Promise<CryptoKeyPair> {\n  return createKeyPairFromBytes(getBase58Encoder().encode(punitiveSecretKey));\n}\n\n/**\n * Create a `KeyPairSigner` from as base58 encoded secret key\n */\nexport async function createKeypairSignerFromBase58(punitiveSecretKey: string): Promise<KeyPairSigner> {\n  return createSignerFromKeyPair(await createKeypairFromBase58(punitiveSecretKey));\n}\n"
  },
  {
    "path": "packages/gill/src/core/keypairs-extractable.ts",
    "content": "import { assertKeyExporterIsAvailable, assertKeyGenerationIsAvailable } from \"@solana/assertions\";\nimport type { KeyPairSigner, createKeyPairFromBytes, createKeyPairSignerFromBytes } from \"@solana/kit\";\nimport { createSignerFromKeyPair } from \"@solana/kit\";\n\nexport function assertKeyPairIsExtractable(keyPair: CryptoKeyPair): asserts keyPair is ExtractableCryptoKeyPair {\n  assertKeyExporterIsAvailable();\n\n  if (!keyPair.privateKey) {\n    throw new Error(\"Keypair is missing private key\");\n  }\n\n  if (!keyPair.publicKey) {\n    throw new Error(\"Keypair is missing public key\");\n  }\n\n  if (!keyPair.privateKey.extractable) {\n    throw new Error(\"Private key is not extractable\");\n  }\n}\n\ntype Extractable = { \"~extractable\": true };\n\ntype ExtractableCryptoKeyPair = CryptoKeyPair & Extractable;\ntype ExtractableKeyPairSigner = KeyPairSigner & Extractable;\n\n/**\n * Generates an extractable Ed25519 `CryptoKeyPair` capable of signing messages and transactions\n * */\nexport async function generateExtractableKeyPair(): Promise<ExtractableCryptoKeyPair> {\n  await assertKeyGenerationIsAvailable();\n  return crypto.subtle.generateKey(\n    /* algorithm */ \"Ed25519\", // Native implementation status: https://github.com/WICG/webcrypto-secure-curves/issues/20\n    /* extractable */ true,\n    /* allowed uses */ [\"sign\", \"verify\"],\n  ) as Promise<ExtractableCryptoKeyPair>;\n}\n\n/**\n * Generates an extractable signer capable of signing messages and transactions using a Crypto KeyPair.\n * */\nexport async function generateExtractableKeyPairSigner(): Promise<ExtractableKeyPairSigner> {\n  return createSignerFromKeyPair(await generateExtractableKeyPair()) as Promise<ExtractableKeyPairSigner>;\n}\n\n/**\n * Extracts the raw key material from an extractable Ed25519 CryptoKeyPair.\n *\n * @remarks\n * - Requires a keypair generated with extractable=true. See {@link generateExtractableKeyPair}.\n * - The extracted bytes can be used to reconstruct the `CryptoKeyPair` with {@link createKeyPairFromBytes}.\n *\n * @param keypair An extractable Ed25519 `CryptoKeyPair`\n * @returns Raw key bytes as `Uint8Array`\n */\nexport async function extractBytesFromKeyPair(keypair: ExtractableCryptoKeyPair | CryptoKeyPair): Promise<Uint8Array> {\n  assertKeyPairIsExtractable(keypair);\n\n  const [publicKeyBytes, privateKeyJwk] = await Promise.all([\n    crypto.subtle.exportKey(\"raw\", keypair.publicKey),\n    crypto.subtle.exportKey(\"jwk\", keypair.privateKey),\n  ]);\n\n  if (!privateKeyJwk.d) throw new Error(\"Failed to get private key bytes\");\n\n  return new Uint8Array([...Buffer.from(privateKeyJwk.d, \"base64\"), ...new Uint8Array(publicKeyBytes)]);\n}\n\n/**\n * Extracts the raw key material from an extractable Ed25519 KeyPairSigner.\n *\n * @remarks\n * - Requires a keypair generated with extractable=true. See {@link generateExtractableKeyPairSigner}.\n * - The extracted bytes can be used to reconstruct the `CryptoKeyPair` with {@link createKeyPairSignerFromBytes}.\n *\n * @param keypairSigner An extractable Ed25519 `KeyPairSigner`\n * @returns Raw key bytes as `Uint8Array`\n */\nexport async function extractBytesFromKeyPairSigner(\n  keypairSigner: ExtractableKeyPairSigner | KeyPairSigner,\n): Promise<Uint8Array> {\n  return extractBytesFromKeyPair(keypairSigner.keyPair);\n}\n"
  },
  {
    "path": "packages/gill/src/core/prepare-transaction.ts",
    "content": "import { COMPUTE_BUDGET_PROGRAM_ADDRESS, getSetComputeUnitLimitInstruction } from \"@solana-program/compute-budget\";\nimport type {\n  GetLatestBlockhashApi,\n  Rpc,\n  SimulateTransactionApi,\n  TransactionMessage,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionMessageWithFeePayer,\n} from \"@solana/kit\";\nimport {\n  appendTransactionMessageInstruction,\n  assertIsTransactionMessageWithBlockhashLifetime,\n  setTransactionMessageLifetimeUsingBlockhash,\n} from \"@solana/kit\";\nimport { isSetComputeLimitInstruction, estimateComputeUnitLimitFactory } from \"../programs/compute-budget\";\nimport { transactionToBase64WithSigners } from \"./base64-to-transaction\";\nimport { debug, isDebugEnabled } from \"./debug\";\n\ntype PrepareCompilableTransactionMessage = TransactionMessageWithFeePayer & TransactionMessage;\n\nexport type PrepareTransactionConfig<TMessage extends PrepareCompilableTransactionMessage> = {\n  /**\n   * Transaction to prepare for sending to the blockchain\n   */\n  transaction: TMessage;\n  /**\n   * RPC client capable of simulating transactions and getting the latest blockhash\n   **/\n  rpc: Rpc<GetLatestBlockhashApi & SimulateTransactionApi>;\n  /**\n   * Multiplier applied to the simulated compute unit value obtained from simulation\n   *\n   * Default: `1.1`\n   **/\n  computeUnitLimitMultiplier?: number;\n  /**\n   * Whether or not you wish to force reset the compute unit limit value (if one is already set)\n   * using the simulation response and `computeUnitLimitMultiplier`\n   **/\n  computeUnitLimitReset?: boolean;\n  /**\n   * Whether or not you wish to force reset the latest blockhash (if one is already set)\n   *\n   * Default: `true`\n   **/\n  blockhashReset?: boolean;\n};\n\n/**\n * Prepare a Transaction to be signed and sent to the network. Including:\n * - setting a compute unit limit (if not already set)\n * - fetching the latest blockhash (if not already set)\n * - (optional) simulating and resetting the compute unit limit\n * - (optional) resetting latest blockhash to the most recent\n */\nexport async function prepareTransaction<TMessage extends PrepareCompilableTransactionMessage>(\n  config: PrepareTransactionConfig<TMessage>,\n): Promise<TMessage & TransactionMessageWithBlockhashLifetime> {\n  // set the config defaults\n  if (!config.computeUnitLimitMultiplier) config.computeUnitLimitMultiplier = 1.1;\n  if (config.blockhashReset !== false) config.blockhashReset = true;\n\n  const computeBudgetIndex = {\n    limit: -1,\n    price: -1,\n  };\n\n  config.transaction.instructions.map((ix, index) => {\n    if (ix.programAddress != COMPUTE_BUDGET_PROGRAM_ADDRESS) return;\n\n    if (isSetComputeLimitInstruction(ix)) {\n      computeBudgetIndex.limit = index;\n    }\n    // else if (isSetComputeUnitPriceInstruction(ix)) {\n    //   computeBudgetIndex.price = index;\n    // }\n  });\n\n  // set a compute unit limit instruction\n  if (computeBudgetIndex.limit < 0 || config.computeUnitLimitReset) {\n    const units = await estimateComputeUnitLimitFactory({ rpc: config.rpc })(config.transaction);\n    debug(`Obtained compute units from simulation: ${units}`, \"debug\");\n    const ix = getSetComputeUnitLimitInstruction({\n      units: units * config.computeUnitLimitMultiplier,\n    });\n\n    if (computeBudgetIndex.limit < 0) {\n      config.transaction = appendTransactionMessageInstruction(ix, config.transaction) as unknown as TMessage;\n    } else if (config.computeUnitLimitReset) {\n      const nextInstructions = [...config.transaction.instructions];\n      nextInstructions.splice(computeBudgetIndex.limit, 1, ix);\n      config.transaction = Object.freeze({\n        ...config.transaction,\n        instructions: nextInstructions,\n      } as TMessage);\n    }\n  }\n\n  // update the latest blockhash\n  if (config.blockhashReset || \"lifetimeConstraint\" in config.transaction == false) {\n    const { value: latestBlockhash } = await config.rpc.getLatestBlockhash().send();\n    if (\"lifetimeConstraint\" in config.transaction == false) {\n      debug(\"Transaction missing latest blockhash, fetching one.\", \"debug\");\n      config.transaction = setTransactionMessageLifetimeUsingBlockhash(\n        latestBlockhash,\n        config.transaction,\n      ) as unknown as TMessage;\n    } else if (config.blockhashReset) {\n      debug(\"Auto resetting the latest blockhash.\", \"debug\");\n      config.transaction = Object.freeze({\n        ...config.transaction,\n        lifetimeConstraint: latestBlockhash,\n      } as TransactionMessageWithBlockhashLifetime & typeof config.transaction);\n    }\n  }\n\n  assertIsTransactionMessageWithBlockhashLifetime(config.transaction);\n\n  // skip the async call if debugging is off\n  if (isDebugEnabled()) {\n    debug(`Transaction as base64: ${await transactionToBase64WithSigners(config.transaction)}`, \"debug\");\n  }\n\n  return config.transaction;\n}\n"
  },
  {
    "path": "packages/gill/src/core/rent.ts",
    "content": "/**\n * Calculate the total rent needed for to create an account, with or without extra data stored in it\n */\nexport function getMinimumBalanceForRentExemption(space: bigint | number = 0) {\n  /**\n   * Default values for Rent calculations\n   *\n   * Values taken from: https://github.com/anza-xyz/solana-sdk/blob/c07f692e41d757057c8700211a9300cdcd6d33b1/rent/src/lib.rs#L93-L97\n   *\n   */\n  const RENT = {\n    /**\n     * Account storage overhead for calculation of base rent. (aka the number of bytes required to store an account with no data.\n     */\n    ACCOUNT_STORAGE_OVERHEAD: 128n,\n    /**\n     * Amount of time (in years) a balance must include rent for the account to\n     * be rent exempt.\n     */\n    DEFAULT_EXEMPTION_THRESHOLD: BigInt(Math.floor(2.0 * 1000)) / 1000n,\n    /**\n     * Default rental rate in lamports/byte-year. This calculation is based on:\n     * - 10^9 lamports per SOL\n     * - $1 per SOL\n     * - $0.01 per megabyte day\n     * - $3.65 per megabyte year\n     */\n    DEFAULT_LAMPORTS_PER_BYTE_YEAR: BigInt(Math.floor(((1_000_000_000 / 100) * 365) / (1024 * 1024))),\n  };\n\n  return (\n    ((RENT.ACCOUNT_STORAGE_OVERHEAD + BigInt(space)) *\n      RENT.DEFAULT_LAMPORTS_PER_BYTE_YEAR *\n      RENT.DEFAULT_EXEMPTION_THRESHOLD) /\n    1n\n  );\n}\n"
  },
  {
    "path": "packages/gill/src/core/rpc.ts",
    "content": "import type { DevnetUrl, MainnetUrl, TestnetUrl } from \"@solana/kit\";\nimport type { LocalnetUrl, ModifiedClusterUrl, SolanaClusterMoniker } from \"../types/rpc\";\n\nexport function localnet(putativeString: string): LocalnetUrl {\n  return putativeString as LocalnetUrl;\n}\n\n/**\n * Get a public Solana RPC endpoint for a cluster based on its moniker\n *\n * Note: These RPC URLs are rate limited and not suitable for production applications.\n */\nexport function getPublicSolanaRpcUrl(\n  cluster: SolanaClusterMoniker | \"mainnet-beta\" | \"localhost\",\n): ModifiedClusterUrl {\n  switch (cluster) {\n    case \"devnet\":\n      return \"https://api.devnet.solana.com\" as DevnetUrl;\n    case \"testnet\":\n      return \"https://api.testnet.solana.com\" as TestnetUrl;\n    case \"mainnet-beta\":\n    case \"mainnet\":\n      return \"https://api.mainnet-beta.solana.com\" as MainnetUrl;\n    case \"localnet\":\n    case \"localhost\":\n      return \"http://127.0.0.1:8899\" as LocalnetUrl;\n    default:\n      throw new Error(\"Invalid cluster moniker\");\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/core/send-and-confirm-transaction-with-signers.ts",
    "content": "import type {\n  BaseTransactionMessage,\n  FullySignedTransaction,\n  GetEpochInfoApi,\n  GetLatestBlockhashApi,\n  GetSignatureStatusesApi,\n  Rpc,\n  RpcSubscriptions,\n  SendTransactionApi,\n  Signature,\n  SignatureNotificationsApi,\n  SlotNotificationsApi,\n  Transaction,\n  TransactionMessage,\n  TransactionMessageWithFeePayer,\n  TransactionWithLifetime,\n} from \"@solana/kit\";\nimport {\n  assertIsFullySignedTransaction,\n  assertIsSendableTransaction,\n  assertIsTransactionMessageWithBlockhashLifetime,\n  assertIsTransactionWithBlockhashLifetime,\n  assertIsTransactionWithinSizeLimit,\n  Commitment,\n  getBase64EncodedWireTransaction,\n  getSignatureFromTransaction,\n  sendAndConfirmTransactionFactory,\n  setTransactionMessageLifetimeUsingBlockhash,\n  signTransactionMessageWithSigners,\n} from \"@solana/kit\";\nimport { type waitForRecentTransactionConfirmation } from \"@solana/transaction-confirmation\";\nimport { debug } from \"./debug\";\nimport { getExplorerLink } from \"./explorer\";\n\ninterface SendAndConfirmTransactionWithBlockhashLifetimeConfig extends SendTransactionConfigWithoutEncoding {\n  confirmRecentTransaction: (\n    config: Omit<\n      Parameters<typeof waitForRecentTransactionConfirmation>[0],\n      \"getBlockHeightExceedencePromise\" | \"getRecentSignatureConfirmationPromise\"\n    >,\n  ) => Promise<void>;\n  abortSignal?: AbortSignal;\n  commitment: Commitment;\n}\n\ntype SendTransactionConfigWithoutEncoding = Omit<\n  NonNullable<Parameters<SendTransactionApi[\"sendTransaction\"]>[1]>,\n  \"encoding\"\n>;\n\ntype SendableTransaction =\n  | (TransactionMessage & TransactionMessageWithFeePayer)\n  | (FullySignedTransaction & TransactionWithLifetime)\n  | (BaseTransactionMessage & TransactionMessageWithFeePayer);\n\nexport type SendAndConfirmTransactionWithSignersFunction = (\n  transaction: SendableTransaction,\n  config?: Omit<\n    SendAndConfirmTransactionWithBlockhashLifetimeConfig,\n    \"confirmRecentTransaction\" | \"rpc\" | \"transaction\"\n  >,\n) => Promise<Signature>;\n\ntype SendAndConfirmTransactionWithSignersFactoryConfig<TCluster> = {\n  rpc: Rpc<GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi> & {\n    \"~cluster\"?: TCluster;\n  };\n  rpcSubscriptions: RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi> & {\n    \"~cluster\"?: TCluster;\n  };\n};\n\nexport function sendAndConfirmTransactionWithSignersFactory({\n  rpc,\n  rpcSubscriptions,\n}: SendAndConfirmTransactionWithSignersFactoryConfig<\"devnet\">): SendAndConfirmTransactionWithSignersFunction;\nexport function sendAndConfirmTransactionWithSignersFactory({\n  rpc,\n  rpcSubscriptions,\n}: SendAndConfirmTransactionWithSignersFactoryConfig<\"testnet\">): SendAndConfirmTransactionWithSignersFunction;\nexport function sendAndConfirmTransactionWithSignersFactory({\n  rpc,\n  rpcSubscriptions,\n}: SendAndConfirmTransactionWithSignersFactoryConfig<\"mainnet\">): SendAndConfirmTransactionWithSignersFunction;\nexport function sendAndConfirmTransactionWithSignersFactory({\n  rpc,\n  rpcSubscriptions,\n}: SendAndConfirmTransactionWithSignersFactoryConfig<\"localnet\">): SendAndConfirmTransactionWithSignersFunction;\nexport function sendAndConfirmTransactionWithSignersFactory<\n  TCluster extends \"devnet\" | \"mainnet\" | \"testnet\" | \"localnet\" | undefined = undefined,\n>({\n  rpc,\n  rpcSubscriptions,\n}: SendAndConfirmTransactionWithSignersFactoryConfig<TCluster>): SendAndConfirmTransactionWithSignersFunction {\n  // @ts-ignore - TODO(FIXME)\n  const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });\n  return async function sendAndConfirmTransactionWithSigners(transaction, config = { commitment: \"confirmed\" }) {\n    let signedTransaction: (Transaction & FullySignedTransaction) | undefined;\n\n    if (\"messageBytes\" in transaction === false) {\n      if (\"lifetimeConstraint\" in transaction === false) {\n        const { value: latestBlockhash } = await rpc.getLatestBlockhash().send({ abortSignal: config.abortSignal });\n        transaction = setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, transaction);\n        assertIsTransactionMessageWithBlockhashLifetime(transaction);\n      }\n\n      // Ensure the transaction has fee payer\n      if (\"feePayer\" in transaction === false) {\n        throw new Error(\"Transaction must have a fee payer\");\n      }\n\n      // Sign the transaction and ensure it has all required properties\n      signedTransaction = await signTransactionMessageWithSigners(transaction);\n    }\n\n    // If the signing branch didn't run above, `signedTx` will be undefined.\n    // Use an explicit undefined check (instead of a truthy check) to avoid\n    // accidental falsy value edge-cases and then assign the provided\n    // `transaction` as a fully-signed transaction.\n    if (!signedTransaction) {\n      // Cast via unknown to acknowledge the developer intent: if the\n      // caller passed a fully-signed transaction, treat it as such.\n      signedTransaction = transaction as unknown as Transaction & FullySignedTransaction;\n    }\n\n    assertIsTransactionWithBlockhashLifetime(signedTransaction);\n    assertIsTransactionWithinSizeLimit(signedTransaction);\n    assertIsFullySignedTransaction(signedTransaction);\n    assertIsSendableTransaction(signedTransaction);\n\n    debug(`Sending transaction: ${getExplorerLink({ transaction: getSignatureFromTransaction(signedTransaction) })}`);\n    debug(`Transaction as base64: ${getBase64EncodedWireTransaction(signedTransaction)}`, \"debug\");\n\n    await sendAndConfirmTransaction(signedTransaction, config);\n    return getSignatureFromTransaction(signedTransaction);\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/core/simulate-transaction.ts",
    "content": "import type {\n  TransactionMessage,\n  TransactionMessageWithFeePayer,\n  Rpc,\n  SimulateTransactionApi,\n  Transaction,\n} from \"@solana/kit\";\nimport { getBase64EncodedWireTransaction, partiallySignTransactionMessageWithSigners } from \"@solana/kit\";\nimport type { Simplify } from \"./../types/index\";\n\nexport type SimulateTransactionFunction = (\n  transaction: Transaction | (TransactionMessage & TransactionMessageWithFeePayer),\n  config?: Simplify<Omit<Parameters<SimulateTransactionApi[\"simulateTransaction\"]>[1], \"encoding\" | \"sigVerify\">>,\n) => Promise<ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>>;\n\ntype SimulateTransactionFactoryConfig<TCluster> = {\n  rpc: Rpc<SimulateTransactionApi> & {\n    \"~cluster\"?: TCluster;\n  };\n};\n\nexport function simulateTransactionFactory({\n  rpc,\n}: SimulateTransactionFactoryConfig<\"devnet\">): SimulateTransactionFunction;\nexport function simulateTransactionFactory({\n  rpc,\n}: SimulateTransactionFactoryConfig<\"testnet\">): SimulateTransactionFunction;\nexport function simulateTransactionFactory({\n  rpc,\n}: SimulateTransactionFactoryConfig<\"mainnet\">): SimulateTransactionFunction;\nexport function simulateTransactionFactory({\n  rpc,\n}: SimulateTransactionFactoryConfig<\"localnet\">): SimulateTransactionFunction;\nexport function simulateTransactionFactory<\n  TCluster extends \"devnet\" | \"mainnet\" | \"testnet\" | \"localnet\" | void = void,\n>({ rpc }: SimulateTransactionFactoryConfig<TCluster>): SimulateTransactionFunction {\n  return async function simulateTransaction(transaction, config) {\n    if (\"messageBytes\" in transaction == false) {\n      transaction = await partiallySignTransactionMessageWithSigners(transaction);\n    }\n\n    return rpc\n      .simulateTransaction(getBase64EncodedWireTransaction(transaction), {\n        replaceRecentBlockhash: true,\n        // innerInstructions: true,\n        ...config,\n        sigVerify: false,\n        encoding: \"base64\",\n      })\n      .send();\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/core/utils.ts",
    "content": "import {\n  assertIsTransactionSigner,\n  createNoopSigner,\n  isTransactionSigner,\n  type Address,\n  type TransactionSigner,\n} from \"@solana/kit\";\nimport type { SolanaClusterMoniker } from \"../types\";\nimport { GENESIS_HASH } from \"./const\";\n\n/**\n * Determine the Solana moniker from its genesis hash\n *\n * If the hash is NOT known, returns `unknown`\n */\nexport function getMonikerFromGenesisHash(hash: string): SolanaClusterMoniker | \"unknown\" {\n  switch (hash) {\n    case GENESIS_HASH.mainnet:\n      return \"mainnet\";\n    case GENESIS_HASH.devnet:\n      return \"devnet\";\n    case GENESIS_HASH.testnet:\n      return \"testnet\";\n    default:\n      return \"unknown\";\n  }\n}\n\nexport function checkedAddress<TAddress extends string = string>(\n  input: Address<TAddress> | TransactionSigner<TAddress>,\n): Address<TAddress> {\n  return typeof input == \"string\" ? input : input.address;\n}\n\nexport function checkedTransactionSigner<TAddress extends string = string>(\n  input: Address<TAddress> | TransactionSigner<TAddress>,\n): TransactionSigner<TAddress> {\n  if (typeof input === \"string\" || \"address\" in input == false) input = createNoopSigner(input);\n  if (!isTransactionSigner(input)) throw new Error(\"A signer or address is required\");\n  assertIsTransactionSigner(input);\n  return input;\n}\n\n/**\n * Convert a lamport number to the human readable string of a SOL value\n * @param lamports - The amount in lamports\n * @param decimals - Number of decimal places to show (default: 9, max: 9)\n */\nexport function lamportsToSol(lamports: bigint | number, decimals: number = 9): string {\n  const maxDecimals = Math.min(decimals, 9);\n  const solValue = Number(lamports) / 1_000_000_000;\n  return new Intl.NumberFormat(\"en-US\", {\n    maximumFractionDigits: maxDecimals,\n    minimumFractionDigits: 0,\n  }).format(solValue);\n}\n"
  },
  {
    "path": "packages/gill/src/core/verify-signature.ts",
    "content": "import type {} from \"@solana/kit\";\nimport {\n  getBase58Encoder,\n  getPublicKeyFromAddress,\n  verifySignature,\n  type Address,\n  type ReadonlyUint8Array,\n  type Signature,\n  type SignatureBytes,\n} from \"@solana/kit\";\n\n/**\n * Verifies a Solana Address had signed the given message.\n *\n * @param address - The Solana address expected to have signed the message\n * @param signature - The signature to verify\n * @param signedMessage - The original message that was signed\n * @returns Promise that resolves to `true` if the signature is valid, `false` otherwise\n *\n * @example\n * ```typescript\n * const isValid = await verifySignatureForAddress(\n *   \"GC5AFcYqshWUnNK23MbWTXPix3FUagZt4fjUAt88FT59\" as Address,\n *   \"jrZaHRqiRojydQMxHqqe7FEkfeyw64KfPdF2ww1mm3hpVtGyxBvEU5NmHdZFoawYnYu62ujgqw3gcL2XHYbxd9K\",\n *   \"Hello, Solana!!\"\n * );\n * console.log(isValid); // true or false\n * ```\n */\nexport async function verifySignatureForAddress(\n  address: Address,\n  signature: string | Signature | SignatureBytes | Uint8Array | ReadonlyUint8Array,\n  message: string | Uint8Array,\n): Promise<boolean> {\n  const publicKey = await getPublicKeyFromAddress(address);\n  if (typeof message === \"string\") {\n    message = new TextEncoder().encode(message);\n  }\n  // massage the signature into the branded type for `SignatureBytes`\n  if (typeof signature === \"string\") {\n    signature = getBase58Encoder().encode(signature);\n  }\n  return verifySignature(publicKey, signature as SignatureBytes, message);\n}\n"
  },
  {
    "path": "packages/gill/src/index.ts",
    "content": "export * from \"@solana/kit\";\n\nexport * from \"./types\";\nexport * from \"./core\";\n\n// Node has a special export for the node JS specific\n// export * from \"./node\"; // DO NOT EXPORT HERE\n"
  },
  {
    "path": "packages/gill/src/node/const.ts",
    "content": "/** Default Solana tool suite local keypair path */\nexport const DEFAULT_CLI_KEYPAIR_PATH = \"~/.config/solana/id.json\";\n"
  },
  {
    "path": "packages/gill/src/node/index.ts",
    "content": "export * from \"./const\";\nexport * from \"./load-keypair\";\nexport * from \"./load-keypair-base58\";\nexport * from \"./save-keypair\";\n"
  },
  {
    "path": "packages/gill/src/node/load-keypair-base58.ts",
    "content": "import { createSignerFromKeyPair, type KeyPairSigner } from \"@solana/kit\";\nimport { createKeypairFromBase58 } from \"../core\";\n\n/**\n * Load a `CryptoKeyPair` from an environment variable containing a base58 encoded keypair\n *\n * @param variableName - environment variable name accessible via `process.env[variableName]`\n */\nexport async function loadKeypairFromEnvironmentBase58<TName extends keyof NodeJS.ProcessEnv | string>(\n  variableName: TName,\n): Promise<CryptoKeyPair> {\n  if (!process.env[variableName]) {\n    throw new Error(`Environment variable '${variableName}' not set`);\n  }\n  return createKeypairFromBase58(process.env[variableName]);\n}\n\n/**\n * Load a `KeyPairSigner` from an environment variable containing a base58 encoded keypair\n *\n * @param variableName - environment variable name accessible via `process.env[variableName]`\n */\nexport async function loadKeypairSignerFromEnvironmentBase58<TName extends keyof NodeJS.ProcessEnv | string>(\n  variableName: TName,\n): Promise<KeyPairSigner> {\n  return createSignerFromKeyPair(await loadKeypairFromEnvironmentBase58(variableName));\n}\n"
  },
  {
    "path": "packages/gill/src/node/load-keypair.ts",
    "content": "import { readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { resolve } from \"node:path\";\n\nimport { createKeyPairFromBytes, createSignerFromKeyPair, type KeyPairSigner } from \"@solana/kit\";\nimport { DEFAULT_CLI_KEYPAIR_PATH } from \"./const\";\nimport type { loadKeypairFromEnvironmentBase58, loadKeypairSignerFromEnvironmentBase58 } from \"./load-keypair-base58\";\n\n/**\n * Load a `CryptoKeyPair` from a filesystem wallet json file\n * (i.e. those generated by the `solana-keygen` command)\n *\n * @param filePath - file path to a json keypair file, default={@link DEFAULT_CLI_KEYPAIR_PATH}\n */\nexport async function loadKeypairFromFile(filePath: string = DEFAULT_CLI_KEYPAIR_PATH): Promise<CryptoKeyPair> {\n  const resolvedPath = resolve(filePath.startsWith(\"~\") ? filePath.replace(\"~\", homedir()) : filePath);\n  return createKeyPairFromBytes(Uint8Array.from(JSON.parse(readFileSync(resolvedPath, \"utf8\"))));\n}\n\n/**\n * Load a `KeyPairSigner` from a filesystem wallet json file\n * (i.e. those generated by the `solana-keygen` command)\n *\n * @param filePath - file path to a json keypair file, default={@link DEFAULT_CLI_KEYPAIR_PATH}\n */\nexport async function loadKeypairSignerFromFile(filePath: string = DEFAULT_CLI_KEYPAIR_PATH): Promise<KeyPairSigner> {\n  return createSignerFromKeyPair(await loadKeypairFromFile(filePath));\n}\n\n/**\n * Load a `CryptoKeyPair` from an environment variable\n * (i.e. those generated by the `solana-keygen` command)\n *\n * Note: for base58 encoded keypairs in environment variables use {@link loadKeypairFromEnvironmentBase58}\n *\n * @param variableName - environment variable name accessible via `process.env[variableName]`\n */\nexport async function loadKeypairFromEnvironment<TName extends keyof NodeJS.ProcessEnv | string>(\n  variableName: TName,\n): Promise<CryptoKeyPair> {\n  if (!process.env[variableName]) {\n    throw new Error(`Environment variable '${variableName}' not set`);\n  }\n  return createKeyPairFromBytes(Uint8Array.from(JSON.parse(process.env[variableName])));\n}\n\n/**\n * Load a `KeyPairSigner` from a environment variable\n * (i.e. those generated by the `solana-keygen` command)\n *\n * Note: for base58 encoded keypairs in environment variables use {@link loadKeypairSignerFromEnvironmentBase58}\n *\n * @param variableName - environment variable name accessible via `process.env[variableName]`\n */\nexport async function loadKeypairSignerFromEnvironment<TName extends keyof NodeJS.ProcessEnv | string>(\n  variableName: TName,\n): Promise<KeyPairSigner> {\n  return createSignerFromKeyPair(await loadKeypairFromEnvironment(variableName));\n}\n"
  },
  {
    "path": "packages/gill/src/node/save-keypair.ts",
    "content": "import { appendFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { resolve } from \"node:path\";\n\nimport { createKeyPairSignerFromBytes, type KeyPairSigner } from \"@solana/kit\";\nimport { extractBytesFromKeyPair } from \"../core\";\nimport { loadKeypairSignerFromFile } from \"./load-keypair\";\n\n/**\n * Save an extractable `CryptoKeyPair` to a filesystem wallet json file\n * (i.e. same format as those generated by the `solana-keygen` command)\n *\n * @param keypair - an extractable `CryptoKeyPair`\n * @param filePath - path to file where the keypair will be saved\n */\nexport async function saveKeypairToFile(keypair: CryptoKeyPair, filePath: string): Promise<boolean> {\n  if (!filePath.endsWith(\".json\")) {\n    throw new Error(\"Must provide a json file path to save keypair to\");\n  }\n\n  const resolvedPath = resolve(filePath.startsWith(\"~\") ? filePath.replace(\"~\", homedir()) : filePath);\n\n  // initialized in multiple steps to help deallocate the bytes faster\n  let bytes: Uint8Array | null;\n  bytes = await extractBytesFromKeyPair(keypair);\n  writeFileSync(resolvedPath, \"[\" + Array.from(bytes).toString() + \"]\", \"utf8\");\n\n  // attempt to reload the saved file to ensure the save was correctly formatted\n  const [input, output] = await Promise.all([\n    createKeyPairSignerFromBytes(bytes),\n    loadKeypairSignerFromFile(resolvedPath),\n  ]);\n\n  // help force the key bytes to be deallocated faster\n  bytes = null;\n\n  return input.address === output.address;\n}\n\n/**\n * Save an extractable `KeyPairSigner` to a filesystem wallet json file\n * (i.e. same format as those generated by the `solana-keygen` command)\n *\n * @param keypairSigner - an extractable `KeyPairSigner`\n * @param filePath - path to file where the keypair will be saved\n */\nexport async function saveKeypairSignerToFile(keypairSigner: KeyPairSigner, filePath: string): Promise<boolean> {\n  return saveKeypairToFile(keypairSigner.keyPair, filePath);\n}\n\n/**\n * Save an extractable `CryptoKeyPair` to a local environment file (e.g. `.env`)\n * (i.e. same format as those generated by the `solana-keygen` command)\n *\n * @param keypair - an extractable `CryptoKeyPair`\n * @param variableName - environment variable name accessible via `process.env[variableName]` after env file is loaded\n * @param envFilePath - environment variable file path, default = `.env` in the current working directory\n */\nexport async function saveKeypairToEnvFile(\n  keypair: CryptoKeyPair,\n  variableName: string,\n  envFilePath: string = \".env\",\n): Promise<void> {\n  if (process.env[variableName]) {\n    throw new Error(`Environment variable '${variableName}' already exist.`);\n  }\n\n  const resolvedPath = resolve(envFilePath.startsWith(\"~\") ? envFilePath.replace(\"~\", homedir()) : envFilePath);\n\n  // initialized in multiple steps to help deallocate the bytes faster\n  let bytes: Uint8Array | null;\n  bytes = await extractBytesFromKeyPair(keypair);\n  const signer = await createKeyPairSignerFromBytes(bytes);\n\n  appendFileSync(\n    resolvedPath,\n    `\\n# Solana Address: ${signer.address}` + `\\n${variableName}=[${Array.from(bytes).toString()}]`,\n    \"utf8\",\n  );\n\n  // help force the key bytes to be deallocated faster\n  bytes = null;\n}\n\n/**\n * Save an extractable `KeyPairSigner` to a filesystem wallet json file\n * (i.e. same format as those generated by the `solana-keygen` command)\n *\n * @param keypairSigner - an extractable `KeyPairSigner`\n * @param variableName - environment variable name accessible via `process.env[variableName]` after env file is loaded\n * @param envFilePath - environment variable file path, default = `.env` in the current working directory\n */\nexport async function saveKeypairSignerToEnvFile(\n  keypairSigner: KeyPairSigner,\n  variableName: string,\n  envFilePath: string = \".env\",\n): Promise<void> {\n  return saveKeypairToEnvFile(keypairSigner.keyPair, variableName, envFilePath);\n}\n"
  },
  {
    "path": "packages/gill/src/programs/address-lookup-table/index.ts",
    "content": "export * from \"./reexports\";\n"
  },
  {
    "path": "packages/gill/src/programs/address-lookup-table/reexports.ts",
    "content": "// Re-exports from @solana-program/address-lookup-table\nexport {\n  ADDRESS_LOOKUP_TABLE_DISCRIMINATOR,\n  ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,\n  AddressLookupTableAccount,\n  AddressLookupTableInstruction,\n  CLOSE_LOOKUP_TABLE_DISCRIMINATOR,\n  CREATE_LOOKUP_TABLE_DISCRIMINATOR,\n  DEACTIVATE_LOOKUP_TABLE_DISCRIMINATOR,\n  EXTEND_LOOKUP_TABLE_DISCRIMINATOR,\n  FREEZE_LOOKUP_TABLE_DISCRIMINATOR,\n  decodeAddressLookupTable,\n  fetchAddressLookupTable,\n  fetchAddressLookupTableFromSeeds,\n  fetchAllAddressLookupTable,\n  fetchAllMaybeAddressLookupTable,\n  fetchMaybeAddressLookupTable,\n  fetchMaybeAddressLookupTableFromSeeds,\n  findAddressLookupTablePda,\n  getAddressLookupTableCodec,\n  getAddressLookupTableDecoder,\n  getAddressLookupTableDiscriminatorBytes,\n  getAddressLookupTableEncoder,\n  getCloseLookupTableDiscriminatorBytes,\n  getCloseLookupTableInstruction,\n  getCloseLookupTableInstructionDataCodec,\n  getCloseLookupTableInstructionDataDecoder,\n  getCloseLookupTableInstructionDataEncoder,\n  getCreateLookupTableDiscriminatorBytes,\n  getCreateLookupTableInstruction,\n  getCreateLookupTableInstructionAsync,\n  getCreateLookupTableInstructionDataCodec,\n  getCreateLookupTableInstructionDataDecoder,\n  getCreateLookupTableInstructionDataEncoder,\n  getDeactivateLookupTableDiscriminatorBytes,\n  getDeactivateLookupTableInstruction,\n  getDeactivateLookupTableInstructionDataCodec,\n  getDeactivateLookupTableInstructionDataDecoder,\n  getDeactivateLookupTableInstructionDataEncoder,\n  getExtendLookupTableDiscriminatorBytes,\n  getExtendLookupTableInstruction,\n  getExtendLookupTableInstructionDataCodec,\n  getExtendLookupTableInstructionDataDecoder,\n  getExtendLookupTableInstructionDataEncoder,\n  getFreezeLookupTableDiscriminatorBytes,\n  getFreezeLookupTableInstruction,\n  getFreezeLookupTableInstructionDataCodec,\n  getFreezeLookupTableInstructionDataDecoder,\n  getFreezeLookupTableInstructionDataEncoder,\n  identifyAddressLookupTableAccount,\n  identifyAddressLookupTableInstruction,\n  parseCloseLookupTableInstruction,\n  parseCreateLookupTableInstruction,\n  parseDeactivateLookupTableInstruction,\n  parseExtendLookupTableInstruction,\n  parseFreezeLookupTableInstruction,\n} from \"@solana-program/address-lookup-table\";\n\nexport type * from \"@solana-program/address-lookup-table\";\n"
  },
  {
    "path": "packages/gill/src/programs/compute-budget/index.ts",
    "content": "export * from \"./utils\";\nexport * from \"./reexports\";\n"
  },
  {
    "path": "packages/gill/src/programs/compute-budget/reexports.ts",
    "content": "// Re-exports from @solana-program/compute-budget\nexport {\n  COMPUTE_BUDGET_PROGRAM_ADDRESS,\n  ComputeBudgetInstruction,\n  MAX_COMPUTE_UNIT_LIMIT,\n  PROVISORY_COMPUTE_UNIT_LIMIT,\n  REQUEST_HEAP_FRAME_DISCRIMINATOR,\n  REQUEST_UNITS_DISCRIMINATOR,\n  SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR,\n  SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR,\n  SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR,\n  estimateAndUpdateProvisoryComputeUnitLimitFactory,\n  estimateComputeUnitLimitFactory,\n  fillProvisorySetComputeUnitLimitInstruction,\n  getRequestHeapFrameDiscriminatorBytes,\n  getRequestHeapFrameInstruction,\n  getRequestHeapFrameInstructionDataCodec,\n  getRequestHeapFrameInstructionDataDecoder,\n  getRequestHeapFrameInstructionDataEncoder,\n  getRequestUnitsDiscriminatorBytes,\n  getRequestUnitsInstruction,\n  getRequestUnitsInstructionDataCodec,\n  getRequestUnitsInstructionDataDecoder,\n  getRequestUnitsInstructionDataEncoder,\n  getSetComputeUnitLimitDiscriminatorBytes,\n  getSetComputeUnitLimitInstruction,\n  getSetComputeUnitLimitInstructionDataCodec,\n  getSetComputeUnitLimitInstructionDataDecoder,\n  getSetComputeUnitLimitInstructionDataEncoder,\n  getSetComputeUnitPriceDiscriminatorBytes,\n  getSetComputeUnitPriceInstruction,\n  getSetComputeUnitPriceInstructionDataCodec,\n  getSetComputeUnitPriceInstructionDataDecoder,\n  getSetComputeUnitPriceInstructionDataEncoder,\n  getSetLoadedAccountsDataSizeLimitDiscriminatorBytes,\n  getSetLoadedAccountsDataSizeLimitInstruction,\n  getSetLoadedAccountsDataSizeLimitInstructionDataCodec,\n  getSetLoadedAccountsDataSizeLimitInstructionDataDecoder,\n  getSetLoadedAccountsDataSizeLimitInstructionDataEncoder,\n  identifyComputeBudgetInstruction,\n  parseRequestHeapFrameInstruction,\n  parseRequestUnitsInstruction,\n  parseSetComputeUnitLimitInstruction,\n  parseSetComputeUnitPriceInstruction,\n  parseSetLoadedAccountsDataSizeLimitInstruction,\n  setTransactionMessageComputeUnitPrice,\n  updateOrAppendSetComputeUnitLimitInstruction,\n  updateOrAppendSetComputeUnitPriceInstruction,\n} from \"@solana-program/compute-budget\";\n\nexport type * from \"@solana-program/compute-budget\";\n"
  },
  {
    "path": "packages/gill/src/programs/compute-budget/utils.ts",
    "content": "import { COMPUTE_BUDGET_PROGRAM_ADDRESS, ComputeBudgetInstruction } from \"@solana-program/compute-budget\";\nimport type { Instruction, InstructionWithData, TransactionMessage } from \"@solana/kit\";\nimport { isInstructionForProgram, isInstructionWithData } from \"@solana/kit\";\n\n/**\n * Check if a given instruction is a `SetComputeUnitLimit` instruction\n */\nexport function isSetComputeLimitInstruction(\n  instruction: Instruction,\n): instruction is Instruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> & InstructionWithData<Uint8Array> {\n  return (\n    isInstructionForProgram(instruction, COMPUTE_BUDGET_PROGRAM_ADDRESS) &&\n    isInstructionWithData(instruction) &&\n    instruction.data[0] === ComputeBudgetInstruction.SetComputeUnitLimit\n  );\n}\n\n/**\n * Check if a given transaction contains a `SetComputeUnitLimit` instruction\n */\nexport function hasSetComputeLimitInstruction(tx: TransactionMessage): boolean {\n  return tx.instructions.filter(isSetComputeLimitInstruction).length == 1;\n}\n\n/**\n * Check if a given instruction is a `SetComputeUnitPrice` instruction\n */\nexport function isSetComputeUnitPriceInstruction(\n  instruction: Instruction,\n): instruction is Instruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> & InstructionWithData<Uint8Array> {\n  return (\n    isInstructionForProgram(instruction, COMPUTE_BUDGET_PROGRAM_ADDRESS) &&\n    isInstructionWithData(instruction) &&\n    instruction.data[0] === ComputeBudgetInstruction.SetComputeUnitPrice\n  );\n}\n\n/**\n * Check if a given transaction contains a `SetComputeUnitPrice` instruction\n */\nexport function hasSetComputeUnitPriceInstruction(tx: TransactionMessage): boolean {\n  return tx.instructions.filter(isSetComputeUnitPriceInstruction).length == 1;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/index.ts",
    "content": "/**\n * Re-export the most common program clients compatible with this library\n */\n\nexport * from \"./system\";\nexport * from \"./compute-budget\";\nexport * from \"./address-lookup-table\";\nexport * from \"./token\";\n\n/**\n * Codama generated clients, stored internally in this package\n * (and associated helpers for them)\n */\nexport * from \"./memo\"; // vendored in from @solana-program/memo\nexport * from \"./token-metadata\";\n"
  },
  {
    "path": "packages/gill/src/programs/memo/generated/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from './instructions';\nexport * from './programs';\n"
  },
  {
    "path": "packages/gill/src/programs/memo/generated/instructions/addMemo.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getStructDecoder,\n  getStructEncoder,\n  getUtf8Decoder,\n  getUtf8Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from \"@solana/codecs\";\nimport type {\n  Address,\n  AccountMeta,\n  Instruction,\n  InstructionWithAccounts,\n  InstructionWithData,\n  TransactionSigner,\n} from \"@solana/kit\";\nimport { AccountRole } from \"@solana/kit\";\nimport { MEMO_PROGRAM_ADDRESS } from \"../programs\";\n\nexport type AddMemoInstruction<\n  TProgram extends string = typeof MEMO_PROGRAM_ADDRESS,\n  TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> & InstructionWithData<Uint8Array> & InstructionWithAccounts<TRemainingAccounts>;\n\nexport type AddMemoInstructionData = { memo: string };\n\nexport type AddMemoInstructionDataArgs = AddMemoInstructionData;\n\nexport function getAddMemoInstructionDataEncoder(): Encoder<AddMemoInstructionDataArgs> {\n  return getStructEncoder([[\"memo\", getUtf8Encoder()]]);\n}\n\nexport function getAddMemoInstructionDataDecoder(): Decoder<AddMemoInstructionData> {\n  return getStructDecoder([[\"memo\", getUtf8Decoder()]]);\n}\n\nexport function getAddMemoInstructionDataCodec(): Codec<AddMemoInstructionDataArgs, AddMemoInstructionData> {\n  return combineCodec(getAddMemoInstructionDataEncoder(), getAddMemoInstructionDataDecoder());\n}\n\nexport type AddMemoInput = {\n  memo: AddMemoInstructionDataArgs[\"memo\"];\n  signers?: Array<TransactionSigner>;\n};\n\nexport function getAddMemoInstruction<TProgramAddress extends Address = typeof MEMO_PROGRAM_ADDRESS>(\n  input: AddMemoInput,\n  config?: { programAddress?: TProgramAddress },\n): AddMemoInstruction<TProgramAddress> {\n  // Program address.\n  const programAddress = config?.programAddress ?? MEMO_PROGRAM_ADDRESS;\n\n  // Original args.\n  const args = { ...input };\n\n  // Remaining accounts.\n  const remainingAccounts: AccountMeta[] = (args.signers ?? []).map((signer) => ({\n    address: signer.address,\n    role: AccountRole.READONLY_SIGNER,\n    signer,\n  }));\n\n  const instruction = {\n    accounts: remainingAccounts,\n    programAddress,\n    data: getAddMemoInstructionDataEncoder().encode(args as AddMemoInstructionDataArgs),\n  } as AddMemoInstruction<TProgramAddress>;\n\n  return instruction;\n}\n\nexport type ParsedAddMemoInstruction<TProgram extends string = typeof MEMO_PROGRAM_ADDRESS> = {\n  programAddress: Address<TProgram>;\n  data: AddMemoInstructionData;\n};\n\nexport function parseAddMemoInstruction<TProgram extends string>(\n  instruction: Instruction<TProgram> & InstructionWithData<Uint8Array>,\n): ParsedAddMemoInstruction<TProgram> {\n  return {\n    programAddress: instruction.programAddress,\n    data: getAddMemoInstructionDataDecoder().decode(instruction.data),\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/programs/memo/generated/instructions/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from './addMemo';\n"
  },
  {
    "path": "packages/gill/src/programs/memo/generated/programs/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from './memo';\n"
  },
  {
    "path": "packages/gill/src/programs/memo/generated/programs/memo.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { type Address } from \"@solana/kit\";\nimport { type ParsedAddMemoInstruction } from \"../instructions\";\n\nexport const MEMO_PROGRAM_ADDRESS =\n  \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\" as Address<\"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\">;\n\nexport enum MemoInstruction {\n  AddMemo,\n}\n\nexport type ParsedMemoInstruction<TProgram extends string = \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\"> = {\n  instructionType: MemoInstruction.AddMemo;\n} & ParsedAddMemoInstruction<TProgram>;\n"
  },
  {
    "path": "packages/gill/src/programs/memo/index.ts",
    "content": "export * from \"./generated\";\n"
  },
  {
    "path": "packages/gill/src/programs/shared/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * And vendored in from various codama generated client to help\n * minimize redundancy and bundle sizes\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { isProgramDerivedAddress, type Address, type ProgramDerivedAddress } from \"@solana/kit\";\nimport { AccountRole, type AccountMeta, upgradeRoleToSigner } from \"@solana/kit\";\nimport {\n  isTransactionSigner as web3JsIsTransactionSigner,\n  type AccountSignerMeta,\n  type TransactionSigner,\n} from \"@solana/kit\";\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome<T>(value: T | null | undefined): T {\n  if (value == null) {\n    throw new Error(\"Expected a value but received null or undefined.\");\n  }\n  return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress<T extends string = string>(\n  value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined,\n): Address<T> {\n  if (!value) {\n    throw new Error(\"Expected a Address.\");\n  }\n  if (typeof value === \"object\" && \"address\" in value) {\n    return value.address;\n  }\n  if (Array.isArray(value)) {\n    return value[0];\n  }\n  return value as Address<T>;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress<T extends string = string>(\n  value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined,\n): ProgramDerivedAddress<T> {\n  if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n    throw new Error(\"Expected a ProgramDerivedAddress.\");\n  }\n  return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner<T extends string = string>(\n  value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined,\n): TransactionSigner<T> {\n  if (!value || !isTransactionSigner(value)) {\n    throw new Error(\"Expected a TransactionSigner.\");\n  }\n  return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n  T extends string = string,\n  U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null =\n    | Address<T>\n    | ProgramDerivedAddress<T>\n    | TransactionSigner<T>\n    | null,\n> = {\n  isWritable: boolean;\n  value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n  byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: \"omitted\" | \"programId\") {\n  return (account: ResolvedAccount): AccountMeta | AccountSignerMeta | undefined => {\n    if (!account.value) {\n      if (optionalAccountStrategy === \"omitted\") return;\n      return Object.freeze({\n        address: programAddress,\n        role: AccountRole.READONLY,\n      });\n    }\n\n    const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;\n    return Object.freeze({\n      address: expectAddress(account.value),\n      role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,\n      ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n    });\n  };\n}\n\nexport function isTransactionSigner<TAddress extends string = string>(\n  value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>,\n): value is TransactionSigner<TAddress> {\n  return !!value && typeof value === \"object\" && \"address\" in value && web3JsIsTransactionSigner(value);\n}\n"
  },
  {
    "path": "packages/gill/src/programs/system/index.ts",
    "content": "export * from \"./reexports\";\n"
  },
  {
    "path": "packages/gill/src/programs/system/reexports.ts",
    "content": "// Re-exports from @solana-program/system\nexport {\n  ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR,\n  ALLOCATE_DISCRIMINATOR,\n  ALLOCATE_WITH_SEED_DISCRIMINATOR,\n  ASSIGN_DISCRIMINATOR,\n  ASSIGN_WITH_SEED_DISCRIMINATOR,\n  AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR,\n  CREATE_ACCOUNT_DISCRIMINATOR,\n  CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR,\n  INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR,\n  NonceState,\n  NonceVersion,\n  SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE,\n  SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH,\n  SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH,\n  SYSTEM_ERROR__INVALID_PROGRAM_ID,\n  SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED,\n  SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED,\n  SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES,\n  SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE,\n  SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS,\n  SYSTEM_PROGRAM_ADDRESS,\n  SystemAccount,\n  SystemInstruction,\n  TRANSFER_SOL_DISCRIMINATOR,\n  TRANSFER_SOL_WITH_SEED_DISCRIMINATOR,\n  UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR,\n  WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR,\n  decodeNonce,\n  fetchAllMaybeNonce,\n  fetchAllNonce,\n  fetchMaybeNonce,\n  fetchNonce,\n  getAdvanceNonceAccountDiscriminatorBytes,\n  getAdvanceNonceAccountInstruction,\n  getAdvanceNonceAccountInstructionDataCodec,\n  getAdvanceNonceAccountInstructionDataDecoder,\n  getAdvanceNonceAccountInstructionDataEncoder,\n  getAllocateDiscriminatorBytes,\n  getAllocateInstruction,\n  getAllocateInstructionDataCodec,\n  getAllocateInstructionDataDecoder,\n  getAllocateInstructionDataEncoder,\n  getAllocateWithSeedDiscriminatorBytes,\n  getAllocateWithSeedInstruction,\n  getAllocateWithSeedInstructionDataCodec,\n  getAllocateWithSeedInstructionDataDecoder,\n  getAllocateWithSeedInstructionDataEncoder,\n  getAssignDiscriminatorBytes,\n  getAssignInstruction,\n  getAssignInstructionDataCodec,\n  getAssignInstructionDataDecoder,\n  getAssignInstructionDataEncoder,\n  getAssignWithSeedDiscriminatorBytes,\n  getAssignWithSeedInstruction,\n  getAssignWithSeedInstructionDataCodec,\n  getAssignWithSeedInstructionDataDecoder,\n  getAssignWithSeedInstructionDataEncoder,\n  getAuthorizeNonceAccountDiscriminatorBytes,\n  getAuthorizeNonceAccountInstruction,\n  getAuthorizeNonceAccountInstructionDataCodec,\n  getAuthorizeNonceAccountInstructionDataDecoder,\n  getAuthorizeNonceAccountInstructionDataEncoder,\n  getCreateAccountDiscriminatorBytes,\n  getCreateAccountInstruction,\n  getCreateAccountInstructionDataCodec,\n  getCreateAccountInstructionDataDecoder,\n  getCreateAccountInstructionDataEncoder,\n  getCreateAccountWithSeedDiscriminatorBytes,\n  getCreateAccountWithSeedInstruction,\n  getCreateAccountWithSeedInstructionDataCodec,\n  getCreateAccountWithSeedInstructionDataDecoder,\n  getCreateAccountWithSeedInstructionDataEncoder,\n  getInitializeNonceAccountDiscriminatorBytes,\n  getInitializeNonceAccountInstruction,\n  getInitializeNonceAccountInstructionDataCodec,\n  getInitializeNonceAccountInstructionDataDecoder,\n  getInitializeNonceAccountInstructionDataEncoder,\n  getNonceCodec,\n  getNonceDecoder,\n  getNonceEncoder,\n  getNonceSize,\n  getNonceStateCodec,\n  getNonceStateDecoder,\n  getNonceStateEncoder,\n  getNonceVersionCodec,\n  getNonceVersionDecoder,\n  getNonceVersionEncoder,\n  getSystemErrorMessage,\n  getTransferSolDiscriminatorBytes,\n  getTransferSolInstruction,\n  getTransferSolInstructionDataCodec,\n  getTransferSolInstructionDataDecoder,\n  getTransferSolInstructionDataEncoder,\n  getTransferSolWithSeedDiscriminatorBytes,\n  getTransferSolWithSeedInstruction,\n  getTransferSolWithSeedInstructionDataCodec,\n  getTransferSolWithSeedInstructionDataDecoder,\n  getTransferSolWithSeedInstructionDataEncoder,\n  getUpgradeNonceAccountDiscriminatorBytes,\n  getUpgradeNonceAccountInstruction,\n  getUpgradeNonceAccountInstructionDataCodec,\n  getUpgradeNonceAccountInstructionDataDecoder,\n  getUpgradeNonceAccountInstructionDataEncoder,\n  getWithdrawNonceAccountDiscriminatorBytes,\n  getWithdrawNonceAccountInstruction,\n  getWithdrawNonceAccountInstructionDataCodec,\n  getWithdrawNonceAccountInstructionDataDecoder,\n  getWithdrawNonceAccountInstructionDataEncoder,\n  identifySystemInstruction,\n  isSystemError,\n  parseAdvanceNonceAccountInstruction,\n  parseAllocateInstruction,\n  parseAllocateWithSeedInstruction,\n  parseAssignInstruction,\n  parseAssignWithSeedInstruction,\n  parseAuthorizeNonceAccountInstruction,\n  parseCreateAccountInstruction,\n  parseCreateAccountWithSeedInstruction,\n  parseInitializeNonceAccountInstruction,\n  parseTransferSolInstruction,\n  parseTransferSolWithSeedInstruction,\n  parseUpgradeNonceAccountInstruction,\n  parseWithdrawNonceAccountInstruction,\n} from \"@solana-program/system\";\n\nexport type * from \"@solana-program/system\";\n"
  },
  {
    "path": "packages/gill/src/programs/token/addresses.ts",
    "content": "import { findAssociatedTokenPda, TOKEN_2022_PROGRAM_ADDRESS } from \"@solana-program/token-2022\";\nimport { isAddress, type Address, type TransactionSigner } from \"@solana/kit\";\nimport { checkedAddress } from \"../../core/utils\";\n\nexport type LegacyTokenProgramMonikers = \"legacy\" | \"token\";\n\nexport type TokenExtensionProgramMonikers = \"token22\" | \"tokenExtension\" | \"tokenExtensions\" | \"token2022\";\n\nexport type TokenProgramMonikers = LegacyTokenProgramMonikers | TokenExtensionProgramMonikers;\n\nexport const TOKEN_PROGRAM_ADDRESS =\n  \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n\n/**\n * Derive the associated token account (ata) address for an owner and mint/tokenProgram\n *\n * @argument `mint` - the token mint itself\n * @argument `owner` - destination wallet address to own tokens from `mint`\n * @argument `tokenProgram` - token program that the token `mint` was created with\n *\n * - (default) {@link TOKEN_PROGRAM_ADDRESS} - the original SPL Token Program\n * - {@link TOKEN_2022_PROGRAM_ADDRESS} - the SPL Token Extensions Program (aka Token22)\n */\nexport async function getAssociatedTokenAccountAddress(\n  mint: Address | TransactionSigner,\n  owner: Address | TransactionSigner,\n  tokenProgram?: Address,\n): Promise<Address> {\n  return (\n    await findAssociatedTokenPda({\n      mint: checkedAddress(mint),\n      owner: checkedAddress(owner),\n      tokenProgram: checkedTokenProgramAddress(tokenProgram),\n    })\n  )[0];\n}\n\nexport function parseTokenProgramAddressOrMoniker(tokenProgram: Address | TokenProgramMonikers): Address {\n  if (!isAddress(tokenProgram)) {\n    tokenProgram = tokenProgram.toLowerCase() as TokenProgramMonikers;\n  }\n  switch (tokenProgram) {\n    case \"legacy\":\n    case \"token\":\n    case TOKEN_PROGRAM_ADDRESS: {\n      return TOKEN_PROGRAM_ADDRESS;\n    }\n    case \"token22\":\n    case \"token2022\":\n    case \"tokenextension\":\n    case \"tokenextensions\":\n    case TOKEN_2022_PROGRAM_ADDRESS: {\n      return TOKEN_2022_PROGRAM_ADDRESS;\n    }\n    default:\n      throw Error(\"Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'\");\n  }\n}\n\nexport function assertIsSupportedTokenProgram(\n  tokenProgram: Address,\n): asserts tokenProgram is Address<typeof tokenProgram> {\n  if (tokenProgram !== TOKEN_PROGRAM_ADDRESS && tokenProgram !== TOKEN_2022_PROGRAM_ADDRESS) {\n    throw Error(\"Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'\");\n  }\n}\n\n/**\n * Check the provided program is one of the supported token programs.\n * Including setting the default to {@link TOKEN_PROGRAM_ADDRESS} (the original SPL token program)\n *\n * @example\n * ```\n * args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n * ```\n */\nexport function checkedTokenProgramAddress(tokenProgram?: Address | TokenProgramMonikers): Address {\n  if (!tokenProgram) return TOKEN_PROGRAM_ADDRESS;\n  tokenProgram = parseTokenProgramAddressOrMoniker(tokenProgram);\n  assertIsSupportedTokenProgram(tokenProgram);\n  return tokenProgram;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/assert-is-mint.ts",
    "content": "import type { Mint } from \"@solana-program/token-2022\";\nimport type { Account, Address } from \"@solana/kit\";\nimport {\n  isAddress,\n  SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND,\n  SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT,\n  SolanaError,\n} from \"@solana/kit\";\n\nexport function assertIsMint<TAddress extends string = string>(\n  accountOrAddress: Account<Mint, TAddress> | Address<TAddress>,\n): asserts accountOrAddress is Account<Mint, TAddress> {\n  if (isAddress(accountOrAddress as Address)) {\n    throw new SolanaError(SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND, { address: accountOrAddress as Address });\n  }\n\n  if (\"data\" in accountOrAddress === false || \"mintAuthority\" in accountOrAddress.data === false) {\n    throw new SolanaError(SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT, { address: accountOrAddress as Address });\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/fetch-token-accounts.ts",
    "content": "import type { Mint, Token } from \"@solana-program/token-2022\";\nimport { decodeToken, fetchMint } from \"@solana-program/token-2022\";\nimport type { Account, Address, GetAccountInfoApi, GetTokenAccountsByOwnerApi, Rpc } from \"@solana/kit\";\nimport { isAddress, parseBase64RpcAccount } from \"@solana/kit\";\nimport type { Simplify } from \"../../types\";\nimport { assertIsMint } from \"./assert-is-mint\";\n\ntype OriginalConfigParam = NonNullable<Parameters<GetTokenAccountsByOwnerApi[\"getTokenAccountsByOwner\"]>[2]>;\n\nexport type FetchTokenAccountsConfig = Simplify<\n  Omit<OriginalConfigParam, \"encoding\"> & {\n    abortSignal?: AbortSignal;\n  }\n>;\n\n/**\n * Fetch all the the token accounts for a given `mint` and `owner` Address. Automatically fetching\n * the Mint account itself and calculating the total balance of all the `owner`'s token accounts.\n *\n * @example\n * ```typescript\n * const { mint, accounts, totalBalance } = await fetchTokenAccounts(\n *    rpc,\n *    \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" as Address, // (mint for USDC on mainnet)\n *    \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address, // owner address\n * );\n * ```\n */\nexport async function fetchTokenAccounts<TMintAddress extends string = string, TOwner extends string = string>(\n  rpc: Rpc<GetTokenAccountsByOwnerApi & GetAccountInfoApi>,\n  mint: Address<TMintAddress> | Account<Mint>,\n  owner: Address<TOwner>,\n  config: FetchTokenAccountsConfig = {},\n): Promise<{ accounts: Account<Token>[]; mint: Account<Mint>; totalBalance: bigint }> {\n  if (isAddress(mint as Address)) mint = await fetchMint(rpc, mint as Address);\n  assertIsMint(mint);\n  const { abortSignal, ...rpcConfig } = config;\n  const { value } = await rpc\n    .getTokenAccountsByOwner(owner, { mint: mint.address }, { ...rpcConfig, encoding: \"base64\" })\n    .send({ abortSignal });\n  let totalBalance: bigint = 0n;\n  const accounts = value.map((account) => {\n    const decoded = decodeToken(parseBase64RpcAccount(account.pubkey, account.account));\n    totalBalance += decoded.data.amount;\n    return decoded;\n  });\n  return {\n    mint,\n    totalBalance,\n    accounts,\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/index.ts",
    "content": "export * from \"./addresses\";\nexport * from \"./assert-is-mint\";\nexport * from \"./fetch-token-accounts\";\nexport * from \"./instructions\";\nexport * from \"./reexports\";\nexport * from \"./transactions\";\nexport * from \"./ui-amount\";\n"
  },
  {
    "path": "packages/gill/src/programs/token/instructions/create-token.ts",
    "content": "import { getCreateAccountInstruction } from \"@solana-program/system\";\nimport type { Address, Instruction, KeyPairSigner, TransactionSigner } from \"@solana/kit\";\nimport { checkedAddress, checkedTransactionSigner, getMinimumBalanceForRentExemption } from \"../../../core\";\nimport { getCreateMetadataAccountV3Instruction, getTokenMetadataAddress } from \"../../token-metadata\";\n\nimport {\n  extension,\n  getInitializeMetadataPointerInstruction,\n  getInitializeMintInstruction,\n  getInitializeTokenMetadataInstruction,\n  getMintSize,\n  TOKEN_2022_PROGRAM_ADDRESS,\n} from \"@solana-program/token-2022\";\nimport { checkedTokenProgramAddress } from \"../addresses\";\nimport type { TokenInstructionBase } from \"./types\";\n\nexport type GetCreateTokenInstructionsArgs = TokenInstructionBase<KeyPairSigner> & {\n  /**\n   * The number of decimal places this token should have\n   *\n   * @default `9` - the most commonly used decimals value\n   **/\n  decimals?: bigint | number;\n  /**\n   * Authority address that is allowed to mint new tokens\n   *\n   * When not provided, defaults to: `feePayer`\n   **/\n  mintAuthority?: TransactionSigner;\n  /**\n   * Authority address that is able to freeze (and thaw) user owned token accounts.\n   * When a user's token account is frozen, they will not be able to transfer their tokens.\n   *\n   * When not provided, defaults to: `null`\n   **/\n  freezeAuthority?: Address | TransactionSigner;\n  /**\n   * Authority address that is allowed to update the metadata\n   *\n   * When not provided, defaults to: `feePayer`\n   **/\n  updateAuthority?: TransactionSigner;\n  /**\n   * Optional (but highly recommended) metadata to attach to this token\n   */\n  metadata: {\n    /** Name of this token */\n    name: string;\n    /** Symbol for this token */\n    symbol: string;\n    /** URI pointing to additional metadata for this token. Typically an offchain json file. */\n    uri: string;\n    /** Whether or not the onchain metadata will be editable after minting */\n    isMutable: boolean;\n  };\n  /**\n   * Metadata address for this token\n   *\n   * @example\n   * For `TOKEN_PROGRAM_ADDRESS` use the {@link getTokenMetadataAddress} function:\n   * ```\n   * metadataAddress: await getTokenMetadataAddress(mint.address);\n   * ```\n   *\n   * @example\n   * For `TOKEN_2022_PROGRAM_ADDRESS` use the mint's address:\n   * ```\n   * metadataAddress: mint.address;\n   * ```\n   * */\n  metadataAddress: Address;\n  // extensions // todo\n};\n\n/**\n * Create the instructions required to initialize a new token's mint\n */\nexport function getCreateTokenInstructions(args: GetCreateTokenInstructionsArgs): Instruction[] {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n\n  if (args.decimals == null) args.decimals = 9;\n  if (!args.mintAuthority) args.mintAuthority = args.feePayer;\n  if (!args.updateAuthority) args.updateAuthority = args.feePayer;\n  if (args.freezeAuthority) args.freezeAuthority = checkedAddress(args.freezeAuthority);\n\n  if (args.tokenProgram === TOKEN_2022_PROGRAM_ADDRESS) {\n    const metadataPointer = extension(\"MetadataPointer\", {\n      metadataAddress: args.mint.address,\n      authority: args.updateAuthority.address,\n    });\n\n    const metadataExtensionData = extension(\"TokenMetadata\", {\n      updateAuthority: args.updateAuthority.address,\n      mint: args.mint.address,\n      name: args.metadata.name,\n      symbol: args.metadata.symbol,\n      uri: args.metadata.uri,\n      // todo: support token22 additional metadata\n      additionalMetadata: new Map(),\n    });\n\n    return [\n      getCreateAccountInstruction({\n        payer: args.feePayer,\n        newAccount: args.mint,\n        /**\n         * token22 requires only the pre-mint-initialization extensions (like metadata pointer)\n         * to be the `space`. then it will extend the account's space for each applicable extension\n         * */\n        space: BigInt(getMintSize([metadataPointer])),\n        /**\n         * token22 requires the total lamport balance for all extensions,\n         * including pre-initialization and post-initialization\n         */\n        lamports: getMinimumBalanceForRentExemption(BigInt(getMintSize([metadataPointer, metadataExtensionData]))),\n        programAddress: args.tokenProgram,\n      }),\n      getInitializeMetadataPointerInstruction({\n        authority: args.mintAuthority.address,\n        metadataAddress: args.metadataAddress,\n        mint: args.mint.address,\n      }),\n      getInitializeMintInstruction(\n        {\n          mint: args.mint.address,\n          decimals: Number(args.decimals),\n          mintAuthority: args.mintAuthority.address,\n          freezeAuthority: args.freezeAuthority || null,\n        },\n        {\n          programAddress: args.tokenProgram,\n        },\n      ),\n      getInitializeTokenMetadataInstruction({\n        metadata: args.mint.address,\n        mint: args.mint.address,\n        mintAuthority: args.mintAuthority,\n        name: args.metadata.name,\n        symbol: args.metadata.symbol,\n        uri: args.metadata.uri,\n        updateAuthority: args.updateAuthority.address,\n      }),\n      // todo: support token22 additional metadata by adding that instruction(s) here\n    ];\n  } else {\n    // the token22 `getMintSize` is fully compatible with the original token program\n    const space: bigint = BigInt(getMintSize());\n\n    return [\n      getCreateAccountInstruction({\n        payer: args.feePayer,\n        newAccount: args.mint,\n        lamports: getMinimumBalanceForRentExemption(space),\n        space,\n        programAddress: args.tokenProgram,\n      }),\n      getInitializeMintInstruction(\n        {\n          mint: args.mint.address,\n          decimals: Number(args.decimals),\n          mintAuthority: args.mintAuthority.address,\n          freezeAuthority: args.freezeAuthority || null,\n        },\n        {\n          programAddress: args.tokenProgram,\n        },\n      ),\n      getCreateMetadataAccountV3Instruction({\n        metadata: args.metadataAddress,\n        mint: args.mint.address,\n        mintAuthority: args.mintAuthority,\n        payer: args.feePayer,\n        updateAuthority: args.updateAuthority,\n        data: {\n          name: args.metadata.name,\n          symbol: args.metadata.symbol,\n          uri: args.metadata.uri,\n          sellerFeeBasisPoints: 0,\n          creators: null,\n          collection: null,\n          uses: null,\n        },\n        isMutable: args.metadata.isMutable,\n        collectionDetails: null,\n      }),\n    ];\n  }\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/instructions/index.ts",
    "content": "export * from \"./create-token\";\nexport * from \"./mint-tokens\";\nexport * from \"./transfer-tokens\";\n"
  },
  {
    "path": "packages/gill/src/programs/token/instructions/mint-tokens.ts",
    "content": "import type { Address, Instruction, TransactionSigner } from \"@solana/kit\";\n\nimport { getCreateAssociatedTokenIdempotentInstruction, getMintToInstruction } from \"@solana-program/token-2022\";\nimport { checkedAddress, checkedTransactionSigner } from \"../../../core\";\nimport { checkedTokenProgramAddress } from \"../addresses\";\nimport type { TokenInstructionBase } from \"./types\";\n\nexport type GetMintTokensInstructionsArgs = TokenInstructionBase & {\n  /**\n   * The authority address capable of authorizing minting of new tokens.\n   *\n   * - this should normally by a `TransactionSigner`\n   * - only for multi-sig authorities (like Squads Protocol), should you supply an `Address`\n   * */\n  mintAuthority: TransactionSigner | Address;\n  /** Wallet address to receive the tokens being minted, via their associated token account (ata) */\n  destination: TransactionSigner | Address;\n  /**\n   * Associated token account (ata) address for `destination` and this `mint`\n   *\n   * See {@link getAssociatedTokenAccountAddress}\n   *\n   * @example\n   * ```\n   * getAssociatedTokenAccountAddress(mint, destination, tokenProgram);\n   * ```\n   * */\n  ata: Address;\n  /** Amount of tokens to mint to the `owner` via their `ata` */\n  amount: bigint | number;\n};\n\n/**\n * Create the instructions required to mint tokens to any wallet/owner,\n * including creating their ATA if it does not exist\n *\n * @example\n *\n * ```\n * const mint = await generateKeyPairSigner();\n * const destination = address(\"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\");\n *\n * const instructions = getMintTokensInstructions({\n *   mint,\n *   feePayer: signer,\n *   mintAuthority: signer,\n *   amount: 1000, // note: be sure to consider the mint's `decimals` value\n *   // if decimals=2 => this will mint 10.00 tokens\n *   // if decimals=4 => this will mint 0.100 tokens\n *   destination,\n *   // be sure to set the correct token program when getting the `ata`\n *   ata: await getAssociatedTokenAccountAddress(mint, destination, tokenProgram),\n *   // tokenProgram: TOKEN_PROGRAM_ADDRESS, // default\n *   // tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n * });\n * ```\n */\nexport function getMintTokensInstructions(args: GetMintTokensInstructionsArgs): Instruction[] {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n  args.mint = checkedAddress(args.mint);\n\n  return [\n    // create idempotent will gracefully fail if the ata already exists. this is the gold standard!\n    getCreateAssociatedTokenIdempotentInstruction({\n      owner: checkedAddress(args.destination),\n      mint: args.mint,\n      ata: args.ata,\n      payer: args.feePayer,\n      tokenProgram: args.tokenProgram,\n    }),\n    getMintToInstruction(\n      {\n        mint: args.mint,\n        mintAuthority: args.mintAuthority,\n        token: args.ata,\n        amount: args.amount,\n      },\n      {\n        programAddress: args.tokenProgram,\n      },\n    ),\n  ];\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/instructions/transfer-tokens.ts",
    "content": "import type { Address, Instruction, TransactionSigner } from \"@solana/kit\";\n\nimport { getCreateAssociatedTokenIdempotentInstruction, getTransferInstruction } from \"@solana-program/token-2022\";\nimport { checkedAddress, checkedTransactionSigner } from \"../../../core\";\nimport { checkedTokenProgramAddress } from \"../addresses\";\nimport type { TokenInstructionBase } from \"./types\";\n\nexport type GetTransferTokensInstructionsArgs = TokenInstructionBase & {\n  /**\n   * The source account's owner/delegate or its multi-signature account:\n   * - this should normally by a `TransactionSigner`\n   * - only for multi-sig authorities (like Squads Protocol), should you supply an `Address`\n   * */\n  authority: TransactionSigner | Address;\n  /**\n   * Associated token account (ata) address for `authority` and this `mint`\n   *\n   * See {@link getAssociatedTokenAccountAddress}\n   *\n   * @example\n   * ```\n   * getAssociatedTokenAccountAddress(mint, authority, tokenProgram);\n   * ```\n   * */\n  sourceAta: Address;\n  /** Wallet address to receive the tokens, via their associated token account: `destinationAta` */\n  destination: TransactionSigner | Address;\n  /**\n   * Associated token account (ata) address for `destination` and this `mint`\n   *\n   * See {@link getAssociatedTokenAccountAddress}\n   *\n   * @example\n   * ```\n   * getAssociatedTokenAccountAddress(mint, destination, tokenProgram);\n   * ```\n   * */\n  destinationAta: Address;\n  /** Amount of tokens to be transferred to the `destination` via their `destinationAta` */\n  amount: bigint | number;\n};\n\n/**\n * Create the instructions required to transfer tokens from one wallet to another,\n * including creating the destination ATA if it does not exist\n *\n * @example\n *\n * ```\n * const sourceAta = await getAssociatedTokenAccountAddress(mint, authority, tokenProgram);\n *\n * const destination = address(...);\n * const destinationAta = await getAssociatedTokenAccountAddress(mint, destination, tokenProgram);\n *\n * const instructions = getTransferTokensInstructions({\n *    feePayer: signer,\n *    mint,\n *    amount: 10,\n *    authority: signer, // the source wallet for the tokens to be transferred\n *    sourceAta, // normally derived from the `authority`\n *    destination,\n *    destinationAta, // derived from the `destination`\n *    tokenProgram,\n * });\n * ```\n */\nexport function getTransferTokensInstructions(args: GetTransferTokensInstructionsArgs): Instruction[] {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n  args.mint = checkedAddress(args.mint);\n\n  return [\n    // create idempotent will gracefully fail if the ata already exists. this is the gold standard!\n    getCreateAssociatedTokenIdempotentInstruction({\n      owner: checkedAddress(args.destination),\n      mint: args.mint,\n      ata: args.destinationAta,\n      payer: args.feePayer,\n      tokenProgram: args.tokenProgram,\n    }),\n    getTransferInstruction(\n      {\n        authority: args.authority,\n        source: args.sourceAta,\n        destination: args.destinationAta,\n        amount: args.amount,\n      },\n      {\n        programAddress: args.tokenProgram,\n      },\n    ),\n  ];\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/instructions/types.ts",
    "content": "import type { TOKEN_2022_PROGRAM_ADDRESS } from \"@solana-program/token-2022\";\nimport type { Address, KeyPairSigner, TransactionSigner } from \"@solana/kit\";\nimport type { TOKEN_PROGRAM_ADDRESS } from \"../addresses\";\n\nexport type TokenInstructionBase<TMint = KeyPairSigner | Address> = {\n  /** Signer that will pay for the rent storage deposit fee and transaction fees */\n  feePayer: Address | TransactionSigner;\n  /** Token mint to issue the tokens */\n  mint: TMint;\n  /**\n   * Token program used to create the token's `mint`\n   *\n   * - (default) {@link TOKEN_PROGRAM_ADDRESS} - the original SPL Token Program\n   * - {@link TOKEN_2022_PROGRAM_ADDRESS} - the SPL Token Extensions Program (aka Token22)\n   **/\n  tokenProgram?: Address;\n};\n"
  },
  {
    "path": "packages/gill/src/programs/token/reexports.ts",
    "content": "// Re-exports from @solana-program/token-2022\nexport {\n  AMOUNT_TO_UI_AMOUNT_DISCRIMINATOR,\n  APPLY_CONFIDENTIAL_PENDING_BALANCE_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  APPLY_CONFIDENTIAL_PENDING_BALANCE_DISCRIMINATOR,\n  APPROVE_CHECKED_DISCRIMINATOR,\n  APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR,\n  APPROVE_DISCRIMINATOR,\n  ASSOCIATED_TOKEN_ERROR__INVALID_OWNER,\n  ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n  AccountState,\n  AssociatedTokenInstruction,\n  AuthorityType,\n  BURN_CHECKED_DISCRIMINATOR,\n  BURN_DISCRIMINATOR,\n  CLOSE_ACCOUNT_DISCRIMINATOR,\n  CONFIDENTIAL_DEPOSIT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIDENTIAL_DEPOSIT_DISCRIMINATOR,\n  CONFIDENTIAL_TRANSFER_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIDENTIAL_TRANSFER_WITH_FEE_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIDENTIAL_TRANSFER_WITH_FEE_DISCRIMINATOR,\n  CONFIDENTIAL_WITHDRAW_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIDENTIAL_WITHDRAW_DISCRIMINATOR,\n  CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR,\n  CREATE_ASSOCIATED_TOKEN_DISCRIMINATOR,\n  CREATE_ASSOCIATED_TOKEN_IDEMPOTENT_DISCRIMINATOR,\n  CREATE_NATIVE_MINT_DISCRIMINATOR,\n  DISABLE_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  DISABLE_CONFIDENTIAL_CREDITS_DISCRIMINATOR,\n  DISABLE_CPI_GUARD_CPI_GUARD_DISCRIMINATOR,\n  DISABLE_CPI_GUARD_DISCRIMINATOR,\n  DISABLE_HARVEST_TO_MINT_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  DISABLE_HARVEST_TO_MINT_DISCRIMINATOR,\n  DISABLE_MEMO_TRANSFERS_DISCRIMINATOR,\n  DISABLE_MEMO_TRANSFERS_MEMO_TRANSFERS_DISCRIMINATOR,\n  DISABLE_NON_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  DISABLE_NON_CONFIDENTIAL_CREDITS_DISCRIMINATOR,\n  EMIT_TOKEN_METADATA_DISCRIMINATOR,\n  EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR,\n  ENABLE_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  ENABLE_CONFIDENTIAL_CREDITS_DISCRIMINATOR,\n  ENABLE_CPI_GUARD_CPI_GUARD_DISCRIMINATOR,\n  ENABLE_CPI_GUARD_DISCRIMINATOR,\n  ENABLE_HARVEST_TO_MINT_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  ENABLE_HARVEST_TO_MINT_DISCRIMINATOR,\n  ENABLE_MEMO_TRANSFERS_DISCRIMINATOR,\n  ENABLE_MEMO_TRANSFERS_MEMO_TRANSFERS_DISCRIMINATOR,\n  ENABLE_NON_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  ENABLE_NON_CONFIDENTIAL_CREDITS_DISCRIMINATOR,\n  ExtensionType,\n  FREEZE_ACCOUNT_DISCRIMINATOR,\n  GET_ACCOUNT_DATA_SIZE_DISCRIMINATOR,\n  HARVEST_WITHHELD_TOKENS_TO_MINT_DISCRIMINATOR,\n  HARVEST_WITHHELD_TOKENS_TO_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  HARVEST_WITHHELD_TOKENS_TO_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  HARVEST_WITHHELD_TOKENS_TO_MINT_TRANSFER_FEE_DISCRIMINATOR,\n  INITIALIZE_ACCOUNT2_DISCRIMINATOR,\n  INITIALIZE_ACCOUNT3_DISCRIMINATOR,\n  INITIALIZE_ACCOUNT_DISCRIMINATOR,\n  INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_DISCRIMINATOR,\n  INITIALIZE_DEFAULT_ACCOUNT_STATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR,\n  INITIALIZE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR,\n  INITIALIZE_GROUP_MEMBER_POINTER_DISCRIMINATOR,\n  INITIALIZE_GROUP_MEMBER_POINTER_GROUP_MEMBER_POINTER_DISCRIMINATOR,\n  INITIALIZE_GROUP_POINTER_DISCRIMINATOR,\n  INITIALIZE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR,\n  INITIALIZE_IMMUTABLE_OWNER_DISCRIMINATOR,\n  INITIALIZE_INTEREST_BEARING_MINT_DISCRIMINATOR,\n  INITIALIZE_INTEREST_BEARING_MINT_INTEREST_BEARING_MINT_DISCRIMINATOR,\n  INITIALIZE_METADATA_POINTER_DISCRIMINATOR,\n  INITIALIZE_METADATA_POINTER_METADATA_POINTER_DISCRIMINATOR,\n  INITIALIZE_MINT2_DISCRIMINATOR,\n  INITIALIZE_MINT_CLOSE_AUTHORITY_DISCRIMINATOR,\n  INITIALIZE_MINT_DISCRIMINATOR,\n  INITIALIZE_MULTISIG2_DISCRIMINATOR,\n  INITIALIZE_MULTISIG_DISCRIMINATOR,\n  INITIALIZE_NON_TRANSFERABLE_MINT_DISCRIMINATOR,\n  INITIALIZE_PAUSABLE_CONFIG_DISCRIMINATOR,\n  INITIALIZE_PAUSABLE_CONFIG_PAUSABLE_DISCRIMINATOR,\n  INITIALIZE_PERMANENT_DELEGATE_DISCRIMINATOR,\n  INITIALIZE_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR,\n  INITIALIZE_SCALED_UI_AMOUNT_MINT_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR,\n  INITIALIZE_TOKEN_GROUP_DISCRIMINATOR,\n  INITIALIZE_TOKEN_GROUP_MEMBER_DISCRIMINATOR,\n  INITIALIZE_TOKEN_METADATA_DISCRIMINATOR,\n  INITIALIZE_TRANSFER_FEE_CONFIG_DISCRIMINATOR,\n  INITIALIZE_TRANSFER_FEE_CONFIG_TRANSFER_FEE_DISCRIMINATOR,\n  INITIALIZE_TRANSFER_HOOK_DISCRIMINATOR,\n  INITIALIZE_TRANSFER_HOOK_TRANSFER_HOOK_DISCRIMINATOR,\n  MINT_TO_CHECKED_DISCRIMINATOR,\n  MINT_TO_DISCRIMINATOR,\n  PAUSE_DISCRIMINATOR,\n  PAUSE_PAUSABLE_DISCRIMINATOR,\n  REALLOCATE_DISCRIMINATOR,\n  RECOVER_NESTED_ASSOCIATED_TOKEN_DISCRIMINATOR,\n  REMOVE_TOKEN_METADATA_KEY_DISCRIMINATOR,\n  RESUME_DISCRIMINATOR,\n  RESUME_PAUSABLE_DISCRIMINATOR,\n  REVOKE_DISCRIMINATOR,\n  SET_AUTHORITY_DISCRIMINATOR,\n  SET_TRANSFER_FEE_DISCRIMINATOR,\n  SET_TRANSFER_FEE_TRANSFER_FEE_DISCRIMINATOR,\n  SYNC_NATIVE_DISCRIMINATOR,\n  THAW_ACCOUNT_DISCRIMINATOR,\n  TOKEN_2022_ERROR__ACCOUNT_FROZEN,\n  TOKEN_2022_ERROR__ALREADY_IN_USE,\n  TOKEN_2022_ERROR__AUTHORITY_TYPE_NOT_SUPPORTED,\n  TOKEN_2022_ERROR__FIXED_SUPPLY,\n  TOKEN_2022_ERROR__INSUFFICIENT_FUNDS,\n  TOKEN_2022_ERROR__INVALID_INSTRUCTION,\n  TOKEN_2022_ERROR__INVALID_MINT,\n  TOKEN_2022_ERROR__INVALID_NUMBER_OF_PROVIDED_SIGNERS,\n  TOKEN_2022_ERROR__INVALID_NUMBER_OF_REQUIRED_SIGNERS,\n  TOKEN_2022_ERROR__INVALID_STATE,\n  TOKEN_2022_ERROR__MINT_CANNOT_FREEZE,\n  TOKEN_2022_ERROR__MINT_DECIMALS_MISMATCH,\n  TOKEN_2022_ERROR__MINT_MISMATCH,\n  TOKEN_2022_ERROR__NATIVE_NOT_SUPPORTED,\n  TOKEN_2022_ERROR__NON_NATIVE_HAS_BALANCE,\n  TOKEN_2022_ERROR__NON_NATIVE_NOT_SUPPORTED,\n  TOKEN_2022_ERROR__NOT_RENT_EXEMPT,\n  TOKEN_2022_ERROR__OVERFLOW,\n  TOKEN_2022_ERROR__OWNER_MISMATCH,\n  TOKEN_2022_ERROR__UNINITIALIZED_STATE,\n  TOKEN_2022_PROGRAM_ADDRESS,\n  TRANSFER_CHECKED_DISCRIMINATOR,\n  TRANSFER_CHECKED_WITH_FEE_DISCRIMINATOR,\n  TRANSFER_CHECKED_WITH_FEE_TRANSFER_FEE_DISCRIMINATOR,\n  TRANSFER_DISCRIMINATOR,\n  Token2022Account,\n  Token2022Instruction,\n  UI_AMOUNT_TO_AMOUNT_DISCRIMINATOR,\n  UPDATE_CONFIDENTIAL_TRANSFER_MINT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR,\n  UPDATE_CONFIDENTIAL_TRANSFER_MINT_DISCRIMINATOR,\n  UPDATE_DEFAULT_ACCOUNT_STATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR,\n  UPDATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR,\n  UPDATE_GROUP_MEMBER_POINTER_DISCRIMINATOR,\n  UPDATE_GROUP_MEMBER_POINTER_GROUP_MEMBER_POINTER_DISCRIMINATOR,\n  UPDATE_GROUP_POINTER_DISCRIMINATOR,\n  UPDATE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR,\n  UPDATE_METADATA_POINTER_DISCRIMINATOR,\n  UPDATE_METADATA_POINTER_METADATA_POINTER_DISCRIMINATOR,\n  UPDATE_MULTIPLIER_SCALED_UI_MINT_DISCRIMINATOR,\n  UPDATE_MULTIPLIER_SCALED_UI_MINT_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR,\n  UPDATE_RATE_INTEREST_BEARING_MINT_DISCRIMINATOR,\n  UPDATE_RATE_INTEREST_BEARING_MINT_INTEREST_BEARING_MINT_DISCRIMINATOR,\n  UPDATE_TOKEN_GROUP_MAX_SIZE_DISCRIMINATOR,\n  UPDATE_TOKEN_GROUP_UPDATE_AUTHORITY_DISCRIMINATOR,\n  UPDATE_TOKEN_METADATA_FIELD_DISCRIMINATOR,\n  UPDATE_TOKEN_METADATA_UPDATE_AUTHORITY_DISCRIMINATOR,\n  UPDATE_TRANSFER_HOOK_DISCRIMINATOR,\n  UPDATE_TRANSFER_HOOK_TRANSFER_HOOK_DISCRIMINATOR,\n  WITHDRAW_EXCESS_LAMPORTS_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_TRANSFER_FEE_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_MINT_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR,\n  WITHDRAW_WITHHELD_TOKENS_FROM_MINT_TRANSFER_FEE_DISCRIMINATOR,\n  amountToUiAmountForInterestBearingMintWithoutSimulation,\n  amountToUiAmountForMintWithoutSimulation,\n  amountToUiAmountForScaledUiAmountMintWithoutSimulation,\n  decodeMint,\n  decodeMultisig,\n  decodeToken,\n  extension,\n  fetchAllMaybeMint,\n  fetchAllMaybeMultisig,\n  fetchAllMaybeToken,\n  fetchAllMint,\n  fetchAllMultisig,\n  fetchAllToken,\n  fetchMaybeMint,\n  fetchMaybeMultisig,\n  fetchMaybeToken,\n  fetchMint,\n  fetchMultisig,\n  fetchToken,\n  findAssociatedTokenPda,\n  getAccountStateCodec,\n  getAccountStateDecoder,\n  getAccountStateEncoder,\n  getAmountToUiAmountDiscriminatorBytes,\n  getAmountToUiAmountInstruction,\n  getAmountToUiAmountInstructionDataCodec,\n  getAmountToUiAmountInstructionDataDecoder,\n  getAmountToUiAmountInstructionDataEncoder,\n  getApplyConfidentialPendingBalanceConfidentialTransferDiscriminatorBytes,\n  getApplyConfidentialPendingBalanceDiscriminatorBytes,\n  getApplyConfidentialPendingBalanceInstruction,\n  getApplyConfidentialPendingBalanceInstructionDataCodec,\n  getApplyConfidentialPendingBalanceInstructionDataDecoder,\n  getApplyConfidentialPendingBalanceInstructionDataEncoder,\n  getApproveCheckedDiscriminatorBytes,\n  getApproveCheckedInstruction,\n  getApproveCheckedInstructionDataCodec,\n  getApproveCheckedInstructionDataDecoder,\n  getApproveCheckedInstructionDataEncoder,\n  getApproveConfidentialTransferAccountConfidentialTransferDiscriminatorBytes,\n  getApproveConfidentialTransferAccountDiscriminatorBytes,\n  getApproveConfidentialTransferAccountInstruction,\n  getApproveConfidentialTransferAccountInstructionDataCodec,\n  getApproveConfidentialTransferAccountInstructionDataDecoder,\n  getApproveConfidentialTransferAccountInstructionDataEncoder,\n  getApproveDiscriminatorBytes,\n  getApproveInstruction,\n  getApproveInstructionDataCodec,\n  getApproveInstructionDataDecoder,\n  getApproveInstructionDataEncoder,\n  getAssociatedTokenErrorMessage,\n  getAuthorityTypeCodec,\n  getAuthorityTypeDecoder,\n  getAuthorityTypeEncoder,\n  getBurnCheckedDiscriminatorBytes,\n  getBurnCheckedInstruction,\n  getBurnCheckedInstructionDataCodec,\n  getBurnCheckedInstructionDataDecoder,\n  getBurnCheckedInstructionDataEncoder,\n  getBurnDiscriminatorBytes,\n  getBurnInstruction,\n  getBurnInstructionDataCodec,\n  getBurnInstructionDataDecoder,\n  getBurnInstructionDataEncoder,\n  getCloseAccountDiscriminatorBytes,\n  getCloseAccountInstruction,\n  getCloseAccountInstructionDataCodec,\n  getCloseAccountInstructionDataDecoder,\n  getCloseAccountInstructionDataEncoder,\n  getConfidentialDepositConfidentialTransferDiscriminatorBytes,\n  getConfidentialDepositDiscriminatorBytes,\n  getConfidentialDepositInstruction,\n  getConfidentialDepositInstructionDataCodec,\n  getConfidentialDepositInstructionDataDecoder,\n  getConfidentialDepositInstructionDataEncoder,\n  getConfidentialTransferConfidentialTransferDiscriminatorBytes,\n  getConfidentialTransferDiscriminatorBytes,\n  getConfidentialTransferInstruction,\n  getConfidentialTransferInstructionDataCodec,\n  getConfidentialTransferInstructionDataDecoder,\n  getConfidentialTransferInstructionDataEncoder,\n  getConfidentialTransferWithFeeConfidentialTransferDiscriminatorBytes,\n  getConfidentialTransferWithFeeDiscriminatorBytes,\n  getConfidentialTransferWithFeeInstruction,\n  getConfidentialTransferWithFeeInstructionDataCodec,\n  getConfidentialTransferWithFeeInstructionDataDecoder,\n  getConfidentialTransferWithFeeInstructionDataEncoder,\n  getConfidentialWithdrawConfidentialTransferDiscriminatorBytes,\n  getConfidentialWithdrawDiscriminatorBytes,\n  getConfidentialWithdrawInstruction,\n  getConfidentialWithdrawInstructionDataCodec,\n  getConfidentialWithdrawInstructionDataDecoder,\n  getConfidentialWithdrawInstructionDataEncoder,\n  getConfigureConfidentialTransferAccountConfidentialTransferDiscriminatorBytes,\n  getConfigureConfidentialTransferAccountDiscriminatorBytes,\n  getConfigureConfidentialTransferAccountInstruction,\n  getConfigureConfidentialTransferAccountInstructionDataCodec,\n  getConfigureConfidentialTransferAccountInstructionDataDecoder,\n  getConfigureConfidentialTransferAccountInstructionDataEncoder,\n  getCreateAssociatedTokenDiscriminatorBytes,\n  getCreateAssociatedTokenIdempotentDiscriminatorBytes,\n  getCreateAssociatedTokenIdempotentInstruction,\n  getCreateAssociatedTokenIdempotentInstructionAsync,\n  getCreateAssociatedTokenIdempotentInstructionDataCodec,\n  getCreateAssociatedTokenIdempotentInstructionDataDecoder,\n  getCreateAssociatedTokenIdempotentInstructionDataEncoder,\n  getCreateAssociatedTokenInstruction,\n  getCreateAssociatedTokenInstructionAsync,\n  getCreateAssociatedTokenInstructionDataCodec,\n  getCreateAssociatedTokenInstructionDataDecoder,\n  getCreateAssociatedTokenInstructionDataEncoder,\n  getCreateNativeMintDiscriminatorBytes,\n  getCreateNativeMintInstruction,\n  getCreateNativeMintInstructionDataCodec,\n  getCreateNativeMintInstructionDataDecoder,\n  getCreateNativeMintInstructionDataEncoder,\n  getDecryptableBalanceCodec,\n  getDecryptableBalanceDecoder,\n  getDecryptableBalanceEncoder,\n  getDisableConfidentialCreditsConfidentialTransferDiscriminatorBytes,\n  getDisableConfidentialCreditsDiscriminatorBytes,\n  getDisableConfidentialCreditsInstruction,\n  getDisableConfidentialCreditsInstructionDataCodec,\n  getDisableConfidentialCreditsInstructionDataDecoder,\n  getDisableConfidentialCreditsInstructionDataEncoder,\n  getDisableCpiGuardCpiGuardDiscriminatorBytes,\n  getDisableCpiGuardDiscriminatorBytes,\n  getDisableCpiGuardInstruction,\n  getDisableCpiGuardInstructionDataCodec,\n  getDisableCpiGuardInstructionDataDecoder,\n  getDisableCpiGuardInstructionDataEncoder,\n  getDisableHarvestToMintConfidentialTransferFeeDiscriminatorBytes,\n  getDisableHarvestToMintDiscriminatorBytes,\n  getDisableHarvestToMintInstruction,\n  getDisableHarvestToMintInstructionDataCodec,\n  getDisableHarvestToMintInstructionDataDecoder,\n  getDisableHarvestToMintInstructionDataEncoder,\n  getDisableMemoTransfersDiscriminatorBytes,\n  getDisableMemoTransfersInstruction,\n  getDisableMemoTransfersInstructionDataCodec,\n  getDisableMemoTransfersInstructionDataDecoder,\n  getDisableMemoTransfersInstructionDataEncoder,\n  getDisableMemoTransfersMemoTransfersDiscriminatorBytes,\n  getDisableNonConfidentialCreditsConfidentialTransferDiscriminatorBytes,\n  getDisableNonConfidentialCreditsDiscriminatorBytes,\n  getDisableNonConfidentialCreditsInstruction,\n  getDisableNonConfidentialCreditsInstructionDataCodec,\n  getDisableNonConfidentialCreditsInstructionDataDecoder,\n  getDisableNonConfidentialCreditsInstructionDataEncoder,\n  getEmitTokenMetadataDiscriminatorBytes,\n  getEmitTokenMetadataInstruction,\n  getEmitTokenMetadataInstructionDataCodec,\n  getEmitTokenMetadataInstructionDataDecoder,\n  getEmitTokenMetadataInstructionDataEncoder,\n  getEmptyConfidentialTransferAccountConfidentialTransferDiscriminatorBytes,\n  getEmptyConfidentialTransferAccountDiscriminatorBytes,\n  getEmptyConfidentialTransferAccountInstruction,\n  getEmptyConfidentialTransferAccountInstructionDataCodec,\n  getEmptyConfidentialTransferAccountInstructionDataDecoder,\n  getEmptyConfidentialTransferAccountInstructionDataEncoder,\n  getEnableConfidentialCreditsConfidentialTransferDiscriminatorBytes,\n  getEnableConfidentialCreditsDiscriminatorBytes,\n  getEnableConfidentialCreditsInstruction,\n  getEnableConfidentialCreditsInstructionDataCodec,\n  getEnableConfidentialCreditsInstructionDataDecoder,\n  getEnableConfidentialCreditsInstructionDataEncoder,\n  getEnableCpiGuardCpiGuardDiscriminatorBytes,\n  getEnableCpiGuardDiscriminatorBytes,\n  getEnableCpiGuardInstruction,\n  getEnableCpiGuardInstructionDataCodec,\n  getEnableCpiGuardInstructionDataDecoder,\n  getEnableCpiGuardInstructionDataEncoder,\n  getEnableHarvestToMintConfidentialTransferFeeDiscriminatorBytes,\n  getEnableHarvestToMintDiscriminatorBytes,\n  getEnableHarvestToMintInstruction,\n  getEnableHarvestToMintInstructionDataCodec,\n  getEnableHarvestToMintInstructionDataDecoder,\n  getEnableHarvestToMintInstructionDataEncoder,\n  getEnableMemoTransfersDiscriminatorBytes,\n  getEnableMemoTransfersInstruction,\n  getEnableMemoTransfersInstructionDataCodec,\n  getEnableMemoTransfersInstructionDataDecoder,\n  getEnableMemoTransfersInstructionDataEncoder,\n  getEnableMemoTransfersMemoTransfersDiscriminatorBytes,\n  getEnableNonConfidentialCreditsConfidentialTransferDiscriminatorBytes,\n  getEnableNonConfidentialCreditsDiscriminatorBytes,\n  getEnableNonConfidentialCreditsInstruction,\n  getEnableNonConfidentialCreditsInstructionDataCodec,\n  getEnableNonConfidentialCreditsInstructionDataDecoder,\n  getEnableNonConfidentialCreditsInstructionDataEncoder,\n  getEncryptedBalanceCodec,\n  getEncryptedBalanceDecoder,\n  getEncryptedBalanceEncoder,\n  getExtensionCodec,\n  getExtensionDecoder,\n  getExtensionEncoder,\n  getExtensionTypeCodec,\n  getExtensionTypeDecoder,\n  getExtensionTypeEncoder,\n  getFreezeAccountDiscriminatorBytes,\n  getFreezeAccountInstruction,\n  getFreezeAccountInstructionDataCodec,\n  getFreezeAccountInstructionDataDecoder,\n  getFreezeAccountInstructionDataEncoder,\n  getGetAccountDataSizeDiscriminatorBytes,\n  getGetAccountDataSizeInstruction,\n  getGetAccountDataSizeInstructionDataCodec,\n  getGetAccountDataSizeInstructionDataDecoder,\n  getGetAccountDataSizeInstructionDataEncoder,\n  getHarvestWithheldTokensToMintDiscriminatorBytes,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeDiscriminatorBytes,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataCodec,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataDecoder,\n  getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataEncoder,\n  getHarvestWithheldTokensToMintInstruction,\n  getHarvestWithheldTokensToMintInstructionDataCodec,\n  getHarvestWithheldTokensToMintInstructionDataDecoder,\n  getHarvestWithheldTokensToMintInstructionDataEncoder,\n  getHarvestWithheldTokensToMintTransferFeeDiscriminatorBytes,\n  getInitializeAccount2DiscriminatorBytes,\n  getInitializeAccount2Instruction,\n  getInitializeAccount2InstructionDataCodec,\n  getInitializeAccount2InstructionDataDecoder,\n  getInitializeAccount2InstructionDataEncoder,\n  getInitializeAccount3DiscriminatorBytes,\n  getInitializeAccount3Instruction,\n  getInitializeAccount3InstructionDataCodec,\n  getInitializeAccount3InstructionDataDecoder,\n  getInitializeAccount3InstructionDataEncoder,\n  getInitializeAccountDiscriminatorBytes,\n  getInitializeAccountInstruction,\n  getInitializeAccountInstructionDataCodec,\n  getInitializeAccountInstructionDataDecoder,\n  getInitializeAccountInstructionDataEncoder,\n  getInitializeConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes,\n  getInitializeConfidentialTransferFeeDiscriminatorBytes,\n  getInitializeConfidentialTransferFeeInstruction,\n  getInitializeConfidentialTransferFeeInstructionDataCodec,\n  getInitializeConfidentialTransferFeeInstructionDataDecoder,\n  getInitializeConfidentialTransferFeeInstructionDataEncoder,\n  getInitializeConfidentialTransferMintConfidentialTransferDiscriminatorBytes,\n  getInitializeConfidentialTransferMintDiscriminatorBytes,\n  getInitializeConfidentialTransferMintInstruction,\n  getInitializeConfidentialTransferMintInstructionDataCodec,\n  getInitializeConfidentialTransferMintInstructionDataDecoder,\n  getInitializeConfidentialTransferMintInstructionDataEncoder,\n  getInitializeDefaultAccountStateDefaultAccountStateDiscriminatorBytes,\n  getInitializeDefaultAccountStateDiscriminatorBytes,\n  getInitializeDefaultAccountStateInstruction,\n  getInitializeDefaultAccountStateInstructionDataCodec,\n  getInitializeDefaultAccountStateInstructionDataDecoder,\n  getInitializeDefaultAccountStateInstructionDataEncoder,\n  getInitializeGroupMemberPointerDiscriminatorBytes,\n  getInitializeGroupMemberPointerGroupMemberPointerDiscriminatorBytes,\n  getInitializeGroupMemberPointerInstruction,\n  getInitializeGroupMemberPointerInstructionDataCodec,\n  getInitializeGroupMemberPointerInstructionDataDecoder,\n  getInitializeGroupMemberPointerInstructionDataEncoder,\n  getInitializeGroupPointerDiscriminatorBytes,\n  getInitializeGroupPointerGroupPointerDiscriminatorBytes,\n  getInitializeGroupPointerInstruction,\n  getInitializeGroupPointerInstructionDataCodec,\n  getInitializeGroupPointerInstructionDataDecoder,\n  getInitializeGroupPointerInstructionDataEncoder,\n  getInitializeImmutableOwnerDiscriminatorBytes,\n  getInitializeImmutableOwnerInstruction,\n  getInitializeImmutableOwnerInstructionDataCodec,\n  getInitializeImmutableOwnerInstructionDataDecoder,\n  getInitializeImmutableOwnerInstructionDataEncoder,\n  getInitializeInterestBearingMintDiscriminatorBytes,\n  getInitializeInterestBearingMintInstruction,\n  getInitializeInterestBearingMintInstructionDataCodec,\n  getInitializeInterestBearingMintInstructionDataDecoder,\n  getInitializeInterestBearingMintInstructionDataEncoder,\n  getInitializeInterestBearingMintInterestBearingMintDiscriminatorBytes,\n  getInitializeMetadataPointerDiscriminatorBytes,\n  getInitializeMetadataPointerInstruction,\n  getInitializeMetadataPointerInstructionDataCodec,\n  getInitializeMetadataPointerInstructionDataDecoder,\n  getInitializeMetadataPointerInstructionDataEncoder,\n  getInitializeMetadataPointerMetadataPointerDiscriminatorBytes,\n  getInitializeMint2DiscriminatorBytes,\n  getInitializeMint2Instruction,\n  getInitializeMint2InstructionDataCodec,\n  getInitializeMint2InstructionDataDecoder,\n  getInitializeMint2InstructionDataEncoder,\n  getInitializeMintCloseAuthorityDiscriminatorBytes,\n  getInitializeMintCloseAuthorityInstruction,\n  getInitializeMintCloseAuthorityInstructionDataCodec,\n  getInitializeMintCloseAuthorityInstructionDataDecoder,\n  getInitializeMintCloseAuthorityInstructionDataEncoder,\n  getInitializeMintDiscriminatorBytes,\n  getInitializeMintInstruction,\n  getInitializeMintInstructionDataCodec,\n  getInitializeMintInstructionDataDecoder,\n  getInitializeMintInstructionDataEncoder,\n  getInitializeMultisig2DiscriminatorBytes,\n  getInitializeMultisig2Instruction,\n  getInitializeMultisig2InstructionDataCodec,\n  getInitializeMultisig2InstructionDataDecoder,\n  getInitializeMultisig2InstructionDataEncoder,\n  getInitializeMultisigDiscriminatorBytes,\n  getInitializeMultisigInstruction,\n  getInitializeMultisigInstructionDataCodec,\n  getInitializeMultisigInstructionDataDecoder,\n  getInitializeMultisigInstructionDataEncoder,\n  getInitializeNonTransferableMintDiscriminatorBytes,\n  getInitializeNonTransferableMintInstruction,\n  getInitializeNonTransferableMintInstructionDataCodec,\n  getInitializeNonTransferableMintInstructionDataDecoder,\n  getInitializeNonTransferableMintInstructionDataEncoder,\n  getInitializePausableConfigDiscriminatorBytes,\n  getInitializePausableConfigInstruction,\n  getInitializePausableConfigInstructionDataCodec,\n  getInitializePausableConfigInstructionDataDecoder,\n  getInitializePausableConfigInstructionDataEncoder,\n  getInitializePausableConfigPausableDiscriminatorBytes,\n  getInitializePermanentDelegateDiscriminatorBytes,\n  getInitializePermanentDelegateInstruction,\n  getInitializePermanentDelegateInstructionDataCodec,\n  getInitializePermanentDelegateInstructionDataDecoder,\n  getInitializePermanentDelegateInstructionDataEncoder,\n  getInitializeScaledUiAmountMintDiscriminatorBytes,\n  getInitializeScaledUiAmountMintInstruction,\n  getInitializeScaledUiAmountMintInstructionDataCodec,\n  getInitializeScaledUiAmountMintInstructionDataDecoder,\n  getInitializeScaledUiAmountMintInstructionDataEncoder,\n  getInitializeScaledUiAmountMintScaledUiAmountMintDiscriminatorBytes,\n  getInitializeTokenGroupDiscriminatorBytes,\n  getInitializeTokenGroupInstruction,\n  getInitializeTokenGroupInstructionDataCodec,\n  getInitializeTokenGroupInstructionDataDecoder,\n  getInitializeTokenGroupInstructionDataEncoder,\n  getInitializeTokenGroupMemberDiscriminatorBytes,\n  getInitializeTokenGroupMemberInstruction,\n  getInitializeTokenGroupMemberInstructionDataCodec,\n  getInitializeTokenGroupMemberInstructionDataDecoder,\n  getInitializeTokenGroupMemberInstructionDataEncoder,\n  getInitializeTokenMetadataDiscriminatorBytes,\n  getInitializeTokenMetadataInstruction,\n  getInitializeTokenMetadataInstructionDataCodec,\n  getInitializeTokenMetadataInstructionDataDecoder,\n  getInitializeTokenMetadataInstructionDataEncoder,\n  getInitializeTransferFeeConfigDiscriminatorBytes,\n  getInitializeTransferFeeConfigInstruction,\n  getInitializeTransferFeeConfigInstructionDataCodec,\n  getInitializeTransferFeeConfigInstructionDataDecoder,\n  getInitializeTransferFeeConfigInstructionDataEncoder,\n  getInitializeTransferFeeConfigTransferFeeDiscriminatorBytes,\n  getInitializeTransferHookDiscriminatorBytes,\n  getInitializeTransferHookInstruction,\n  getInitializeTransferHookInstructionDataCodec,\n  getInitializeTransferHookInstructionDataDecoder,\n  getInitializeTransferHookInstructionDataEncoder,\n  getInitializeTransferHookTransferHookDiscriminatorBytes,\n  getMintCodec,\n  getMintDecoder,\n  getMintEncoder,\n  getMintSize,\n  getMintToCheckedDiscriminatorBytes,\n  getMintToCheckedInstruction,\n  getMintToCheckedInstructionDataCodec,\n  getMintToCheckedInstructionDataDecoder,\n  getMintToCheckedInstructionDataEncoder,\n  getMintToDiscriminatorBytes,\n  getMintToInstruction,\n  getMintToInstructionDataCodec,\n  getMintToInstructionDataDecoder,\n  getMintToInstructionDataEncoder,\n  getMultisigCodec,\n  getMultisigDecoder,\n  getMultisigEncoder,\n  getMultisigSize,\n  getPauseDiscriminatorBytes,\n  getPauseInstruction,\n  getPauseInstructionDataCodec,\n  getPauseInstructionDataDecoder,\n  getPauseInstructionDataEncoder,\n  getPausePausableDiscriminatorBytes,\n  getPostInitializeInstructionsForMintExtensions,\n  getPostInitializeInstructionsForTokenExtensions,\n  getPreInitializeInstructionsForMintExtensions,\n  getReallocateDiscriminatorBytes,\n  getReallocateInstruction,\n  getReallocateInstructionDataCodec,\n  getReallocateInstructionDataDecoder,\n  getReallocateInstructionDataEncoder,\n  getRecoverNestedAssociatedTokenDiscriminatorBytes,\n  getRecoverNestedAssociatedTokenInstruction,\n  getRecoverNestedAssociatedTokenInstructionAsync,\n  getRecoverNestedAssociatedTokenInstructionDataCodec,\n  getRecoverNestedAssociatedTokenInstructionDataDecoder,\n  getRecoverNestedAssociatedTokenInstructionDataEncoder,\n  getRemoveTokenMetadataKeyDiscriminatorBytes,\n  getRemoveTokenMetadataKeyInstruction,\n  getRemoveTokenMetadataKeyInstructionDataCodec,\n  getRemoveTokenMetadataKeyInstructionDataDecoder,\n  getRemoveTokenMetadataKeyInstructionDataEncoder,\n  getResumeDiscriminatorBytes,\n  getResumeInstruction,\n  getResumeInstructionDataCodec,\n  getResumeInstructionDataDecoder,\n  getResumeInstructionDataEncoder,\n  getResumePausableDiscriminatorBytes,\n  getRevokeDiscriminatorBytes,\n  getRevokeInstruction,\n  getRevokeInstructionDataCodec,\n  getRevokeInstructionDataDecoder,\n  getRevokeInstructionDataEncoder,\n  getSetAuthorityDiscriminatorBytes,\n  getSetAuthorityInstruction,\n  getSetAuthorityInstructionDataCodec,\n  getSetAuthorityInstructionDataDecoder,\n  getSetAuthorityInstructionDataEncoder,\n  getSetTransferFeeDiscriminatorBytes,\n  getSetTransferFeeInstruction,\n  getSetTransferFeeInstructionDataCodec,\n  getSetTransferFeeInstructionDataDecoder,\n  getSetTransferFeeInstructionDataEncoder,\n  getSetTransferFeeTransferFeeDiscriminatorBytes,\n  getSyncNativeDiscriminatorBytes,\n  getSyncNativeInstruction,\n  getSyncNativeInstructionDataCodec,\n  getSyncNativeInstructionDataDecoder,\n  getSyncNativeInstructionDataEncoder,\n  getThawAccountDiscriminatorBytes,\n  getThawAccountInstruction,\n  getThawAccountInstructionDataCodec,\n  getThawAccountInstructionDataDecoder,\n  getThawAccountInstructionDataEncoder,\n  getToken2022ErrorMessage,\n  getTokenCodec,\n  getTokenDecoder,\n  getTokenEncoder,\n  getTokenMetadataFieldCodec,\n  getTokenMetadataFieldDecoder,\n  getTokenMetadataFieldEncoder,\n  getTokenSize,\n  getTransferCheckedDiscriminatorBytes,\n  getTransferCheckedInstruction,\n  getTransferCheckedInstructionDataCodec,\n  getTransferCheckedInstructionDataDecoder,\n  getTransferCheckedInstructionDataEncoder,\n  getTransferCheckedWithFeeDiscriminatorBytes,\n  getTransferCheckedWithFeeInstruction,\n  getTransferCheckedWithFeeInstructionDataCodec,\n  getTransferCheckedWithFeeInstructionDataDecoder,\n  getTransferCheckedWithFeeInstructionDataEncoder,\n  getTransferCheckedWithFeeTransferFeeDiscriminatorBytes,\n  getTransferDiscriminatorBytes,\n  getTransferFeeCodec,\n  getTransferFeeDecoder,\n  getTransferFeeEncoder,\n  getTransferInstruction,\n  getTransferInstructionDataCodec,\n  getTransferInstructionDataDecoder,\n  getTransferInstructionDataEncoder,\n  getUiAmountToAmountDiscriminatorBytes,\n  getUiAmountToAmountInstruction,\n  getUiAmountToAmountInstructionDataCodec,\n  getUiAmountToAmountInstructionDataDecoder,\n  getUiAmountToAmountInstructionDataEncoder,\n  getUpdateConfidentialTransferMintConfidentialTransferDiscriminatorBytes,\n  getUpdateConfidentialTransferMintDiscriminatorBytes,\n  getUpdateConfidentialTransferMintInstruction,\n  getUpdateConfidentialTransferMintInstructionDataCodec,\n  getUpdateConfidentialTransferMintInstructionDataDecoder,\n  getUpdateConfidentialTransferMintInstructionDataEncoder,\n  getUpdateDefaultAccountStateDefaultAccountStateDiscriminatorBytes,\n  getUpdateDefaultAccountStateDiscriminatorBytes,\n  getUpdateDefaultAccountStateInstruction,\n  getUpdateDefaultAccountStateInstructionDataCodec,\n  getUpdateDefaultAccountStateInstructionDataDecoder,\n  getUpdateDefaultAccountStateInstructionDataEncoder,\n  getUpdateGroupMemberPointerDiscriminatorBytes,\n  getUpdateGroupMemberPointerGroupMemberPointerDiscriminatorBytes,\n  getUpdateGroupMemberPointerInstruction,\n  getUpdateGroupMemberPointerInstructionDataCodec,\n  getUpdateGroupMemberPointerInstructionDataDecoder,\n  getUpdateGroupMemberPointerInstructionDataEncoder,\n  getUpdateGroupPointerDiscriminatorBytes,\n  getUpdateGroupPointerGroupPointerDiscriminatorBytes,\n  getUpdateGroupPointerInstruction,\n  getUpdateGroupPointerInstructionDataCodec,\n  getUpdateGroupPointerInstructionDataDecoder,\n  getUpdateGroupPointerInstructionDataEncoder,\n  getUpdateMetadataPointerDiscriminatorBytes,\n  getUpdateMetadataPointerInstruction,\n  getUpdateMetadataPointerInstructionDataCodec,\n  getUpdateMetadataPointerInstructionDataDecoder,\n  getUpdateMetadataPointerInstructionDataEncoder,\n  getUpdateMetadataPointerMetadataPointerDiscriminatorBytes,\n  getUpdateMultiplierScaledUiMintDiscriminatorBytes,\n  getUpdateMultiplierScaledUiMintInstruction,\n  getUpdateMultiplierScaledUiMintInstructionDataCodec,\n  getUpdateMultiplierScaledUiMintInstructionDataDecoder,\n  getUpdateMultiplierScaledUiMintInstructionDataEncoder,\n  getUpdateMultiplierScaledUiMintScaledUiAmountMintDiscriminatorBytes,\n  getUpdateRateInterestBearingMintDiscriminatorBytes,\n  getUpdateRateInterestBearingMintInstruction,\n  getUpdateRateInterestBearingMintInstructionDataCodec,\n  getUpdateRateInterestBearingMintInstructionDataDecoder,\n  getUpdateRateInterestBearingMintInstructionDataEncoder,\n  getUpdateRateInterestBearingMintInterestBearingMintDiscriminatorBytes,\n  getUpdateTokenGroupMaxSizeDiscriminatorBytes,\n  getUpdateTokenGroupMaxSizeInstruction,\n  getUpdateTokenGroupMaxSizeInstructionDataCodec,\n  getUpdateTokenGroupMaxSizeInstructionDataDecoder,\n  getUpdateTokenGroupMaxSizeInstructionDataEncoder,\n  getUpdateTokenGroupUpdateAuthorityDiscriminatorBytes,\n  getUpdateTokenGroupUpdateAuthorityInstruction,\n  getUpdateTokenGroupUpdateAuthorityInstructionDataCodec,\n  getUpdateTokenGroupUpdateAuthorityInstructionDataDecoder,\n  getUpdateTokenGroupUpdateAuthorityInstructionDataEncoder,\n  getUpdateTokenMetadataFieldDiscriminatorBytes,\n  getUpdateTokenMetadataFieldInstruction,\n  getUpdateTokenMetadataFieldInstructionDataCodec,\n  getUpdateTokenMetadataFieldInstructionDataDecoder,\n  getUpdateTokenMetadataFieldInstructionDataEncoder,\n  getUpdateTokenMetadataUpdateAuthorityDiscriminatorBytes,\n  getUpdateTokenMetadataUpdateAuthorityInstruction,\n  getUpdateTokenMetadataUpdateAuthorityInstructionDataCodec,\n  getUpdateTokenMetadataUpdateAuthorityInstructionDataDecoder,\n  getUpdateTokenMetadataUpdateAuthorityInstructionDataEncoder,\n  getUpdateTransferHookDiscriminatorBytes,\n  getUpdateTransferHookInstruction,\n  getUpdateTransferHookInstructionDataCodec,\n  getUpdateTransferHookInstructionDataDecoder,\n  getUpdateTransferHookInstructionDataEncoder,\n  getUpdateTransferHookTransferHookDiscriminatorBytes,\n  getWithdrawExcessLamportsDiscriminatorBytes,\n  getWithdrawExcessLamportsInstruction,\n  getWithdrawExcessLamportsInstructionDataCodec,\n  getWithdrawExcessLamportsInstructionDataDecoder,\n  getWithdrawExcessLamportsInstructionDataEncoder,\n  getWithdrawWithheldTokensFromAccountsDiscriminatorBytes,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeDiscriminatorBytes,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataCodec,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataDecoder,\n  getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataEncoder,\n  getWithdrawWithheldTokensFromAccountsInstruction,\n  getWithdrawWithheldTokensFromAccountsInstructionDataCodec,\n  getWithdrawWithheldTokensFromAccountsInstructionDataDecoder,\n  getWithdrawWithheldTokensFromAccountsInstructionDataEncoder,\n  getWithdrawWithheldTokensFromAccountsTransferFeeDiscriminatorBytes,\n  getWithdrawWithheldTokensFromMintDiscriminatorBytes,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeDiscriminatorBytes,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataCodec,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataDecoder,\n  getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataEncoder,\n  getWithdrawWithheldTokensFromMintInstruction,\n  getWithdrawWithheldTokensFromMintInstructionDataCodec,\n  getWithdrawWithheldTokensFromMintInstructionDataDecoder,\n  getWithdrawWithheldTokensFromMintInstructionDataEncoder,\n  getWithdrawWithheldTokensFromMintTransferFeeDiscriminatorBytes,\n  identifyAssociatedTokenInstruction,\n  identifyToken2022Account,\n  identifyToken2022Instruction,\n  isAssociatedTokenError,\n  isExtension,\n  isToken2022Error,\n  isTokenMetadataField,\n  parseAmountToUiAmountInstruction,\n  parseApplyConfidentialPendingBalanceInstruction,\n  parseApproveCheckedInstruction,\n  parseApproveConfidentialTransferAccountInstruction,\n  parseApproveInstruction,\n  parseBurnCheckedInstruction,\n  parseBurnInstruction,\n  parseCloseAccountInstruction,\n  parseConfidentialDepositInstruction,\n  parseConfidentialTransferInstruction,\n  parseConfidentialTransferWithFeeInstruction,\n  parseConfidentialWithdrawInstruction,\n  parseConfigureConfidentialTransferAccountInstruction,\n  parseCreateAssociatedTokenIdempotentInstruction,\n  parseCreateAssociatedTokenInstruction,\n  parseCreateNativeMintInstruction,\n  parseDisableConfidentialCreditsInstruction,\n  parseDisableCpiGuardInstruction,\n  parseDisableHarvestToMintInstruction,\n  parseDisableMemoTransfersInstruction,\n  parseDisableNonConfidentialCreditsInstruction,\n  parseEmitTokenMetadataInstruction,\n  parseEmptyConfidentialTransferAccountInstruction,\n  parseEnableConfidentialCreditsInstruction,\n  parseEnableCpiGuardInstruction,\n  parseEnableHarvestToMintInstruction,\n  parseEnableMemoTransfersInstruction,\n  parseEnableNonConfidentialCreditsInstruction,\n  parseFreezeAccountInstruction,\n  parseGetAccountDataSizeInstruction,\n  parseHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction,\n  parseHarvestWithheldTokensToMintInstruction,\n  parseInitializeAccount2Instruction,\n  parseInitializeAccount3Instruction,\n  parseInitializeAccountInstruction,\n  parseInitializeConfidentialTransferFeeInstruction,\n  parseInitializeConfidentialTransferMintInstruction,\n  parseInitializeDefaultAccountStateInstruction,\n  parseInitializeGroupMemberPointerInstruction,\n  parseInitializeGroupPointerInstruction,\n  parseInitializeImmutableOwnerInstruction,\n  parseInitializeInterestBearingMintInstruction,\n  parseInitializeMetadataPointerInstruction,\n  parseInitializeMint2Instruction,\n  parseInitializeMintCloseAuthorityInstruction,\n  parseInitializeMintInstruction,\n  parseInitializeMultisig2Instruction,\n  parseInitializeMultisigInstruction,\n  parseInitializeNonTransferableMintInstruction,\n  parseInitializePausableConfigInstruction,\n  parseInitializePermanentDelegateInstruction,\n  parseInitializeScaledUiAmountMintInstruction,\n  parseInitializeTokenGroupInstruction,\n  parseInitializeTokenGroupMemberInstruction,\n  parseInitializeTokenMetadataInstruction,\n  parseInitializeTransferFeeConfigInstruction,\n  parseInitializeTransferHookInstruction,\n  parseMintToCheckedInstruction,\n  parseMintToInstruction,\n  parsePauseInstruction,\n  parseReallocateInstruction,\n  parseRecoverNestedAssociatedTokenInstruction,\n  parseRemoveTokenMetadataKeyInstruction,\n  parseResumeInstruction,\n  parseRevokeInstruction,\n  parseSetAuthorityInstruction,\n  parseSetTransferFeeInstruction,\n  parseSyncNativeInstruction,\n  parseThawAccountInstruction,\n  parseTransferCheckedInstruction,\n  parseTransferCheckedWithFeeInstruction,\n  parseTransferInstruction,\n  parseUiAmountToAmountInstruction,\n  parseUpdateConfidentialTransferMintInstruction,\n  parseUpdateDefaultAccountStateInstruction,\n  parseUpdateGroupMemberPointerInstruction,\n  parseUpdateGroupPointerInstruction,\n  parseUpdateMetadataPointerInstruction,\n  parseUpdateMultiplierScaledUiMintInstruction,\n  parseUpdateRateInterestBearingMintInstruction,\n  parseUpdateTokenGroupMaxSizeInstruction,\n  parseUpdateTokenGroupUpdateAuthorityInstruction,\n  parseUpdateTokenMetadataFieldInstruction,\n  parseUpdateTokenMetadataUpdateAuthorityInstruction,\n  parseUpdateTransferHookInstruction,\n  parseWithdrawExcessLamportsInstruction,\n  parseWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction,\n  parseWithdrawWithheldTokensFromAccountsInstruction,\n  parseWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction,\n  parseWithdrawWithheldTokensFromMintInstruction,\n  tokenMetadataField,\n  uiAmountToAmountForInterestBearingMintWithoutSimulation,\n  uiAmountToAmountForMintWithoutSimulation,\n  uiAmountToAmountForScaledUiAmountMintWithoutSimulation,\n} from \"@solana-program/token-2022\";\n\nexport type * from \"@solana-program/token-2022\";\n"
  },
  {
    "path": "packages/gill/src/programs/token/transactions/create-token.ts",
    "content": "import { TOKEN_2022_PROGRAM_ADDRESS } from \"@solana-program/token-2022\";\nimport type {\n  TransactionMessageWithFeePayer,\n  KeyPairSigner,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\nimport { checkedTransactionSigner, createTransaction } from \"../../../core\";\nimport type { FullTransaction, Simplify } from \"../../../types\";\nimport { getTokenMetadataAddress } from \"../../token-metadata\";\nimport { checkedTokenProgramAddress, TOKEN_PROGRAM_ADDRESS } from \"../addresses\";\nimport { getCreateTokenInstructions, type GetCreateTokenInstructionsArgs } from \"../instructions/create-token\";\nimport type { TransactionBuilderInput } from \"./types\";\n\ntype GetCreateTokenTransactionInput = Simplify<\n  Omit<GetCreateTokenInstructionsArgs, \"metadataAddress\"> &\n    Partial<Pick<GetCreateTokenInstructionsArgs, \"metadataAddress\">>\n>;\n\n/**\n * Create a transaction that can create a token with metadata\n *\n * The transaction has the following defaults:\n * - Default `version` = `legacy`\n * - Default `computeUnitLimit`:\n *    - for TOKEN_PROGRAM_ADDRESS => `60_000`\n *    - for TOKEN_2022_PROGRAM_ADDRESS => `10_000`\n *\n * @example\n *\n * ```\n * const mint = await generateKeyPairSigner();\n *\n * const transaction = await buildCreateTokenTransaction({\n *   feePayer: signer,\n *   latestBlockhash,\n *   mint,\n *   metadata: {\n *     name: \"Test Token\",\n *     symbol: \"TEST\",\n *     uri: \"https://example.com/metadata.json\",\n *     isMutable: true,\n *   },\n *   // tokenProgram: TOKEN_PROGRAM_ADDRESS, // default\n *   // tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n * });\n * ```\n */\nexport async function buildCreateTokenTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer> & GetCreateTokenTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer>>;\nexport async function buildCreateTokenTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n  TLifetimeConstraint extends\n    TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"] = TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetCreateTokenTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime>>;\nexport async function buildCreateTokenTransaction<\n  TVersion extends TransactionVersion,\n  TFeePayer extends TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetCreateTokenTransactionInput) {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n\n  let metadataAddress = args.mint.address;\n\n  if (args.tokenProgram === TOKEN_PROGRAM_ADDRESS) {\n    metadataAddress = await getTokenMetadataAddress(args.mint);\n\n    // default a reasonably low computeUnitLimit based on simulation data\n    if (!args.computeUnitLimit) {\n      // creating the token's mint is around 3219cu (and stable?)\n      // token metadata is the rest... and fluctuates a lot based on the pda and amount of metadata\n      args.computeUnitLimit = 60_000;\n    }\n  } else if (args.tokenProgram === TOKEN_2022_PROGRAM_ADDRESS) {\n    if (!args.computeUnitLimit) {\n      // token22 token creation, with metadata is (seemingly stable) around 7647cu,\n      // but consume more with more metadata provided\n      args.computeUnitLimit = 10_000;\n    }\n  }\n\n  return createTransaction(\n    (({ feePayer, version, computeUnitLimit, computeUnitPrice, latestBlockhash }: typeof args) => ({\n      feePayer,\n      version: version || \"legacy\",\n      computeUnitLimit,\n      computeUnitPrice,\n      latestBlockhash,\n      instructions: getCreateTokenInstructions(\n        (({\n          decimals,\n          mintAuthority,\n          freezeAuthority,\n          updateAuthority,\n          metadata,\n          feePayer,\n          tokenProgram,\n          mint,\n        }: typeof args) => ({\n          mint: mint as KeyPairSigner,\n          feePayer,\n          metadataAddress,\n          metadata,\n          decimals,\n          mintAuthority,\n          freezeAuthority,\n          updateAuthority,\n          tokenProgram,\n        }))(args),\n      ),\n    }))(args),\n  );\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/transactions/index.ts",
    "content": "export * from \"./create-token\";\nexport * from \"./mint-tokens\";\nexport * from \"./transfer-tokens\";\n"
  },
  {
    "path": "packages/gill/src/programs/token/transactions/mint-tokens.ts",
    "content": "import type {\n  Address,\n  TransactionMessageWithFeePayer,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\nimport { checkedAddress, checkedTransactionSigner, createTransaction } from \"../../../core\";\nimport type { FullTransaction, Simplify } from \"../../../types\";\nimport { checkedTokenProgramAddress, getAssociatedTokenAccountAddress } from \"../addresses\";\nimport { getMintTokensInstructions, type GetMintTokensInstructionsArgs } from \"../instructions/mint-tokens\";\nimport type { TransactionBuilderInput } from \"./types\";\n\ntype GetCreateTokenTransactionInput = Simplify<\n  Omit<GetMintTokensInstructionsArgs, \"ata\"> & Partial<Pick<GetMintTokensInstructionsArgs, \"ata\">>\n>;\n\n/**\n * Create a transaction that can mint tokens to the desired wallet/owner,\n * including creating their ATA if it does not exist\n *\n * The transaction has the following defaults:\n * - Default `version` = `legacy`\n * - Default `computeUnitLimit` = `31_000`\n *\n * @remarks\n *\n * - minting without creating the ata is generally < 10_000cu\n * - validating the ata onchain during creation results in a ~5000cu fluctuation\n *\n * @example\n * ```\n * const destination = address(\"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\");\n *\n * const mint = address(...);\n * // or mint can be a keypair from a freshly created token\n *\n * const transaction = await buildMintTokensTransaction({\n *   feePayer: signer,\n *   latestBlockhash,\n *   mint,\n *   mintAuthority: signer,\n *   amount: 1000, // note: be sure to consider the mint's `decimals` value\n *   // if decimals=2 => this will mint 10.00 tokens\n *   // if decimals=4 => this will mint 0.100 tokens\n *   destination,\n *   // tokenProgram: TOKEN_PROGRAM_ADDRESS, // default\n *   // tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,\n * });\n * ```\n */\nexport async function buildMintTokensTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer> & GetCreateTokenTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer>>;\nexport async function buildMintTokensTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n  TLifetimeConstraint extends\n    TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"] = TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetCreateTokenTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime>>;\nexport async function buildMintTokensTransaction<\n  TVersion extends TransactionVersion,\n  TFeePayer extends TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetCreateTokenTransactionInput) {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n  args.mint = checkedAddress(args.mint);\n\n  if (!args.ata) {\n    args.ata = await getAssociatedTokenAccountAddress(args.mint, args.destination, args.tokenProgram);\n  }\n\n  // default a reasonably low computeUnitLimit based on simulation data\n  if (!args.computeUnitLimit) {\n    /**\n     * for TOKEN_PROGRAM_ADDRESS and multiple simulation attempts,\n     * minting tokens costs the following:\n     * - when not creating the ata: 9156cu\n     * - when creating the ata: 26535cu\n     *\n     * for TOKEN_2022_PROGRAM_ADDRESS and multiple simulation attempts,\n     * minting tokens costs the following:\n     * - when not creating the ata: 8978cu\n     * - when creating the ata: 22567cu\n     */\n    args.computeUnitLimit = 31_000;\n  }\n\n  return createTransaction(\n    (({ feePayer, version, computeUnitLimit, computeUnitPrice, latestBlockhash }: typeof args) => ({\n      feePayer,\n      version: version || \"legacy\",\n      computeUnitLimit,\n      computeUnitPrice,\n      latestBlockhash,\n      instructions: getMintTokensInstructions(\n        (({ tokenProgram, feePayer, mint, ata, mintAuthority, amount, destination }: typeof args) => ({\n          tokenProgram,\n          feePayer,\n          mint,\n          mintAuthority,\n          ata: ata as Address,\n          amount,\n          destination,\n        }))(args),\n      ),\n    }))(args),\n  );\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/transactions/transfer-tokens.ts",
    "content": "import type {\n  Address,\n  TransactionMessageWithFeePayer,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\nimport { checkedAddress, checkedTransactionSigner, createTransaction } from \"../../../core\";\nimport type { FullTransaction, Simplify } from \"../../../types\";\nimport { checkedTokenProgramAddress, getAssociatedTokenAccountAddress } from \"../addresses\";\nimport { getTransferTokensInstructions, type GetTransferTokensInstructionsArgs } from \"../instructions\";\nimport type { TransactionBuilderInput } from \"./types\";\n\ntype GetTransferTokensTransactionInput = Simplify<\n  Omit<GetTransferTokensInstructionsArgs, \"sourceAta\" | \"destinationAta\"> &\n    Partial<Pick<GetTransferTokensInstructionsArgs, \"sourceAta\" | \"destinationAta\">>\n>;\n\n/**\n * Create a transaction that can transfer tokens to the desired wallet/owner,\n * including creating their ATA if it does not exist\n *\n * The transaction has the following defaults:\n * - Default `version` = `legacy`\n * - Default `computeUnitLimit` = `31_000`\n *\n * @remarks\n *\n * - transferring without creating the ata is generally < 10_000cu\n * - validating the ata onchain during creation results in a ~15000cu fluctuation\n *\n * @example\n * ```\n * const destination = address(...);\n *\n * const transferTokensTx = await buildTransferTokensTransaction({\n *   feePayer: signer,\n *   latestBlockhash,\n *   mint,\n *   authority: signer,\n *   amount: 900, // note: be sure to consider the mint's `decimals` value\n *   // if decimals=2 => this will transfer 9.00 tokens\n *   // if decimals=4 => this will transfer 0.090 tokens\n *   destination,\n *   // use the correct token program for the `mint`\n *   tokenProgram, // default=TOKEN_PROGRAM_ADDRESS\n *   // default cu limit set to be optimized, but can be overridden here\n *   // computeUnitLimit?: number,\n *   // obtain from your favorite priority fee api\n *   // computeUnitPrice?: number, // no default set\n * });\n * ```\n */\nexport async function buildTransferTokensTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer> & GetTransferTokensTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer>>;\nexport async function buildTransferTokensTransaction<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends TransactionSigner = TransactionSigner,\n  TLifetimeConstraint extends\n    TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"] = TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(\n  args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetTransferTokensTransactionInput,\n): Promise<FullTransaction<TVersion, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime>>;\nexport async function buildTransferTokensTransaction<\n  TVersion extends TransactionVersion,\n  TFeePayer extends Address | TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"],\n>(args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetTransferTokensTransactionInput) {\n  args.tokenProgram = checkedTokenProgramAddress(args.tokenProgram);\n  args.feePayer = checkedTransactionSigner(args.feePayer);\n  args.mint = checkedAddress(args.mint);\n\n  [args.destinationAta, args.sourceAta] = await Promise.all([\n    !args.destinationAta\n      ? getAssociatedTokenAccountAddress(args.mint, args.destination, args.tokenProgram)\n      : args.destinationAta,\n    !args.sourceAta ? getAssociatedTokenAccountAddress(args.mint, args.authority, args.tokenProgram) : args.sourceAta,\n  ]);\n\n  // default a reasonably low computeUnitLimit based on simulation data\n  if (!args.computeUnitLimit) {\n    /**\n     * for TOKEN_PROGRAM_ADDRESS and multiple simulation attempts,\n     * minting tokens costs the following:\n     * - when not creating the ata: 6336cu - 12336cu\n     * - when creating the ata: 19428cu - 25034cu\n     *\n     * for TOKEN_2022_PROGRAM_ADDRESS and multiple simulation attempts,\n     * minting tokens costs the following:\n     * - when not creating the ata: 6157cu - 15157cu\n     * - when creating the ata: 18722cu - 27722cu\n     */\n    args.computeUnitLimit = 31_000;\n  }\n\n  return createTransaction(\n    (({ feePayer, version, computeUnitLimit, computeUnitPrice, latestBlockhash }: typeof args) => ({\n      feePayer,\n      version: version || \"legacy\",\n      computeUnitLimit,\n      computeUnitPrice,\n      latestBlockhash,\n      instructions: getTransferTokensInstructions(\n        (({\n          tokenProgram,\n          feePayer,\n          mint,\n          amount,\n          destination,\n          authority,\n          destinationAta,\n          sourceAta,\n        }: typeof args) => ({\n          tokenProgram,\n          feePayer,\n          mint,\n          amount,\n          authority,\n          destination,\n          sourceAta: sourceAta as Address,\n          destinationAta: destinationAta as Address,\n        }))(args),\n      ),\n    }))(args),\n  );\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token/transactions/types.ts",
    "content": "import type {\n  Address,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\nimport type { CreateTransactionInput, Simplify } from \"../../../types\";\n\nexport type TransactionBuilderInput<\n  TVersion extends TransactionVersion = \"legacy\",\n  TFeePayer extends Address | TransactionSigner = TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"] | undefined = undefined,\n> = Simplify<\n  Omit<CreateTransactionInput<TVersion, TFeePayer, TLifetimeConstraint>, \"version\" | \"instructions\" | \"feePayer\"> &\n    Partial<Pick<CreateTransactionInput<TVersion, TFeePayer, TLifetimeConstraint>, \"version\">>\n>;\n"
  },
  {
    "path": "packages/gill/src/programs/token/ui-amount.ts",
    "content": "/**\n * Converts a UI amount (human-readable) to raw amount (BigInt)\n * @param uiAmount The human-readable token amount (e.g., 1.5)\n * @param decimals The number of decimals for the token\n * @returns BigInt representation of the amount\n */\nexport function tokenUiAmountToAmount(uiAmount: number, decimals: number): bigint {\n  // Handle potential scientific notation by using the built-in toFixed\n  // This ensures we get a decimal string representation without scientific notation\n  const uiAmountStr = uiAmount.toFixed(decimals);\n\n  // Find decimal point position\n  const decimalPointIndex = uiAmountStr.indexOf(\".\");\n\n  let wholeNumber: string;\n  let fractionalPart: string;\n\n  if (decimalPointIndex === -1) {\n    // No decimal point\n    wholeNumber = uiAmountStr;\n    fractionalPart = \"\";\n  } else {\n    wholeNumber = uiAmountStr.substring(0, decimalPointIndex);\n    fractionalPart = uiAmountStr.substring(decimalPointIndex + 1);\n  }\n\n  // Pad or truncate fractional part based on decimals\n  if (fractionalPart.length > decimals) {\n    fractionalPart = fractionalPart.substring(0, decimals);\n  } else {\n    fractionalPart = fractionalPart.padEnd(decimals, \"0\");\n  }\n\n  // Combine and convert to BigInt, stripping any potential leading zeros\n  const rawAmountStr = wholeNumber + fractionalPart;\n  if (rawAmountStr.replace(/0/g, \"\") === \"\") {\n    return BigInt(0);\n  }\n  return BigInt(rawAmountStr);\n}\n\n/**\n * Converts a raw amount (BigInt) to UI amount (human-readable)\n *\n * Note: This function does not support token balances that utilize the various \"UI amount modifying\"\n * Token Extensions, like the Interest-Bearing extension.\n *\n * @param amount The raw token amount as BigInt\n * @param decimals The number of decimals for the token\n * @returns UI representation of the amount as a number\n */\nexport function tokenAmountToUiAmount(amount: bigint, decimals: number): number {\n  // Convert to string for easier manipulation\n  let amountStr = amount.toString();\n\n  // Pad with leading zeros if necessary\n  if (amountStr.length <= decimals) {\n    amountStr = amountStr.padStart(decimals + 1, \"0\");\n  }\n\n  // Split into whole and fractional parts\n  const wholePartLength = amountStr.length - decimals;\n  const wholePart = amountStr.substring(0, wholePartLength);\n  const fractionalPart = amountStr.substring(wholePartLength);\n\n  // Combine with decimal point\n  const uiAmountStr = `${wholePart || \"0\"}.${fractionalPart}`;\n\n  // Convert back to number\n  return parseFloat(uiAmountStr);\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/addresses.ts",
    "content": "import { type Address, type KeyPairSigner, getAddressEncoder, getProgramDerivedAddress } from \"@solana/kit\";\nimport { checkedAddress } from \"../../core/utils\";\nimport { TOKEN_METADATA_PROGRAM_ADDRESS } from \"./generated\";\n\n/**\n * Derive the Token Metadata address from a token's mint address\n *\n * @param `mint` - `Address` or `KeyPairSigner` of the token mint\n */\nexport async function getTokenMetadataAddress(mint: Address | KeyPairSigner): Promise<Address> {\n  return (\n    await getProgramDerivedAddress({\n      programAddress: TOKEN_METADATA_PROGRAM_ADDRESS,\n      seeds: [\n        Buffer.from(\"metadata\"),\n        getAddressEncoder().encode(TOKEN_METADATA_PROGRAM_ADDRESS),\n        getAddressEncoder().encode(checkedAddress(mint)),\n      ],\n    })\n  )[0];\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/accounts/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from \"./metadata\";\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/accounts/metadata.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  assertAccountExists,\n  assertAccountsExist,\n  combineCodec,\n  decodeAccount,\n  fetchEncodedAccount,\n  fetchEncodedAccounts,\n  getAddressDecoder,\n  getAddressEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU8Decoder,\n  getU8Encoder,\n  type Account,\n  type Address,\n  type Codec,\n  type Decoder,\n  type EncodedAccount,\n  type Encoder,\n  type FetchAccountConfig,\n  type FetchAccountsConfig,\n  type MaybeAccount,\n  type MaybeEncodedAccount,\n  type Option,\n  type OptionOrNullable,\n} from \"@solana/kit\";\nimport {\n  getCollectionDecoder,\n  getCollectionDetailsDecoder,\n  getCollectionDetailsEncoder,\n  getCollectionEncoder,\n  getDataDecoder,\n  getDataEncoder,\n  getKeyDecoder,\n  getKeyEncoder,\n  getProgrammableConfigDecoder,\n  getProgrammableConfigEncoder,\n  getTokenStandardDecoder,\n  getTokenStandardEncoder,\n  getUsesDecoder,\n  getUsesEncoder,\n  type Collection,\n  type CollectionArgs,\n  type CollectionDetails,\n  type CollectionDetailsArgs,\n  type Data,\n  type DataArgs,\n  type Key,\n  type KeyArgs,\n  type ProgrammableConfig,\n  type ProgrammableConfigArgs,\n  type TokenStandard,\n  type TokenStandardArgs,\n  type Uses,\n  type UsesArgs,\n} from \"../types\";\n\nexport type Metadata = {\n  key: Key;\n  updateAuthority: Address;\n  mint: Address;\n  data: Data;\n  primarySaleHappened: boolean;\n  isMutable: boolean;\n  editionNonce: Option<number>;\n  tokenStandard: Option<TokenStandard>;\n  collection: Option<Collection>;\n  uses: Option<Uses>;\n  collectionDetails: Option<CollectionDetails>;\n  programmableConfig: Option<ProgrammableConfig>;\n};\n\nexport type MetadataArgs = {\n  key: KeyArgs;\n  updateAuthority: Address;\n  mint: Address;\n  data: DataArgs;\n  primarySaleHappened: boolean;\n  isMutable: boolean;\n  editionNonce: OptionOrNullable<number>;\n  tokenStandard: OptionOrNullable<TokenStandardArgs>;\n  collection: OptionOrNullable<CollectionArgs>;\n  uses: OptionOrNullable<UsesArgs>;\n  collectionDetails: OptionOrNullable<CollectionDetailsArgs>;\n  programmableConfig: OptionOrNullable<ProgrammableConfigArgs>;\n};\n\nexport function getMetadataEncoder(): Encoder<MetadataArgs> {\n  return getStructEncoder([\n    [\"key\", getKeyEncoder()],\n    [\"updateAuthority\", getAddressEncoder()],\n    [\"mint\", getAddressEncoder()],\n    [\"data\", getDataEncoder()],\n    [\"primarySaleHappened\", getBooleanEncoder()],\n    [\"isMutable\", getBooleanEncoder()],\n    [\"editionNonce\", getOptionEncoder(getU8Encoder())],\n    [\"tokenStandard\", getOptionEncoder(getTokenStandardEncoder())],\n    [\"collection\", getOptionEncoder(getCollectionEncoder())],\n    [\"uses\", getOptionEncoder(getUsesEncoder())],\n    [\"collectionDetails\", getOptionEncoder(getCollectionDetailsEncoder())],\n    [\"programmableConfig\", getOptionEncoder(getProgrammableConfigEncoder())],\n  ]);\n}\n\nexport function getMetadataDecoder(): Decoder<Metadata> {\n  return getStructDecoder([\n    [\"key\", getKeyDecoder()],\n    [\"updateAuthority\", getAddressDecoder()],\n    [\"mint\", getAddressDecoder()],\n    [\"data\", getDataDecoder()],\n    [\"primarySaleHappened\", getBooleanDecoder()],\n    [\"isMutable\", getBooleanDecoder()],\n    [\"editionNonce\", getOptionDecoder(getU8Decoder())],\n    [\"tokenStandard\", getOptionDecoder(getTokenStandardDecoder())],\n    [\"collection\", getOptionDecoder(getCollectionDecoder())],\n    [\"uses\", getOptionDecoder(getUsesDecoder())],\n    [\"collectionDetails\", getOptionDecoder(getCollectionDetailsDecoder())],\n    [\"programmableConfig\", getOptionDecoder(getProgrammableConfigDecoder())],\n  ]);\n}\n\nexport function getMetadataCodec(): Codec<MetadataArgs, Metadata> {\n  return combineCodec(getMetadataEncoder(), getMetadataDecoder());\n}\n\nexport function decodeMetadata<TAddress extends string = string>(\n  encodedAccount: EncodedAccount<TAddress>,\n): Account<Metadata, TAddress>;\nexport function decodeMetadata<TAddress extends string = string>(\n  encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Metadata, TAddress>;\nexport function decodeMetadata<TAddress extends string = string>(\n  encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Metadata, TAddress> | MaybeAccount<Metadata, TAddress> {\n  return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getMetadataDecoder());\n}\n\nexport async function fetchMetadata<TAddress extends string = string>(\n  rpc: Parameters<typeof fetchEncodedAccount>[0],\n  address: Address<TAddress>,\n  config?: FetchAccountConfig,\n): Promise<Account<Metadata, TAddress>> {\n  const maybeAccount = await fetchMaybeMetadata(rpc, address, config);\n  assertAccountExists(maybeAccount);\n  return maybeAccount;\n}\n\nexport async function fetchMaybeMetadata<TAddress extends string = string>(\n  rpc: Parameters<typeof fetchEncodedAccount>[0],\n  address: Address<TAddress>,\n  config?: FetchAccountConfig,\n): Promise<MaybeAccount<Metadata, TAddress>> {\n  const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n  return decodeMetadata(maybeAccount);\n}\n\nexport async function fetchAllMetadata(\n  rpc: Parameters<typeof fetchEncodedAccounts>[0],\n  addresses: Array<Address>,\n  config?: FetchAccountsConfig,\n): Promise<Account<Metadata>[]> {\n  const maybeAccounts = await fetchAllMaybeMetadata(rpc, addresses, config);\n  assertAccountsExist(maybeAccounts);\n  return maybeAccounts;\n}\n\nexport async function fetchAllMaybeMetadata(\n  rpc: Parameters<typeof fetchEncodedAccounts>[0],\n  addresses: Array<Address>,\n  config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Metadata>[]> {\n  const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n  return maybeAccounts.map((maybeAccount) => decodeMetadata(maybeAccount));\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from \"./accounts\";\nexport * from \"./programs\";\nexport * from \"./instructions\";\nexport * from \"./types\";\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/instructions/createMetadataAccountV3.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU8Decoder,\n  getU8Encoder,\n  transformEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type Option,\n  type OptionOrNullable,\n  type ReadonlyUint8Array,\n} from \"@solana/codecs\";\nimport type {\n  Address,\n  AccountMeta,\n  AccountSignerMeta,\n  Instruction,\n  InstructionWithAccounts,\n  InstructionWithData,\n  ReadonlyAccount,\n  ReadonlySignerAccount,\n  TransactionSigner,\n  WritableAccount,\n  WritableSignerAccount,\n} from \"@solana/kit\";\n\nimport { getAccountMetaFactory, type ResolvedAccount } from \"../../../shared\";\nimport { TOKEN_METADATA_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n  getCollectionDetailsDecoder,\n  getCollectionDetailsEncoder,\n  getDataV2Decoder,\n  getDataV2Encoder,\n  type CollectionDetails,\n  type CollectionDetailsArgs,\n  type DataV2,\n  type DataV2Args,\n} from \"../types\";\n\nexport const CREATE_METADATA_ACCOUNT_V3_DISCRIMINATOR = 33;\n\nexport function getCreateMetadataAccountV3DiscriminatorBytes(): ReadonlyUint8Array {\n  return getU8Encoder().encode(CREATE_METADATA_ACCOUNT_V3_DISCRIMINATOR);\n}\n\nexport type CreateMetadataAccountV3Instruction<\n  TProgram extends string = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n  TAccountMetadata extends string | AccountMeta<string> = string,\n  TAccountMint extends string | AccountMeta<string> = string,\n  TAccountMintAuthority extends string | AccountMeta<string> = string,\n  TAccountPayer extends string | AccountMeta<string> = string,\n  TAccountUpdateAuthority extends string | AccountMeta<string> = string,\n  TAccountSystemProgram extends string | AccountMeta<string> = \"11111111111111111111111111111111\",\n  TAccountRent extends string | AccountMeta<string> | undefined = undefined,\n  TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n  InstructionWithData<Uint8Array> &\n  InstructionWithAccounts<\n    [\n      TAccountMetadata extends string ? WritableAccount<TAccountMetadata> : TAccountMetadata,\n      TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,\n      TAccountMintAuthority extends string\n        ? ReadonlySignerAccount<TAccountMintAuthority> & AccountSignerMeta<TAccountMintAuthority>\n        : TAccountMintAuthority,\n      TAccountPayer extends string\n        ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n        : TAccountPayer,\n      TAccountUpdateAuthority extends string ? ReadonlyAccount<TAccountUpdateAuthority> : TAccountUpdateAuthority,\n      TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n      ...(TAccountRent extends undefined\n        ? []\n        : [TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent]),\n      ...TRemainingAccounts,\n    ]\n  >;\n\nexport type CreateMetadataAccountV3InstructionData = {\n  discriminator: number;\n  data: DataV2;\n  isMutable: boolean;\n  collectionDetails: Option<CollectionDetails>;\n};\n\nexport type CreateMetadataAccountV3InstructionDataArgs = {\n  data: DataV2Args;\n  isMutable: boolean;\n  collectionDetails: OptionOrNullable<CollectionDetailsArgs>;\n};\n\nexport function getCreateMetadataAccountV3InstructionDataEncoder(): Encoder<CreateMetadataAccountV3InstructionDataArgs> {\n  return transformEncoder(\n    getStructEncoder([\n      [\"discriminator\", getU8Encoder()],\n      [\"data\", getDataV2Encoder()],\n      [\"isMutable\", getBooleanEncoder()],\n      [\"collectionDetails\", getOptionEncoder(getCollectionDetailsEncoder())],\n    ]),\n    (value) => ({\n      ...value,\n      discriminator: CREATE_METADATA_ACCOUNT_V3_DISCRIMINATOR,\n    }),\n  );\n}\n\nexport function getCreateMetadataAccountV3InstructionDataDecoder(): Decoder<CreateMetadataAccountV3InstructionData> {\n  return getStructDecoder([\n    [\"discriminator\", getU8Decoder()],\n    [\"data\", getDataV2Decoder()],\n    [\"isMutable\", getBooleanDecoder()],\n    [\"collectionDetails\", getOptionDecoder(getCollectionDetailsDecoder())],\n  ]);\n}\n\nexport function getCreateMetadataAccountV3InstructionDataCodec(): Codec<\n  CreateMetadataAccountV3InstructionDataArgs,\n  CreateMetadataAccountV3InstructionData\n> {\n  return combineCodec(\n    getCreateMetadataAccountV3InstructionDataEncoder(),\n    getCreateMetadataAccountV3InstructionDataDecoder(),\n  );\n}\n\nexport type CreateMetadataAccountV3Input<\n  TAccountMetadata extends string = string,\n  TAccountMint extends string = string,\n  TAccountMintAuthority extends string = string,\n  TAccountPayer extends string = string,\n  TAccountUpdateAuthority extends string = string,\n  TAccountSystemProgram extends string = string,\n  TAccountRent extends string = string,\n> = {\n  /** Metadata key (pda of ['metadata', program id, mint id]) */\n  metadata: Address<TAccountMetadata>;\n  /** Mint of token asset */\n  mint: Address<TAccountMint>;\n  /** Mint authority */\n  mintAuthority: TransactionSigner<TAccountMintAuthority>;\n  /** payer */\n  payer: TransactionSigner<TAccountPayer>;\n  /** update authority info */\n  updateAuthority: Address<TAccountUpdateAuthority> | TransactionSigner<TAccountUpdateAuthority>;\n  /** System program */\n  systemProgram?: Address<TAccountSystemProgram>;\n  /** Rent info */\n  rent?: Address<TAccountRent>;\n  data: CreateMetadataAccountV3InstructionDataArgs[\"data\"];\n  isMutable: CreateMetadataAccountV3InstructionDataArgs[\"isMutable\"];\n  collectionDetails: CreateMetadataAccountV3InstructionDataArgs[\"collectionDetails\"];\n};\n\nexport function getCreateMetadataAccountV3Instruction<\n  TAccountMetadata extends string,\n  TAccountMint extends string,\n  TAccountMintAuthority extends string,\n  TAccountPayer extends string,\n  TAccountUpdateAuthority extends string,\n  TAccountSystemProgram extends string,\n  TAccountRent extends string,\n  TProgramAddress extends Address = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n>(\n  input: CreateMetadataAccountV3Input<\n    TAccountMetadata,\n    TAccountMint,\n    TAccountMintAuthority,\n    TAccountPayer,\n    TAccountUpdateAuthority,\n    TAccountSystemProgram,\n    TAccountRent\n  >,\n  config?: { programAddress?: TProgramAddress },\n): CreateMetadataAccountV3Instruction<\n  TProgramAddress,\n  TAccountMetadata,\n  TAccountMint,\n  TAccountMintAuthority,\n  TAccountPayer,\n  (typeof input)[\"updateAuthority\"] extends TransactionSigner<TAccountUpdateAuthority>\n    ? ReadonlySignerAccount<TAccountUpdateAuthority> & AccountSignerMeta<TAccountUpdateAuthority>\n    : TAccountUpdateAuthority,\n  TAccountSystemProgram,\n  TAccountRent\n> {\n  // Program address.\n  const programAddress = config?.programAddress ?? TOKEN_METADATA_PROGRAM_ADDRESS;\n\n  // Original accounts.\n  const originalAccounts = {\n    metadata: { value: input.metadata ?? null, isWritable: true },\n    mint: { value: input.mint ?? null, isWritable: false },\n    mintAuthority: { value: input.mintAuthority ?? null, isWritable: false },\n    payer: { value: input.payer ?? null, isWritable: true },\n    updateAuthority: {\n      value: input.updateAuthority ?? null,\n      isWritable: false,\n    },\n    systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n    rent: { value: input.rent ?? null, isWritable: false },\n  };\n  const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;\n\n  // Original args.\n  const args = { ...input };\n\n  // Resolve default values.\n  if (!accounts.systemProgram.value) {\n    accounts.systemProgram.value = \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n  }\n\n  const getAccountMeta = getAccountMetaFactory(programAddress, \"omitted\");\n  const instruction = {\n    accounts: [\n      getAccountMeta(accounts.metadata),\n      getAccountMeta(accounts.mint),\n      getAccountMeta(accounts.mintAuthority),\n      getAccountMeta(accounts.payer),\n      getAccountMeta(accounts.updateAuthority),\n      getAccountMeta(accounts.systemProgram),\n      getAccountMeta(accounts.rent),\n    ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n    programAddress,\n    data: getCreateMetadataAccountV3InstructionDataEncoder().encode(args as CreateMetadataAccountV3InstructionDataArgs),\n  } as CreateMetadataAccountV3Instruction<\n    TProgramAddress,\n    TAccountMetadata,\n    TAccountMint,\n    TAccountMintAuthority,\n    TAccountPayer,\n    (typeof input)[\"updateAuthority\"] extends TransactionSigner<TAccountUpdateAuthority>\n      ? ReadonlySignerAccount<TAccountUpdateAuthority> & AccountSignerMeta<TAccountUpdateAuthority>\n      : TAccountUpdateAuthority,\n    TAccountSystemProgram,\n    TAccountRent\n  >;\n\n  return instruction;\n}\n\nexport type ParsedCreateMetadataAccountV3Instruction<\n  TProgram extends string = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n  TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n  programAddress: Address<TProgram>;\n  accounts: {\n    /** Metadata key (pda of ['metadata', program id, mint id]) */\n    metadata: TAccountMetas[0];\n    /** Mint of token asset */\n    mint: TAccountMetas[1];\n    /** Mint authority */\n    mintAuthority: TAccountMetas[2];\n    /** payer */\n    payer: TAccountMetas[3];\n    /** update authority info */\n    updateAuthority: TAccountMetas[4];\n    /** System program */\n    systemProgram: TAccountMetas[5];\n    /** Rent info */\n    rent?: TAccountMetas[6] | undefined;\n  };\n  data: CreateMetadataAccountV3InstructionData;\n};\n\nexport function parseCreateMetadataAccountV3Instruction<\n  TProgram extends string,\n  TAccountMetas extends readonly AccountMeta[],\n>(\n  instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<Uint8Array>,\n): ParsedCreateMetadataAccountV3Instruction<TProgram, TAccountMetas> {\n  if (instruction.accounts.length < 6) {\n    // TODO: Coded error.\n    throw new Error(\"Not enough accounts\");\n  }\n  let accountIndex = 0;\n  const getNextAccount = () => {\n    const accountMeta = instruction.accounts![accountIndex]!;\n    accountIndex += 1;\n    return accountMeta;\n  };\n  let optionalAccountsRemaining = instruction.accounts.length - 6;\n  const getNextOptionalAccount = () => {\n    if (optionalAccountsRemaining === 0) return undefined;\n    optionalAccountsRemaining -= 1;\n    return getNextAccount();\n  };\n  return {\n    programAddress: instruction.programAddress,\n    accounts: {\n      metadata: getNextAccount(),\n      mint: getNextAccount(),\n      mintAuthority: getNextAccount(),\n      payer: getNextAccount(),\n      updateAuthority: getNextAccount(),\n      systemProgram: getNextAccount(),\n      rent: getNextOptionalAccount(),\n    },\n    data: getCreateMetadataAccountV3InstructionDataDecoder().decode(instruction.data),\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/instructions/index.ts",
    "content": "export * from \"./createMetadataAccountV3\";\nexport * from \"./updateMetadataAccountV2\";\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/instructions/updateMetadataAccountV2.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU8Decoder,\n  getU8Encoder,\n  transformEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type AccountMeta,\n  type AccountSignerMeta,\n  type Instruction,\n  type InstructionWithAccounts,\n  type InstructionWithData,\n  type Option,\n  type OptionOrNullable,\n  type ReadonlySignerAccount,\n  type TransactionSigner,\n  type WritableAccount,\n} from \"@solana/kit\";\nimport { getAccountMetaFactory, ResolvedAccount } from \"../../../shared\";\nimport { TOKEN_METADATA_PROGRAM_ADDRESS } from \"../programs\";\nimport { getDataV2Decoder, getDataV2Encoder, type DataV2, type DataV2Args } from \"../types\";\n\nexport const UPDATE_METADATA_ACCOUNT_V2_DISCRIMINATOR = 15;\n\nexport function getUpdateMetadataAccountV2DiscriminatorBytes() {\n  return getU8Encoder().encode(UPDATE_METADATA_ACCOUNT_V2_DISCRIMINATOR);\n}\n\nexport type UpdateMetadataAccountV2Instruction<\n  TProgram extends string = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n  TAccountMetadata extends string | AccountMeta<string> = string,\n  TAccountUpdateAuthority extends string | AccountMeta<string> = string,\n  TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n  InstructionWithData<Uint8Array> &\n  InstructionWithAccounts<\n    [\n      TAccountMetadata extends string ? WritableAccount<TAccountMetadata> : TAccountMetadata,\n      TAccountUpdateAuthority extends string\n        ? ReadonlySignerAccount<TAccountUpdateAuthority> & AccountSignerMeta<TAccountUpdateAuthority>\n        : TAccountUpdateAuthority,\n      ...TRemainingAccounts,\n    ]\n  >;\n\nexport type UpdateMetadataAccountV2InstructionData = {\n  discriminator: number;\n  data: Option<DataV2>;\n  updateAuthority: Option<Address>;\n  primarySaleHappened: Option<boolean>;\n  isMutable: Option<boolean>;\n};\n\nexport type UpdateMetadataAccountV2InstructionDataArgs = {\n  data: OptionOrNullable<DataV2Args>;\n  updateAuthority: OptionOrNullable<Address>;\n  primarySaleHappened: OptionOrNullable<boolean>;\n  isMutable: OptionOrNullable<boolean>;\n};\n\nexport function getUpdateMetadataAccountV2InstructionDataEncoder(): Encoder<UpdateMetadataAccountV2InstructionDataArgs> {\n  return transformEncoder(\n    getStructEncoder([\n      [\"discriminator\", getU8Encoder()],\n      [\"data\", getOptionEncoder(getDataV2Encoder())],\n      [\"updateAuthority\", getOptionEncoder(getAddressEncoder())],\n      [\"primarySaleHappened\", getOptionEncoder(getBooleanEncoder())],\n      [\"isMutable\", getOptionEncoder(getBooleanEncoder())],\n    ]),\n    (value) => ({\n      ...value,\n      discriminator: UPDATE_METADATA_ACCOUNT_V2_DISCRIMINATOR,\n    }),\n  );\n}\n\nexport function getUpdateMetadataAccountV2InstructionDataDecoder(): Decoder<UpdateMetadataAccountV2InstructionData> {\n  return getStructDecoder([\n    [\"discriminator\", getU8Decoder()],\n    [\"data\", getOptionDecoder(getDataV2Decoder())],\n    [\"updateAuthority\", getOptionDecoder(getAddressDecoder())],\n    [\"primarySaleHappened\", getOptionDecoder(getBooleanDecoder())],\n    [\"isMutable\", getOptionDecoder(getBooleanDecoder())],\n  ]);\n}\n\nexport function getUpdateMetadataAccountV2InstructionDataCodec(): Codec<\n  UpdateMetadataAccountV2InstructionDataArgs,\n  UpdateMetadataAccountV2InstructionData\n> {\n  return combineCodec(\n    getUpdateMetadataAccountV2InstructionDataEncoder(),\n    getUpdateMetadataAccountV2InstructionDataDecoder(),\n  );\n}\n\nexport type UpdateMetadataAccountV2Input<\n  TAccountMetadata extends string = string,\n  TAccountUpdateAuthority extends string = string,\n> = {\n  /** Metadata account */\n  metadata: Address<TAccountMetadata>;\n  /** Update authority key */\n  updateAuthority: TransactionSigner<TAccountUpdateAuthority>;\n  data: UpdateMetadataAccountV2InstructionDataArgs[\"data\"];\n  updateAuthorityArg: UpdateMetadataAccountV2InstructionDataArgs[\"updateAuthority\"];\n  primarySaleHappened: UpdateMetadataAccountV2InstructionDataArgs[\"primarySaleHappened\"];\n  isMutable: UpdateMetadataAccountV2InstructionDataArgs[\"isMutable\"];\n};\n\nexport function getUpdateMetadataAccountV2Instruction<\n  TAccountMetadata extends string,\n  TAccountUpdateAuthority extends string,\n  TProgramAddress extends Address = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n>(\n  input: UpdateMetadataAccountV2Input<TAccountMetadata, TAccountUpdateAuthority>,\n  config?: { programAddress?: TProgramAddress },\n): UpdateMetadataAccountV2Instruction<TProgramAddress, TAccountMetadata, TAccountUpdateAuthority> {\n  // Program address.\n  const programAddress = config?.programAddress ?? TOKEN_METADATA_PROGRAM_ADDRESS;\n\n  // Original accounts.\n  const originalAccounts = {\n    metadata: { value: input.metadata ?? null, isWritable: true },\n    updateAuthority: {\n      value: input.updateAuthority ?? null,\n      isWritable: false,\n    },\n  };\n  const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;\n\n  // Original args.\n  const args = { ...input, updateAuthority: input.updateAuthorityArg };\n\n  const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n  const instruction = {\n    accounts: [getAccountMeta(accounts.metadata), getAccountMeta(accounts.updateAuthority)],\n    programAddress,\n    data: getUpdateMetadataAccountV2InstructionDataEncoder().encode(args as UpdateMetadataAccountV2InstructionDataArgs),\n  } as UpdateMetadataAccountV2Instruction<TProgramAddress, TAccountMetadata, TAccountUpdateAuthority>;\n\n  return instruction;\n}\n\nexport type ParsedUpdateMetadataAccountV2Instruction<\n  TProgram extends string = typeof TOKEN_METADATA_PROGRAM_ADDRESS,\n  TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n  programAddress: Address<TProgram>;\n  accounts: {\n    /** Metadata account */\n    metadata: TAccountMetas[0];\n    /** Update authority key */\n    updateAuthority: TAccountMetas[1];\n  };\n  data: UpdateMetadataAccountV2InstructionData;\n};\n\nexport function parseUpdateMetadataAccountV2Instruction<\n  TProgram extends string,\n  TAccountMetas extends readonly AccountMeta[],\n>(\n  instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<Uint8Array>,\n): ParsedUpdateMetadataAccountV2Instruction<TProgram, TAccountMetas> {\n  if (instruction.accounts.length < 2) {\n    // TODO: Coded error.\n    throw new Error(\"Not enough accounts\");\n  }\n  let accountIndex = 0;\n  const getNextAccount = () => {\n    const accountMeta = instruction.accounts![accountIndex]!;\n    accountIndex += 1;\n    return accountMeta;\n  };\n  return {\n    programAddress: instruction.programAddress,\n    accounts: {\n      metadata: getNextAccount(),\n      updateAuthority: getNextAccount(),\n    },\n    data: getUpdateMetadataAccountV2InstructionDataDecoder().decode(instruction.data),\n  };\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/programs/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from './tokenMetadata';\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/programs/tokenMetadata.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { type Address } from \"@solana/kit\";\n\nexport const TOKEN_METADATA_PROGRAM_ADDRESS =\n  \"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s\" as Address<\"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s\">;\n\nexport enum TokenMetadataAccount {\n  CollectionAuthorityRecord,\n  MetadataDelegateRecord,\n  HolderDelegateRecord,\n  Edition,\n  EditionMarker,\n  EditionMarkerV2,\n  TokenOwnedEscrow,\n  MasterEditionV2,\n  MasterEditionV1,\n  Metadata,\n  TokenRecord,\n  ReservationListV2,\n  ReservationListV1,\n  UseAuthorityRecord,\n}\n\nexport enum TokenMetadataInstruction {\n  CreateMetadataAccount,\n  UpdateMetadataAccount,\n  DeprecatedCreateMasterEdition,\n  DeprecatedMintNewEditionFromMasterEditionViaPrintingToken,\n  UpdatePrimarySaleHappenedViaToken,\n  DeprecatedSetReservationList,\n  DeprecatedCreateReservationList,\n  SignMetadata,\n  DeprecatedMintPrintingTokensViaToken,\n  DeprecatedMintPrintingTokens,\n  CreateMasterEdition,\n  MintNewEditionFromMasterEditionViaToken,\n  ConvertMasterEditionV1ToV2,\n  MintNewEditionFromMasterEditionViaVaultProxy,\n  PuffMetadata,\n  UpdateMetadataAccountV2,\n  CreateMetadataAccountV2,\n  CreateMasterEditionV3,\n  VerifyCollection,\n  Utilize,\n  ApproveUseAuthority,\n  RevokeUseAuthority,\n  UnverifyCollection,\n  ApproveCollectionAuthority,\n  RevokeCollectionAuthority,\n  SetAndVerifyCollection,\n  FreezeDelegatedAccount,\n  ThawDelegatedAccount,\n  RemoveCreatorVerification,\n  BurnNft,\n  VerifySizedCollectionItem,\n  UnverifySizedCollectionItem,\n  SetAndVerifySizedCollectionItem,\n  CreateMetadataAccountV3,\n  SetCollectionSize,\n  SetTokenStandard,\n  BubblegumSetCollectionSize,\n  BurnEditionNft,\n  CreateEscrowAccount,\n  CloseEscrowAccount,\n  TransferOutOfEscrow,\n  Burn,\n  Create,\n  Mint,\n  Delegate,\n  Revoke,\n  Lock,\n  Unlock,\n  Migrate,\n  Transfer,\n  Update,\n  Use,\n  Verify,\n  Unverify,\n  Collect,\n  Print,\n  Resize,\n  CloseAccounts,\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/assetData.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  addDecoderSizePrefix,\n  addEncoderSizePrefix,\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getArrayDecoder,\n  getArrayEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU16Decoder,\n  getU16Encoder,\n  getU32Decoder,\n  getU32Encoder,\n  getUtf8Decoder,\n  getUtf8Encoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getCollectionDecoder,\n  getCollectionDetailsDecoder,\n  getCollectionDetailsEncoder,\n  getCollectionEncoder,\n  getCreatorDecoder,\n  getCreatorEncoder,\n  getTokenStandardDecoder,\n  getTokenStandardEncoder,\n  getUsesDecoder,\n  getUsesEncoder,\n  type Collection,\n  type CollectionArgs,\n  type CollectionDetails,\n  type CollectionDetailsArgs,\n  type Creator,\n  type CreatorArgs,\n  type TokenStandard,\n  type TokenStandardArgs,\n  type Uses,\n  type UsesArgs,\n} from '.';\n\nexport type AssetData = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: Option<Array<Creator>>;\n  primarySaleHappened: boolean;\n  isMutable: boolean;\n  tokenStandard: TokenStandard;\n  collection: Option<Collection>;\n  uses: Option<Uses>;\n  collectionDetails: Option<CollectionDetails>;\n  ruleSet: Option<Address>;\n};\n\nexport type AssetDataArgs = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: OptionOrNullable<Array<CreatorArgs>>;\n  primarySaleHappened: boolean;\n  isMutable: boolean;\n  tokenStandard: TokenStandardArgs;\n  collection: OptionOrNullable<CollectionArgs>;\n  uses: OptionOrNullable<UsesArgs>;\n  collectionDetails: OptionOrNullable<CollectionDetailsArgs>;\n  ruleSet: OptionOrNullable<Address>;\n};\n\nexport function getAssetDataEncoder(): Encoder<AssetDataArgs> {\n  return getStructEncoder([\n    ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['sellerFeeBasisPoints', getU16Encoder()],\n    ['creators', getOptionEncoder(getArrayEncoder(getCreatorEncoder()))],\n    ['primarySaleHappened', getBooleanEncoder()],\n    ['isMutable', getBooleanEncoder()],\n    ['tokenStandard', getTokenStandardEncoder()],\n    ['collection', getOptionEncoder(getCollectionEncoder())],\n    ['uses', getOptionEncoder(getUsesEncoder())],\n    ['collectionDetails', getOptionEncoder(getCollectionDetailsEncoder())],\n    ['ruleSet', getOptionEncoder(getAddressEncoder())],\n  ]);\n}\n\nexport function getAssetDataDecoder(): Decoder<AssetData> {\n  return getStructDecoder([\n    ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['sellerFeeBasisPoints', getU16Decoder()],\n    ['creators', getOptionDecoder(getArrayDecoder(getCreatorDecoder()))],\n    ['primarySaleHappened', getBooleanDecoder()],\n    ['isMutable', getBooleanDecoder()],\n    ['tokenStandard', getTokenStandardDecoder()],\n    ['collection', getOptionDecoder(getCollectionDecoder())],\n    ['uses', getOptionDecoder(getUsesDecoder())],\n    ['collectionDetails', getOptionDecoder(getCollectionDetailsDecoder())],\n    ['ruleSet', getOptionDecoder(getAddressDecoder())],\n  ]);\n}\n\nexport function getAssetDataCodec(): Codec<AssetDataArgs, AssetData> {\n  return combineCodec(getAssetDataEncoder(), getAssetDataDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/authorizationData.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getStructDecoder,\n  getStructEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\nimport {\n  getPayloadDecoder,\n  getPayloadEncoder,\n  type Payload,\n  type PayloadArgs,\n} from '.';\n\nexport type AuthorizationData = { payload: Payload };\n\nexport type AuthorizationDataArgs = { payload: PayloadArgs };\n\nexport function getAuthorizationDataEncoder(): Encoder<AuthorizationDataArgs> {\n  return getStructEncoder([['payload', getPayloadEncoder()]]);\n}\n\nexport function getAuthorizationDataDecoder(): Decoder<AuthorizationData> {\n  return getStructDecoder([['payload', getPayloadDecoder()]]);\n}\n\nexport function getAuthorizationDataCodec(): Codec<\n  AuthorizationDataArgs,\n  AuthorizationData\n> {\n  return combineCodec(\n    getAuthorizationDataEncoder(),\n    getAuthorizationDataDecoder()\n  );\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/collection.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from \"@solana/kit\";\n\nexport type Collection = { verified: boolean; key: Address };\n\nexport type CollectionArgs = Collection;\n\nexport function getCollectionEncoder(): Encoder<CollectionArgs> {\n  return getStructEncoder([\n    [\"verified\", getBooleanEncoder()],\n    [\"key\", getAddressEncoder()],\n  ]);\n}\n\nexport function getCollectionDecoder(): Decoder<Collection> {\n  return getStructDecoder([\n    [\"verified\", getBooleanDecoder()],\n    [\"key\", getAddressDecoder()],\n  ]);\n}\n\nexport function getCollectionCodec(): Codec<CollectionArgs, Collection> {\n  return combineCodec(getCollectionEncoder(), getCollectionDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/collectionDetails.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  fixDecoderSize,\n  fixEncoderSize,\n  getBytesDecoder,\n  getBytesEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type CollectionDetails =\n  | { __kind: 'V1'; size: bigint }\n  | { __kind: 'V2'; padding: ReadonlyUint8Array };\n\nexport type CollectionDetailsArgs =\n  | { __kind: 'V1'; size: number | bigint }\n  | { __kind: 'V2'; padding: ReadonlyUint8Array };\n\nexport function getCollectionDetailsEncoder(): Encoder<CollectionDetailsArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['V1', getStructEncoder([['size', getU64Encoder()]])],\n    [\n      'V2',\n      getStructEncoder([['padding', fixEncoderSize(getBytesEncoder(), 8)]]),\n    ],\n  ]);\n}\n\nexport function getCollectionDetailsDecoder(): Decoder<CollectionDetails> {\n  return getDiscriminatedUnionDecoder([\n    ['V1', getStructDecoder([['size', getU64Decoder()]])],\n    [\n      'V2',\n      getStructDecoder([['padding', fixDecoderSize(getBytesDecoder(), 8)]]),\n    ],\n  ]);\n}\n\nexport function getCollectionDetailsCodec(): Codec<\n  CollectionDetailsArgs,\n  CollectionDetails\n> {\n  return combineCodec(\n    getCollectionDetailsEncoder(),\n    getCollectionDetailsDecoder()\n  );\n}\n\n// Data Enum Helpers.\nexport function collectionDetails(\n  kind: 'V1',\n  data: GetDiscriminatedUnionVariantContent<\n    CollectionDetailsArgs,\n    '__kind',\n    'V1'\n  >\n): GetDiscriminatedUnionVariant<CollectionDetailsArgs, '__kind', 'V1'>;\nexport function collectionDetails(\n  kind: 'V2',\n  data: GetDiscriminatedUnionVariantContent<\n    CollectionDetailsArgs,\n    '__kind',\n    'V2'\n  >\n): GetDiscriminatedUnionVariant<CollectionDetailsArgs, '__kind', 'V2'>;\nexport function collectionDetails<\n  K extends CollectionDetailsArgs['__kind'],\n  Data,\n>(kind: K, data?: Data) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isCollectionDetails<K extends CollectionDetails['__kind']>(\n  kind: K,\n  value: CollectionDetails\n): value is CollectionDetails & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/collectionDetailsToggle.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\nimport {\n  getCollectionDetailsDecoder,\n  getCollectionDetailsEncoder,\n  type CollectionDetails,\n  type CollectionDetailsArgs,\n} from '.';\n\nexport type CollectionDetailsToggle =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [CollectionDetails] };\n\nexport type CollectionDetailsToggleArgs =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [CollectionDetailsArgs] };\n\nexport function getCollectionDetailsToggleEncoder(): Encoder<CollectionDetailsToggleArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['None', getUnitEncoder()],\n    ['Clear', getUnitEncoder()],\n    [\n      'Set',\n      getStructEncoder([\n        ['fields', getTupleEncoder([getCollectionDetailsEncoder()])],\n      ]),\n    ],\n  ]);\n}\n\nexport function getCollectionDetailsToggleDecoder(): Decoder<CollectionDetailsToggle> {\n  return getDiscriminatedUnionDecoder([\n    ['None', getUnitDecoder()],\n    ['Clear', getUnitDecoder()],\n    [\n      'Set',\n      getStructDecoder([\n        ['fields', getTupleDecoder([getCollectionDetailsDecoder()])],\n      ]),\n    ],\n  ]);\n}\n\nexport function getCollectionDetailsToggleCodec(): Codec<\n  CollectionDetailsToggleArgs,\n  CollectionDetailsToggle\n> {\n  return combineCodec(\n    getCollectionDetailsToggleEncoder(),\n    getCollectionDetailsToggleDecoder()\n  );\n}\n\n// Data Enum Helpers.\nexport function collectionDetailsToggle(\n  kind: 'None'\n): GetDiscriminatedUnionVariant<CollectionDetailsToggleArgs, '__kind', 'None'>;\nexport function collectionDetailsToggle(\n  kind: 'Clear'\n): GetDiscriminatedUnionVariant<CollectionDetailsToggleArgs, '__kind', 'Clear'>;\nexport function collectionDetailsToggle(\n  kind: 'Set',\n  data: GetDiscriminatedUnionVariantContent<\n    CollectionDetailsToggleArgs,\n    '__kind',\n    'Set'\n  >['fields']\n): GetDiscriminatedUnionVariant<CollectionDetailsToggleArgs, '__kind', 'Set'>;\nexport function collectionDetailsToggle<\n  K extends CollectionDetailsToggleArgs['__kind'],\n  Data,\n>(kind: K, data?: Data) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isCollectionDetailsToggle<\n  K extends CollectionDetailsToggle['__kind'],\n>(\n  kind: K,\n  value: CollectionDetailsToggle\n): value is CollectionDetailsToggle & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/collectionToggle.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\nimport {\n  getCollectionDecoder,\n  getCollectionEncoder,\n  type Collection,\n  type CollectionArgs,\n} from '.';\n\nexport type CollectionToggle =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [Collection] };\n\nexport type CollectionToggleArgs =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [CollectionArgs] };\n\nexport function getCollectionToggleEncoder(): Encoder<CollectionToggleArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['None', getUnitEncoder()],\n    ['Clear', getUnitEncoder()],\n    [\n      'Set',\n      getStructEncoder([['fields', getTupleEncoder([getCollectionEncoder()])]]),\n    ],\n  ]);\n}\n\nexport function getCollectionToggleDecoder(): Decoder<CollectionToggle> {\n  return getDiscriminatedUnionDecoder([\n    ['None', getUnitDecoder()],\n    ['Clear', getUnitDecoder()],\n    [\n      'Set',\n      getStructDecoder([['fields', getTupleDecoder([getCollectionDecoder()])]]),\n    ],\n  ]);\n}\n\nexport function getCollectionToggleCodec(): Codec<\n  CollectionToggleArgs,\n  CollectionToggle\n> {\n  return combineCodec(\n    getCollectionToggleEncoder(),\n    getCollectionToggleDecoder()\n  );\n}\n\n// Data Enum Helpers.\nexport function collectionToggle(\n  kind: 'None'\n): GetDiscriminatedUnionVariant<CollectionToggleArgs, '__kind', 'None'>;\nexport function collectionToggle(\n  kind: 'Clear'\n): GetDiscriminatedUnionVariant<CollectionToggleArgs, '__kind', 'Clear'>;\nexport function collectionToggle(\n  kind: 'Set',\n  data: GetDiscriminatedUnionVariantContent<\n    CollectionToggleArgs,\n    '__kind',\n    'Set'\n  >['fields']\n): GetDiscriminatedUnionVariant<CollectionToggleArgs, '__kind', 'Set'>;\nexport function collectionToggle<\n  K extends CollectionToggleArgs['__kind'],\n  Data,\n>(kind: K, data?: Data) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isCollectionToggle<K extends CollectionToggle['__kind']>(\n  kind: K,\n  value: CollectionToggle\n): value is CollectionToggle & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/createArgs.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU8Decoder,\n  getU8Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getAssetDataDecoder,\n  getAssetDataEncoder,\n  getPrintSupplyDecoder,\n  getPrintSupplyEncoder,\n  type AssetData,\n  type AssetDataArgs,\n  type PrintSupply,\n  type PrintSupplyArgs,\n} from '.';\n\nexport type CreateArgs = {\n  __kind: 'V1';\n  assetData: AssetData;\n  decimals: Option<number>;\n  printSupply: Option<PrintSupply>;\n};\n\nexport type CreateArgsArgs = {\n  __kind: 'V1';\n  assetData: AssetDataArgs;\n  decimals: OptionOrNullable<number>;\n  printSupply: OptionOrNullable<PrintSupplyArgs>;\n};\n\nexport function getCreateArgsEncoder(): Encoder<CreateArgsArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      'V1',\n      getStructEncoder([\n        ['assetData', getAssetDataEncoder()],\n        ['decimals', getOptionEncoder(getU8Encoder())],\n        ['printSupply', getOptionEncoder(getPrintSupplyEncoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getCreateArgsDecoder(): Decoder<CreateArgs> {\n  return getDiscriminatedUnionDecoder([\n    [\n      'V1',\n      getStructDecoder([\n        ['assetData', getAssetDataDecoder()],\n        ['decimals', getOptionDecoder(getU8Decoder())],\n        ['printSupply', getOptionDecoder(getPrintSupplyDecoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getCreateArgsCodec(): Codec<CreateArgsArgs, CreateArgs> {\n  return combineCodec(getCreateArgsEncoder(), getCreateArgsDecoder());\n}\n\n// Data Enum Helpers.\nexport function createArgs(\n  kind: 'V1',\n  data: GetDiscriminatedUnionVariantContent<CreateArgsArgs, '__kind', 'V1'>\n): GetDiscriminatedUnionVariant<CreateArgsArgs, '__kind', 'V1'>;\nexport function createArgs<K extends CreateArgsArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isCreateArgs<K extends CreateArgs['__kind']>(\n  kind: K,\n  value: CreateArgs\n): value is CreateArgs & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/creator.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU8Decoder,\n  getU8Encoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\n\nexport type Creator = { address: Address; verified: boolean; share: number };\n\nexport type CreatorArgs = Creator;\n\nexport function getCreatorEncoder(): Encoder<CreatorArgs> {\n  return getStructEncoder([\n    ['address', getAddressEncoder()],\n    ['verified', getBooleanEncoder()],\n    ['share', getU8Encoder()],\n  ]);\n}\n\nexport function getCreatorDecoder(): Decoder<Creator> {\n  return getStructDecoder([\n    ['address', getAddressDecoder()],\n    ['verified', getBooleanDecoder()],\n    ['share', getU8Decoder()],\n  ]);\n}\n\nexport function getCreatorCodec(): Codec<CreatorArgs, Creator> {\n  return combineCodec(getCreatorEncoder(), getCreatorDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/data.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  addDecoderSizePrefix,\n  addEncoderSizePrefix,\n  combineCodec,\n  getArrayDecoder,\n  getArrayEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU16Decoder,\n  getU16Encoder,\n  getU32Decoder,\n  getU32Encoder,\n  getUtf8Decoder,\n  getUtf8Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getCreatorDecoder,\n  getCreatorEncoder,\n  type Creator,\n  type CreatorArgs,\n} from '.';\n\nexport type Data = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: Option<Array<Creator>>;\n};\n\nexport type DataArgs = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: OptionOrNullable<Array<CreatorArgs>>;\n};\n\nexport function getDataEncoder(): Encoder<DataArgs> {\n  return getStructEncoder([\n    ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['sellerFeeBasisPoints', getU16Encoder()],\n    ['creators', getOptionEncoder(getArrayEncoder(getCreatorEncoder()))],\n  ]);\n}\n\nexport function getDataDecoder(): Decoder<Data> {\n  return getStructDecoder([\n    ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['sellerFeeBasisPoints', getU16Decoder()],\n    ['creators', getOptionDecoder(getArrayDecoder(getCreatorDecoder()))],\n  ]);\n}\n\nexport function getDataCodec(): Codec<DataArgs, Data> {\n  return combineCodec(getDataEncoder(), getDataDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/dataV2.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  addDecoderSizePrefix,\n  addEncoderSizePrefix,\n  combineCodec,\n  getArrayDecoder,\n  getArrayEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU16Decoder,\n  getU16Encoder,\n  getU32Decoder,\n  getU32Encoder,\n  getUtf8Decoder,\n  getUtf8Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getCollectionDecoder,\n  getCollectionEncoder,\n  getCreatorDecoder,\n  getCreatorEncoder,\n  getUsesDecoder,\n  getUsesEncoder,\n  type Collection,\n  type CollectionArgs,\n  type Creator,\n  type CreatorArgs,\n  type Uses,\n  type UsesArgs,\n} from '.';\n\nexport type DataV2 = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: Option<Array<Creator>>;\n  collection: Option<Collection>;\n  uses: Option<Uses>;\n};\n\nexport type DataV2Args = {\n  name: string;\n  symbol: string;\n  uri: string;\n  sellerFeeBasisPoints: number;\n  creators: OptionOrNullable<Array<CreatorArgs>>;\n  collection: OptionOrNullable<CollectionArgs>;\n  uses: OptionOrNullable<UsesArgs>;\n};\n\nexport function getDataV2Encoder(): Encoder<DataV2Args> {\n  return getStructEncoder([\n    ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n    ['sellerFeeBasisPoints', getU16Encoder()],\n    ['creators', getOptionEncoder(getArrayEncoder(getCreatorEncoder()))],\n    ['collection', getOptionEncoder(getCollectionEncoder())],\n    ['uses', getOptionEncoder(getUsesEncoder())],\n  ]);\n}\n\nexport function getDataV2Decoder(): Decoder<DataV2> {\n  return getStructDecoder([\n    ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n    ['sellerFeeBasisPoints', getU16Decoder()],\n    ['creators', getOptionDecoder(getArrayDecoder(getCreatorDecoder()))],\n    ['collection', getOptionDecoder(getCollectionDecoder())],\n    ['uses', getOptionDecoder(getUsesDecoder())],\n  ]);\n}\n\nexport function getDataV2Codec(): Codec<DataV2Args, DataV2> {\n  return combineCodec(getDataV2Encoder(), getDataV2Decoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/delegateArgs.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getAuthorizationDataDecoder,\n  getAuthorizationDataEncoder,\n  type AuthorizationData,\n  type AuthorizationDataArgs,\n} from '.';\n\nexport type DelegateArgs =\n  | { __kind: 'CollectionV1'; authorizationData: Option<AuthorizationData> }\n  | {\n      __kind: 'SaleV1';\n      amount: bigint;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'TransferV1';\n      amount: bigint;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | { __kind: 'DataV1'; authorizationData: Option<AuthorizationData> }\n  | {\n      __kind: 'UtilityV1';\n      amount: bigint;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'StakingV1';\n      amount: bigint;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | { __kind: 'StandardV1'; amount: bigint }\n  | {\n      __kind: 'LockedTransferV1';\n      amount: bigint;\n      lockedAddress: Address;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'ProgrammableConfigV1';\n      authorizationData: Option<AuthorizationData>;\n    }\n  | { __kind: 'AuthorityItemV1'; authorizationData: Option<AuthorizationData> }\n  | { __kind: 'DataItemV1'; authorizationData: Option<AuthorizationData> }\n  | { __kind: 'CollectionItemV1'; authorizationData: Option<AuthorizationData> }\n  | {\n      __kind: 'ProgrammableConfigItemV1';\n      authorizationData: Option<AuthorizationData>;\n    }\n  | { __kind: 'PrintDelegateV1'; authorizationData: Option<AuthorizationData> };\n\nexport type DelegateArgsArgs =\n  | {\n      __kind: 'CollectionV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'SaleV1';\n      amount: number | bigint;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'TransferV1';\n      amount: number | bigint;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'DataV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'UtilityV1';\n      amount: number | bigint;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'StakingV1';\n      amount: number | bigint;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | { __kind: 'StandardV1'; amount: number | bigint }\n  | {\n      __kind: 'LockedTransferV1';\n      amount: number | bigint;\n      lockedAddress: Address;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'ProgrammableConfigV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AuthorityItemV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'DataItemV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'CollectionItemV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'ProgrammableConfigItemV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'PrintDelegateV1';\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    };\n\nexport function getDelegateArgsEncoder(): Encoder<DelegateArgsArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      'CollectionV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'SaleV1',\n      getStructEncoder([\n        ['amount', getU64Encoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'TransferV1',\n      getStructEncoder([\n        ['amount', getU64Encoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'DataV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'UtilityV1',\n      getStructEncoder([\n        ['amount', getU64Encoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'StakingV1',\n      getStructEncoder([\n        ['amount', getU64Encoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    ['StandardV1', getStructEncoder([['amount', getU64Encoder()]])],\n    [\n      'LockedTransferV1',\n      getStructEncoder([\n        ['amount', getU64Encoder()],\n        ['lockedAddress', getAddressEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'ProgrammableConfigV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AuthorityItemV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'DataItemV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'CollectionItemV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'ProgrammableConfigItemV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'PrintDelegateV1',\n      getStructEncoder([\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getDelegateArgsDecoder(): Decoder<DelegateArgs> {\n  return getDiscriminatedUnionDecoder([\n    [\n      'CollectionV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'SaleV1',\n      getStructDecoder([\n        ['amount', getU64Decoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'TransferV1',\n      getStructDecoder([\n        ['amount', getU64Decoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'DataV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'UtilityV1',\n      getStructDecoder([\n        ['amount', getU64Decoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'StakingV1',\n      getStructDecoder([\n        ['amount', getU64Decoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    ['StandardV1', getStructDecoder([['amount', getU64Decoder()]])],\n    [\n      'LockedTransferV1',\n      getStructDecoder([\n        ['amount', getU64Decoder()],\n        ['lockedAddress', getAddressDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'ProgrammableConfigV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AuthorityItemV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'DataItemV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'CollectionItemV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'ProgrammableConfigItemV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'PrintDelegateV1',\n      getStructDecoder([\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getDelegateArgsCodec(): Codec<DelegateArgsArgs, DelegateArgs> {\n  return combineCodec(getDelegateArgsEncoder(), getDelegateArgsDecoder());\n}\n\n// Data Enum Helpers.\nexport function delegateArgs(\n  kind: 'CollectionV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'CollectionV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'CollectionV1'>;\nexport function delegateArgs(\n  kind: 'SaleV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'SaleV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'SaleV1'>;\nexport function delegateArgs(\n  kind: 'TransferV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'TransferV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'TransferV1'>;\nexport function delegateArgs(\n  kind: 'DataV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'DataV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'DataV1'>;\nexport function delegateArgs(\n  kind: 'UtilityV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'UtilityV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'UtilityV1'>;\nexport function delegateArgs(\n  kind: 'StakingV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'StakingV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'StakingV1'>;\nexport function delegateArgs(\n  kind: 'StandardV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'StandardV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'StandardV1'>;\nexport function delegateArgs(\n  kind: 'LockedTransferV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'LockedTransferV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'LockedTransferV1'>;\nexport function delegateArgs(\n  kind: 'ProgrammableConfigV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'ProgrammableConfigV1'\n  >\n): GetDiscriminatedUnionVariant<\n  DelegateArgsArgs,\n  '__kind',\n  'ProgrammableConfigV1'\n>;\nexport function delegateArgs(\n  kind: 'AuthorityItemV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'AuthorityItemV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'AuthorityItemV1'>;\nexport function delegateArgs(\n  kind: 'DataItemV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'DataItemV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'DataItemV1'>;\nexport function delegateArgs(\n  kind: 'CollectionItemV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'CollectionItemV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'CollectionItemV1'>;\nexport function delegateArgs(\n  kind: 'ProgrammableConfigItemV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'ProgrammableConfigItemV1'\n  >\n): GetDiscriminatedUnionVariant<\n  DelegateArgsArgs,\n  '__kind',\n  'ProgrammableConfigItemV1'\n>;\nexport function delegateArgs(\n  kind: 'PrintDelegateV1',\n  data: GetDiscriminatedUnionVariantContent<\n    DelegateArgsArgs,\n    '__kind',\n    'PrintDelegateV1'\n  >\n): GetDiscriminatedUnionVariant<DelegateArgsArgs, '__kind', 'PrintDelegateV1'>;\nexport function delegateArgs<K extends DelegateArgsArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isDelegateArgs<K extends DelegateArgs['__kind']>(\n  kind: K,\n  value: DelegateArgs\n): value is DelegateArgs & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/escrowAuthority.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\n\nexport type EscrowAuthority =\n  | { __kind: 'TokenOwner' }\n  | { __kind: 'Creator'; fields: readonly [Address] };\n\nexport type EscrowAuthorityArgs = EscrowAuthority;\n\nexport function getEscrowAuthorityEncoder(): Encoder<EscrowAuthorityArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['TokenOwner', getUnitEncoder()],\n    [\n      'Creator',\n      getStructEncoder([['fields', getTupleEncoder([getAddressEncoder()])]]),\n    ],\n  ]);\n}\n\nexport function getEscrowAuthorityDecoder(): Decoder<EscrowAuthority> {\n  return getDiscriminatedUnionDecoder([\n    ['TokenOwner', getUnitDecoder()],\n    [\n      'Creator',\n      getStructDecoder([['fields', getTupleDecoder([getAddressDecoder()])]]),\n    ],\n  ]);\n}\n\nexport function getEscrowAuthorityCodec(): Codec<\n  EscrowAuthorityArgs,\n  EscrowAuthority\n> {\n  return combineCodec(getEscrowAuthorityEncoder(), getEscrowAuthorityDecoder());\n}\n\n// Data Enum Helpers.\nexport function escrowAuthority(\n  kind: 'TokenOwner'\n): GetDiscriminatedUnionVariant<EscrowAuthorityArgs, '__kind', 'TokenOwner'>;\nexport function escrowAuthority(\n  kind: 'Creator',\n  data: GetDiscriminatedUnionVariantContent<\n    EscrowAuthorityArgs,\n    '__kind',\n    'Creator'\n  >['fields']\n): GetDiscriminatedUnionVariant<EscrowAuthorityArgs, '__kind', 'Creator'>;\nexport function escrowAuthority<K extends EscrowAuthorityArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isEscrowAuthority<K extends EscrowAuthority['__kind']>(\n  kind: K,\n  value: EscrowAuthority\n): value is EscrowAuthority & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/index.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from \"./assetData\";\nexport * from \"./collection\";\nexport * from \"./collectionDetails\";\nexport * from \"./collectionDetailsToggle\";\nexport * from \"./collectionToggle\";\nexport * from \"./createArgs\";\nexport * from \"./creator\";\nexport * from \"./data\";\nexport * from \"./dataV2\";\nexport * from \"./delegateArgs\";\nexport * from \"./escrowAuthority\";\nexport * from \"./key\";\nexport * from \"./mintArgs\";\nexport * from \"./payload\";\nexport * from \"./programmableConfig\";\nexport * from \"./reservation\";\nexport * from \"./tokenStandard\";\nexport * from \"./updateArgs\";\nexport * from \"./uses\";\nexport * from \"./useMethod\";\nexport * from \"./usesToggle\";\nexport * from \"./ruleSetToggle\";\nexport * from \"./authorizationData\";\nexport * from \"./payloadType\";\nexport * from \"./seedsVec\";\nexport * from \"./proofInfo\";\nexport * from \"./printSupply\";\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/key.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getEnumDecoder,\n  getEnumEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\n\nexport enum Key {\n  Uninitialized,\n  EditionV1,\n  MasterEditionV1,\n  ReservationListV1,\n  MetadataV1,\n  ReservationListV2,\n  MasterEditionV2,\n  EditionMarker,\n  UseAuthorityRecord,\n  CollectionAuthorityRecord,\n  TokenOwnedEscrow,\n  TokenRecord,\n  MetadataDelegate,\n  EditionMarkerV2,\n  HolderDelegate,\n}\n\nexport type KeyArgs = Key;\n\nexport function getKeyEncoder(): Encoder<KeyArgs> {\n  return getEnumEncoder(Key);\n}\n\nexport function getKeyDecoder(): Decoder<Key> {\n  return getEnumDecoder(Key);\n}\n\nexport function getKeyCodec(): Codec<KeyArgs, Key> {\n  return combineCodec(getKeyEncoder(), getKeyDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/mintArgs.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type Option,\n  type OptionOrNullable,\n} from \"@solana/kit\";\nimport {\n  getAuthorizationDataDecoder,\n  getAuthorizationDataEncoder,\n  type AuthorizationData,\n  type AuthorizationDataArgs,\n} from \".\";\n\nexport type MetadataMintArgs = {\n  __kind: \"V1\";\n  amount: bigint;\n  authorizationData: Option<AuthorizationData>;\n};\n\nexport type MintArgsArgs = {\n  __kind: \"V1\";\n  amount: number | bigint;\n  authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n};\n\nexport function getMintArgsEncoder(): Encoder<MintArgsArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      \"V1\",\n      getStructEncoder([\n        [\"amount\", getU64Encoder()],\n        [\"authorizationData\", getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getMintArgsDecoder(): Decoder<MetadataMintArgs> {\n  return getDiscriminatedUnionDecoder([\n    [\n      \"V1\",\n      getStructDecoder([\n        [\"amount\", getU64Decoder()],\n        [\"authorizationData\", getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getMintArgsCodec(): Codec<MintArgsArgs, MetadataMintArgs> {\n  return combineCodec(getMintArgsEncoder(), getMintArgsDecoder());\n}\n\n// Data Enum Helpers.\nexport function mintArgs(\n  kind: \"V1\",\n  data: GetDiscriminatedUnionVariantContent<MintArgsArgs, \"__kind\", \"V1\">,\n): GetDiscriminatedUnionVariant<MintArgsArgs, \"__kind\", \"V1\">;\nexport function mintArgs<K extends MintArgsArgs[\"__kind\"], Data>(kind: K, data?: Data) {\n  return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isMintArgs<K extends MetadataMintArgs[\"__kind\"]>(\n  kind: K,\n  value: MetadataMintArgs,\n): value is MetadataMintArgs & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/payload.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  addDecoderSizePrefix,\n  addEncoderSizePrefix,\n  combineCodec,\n  getMapDecoder,\n  getMapEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU32Decoder,\n  getU32Encoder,\n  getUtf8Decoder,\n  getUtf8Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\nimport {\n  getPayloadTypeDecoder,\n  getPayloadTypeEncoder,\n  type PayloadType,\n  type PayloadTypeArgs,\n} from '.';\n\nexport type Payload = { map: Map<string, PayloadType> };\n\nexport type PayloadArgs = { map: Map<string, PayloadTypeArgs> };\n\nexport function getPayloadEncoder(): Encoder<PayloadArgs> {\n  return getStructEncoder([\n    [\n      'map',\n      getMapEncoder(\n        addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n        getPayloadTypeEncoder()\n      ),\n    ],\n  ]);\n}\n\nexport function getPayloadDecoder(): Decoder<Payload> {\n  return getStructDecoder([\n    [\n      'map',\n      getMapDecoder(\n        addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n        getPayloadTypeDecoder()\n      ),\n    ],\n  ]);\n}\n\nexport function getPayloadCodec(): Codec<PayloadArgs, Payload> {\n  return combineCodec(getPayloadEncoder(), getPayloadDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/payloadType.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\nimport {\n  getProofInfoDecoder,\n  getProofInfoEncoder,\n  getSeedsVecDecoder,\n  getSeedsVecEncoder,\n  type ProofInfo,\n  type ProofInfoArgs,\n  type SeedsVec,\n  type SeedsVecArgs,\n} from '.';\n\nexport type PayloadType =\n  | { __kind: 'Pubkey'; fields: readonly [Address] }\n  | { __kind: 'Seeds'; fields: readonly [SeedsVec] }\n  | { __kind: 'MerkleProof'; fields: readonly [ProofInfo] }\n  | { __kind: 'Number'; fields: readonly [bigint] };\n\nexport type PayloadTypeArgs =\n  | { __kind: 'Pubkey'; fields: readonly [Address] }\n  | { __kind: 'Seeds'; fields: readonly [SeedsVecArgs] }\n  | { __kind: 'MerkleProof'; fields: readonly [ProofInfoArgs] }\n  | { __kind: 'Number'; fields: readonly [number | bigint] };\n\nexport function getPayloadTypeEncoder(): Encoder<PayloadTypeArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      'Pubkey',\n      getStructEncoder([['fields', getTupleEncoder([getAddressEncoder()])]]),\n    ],\n    [\n      'Seeds',\n      getStructEncoder([['fields', getTupleEncoder([getSeedsVecEncoder()])]]),\n    ],\n    [\n      'MerkleProof',\n      getStructEncoder([['fields', getTupleEncoder([getProofInfoEncoder()])]]),\n    ],\n    [\n      'Number',\n      getStructEncoder([['fields', getTupleEncoder([getU64Encoder()])]]),\n    ],\n  ]);\n}\n\nexport function getPayloadTypeDecoder(): Decoder<PayloadType> {\n  return getDiscriminatedUnionDecoder([\n    [\n      'Pubkey',\n      getStructDecoder([['fields', getTupleDecoder([getAddressDecoder()])]]),\n    ],\n    [\n      'Seeds',\n      getStructDecoder([['fields', getTupleDecoder([getSeedsVecDecoder()])]]),\n    ],\n    [\n      'MerkleProof',\n      getStructDecoder([['fields', getTupleDecoder([getProofInfoDecoder()])]]),\n    ],\n    [\n      'Number',\n      getStructDecoder([['fields', getTupleDecoder([getU64Decoder()])]]),\n    ],\n  ]);\n}\n\nexport function getPayloadTypeCodec(): Codec<PayloadTypeArgs, PayloadType> {\n  return combineCodec(getPayloadTypeEncoder(), getPayloadTypeDecoder());\n}\n\n// Data Enum Helpers.\nexport function payloadType(\n  kind: 'Pubkey',\n  data: GetDiscriminatedUnionVariantContent<\n    PayloadTypeArgs,\n    '__kind',\n    'Pubkey'\n  >['fields']\n): GetDiscriminatedUnionVariant<PayloadTypeArgs, '__kind', 'Pubkey'>;\nexport function payloadType(\n  kind: 'Seeds',\n  data: GetDiscriminatedUnionVariantContent<\n    PayloadTypeArgs,\n    '__kind',\n    'Seeds'\n  >['fields']\n): GetDiscriminatedUnionVariant<PayloadTypeArgs, '__kind', 'Seeds'>;\nexport function payloadType(\n  kind: 'MerkleProof',\n  data: GetDiscriminatedUnionVariantContent<\n    PayloadTypeArgs,\n    '__kind',\n    'MerkleProof'\n  >['fields']\n): GetDiscriminatedUnionVariant<PayloadTypeArgs, '__kind', 'MerkleProof'>;\nexport function payloadType(\n  kind: 'Number',\n  data: GetDiscriminatedUnionVariantContent<\n    PayloadTypeArgs,\n    '__kind',\n    'Number'\n  >['fields']\n): GetDiscriminatedUnionVariant<PayloadTypeArgs, '__kind', 'Number'>;\nexport function payloadType<K extends PayloadTypeArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isPayloadType<K extends PayloadType['__kind']>(\n  kind: K,\n  value: PayloadType\n): value is PayloadType & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/printSupply.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\n\nexport type PrintSupply =\n  | { __kind: 'Zero' }\n  | { __kind: 'Limited'; fields: readonly [bigint] }\n  | { __kind: 'Unlimited' };\n\nexport type PrintSupplyArgs =\n  | { __kind: 'Zero' }\n  | { __kind: 'Limited'; fields: readonly [number | bigint] }\n  | { __kind: 'Unlimited' };\n\nexport function getPrintSupplyEncoder(): Encoder<PrintSupplyArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['Zero', getUnitEncoder()],\n    [\n      'Limited',\n      getStructEncoder([['fields', getTupleEncoder([getU64Encoder()])]]),\n    ],\n    ['Unlimited', getUnitEncoder()],\n  ]);\n}\n\nexport function getPrintSupplyDecoder(): Decoder<PrintSupply> {\n  return getDiscriminatedUnionDecoder([\n    ['Zero', getUnitDecoder()],\n    [\n      'Limited',\n      getStructDecoder([['fields', getTupleDecoder([getU64Decoder()])]]),\n    ],\n    ['Unlimited', getUnitDecoder()],\n  ]);\n}\n\nexport function getPrintSupplyCodec(): Codec<PrintSupplyArgs, PrintSupply> {\n  return combineCodec(getPrintSupplyEncoder(), getPrintSupplyDecoder());\n}\n\n// Data Enum Helpers.\nexport function printSupply(\n  kind: 'Zero'\n): GetDiscriminatedUnionVariant<PrintSupplyArgs, '__kind', 'Zero'>;\nexport function printSupply(\n  kind: 'Limited',\n  data: GetDiscriminatedUnionVariantContent<\n    PrintSupplyArgs,\n    '__kind',\n    'Limited'\n  >['fields']\n): GetDiscriminatedUnionVariant<PrintSupplyArgs, '__kind', 'Limited'>;\nexport function printSupply(\n  kind: 'Unlimited'\n): GetDiscriminatedUnionVariant<PrintSupplyArgs, '__kind', 'Unlimited'>;\nexport function printSupply<K extends PrintSupplyArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isPrintSupply<K extends PrintSupply['__kind']>(\n  kind: K,\n  value: PrintSupply\n): value is PrintSupply & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/programmableConfig.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\n\nexport type ProgrammableConfig = { __kind: 'V1'; ruleSet: Option<Address> };\n\nexport type ProgrammableConfigArgs = {\n  __kind: 'V1';\n  ruleSet: OptionOrNullable<Address>;\n};\n\nexport function getProgrammableConfigEncoder(): Encoder<ProgrammableConfigArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      'V1',\n      getStructEncoder([['ruleSet', getOptionEncoder(getAddressEncoder())]]),\n    ],\n  ]);\n}\n\nexport function getProgrammableConfigDecoder(): Decoder<ProgrammableConfig> {\n  return getDiscriminatedUnionDecoder([\n    [\n      'V1',\n      getStructDecoder([['ruleSet', getOptionDecoder(getAddressDecoder())]]),\n    ],\n  ]);\n}\n\nexport function getProgrammableConfigCodec(): Codec<\n  ProgrammableConfigArgs,\n  ProgrammableConfig\n> {\n  return combineCodec(\n    getProgrammableConfigEncoder(),\n    getProgrammableConfigDecoder()\n  );\n}\n\n// Data Enum Helpers.\nexport function programmableConfig(\n  kind: 'V1',\n  data: GetDiscriminatedUnionVariantContent<\n    ProgrammableConfigArgs,\n    '__kind',\n    'V1'\n  >\n): GetDiscriminatedUnionVariant<ProgrammableConfigArgs, '__kind', 'V1'>;\nexport function programmableConfig<\n  K extends ProgrammableConfigArgs['__kind'],\n  Data,\n>(kind: K, data?: Data) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isProgrammableConfig<K extends ProgrammableConfig['__kind']>(\n  kind: K,\n  value: ProgrammableConfig\n): value is ProgrammableConfig & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/proofInfo.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  fixDecoderSize,\n  fixEncoderSize,\n  getArrayDecoder,\n  getArrayEncoder,\n  getBytesDecoder,\n  getBytesEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type ProofInfo = { proof: Array<ReadonlyUint8Array> };\n\nexport type ProofInfoArgs = ProofInfo;\n\nexport function getProofInfoEncoder(): Encoder<ProofInfoArgs> {\n  return getStructEncoder([\n    ['proof', getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32))],\n  ]);\n}\n\nexport function getProofInfoDecoder(): Decoder<ProofInfo> {\n  return getStructDecoder([\n    ['proof', getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32))],\n  ]);\n}\n\nexport function getProofInfoCodec(): Codec<ProofInfoArgs, ProofInfo> {\n  return combineCodec(getProofInfoEncoder(), getProofInfoDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/reservation.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\n\nexport type Reservation = {\n  address: Address;\n  spotsRemaining: bigint;\n  totalSpots: bigint;\n};\n\nexport type ReservationArgs = {\n  address: Address;\n  spotsRemaining: number | bigint;\n  totalSpots: number | bigint;\n};\n\nexport function getReservationEncoder(): Encoder<ReservationArgs> {\n  return getStructEncoder([\n    ['address', getAddressEncoder()],\n    ['spotsRemaining', getU64Encoder()],\n    ['totalSpots', getU64Encoder()],\n  ]);\n}\n\nexport function getReservationDecoder(): Decoder<Reservation> {\n  return getStructDecoder([\n    ['address', getAddressDecoder()],\n    ['spotsRemaining', getU64Decoder()],\n    ['totalSpots', getU64Decoder()],\n  ]);\n}\n\nexport function getReservationCodec(): Codec<ReservationArgs, Reservation> {\n  return combineCodec(getReservationEncoder(), getReservationDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/ruleSetToggle.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\n\nexport type RuleSetToggle =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [Address] };\n\nexport type RuleSetToggleArgs = RuleSetToggle;\n\nexport function getRuleSetToggleEncoder(): Encoder<RuleSetToggleArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['None', getUnitEncoder()],\n    ['Clear', getUnitEncoder()],\n    [\n      'Set',\n      getStructEncoder([['fields', getTupleEncoder([getAddressEncoder()])]]),\n    ],\n  ]);\n}\n\nexport function getRuleSetToggleDecoder(): Decoder<RuleSetToggle> {\n  return getDiscriminatedUnionDecoder([\n    ['None', getUnitDecoder()],\n    ['Clear', getUnitDecoder()],\n    [\n      'Set',\n      getStructDecoder([['fields', getTupleDecoder([getAddressDecoder()])]]),\n    ],\n  ]);\n}\n\nexport function getRuleSetToggleCodec(): Codec<\n  RuleSetToggleArgs,\n  RuleSetToggle\n> {\n  return combineCodec(getRuleSetToggleEncoder(), getRuleSetToggleDecoder());\n}\n\n// Data Enum Helpers.\nexport function ruleSetToggle(\n  kind: 'None'\n): GetDiscriminatedUnionVariant<RuleSetToggleArgs, '__kind', 'None'>;\nexport function ruleSetToggle(\n  kind: 'Clear'\n): GetDiscriminatedUnionVariant<RuleSetToggleArgs, '__kind', 'Clear'>;\nexport function ruleSetToggle(\n  kind: 'Set',\n  data: GetDiscriminatedUnionVariantContent<\n    RuleSetToggleArgs,\n    '__kind',\n    'Set'\n  >['fields']\n): GetDiscriminatedUnionVariant<RuleSetToggleArgs, '__kind', 'Set'>;\nexport function ruleSetToggle<K extends RuleSetToggleArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isRuleSetToggle<K extends RuleSetToggle['__kind']>(\n  kind: K,\n  value: RuleSetToggle\n): value is RuleSetToggle & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/seedsVec.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  addDecoderSizePrefix,\n  addEncoderSizePrefix,\n  combineCodec,\n  getArrayDecoder,\n  getArrayEncoder,\n  getBytesDecoder,\n  getBytesEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getU32Decoder,\n  getU32Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type SeedsVec = { seeds: Array<ReadonlyUint8Array> };\n\nexport type SeedsVecArgs = SeedsVec;\n\nexport function getSeedsVecEncoder(): Encoder<SeedsVecArgs> {\n  return getStructEncoder([\n    [\n      'seeds',\n      getArrayEncoder(addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())),\n    ],\n  ]);\n}\n\nexport function getSeedsVecDecoder(): Decoder<SeedsVec> {\n  return getStructDecoder([\n    [\n      'seeds',\n      getArrayDecoder(addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())),\n    ],\n  ]);\n}\n\nexport function getSeedsVecCodec(): Codec<SeedsVecArgs, SeedsVec> {\n  return combineCodec(getSeedsVecEncoder(), getSeedsVecDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/tokenStandard.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, getEnumDecoder, getEnumEncoder, type Codec, type Decoder, type Encoder } from \"@solana/kit\";\n\nexport enum TokenStandard {\n  NonFungible,\n  FungibleAsset,\n  Fungible,\n  NonFungibleEdition,\n  ProgrammableNonFungible,\n  ProgrammableNonFungibleEdition,\n}\n\nexport type TokenStandardArgs = TokenStandard;\n\nexport function getTokenStandardEncoder(): Encoder<TokenStandardArgs> {\n  return getEnumEncoder(TokenStandard);\n}\n\nexport function getTokenStandardDecoder(): Decoder<TokenStandard> {\n  return getEnumDecoder(TokenStandard);\n}\n\nexport function getTokenStandardCodec(): Codec<TokenStandardArgs, TokenStandard> {\n  return combineCodec(getTokenStandardEncoder(), getTokenStandardDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/updateArgs.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getAddressDecoder,\n  getAddressEncoder,\n  getBooleanDecoder,\n  getBooleanEncoder,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getOptionDecoder,\n  getOptionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  type Address,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n  type Option,\n  type OptionOrNullable,\n} from '@solana/kit';\nimport {\n  getAuthorizationDataDecoder,\n  getAuthorizationDataEncoder,\n  getCollectionDetailsToggleDecoder,\n  getCollectionDetailsToggleEncoder,\n  getCollectionToggleDecoder,\n  getCollectionToggleEncoder,\n  getDataDecoder,\n  getDataEncoder,\n  getRuleSetToggleDecoder,\n  getRuleSetToggleEncoder,\n  getTokenStandardDecoder,\n  getTokenStandardEncoder,\n  getUsesToggleDecoder,\n  getUsesToggleEncoder,\n  type AuthorizationData,\n  type AuthorizationDataArgs,\n  type CollectionDetailsToggle,\n  type CollectionDetailsToggleArgs,\n  type CollectionToggle,\n  type CollectionToggleArgs,\n  type Data,\n  type DataArgs,\n  type RuleSetToggle,\n  type RuleSetToggleArgs,\n  type TokenStandard,\n  type TokenStandardArgs,\n  type UsesToggle,\n  type UsesToggleArgs,\n} from '.';\n\nexport type UpdateArgs =\n  | {\n      __kind: 'V1';\n      newUpdateAuthority: Option<Address>;\n      data: Option<Data>;\n      primarySaleHappened: Option<boolean>;\n      isMutable: Option<boolean>;\n      collection: CollectionToggle;\n      collectionDetails: CollectionDetailsToggle;\n      uses: UsesToggle;\n      ruleSet: RuleSetToggle;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsUpdateAuthorityV2';\n      newUpdateAuthority: Option<Address>;\n      data: Option<Data>;\n      primarySaleHappened: Option<boolean>;\n      isMutable: Option<boolean>;\n      collection: CollectionToggle;\n      collectionDetails: CollectionDetailsToggle;\n      uses: UsesToggle;\n      ruleSet: RuleSetToggle;\n      tokenStandard: Option<TokenStandard>;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsAuthorityItemDelegateV2';\n      newUpdateAuthority: Option<Address>;\n      primarySaleHappened: Option<boolean>;\n      isMutable: Option<boolean>;\n      tokenStandard: Option<TokenStandard>;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsCollectionDelegateV2';\n      collection: CollectionToggle;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsDataDelegateV2';\n      data: Option<Data>;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsProgrammableConfigDelegateV2';\n      ruleSet: RuleSetToggle;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsDataItemDelegateV2';\n      data: Option<Data>;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsCollectionItemDelegateV2';\n      collection: CollectionToggle;\n      authorizationData: Option<AuthorizationData>;\n    }\n  | {\n      __kind: 'AsProgrammableConfigItemDelegateV2';\n      ruleSet: RuleSetToggle;\n      authorizationData: Option<AuthorizationData>;\n    };\n\nexport type UpdateArgsArgs =\n  | {\n      __kind: 'V1';\n      newUpdateAuthority: OptionOrNullable<Address>;\n      data: OptionOrNullable<DataArgs>;\n      primarySaleHappened: OptionOrNullable<boolean>;\n      isMutable: OptionOrNullable<boolean>;\n      collection: CollectionToggleArgs;\n      collectionDetails: CollectionDetailsToggleArgs;\n      uses: UsesToggleArgs;\n      ruleSet: RuleSetToggleArgs;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsUpdateAuthorityV2';\n      newUpdateAuthority: OptionOrNullable<Address>;\n      data: OptionOrNullable<DataArgs>;\n      primarySaleHappened: OptionOrNullable<boolean>;\n      isMutable: OptionOrNullable<boolean>;\n      collection: CollectionToggleArgs;\n      collectionDetails: CollectionDetailsToggleArgs;\n      uses: UsesToggleArgs;\n      ruleSet: RuleSetToggleArgs;\n      tokenStandard: OptionOrNullable<TokenStandardArgs>;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsAuthorityItemDelegateV2';\n      newUpdateAuthority: OptionOrNullable<Address>;\n      primarySaleHappened: OptionOrNullable<boolean>;\n      isMutable: OptionOrNullable<boolean>;\n      tokenStandard: OptionOrNullable<TokenStandardArgs>;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsCollectionDelegateV2';\n      collection: CollectionToggleArgs;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsDataDelegateV2';\n      data: OptionOrNullable<DataArgs>;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsProgrammableConfigDelegateV2';\n      ruleSet: RuleSetToggleArgs;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsDataItemDelegateV2';\n      data: OptionOrNullable<DataArgs>;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsCollectionItemDelegateV2';\n      collection: CollectionToggleArgs;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    }\n  | {\n      __kind: 'AsProgrammableConfigItemDelegateV2';\n      ruleSet: RuleSetToggleArgs;\n      authorizationData: OptionOrNullable<AuthorizationDataArgs>;\n    };\n\nexport function getUpdateArgsEncoder(): Encoder<UpdateArgsArgs> {\n  return getDiscriminatedUnionEncoder([\n    [\n      'V1',\n      getStructEncoder([\n        ['newUpdateAuthority', getOptionEncoder(getAddressEncoder())],\n        ['data', getOptionEncoder(getDataEncoder())],\n        ['primarySaleHappened', getOptionEncoder(getBooleanEncoder())],\n        ['isMutable', getOptionEncoder(getBooleanEncoder())],\n        ['collection', getCollectionToggleEncoder()],\n        ['collectionDetails', getCollectionDetailsToggleEncoder()],\n        ['uses', getUsesToggleEncoder()],\n        ['ruleSet', getRuleSetToggleEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsUpdateAuthorityV2',\n      getStructEncoder([\n        ['newUpdateAuthority', getOptionEncoder(getAddressEncoder())],\n        ['data', getOptionEncoder(getDataEncoder())],\n        ['primarySaleHappened', getOptionEncoder(getBooleanEncoder())],\n        ['isMutable', getOptionEncoder(getBooleanEncoder())],\n        ['collection', getCollectionToggleEncoder()],\n        ['collectionDetails', getCollectionDetailsToggleEncoder()],\n        ['uses', getUsesToggleEncoder()],\n        ['ruleSet', getRuleSetToggleEncoder()],\n        ['tokenStandard', getOptionEncoder(getTokenStandardEncoder())],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsAuthorityItemDelegateV2',\n      getStructEncoder([\n        ['newUpdateAuthority', getOptionEncoder(getAddressEncoder())],\n        ['primarySaleHappened', getOptionEncoder(getBooleanEncoder())],\n        ['isMutable', getOptionEncoder(getBooleanEncoder())],\n        ['tokenStandard', getOptionEncoder(getTokenStandardEncoder())],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsCollectionDelegateV2',\n      getStructEncoder([\n        ['collection', getCollectionToggleEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsDataDelegateV2',\n      getStructEncoder([\n        ['data', getOptionEncoder(getDataEncoder())],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsProgrammableConfigDelegateV2',\n      getStructEncoder([\n        ['ruleSet', getRuleSetToggleEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsDataItemDelegateV2',\n      getStructEncoder([\n        ['data', getOptionEncoder(getDataEncoder())],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsCollectionItemDelegateV2',\n      getStructEncoder([\n        ['collection', getCollectionToggleEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n    [\n      'AsProgrammableConfigItemDelegateV2',\n      getStructEncoder([\n        ['ruleSet', getRuleSetToggleEncoder()],\n        ['authorizationData', getOptionEncoder(getAuthorizationDataEncoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getUpdateArgsDecoder(): Decoder<UpdateArgs> {\n  return getDiscriminatedUnionDecoder([\n    [\n      'V1',\n      getStructDecoder([\n        ['newUpdateAuthority', getOptionDecoder(getAddressDecoder())],\n        ['data', getOptionDecoder(getDataDecoder())],\n        ['primarySaleHappened', getOptionDecoder(getBooleanDecoder())],\n        ['isMutable', getOptionDecoder(getBooleanDecoder())],\n        ['collection', getCollectionToggleDecoder()],\n        ['collectionDetails', getCollectionDetailsToggleDecoder()],\n        ['uses', getUsesToggleDecoder()],\n        ['ruleSet', getRuleSetToggleDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsUpdateAuthorityV2',\n      getStructDecoder([\n        ['newUpdateAuthority', getOptionDecoder(getAddressDecoder())],\n        ['data', getOptionDecoder(getDataDecoder())],\n        ['primarySaleHappened', getOptionDecoder(getBooleanDecoder())],\n        ['isMutable', getOptionDecoder(getBooleanDecoder())],\n        ['collection', getCollectionToggleDecoder()],\n        ['collectionDetails', getCollectionDetailsToggleDecoder()],\n        ['uses', getUsesToggleDecoder()],\n        ['ruleSet', getRuleSetToggleDecoder()],\n        ['tokenStandard', getOptionDecoder(getTokenStandardDecoder())],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsAuthorityItemDelegateV2',\n      getStructDecoder([\n        ['newUpdateAuthority', getOptionDecoder(getAddressDecoder())],\n        ['primarySaleHappened', getOptionDecoder(getBooleanDecoder())],\n        ['isMutable', getOptionDecoder(getBooleanDecoder())],\n        ['tokenStandard', getOptionDecoder(getTokenStandardDecoder())],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsCollectionDelegateV2',\n      getStructDecoder([\n        ['collection', getCollectionToggleDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsDataDelegateV2',\n      getStructDecoder([\n        ['data', getOptionDecoder(getDataDecoder())],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsProgrammableConfigDelegateV2',\n      getStructDecoder([\n        ['ruleSet', getRuleSetToggleDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsDataItemDelegateV2',\n      getStructDecoder([\n        ['data', getOptionDecoder(getDataDecoder())],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsCollectionItemDelegateV2',\n      getStructDecoder([\n        ['collection', getCollectionToggleDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n    [\n      'AsProgrammableConfigItemDelegateV2',\n      getStructDecoder([\n        ['ruleSet', getRuleSetToggleDecoder()],\n        ['authorizationData', getOptionDecoder(getAuthorizationDataDecoder())],\n      ]),\n    ],\n  ]);\n}\n\nexport function getUpdateArgsCodec(): Codec<UpdateArgsArgs, UpdateArgs> {\n  return combineCodec(getUpdateArgsEncoder(), getUpdateArgsDecoder());\n}\n\n// Data Enum Helpers.\nexport function updateArgs(\n  kind: 'V1',\n  data: GetDiscriminatedUnionVariantContent<UpdateArgsArgs, '__kind', 'V1'>\n): GetDiscriminatedUnionVariant<UpdateArgsArgs, '__kind', 'V1'>;\nexport function updateArgs(\n  kind: 'AsUpdateAuthorityV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsUpdateAuthorityV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsUpdateAuthorityV2'\n>;\nexport function updateArgs(\n  kind: 'AsAuthorityItemDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsAuthorityItemDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsAuthorityItemDelegateV2'\n>;\nexport function updateArgs(\n  kind: 'AsCollectionDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsCollectionDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsCollectionDelegateV2'\n>;\nexport function updateArgs(\n  kind: 'AsDataDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsDataDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<UpdateArgsArgs, '__kind', 'AsDataDelegateV2'>;\nexport function updateArgs(\n  kind: 'AsProgrammableConfigDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsProgrammableConfigDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsProgrammableConfigDelegateV2'\n>;\nexport function updateArgs(\n  kind: 'AsDataItemDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsDataItemDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsDataItemDelegateV2'\n>;\nexport function updateArgs(\n  kind: 'AsCollectionItemDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsCollectionItemDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsCollectionItemDelegateV2'\n>;\nexport function updateArgs(\n  kind: 'AsProgrammableConfigItemDelegateV2',\n  data: GetDiscriminatedUnionVariantContent<\n    UpdateArgsArgs,\n    '__kind',\n    'AsProgrammableConfigItemDelegateV2'\n  >\n): GetDiscriminatedUnionVariant<\n  UpdateArgsArgs,\n  '__kind',\n  'AsProgrammableConfigItemDelegateV2'\n>;\nexport function updateArgs<K extends UpdateArgsArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isUpdateArgs<K extends UpdateArgs['__kind']>(\n  kind: K,\n  value: UpdateArgs\n): value is UpdateArgs & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/useMethod.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getEnumDecoder,\n  getEnumEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\n\nexport enum UseMethod {\n  Burn,\n  Multiple,\n  Single,\n}\n\nexport type UseMethodArgs = UseMethod;\n\nexport function getUseMethodEncoder(): Encoder<UseMethodArgs> {\n  return getEnumEncoder(UseMethod);\n}\n\nexport function getUseMethodDecoder(): Decoder<UseMethod> {\n  return getEnumDecoder(UseMethod);\n}\n\nexport function getUseMethodCodec(): Codec<UseMethodArgs, UseMethod> {\n  return combineCodec(getUseMethodEncoder(), getUseMethodDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/uses.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getStructDecoder,\n  getStructEncoder,\n  getU64Decoder,\n  getU64Encoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n} from '@solana/kit';\nimport {\n  getUseMethodDecoder,\n  getUseMethodEncoder,\n  type UseMethod,\n  type UseMethodArgs,\n} from '.';\n\nexport type Uses = { useMethod: UseMethod; remaining: bigint; total: bigint };\n\nexport type UsesArgs = {\n  useMethod: UseMethodArgs;\n  remaining: number | bigint;\n  total: number | bigint;\n};\n\nexport function getUsesEncoder(): Encoder<UsesArgs> {\n  return getStructEncoder([\n    ['useMethod', getUseMethodEncoder()],\n    ['remaining', getU64Encoder()],\n    ['total', getU64Encoder()],\n  ]);\n}\n\nexport function getUsesDecoder(): Decoder<Uses> {\n  return getStructDecoder([\n    ['useMethod', getUseMethodDecoder()],\n    ['remaining', getU64Decoder()],\n    ['total', getU64Decoder()],\n  ]);\n}\n\nexport function getUsesCodec(): Codec<UsesArgs, Uses> {\n  return combineCodec(getUsesEncoder(), getUsesDecoder());\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/generated/types/usesToggle.ts",
    "content": "/**\n * This code was AUTOGENERATED using the codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n  combineCodec,\n  getDiscriminatedUnionDecoder,\n  getDiscriminatedUnionEncoder,\n  getStructDecoder,\n  getStructEncoder,\n  getTupleDecoder,\n  getTupleEncoder,\n  getUnitDecoder,\n  getUnitEncoder,\n  type Codec,\n  type Decoder,\n  type Encoder,\n  type GetDiscriminatedUnionVariant,\n  type GetDiscriminatedUnionVariantContent,\n} from '@solana/kit';\nimport { getUsesDecoder, getUsesEncoder, type Uses, type UsesArgs } from '.';\n\nexport type UsesToggle =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [Uses] };\n\nexport type UsesToggleArgs =\n  | { __kind: 'None' }\n  | { __kind: 'Clear' }\n  | { __kind: 'Set'; fields: readonly [UsesArgs] };\n\nexport function getUsesToggleEncoder(): Encoder<UsesToggleArgs> {\n  return getDiscriminatedUnionEncoder([\n    ['None', getUnitEncoder()],\n    ['Clear', getUnitEncoder()],\n    [\n      'Set',\n      getStructEncoder([['fields', getTupleEncoder([getUsesEncoder()])]]),\n    ],\n  ]);\n}\n\nexport function getUsesToggleDecoder(): Decoder<UsesToggle> {\n  return getDiscriminatedUnionDecoder([\n    ['None', getUnitDecoder()],\n    ['Clear', getUnitDecoder()],\n    [\n      'Set',\n      getStructDecoder([['fields', getTupleDecoder([getUsesDecoder()])]]),\n    ],\n  ]);\n}\n\nexport function getUsesToggleCodec(): Codec<UsesToggleArgs, UsesToggle> {\n  return combineCodec(getUsesToggleEncoder(), getUsesToggleDecoder());\n}\n\n// Data Enum Helpers.\nexport function usesToggle(\n  kind: 'None'\n): GetDiscriminatedUnionVariant<UsesToggleArgs, '__kind', 'None'>;\nexport function usesToggle(\n  kind: 'Clear'\n): GetDiscriminatedUnionVariant<UsesToggleArgs, '__kind', 'Clear'>;\nexport function usesToggle(\n  kind: 'Set',\n  data: GetDiscriminatedUnionVariantContent<\n    UsesToggleArgs,\n    '__kind',\n    'Set'\n  >['fields']\n): GetDiscriminatedUnionVariant<UsesToggleArgs, '__kind', 'Set'>;\nexport function usesToggle<K extends UsesToggleArgs['__kind'], Data>(\n  kind: K,\n  data?: Data\n) {\n  return Array.isArray(data)\n    ? { __kind: kind, fields: data }\n    : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isUsesToggle<K extends UsesToggle['__kind']>(\n  kind: K,\n  value: UsesToggle\n): value is UsesToggle & { __kind: K } {\n  return value.__kind === kind;\n}\n"
  },
  {
    "path": "packages/gill/src/programs/token-metadata/index.ts",
    "content": "/**\n * Token Metadata program from Metaplex\n * - repo: https://github.com/metaplex-foundation/mpl-token-metadata\n *\n * TypeScript client generated via Codama\n */\n\nexport * from \"./generated\";\nexport * from \"./addresses\";\n"
  },
  {
    "path": "packages/gill/src/types/explorer.ts",
    "content": "import type { SolanaClusterMoniker } from \"./rpc\";\n\ntype ExplorerLinkAccount = {\n  address: string;\n};\ntype ExplorerLinkTransaction = {\n  transaction: string;\n};\ntype ExplorerLinkBlock = {\n  block: string;\n};\n\n/**\n * @param cluster - Default: `mainnet`\n */\nexport type GetExplorerLinkArgs = {\n  cluster?: SolanaClusterMoniker | \"mainnet-beta\" | \"localhost\";\n} & (ExplorerLinkAccount | ExplorerLinkTransaction | ExplorerLinkBlock | {});\n"
  },
  {
    "path": "packages/gill/src/types/global.d.ts",
    "content": "declare const __BROWSER__: boolean;\ndeclare const __DEV__: boolean;\ndeclare const __NODEJS__: boolean;\ndeclare const __REACTNATIVE__: boolean;\ndeclare const __VERSION__: string;\n"
  },
  {
    "path": "packages/gill/src/types/index.ts",
    "content": "export * from \"./rpc\";\nexport * from \"./explorer\";\nexport * from \"./transactions\";\n\nexport type Simplify<T> = {\n  [K in keyof T]: T[K];\n} & {};\n"
  },
  {
    "path": "packages/gill/src/types/rpc.ts",
    "content": "import type {\n  createSolanaRpc,\n  createSolanaRpcSubscriptions,\n  DevnetUrl,\n  MainnetUrl,\n  RpcFromTransport,\n  RpcSubscriptions,\n  RpcTransportFromClusterUrl,\n  SolanaRpcApiFromTransport,\n  SolanaRpcSubscriptionsApi,\n  TestnetUrl,\n} from \"@solana/kit\";\n\nimport { SendAndConfirmTransactionWithSignersFunction } from \"../core/send-and-confirm-transaction-with-signers\";\nimport type { SimulateTransactionFunction } from \"../core/simulate-transaction\";\n\n/** Solana cluster moniker */\nexport type SolanaClusterMoniker = \"devnet\" | \"localnet\" | \"mainnet\" | \"testnet\";\n\nexport type LocalnetUrl = string & { \"~cluster\": \"localnet\" };\n\nexport type GenericUrl = string & {};\n\nexport type ModifiedClusterUrl = DevnetUrl | GenericUrl | LocalnetUrl | MainnetUrl | TestnetUrl;\n\nexport type SolanaClientUrlOrMoniker = ModifiedClusterUrl | SolanaClusterMoniker | URL;\n\nexport type CreateSolanaClientArgs<TClusterUrl extends SolanaClientUrlOrMoniker = GenericUrl> = {\n  /** Configuration used to create the `rpc` client */\n  rpcConfig?: Parameters<typeof createSolanaRpc>[1] & { port?: number };\n  /** Configuration used to create the `rpcSubscriptions` client */\n  rpcSubscriptionsConfig?: Parameters<typeof createSolanaRpcSubscriptions>[1] & { port?: number };\n  /** Full RPC URL (for a private RPC endpoint) or the Solana moniker (for a public RPC endpoint) */\n  urlOrMoniker: SolanaClientUrlOrMoniker | TClusterUrl;\n};\n\nexport type SolanaClient<TClusterUrl extends ModifiedClusterUrl | string = string> = {\n  /** Used to make RPC calls to your RPC provider */\n  rpc: RpcFromTransport<\n    SolanaRpcApiFromTransport<RpcTransportFromClusterUrl<TClusterUrl>>,\n    RpcTransportFromClusterUrl<TClusterUrl>\n  >;\n  /** Used to make RPC websocket calls to your RPC provider */\n  rpcSubscriptions: RpcSubscriptions<SolanaRpcSubscriptionsApi> & TClusterUrl;\n  /**\n   * Send and confirm a transaction to the network (including signing with available Signers).\n   *\n   * If the `transaction` does not already have a latest blockhash (and is not already signed), it will be automatically retrieved and applied.\n   *\n   * Default commitment level: `confirmed`\n   */\n  sendAndConfirmTransaction: SendAndConfirmTransactionWithSignersFunction;\n  /**\n   * Simulate a transaction on the network\n   */\n  simulateTransaction: SimulateTransactionFunction;\n  /** Full RPC URL (for a private RPC endpoint) or the Solana moniker (for a public RPC endpoint) */\n  urlOrMoniker: SolanaClientUrlOrMoniker | TClusterUrl;\n};\n"
  },
  {
    "path": "packages/gill/src/types/transactions.ts",
    "content": "import type {\n  Address,\n  BaseTransactionMessage,\n  Instruction,\n  TransactionMessageWithBlockhashLifetime,\n  TransactionMessageWithFeePayer,\n  TransactionMessageWithFeePayerSigner,\n  TransactionSigner,\n  TransactionVersion,\n} from \"@solana/kit\";\n\nimport type { Simplify } from \".\";\n\nexport type CreateTransactionInput<\n  TVersion extends TransactionVersion | \"auto\",\n  TFeePayer extends Address | TransactionSigner = TransactionSigner,\n  TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime[\"lifetimeConstraint\"] | undefined = undefined,\n> = {\n  /** Compute unit limit value to set on this transaction */\n  computeUnitLimit?: bigint | number;\n  /** Compute unit price (in micro-lamports) to set on this transaction */\n  computeUnitPrice?: bigint | number;\n  /** Address or Signer that will pay transaction fees */\n  feePayer: TFeePayer;\n  /** List of instructions for this transaction */\n  instructions: Instruction[];\n  /**\n   * Latest blockhash (aka transaction lifetime) for this transaction to\n   * accepted for execution on the Solana network\n   * */\n  latestBlockhash?: TLifetimeConstraint;\n  /**\n   * Transaction version\n   * - `auto` automatically selects based on instruction content (default)\n   * - `legacy` for traditional transactions\n   * - `0` for transactions using Address Lookup Tables\n   *\n   * @default `auto`\n   * */\n  version?: TVersion;\n};\n\nexport type FullTransaction<\n  TVersion extends TransactionVersion,\n  TFeePayer extends TransactionMessageWithFeePayer | TransactionMessageWithFeePayerSigner,\n  TBlockhashLifetime extends TransactionMessageWithBlockhashLifetime | undefined = undefined,\n> = Simplify<\n  BaseTransactionMessage<TVersion> &\n    TFeePayer &\n    (TBlockhashLifetime extends TransactionMessageWithBlockhashLifetime\n      ? TransactionMessageWithBlockhashLifetime\n      : object)\n>;\n"
  },
  {
    "path": "packages/gill/tsconfig.declarations.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"include\": [\"src/programs/token/index.ts\", \"src/programs/index.ts\", \"src/node/index.ts\", \"src/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/gill/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"gill\",\n  \"extends\": \"../tsconfig/base.json\",\n  \"include\": [\"src\", \"src/programs/token/index.ts\", \"src/programs/index.ts\", \"src/node/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/gill/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"../build-scripts/getBaseConfig\";\n\nexport default defineConfig((options = {}) => [\n  // ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], {\n    ...options,\n    entry: {\n      index: \"src/index.ts\",\n      \"node/index\": \"src/node/index.ts\",\n      // some program clients have symbol collision, re-exporting under a different path helps resolve them\n      \"programs/index\": \"src/programs/index.ts\",\n      \"programs/token/index\": \"src/programs/token/index.ts\",\n    },\n  }),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"native\", [\"esm\"], options),\n]);\n"
  },
  {
    "path": "packages/gill/typedoc.core.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"extends\": [\"../../typedoc.json\"],\n  \"entryPoints\": [\"src/index.ts\"],\n  \"out\": \"./.docs/gill\"\n}\n"
  },
  {
    "path": "packages/gill/typedoc.node.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"extends\": [\"../../typedoc.json\"],\n  \"entryPoints\": [\"src/node/index.ts\"],\n  \"out\": \"./.docs/gill-node\"\n}\n"
  },
  {
    "path": "packages/gill/typedoc.programs.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"extends\": [\"../../typedoc.json\"],\n  \"excludeExternals\": false,\n  \"entryPoints\": [\n    \"src/programs/compute-budget/index.ts\",\n    \"src/programs/system/index.ts\",\n    \"src/programs/address-lookup-table/index.ts\",\n    \"src/programs/memo/index.ts\",\n    \"src/programs/token/index.ts\",\n    \"src/programs/token-metadata/index.ts\"\n  ],\n  \"out\": \"./.docs/gill-programs\"\n}\n"
  },
  {
    "path": "packages/react/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "packages/react/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/react/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/react/CHANGELOG.md",
    "content": "# @gillsdk/react\n\n## 0.7.0\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies [[`e345aa9`](https://github.com/gillsdk/gill/commit/e345aa9977513ce9f8635543bad3d5ed392365d5),\n  [`0ea4c93`](https://github.com/gillsdk/gill/commit/0ea4c93d0f2a812b2fcceb2b467f8c9bb8b3afb8)]:\n  - gill@0.14.0\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies [[`157dc22`](https://github.com/gillsdk/gill/commit/157dc221655d5fa56fc035d9fbaad58caa48af19)]:\n  - gill@0.13.0\n\n## 0.6.0\n\n### Minor Changes\n\n- [#267](https://github.com/gillsdk/gill/pull/267)\n  [`459e9a7`](https://github.com/gillsdk/gill/commit/459e9a778b1316374c7028144dd41cde0c5c2455) Thanks\n  [@tobeycodes](https://github.com/tobeycodes)! - fix: update solana client race condition\n\n- [#270](https://github.com/gillsdk/gill/pull/270)\n  [`91a3ac2`](https://github.com/gillsdk/gill/commit/91a3ac24d2b79f9d22e7a2b3df88cbd2a8465063) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - include wallet standard basics\n\n- [#228](https://github.com/gillsdk/gill/pull/228)\n  [`83bba6a`](https://github.com/gillsdk/gill/commit/83bba6a3643c5eb719f5018917308fd8dad6e540) Thanks\n  [@JkrishnaD](https://github.com/JkrishnaD)! - update `useProgramAccounts` hook by removing the base58 encodings\n\n- [#271](https://github.com/gillsdk/gill/pull/271)\n  [`4f69014`](https://github.com/gillsdk/gill/commit/4f69014f182c7ea0a2d21d9b73e95acf704da8f1) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - update to esm over commonJS, including updating relative imports\n\n- [#180](https://github.com/gillsdk/gill/pull/180)\n  [`6ddaef9`](https://github.com/gillsdk/gill/commit/6ddaef9e530325678aa0c81a52661d003bf4a518) Thanks\n  [@kirtiraj22](https://github.com/kirtiraj22)! - adds useMultipleAccounts hook\n\n- [#174](https://github.com/gillsdk/gill/pull/174)\n  [`d59e1fd`](https://github.com/gillsdk/gill/commit/d59e1fdc05a194f286c142bb8b9495432a7649fd) Thanks\n  [@pratikbuilds](https://github.com/pratikbuilds)! - adds useSimulateTransaction hook\n\n- [#176](https://github.com/gillsdk/gill/pull/176)\n  [`34a0ac9`](https://github.com/gillsdk/gill/commit/34a0ac9d74e84b1a1bd0348daad3abae2e1f2a93) Thanks\n  [@pratikbuilds](https://github.com/pratikbuilds)! - adds useTokenAccountBalance hook\n\n### Patch Changes\n\n- [#264](https://github.com/gillsdk/gill/pull/264)\n  [`9c22897`](https://github.com/gillsdk/gill/commit/9c228971124c7e711cbbad15b7298fca5dec4c62) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - updated token program imports from \"gill/programs/token\" to\n  \"gill/programs\"\n\n- [#233](https://github.com/gillsdk/gill/pull/233)\n  [`0474578`](https://github.com/gillsdk/gill/commit/04745787a188baa1395cd1a6cc4ff07b98b305d7) Thanks\n  [@vict0rcarvalh0](https://github.com/vict0rcarvalh0)! - fix(react): respect user-provided enabled field in hooks\n\n- Updated dependencies [[`55e5628`](https://github.com/gillsdk/gill/commit/55e562846a0865c0c9773f638e5a48b35e89ed5b),\n  [`2efea9f`](https://github.com/gillsdk/gill/commit/2efea9fde46aca6c030c6bcc07ae2aee4f359ea8),\n  [`459e9a7`](https://github.com/gillsdk/gill/commit/459e9a778b1316374c7028144dd41cde0c5c2455),\n  [`8849226`](https://github.com/gillsdk/gill/commit/8849226d153f9a2660796b829ad44b5e37bae1a0),\n  [`9c22897`](https://github.com/gillsdk/gill/commit/9c228971124c7e711cbbad15b7298fca5dec4c62),\n  [`b94c6f4`](https://github.com/gillsdk/gill/commit/b94c6f4cf0f83bfea550b19580d930fbde908911),\n  [`ee23f2a`](https://github.com/gillsdk/gill/commit/ee23f2a3fbabd31c3ca040e7def970aa552afdf9),\n  [`54e2e96`](https://github.com/gillsdk/gill/commit/54e2e96f87192d36080ececfba0cc3b64c608485),\n  [`8a50e71`](https://github.com/gillsdk/gill/commit/8a50e7151da1b1f270850b25127ac0a671fe6aa5)]:\n  - gill@0.12.0\n\n## 0.5.1\n\n### Patch Changes\n\n- Updated dependencies [[`7f77aa4`](https://github.com/gillsdk/gill/commit/7f77aa47385680bfb331e36f4f2a8d6a0c8aa250),\n  [`a828da0`](https://github.com/gillsdk/gill/commit/a828da0b2e4e87436d254062d339167fed3db8ab)]:\n  - gill@0.11.0\n\n## 0.5.0\n\n### Minor Changes\n\n- [#173](https://github.com/gillsdk/gill/pull/173)\n  [`230d982`](https://github.com/gillsdk/gill/commit/230d982ae177c6912e46b46dabbcb7aae49addb1) Thanks\n  [@pratikbuilds](https://github.com/pratikbuilds)! - added `useRecentPrioritizationFees` hook\n\n- [#187](https://github.com/gillsdk/gill/pull/187)\n  [`50982c2`](https://github.com/gillsdk/gill/commit/50982c2721ba1e05e9f0981065c6fcc07dee9528) Thanks\n  [@zsh28](https://github.com/zsh28)! - add the `useTransaction` hook\n\n- [#171](https://github.com/gillsdk/gill/pull/171)\n  [`347ff26`](https://github.com/gillsdk/gill/commit/347ff26b30b6fb8593a14ce996515440e3b0b295) Thanks\n  [@pratikbuilds](https://github.com/pratikbuilds)! - added `useSlot` hook\n\n- [#188](https://github.com/gillsdk/gill/pull/188)\n  [`8494f99`](https://github.com/gillsdk/gill/commit/8494f99d82630389659359ba9b567124b0c04e3a) Thanks\n  [@holps-7](https://github.com/holps-7)! - added `useSignaturesForAddress` hook\n\n### Patch Changes\n\n- [#179](https://github.com/gillsdk/gill/pull/179)\n  [`b9e1027`](https://github.com/gillsdk/gill/commit/b9e102793b30b0bf8a5c8e512ecc20f04a1e6ddc) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - update repo location\n\n- Updated dependencies [[`0473034`](https://github.com/gillsdk/gill/commit/0473034aaac424195b120e939d6501bfd6a24a9d),\n  [`37b88f1`](https://github.com/gillsdk/gill/commit/37b88f1a3951db73e46d0969e2c0a2d400ba0579),\n  [`b9e1027`](https://github.com/gillsdk/gill/commit/b9e102793b30b0bf8a5c8e512ecc20f04a1e6ddc),\n  [`e1c47e9`](https://github.com/gillsdk/gill/commit/e1c47e9a84340bed35d5b33298c600a3b23628ff)]:\n  - gill@0.10.3\n\n## 0.4.4\n\n### Patch Changes\n\n- Updated dependencies [[`29b0b02`](https://github.com/gillsdk/gill/commit/29b0b0260b03ad2434a2e838204d248061e0fdfa),\n  [`81c6bed`](https://github.com/gillsdk/gill/commit/81c6beddc314a98b75180e5241c7808da16c4f42)]:\n  - gill@0.10.2\n\n## 0.4.3\n\n### Patch Changes\n\n- Updated dependencies [[`c3f7b64`](https://github.com/gillsdk/gill/commit/c3f7b64ce7e2c2ed045ede39885e36c054fa1403),\n  [`2571cec`](https://github.com/gillsdk/gill/commit/2571ceca9efab70fbe8b7e451a3be35db106dfd6)]:\n  - gill@0.10.1\n\n## 0.4.2\n\n### Patch Changes\n\n- Updated dependencies [[`0be650e`](https://github.com/gillsdk/gill/commit/0be650e92c1f8de1011e6fdbde0a66aaf07cc120)]:\n  - gill@0.9.2\n\n## 0.4.1\n\n### Patch Changes\n\n- Updated dependencies [[`537c26d`](https://github.com/gillsdk/gill/commit/537c26daa62519f9061891103862e902e1605a25),\n  [`ebbc4d6`](https://github.com/gillsdk/gill/commit/ebbc4d6f5b8e616d600fd3542226a201a5d5df40)]:\n  - gill@0.9.1\n\n## 0.4.0\n\n### Minor Changes\n\n- [#96](https://github.com/gillsdk/gill/pull/96)\n  [`844bcb3`](https://github.com/gillsdk/gill/commit/844bcb3e71937c9f4af8c93b2058d0d03f793a75) Thanks\n  [@Gift-Stack](https://github.com/Gift-Stack)! - added `useTokenAccount` hook\n\n### Patch Changes\n\n- Updated dependencies [[`4bac16e`](https://github.com/gillsdk/gill/commit/4bac16ef9d11a11ca59bf2ffa99d23ad77e8bd21),\n  [`90f7a8e`](https://github.com/gillsdk/gill/commit/90f7a8eeb9fbce3b4dd815912438075e3c6852ac),\n  [`3f456f2`](https://github.com/gillsdk/gill/commit/3f456f297f4a656edc6d47c2bbcaf3350fb0cdf9),\n  [`7dedc33`](https://github.com/gillsdk/gill/commit/7dedc33397a0346a8a56344d77a719e7238ef930),\n  [`7e51f34`](https://github.com/gillsdk/gill/commit/7e51f34002e5ac5e54bf54f2a86d4c8a0149392d)]:\n  - gill@0.9.0\n\n## 0.3.0\n\n### Minor Changes\n\n- [#91](https://github.com/gillsdk/gill/pull/91)\n  [`d6d5127`](https://github.com/gillsdk/gill/commit/d6d51274e0bd978433d39ba999ff7f6cdc15bfdb) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add decoder support `useAccount` hook\n\n- [#103](https://github.com/gillsdk/gill/pull/103)\n  [`dd41a56`](https://github.com/gillsdk/gill/commit/dd41a569212f2438b174256d98bb3270fa07410d) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `useTokenMint` hook\n\n### Patch Changes\n\n- [#95](https://github.com/gillsdk/gill/pull/95)\n  [`21b6688`](https://github.com/gillsdk/gill/commit/21b6688db106d6eaf959566308824307d04a271a) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - add support for AbortSignal on existing hooks\n\n- [#86](https://github.com/gillsdk/gill/pull/86)\n  [`193e5f3`](https://github.com/gillsdk/gill/commit/193e5f3df84c584ff2ebbec9d41eb4c84e903d70) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added missing hooks to readme\n\n- Updated dependencies [[`6f547ff`](https://github.com/gillsdk/gill/commit/6f547fff0731bd7530b1266f8a5c15eac2e80d32),\n  [`56a7af8`](https://github.com/gillsdk/gill/commit/56a7af87878b914275f5189d99ea7c2674f45c0c),\n  [`1314cda`](https://github.com/gillsdk/gill/commit/1314cda705d9734d4cdf1a42c985f25ae3737a92)]:\n  - gill@0.8.3\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies [[`93b875a`](https://github.com/gillsdk/gill/commit/93b875a088a4830ef39e8084d3d5e6038c8a96cc)]:\n  - gill@0.8.2\n\n## 0.2.0\n\n### Minor Changes\n\n- [#82](https://github.com/gillsdk/gill/pull/82)\n  [`05c8605`](https://github.com/gillsdk/gill/commit/05c8605ff00d65ba04b0b6e218d540da2a164232) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - standardized hook arg inputs\n\n- [#79](https://github.com/gillsdk/gill/pull/79)\n  [`26551ea`](https://github.com/gillsdk/gill/commit/26551ea988eb1db8490cd0bb1003e1805c75e327) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added `useProgramAccounts` and `useSignatureStatuses` hooks\n\n### Patch Changes\n\n- Updated dependencies [[`b99ac65`](https://github.com/gillsdk/gill/commit/b99ac65a6de6d379e5f0f65b80c1f2a1a492d061)]:\n  - gill@0.8.1\n\n## 0.1.0\n\n### Minor Changes\n\n- [#76](https://github.com/gillsdk/gill/pull/76)\n  [`56f142c`](https://github.com/gillsdk/gill/commit/56f142c537e30d5f74c337e600c2216be5dd525a) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - added basic react hooks\n\n### Patch Changes\n\n- [#77](https://github.com/gillsdk/gill/pull/77)\n  [`b8ee97c`](https://github.com/gillsdk/gill/commit/b8ee97ccdd38a2d0d0bc2284cf9ecfad3e717ad1) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - refactor peer dep due to changeset limitations\n\n- Updated dependencies [[`2cb27d5`](https://github.com/gillsdk/gill/commit/2cb27d5b2450002038bf6501015c259eb4c43ee6),\n  [`6415cd7`](https://github.com/gillsdk/gill/commit/6415cd774ea333135756863a227613d8d075fa8a),\n  [`6b24c98`](https://github.com/gillsdk/gill/commit/6b24c982a7cd00b71be82ef65753d0cce074b868)]:\n  - gill@0.8.0\n\n## 0.0.2\n\n### Patch Changes\n\n- Updated dependencies [[`6ae676f`](https://github.com/gillsdk/gill/commit/6ae676f0f06c0ab07af8b2d03fd2e0f3fb051916),\n  [`1438ba7`](https://github.com/gillsdk/gill/commit/1438ba7fbf1a572d7c8c7936b70ba85e775d2cf0)]:\n  - gill@0.0.4\n"
  },
  {
    "path": "packages/react/README.md",
    "content": "<h1 align=\"center\">\n  @gillsdk/react\n</h1>\n\n<p align=\"center\">\n  React hooks library for the Solana blockchain\n</p>\n\n## Overview\n\nWelcome to `@gillsdk/react`, a React hooks library for easily interacting with the [Solana](http://solana.com/)\nblockchain.\n\n> Notice: `@gillsdk/react` is in active development. All APIs are subject to change until reaching the first major\n> version (v1.0.0).\n\nThis React hooks library is built on top of two core libraries:\n\n1. [`gill`](https://www.npmjs.com/package/gill) - modern JavaScript/TypeScript library for interacting with the Solana\n   blockchain.\n2. [`@tanstack/react-query`](https://www.npmjs.com/package/@tanstack/react-query) - popular and powerful asynchronous\n   state management for React.\n\n## Installation\n\nInstall `@gillsdk/react` with your package manager of choice:\n\n```shell\nnpm install gill @gillsdk/react @tanstack/react-query\n```\n\n```shell\npnpm add gill @gillsdk/react @tanstack/react-query\n```\n\n```shell\nyarn add gill @gillsdk/react @tanstack/react-query\n```\n\n> Note: `gill` and `@tanstack/react-query` are peer dependencies of `@gillsdk/react` so you need to explicitly install\n> them. This allows you have more/easier control over managing dependencies yourself.\n\n## Quick start\n\nSetup and configure your `SolanaProvider` to use the gill hooks:\n\n- [Wrap your React app in a context provider](#wrap-your-react-app-in-a-context-provider)\n- [Create a client-only provider for NextJs and React server components](#create-a-client-only-provider-for-nextjs-and-react-server-components)\n- [Wrap your app in the client-only provider for NextJs](#wrap-your-app-in-the-client-only-provider-for-nextjs)\n- [Using React hooks in React server component applications](#using-react-hooks-in-react-server-component-applications)\n\nManage and use your Solana client's connections:\n\n- [`useSolanaClient`](#get-solana-client) - get the current Solana client (including `rpc` and `rpcSubscriptions`)\n- [`useUpdateSolanaClient`](#get-account-balance-in-lamports) - update the current Solana client (including `rpc` and\n  `rpcSubscriptions`)\n\nFetch data from the Solana blockchain with the gill hooks:\n\n- [`useAccount`](#get-account-info-and-data) - get the account info for an address\n- [`useBalance`](#get-account-balance-in-lamports) - get account balance (in lamports)\n- [`useLatestBlockhash`](#get-latest-blockhash) - get the latest blockhash\n- [`useSignatureStatuses`](#get-signature-statuses) - get signature statuses\n- [`useSignaturesForAddress`](#get-signatures-for-address) - get signatures for address\n- [`useProgramAccounts`](#get-program-accounts-gpa) - get program accounts (GPA)\n- [`useTokenMint`](#get-token-mint-account) - get a decoded token's Mint account\n- [`useTokenAccount`](#get-token-account) - get the token account for a given mint and owner (or ATA)\n\n### Wrap your React app in a context provider\n\nWrap your app with the `SolanaProvider` React context provider and pass your Solana client to it:\n\n```tsx\nimport { createSolanaClient } from \"gill\";\nimport { SolanaProvider } from \"@gillsdk/react\";\n\nconst client = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nfunction App() {\n  return <SolanaProvider client={client}>{/* ... */}</SolanaProvider>;\n}\n```\n\n### Create a client-only provider for NextJs and React server components\n\nFor application that use React server components, like NextJS, you will need to create a \"client only\" wrapper for the\n`SolanaProvider` exported from `@gillsdk/react`:\n\n```tsx\n\"use client\"; // <--- this \"use client\" directive is required!\n\nimport { createSolanaClient } from \"gill\";\nimport { SolanaProvider } from \"@gillsdk/react\";\n\nconst client = createSolanaClient({\n  urlOrMoniker: \"devnet\",\n});\n\nexport function SolanaProviderClient({ children }: { children: React.ReactNode }) {\n  return <SolanaProvider client={client}>{children}</SolanaProvider>;\n}\n```\n\n### Wrap your app in the client-only provider for NextJs\n\nAfter creating your client-only provider, you can wrap your app with this\n[`SolanaProviderClient`](#create-a-client-only-provider-for-nextjs-and-react-server-components) (normally inside the\nroot `layout.tsx`):\n\n```tsx\nimport { SolanaProviderClient } from \"@/providers/solana-provider\";\n\nexport default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {\n  return (\n    <html>\n      <body>\n        <SolanaProviderClient>{children}</SolanaProviderClient>\n      </body>\n    </html>\n  );\n}\n```\n\n### Using React hooks in React server component applications\n\nAfter you have setup your client-only provider, you must set the `use client` directive in any component that uses the\n`@gillsdk/react` library. Signifying this component is required to be \"client only\".\n\nSee React's [`use client` directive docs](https://react.dev/reference/rsc/use-client).\n\n> Note: NextJs uses React server components by default. Read their docs\n> [here](https://react.dev/reference/rsc/use-client) on the `use client` directive.\n\n```tsx\n\"use client\"; // <--- directive required anywhere you use `@gillsdk/react`\n\nimport { useBalance, ... } from \"@gillsdk/react\";\n// ... other imports\n\nexport function PageClient() {\n  const { balance } = useBalance({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  return (\n    {/* ... */}\n  );\n}\n\n```\n\n### Get your Solana client\n\nGet the current Solana client configured in the [`SolanaProvider`](#wrap-your-react-app-in-a-context-provider),\nincluding the `rpc` and `rpcSubscriptions` connections:\n\n```tsx\n\"use client\";\n\nimport { useSolanaClient } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { rpc, rpcSubscriptions } = useSolanaClient();\n\n  // you can now use `rpc` to access any of the Solana JSON RPC methods\n\n  return { ... }\n}\n```\n\n### Get account balance (in lamports)\n\nGet an account's balance (in lamports) using the Solana RPC method of\n[`getBalance`](https://solana.com/docs/rpc/http/getbalance):\n\n```tsx\n\"use client\";\n\nimport { lamportsToSol } from \"gill\";\nimport { useBalance } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { balance, isLoading, isError, error } = useBalance({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <p>Balance: {lamportsToSol(balance) + \" SOL\"}</p>\n    </div>\n  );\n}\n```\n\n### Get latest blockhash\n\nGet the latest blockhash using the Solana RPC method of\n[`getLatestBlockhash`](https://solana.com/docs/rpc/http/getlatestblockhash)\n\n```tsx\n\"use client\";\n\nimport { useLatestBlockhash } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { latestBlockhash, isLoading, isError, error } = useLatestBlockhash();\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>latestBlockhash: {JSON.stringify(latestBlockhash, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get account info (and data)\n\nGet the account info for an address using the Solana RPC method of\n[`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo):\n\n> See also: [useTokenMint](#get-token-mint-account) and [`useTokenAccount`](#get-token-account)\n\n```tsx\n\"use client\";\n\nimport { useAccount } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { account, isLoading, isError, error } = useAccount({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>account: {JSON.stringify(account, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\nYou can also provide a `Decoder` for known account data structure in order to decode the `data` byte array into a typed\nobject:\n\n> ![NOTE] Some popular account types may have their own dedicated hook, like\n> [Token Mints (`useTokenMint`)](#get-token-mint-account) and and [`useTokenAccount`](#get-token-account). If a\n> dedicated hook exists for an account type, it is highly recommended to use those hooks as opposed to manually\n> providing a `decoder` to `useAccount()`.\n\n```tsx\n\"use client\";\n\nimport { useAccount } from \"@gillsdk/react\";\nimport { getMintDecoder } from \"gill/programs\";\n\nexport function PageClient() {\n  const { account, isLoading, isError, error } = useAccount({\n    // USDC mint account (on Solana mainnet)\n    address: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n    decoder: getMintDecoder(),\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>account: {JSON.stringify(account, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get signature statuses\n\nGet the statuses of signatures using the Solana RPC method of\n[`getSignatureStatuses`](https://solana.com/docs/rpc/http/getSignatureStatuses):\n\n```tsx\n\"use client\";\n\nimport { useSignatureStatuses } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { statuses, isLoading, isError, error } = useSignatureStatuses({\n    signatures: [\"5ewJmppABUbsWcDQEvThJj4GH4pRVK8NDjUtMVJXjvEndkhdy23mHjHpDmHVNNGoKsjPAsCwD4vzTQY4V2GEmvKu\"],\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>statuses: {JSON.stringify(statuses, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get program accounts (GPA)\n\nGet all the accounts owned by a `program` using the Solana RPC method of\n[`getProgramAccounts`](https://solana.com/docs/rpc/http/getProgramAccounts):\n\n```tsx\n\"use client\";\n\nimport { useProgramAccounts } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { accounts, isLoading, isError, error } = useProgramAccounts({\n    program: \"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T\",\n    config: {\n      encoding: \"base64\",\n      filters: [\n        { dataSize: 17n },\n        {\n          memcmp: {\n            offset: 4n,\n            bytes: \"3Mc6vR\",\n            encoding: \"base64\",\n          },\n        },\n      ],\n    },\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>accounts: {JSON.stringify(accounts, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get token Mint account\n\nGet a decoded [Mint account](https://solana.com/docs/tokens#mint-account) for a given token's Mint address.\n\n> Note: the Mint's information can be accessed via the returned `account.data` field.\n\n```tsx\n\"use client\";\n\nimport { useTokenMint } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { account, isLoading, isError, error } = useTokenMint({\n    // USDC mint account (on Solana mainnet)\n    mint: \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>account: {JSON.stringify(account, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get token account\n\nGet the token account for a given mint and owner:\n\n```tsx\n\"use client\";\n\nimport { useTokenAccount } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { account, isLoading, isError, error } = useTokenAccount({\n    // token on devnet\n    mint: \"HwxZNMkZbZMeiu9Xnmc6Rg8jYgNsJB47jwabHGUebW4F\",\n    owner: \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\",\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>account: {JSON.stringify(account, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\nIf you already know the specific Associated Token Account's address (ATA), then you can get that specific token account\nby providing the `ata` address:\n\n> Note: This is most commonly used for multi-sig protocols like Squads.\n\n```tsx\n\"use client\";\n\nimport { useTokenAccount } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { account, isLoading, isError, error } = useTokenAccount({\n    ata: \"CCMCWh4FudPEmY6Q1AVi5o8mQMXkHYkJUmZfzRGdcJ9P\",\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>account: {JSON.stringify(account, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n\n### Get Signatures for address\n\nGet the signatures for confirmed transactions using the RPC method of\n[getSignaturesForAddress](https://solana.com/docs/rpc/http/getsignaturesforaddress)\n\n```tsx\n\"use client\";\n\nimport { useSignaturesForAddress } from \"@gillsdk/react\";\n\nexport function PageClient() {\n  const { signatures, isLoading, isError, error } = useSignaturesForAddress({\n    address: \"nicktrLHhYzLmoVbuZQzHUTicd2sfP571orwo9jfc8c\",\n    config: {\n      limit: 10,\n    },\n  });\n\n  // if (isLoading) { return ... }\n  // if (isError) { return ... }\n\n  return (\n    <div className=\"\">\n      <pre>signatures: {JSON.stringify(signatures, null, \"\\t\")}</pre>\n    </div>\n  );\n}\n```\n"
  },
  {
    "path": "packages/react/eslint.config.mjs",
    "content": "import config from \"@gillsdk/config-eslint/base\";\n\n/** @type {import(\"eslint\").Linter.Config} */\nexport default config;\n"
  },
  {
    "path": "packages/react/package.json",
    "content": "{\n  \"name\": \"@gillsdk/react\",\n  \"license\": \"MIT\",\n  \"version\": \"0.7.0\",\n  \"type\": \"module\",\n  \"description\": \"a Solana hooks library for React, built on top of gill - the modern JavaScript/TypeScript library for Solana\",\n  \"scripts\": {\n    \"clean\": \"rimraf coverage dist build node_modules .turbo\",\n    \"compile:js\": \"tsup --config ./tsup.config.package.ts\",\n    \"compile:typedefs\": \"tsc -p ./tsconfig.declarations.json\",\n    \"compile:docs\": \"typedoc --options typedoc.json && pnpm move:docs\",\n    \"move:docs\": \"pnpm clean:docs && cp -rf ./.docs/* ../../docs/content/api/react\",\n    \"clean:docs\": \"mkdir -p ../../docs/content/api/react && rimraf ../../docs/content/api/react/*\",\n    \"prepublishOnly\": \"pnpm pkg delete devDependencies\",\n    \"publish-impl\": \"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \\\"$PUBLISH_TAG\\\" != \\\"canary\\\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))\",\n    \"publish-packages\": \"pnpm prepublishOnly && pnpm publish-impl\",\n    \"coverage\": \"pnpm test:unit:node --coverage\",\n    \"coverage:open\": \"export BROWSER=brave && xdg-open ./coverage/lcov-report/index.html > /dev/null\",\n    \"test:typecheck\": \"tsc --noEmit\",\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.node.ts --rootDir . --silent\",\n    \"test:unit:browser\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.browser.ts --rootDir . --silent\",\n    \"test:treeshakability:browser\": \"agadoo dist/index.browser.mjs\",\n    \"test:treeshakability:native\": \"agadoo dist/index.native.mjs\",\n    \"test:treeshakability:node\": \"agadoo dist/index.node.mjs\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\",\n    \"lint\": \"eslint src\",\n    \"lint:fix\": \"eslint --fix src\"\n  },\n  \"exports\": {\n    \"types\": \"./dist/index.d.ts\",\n    \"import\": \"./dist/index.node.mjs\",\n    \"require\": \"./dist/index.node.cjs\",\n    \"default\": \"./dist/index.node.cjs\"\n  },\n  \"browser\": {\n    \"./dist/index.node.cjs\": \"./dist/index.browser.cjs\",\n    \"./dist/index.node.mjs\": \"./dist/index.browser.mjs\"\n  },\n  \"main\": \"./dist/index.node.cjs\",\n  \"module\": \"./dist/index.node.mjs\",\n  \"react-native\": \"./dist/index.native.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"files\": [\n    \"./dist/\"\n  ],\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"blockchain\",\n    \"solana\",\n    \"web3\",\n    \"web3js v2\",\n    \"solana kit\",\n    \"wallet\",\n    \"dapps\",\n    \"hooks\",\n    \"react hooks\",\n    \"solana hooks\",\n    \"web3js hooks\",\n    \"wagmi\"\n  ],\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"browserslist\": [\n    \"supports bigint and not dead\",\n    \"maintained node versions\"\n  ],\n  \"devDependencies\": {\n    \"@types/react\": \"^18\",\n    \"@types/react-test-renderer\": \"^18\",\n    \"react\": \"^18\",\n    \"@gillsdk/config-eslint\": \"workspace:*\"\n  },\n  \"dependencies\": {\n    \"@solana/react\": \"^3.0.3\",\n    \"@solana/wallet-standard-chains\": \"^1.1.1\",\n    \"@solana/wallet-standard-features\": \"^1.3.0\",\n    \"@wallet-standard/core\": \"^1.1.1\",\n    \"@wallet-standard/react\": \"^1.0.1\",\n    \"@wallet-standard/ui\": \"^1.0.1\",\n    \"gill\": \"workspace:*\"\n  },\n  \"peerDependencies\": {\n    \"@tanstack/react-query\": \"^5.61.4\",\n    \"@types/react\": \"^18\",\n    \"@types/react-dom\": \"^18\",\n    \"react\": \"^18\",\n    \"typescript\": \">=5\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__tests__/placeholder.ts",
    "content": "// import assert from \"node:assert\";\n\ndescribe(\"placeholder\", () => {\n  test(\"this is a placeholder test to satisfy github actions\", () => {});\n});\n"
  },
  {
    "path": "packages/react/src/__typeset__/account.ts",
    "content": "import { Account, Address } from \"gill\";\nimport { getMetadataDecoder, Metadata } from \"gill/programs\";\nimport { useAccount } from \"../hooks/account.js\";\n\n// [DESCRIBE] useAccount\n{\n  const address = null as unknown as Address<\"12345\">;\n\n  // Should use default account data type\n  {\n    const { account } = useAccount({ address });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a Uint8Array for the data\n    account satisfies Account<Uint8Array>;\n    // Should use the address type\n    account.address satisfies Address<\"12345\">;\n\n    // @ts-expect-error - Should not allow no argument\n    useAccount();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useAccount({});\n  }\n\n  // Should accept `config` input\n  {\n    const { account } = useAccount({\n      address,\n      config: { commitment: \"confirmed\" },\n    });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a Uint8Array for the data\n    account satisfies Account<Uint8Array>;\n  }\n\n  // Should use the decoder type\n  {\n    const { account } = useAccount({\n      address,\n      decoder: getMetadataDecoder(),\n    });\n    // Should be a `Metadata` type for the data\n    account satisfies Account<Metadata>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/balance.ts",
    "content": "import { Address, GetBalanceApi } from \"gill\";\nimport { useBalance } from \"../hooks/balance.js\";\n\n// [DESCRIBE] useBalance\n{\n  const address = null as unknown as Address;\n\n  {\n    const { balance } = useBalance({ address });\n    balance satisfies ReturnType<GetBalanceApi[\"getBalance\"]>[\"value\"];\n\n    // @ts-expect-error - Should not allow no argument\n    useBalance();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useBalance({});\n  }\n\n  {\n    const { balance } = useBalance({\n      address,\n      config: { commitment: \"confirmed\" },\n    });\n    balance satisfies ReturnType<GetBalanceApi[\"getBalance\"]>[\"value\"];\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/get-slot.ts",
    "content": "import type { GetSlotApi } from \"gill\";\nimport { useSlot } from \"../hooks/slot.js\";\n\n// [DESCRIBE] useSlot\n{\n  // Should allow no arguments (default usage)\n  {\n    const { slot } = useSlot();\n    // Should be the correct return type\n    slot satisfies ReturnType<GetSlotApi[\"getSlot\"]>;\n  }\n\n  // Should accept config input\n  {\n    const { slot } = useSlot({\n      config: { commitment: \"confirmed\" },\n    });\n    slot satisfies ReturnType<GetSlotApi[\"getSlot\"]>;\n  }\n\n  // Should accept options input (e.g., refetchInterval)\n  {\n    const { slot } = useSlot({\n      options: { refetchInterval: 1000 },\n    });\n    slot satisfies ReturnType<GetSlotApi[\"getSlot\"]>;\n  }\n\n  // Should error on invalid config\n  // @ts-expect-error - Invalid config property\n  useSlot({ config: { invalidProp: true } });\n\n  // Should error on completely invalid argument\n  // @ts-expect-error - Invalid argument type\n  useSlot(123);\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/latest-blockhash.ts",
    "content": "import { GetLatestBlockhashApi } from \"gill\";\nimport { useLatestBlockhash } from \"../hooks/index.js\";\n\n// [DESCRIBE] useLatestBlockhash\n{\n  {\n    const { latestBlockhash } = useLatestBlockhash();\n    latestBlockhash satisfies ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n  }\n\n  {\n    const { latestBlockhash } = useLatestBlockhash({});\n    latestBlockhash satisfies ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n  }\n\n  {\n    const { latestBlockhash } = useLatestBlockhash({\n      config: { commitment: \"confirmed\" },\n    });\n    latestBlockhash satisfies ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/multiple-accounts.ts",
    "content": "import { Account, Address } from \"gill\";\nimport { getMetadataDecoder, Metadata } from \"gill/programs\";\n\nimport { useMultipleAccounts } from \"../hooks/multiple-accounts.js\";\n\n// [DESCRIBE] useMultipleAccounts\n{\n  const addresses = [null] as unknown as [Address<\"12345\">];\n\n  // Should use default account data type\n  {\n    const { accounts } = useMultipleAccounts({ addresses });\n\n    // Should be a Uint8Array for the data\n    accounts satisfies Account<Uint8Array>[];\n\n    // @ts-expect-error - Should not allow no argument\n    useMultipleAccounts();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useMultipleAccounts({});\n  }\n\n  // Should accept `config` input\n  {\n    const { accounts } = useMultipleAccounts({\n      addresses,\n      config: { commitment: \"confirmed\" },\n    });\n    accounts satisfies Account<Uint8Array>[];\n  }\n\n  // Should use the decoder type\n  {\n    const { accounts } = useMultipleAccounts({\n      addresses,\n      decoder: getMetadataDecoder(),\n    });\n    // Should be a `Metadata` type for the data\n    accounts satisfies Account<Metadata>[];\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/program-accounts.ts",
    "content": "import {\n  AccountInfoWithBase64EncodedData,\n  AccountInfoWithBase64EncodedZStdCompressedData,\n  AccountInfoWithJsonData,\n  Address,\n  Base58EncodedBytes,\n  SolanaRpcResponse,\n} from \"gill\";\nimport { useProgramAccounts } from \"../hooks/program-accounts.js\";\n\n// [DESCRIBE] useProgramAccounts\n{\n  const program = null as unknown as Address;\n\n  // default encoded data as bytes\n  {\n    const { accounts: baseConfigAccounts } = useProgramAccounts({ program });\n    baseConfigAccounts[0].account.data satisfies AccountInfoWithBase64EncodedData[\"data\"];\n\n    const { accounts: baseConfigAccounts2 } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n      },\n    });\n    baseConfigAccounts2[0].account.data satisfies AccountInfoWithBase64EncodedData[\"data\"];\n\n    const { accounts: baseConfigContextAccounts } = useProgramAccounts({\n      program,\n      config: {\n        withContext: true,\n      },\n    });\n\n    // Should include context in response\n    baseConfigContextAccounts satisfies SolanaRpcResponse<any>;\n    baseConfigContextAccounts.value[0].account satisfies AccountInfoWithBase64EncodedData;\n  }\n\n  // base64 encoded `data`\n  {\n    const { accounts: base64Accounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"base64\",\n      },\n    });\n    base64Accounts[0].account satisfies AccountInfoWithBase64EncodedData;\n    // @ts-expect-error Should not be base58 encoded bytes\n    base64Accounts[0].account.data satisfies Base58EncodedBytes;\n\n    const { accounts: base64ContextAccounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"base64\",\n        withContext: true,\n      },\n    });\n\n    // Should include context in response\n    base64ContextAccounts satisfies SolanaRpcResponse<any>;\n    base64ContextAccounts.value[0].account satisfies AccountInfoWithBase64EncodedData;\n\n    // @ts-expect-error Should not be base58 encoded bytes\n    base64ContextAccounts.value[0].account.data satisfies Base58EncodedBytes;\n  }\n\n  // base64+zstd encoded `data`\n  {\n    const { accounts: base64ZstdAccounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"base64+zstd\",\n      },\n    });\n    base64ZstdAccounts[0].account satisfies AccountInfoWithBase64EncodedZStdCompressedData;\n    // @ts-expect-error Should not be base58 encoded bytes\n    base64ZstdAccounts[0].account.data satisfies Base58EncodedBytes;\n\n    const { accounts: base64ZstdContextAccounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"base64+zstd\",\n        withContext: true,\n      },\n    });\n\n    // Should include context in response\n    base64ZstdContextAccounts satisfies SolanaRpcResponse<any>;\n    base64ZstdContextAccounts.value[0].account satisfies AccountInfoWithBase64EncodedZStdCompressedData;\n\n    // @ts-expect-error Should not be base58 encoded bytes\n    base64ZstdContextAccounts.value[0].account.data satisfies Base58EncodedBytes;\n  }\n\n  // json parsed encoded `data`\n  {\n    const { accounts: jsonParsedAccounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"jsonParsed\",\n      },\n    });\n\n    jsonParsedAccounts[0].account satisfies AccountInfoWithBase64EncodedData | AccountInfoWithJsonData;\n    // @ts-expect-error Should not be base58 encoded bytes\n    jsonParsedAccounts[0].account.data satisfies Base58EncodedBytes;\n\n    const { accounts: jsonParsedContextAccounts } = useProgramAccounts({\n      program,\n      config: {\n        commitment: \"finalized\",\n        encoding: \"jsonParsed\",\n        withContext: true,\n      },\n    });\n    jsonParsedContextAccounts.value[0].account.data;\n\n    // Should include context in response\n    jsonParsedContextAccounts satisfies SolanaRpcResponse<any>;\n    jsonParsedContextAccounts.value[0].account satisfies AccountInfoWithBase64EncodedData | AccountInfoWithJsonData;\n\n    // @ts-expect-error Should not be base58 encoded bytes\n    jsonParsedContextAccounts.value[0].account.data satisfies Base58EncodedBytes;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/recent-prioritization-fees.ts",
    "content": "import { Address, GetRecentPrioritizationFeesApi } from \"gill\";\nimport { useRecentPrioritizationFees } from \"../hooks/recent-prioritization-fees.js\";\n\n// [DESCRIBE] useRecentPrioritizationFees\n{\n  // Should accept empty inputs\n  {\n    useRecentPrioritizationFees();\n    useRecentPrioritizationFees({});\n  }\n\n  // Should accept an empty array for `addresses`\n  {\n    const { fees } = useRecentPrioritizationFees({ addresses: [] });\n    fees satisfies ReturnType<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>;\n  }\n\n  {\n    const { fees } = useRecentPrioritizationFees({\n      addresses: [\"123\" as Address],\n      options: {\n        refetchInterval: 1000,\n      },\n    });\n    fees satisfies ReturnType<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>;\n  }\n\n  {\n    const { fees } = useRecentPrioritizationFees({\n      addresses: [\"123\" as Address],\n      abortSignal: new AbortController().signal,\n    });\n    fees satisfies ReturnType<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/signature-statuses.ts",
    "content": "import { Signature, SolanaRpcResponse } from \"gill\";\nimport { useSignatureStatuses } from \"../hooks/signature-statuses.js\";\n\n// [DESCRIBE] useSignatureStatuses\n{\n  const signature = null as unknown as Signature;\n  const signatures = [signature];\n\n  const { statuses } = useSignatureStatuses({ signatures });\n  statuses satisfies SolanaRpcResponse<any>[\"value\"];\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/signatures-for-address.ts",
    "content": "import { Address, GetSignaturesForAddressApi } from \"gill\";\nimport { useSignaturesForAddress } from \"../hooks/index.js\";\n\n// [DESCRIBE] useSignaturesForAddress\n{\n  const address = null as unknown as Address;\n\n  {\n    const { signatures } = useSignaturesForAddress({ address });\n    signatures satisfies ReturnType<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>;\n\n    // @ts-expect-error - Should not allow no argument\n    useSignaturesForAddress();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useSignaturesForAddress({});\n  }\n\n  {\n    const { signatures } = useSignaturesForAddress({\n      address,\n      config: { limit: 10 },\n    });\n    signatures satisfies ReturnType<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/simulate-transaction.ts",
    "content": "import { Base64EncodedWireTransaction, SimulateTransactionApi } from \"gill\";\nimport { useSimulateTransaction } from \"../hooks/simulate-transaction.js\";\n\n// [DESCRIBE] useSimulateTransaction\n{\n  {\n    const { simulation } = useSimulateTransaction({\n      transaction: \"123\" as Base64EncodedWireTransaction,\n      config: { commitment: \"confirmed\", encoding: \"base64\" },\n    });\n    simulation satisfies ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>;\n  }\n\n  {\n    const { simulation } = useSimulateTransaction({\n      transaction: \"123\" as Base64EncodedWireTransaction,\n      config: { commitment: \"confirmed\", encoding: \"base64\" },\n      options: {\n        refetchInterval: 1000,\n      },\n    });\n    simulation satisfies ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>;\n  }\n\n  {\n    const { simulation } = useSimulateTransaction({\n      transaction: \"123\" as Base64EncodedWireTransaction,\n      config: { commitment: \"confirmed\", encoding: \"base64\" },\n      abortSignal: new AbortController().signal,\n    });\n    simulation satisfies ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/token-account-balance.ts",
    "content": "import { Address, GetTokenAccountBalanceApi } from \"gill\";\nimport { useTokenAccountBalance } from \"../hooks/token-account-balance.js\";\n\n// [DESCRIBE] useTokenAccountBalance\n{\n  {\n    const { balance } = useTokenAccountBalance({ address: \"123\" as Address });\n    balance satisfies ReturnType<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>;\n  }\n\n  {\n    const { balance } = useTokenAccountBalance({\n      address: \"123\" as Address,\n      options: {\n        refetchInterval: 500,\n      },\n    });\n    balance satisfies ReturnType<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>;\n  }\n\n  {\n    const { balance } = useTokenAccountBalance({\n      address: \"123\" as Address,\n      config: {\n        commitment: \"confirmed\",\n      },\n      abortSignal: new AbortController().signal,\n    });\n    balance satisfies ReturnType<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/token-account.ts",
    "content": "import { Account, Address } from \"gill\";\n\nimport { Token } from \"gill/programs\";\nimport { useTokenAccount } from \"../hooks/token-account.js\";\n\n// [DESCRIBE] useTokenAccount\n{\n  const mint = null as unknown as Address<\"mint\">;\n  const owner = null as unknown as Address<\"owner\">;\n  const ata = null as unknown as Address<\"ata\">;\n\n  // Should accept `mint` and `owner`\n  {\n    const { account } = useTokenAccount({ mint, owner });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a Token for the data\n    account satisfies Account<Token>;\n\n    // @ts-expect-error - Should not allow no argument\n    useTokenAccount();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useTokenAccount({});\n  }\n\n  // Should accept `ata` input\n  {\n    const { account } = useTokenAccount({ ata });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a Token for the data\n    account satisfies Account<Token>;\n    // Should use the address type\n    account.address satisfies Address<\"ata\">;\n  }\n\n  // Should accept `config` input with `ata`\n  {\n    const { account } = useTokenAccount({\n      ata,\n      config: { commitment: \"confirmed\" },\n    });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a parsed `Token` for the data\n    account satisfies Account<Token>;\n  }\n\n  // Should accept `config` input with `mint` and `owner`\n  {\n    const { account } = useTokenAccount({\n      mint,\n      owner,\n      config: { commitment: \"confirmed\" },\n    });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a parsed `Token` for the data\n    account satisfies Account<Token>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/token-mint.ts",
    "content": "import type { Account, Address } from \"gill\";\n\nimport type { Mint } from \"gill/programs\";\nimport { useTokenMint } from \"../hooks/token-mint.js\";\n\n// [DESCRIBE] useTokenMint\n{\n  const mint = null as unknown as Address<\"mint1234\">;\n\n  // Should use default account data type\n  {\n    const { account } = useTokenMint({ mint });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a parsed `Mint` for the data\n    account satisfies Account<Mint>;\n    // Should use the address type\n    account.address satisfies Address<\"mint1234\">;\n\n    // @ts-expect-error - Should not allow no argument\n    useTokenMint();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useTokenMint({});\n  }\n\n  // Should accept `config` input\n  {\n    const { account } = useTokenMint({\n      mint,\n      config: { commitment: \"confirmed\" },\n    });\n    // Should have `exists=true` declared\n    account satisfies { exists: true };\n    // Should be a parsed `Mint` for the data\n    account satisfies Account<Mint>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/__typeset__/transaction.ts",
    "content": "import { GetTransactionApi, Signature } from \"gill\";\nimport { useTransaction } from \"../hooks/transaction.js\";\n\n// [DESCRIBE] useTransaction\n{\n  const signature = null as unknown as Signature;\n\n  {\n    const { transaction } = useTransaction({ signature });\n    transaction satisfies ReturnType<GetTransactionApi[\"getTransaction\"]>;\n\n    // @ts-expect-error - Should not allow no argument\n    useTransaction();\n\n    // @ts-expect-error - Should not allow empty argument object\n    useTransaction({});\n  }\n\n  {\n    // Should accept `config` input\n    const { transaction } = useTransaction({\n      signature,\n      config: {\n        commitment: \"confirmed\",\n        maxSupportedTransactionVersion: 0,\n        encoding: \"json\",\n      },\n    });\n    transaction satisfies ReturnType<GetTransactionApi[\"getTransaction\"]>;\n  }\n\n  {\n    // Should accept a plain `string` as the `signature`\n    const { transaction } = useTransaction({\n      signature: \"5Pj5fCupXLUePYn18JkY8SrRaWFiUctuDTRwvUy2ML9yvkENLb1QMYbcBGcBXRrSVDjp7RjUwk9a3rLC6gpvtYpZ\",\n    });\n    transaction satisfies ReturnType<GetTransactionApi[\"getTransaction\"]>;\n  }\n}\n"
  },
  {
    "path": "packages/react/src/const.ts",
    "content": "/**\n * @private\n */\nexport const GILL_NAME = \"gill\";\n\nexport const GILL_HOOK_CLIENT_KEY = \"gill-client\";\n"
  },
  {
    "path": "packages/react/src/hooks/account.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, Decoder, FetchAccountConfig, Simplify } from \"gill\";\nimport { assertAccountExists, decodeAccount, fetchEncodedAccount } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseAccountResponse<TAddress extends string = string, TData extends Uint8Array | object = Uint8Array> = Account<\n  TData,\n  TAddress\n> & {\n  exists: true;\n};\n\ntype UseAccountInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to get the balance of\n   */\n  address: Address | TAddress;\n  /**\n   * Account decoder that can decode the account's `data` byte array value\n   */\n  decoder?: Decoder<TDecodedData>;\n};\n\n/**\n * Get the account info for an address using the Solana RPC method of\n * [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo)\n */\nexport function useAccount<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n>({ options, config, abortSignal, address, decoder }: UseAccountInput<TConfig, TAddress, TDecodedData>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const account = await fetchEncodedAccount(rpc, address as Address, config);\n      assertAccountExists(account);\n      if (decoder) return decodeAccount(account, decoder);\n      return account;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getAccountInfo\", address],\n  });\n  return {\n    ...rest,\n    account: data as UseAccountResponse<TAddress, TDecodedData>,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/balance.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Address, GetBalanceApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\ntype RpcConfig = Simplify<Parameters<GetBalanceApi[\"getBalance\"]>>[1];\n\ntype UseBalanceResponse = ReturnType<GetBalanceApi[\"getBalance\"]>[\"value\"];\n\ntype UseBalanceInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to get the balance of\n   */\n  address: Address | string;\n};\n\n/**\n * Get an account's balance (in lamports) using the Solana RPC method of\n * [`getBalance`](https://solana.com/docs/rpc/http/getbalance)\n */\nexport function useBalance<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseBalanceInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const { value } = await rpc.getBalance(address as Address, config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getBalance\", address],\n  });\n  return {\n    ...rest,\n    balance: data as UseBalanceResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/client.ts",
    "content": "import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { createSolanaClient, type SolanaClient } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\n\n/**\n * Get the current Solana client (including `rpc` and `rpcSubscriptions`)\n */\nexport function useSolanaClient(): SolanaClient {\n  const { data: config } = useQuery<SolanaClient>({\n    // fallback data should not be reached if used within `SolanaProvider`\n    // since we set the initial value. but just in case => devnet\n    initialData: createSolanaClient({\n      urlOrMoniker: \"devnet\",\n    }),\n    queryKey: [GILL_HOOK_CLIENT_KEY],\n    staleTime: Infinity,\n  });\n  return config;\n}\n\n/**\n * Update your Solana client (including `rpc` and `rpcSubscriptions`)\n */\nexport function useUpdateSolanaClient() {\n  const queryClient = useQueryClient();\n  return useMutation({\n    mutationFn: async (newClient: SolanaClient): Promise<void> => {\n      queryClient.setQueryData([GILL_HOOK_CLIENT_KEY], newClient);\n\n      return await Promise.resolve();\n    },\n  });\n}\n"
  },
  {
    "path": "packages/react/src/hooks/index.ts",
    "content": "export * from \"./account.js\";\nexport * from \"./balance.js\";\nexport * from \"./client.js\";\nexport * from \"./latest-blockhash.js\";\nexport * from \"./multiple-accounts.js\";\nexport * from \"./program-accounts.js\";\nexport * from \"./recent-prioritization-fees.js\";\nexport * from \"./signature-statuses.js\";\nexport * from \"./signatures-for-address.js\";\nexport * from \"./simulate-transaction.js\";\nexport * from \"./slot.js\";\nexport * from \"./token-account-balance.js\";\nexport * from \"./token-account.js\";\nexport * from \"./token-mint.js\";\nexport * from \"./transaction.js\";\n"
  },
  {
    "path": "packages/react/src/hooks/latest-blockhash.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetLatestBlockhashApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetLatestBlockhashApi[\"getLatestBlockhash\"]>>[0];\n\ntype UseLatestBlockhashResponse = ReturnType<GetLatestBlockhashApi[\"getLatestBlockhash\"]>[\"value\"];\n\ntype UseLatestBlockhashInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig>;\n\n/**\n * Get the latest blockhash using the Solana RPC method of\n * [`getLatestBlockhash`](https://solana.com/docs/rpc/http/getlatestblockhash)\n *\n * To auto refetch the latest blockhash, provide a `options.refetchInterval` value\n */\nexport function useLatestBlockhash<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n}: UseLatestBlockhashInput<TConfig> = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const { value } = await rpc.getLatestBlockhash(config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getLatestBlockhash\"],\n  });\n  return {\n    ...rest,\n    latestBlockhash: data as UseLatestBlockhashResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/multiple-accounts.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, Decoder, FetchAccountsConfig, Simplify } from \"gill\";\nimport { assertAccountsExist, decodeAccount, fetchEncodedAccounts } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountsConfig, \"abortSignal\">>;\n\ntype UseMultipleAccountsInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * List of addresses to fetch accounts for.\n   */\n  addresses: Address<TAddress>[];\n  /**\n   * Optional decoder to decode the account's `data` buffer.\n   */\n  decoder?: Decoder<TDecodedData>;\n};\n\ntype UseMultipleAccountsResponse<TAddress extends string = string, TDecodedData extends object = Uint8Array> = {\n  accounts: Account<TDecodedData, TAddress>[];\n};\n\n/**\n * Fetch multiple accounts using the Solana RPC method of\n * [`getMultipleAccounts`](https://solana.com/docs/rpc/http/getmultipleaccounts)\n *\n * Optionally provide a {@link Decoder | `decoder`} to automatically decode all Accounts using it.\n */\nexport function useMultipleAccounts<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n  TDecodedData extends object = Uint8Array,\n>({ addresses, decoder, config, options, abortSignal }: UseMultipleAccountsInput<TConfig, TAddress, TDecodedData>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && addresses.length > 0,\n    queryFn: async () => {\n      const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n      assertAccountsExist(maybeAccounts);\n      return maybeAccounts.map((acc) => (decoder ? decodeAccount(acc, decoder) : acc));\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getMultipleAccounts\", addresses, config?.commitment],\n  });\n\n  return {\n    ...rest,\n    accounts: data,\n  } as UseMultipleAccountsResponse<TAddress, TDecodedData>;\n}\n"
  },
  {
    "path": "packages/react/src/hooks/program-accounts.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n  AccountInfoBase,\n  AccountInfoWithBase64EncodedData,\n  AccountInfoWithBase64EncodedZStdCompressedData,\n  AccountInfoWithJsonData,\n  AccountInfoWithPubkey,\n  Address,\n  GetProgramAccountsApi,\n  Simplify,\n  SolanaRpcResponse,\n} from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype Encoding = \"base64\" | \"base64+zstd\" | \"jsonParsed\";\n\ntype RpcConfig = Simplify<\n  Parameters<GetProgramAccountsApi[\"getProgramAccounts\"]>[1] &\n    Readonly<{\n      encoding?: Encoding;\n    }>\n>;\n\ntype UseProgramAccountsInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the program used to call\n   * [`getProgramAccounts`](https://solana.com/docs/rpc/http/getprogramaccounts)\n   */\n  program: Address | string;\n};\n\ntype UseProgramAccountsResponse<TConfig extends RpcConfig> = TConfig extends {\n  encoding: \"base64\";\n  withContext: true;\n}\n  ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]>\n  : TConfig extends { encoding: \"base64\" }\n    ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]\n    : TConfig extends { encoding: \"base64+zstd\"; withContext: true }\n      ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[]>\n      : TConfig extends { encoding: \"base64+zstd\" }\n        ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[]\n        : TConfig extends { encoding: \"jsonParsed\"; withContext: true }\n          ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[]>\n          : TConfig extends { encoding: \"jsonParsed\" }\n            ? AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[]\n            : TConfig extends { withContext: true }\n              ? SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]>\n              : AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[];\n/**\n * Get all the accounts owned by a `program` using the Solana RPC method of\n * [`getProgramAccounts`](https://solana.com/docs/rpc/http/getprogramaccounts)\n */\nexport function useProgramAccounts<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  program,\n}: UseProgramAccountsInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && !!program,\n    queryFn: async () => {\n      const accounts = await rpc.getProgramAccounts(program as Address, config).send({ abortSignal });\n      return accounts;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getProgramAccounts\", program],\n  });\n\n  return {\n    ...rest,\n    accounts: data as Simplify<UseProgramAccountsResponse<TConfig>>,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/recent-prioritization-fees.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetRecentPrioritizationFeesApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype UseRecentPrioritizationFeesInput = Simplify<\n  Pick<GillUseRpcHook<{}>, \"abortSignal\" | \"options\"> & {\n    addresses?: Parameters<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>[0];\n  }\n>;\n\ntype UseRecentPrioritizationFeesResponse = ReturnType<GetRecentPrioritizationFeesApi[\"getRecentPrioritizationFees\"]>;\n\n/**\n * Get the recent prioritization fees for a list of addresses using the Solana RPC method of\n * [`getRecentPrioritizationFees`](https://solana.com/docs/rpc/http/getrecentprioritizationfees)\n */\nexport function useRecentPrioritizationFees({\n  options,\n  abortSignal,\n  addresses,\n}: UseRecentPrioritizationFeesInput = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const fees = await rpc.getRecentPrioritizationFees(addresses).send({ abortSignal });\n      return fees;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getRecentPrioritizationFees\", addresses],\n  });\n\n  return {\n    ...rest,\n    fees: data as UseRecentPrioritizationFeesResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/signature-statuses.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetSignatureStatusesApi, Signature, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSignatureStatusesApi[\"getSignatureStatuses\"]>[1]>;\n\ntype UseSignatureStatusesInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * List of signatures used to call\n   * [`getSignatureStatuses`](https://solana.com/docs/rpc/http/getsignaturestatuses)\n   */\n  signatures: Signature[] | string[];\n};\n\ntype UseSignatureStatusesResponse = ReturnType<GetSignatureStatusesApi[\"getSignatureStatuses\"]>[\"value\"];\n\n/**\n * Get the statuses of signatures using the Solana RPC method of\n * [`getSignatureStatuses`](https://solana.com/docs/rpc/http/getsignaturestatuses)\n */\nexport function useSignatureStatuses<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  signatures,\n}: UseSignatureStatusesInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && signatures && signatures.length > 0,\n    queryFn: async () => {\n      const { value } = await rpc.getSignatureStatuses(signatures as Signature[], config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSignatureStatuses\", signatures],\n  });\n  return {\n    ...rest,\n    statuses: data as UseSignatureStatusesResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/signatures-for-address.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Address, GetSignaturesForAddressApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>[1]>;\n\ntype UseSignaturesForAddressInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the account to fetch signatures of\n   */\n  address: Address | string;\n};\n\ntype UseSignaturesForAddressResponse = ReturnType<GetSignaturesForAddressApi[\"getSignaturesForAddress\"]>;\n\n/**\n * Returns signatures for confirmed transactions that include the given address\n * in their `accountKeys` list. Returns signatures backwards in time from the\n * provided signature or most recent confirmed block using the Solana RPC method of\n * [`getSignaturesForAddress`](https://solana.com/docs/rpc/http/getsignaturesforaddress)\n */\nexport function useSignaturesForAddress<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseSignaturesForAddressInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const signatures = await rpc.getSignaturesForAddress(address as Address, config).send({ abortSignal });\n      return signatures;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSignaturesForAddress\", address],\n  });\n  return {\n    ...rest,\n    signatures: data as UseSignaturesForAddressResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/simulate-transaction.ts",
    "content": "\"use client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Base64EncodedWireTransaction, Simplify, SimulateTransactionApi } from \"gill\";\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<SimulateTransactionApi[\"simulateTransaction\"]>>[1];\n\nconst DEFAULT_CONFIG: RpcConfig = {\n  replaceRecentBlockhash: true,\n  sigVerify: false,\n  encoding: \"base64\",\n  commitment: \"confirmed\",\n} as const;\n\ntype UseSimulateTransactionInput<TConfig extends RpcConfig = RpcConfig> = Omit<GillUseRpcHook<TConfig>, \"config\"> & {\n  transaction: Base64EncodedWireTransaction;\n  /**\n   * @default { replaceRecentBlockhash: true, sigVerify: false, encoding: \"base64\", commitment: \"confirmed\" }\n   */\n  config?: TConfig;\n};\n\ntype UseSimulateTransactionResponse = ReturnType<SimulateTransactionApi[\"simulateTransaction\"]>;\n\n/**\n * Simulate a transaction using the Solana RPC method of\n * [`simulateTransaction`](https://solana.com/docs/rpc/http/simulatetransaction)\n */\nexport function useSimulateTransaction<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  transaction,\n}: UseSimulateTransactionInput<TConfig>) {\n  const { rpc } = useSolanaClient();\n\n  const mergedConfig = { ...DEFAULT_CONFIG, ...config } as RpcConfig;\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    enabled: (options?.enabled ?? true) && !!transaction,\n    queryKey: [GILL_HOOK_CLIENT_KEY, \"simulateTransaction\", transaction, mergedConfig],\n    queryFn: async () => {\n      const simulation = await rpc.simulateTransaction(transaction, mergedConfig).send({ abortSignal });\n      return simulation;\n    },\n  });\n\n  return {\n    ...rest,\n    simulation: data as UseSimulateTransactionResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/slot.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetSlotApi, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetSlotApi[\"getSlot\"]>>[0];\n\ntype UseSlotResponse = ReturnType<GetSlotApi[\"getSlot\"]>;\n\ntype UseSlotInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig>;\n\n/**\n * Get the current slot using the Solana RPC method of\n * [`getSlot`](https://solana.com/docs/rpc/http/getslot)\n *\n * To auto refetch the slot, provide a `options.refetchInterval` value\n */\nexport function useSlot<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n}: UseSlotInput<TConfig> = {}) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  const { data, ...rest } = useQuery({\n    ...options,\n    queryFn: async () => {\n      const slot = await rpc.getSlot(config).send({ abortSignal });\n      return slot;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getSlot\"],\n  });\n\n  return {\n    ...rest,\n    slot: data as UseSlotResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/token-account-balance.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Address, GetTokenAccountBalanceApi, Simplify } from \"gill\";\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>>[1];\n\ntype UseTokenAccountBalanceInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  address: Address | string;\n};\n\ntype UseTokenAccountBalanceResponse = ReturnType<GetTokenAccountBalanceApi[\"getTokenAccountBalance\"]>;\n\nexport function useTokenAccountBalance<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  address,\n}: UseTokenAccountBalanceInput<TConfig>) {\n  const { rpc } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!address,\n    queryFn: async () => {\n      const { value } = await rpc.getTokenAccountBalance(address as Address, config).send({ abortSignal });\n      return value;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, \"getTokenAccountBalance\", address],\n  });\n\n  return {\n    ...rest,\n    balance: data as UseTokenAccountBalanceResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/token-account.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, FetchAccountConfig, Simplify } from \"gill\";\nimport { address, assertAccountExists, assertIsAddress, fetchEncodedAccount } from \"gill\";\nimport {\n  checkedTokenProgramAddress,\n  decodeToken,\n  fetchMint,\n  getAssociatedTokenAccountAddress,\n  type Token,\n} from \"gill/programs\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseTokenAccountResponse<TAddress extends Address = Address> = Simplify<\n  Account<Token, TAddress> & {\n    exists: true;\n  }\n>;\n\ntype TokenAccountInputWithDeclaredAta<TAddress extends Address = Address> = {\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#associated-token-account | Token Account} to get and decode\n   */\n  ata: TAddress;\n};\n\ntype TokenAccountInputWithDerivedAtaDetails = {\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `mint`\n   */\n  mint: Address;\n  /**\n   * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `owner`\n   */\n  owner: Address;\n  /**\n   * The {@link https://solana.com/docs/tokens#token-programs | Token Program} used to create the `mint`\n   *\n   * If no `tokenProgram` is provided, the hook will automatically fetch the\n   * {@link https://solana.com/docs/tokens#mint-account | Mint account} to retrieve the correct Token Program address\n   */\n  tokenProgram?: Address;\n};\n\ntype UseTokenAccountInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends Address = Address,\n> = GillUseRpcHook<TConfig> & (TokenAccountInputWithDeclaredAta<TAddress> | TokenAccountInputWithDerivedAtaDetails);\n\nfunction hasDeclaredAta(\n  input: TokenAccountInputWithDeclaredAta | TokenAccountInputWithDerivedAtaDetails,\n): input is TokenAccountInputWithDeclaredAta {\n  return (input as TokenAccountInputWithDeclaredAta).ata !== undefined;\n}\n\n/**\n * Get and parse an owner's {@link https://solana.com/docs/tokens#token-account | Token account} for a\n * {@link https://solana.com/docs/tokens#mint-account | Mint} and {@link https://solana.com/docs/tokens#token-programs | Token Program}\n */\nexport function useTokenAccount<TConfig extends RpcConfig = RpcConfig, TAddress extends Address = Address>({\n  options,\n  config,\n  abortSignal,\n  // tokenProgram,\n  ...tokenAccountOptions\n}: UseTokenAccountInput<TConfig, TAddress>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error the `abortSignal` was stripped from the type but is now being added back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled:\n      (options?.enabled ?? true) &&\n      (hasDeclaredAta(tokenAccountOptions)\n        ? !!tokenAccountOptions.ata\n        : Boolean(tokenAccountOptions.mint && tokenAccountOptions.owner)),\n    queryFn: async () => {\n      let ata: Address;\n\n      if (hasDeclaredAta(tokenAccountOptions)) {\n        // if the user manually provides the ata, we will use that\n        ata = tokenAccountOptions.ata;\n      } else {\n        // auto fetch the token program address if not provided\n        if (!tokenAccountOptions.tokenProgram) {\n          const mint = await fetchMint(rpc, address(tokenAccountOptions.mint));\n          tokenAccountOptions.tokenProgram = mint.programAddress;\n        }\n\n        checkedTokenProgramAddress(tokenAccountOptions.tokenProgram);\n\n        ata = await getAssociatedTokenAccountAddress(\n          tokenAccountOptions.mint,\n          tokenAccountOptions.owner,\n          tokenAccountOptions.tokenProgram,\n        );\n      }\n\n      assertIsAddress(ata);\n      const account = await fetchEncodedAccount(rpc, ata, config);\n      assertAccountExists(account);\n      return decodeToken(account);\n    },\n    queryKey: [\n      GILL_HOOK_CLIENT_KEY,\n      urlOrMoniker,\n      \"getTokenAccount\",\n      hasDeclaredAta(tokenAccountOptions)\n        ? [{ ata: tokenAccountOptions.ata }]\n        : [\n            {\n              mint: tokenAccountOptions.mint,\n              owner: tokenAccountOptions.owner,\n            },\n          ],\n    ],\n  });\n\n  return {\n    ...rest,\n    account: data as UseTokenAccountResponse<TAddress>,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/token-mint.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Account, Address, FetchAccountConfig, Simplify } from \"gill\";\nimport { assertAccountExists, fetchEncodedAccount } from \"gill\";\nimport { decodeMint, type Mint } from \"gill/programs\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Omit<FetchAccountConfig, \"abortSignal\">>;\n\ntype UseTokenMintResponse<TAddress extends string = string> = Simplify<\n  Account<Mint, TAddress> & {\n    exists: true;\n  }\n>;\n\ntype UseTokenMintInput<\n  TConfig extends RpcConfig = RpcConfig,\n  TAddress extends string = string,\n> = GillUseRpcHook<TConfig> & {\n  /**\n   * Address of the Mint account to get and decode\n   */\n  mint: Address<TAddress> | TAddress;\n};\n\n/**\n * Get and parse a token's {@link https://solana.com/docs/tokens#mint-account | Mint account}\n */\nexport function useTokenMint<TConfig extends RpcConfig = RpcConfig, TAddress extends string = string>({\n  options,\n  config,\n  abortSignal,\n  mint,\n}: UseTokenMintInput<TConfig, TAddress>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n\n  if (abortSignal) {\n    // @ts-expect-error we stripped the `abortSignal` from the type but are now adding it back in\n    config = {\n      ...(config || {}),\n      abortSignal,\n    };\n  }\n\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!mint,\n    queryFn: async () => {\n      const account = await fetchEncodedAccount(rpc, mint as Address<TAddress>, config);\n      assertAccountExists(account);\n      return decodeMint(account);\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getMintAccount\", mint],\n  });\n  return {\n    ...rest,\n    account: data as UseTokenMintResponse<TAddress>,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/transaction.ts",
    "content": "\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetTransactionApi, Signature, Simplify } from \"gill\";\n\nimport { GILL_HOOK_CLIENT_KEY } from \"../const.js\";\nimport { useSolanaClient } from \"./client.js\";\nimport type { GillUseRpcHook } from \"./types.js\";\n\ntype RpcConfig = Simplify<Parameters<GetTransactionApi[\"getTransaction\"]>[1]>;\n\ntype UseTransactionResponse = ReturnType<GetTransactionApi[\"getTransaction\"]>;\n\ntype UseTransactionInput<TConfig extends RpcConfig = RpcConfig> = GillUseRpcHook<TConfig> & {\n  /**\n   * Transaction signature as a base-58 encoded string\n   */\n  signature: Signature | string;\n};\n\n/**\n * Get transaction details for a confirmed transaction using the Solana RPC method of\n * [`getTransaction`](https://solana.com/docs/rpc/http/gettransaction)\n *\n * Default `config` includes:\n * - `maxSupportedTransactionVersion` of `0`\n * - `encoding` of `json`\n */\nexport function useTransaction<TConfig extends RpcConfig = RpcConfig>({\n  options,\n  config,\n  abortSignal,\n  signature,\n}: UseTransactionInput<TConfig>) {\n  const { rpc, urlOrMoniker } = useSolanaClient();\n  const { data, ...rest } = useQuery({\n    networkMode: \"offlineFirst\",\n    ...options,\n    enabled: (options?.enabled ?? true) && !!signature,\n    queryFn: async () => {\n      const response = await rpc\n        .getTransaction(signature as Signature, {\n          encoding: \"json\",\n          // set default values for better DX\n          maxSupportedTransactionVersion: 0,\n          ...(config || {}),\n        })\n        .send({ abortSignal });\n      return response;\n    },\n    queryKey: [GILL_HOOK_CLIENT_KEY, urlOrMoniker, \"getTransaction\", signature],\n  });\n  return {\n    ...rest,\n    transaction: data as UseTransactionResponse,\n  };\n}\n"
  },
  {
    "path": "packages/react/src/hooks/types.ts",
    "content": "import type { useQuery } from \"@tanstack/react-query\";\nimport type { Simplify } from \"gill\";\n\nexport type OmittedUseQueryFields = \"queryKey\" | \"queryFn\";\n\nexport type GillUseQueryDefaultOptions = Omit<Parameters<typeof useQuery>[0], OmittedUseQueryFields>;\n\nexport type GillUseRpcHook<TConfig, TOptions extends GillUseQueryDefaultOptions = GillUseQueryDefaultOptions> = {\n  /**\n   * RPC configuration passed to the RPC method being called\n   */\n  config?: TConfig;\n  /**\n   * Options passed to the {@link useQuery} hook\n   */\n  options?: Simplify<TOptions>;\n  /**\n   * Signal used to abort the RPC operation\n   *\n   * See MDN docs for {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal}\n   * and {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortController | AbortController}\n   */\n  abortSignal?: AbortSignal;\n};\n"
  },
  {
    "path": "packages/react/src/index.ts",
    "content": "// @ts-ignore - Patch BigInt to allow calling `JSON.stringify` on objects that use\ninterface BigInt {\n  /** Convert a BigInt to string form when calling `JSON.stringify()` */\n  toJSON: () => string;\n}\n\n// @ts-ignore - Only add the toJSON method if it doesn't already exist\nif (BigInt.prototype.toJSON === undefined) {\n  // @ts-ignore - toJSON does not exist which is why we are patching it\n  BigInt.prototype.toJSON = function () {\n    return String(this);\n  };\n}\n\nexport * from \"./const.js\";\nexport * from \"./hooks/index.js\";\nexport * from \"./providers.js\";\n\n/**\n * Reexporting the Solana Wallet Standard functionality allows gill to\n * provide a cohesive developer experience\n */\nexport * from \"@solana/react\";\nexport * from \"@solana/wallet-standard-chains\";\nexport * from \"@solana/wallet-standard-features\";\nexport * from \"@wallet-standard/core\";\nexport * from \"@wallet-standard/react\";\nexport * from \"@wallet-standard/ui\";\n"
  },
  {
    "path": "packages/react/src/providers.tsx",
    "content": "\"use client\";\n\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { SolanaClient } from \"gill\";\nimport React from \"react\";\nimport { GILL_HOOK_CLIENT_KEY } from \"./const.js\";\n\n/**\n * Provider to utilize gill hooks for Solana\n */\nexport function SolanaProvider({\n  client,\n  children,\n  queryClient = new QueryClient(),\n}: {\n  client: SolanaClient;\n  children: React.ReactNode;\n  queryClient?: QueryClient;\n}) {\n  queryClient.setQueryData([GILL_HOOK_CLIENT_KEY], client);\n  return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;\n}\n"
  },
  {
    "path": "packages/react/src/types/global.d.ts",
    "content": "declare const __BROWSER__: boolean;\ndeclare const __DEV__: boolean;\ndeclare const __NODEJS__: boolean;\ndeclare const __REACTNATIVE__: boolean;\n"
  },
  {
    "path": "packages/react/tsconfig.declarations.json",
    "content": "{\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"src/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/react/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"@gillsdk/react\",\n  \"extends\": \"../tsconfig/base.json\",\n  \"include\": [\"src\"],\n  \"compilerOptions\": {\n    \"jsx\": \"react\",\n    \"lib\": [\"DOM\", \"ES2015\", \"ESNext.Promise\"]\n  }\n}\n"
  },
  {
    "path": "packages/react/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"../build-scripts/getBaseConfig\";\n\nexport default defineConfig((options = {}) => [\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"native\", [\"esm\"], options),\n]);\n"
  },
  {
    "path": "packages/react/typedoc.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"extends\": [\"../../typedoc.json\"],\n  \"entryPoints\": [\"src/index.ts\"],\n  \"out\": \"./.docs\"\n}\n"
  },
  {
    "path": "packages/solana-pay/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "packages/solana-pay/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/solana-pay/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/solana-pay/CHANGELOG.md",
    "content": "# @gillsdk/solana-pay\n\n## 0.7.0\n\n### Minor Changes\n\n- [#342](https://github.com/gillsdk/gill/pull/342)\n  [`a4477bd`](https://github.com/gillsdk/gill/commit/a4477bde6744f9e2b06b7992548e9f0d61fbb6b3) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - renamed existing fetchers for clarity and added a new generic fetcher\n\n### Patch Changes\n\n- [#339](https://github.com/gillsdk/gill/pull/339)\n  [`52e07ae`](https://github.com/gillsdk/gill/commit/52e07ae6458990b64a2814286188e7a0fb0057e8) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - comprehensive readme\n\n- [#341](https://github.com/gillsdk/gill/pull/341)\n  [`8014797`](https://github.com/gillsdk/gill/commit/8014797e0e49d65b33e9f096b9b767aba87169a7) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - fix `solanaPayTransactionRequest.post` to actually make post request\n  (not a GET request)\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies [[`e345aa9`](https://github.com/gillsdk/gill/commit/e345aa9977513ce9f8635543bad3d5ed392365d5),\n  [`0ea4c93`](https://github.com/gillsdk/gill/commit/0ea4c93d0f2a812b2fcceb2b467f8c9bb8b3afb8)]:\n  - gill@0.14.0\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies [[`157dc22`](https://github.com/gillsdk/gill/commit/157dc221655d5fa56fc035d9fbaad58caa48af19)]:\n  - gill@0.13.0\n\n## 0.6.0\n\n### Minor Changes\n\n- [#300](https://github.com/gillsdk/gill/pull/300)\n  [`fe74a49`](https://github.com/gillsdk/gill/commit/fe74a49fc2dfe7d623f04c4aca6fdad026cc835a) Thanks\n  [@nickfrosty](https://github.com/nickfrosty)! - initialize the solana pay package\n\n### Patch Changes\n\n- Updated dependencies [[`55e5628`](https://github.com/gillsdk/gill/commit/55e562846a0865c0c9773f638e5a48b35e89ed5b),\n  [`2efea9f`](https://github.com/gillsdk/gill/commit/2efea9fde46aca6c030c6bcc07ae2aee4f359ea8),\n  [`459e9a7`](https://github.com/gillsdk/gill/commit/459e9a778b1316374c7028144dd41cde0c5c2455),\n  [`8849226`](https://github.com/gillsdk/gill/commit/8849226d153f9a2660796b829ad44b5e37bae1a0),\n  [`9c22897`](https://github.com/gillsdk/gill/commit/9c228971124c7e711cbbad15b7298fca5dec4c62),\n  [`b94c6f4`](https://github.com/gillsdk/gill/commit/b94c6f4cf0f83bfea550b19580d930fbde908911),\n  [`ee23f2a`](https://github.com/gillsdk/gill/commit/ee23f2a3fbabd31c3ca040e7def970aa552afdf9),\n  [`54e2e96`](https://github.com/gillsdk/gill/commit/54e2e96f87192d36080ececfba0cc3b64c608485),\n  [`8a50e71`](https://github.com/gillsdk/gill/commit/8a50e7151da1b1f270850b25127ac0a671fe6aa5)]:\n  - gill@0.12.0\n"
  },
  {
    "path": "packages/solana-pay/README.md",
    "content": "<h1 align=\"center\">\n  @gillsdk/solana-pay\n</h1>\n\n<p align=\"center\">\n  modern and type-safe Solana Pay protocol client library, built on top of gill\n</p>\n\n<p align=\"center\">\n  <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>\n  <a href=\"https://www.npmjs.com/package/@gillsdk/solana-pay\"><img src=\"https://img.shields.io/npm/v/@gillsdk/solana-pay?logo=npm&color=377CC0\" /></a>\n  <a href=\"https://www.npmjs.com/package/@gillsdk/solana-pay\"><img src=\"https://img.shields.io/npm/dm/@gillsdk/solana-pay?color=377CC0\" /></a>\n</p>\n\n## Overview\n\n`@gillsdk/solana-pay` is a complete, type-safe implementation of the\n[Solana Pay specification](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md). Solana Pay is a\nstandardized protocol for encoding transaction requests within URLs, enabling seamless payments and blockchain\ninteractions across the Solana ecosystem.\n\n**Key Features:**\n\n- **Transfer Requests**: Create payment URLs for SOL and SPL tokens with optional reference tracking\n- **Transaction Requests**: Build interactive checkout flows with HTTPS endpoints\n- **URL Parsing**: Parse and validate any Solana Pay URL with full type safety\n- **Response Handling**: Fetch and validate merchant information and transactions\n- **Comprehensive Validation**: Built-in security checks including HTTPS enforcement, URL length validation, and input\n  validation\n\n## Installation\n\nInstall `@gillsdk/solana-pay` with your package manager of choice:\n\n```shell\nnpm install gill @gillsdk/solana-pay\n```\n\n```shell\npnpm add gill @gillsdk/solana-pay\n```\n\n```shell\nyarn add gill @gillsdk/solana-pay\n```\n\n## Documentation\n\nFor comprehensive documentation, examples, and best practices, see the\n[Solana Pay guide](https://gillsdk.com/docs/guides/solana-pay).\n\nAdditional resources:\n\n- [gill docs site](https://gillsdk.com)\n- [gill setup guide](https://gillsdk.com/docs#quick-start)\n- [gill API references](https://gillsdk.com/api)\n\n## Request Types\n\nSolana Pay supports two distinct request types:\n\n**Transfer Requests** - Non-interactive payment URLs with all details encoded directly:\n\n- Best for: Simple payments, invoices, QR codes\n- No server required\n- Example: `solana:recipient?amount=1.5&label=Coffee+Shop`\n\n**Transaction Requests** - Interactive URLs pointing to HTTPS endpoints:\n\n- Best for: Complex transactions, merchant checkouts, dynamic pricing\n- Requires server-side implementation\n- Example: `solana:https://merchant.example.com/api`\n\nSee the [Request Types documentation](https://gillsdk.com/docs/guides/solana-pay#request-types) for detailed comparison.\n\n## API Reference\n\n| Function                           | Purpose                                     | Documentation                                                                                                                                                              |\n| ---------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `encodeSolanaPayURL`               | Create transfer or transaction request URLs | [Transfer Requests](https://gillsdk.com/docs/guides/solana-pay#transfer-requests), [Transaction Requests](https://gillsdk.com/docs/guides/solana-pay#transaction-requests) |\n| `parseSolanaPayURL`                | Parse and validate any Solana Pay URL       | [Parsing URLs](https://gillsdk.com/docs/guides/solana-pay#parsing-solana-pay-urls)                                                                                         |\n| `solanaPayTransactionRequest.get`  | Fetch merchant info (GET request)           | [Fetching Merchant Information](https://gillsdk.com/docs/guides/solana-pay#fetching-merchant-information-get-request)                                                      |\n| `solanaPayTransactionRequest.post` | Request transaction (POST request)          | [Requesting a Transaction](https://gillsdk.com/docs/guides/solana-pay#requesting-a-transaction-post-request)                                                               |\n| `parseSolanaPayGetResponse`        | Validate GET response data                  | [Validating GET Responses](https://gillsdk.com/docs/guides/solana-pay#validating-get-responses)                                                                            |\n| `parseSolanaPayPostResponse`       | Validate POST response data                 | [Validating POST Responses](https://gillsdk.com/docs/guides/solana-pay#validating-post-responses)                                                                          |\n\n## Quick Start\n\n### Transfer Request (Simple Payment)\n\n```ts\nimport { encodeSolanaPayURL } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\n// Create a payment request for 1.5 SOL\nconst url = encodeSolanaPayURL({\n  recipient: address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\"),\n  amount: 1.5,\n  label: \"Coffee Shop\",\n  message: \"Payment for espresso\",\n});\n// → \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.5&label=Coffee+Shop&message=Payment+for+espresso\"\n```\n\n### Transaction Request (Interactive Checkout)\n\n```ts\nimport { encodeSolanaPayURL, solanaPayTransactionRequest } from \"@gillsdk/solana-pay\";\nimport { address } from \"gill\";\n\n// Create a transaction request URL\nconst url = encodeSolanaPayURL({\n  link: new URL(\"https://merchant.example.com/api\"),\n  label: \"Example Merchant\",\n  message: \"Purchase item #42\",\n});\n\n// Fetch merchant information (GET request)\nconst { label, icon } = await solanaPayTransactionRequest.get(new URL(\"https://merchant.example.com/api\"));\n\n// Request transaction (POST request)\nconst { transaction, message } = await solanaPayTransactionRequest.post(new URL(\"https://merchant.example.com/api\"), {\n  account: address(\"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\"),\n});\n```\n"
  },
  {
    "path": "packages/solana-pay/package.json",
    "content": "{\n  \"name\": \"@gillsdk/solana-pay\",\n  \"license\": \"MIT\",\n  \"version\": \"0.7.0\",\n  \"description\": \"modern Solana Pay protocol client library, built on top of gill\",\n  \"scripts\": {\n    \"clean\": \"rimraf coverage dist build node_modules .turbo\",\n    \"compile:js\": \"tsup --config ./tsup.config.package.ts\",\n    \"compile:typedefs\": \"tsc -p ./tsconfig.declarations.json\",\n    \"compile:docs\": \"typedoc --options typedoc.json && pnpm move:docs\",\n    \"move:docs\": \"pnpm clean:docs && cp -rf ./.docs/* ../../docs/content/api/solana-pay\",\n    \"clean:docs\": \"mkdir -p ../../docs/content/api/solana-pay && rimraf ../../docs/content/api/solana-pay/*\",\n    \"prepublishOnly\": \"pnpm pkg delete devDependencies\",\n    \"publish-impl\": \"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \\\"$PUBLISH_TAG\\\" != \\\"canary\\\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))\",\n    \"publish-packages\": \"pnpm prepublishOnly && pnpm publish-impl\",\n    \"coverage\": \"pnpm test:unit:node --coverage\",\n    \"coverage:open\": \"export BROWSER=brave && xdg-open ./coverage/lcov-report/index.html > /dev/null\",\n    \"test:typecheck\": \"tsc --noEmit\",\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.node.ts --rootDir . --silent\",\n    \"test:unit:browser\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.browser.ts --rootDir . --silent\",\n    \"test:treeshakability:browser\": \"agadoo dist/index.browser.mjs\",\n    \"test:treeshakability:native\": \"agadoo dist/index.native.mjs\",\n    \"test:treeshakability:node\": \"agadoo dist/index.node.mjs\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\"\n  },\n  \"exports\": {\n    \"types\": \"./dist/index.d.ts\",\n    \"import\": \"./dist/index.node.mjs\",\n    \"require\": \"./dist/index.node.cjs\",\n    \"default\": \"./dist/index.node.cjs\"\n  },\n  \"browser\": {\n    \"./dist/index.node.cjs\": \"./dist/index.browser.cjs\",\n    \"./dist/index.node.mjs\": \"./dist/index.browser.mjs\"\n  },\n  \"main\": \"./dist/index.node.cjs\",\n  \"module\": \"./dist/index.node.mjs\",\n  \"react-native\": \"./dist/index.native.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"type\": \"module\",\n  \"files\": [\n    \"./dist/\"\n  ],\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"blockchain\",\n    \"solana\",\n    \"web3\",\n    \"web3js v2\",\n    \"solana kit\",\n    \"wallet\",\n    \"dapps\",\n    \"solana helpers\",\n    \"solana pay\",\n    \"payments\",\n    \"@solana/web3.js\",\n    \"@solana/kit\",\n    \"@solana/pay\",\n    \"@solana-developers/helpers\",\n    \"treeshake\"\n  ],\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"browserslist\": [\n    \"supports bigint and not dead\",\n    \"maintained node versions\"\n  ],\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  },\n  \"dependencies\": {\n    \"gill\": \"workspace:*\"\n  },\n  \"peerDependencies\": {\n    \"typescript\": \">=5\"\n  }\n}\n"
  },
  {
    "path": "packages/solana-pay/src/__tests__/encode-url.ts",
    "content": "import assert from \"node:assert\";\n\nimport { type Address } from \"gill\";\nimport { encodeSolanaPayURL } from \"../encode-url.js\";\n\ndescribe(\"encodeSolanaPayURL\", () => {\n  describe(\"TransferRequestURL\", () => {\n    const recipient = \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address;\n    const splToken = \"USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA\" as Address;\n    const reference1 = \"mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN\" as Address;\n    const reference2 = \"82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny\" as Address;\n    const label = \"label\";\n    const message = \"message\";\n    const memo = \"memo\";\n\n    it(\"encodes a url with only recipient\", () => {\n      const url = encodeSolanaPayURL({ recipient });\n\n      assert.equal(String(url), `solana:${recipient}`);\n    });\n\n    it(\"encodes a url with recipient and amount\", () => {\n      const amount = 1;\n\n      const url = encodeSolanaPayURL({ recipient, amount });\n\n      assert.equal(String(url), `solana:${recipient}?amount=1`);\n    });\n\n    it(\"encodes a url with recipient, amount, and token\", () => {\n      const amount = 1.01;\n\n      const url = encodeSolanaPayURL({ recipient, amount, splToken });\n\n      assert.equal(String(url), `solana:${recipient}?amount=1.01&spl-token=${splToken}`);\n    });\n\n    it(\"encodes a url with recipient, amount, and single reference\", () => {\n      const amount = 100000.123456;\n\n      const url = encodeSolanaPayURL({ recipient, amount, reference: reference1 });\n\n      assert.equal(String(url), `solana:${recipient}?amount=100000.123456&reference=${reference1}`);\n    });\n\n    it(\"encodes a url with recipient, amount, and multiple references\", () => {\n      const amount = 100000.123456;\n      const reference = [reference1, reference2];\n\n      const url = encodeSolanaPayURL({ recipient, amount, reference });\n\n      assert.equal(\n        String(url),\n        `solana:${recipient}?amount=100000.123456&reference=${reference1}&reference=${reference2}`,\n      );\n    });\n\n    it(\"encodes a url with recipient, amount, and label\", () => {\n      const amount = 1.99;\n\n      const url = encodeSolanaPayURL({ recipient, amount, label });\n\n      assert.equal(String(url), `solana:${recipient}?amount=1.99&label=${label}`);\n    });\n\n    it(\"encodes a url with recipient, message, and amount (as integer)\", () => {\n      const amount = 1;\n\n      const url = encodeSolanaPayURL({ recipient, amount, message });\n\n      assert.equal(String(url), `solana:${recipient}?amount=1&message=${message}`);\n    });\n\n    it(\"encodes a url with recipient, amount, and memo\", () => {\n      const amount = 100;\n\n      const url = encodeSolanaPayURL({ recipient, amount, memo });\n\n      assert.equal(String(url), `solana:${recipient}?amount=100&memo=${memo}`);\n    });\n\n    it(\"encodes a url with recipient, message, and amount (with lots of decimals)\", () => {\n      const amount = \"0.000000001\";\n\n      const url = encodeSolanaPayURL({ recipient, amount, message });\n\n      assert.equal(String(url), `solana:${recipient}?amount=${\"0.000000001\"}&message=${message}`);\n    });\n\n    // it(\"encodes a URL with all parameters\", () => {\n    //   const amount: number = 0.000000001;\n    //   const reference = [reference1, reference2];\n\n    //   const url = encodeSolanaPayURL({ recipient, amount, splToken, reference, label, message, memo });\n\n    //   assert.equal(\n    //     String(url),\n    //     `solana:${recipient}?amount=${\"0.000000001\"}&spl-token=${splToken}&reference=${reference1}&reference=${reference2}&label=${label}&message=${message}&memo=${memo}`,\n    //   );\n    // });\n  });\n\n  describe(\"TransactionRequestURL\", () => {\n    const label = \"label\";\n    const message = \"message\";\n\n    it(\"encodes a URL\", () => {\n      const link = \"https://gillsdk.com\";\n\n      const url = encodeSolanaPayURL({ link: new URL(link), label, message });\n\n      assert.equal(String(url), `solana:${link}?label=${label}&message=${message}`);\n    });\n\n    it(\"encodes a URL with query parameters\", () => {\n      const link = \"https://gillsdk.com?query=param\";\n\n      const url = encodeSolanaPayURL({ link: new URL(link), label, message });\n\n      assert.equal(String(url), `solana:${encodeURIComponent(link)}?label=${label}&message=${message}`);\n    });\n\n    it(\"throws an error for HTTP\", () => {\n      const link = \"http://gillsdk.com?query=param\";\n      expect(() => encodeSolanaPayURL({ link: new URL(link) })).toThrow(\"must use HTTPS protocol\");\n    });\n\n    it(\"throws an error for FTP\", () => {\n      const link = \"ftp://gillsdk.com?query=param\";\n      expect(() => encodeSolanaPayURL({ link: new URL(link) })).toThrow(\"must use HTTPS protocol\");\n    });\n\n    it(\"throws an error for Solana Pay\", () => {\n      const link = \"solana://gillsdk.com\";\n      expect(() => encodeSolanaPayURL({ link: new URL(link) })).toThrow(\"must use HTTPS protocol\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/solana-pay/src/__tests__/fetchers.ts",
    "content": "import assert from \"node:assert\";\n\nimport { transactionFromBase64, type Address } from \"gill\";\nimport { fetchSolanaPayGetRequest, fetchSolanaPayPostRequest, fetchSolanaPayRequest } from \"../fetchers.js\";\n\n// Mock fetch for testing\nconst originalFetch = globalThis.fetch;\n\nfunction mockFetch(response: any, ok = true, status = 200, statusText = \"OK\") {\n  globalThis.fetch = async () =>\n    ({\n      ok,\n      status,\n      statusText,\n      json: async () => response,\n    }) as unknown as Response;\n}\n\nfunction restoreFetch() {\n  globalThis.fetch = originalFetch;\n}\n\ndescribe(\"HTTP Integration Tests\", () => {\n  const account = \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address;\n\n  const unsignedTransaction =\n    \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABC7YxPJkVXZH3qqq8Nq1nwYa5Pm6+M9ZeObND0CCtBLXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n  const signedTransaction =\n    \"Ace42d/o4XA3NGfL6hslysKyc8kB0ILDUT6diotxWdxP1cdt+oNWGztxEPb5t0F797swnV7NLCguh94nGqetQwABAAABHQ6Thk3MgV/D8oYYCRHQCj/SBt4xoclCh8tD8F/J8rXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n  const unsignedTx = transactionFromBase64(unsignedTransaction);\n  const signedTx = transactionFromBase64(signedTransaction);\n\n  afterEach(() => {\n    restoreFetch();\n  });\n\n  it(\"should successfully complete GET transaction request flow\", async () => {\n    const mockResponse = {\n      label: \"Test Store\",\n      icon: \"https://example.com/icon.png\",\n    };\n\n    mockFetch(mockResponse);\n\n    const url = new URL(\"https://example.com/pay\");\n    const result = await fetchSolanaPayGetRequest(url);\n\n    assert.equal(result.label, mockResponse.label);\n    assert.equal(result.icon.href, mockResponse.icon);\n  });\n\n  it(\"should successfully complete POST transaction request flow (with unsigned transaction)\", async () => {\n    const mockResponse = {\n      transaction: unsignedTransaction,\n      message: \"Payment successful\",\n    };\n\n    mockFetch(mockResponse);\n\n    const url = new URL(\"https://example.com/pay\");\n    const result = await fetchSolanaPayPostRequest(url, {\n      account,\n    });\n\n    assert.equal(result.message, mockResponse.message);\n    assert.deepEqual(result.transaction, unsignedTx);\n    // assert.deepEqual(result.transaction.signatures, unsignedTx.signatures);\n  });\n\n  it(\"should successfully complete POST transaction request flow (with signed transaction)\", async () => {\n    const mockResponse = {\n      transaction: signedTransaction,\n      message: \"Payment successful\",\n    };\n\n    mockFetch(mockResponse);\n\n    const url = new URL(\"https://example.com/pay\");\n    const result = await fetchSolanaPayPostRequest(url, {\n      account,\n    });\n\n    assert.equal(result.message, mockResponse.message);\n    assert.deepEqual(result.transaction, signedTx);\n  });\n});\n\ndescribe(\"fetchSolanaPayRequest\", () => {\n  afterEach(() => {\n    restoreFetch();\n  });\n\n  describe(\"URL validation\", () => {\n    it(\"should reject non-HTTPS URLs\", async () => {\n      const url = new URL(\"http://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n          }),\n        {\n          message: \"URL must use HTTPS protocol\",\n        },\n      );\n    });\n\n    it(\"should accept valid HTTPS URLs\", async () => {\n      const mockResponse = { data: \"test\" };\n      mockFetch(mockResponse);\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n      });\n\n      assert.deepEqual(result, mockResponse);\n    });\n  });\n\n  describe(\"HTTP method and headers\", () => {\n    it(\"should make GET request with correct headers\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n      });\n\n      assert.equal(capturedRequest?.method, \"GET\");\n      assert.deepEqual(capturedRequest?.headers, {\n        Accept: \"application/json\",\n        \"Accept-Encoding\": \"gzip, deflate, br\",\n      });\n    });\n\n    it(\"should make POST request with Content-Type header when body present\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"POST\",\n        body: { test: \"data\" },\n      });\n\n      assert.equal(capturedRequest?.method, \"POST\");\n      assert.deepEqual(capturedRequest?.headers, {\n        Accept: \"application/json\",\n        \"Accept-Encoding\": \"gzip, deflate, br\",\n        \"Content-Type\": \"application/json\",\n      });\n      assert.equal(capturedRequest?.body, JSON.stringify({ test: \"data\" }));\n    });\n\n    it(\"should merge custom headers from requestInit\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n        requestInit: {\n          headers: {\n            \"X-Custom-Header\": \"custom-value\",\n          },\n        },\n      });\n\n      assert.deepEqual(capturedRequest?.headers, {\n        Accept: \"application/json\",\n        \"Accept-Encoding\": \"gzip, deflate, br\",\n        \"X-Custom-Header\": \"custom-value\",\n      });\n    });\n\n    it(\"should JSON stringify body for POST requests\", async () => {\n      const mockResponse = { success: true };\n      let capturedBody: string | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedBody = init?.body as string;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      const body = { account: \"test123\", amount: 100 };\n\n      await fetchSolanaPayRequest(url, {\n        method: \"POST\",\n        body,\n      });\n\n      assert.equal(capturedBody, JSON.stringify(body));\n    });\n  });\n\n  describe(\"Response handling - success\", () => {\n    it(\"should return raw JSON when no parser provided\", async () => {\n      const mockResponse = { data: \"test\", value: 123 };\n      mockFetch(mockResponse);\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n      });\n\n      assert.deepEqual(result, mockResponse);\n    });\n\n    it(\"should use parser function when provided\", async () => {\n      const mockResponse = { raw: \"data\" };\n      mockFetch(mockResponse);\n\n      const parser = (data: unknown) => {\n        const d = data as { raw: string };\n        return { parsed: d.raw.toUpperCase() };\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n        parser,\n      });\n\n      assert.deepEqual(result, { parsed: \"DATA\" });\n    });\n\n    it(\"should handle GET request successfully\", async () => {\n      const mockResponse = { label: \"Test\", icon: \"https://test.com/icon.png\" };\n      mockFetch(mockResponse);\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n      });\n\n      assert.deepEqual(result, mockResponse);\n    });\n\n    it(\"should handle POST request successfully\", async () => {\n      const mockResponse = { transaction: \"base64tx\", message: \"Success\" };\n      mockFetch(mockResponse);\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"POST\",\n        body: { account: \"test123\" },\n      });\n\n      assert.deepEqual(result, mockResponse);\n    });\n  });\n\n  describe(\"Response handling - errors\", () => {\n    it(\"should throw on HTTP 4xx error\", async () => {\n      mockFetch({}, false, 404, \"Not Found\");\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n          }),\n        {\n          message: \"HTTP 404: Not Found\",\n        },\n      );\n    });\n\n    it(\"should throw on HTTP 5xx error\", async () => {\n      mockFetch({}, false, 500, \"Internal Server Error\");\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n          }),\n        {\n          message: \"HTTP 500: Internal Server Error\",\n        },\n      );\n    });\n\n    it(\"should throw descriptive error on invalid JSON\", async () => {\n      globalThis.fetch = async () =>\n        ({\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => {\n            throw new SyntaxError(\"Unexpected token < in JSON at position 0\");\n          },\n        }) as unknown as Response;\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n          }),\n        {\n          message: \"Failed to parse response as JSON: Unexpected token < in JSON at position 0\",\n        },\n      );\n    });\n\n    it(\"should throw descriptive error on parser validation failure\", async () => {\n      const mockResponse = { invalid: \"data\" };\n      mockFetch(mockResponse);\n\n      const parser = (data: unknown) => {\n        const d = data as any;\n        if (!d.required) {\n          throw new Error(\"Missing required field: required\");\n        }\n        return d;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n            parser,\n          }),\n        {\n          message: \"Failed to validate response schema: Missing required field: required\",\n        },\n      );\n    });\n\n    it(\"should handle non-Error thrown in JSON parsing\", async () => {\n      globalThis.fetch = async () =>\n        ({\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => {\n            throw \"String error\";\n          },\n        }) as unknown as Response;\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n          }),\n        {\n          message: \"Failed to parse response as JSON: String error\",\n        },\n      );\n    });\n\n    it(\"should handle non-Error thrown in parser\", async () => {\n      const mockResponse = { data: \"test\" };\n      mockFetch(mockResponse);\n\n      const parser = () => {\n        throw \"Parser failed\";\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n\n      await assert.rejects(\n        async () =>\n          fetchSolanaPayRequest(url, {\n            method: \"GET\",\n            parser,\n          }),\n        {\n          message: \"Failed to validate response schema: Parser failed\",\n        },\n      );\n    });\n  });\n\n  describe(\"Edge cases\", () => {\n    it(\"should handle request with body but no Content-Type if method is GET\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n        body: { test: \"data\" },\n      });\n\n      // Should have Content-Type because body is present\n      assert.deepEqual(capturedRequest?.headers, {\n        Accept: \"application/json\",\n        \"Accept-Encoding\": \"gzip, deflate, br\",\n        \"Content-Type\": \"application/json\",\n      });\n    });\n\n    it(\"should handle POST without body\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"POST\",\n      });\n\n      assert.equal(capturedRequest?.method, \"POST\");\n      assert.equal(capturedRequest?.body, undefined);\n      // Content-Type should be added for POST even without body\n      assert.deepEqual(capturedRequest?.headers, {\n        Accept: \"application/json\",\n        \"Accept-Encoding\": \"gzip, deflate, br\",\n        \"Content-Type\": \"application/json\",\n      });\n    });\n\n    it(\"should handle empty response object\", async () => {\n      mockFetch({});\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n      });\n\n      assert.deepEqual(result, {});\n    });\n\n    it(\"should handle parser that transforms data\", async () => {\n      const mockResponse = {\n        firstName: \"John\",\n        lastName: \"Doe\",\n      };\n      mockFetch(mockResponse);\n\n      const parser = (data: unknown) => {\n        const d = data as { firstName: string; lastName: string };\n        return {\n          fullName: `${d.firstName} ${d.lastName}`,\n        };\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      const result = await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n        parser,\n      });\n\n      assert.deepEqual(result, { fullName: \"John Doe\" });\n    });\n\n    it(\"should pass through all requestInit options\", async () => {\n      const mockResponse = { data: \"test\" };\n      let capturedRequest: RequestInit | undefined;\n\n      globalThis.fetch = async (_url, init) => {\n        capturedRequest = init;\n        return {\n          ok: true,\n          status: 200,\n          statusText: \"OK\",\n          json: async () => mockResponse,\n        } as unknown as Response;\n      };\n\n      const url = new URL(\"https://example.com/pay\");\n      await fetchSolanaPayRequest(url, {\n        method: \"GET\",\n        requestInit: {\n          signal: new AbortController().signal,\n          cache: \"no-cache\",\n        },\n      });\n\n      assert.equal(capturedRequest?.cache, \"no-cache\");\n      assert.ok(capturedRequest?.signal);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/solana-pay/src/__tests__/parse-url.ts",
    "content": "import { type Address } from \"gill\";\nimport assert from \"node:assert\";\nimport { parseSolanaPayURL, SolanaPayTransactionRequestURL, type SolanaPayTransferRequestURL } from \"../parse-url.js\";\n\ndescribe(\"parseSolanaPayURL\", () => {\n  const pubkey = \"nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\" as Address;\n\n  describe(\"SolanaPayTransactionRequestURL\", () => {\n    it(\"should parse with only a url\", () => {\n      const url = `solana:${\"https://gillsdk.com\"}`;\n\n      const { label, message, link } = parseSolanaPayURL(url) as SolanaPayTransactionRequestURL;\n\n      // should add trailing slash\n      assert.equal(link, \"https://gillsdk.com/\");\n      assert.equal(label, undefined);\n      assert.equal(message, undefined);\n    });\n\n    it(\"should parse with Solana Pay query params\", () => {\n      const data = {\n        link: \"https://gillsdk.com/\",\n        message: \"Message\",\n        label: \"Label\",\n      };\n      const url = `solana:${data.link}?label=${data.label}&message=${data.message}`;\n\n      const { label, message, link } = parseSolanaPayURL(url) as SolanaPayTransactionRequestURL;\n\n      assert.equal(link, data.link);\n      assert.equal(label, data.label);\n      assert.equal(message, data.message);\n    });\n\n    it(\"should parse with link with query params\", () => {\n      const data = {\n        link: \"https://gillsdk.com/?query=param\",\n      };\n      const url = `solana:${encodeURIComponent(data.link)}`;\n\n      const { label, message, link } = parseSolanaPayURL(url) as SolanaPayTransactionRequestURL;\n\n      assert.equal(link, data.link);\n      assert.equal(label, undefined);\n      assert.equal(message, undefined);\n    });\n\n    it(\"should parse with link with query params and Solana Pay query params\", () => {\n      const data = {\n        link: \"https://gillsdk.com/?query=param\",\n        message: \"Message\",\n        label: \"Label\",\n      };\n      const url = `solana:${encodeURIComponent(data.link)}?label=${data.label}&message=${data.message}`;\n\n      const { label, message, link } = parseSolanaPayURL(url) as SolanaPayTransactionRequestURL;\n\n      assert.equal(link, data.link);\n      assert.equal(label, data.label);\n      assert.equal(message, data.message);\n    });\n  });\n\n  describe(\"SolanaPayTransferRequestURL\", () => {\n    it(\"should parse with only address\", () => {\n      const url = \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      assert.equal(amount, undefined);\n      assert.equal(splToken, undefined);\n      assert.equal(reference, undefined);\n      assert.equal(label, undefined);\n      assert.equal(message, undefined);\n      assert.equal(memo, undefined);\n    });\n\n    it(\"should parse successfully\", () => {\n      const url =\n        \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=0.000000001&reference=82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny&label=Michael&message=Thanks%20for%20all%20the%20fish&memo=OrderId5678\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      assert.equal(amount, 0.000000001);\n      assert.equal(splToken, undefined);\n      assert.equal(reference?.length, 1);\n      assert.equal(reference![0], \"82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny\");\n      assert.equal(label, \"Michael\");\n      assert.equal(message, \"Thanks for all the fish\");\n      assert.equal(memo, \"OrderId5678\");\n    });\n\n    it(\"should parse with spl-token\", () => {\n      const url =\n        \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1.01&spl-token=82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny&label=Michael&message=Thanks%20for%20all%20the%20fish&memo=OrderId5678\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      assert.equal(amount, 1.01);\n      assert.equal(splToken, \"82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny\");\n      assert.equal(reference, undefined);\n      assert.equal(label, \"Michael\");\n      assert.equal(message, \"Thanks for all the fish\");\n      assert.equal(memo, \"OrderId5678\");\n    });\n\n    it(\"should parse multiple references\", () => {\n      const url =\n        \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?reference=82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny&reference=mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      assert.equal(reference?.length, 2);\n      assert.equal(reference![0], \"82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny\");\n      assert.equal(reference![1], \"mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN\");\n      assert.equal(amount, undefined);\n      assert.equal(splToken, undefined);\n      assert.equal(label, undefined);\n      assert.equal(message, undefined);\n      assert.equal(memo, undefined);\n    });\n\n    it(\"should parse without an amount\", () => {\n      const url =\n        \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?reference=82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny&label=Michael&message=Thanks%20for%20all%20the%20fish&memo=OrderId5678\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      expect(amount).toBeUndefined();\n      assert.equal(splToken, undefined);\n      assert.equal(reference?.length, 1);\n      assert.equal(reference![0], \"82ZJ7nbGpixjeDCmEhUcmwXYfvurzAgGdtSMuHnUgyny\");\n      assert.equal(label, \"Michael\");\n      assert.equal(message, \"Thanks for all the fish\");\n      assert.equal(memo, \"OrderId5678\");\n    });\n\n    it(\"should parse with only amount\", () => {\n      const url = \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=0.000000001\";\n\n      const { recipient, amount, splToken, reference, label, message, memo } = parseSolanaPayURL(\n        url,\n      ) as SolanaPayTransferRequestURL;\n\n      assert.equal(recipient, pubkey);\n      assert.equal(amount, 0.000000001);\n      assert.equal(splToken, undefined);\n      assert.equal(reference, undefined);\n      assert.equal(label, undefined);\n      assert.equal(message, undefined);\n      assert.equal(memo, undefined);\n    });\n  });\n\n  describe(\"errors\", () => {\n    it(\"throws an error on invalid length\", () => {\n      const url = \"X\".repeat(2049);\n      expect(() => parseSolanaPayURL(url)).toThrow(\"length invalid\");\n    });\n\n    it(\"throws an error on invalid protocol\", () => {\n      const url = \"eth:0xffff\";\n      expect(() => parseSolanaPayURL(url)).toThrow(\"protocol invalid\");\n    });\n\n    it(\"throws an error on invalid recipient\", () => {\n      const url = \"solana:0xffff\";\n      expect(() => parseSolanaPayURL(url)).toThrow(\"recipient invalid\");\n    });\n\n    it.each([\n      // various invalid numbers\n      [\"1milliondollars\"],\n      [-0.1],\n      [-100],\n    ])(\"throws an error on invalid amount: %p\", (amount) => {\n      const url = `solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=${amount}`;\n\n      expect(() => parseSolanaPayURL(url)).toThrow(\"amount invalid\");\n    });\n\n    it(\"throws an error on invalid token\", () => {\n      const url = \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1&spl-token=0xffff\";\n\n      expect(() => parseSolanaPayURL(url)).toThrow(\"spl-token invalid\");\n    });\n\n    it(\"throws an error on invalid reference\", () => {\n      const url = \"solana:nick6zJc6HpW3kfBm4xS2dmbuVRyb5F3AnUvj5ymzR5?amount=1&reference=0xffff\";\n\n      expect(() => parseSolanaPayURL(url)).toThrow(\"reference invalid\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/solana-pay/src/__tests__/response.ts",
    "content": "import assert from \"node:assert\";\n\nimport { transactionFromBase64 } from \"gill\";\nimport { parseSolanaPayGetResponse, parseSolanaPayPostResponse, SolanaPayResponseError } from \"../response.js\";\n\ndescribe(\"parseSolanaPayGetResponse\", () => {\n  it(\"should parse valid GET response\", () => {\n    const data = {\n      label: \"Test Store\",\n      icon: \"https://example.com/icon.png\",\n    };\n\n    const result = parseSolanaPayGetResponse(data);\n    assert.equal(result.label, data.label);\n    assert.equal(result.icon.href, data.icon);\n  });\n\n  it(\"should throw error for missing label\", () => {\n    const data = {\n      icon: \"https://example.com/icon.png\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid label\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for invalid label type\", () => {\n    const data = {\n      label: 123, // Should be string\n      icon: \"https://example.com/icon.png\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid label\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for missing icon\", () => {\n    const data = {\n      label: \"Test Store\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid icon\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for invalid icon URL format\", () => {\n    const data = {\n      label: \"Test Store\",\n      icon: \"not-a-url\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid icon URL format\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for non-HTTP(S) icon URL\", () => {\n    const data = {\n      label: \"Test Store\",\n      icon: \"ftp://example.com/icon.png\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Icon URL must use HTTP or HTTPS protocol\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for invalid icon format\", () => {\n    const data = {\n      label: \"Test Store\",\n      icon: \"https://example.com/icon.gif\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayGetResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Icon must be SVG, PNG, WebP, or JPEG format\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should accept valid icon formats\", () => {\n    const formats = [\".svg\", \".png\", \".webp\", \".jpg\", \".jpeg\"];\n\n    for (const format of formats) {\n      const data = {\n        label: \"Test Store\",\n        icon: `https://example.com/icon${format}`,\n      };\n\n      const result = parseSolanaPayGetResponse(data);\n      assert.equal(result.icon.href, data.icon);\n    }\n  });\n\n  it(\"should handle case-insensitive file extensions\", () => {\n    const data = {\n      label: \"Test Store\",\n      icon: \"https://example.com/icon.PNG\",\n    };\n\n    const result = parseSolanaPayGetResponse(data);\n    assert.equal(result.icon.href, data.icon);\n  });\n});\n\ndescribe(\"parseSolanaPayPostResponse\", () => {\n  const unsignedTransaction =\n    \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABC7YxPJkVXZH3qqq8Nq1nwYa5Pm6+M9ZeObND0CCtBLXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n  const signedTransaction =\n    \"Ace42d/o4XA3NGfL6hslysKyc8kB0ILDUT6diotxWdxP1cdt+oNWGztxEPb5t0F797swnV7NLCguh94nGqetQwABAAABHQ6Thk3MgV/D8oYYCRHQCj/SBt4xoclCh8tD8F/J8rXjfKbGfbEEIU1AEH81ttgpyiNLO+xurYCsjdCVcfR4YQA=\";\n\n  const unsignedTx = transactionFromBase64(unsignedTransaction);\n  const signedTx = transactionFromBase64(signedTransaction);\n\n  it(\"should parse valid POST response (unsigned transaction)\", () => {\n    const data = {\n      transaction: unsignedTransaction,\n      message: \"Payment successful\",\n    };\n\n    const result = parseSolanaPayPostResponse(data);\n    assert.equal(result.message, data.message);\n    assert.deepEqual(result.transaction, unsignedTx);\n  });\n\n  it(\"should parse valid POST response (signed transaction)\", () => {\n    const data = {\n      transaction: signedTransaction,\n      message: \"Payment successful\",\n    };\n\n    const result = parseSolanaPayPostResponse(data);\n    assert.equal(result.message, data.message);\n    assert.deepEqual(result.transaction, signedTx);\n  });\n\n  it(\"should parse POST response without message\", () => {\n    const data = {\n      // transaction: \"dGVzdA==\", // \"test\" in base64\n      transaction: unsignedTransaction,\n    };\n\n    const result = parseSolanaPayPostResponse(data);\n    assert.equal(result.message, undefined);\n    assert.deepEqual(result.transaction, unsignedTx);\n  });\n\n  it(\"should throw error for missing transaction\", () => {\n    const data = {\n      message: \"Payment successful\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayPostResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid transaction\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for non-string transaction\", () => {\n    const data = {\n      transaction: 123, // Should be string\n    };\n\n    assert.throws(\n      () => parseSolanaPayPostResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid transaction\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for empty transaction\", () => {\n    const data = {\n      transaction: \"\",\n    };\n\n    assert.throws(\n      () => parseSolanaPayPostResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: missing or invalid transaction\");\n        return true;\n      },\n    );\n  });\n\n  it(\"should throw error for invalid message type\", () => {\n    const data = {\n      transaction: unsignedTransaction,\n      message: 123, // Should be string\n    };\n\n    assert.throws(\n      () => parseSolanaPayPostResponse(data),\n      (err: SolanaPayResponseError) => {\n        assert(err instanceof SolanaPayResponseError);\n        assert.equal(err.message, \"Invalid response: message must be string\");\n        return true;\n      },\n    );\n  });\n});\n"
  },
  {
    "path": "packages/solana-pay/src/__typetests__/response.ts",
    "content": "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type {\n  SolanaPayTransactionRequestGetResponse,\n  SolanaPayTransactionRequestGetResponseParsed,\n  SolanaPayTransactionRequestPostResponse,\n  SolanaPayTransactionRequestPostResponseParsed,\n} from \"../response.js\";\n\n// [DESCRIBE] Wire and Parsed types have matching keys\n{\n  // GET response: wire and parsed types must have the same keys\n  type _GetWireKeys = keyof SolanaPayTransactionRequestGetResponse;\n  type _GetParsedKeys = keyof SolanaPayTransactionRequestGetResponseParsed;\n\n  // Assert bidirectional key compatibility\n  null as unknown as _GetWireKeys satisfies _GetParsedKeys;\n  null as unknown as _GetParsedKeys satisfies _GetWireKeys;\n\n  // POST response: wire and parsed types must have the same keys\n  type _PostWireKeys = keyof SolanaPayTransactionRequestPostResponse;\n  type _PostParsedKeys = keyof SolanaPayTransactionRequestPostResponseParsed;\n\n  // Assert bidirectional key compatibility\n  null as unknown as _PostWireKeys satisfies _PostParsedKeys;\n  null as unknown as _PostParsedKeys satisfies _PostWireKeys;\n}\n"
  },
  {
    "path": "packages/solana-pay/src/constants.ts",
    "content": "/** @internal */\nexport const SOLANA_PAY_PROTOCOL = \"solana:\";\n"
  },
  {
    "path": "packages/solana-pay/src/encode-url.ts",
    "content": "import type { Address } from \"gill\";\nimport { SOLANA_PAY_PROTOCOL } from \"./constants.js\";\n\n/**\n * Fields of a Solana Pay transaction request URL.\n */\nexport interface SolanaPayTransactionRequestURLFields {\n  /** `link` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#link) */\n  link: URL;\n  /** `label` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#label-1) */\n  label?: string;\n  /** `message` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#message-1).  */\n  message?: string;\n}\n\n/**\n * Fields of a Solana Pay transfer request URL.\n */\nexport interface SolanaPayTransferRequestURLFields {\n  /** `recipient` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#recipient) */\n  recipient: Address;\n  /** `amount` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#amount) */\n  amount?: number | string;\n  /** `spl-token` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#spl-token) */\n  splToken?: Address;\n  /** `reference` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#reference) */\n  reference?: Address | Address[];\n  /** `label` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#label) */\n  label?: string;\n  /** `message` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#message).  */\n  message?: string;\n  /** `memo` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#memo) */\n  memo?: string;\n}\n\n/**\n * Encode a Solana Pay URL\n *\n * @param fields Fields to encode in the URL\n */\nexport function encodeSolanaPayURL(\n  fields: SolanaPayTransactionRequestURLFields | SolanaPayTransferRequestURLFields,\n): URL {\n  return \"link\" in fields ? encodeTransactionRequestURL(fields) : encodeTransferRequestURL(fields);\n}\n\nfunction encodeTransactionRequestURL({ link, label, message }: SolanaPayTransactionRequestURLFields): URL {\n  if (link.protocol !== \"https:\") {\n    throw new Error(\"Link must use HTTPS protocol\");\n  }\n\n  // Remove trailing slashes\n  const pathname = link.search\n    ? encodeURIComponent(String(link).replace(/\\/\\?/, \"?\"))\n    : String(link).replace(/\\/$/, \"\");\n  const url = new URL(SOLANA_PAY_PROTOCOL + pathname);\n\n  if (label) {\n    url.searchParams.append(\"label\", label);\n  }\n\n  if (message) {\n    url.searchParams.append(\"message\", message);\n  }\n\n  return url;\n}\n\nfunction encodeTransferRequestURL({\n  recipient,\n  amount,\n  splToken,\n  reference,\n  label,\n  message,\n  memo,\n}: SolanaPayTransferRequestURLFields): URL {\n  const url = new URL(SOLANA_PAY_PROTOCOL + recipient);\n\n  if (amount) {\n    url.searchParams.append(\"amount\", amount.toString());\n  }\n\n  if (splToken) {\n    url.searchParams.append(\"spl-token\", splToken);\n  }\n\n  if (reference) {\n    if (!Array.isArray(reference)) {\n      reference = [reference];\n    }\n\n    for (const pubkey of reference) {\n      url.searchParams.append(\"reference\", pubkey);\n    }\n  }\n\n  if (label) {\n    url.searchParams.append(\"label\", label);\n  }\n\n  if (message) {\n    url.searchParams.append(\"message\", message);\n  }\n\n  if (memo) {\n    url.searchParams.append(\"memo\", memo);\n  }\n\n  return url;\n}\n"
  },
  {
    "path": "packages/solana-pay/src/fetchers.ts",
    "content": "import { SolanaPayTransactionRequestPostRequest, validateSolanaPayRequestUrl } from \"./request.js\";\nimport {\n  parseSolanaPayGetResponse,\n  parseSolanaPayPostResponse,\n  SolanaPayTransactionRequestGetResponseParsed,\n  SolanaPayTransactionRequestPostResponseParsed,\n} from \"./response.js\";\n\n/**\n * Generic HTTP fetcher for Solana Pay transaction request endpoints.\n *\n * Validates URL, makes request, and optionally parses the JSON response.\n *\n * @template TResponse - Expected response type (defaults to unknown)\n * @param url - Solana Pay transaction request URL (must be https://)\n * @param config - Request configuration\n * @param config.method - HTTP method (GET or POST)\n * @param config.body - Request body (JSON stringified)\n * @param config.parser - Optional response parser/validator\n * @param config.requestInit - Optional fetch options\n * @returns Parsed response or raw JSON if no parser provided\n * @throws {Error} Invalid URL, HTTP error, JSON parse error, or schema validation error\n */\nexport async function fetchSolanaPayRequest<TResponse = unknown>(\n  url: URL,\n  config: {\n    method: \"GET\" | \"POST\";\n    body?: unknown;\n    parser?: (data: unknown) => TResponse;\n    requestInit?: RequestInit;\n  },\n): Promise<TResponse> {\n  validateSolanaPayRequestUrl(url);\n\n  const baseHeaders: HeadersInit = {\n    Accept: \"application/json\",\n    \"Accept-Encoding\": \"gzip, deflate, br\",\n  };\n\n  if (config.method === \"POST\" || config.body !== undefined) {\n    baseHeaders[\"Content-Type\"] = \"application/json\";\n  }\n\n  // Destructure to exclude headers from requestInit since we handle them separately\n  const { headers: _headers, ...restRequestInit } = config.requestInit || {};\n\n  const response = await fetch(url, {\n    method: config.method,\n    headers: {\n      ...baseHeaders,\n      ...config.requestInit?.headers,\n    },\n    body: config.body !== undefined ? JSON.stringify(config.body) : undefined,\n    ...restRequestInit,\n  });\n\n  if (!response.ok) {\n    throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n  }\n\n  let data: unknown;\n  try {\n    data = await response.json();\n  } catch (error) {\n    throw new Error(`Failed to parse response as JSON: ${error instanceof Error ? error.message : String(error)}`);\n  }\n\n  if (config.parser) {\n    try {\n      return config.parser(data);\n    } catch (error) {\n      throw new Error(`Failed to validate response schema: ${error instanceof Error ? error.message : String(error)}`);\n    }\n  }\n\n  return data as TResponse;\n}\n\n/**\n * Fetches merchant information for a Solana Pay transaction request.\n *\n * Makes a GET request to retrieve the merchant's label and icon, which are displayed\n * to the user before presenting the transaction for signing.\n *\n * @param url - Solana Pay transaction request URL (must be https://)\n * @param options - Optional fetch configuration\n * @returns Merchant label and icon\n * @throws {Error} Invalid URL, HTTP error, or invalid response schema\n *\n * @example\n * ```typescript\n * const { label, icon } = await fetchSolanaPayGetRequest(\n *   new URL('https://merchant.example.com/api')\n * );\n * console.log(label); // \"Example Merchant\"\n * console.log(icon);  // URL object: https://merchant.example.com/icon.svg\n * ```\n */\nexport async function fetchSolanaPayGetRequest(\n  url: URL,\n  options?: RequestInit,\n): Promise<SolanaPayTransactionRequestGetResponseParsed> {\n  return fetchSolanaPayRequest(url, {\n    method: \"GET\",\n    parser: parseSolanaPayGetResponse,\n    requestInit: options,\n  });\n}\n\n/**\n * Requests a transaction from a Solana Pay merchant endpoint.\n *\n * Makes a POST request with the user's account address. The merchant returns a\n * serialized transaction (unsigned or partially signed) for the wallet to sign.\n *\n * @param url - Solana Pay transaction request URL (must be https://)\n * @param body - Request body containing the user's account address\n * @param options - Optional fetch configuration\n * @returns transaction and optional message\n * @throws {Error} Invalid URL, HTTP error, or invalid response schema\n *\n * @example\n * ```typescript\n * const { transaction, message } = await fetchSolanaPayPostRequest(\n *   new URL('https://merchant.example.com/api'),\n *   { account: address(\"user123...\") }\n * );\n * // transaction is automatically decoded and deserialized\n * // message is an optional string to display to the user\n * ```\n */\nexport async function fetchSolanaPayPostRequest(\n  url: URL,\n  body: SolanaPayTransactionRequestPostRequest,\n  options?: RequestInit,\n): Promise<SolanaPayTransactionRequestPostResponseParsed> {\n  return fetchSolanaPayRequest(url, {\n    method: \"POST\",\n    body,\n    parser: parseSolanaPayPostResponse,\n    requestInit: options,\n  });\n}\n\n/**\n * Solana Pay transaction request methods.\n *\n * @property {Function} get - Fetch merchant information (label and icon)\n * @property {Function} post - Request a transaction from the merchant\n *\n * @example\n * ```typescript\n * const { label, icon } = await solanaPayTransactionRequest.get(url);\n * const { transaction } = await solanaPayTransactionRequest.post(url, { account });\n * ```\n */\nexport const solanaPayTransactionRequest = {\n  get: fetchSolanaPayGetRequest,\n  post: fetchSolanaPayPostRequest,\n};\n"
  },
  {
    "path": "packages/solana-pay/src/global.d.ts",
    "content": "declare const __BROWSER__: boolean;\ndeclare const __DEV__: boolean;\ndeclare const __NODEJS__: boolean;\ndeclare const __REACTNATIVE__: boolean;\ndeclare const __VERSION__: string;\n"
  },
  {
    "path": "packages/solana-pay/src/index.ts",
    "content": "export * from \"./constants.js\";\nexport * from \"./encode-url.js\";\nexport { solanaPayTransactionRequest } from \"./fetchers.js\";\nexport * from \"./parse-url.js\";\nexport * from \"./request.js\";\nexport * from \"./response.js\";\n"
  },
  {
    "path": "packages/solana-pay/src/parse-url.ts",
    "content": "import { address, type Address } from \"gill\";\n// import BigNumber from \"bignumber.js\";\nimport { SOLANA_PAY_PROTOCOL } from \"./constants.js\";\n\n/**\n * A Solana Pay transaction request URL\n */\nexport interface SolanaPayTransactionRequestURL {\n  /** `link` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#link) */\n  link: URL;\n  /** `label` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#label-1) */\n  label?: string;\n  /** `message` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#message-1) */\n  message?: string;\n}\n\n/**\n * A Solana Pay transfer request URL\n */\nexport interface SolanaPayTransferRequestURL {\n  /** `recipient` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#recipient) */\n  recipient: Address;\n  /** `amount` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#amount) */\n  amount?: number;\n  /** `spl-token` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#spl-token) */\n  splToken: Address | undefined;\n  /** `reference` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#reference) */\n  reference?: Address[];\n  /** `label` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#label) */\n  label?: string;\n  /** `message` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#message) */\n  message?: string;\n  /** `memo` in the [Solana Pay spec](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#memo) */\n  memo?: string;\n}\n\n/**\n * Thrown when a URL can't be parsed as a Solana Pay URL\n */\nexport class SolanaPayParseURLError extends Error {\n  name = \"SolanaPayParseURLError\";\n}\n\n/**\n * Parse a Solana Pay URL as a Transfer Request or Transaction Request\n *\n * @param url - URL to parse\n *\n * @throws {SolanaPayParseURLError}\n */\nexport function parseSolanaPayURL(url: string | URL): SolanaPayTransactionRequestURL | SolanaPayTransferRequestURL {\n  if (typeof url === \"string\") {\n    if (url.length > 2048) throw new SolanaPayParseURLError(\"length invalid\");\n    url = new URL(url);\n  }\n\n  if (url.protocol !== SOLANA_PAY_PROTOCOL) throw new SolanaPayParseURLError(\"protocol invalid\");\n  if (!url.pathname) throw new SolanaPayParseURLError(\"missing pathname\");\n\n  return /[:%]/.test(url.pathname) ? parseTransactionRequestURL(url) : parseTransferRequestURL(url);\n}\n\nfunction parseTransactionRequestURL({ pathname, searchParams }: URL): SolanaPayTransactionRequestURL {\n  const link = new URL(decodeURIComponent(pathname));\n  if (link.protocol !== \"https:\") throw new SolanaPayParseURLError(\"link invalid\");\n\n  const label = searchParams.get(\"label\") || undefined;\n  const message = searchParams.get(\"message\") || undefined;\n\n  return {\n    link,\n    label,\n    message,\n  };\n}\n\nfunction parseTransferRequestURL({ pathname, searchParams }: URL): SolanaPayTransferRequestURL {\n  let recipient: Address;\n  try {\n    recipient = address(pathname);\n  } catch (error: any) {\n    throw new SolanaPayParseURLError(\"recipient invalid\");\n  }\n\n  let amount: number | undefined;\n  const amountParam = searchParams.get(\"amount\");\n  if (amountParam != null) {\n    if (!/^\\d+(\\.\\d+)?$/.test(amountParam)) throw new SolanaPayParseURLError(\"amount invalid\");\n\n    try {\n      amount = parseFloat(amountParam);\n    } catch (err) {\n      throw new SolanaPayParseURLError(\"amount invalid\");\n    }\n    if (!amount) throw new SolanaPayParseURLError(\"amount invalid\");\n    if (Number.isNaN(amount)) throw new SolanaPayParseURLError(\"amount NaN\");\n    if (amount < 0) throw new SolanaPayParseURLError(\"amount negative\");\n    // 0 is a valid `amount`\n  }\n\n  let splToken: Address | undefined;\n  const splTokenParam = searchParams.get(\"spl-token\");\n  if (splTokenParam != null) {\n    try {\n      splToken = address(splTokenParam);\n    } catch (error) {\n      throw new SolanaPayParseURLError(\"spl-token invalid\");\n    }\n  }\n\n  let reference: Address[] | undefined;\n  const referenceParams = searchParams.getAll(\"reference\");\n  if (referenceParams.length) {\n    try {\n      reference = referenceParams.map((reference) => address(reference));\n    } catch (error) {\n      throw new SolanaPayParseURLError(\"reference invalid\");\n    }\n  }\n\n  const label = searchParams.get(\"label\") || undefined;\n  const message = searchParams.get(\"message\") || undefined;\n  const memo = searchParams.get(\"memo\") || undefined;\n\n  return {\n    recipient,\n    amount,\n    splToken,\n    reference,\n    label,\n    message,\n    memo,\n  };\n}\n"
  },
  {
    "path": "packages/solana-pay/src/request.ts",
    "content": "import { Address } from \"gill\";\n\nexport interface SolanaPayTransactionRequestGetRequest {\n  // get request takes not data\n}\n\nexport interface SolanaPayTransactionRequestPostRequest {\n  account: Address;\n}\n\nexport function validateSolanaPayRequestUrl(url: URL): void {\n  if (url.protocol !== \"https:\") {\n    throw new Error(\"URL must use HTTPS protocol\");\n  }\n}\n"
  },
  {
    "path": "packages/solana-pay/src/response.ts",
    "content": "import { transactionFromBase64, type Transaction } from \"gill\";\n\nexport class SolanaPayResponseError extends Error {\n  name = \"SolanaPayResponseError\";\n}\n\nexport interface SolanaPayTransactionRequestGetResponse {\n  label: string;\n  icon: string;\n}\n\nexport interface SolanaPayTransactionRequestPostResponse {\n  transaction: string;\n  message?: string;\n}\n\nexport interface SolanaPayTransactionRequestGetResponseParsed {\n  label: string;\n  icon: URL;\n}\n\nexport interface SolanaPayTransactionRequestPostResponseParsed {\n  transaction: Transaction;\n  message?: string;\n}\n\n/**\n * Parse provided input to be a valid Solana Pay Transaction Request's\n * [GET response](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md#get-response)\n * per the spec\n */\nexport function parseSolanaPayGetResponse(data: any): SolanaPayTransactionRequestGetResponseParsed {\n  if (!data.label || typeof data.label !== \"string\") {\n    throw new SolanaPayResponseError(\"Invalid response: missing or invalid label\");\n  }\n\n  if (!data.icon || typeof data.icon !== \"string\") {\n    throw new SolanaPayResponseError(\"Invalid response: missing or invalid icon\");\n  }\n\n  let iconUrl: URL;\n  try {\n    iconUrl = new URL(data.icon);\n  } catch {\n    throw new SolanaPayResponseError(\"Invalid icon URL format\");\n  }\n\n  if (iconUrl.protocol !== \"http:\" && iconUrl.protocol !== \"https:\") {\n    throw new SolanaPayResponseError(\"Icon URL must use HTTP or HTTPS protocol\");\n  }\n\n  // jpg is not in the v1.1 spec, but they should be :)\n  const allowedExtensions = [\".svg\", \".png\", \".webp\", \".jpg\", \".jpeg\"];\n  const hasValidExtension = allowedExtensions.some((ext) => iconUrl.pathname.toLowerCase().endsWith(ext));\n\n  if (!hasValidExtension) {\n    throw new SolanaPayResponseError(\"Icon must be SVG, PNG, WebP, or JPEG format\");\n  }\n\n  return {\n    label: data.label,\n    icon: iconUrl,\n  };\n}\n\n/**\n * Parse provided input to be a valid Solana Pay Transaction Request's\n * [POST response](https://github.com/solana-foundation/solana-pay/blob/master/SPEC.md#post-response)\n * per the spec\n */\nexport function parseSolanaPayPostResponse(data: any): SolanaPayTransactionRequestPostResponseParsed {\n  if (!data.transaction || typeof data.transaction !== \"string\") {\n    throw new SolanaPayResponseError(\"Invalid response: missing or invalid transaction\");\n  }\n\n  if (data.message && typeof data.message !== \"string\") {\n    throw new SolanaPayResponseError(\"Invalid response: message must be string\");\n  }\n\n  let transaction: Transaction | null = null;\n\n  try {\n    transaction = transactionFromBase64(data.transaction);\n  } catch {\n    throw new SolanaPayResponseError(\"Invalid transaction data as base64\");\n  }\n\n  return {\n    transaction,\n    message: data.message,\n  };\n}\n"
  },
  {
    "path": "packages/solana-pay/tsconfig.declarations.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"include\": [\"src/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/solana-pay/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"solana-pay\",\n  \"extends\": \"../tsconfig/base.json\",\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "packages/solana-pay/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"../build-scripts/getBaseConfig\";\n\nexport default defineConfig((options = {}) => [\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"native\", [\"esm\"], options),\n]);\n"
  },
  {
    "path": "packages/solana-pay/typedoc.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"extends\": [\"../../typedoc.json\"],\n  \"entryPoints\": [\"src/index.ts\"],\n  \"out\": \"./.docs\"\n}\n"
  },
  {
    "path": "packages/svelte/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "packages/svelte/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/svelte/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/svelte/README.md",
    "content": "# @gillsdk/svelte\n"
  },
  {
    "path": "packages/svelte/eslint.config.mjs",
    "content": "import config from \"@gillsdk/config-eslint/base\";\n\nexport default config;\n"
  },
  {
    "path": "packages/svelte/package.json",
    "content": "{\n  \"name\": \"@gillsdk/svelte\",\n  \"license\": \"MIT\",\n  \"version\": \"0.0.1\",\n  \"description\": \"\",\n  \"scripts\": {\n    \"clean\": \"rimraf coverage dist build node_modules .turbo\",\n    \"compile:js\": \"tsup --config ./tsup.config.package.ts\",\n    \"compile:typedefs\": \"tsc -p ./tsconfig.declarations.json\",\n    \"prepublishOnly\": \"pnpm pkg delete devDependencies\",\n    \"publish-impl\": \"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \\\"$PUBLISH_TAG\\\" != \\\"canary\\\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))\",\n    \"publish-packages\": \"true\",\n    \"test:typecheck\": \"tsc --noEmit\",\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.node.ts --rootDir . --silent\",\n    \"test:unit:browser\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.browser.ts --rootDir . --silent\",\n    \"test:treeshakability:browser\": \"agadoo dist/index.browser.mjs\",\n    \"test:treeshakability:node\": \"agadoo dist/index.node.mjs\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\",\n    \"lint\": \"eslint src\",\n    \"lint:fix\": \"eslint --fix src\"\n  },\n  \"exports\": {\n    \"types\": \"./dist/index.d.ts\",\n    \"edge-light\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"workerd\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"browser\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.browser.mjs\",\n      \"require\": \"./dist/index.browser.cjs\"\n    },\n    \"node\": {\n      \"types\": \"./dist/node/index.d.ts\",\n      \"import\": \"./dist/node/index.node.mjs\",\n      \"require\": \"./dist/node/index.node.cjs\"\n    }\n  },\n  \"browser\": {\n    \"./dist/index.node.cjs\": \"./dist/index.browser.cjs\",\n    \"./dist/index.node.mjs\": \"./dist/index.browser.mjs\"\n  },\n  \"main\": \"./dist/index.node.cjs\",\n  \"module\": \"./dist/index.node.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"type\": \"commonjs\",\n  \"files\": [\n    \"./dist/\"\n  ],\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"blockchain\",\n    \"solana\",\n    \"web3\"\n  ],\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"browserslist\": [\n    \"supports bigint and not dead\",\n    \"maintained node versions\"\n  ],\n  \"devDependencies\": {\n    \"@gillsdk/config-eslint\": \"workspace:*\"\n  },\n  \"peerDependencies\": {\n    \"gill\": \"workspace:*\",\n    \"typescript\": \">=5\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/svelte/src/__tests__/placeholder.ts",
    "content": "// import assert from \"node:assert\";\n\ndescribe(\"placeholder\", () => {\n  test(\"this is a placeholder test to satisfy github actions\", () => {});\n});\n"
  },
  {
    "path": "packages/svelte/src/const.ts",
    "content": ""
  },
  {
    "path": "packages/svelte/src/index.ts",
    "content": ""
  },
  {
    "path": "packages/svelte/src/types/global.d.ts",
    "content": "declare const __BROWSER__: boolean;\ndeclare const __DEV__: boolean;\ndeclare const __NODEJS__: boolean;\ndeclare const __REACTNATIVE__: boolean;\n"
  },
  {
    "path": "packages/svelte/src/types/index.ts",
    "content": ""
  },
  {
    "path": "packages/svelte/tsconfig.declarations.json",
    "content": "{\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"src/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/svelte/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"@gillsdk/svelte\",\n  \"extends\": \"../tsconfig/base.json\",\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "packages/svelte/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"../build-scripts/getBaseConfig\";\n\nexport default defineConfig((options = {}) => [\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n]);\n"
  },
  {
    "path": "packages/test-config/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/test-config/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/test-config/browser-environment.ts",
    "content": "import { TestEnvironment } from \"jest-environment-jsdom\";\n\nexport default class BrowserEnvironment extends TestEnvironment {\n  async setup() {\n    await super.setup();\n    /**\n     * Here we inject Node's `Uint8Array` as a global so that `instanceof` checks inside\n     * `SubtleCrypto.digest()` work with `Uint8Array#buffer`. Read more here:\n     * https://github.com/jestjs/jest/issues/7780#issuecomment-615890410\n     */\n    this.global.Uint8Array = globalThis.Uint8Array;\n  }\n}\n"
  },
  {
    "path": "packages/test-config/global.d.ts",
    "content": "declare namespace globalThis {\n  // eslint-disable-next-line no-var\n  var __DEV__: boolean;\n  // eslint-disable-next-line no-var\n  var __VERSION__: string;\n}\n"
  },
  {
    "path": "packages/test-config/jest-dev.config.ts",
    "content": "import type { Config } from \"jest\";\nimport path from \"path\";\n\nconst config: Config = {\n  projects: [\n    path.resolve(__dirname, \"jest-lint.config.ts\"),\n    path.resolve(__dirname, \"jest-prettier.config.ts\"),\n    path.resolve(__dirname, \"jest-unit.config.browser.ts\"),\n    path.resolve(__dirname, \"jest-unit.config.node.ts\"),\n  ],\n  watchPlugins: [\n    \"jest-watch-master\",\n    \"jest-watch-select-projects\",\n    \"jest-watch-typeahead/filename\",\n    \"jest-watch-typeahead/testname\",\n  ],\n  workerThreads: true,\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/jest-lint.config.ts",
    "content": "import type { Config } from \"@jest/types\";\n\nconst config: Partial<Config.InitialProjectOptions> = {\n  displayName: {\n    color: \"cyanBright\",\n    name: \"ESLint\",\n  },\n  runner: \"eslint\",\n  testMatch: [\"<rootDir>src/**/*.ts\"],\n  testPathIgnorePatterns: [\"README.md\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/jest-prettier.config.ts",
    "content": "import type { Config } from \"@jest/types\";\n\nconst config: Partial<Config.InitialProjectOptions> = {\n  displayName: {\n    color: \"magentaBright\",\n    name: \"Prettier\",\n  },\n  moduleFileExtensions: [\"js\", \"ts\", \"json\", \"md\"],\n  runner: \"prettier\",\n  testMatch: [\"<rootDir>/src/**\", \"<rootDir>*\"],\n  testPathIgnorePatterns: [\"README.md\", \"CHANGELOG.md\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/jest-unit.config.browser.ts",
    "content": "import type { Config } from \"@jest/types\";\nimport path from \"path\";\n\nimport commonConfig from \"./jest-unit.config.common\";\n\nconst config: Partial<Config.InitialProjectOptions> = {\n  ...commonConfig,\n  displayName: {\n    color: \"grey\",\n    name: \"Unit Test (Browser)\",\n  },\n  globals: {\n    ...commonConfig.globals,\n    __BROWSER__: true,\n    __NODEJS__: false,\n    __REACTNATIVE__: false,\n  },\n  setupFilesAfterEnv: [\n    ...(commonConfig.setupFilesAfterEnv ?? []),\n    path.resolve(__dirname, \"setup-secure-context.ts\"),\n    path.resolve(__dirname, \"setup-text-encoder.ts\"),\n    path.resolve(__dirname, \"setup-web-buffer-global.ts\"),\n    path.resolve(__dirname, \"setup-whatwg-fetch.ts\"),\n  ],\n  testEnvironment: path.resolve(__dirname, \"browser-environment.ts\"),\n  testEnvironmentOptions: {},\n  testPathIgnorePatterns: [...(commonConfig.testPathIgnorePatterns ?? []), \"-test.node.ts$\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/jest-unit.config.common.ts",
    "content": "import { Config } from \"@jest/types\";\nimport path from \"path\";\n\nconst config: Partial<Config.InitialProjectOptions> = {\n  resetMocks: true,\n  restoreMocks: true,\n  roots: [\"<rootDir>/src/\"],\n  setupFilesAfterEnv: [\n    path.resolve(__dirname, \"setup-dev-mode.ts\"),\n    path.resolve(__dirname, \"setup-define-version-constant.ts\"),\n    path.resolve(__dirname, \"setup-webcrypto.ts\"),\n  ],\n  coveragePathIgnorePatterns: [\n    // comment for better diffs\n    \"node_modules\",\n    \".turbo\",\n    \".next\",\n    \".*generated.*\",\n    \".*reexports|index.ts\",\n  ],\n  testPathIgnorePatterns: [\"__setup__.ts\"],\n  moduleNameMapper: {\n    // Handle .js imports to .ts files for ESM compatibility\n    \"^(\\\\.{1,2}/.*)\\\\.js$\": \"$1\",\n  },\n  transform: {\n    \"^.+\\\\.(ts|js)x?$\": [\n      \"@swc/jest\",\n      {\n        jsc: {\n          target: \"es2020\",\n        },\n      },\n    ],\n  },\n  transformIgnorePatterns: [\"/node_modules/(?!.*\\\\@noble/ed25519/)\", \"\\\\.pnp\\\\.[^\\\\/]+$\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/jest-unit.config.node.ts",
    "content": "import path from \"node:path\";\n\nimport { Config } from \"@jest/types\";\n\nimport commonConfig from \"./jest-unit.config.common\";\n\nconst config: Partial<Config.InitialProjectOptions> = {\n  ...commonConfig,\n  displayName: {\n    color: \"grey\",\n    name: \"Unit Test (Node)\",\n  },\n  globals: {\n    ...commonConfig.globals,\n    __BROWSER__: false,\n    __NODEJS__: true,\n    __REACTNATIVE__: false,\n  },\n  setupFilesAfterEnv: [\n    ...(commonConfig.setupFilesAfterEnv ?? []),\n    path.resolve(__dirname, \"setup-undici-fetch.ts\"),\n  ],\n  testPathIgnorePatterns: [...(commonConfig.testPathIgnorePatterns ?? []), \"-test.browser.ts$\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/test-config/package.json",
    "content": "{\n  \"name\": \"@gillsdk/test-config\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"files\": [\n    \"test-validator-setup.js\",\n    \"test-validator-teardown.js\"\n  ],\n  \"peerDependencies\": {\n    \"jest-dev-server\": \"^10.0.0\",\n    \"undici\": \"^6.21.0\",\n    \"whatwg-fetch\": \"^3.6.20\"\n  },\n  \"devDependencies\": {\n    \"@jest/types\": \"^29.6.3\",\n    \"undici\": \"^6.21.0\",\n    \"whatwg-fetch\": \"^3.6.20\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/test-config/setup-define-version-constant.ts",
    "content": "beforeEach(() => {\n  globalThis.__VERSION__ = \"0.0.0-test\";\n});\n"
  },
  {
    "path": "packages/test-config/setup-dev-mode.ts",
    "content": "globalThis.__DEV__ = false;\nbeforeEach(() => {\n  globalThis.__DEV__ = false;\n});\n"
  },
  {
    "path": "packages/test-config/setup-secure-context.ts",
    "content": "globalThis.isSecureContext = true;\nbeforeEach(() => {\n  globalThis.isSecureContext = true;\n});\n"
  },
  {
    "path": "packages/test-config/setup-text-encoder.ts",
    "content": "import { TextDecoder, TextEncoder } from \"util\";\n\nif (typeof globalThis.TextEncoder === \"undefined\") {\n  globalThis.TextEncoder = TextEncoder;\n}\n\nif (typeof globalThis.TextDecoder === \"undefined\") {\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore\n  globalThis.TextDecoder = TextDecoder;\n}\n"
  },
  {
    "path": "packages/test-config/setup-undici-fetch.ts",
    "content": "import { fetch as undiciFetch } from \"undici\";\n\nglobalThis.fetch = undiciFetch as unknown as typeof globalThis.fetch;\n"
  },
  {
    "path": "packages/test-config/setup-web-buffer-global.ts",
    "content": "/**\n * Browsers don't have a `Buffer` global, so delete it now.\n */\nbeforeEach(() => {\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore\n  delete globalThis.Buffer;\n});\n"
  },
  {
    "path": "packages/test-config/setup-webcrypto.ts",
    "content": "import crypto from \"node:crypto\";\n\nif (typeof globalThis.crypto === \"undefined\") {\n  Object.defineProperty(globalThis, \"crypto\", {\n    value: crypto.webcrypto,\n    writable: true, // Allow tests to delete it.\n  });\n}\nif (typeof globalThis.crypto.subtle === \"undefined\") {\n  Object.defineProperty(globalThis.crypto, \"subtle\", {\n    value: crypto.webcrypto.subtle,\n  });\n}\n"
  },
  {
    "path": "packages/test-config/setup-whatwg-fetch.ts",
    "content": "import \"whatwg-fetch\";\n"
  },
  {
    "path": "packages/test-config/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"Test Config\",\n  \"extends\": \"../tsconfig/base.json\"\n}\n"
  },
  {
    "path": "packages/tsconfig/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/tsconfig/README.md",
    "content": "# `tsconfig`\n\nThese are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.\n"
  },
  {
    "path": "packages/tsconfig/base.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"Default\",\n  \"compilerOptions\": {\n    \"composite\": false,\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"inlineSources\": false,\n    \"isolatedModules\": true,\n    \"module\": \"node16\",\n    \"moduleResolution\": \"node16\",\n    \"noFallthroughCasesInSwitch\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"preserveWatchOutput\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"target\": \"ESNext\",\n    \"useDefineForClassFields\": true\n  },\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/tsconfig/package.json",
    "content": "{\n  \"name\": \"@gillsdk/tsconfig\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"files\": [\n    \"base.json\"\n  ],\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/vue/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "packages/vue/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/vue/.prettierignore",
    "content": "node_modules\npnpm-lock.yaml\n\nLICENSE\n.changeset/\n.github/PULL_REQUEST_TEMPLATE.md\n\ndeclarations/\ndist/\ndoc/\nlib/\nkit/\n\n.docs\n.turbo\n.next\n.vercel\n\n**/generated/\n**/generated/**\ngenerated/\ngenerated/**\n"
  },
  {
    "path": "packages/vue/README.md",
    "content": "# @gillsdk/vue\n"
  },
  {
    "path": "packages/vue/eslint.config.mjs",
    "content": "import config from \"@gillsdk/config-eslint/base\";\n\nexport default config;\n"
  },
  {
    "path": "packages/vue/package.json",
    "content": "{\n  \"name\": \"@gillsdk/vue\",\n  \"license\": \"MIT\",\n  \"version\": \"0.0.1\",\n  \"description\": \"\",\n  \"scripts\": {\n    \"clean\": \"rimraf coverage dist build node_modules .turbo\",\n    \"compile:js\": \"tsup --config ./tsup.config.package.ts\",\n    \"compile:typedefs\": \"tsc -p ./tsconfig.declarations.json\",\n    \"prepublishOnly\": \"pnpm pkg delete devDependencies\",\n    \"publish-impl\": \"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \\\"$PUBLISH_TAG\\\" != \\\"canary\\\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))\",\n    \"publish-packages\": \"true\",\n    \"test:typecheck\": \"tsc --noEmit\",\n    \"test:unit:node\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.node.ts --rootDir . --silent\",\n    \"test:unit:browser\": \"TERM_OVERRIDE=\\\"${TURBO_HASH:+dumb}\\\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../packages/test-config/jest-unit.config.browser.ts --rootDir . --silent\",\n    \"test:treeshakability:browser\": \"agadoo dist/index.browser.mjs\",\n    \"test:treeshakability:node\": \"agadoo dist/index.node.mjs\",\n    \"style:check\": \"prettier --check '{*,**/*}.{ts,tsx,js,jsx,css,json,md,mdx}'\",\n    \"style:fix\": \"pnpm style:check --write\",\n    \"lint\": \"eslint src\",\n    \"lint:fix\": \"eslint --fix src\"\n  },\n  \"exports\": {\n    \"types\": \"./dist/index.d.ts\",\n    \"edge-light\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"workerd\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.node.mjs\",\n      \"require\": \"./dist/index.node.cjs\"\n    },\n    \"browser\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.browser.mjs\",\n      \"require\": \"./dist/index.browser.cjs\"\n    },\n    \"node\": {\n      \"types\": \"./dist/node/index.d.ts\",\n      \"import\": \"./dist/node/index.node.mjs\",\n      \"require\": \"./dist/node/index.node.cjs\"\n    }\n  },\n  \"browser\": {\n    \"./dist/index.node.cjs\": \"./dist/index.browser.cjs\",\n    \"./dist/index.node.mjs\": \"./dist/index.browser.mjs\"\n  },\n  \"main\": \"./dist/index.node.cjs\",\n  \"module\": \"./dist/index.node.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"type\": \"commonjs\",\n  \"files\": [\n    \"./dist/\"\n  ],\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"blockchain\",\n    \"solana\",\n    \"web3\"\n  ],\n  \"author\": \"Nick Frostbutter <maintainers@gillsdk.com>\",\n  \"homepage\": \"https://gillsdk.com\",\n  \"bugs\": {\n    \"url\": \"https://github.com/gillsdk/gill/issues\"\n  },\n  \"browserslist\": [\n    \"supports bigint and not dead\",\n    \"maintained node versions\"\n  ],\n  \"devDependencies\": {\n    \"@gillsdk/config-eslint\": \"workspace:*\"\n  },\n  \"peerDependencies\": {\n    \"gill\": \"workspace:*\",\n    \"typescript\": \">=5\"\n  },\n  \"engines\": {\n    \"node\": \">=20.18.0\"\n  }\n}\n"
  },
  {
    "path": "packages/vue/src/__tests__/placeholder.ts",
    "content": "// import assert from \"node:assert\";\n\ndescribe(\"placeholder\", () => {\n  test(\"this is a placeholder test to satisfy github actions\", () => {});\n});\n"
  },
  {
    "path": "packages/vue/src/const.ts",
    "content": ""
  },
  {
    "path": "packages/vue/src/index.ts",
    "content": ""
  },
  {
    "path": "packages/vue/src/types/global.d.ts",
    "content": "declare const __BROWSER__: boolean;\ndeclare const __DEV__: boolean;\ndeclare const __NODEJS__: boolean;\ndeclare const __REACTNATIVE__: boolean;\n"
  },
  {
    "path": "packages/vue/src/types/index.ts",
    "content": ""
  },
  {
    "path": "packages/vue/tsconfig.declarations.json",
    "content": "{\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"emitDeclarationOnly\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"src/index.ts\", \"src/types\"]\n}\n"
  },
  {
    "path": "packages/vue/tsconfig.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"@gillsdk/vue\",\n  \"extends\": \"../tsconfig/base.json\",\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "packages/vue/tsup.config.package.ts",
    "content": "import { defineConfig } from \"tsup\";\n\nimport { getBaseConfig } from \"../build-scripts/getBaseConfig\";\n\nexport default defineConfig((options = {}) => [\n  ...getBaseConfig(\"node\", [\"cjs\", \"esm\"], options),\n  ...getBaseConfig(\"browser\", [\"cjs\", \"esm\"], options),\n]);\n"
  },
  {
    "path": "pnpm-workspace.yaml",
    "content": "packages:\n  - \"examples/*\"\n  - \"scripts\"\n  - \"e2e/*\"\n  - \"packages/*\"\n  - \"!docs\"\n"
  },
  {
    "path": "turbo.json",
    "content": "{\n  \"$schema\": \"https://turbo.build/schema.json\",\n  \"remoteCache\": {\n    \"signature\": true\n  },\n  \"tasks\": {\n    \"clean\": {\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"*\"],\n      \"outputs\": [\"*\"]\n    },\n    \"build\": {\n      \"dependsOn\": [\"compile:js\", \"compile:typedefs\"],\n      \"outputs\": [\"dist/**\"]\n    },\n    \"test\": {\n      \"dependsOn\": [\"build\", \"test:typecheck\", \"test:unit:browser\", \"test:unit:node\"],\n      \"outputs\": [\"dist/**\"]\n    },\n    \"coverage\": {\n      \"cache\": false\n    },\n    \"coverage:open\": {\n      \"dependsOn\": [\"coverage\"],\n      \"cache\": false\n    },\n    \"publish-packages\": {\n      \"cache\": false,\n      \"dependsOn\": [\"build\", \"test\"],\n      \"passThroughEnv\": [\"GH_TOKEN\", \"NPM_TOKEN\", \"PUBLISH_TAG\"]\n    },\n    \"compile:docs\": {\n      \"dependsOn\": [\"^compile:typedefs\"],\n      \"inputs\": [\n        \"$TURBO_DEFAULT$\",\n        \"tsconfig.*\",\n        \"$TURBO_ROOT$/typedoc.json\",\n        \"$TURBO_ROOT$/typedoc.plugin.mjs\",\n        \"src/**\"\n      ],\n      \"outputs\": [\".docs/**\"]\n    },\n    \"compile:js\": {\n      \"dependsOn\": [\"^compile:js\"],\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"tsconfig.*\", \"src/**\", \"../build-scripts/*.ts\"],\n      \"outputs\": [\"dist/**\"]\n    },\n    \"compile:typedefs\": {\n      \"dependsOn\": [\"^compile:typedefs\"],\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"tsconfig.*\", \"src/**\"],\n      \"outputs\": [\"dist/**/*.d.ts\"]\n    },\n    \"style:check\": {\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"*\"],\n      \"outputs\": [\"*\"]\n    },\n    \"style:fix\": {\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"*\"],\n      \"outputs\": [\"*\"]\n    },\n    \"lint\": {\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"src/**/*\", \"eslint.config.*\"],\n      \"outputs\": []\n    },\n    \"lint:fix\": {\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"src/**/*\", \"eslint.config.*\"],\n      \"outputs\": []\n    },\n    \"test:typecheck\": {\n      \"dependsOn\": [\"^compile:typedefs\"],\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"tsconfig.*\", \"src/**\"],\n      \"outputs\": []\n    },\n    \"test:unit:browser\": {\n      \"dependsOn\": [\"^compile:js\"],\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"src/**\"],\n      \"outputs\": []\n    },\n    \"test:unit:node\": {\n      \"dependsOn\": [\"^compile:js\"],\n      \"inputs\": [\"$TURBO_DEFAULT$\", \"src/**\"],\n      \"outputs\": []\n    },\n    \"test:treeshakability:browser\": {\n      \"dependsOn\": [\"compile:js\"]\n    },\n    \"test:treeshakability:native\": {\n      \"dependsOn\": [\"compile:js\"]\n    },\n    \"test:treeshakability:node\": {\n      \"dependsOn\": [\"compile:js\"]\n    }\n  },\n  \"ui\": \"stream\"\n}\n"
  },
  {
    "path": "typedoc.json",
    "content": "{\n  \"$schema\": \"https://typedoc.org/schema.json\",\n  \"out\": \"docs/content/api\",\n  \"plugin\": [\"typedoc-plugin-markdown\", \"typedoc-plugin-frontmatter\", \"./typedoc.plugin.mjs\"],\n  \"excludeExternals\": true,\n  \"disableSources\": true,\n  \"readme\": \"none\",\n  \"hidePageHeader\": true,\n  \"hideBreadcrumbs\": true,\n  \"hideGroupHeadings\": true,\n  \"hidePageTitle\": true,\n  \"expandObjects\": true,\n  \"expandParameters\": false,\n  \"blockTagsPreserveOrder\": [\"@example\", \"@deprecated\"],\n  \"useCodeBlocks\": true,\n  \"indexFormat\": \"table\",\n  \"parametersFormat\": \"table\",\n  \"classPropertiesFormat\": \"table\",\n  \"enumMembersFormat\": \"table\",\n  \"typeDeclarationFormat\": \"table\",\n  \"propertyMembersFormat\": \"table\",\n  \"interfacePropertiesFormat\": \"table\",\n  \"fileExtension\": \".mdx\",\n  \"entryFileName\": \"index\"\n}\n"
  },
  {
    "path": "typedoc.plugin.mjs",
    "content": "// @ts-check\nimport { dirname, resolve } from \"node:path\";\nimport { cwd } from \"node:process\";\nimport * as td from \"typedoc-plugin-markdown\";\n\nimport { typedocPageIndexData } from \"./docs/typedoc-data.mjs\";\n\n// Extract the package directory name to be used as the part of the markdown links\nlet dirs = cwd().split(\"/packages/\");\n\n/** @param {td.MarkdownApplication} app */\nexport function load(app) {\n  // For multi-export packages, put each docs into a different directory\n  if (!app.options.getValue(\"out\").endsWith(\"/.docs\")) {\n    // console.warn(\"[app]\", app.options.getValue(\"out\"));\n    dirs = app.options.getValue(\"out\").split(\"/.docs/\");\n  }\n\n  const apiDirName = dirs[dirs.length - 1];\n\n  // Set Markdown frontmatter for each page\n  app.renderer.on(td.MarkdownPageEvent.BEGIN, (page) => {\n    page.frontmatter = {\n      title: page.model.name,\n    };\n\n    // Slice in the index data (when desired)\n    if (page.url == \"index.mdx\" && typedocPageIndexData[apiDirName]?.frontmatter) {\n      page.frontmatter = {\n        ...page.frontmatter,\n        ...typedocPageIndexData[apiDirName].frontmatter,\n      };\n    }\n  });\n\n  // Rewrite all of the internal links\n  // - root relative for compatibility with Next.js\n  // - strip the .mdx extension\n  app.renderer.on(td.MarkdownPageEvent.END, (page) => {\n    if (!page.contents) return;\n\n    // Slice in the index data (when desired)\n    if (page.url == \"index.mdx\" && typedocPageIndexData[apiDirName]?.contents) {\n      page.contents = insertAfterFrontmatter(page.contents, typedocPageIndexData[apiDirName].contents);\n    }\n\n    page.contents = page.contents.replace(/\\(((?:[^\\/\\)]+\\/)*[^\\/\\)]+)\\.mdx\\)/gm, (_, path) => {\n      // Remove trailing /index routes\n      if (path.endsWith(\"/index\")) path = path.replace(/\\/index$/gi, \"\");\n\n      const rootRelativeUrl = resolve(`/api/${apiDirName}`, dirname(page.url), path);\n      return `(${rootRelativeUrl})`;\n    });\n  });\n}\n\nfunction insertAfterFrontmatter(markdownText, textToInsert) {\n  if (!markdownText.startsWith(\"---\")) {\n    return textToInsert + markdownText;\n  }\n\n  const secondDelimiter = markdownText.indexOf(\"\\n---\\n\", 4);\n  if (secondDelimiter === -1) {\n    return textToInsert + markdownText;\n  }\n\n  const frontmatter = markdownText.substring(0, secondDelimiter + 5);\n  const content = markdownText.substring(secondDelimiter + 5);\n\n  return frontmatter + `\\n${textToInsert}\\n` + content;\n}\n"
  }
]