diff --git a/.github/ISSUE_TEMPLATE/0_bug.md b/.github/ISSUE_TEMPLATE/0_bug.md new file mode 100644 index 000000000000..f1e7984cf2b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/0_bug.md @@ -0,0 +1,39 @@ +--- +name: Report a Bug +about: Help us reproduce a bug you've found so that we can fix it +title: '' +labels: ['bug'] +assignees: '' +--- + + + + + +## Overview + + + +## Steps to reproduce + + + +## Description of bug + + diff --git a/.github/ISSUE_TEMPLATE/1_feature.md b/.github/ISSUE_TEMPLATE/1_feature.md new file mode 100644 index 000000000000..7ebf223091e1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_feature.md @@ -0,0 +1,37 @@ +--- +name: Suggest a Feature +about: Propose an idea for how to make this library better. +title: '' +labels: ['enhancement'] +assignees: '' +--- + + + + + +## Motivation + + + +## Example use case + + + +## Details + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..d061b0bc53df --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - about: 'Have a question about using this software, or about Solana in general? Post it on the Solana Stack Exchange.' + name: Ask a Question + url: 'https://solana.stackexchange.com/questions/ask' + - about: 'Start or join a discussion on the Solana Tech Discord.' + name: Start a Discussion + url: 'https://solana.com/discord' diff --git a/.github/workflows/PULL_REQUEST_TEMPLATE.md b/.github/workflows/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..e798ebfba222 --- /dev/null +++ b/.github/workflows/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +#### Problem + +#### Summary of Changes + +Fixes # diff --git a/.github/workflows/actions/compile-gh-pages/action.yml b/.github/workflows/actions/compile-gh-pages/action.yml index d2394bc90935..9fab2bba7de1 100644 --- a/.github/workflows/actions/compile-gh-pages/action.yml +++ b/.github/workflows/actions/compile-gh-pages/action.yml @@ -9,10 +9,16 @@ runs: run: pnpm compile:docs - name: Assemble Deploy Directory + shell: bash + run: | + mkdir -p .ghpages-deploy + cp -r ./doc/* .ghpages-deploy + + - name: Assemble Deploy Versioned Subdirectory shell: bash run: | mkdir -p .ghpages-deploy/v1.x - mv ./doc/* .ghpages-deploy/v1.x + cp -r ./doc/* .ghpages-deploy/v1.x - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/autolock-inactive-threads.yml b/.github/workflows/autolock-inactive-threads.yml new file mode 100644 index 000000000000..d25a7acfeda5 --- /dev/null +++ b/.github/workflows/autolock-inactive-threads.yml @@ -0,0 +1,32 @@ +name: 'Lock inactive threads' + +on: + # Chosen to be just before London wakes up and way past San Francisco's bedtime. + schedule: + - cron: '0 8 * * 1-5' # This is in UTC. + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v4 + with: + github-token: ${{ github.token }} + issue-inactive-days: '7' + issue-lock-reason: 'resolved' + issue-comment: > + Because there has been no activity on this issue for 7 days since it was closed, it has + been automatically locked. Please open a new issue if it requires a follow up. + pr-inactive-days: '14' + pr-lock-reason: 'resolved' + pr-comment: > + Because there has been no activity on this PR for 14 days since it was merged, it has + been automatically locked. Please open a new issue if it requires a follow up. diff --git a/.github/workflows/label-actions.yml b/.github/workflows/label-actions.yml new file mode 100644 index 000000000000..45b36ac48543 --- /dev/null +++ b/.github/workflows/label-actions.yml @@ -0,0 +1,15 @@ +name: 'Issue Label Actions' + +on: + issues: + types: [labeled, unlabeled] + +permissions: + contents: read + issues: write + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/label-actions@v2 diff --git a/.github/workflows/manage-stale-threads.yml b/.github/workflows/manage-stale-threads.yml new file mode 100644 index 000000000000..ff802edc9d54 --- /dev/null +++ b/.github/workflows/manage-stale-threads.yml @@ -0,0 +1,39 @@ +name: 'Manage stale issues and PRs' +on: + # Chosen to be just before London wakes up and way past San Francisco's bedtime. + schedule: + - cron: '0 8 * * 1-5' # This is in UTC. + # Do a dry-run (debug-only: true) whenever this workflow itself is changed. + pull_request: + paths: + - .github/workflows/manage-stale-threads.yml + types: + - opened + - synchronize + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + ascending: true # Spend API operations budget on older, more-likely-to-get-closed issues first + close-issue-message: '' # Leave no comment when closing + close-pr-message: '' # Leave no comment when closing + days-before-issue-stale: 365 + days-before-pr-stale: 14 + days-before-close: 7 + debug-only: ${{ github.event_name == 'pull_request' }} # Dry-run when true. + exempt-all-milestones: true # Milestones can sometimes last a month, so exempt issues attached to a milestone. + exempt-issue-labels: blocked,do-not-close,feature-gate,security + exempt-pr-labels: blocked,do-not-close,feature-gate,security + # No actual changes get made in debug-only mode, so we can raise the operations ceiling. + operations-per-run: ${{ github.event_name == 'pull_request' && 1000 || 900}} + stale-issue-label: stale + stale-issue-message: '' # Leave no comment when marking as stale + stale-pr-label: stale + stale-pr-message: '' # Leave no comment when marking as stale diff --git a/.github/workflows/preview-gh-pages.yml b/.github/workflows/preview-gh-pages.yml new file mode 100644 index 000000000000..5958d382739b --- /dev/null +++ b/.github/workflows/preview-gh-pages.yml @@ -0,0 +1,84 @@ +name: Preview GitHub Pages + +on: + pull_request: + types: [synchronize, opened, reopened] + +env: + # Among other things, opts out of Turborepo telemetry + # See https://consoledonottrack.com/ + DO_NOT_TRACK: '1' + # Some tasks slow down considerably on GitHub Actions runners when concurrency is high + TURBO_CONCURRENCY: 1 + # Enables Turborepo Remote Caching. + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + +jobs: + compile-gh-pages: + runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: maintenance/v1.x + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Compile and Upload Artifacts + uses: ./.github/workflows/actions/compile-gh-pages + + preview: + runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + needs: [compile-gh-pages] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Download Deploy Directory from Artifact Cache + uses: actions/download-artifact@v4 + with: + path: .ghpages-deploy + pattern: ghpages-deploy-artifacts* + merge-multiple: true + + - name: Deploy to Preview Github Pages + uses: peaceiris/actions-gh-pages@v4 + with: + destination_dir: ${{ format('{0}/', github.event.pull_request.number) }} + external_repository: solana-labs/solana-web3.js-pr-preview + personal_token: ${{ secrets.PR_PREVIEW_REPO_CONTENTS_TOKEN }} + publish_dir: .ghpages-deploy + + - name: Find Existing Preview Link Comment + uses: peter-evans/find-comment@v3 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: + + - name: Create Preview Link Comment + uses: actions/github-script@v7 + if: steps.find-comment.outputs.comment-id == '' + with: + script: > + const prNumber = context.issue.number; + github.rest.issues.createComment({ + issue_number: prNumber, + owner: context.repo.owner, + repo: context.repo.repo, + body: [ + '', + 'A preview of the GitHub Pages site based on this PR is now available here:', + '', + `solana-labs.github.io/solana-web3.js-pr-preview/${prNumber}/`, + ].join('\n'), + }); diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml new file mode 100644 index 000000000000..d1a664715f3d --- /dev/null +++ b/.github/workflows/publish-gh-pages.yml @@ -0,0 +1,58 @@ +name: Publish GitHub Pages + +on: + workflow_dispatch: + branches: + - maintenance/* + push: + branches: + - maintenance/* + +env: + # Among other things, opts out of Turborepo telemetry + # See https://consoledonottrack.com/ + DO_NOT_TRACK: '1' + # Some tasks slow down considerably on GitHub Actions runners when concurrency is high + TURBO_CONCURRENCY: 1 + # Enables Turborepo Remote Caching. + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + +jobs: + compile-gh-pages: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: maintenance/v1.x + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Compile and Upload Artifacts + uses: ./.github/workflows/actions/compile-gh-pages + + publish: + runs-on: ubuntu-latest + needs: [compile-gh-pages] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Download Deploy Directory from Artifact Cache + uses: actions/download-artifact@v4 + with: + path: .ghpages-deploy + pattern: ghpages-deploy-artifacts* + merge-multiple: true + + - name: Deploy to Github Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: .ghpages-deploy diff --git a/README.md b/README.md index 4dc970a41a11..174c7a0efe15 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ [semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg [semantic-release-url]: https://github.com/semantic-release/semantic-release -> [!NOTE] This is the maintenance branch for the 1.x line of `@solana/web3.js`. The current development branch can be found [here](https://github.com/solana-labs/solana-web3.js). +> [!NOTE] +> This is the maintenance branch for the 1.x line of `@solana/web3.js`. You can find the successor to this library [here](https://l.anza.xyz/s/js-sdk-repo). # Solana JavaScript SDK (v1.x) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7a1d88ab36a..ea3a41021543 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,25 +80,25 @@ importers: version: 19.6.0 '@rollup/plugin-alias': specifier: ^5.1.1 - version: 5.1.1(rollup@4.28.0) + version: 5.1.1(rollup@4.28.1) '@rollup/plugin-babel': specifier: ^6.0.4 - version: 6.0.4(@babel/core@7.26.0)(@types/babel__core@7.20.1)(rollup@4.28.0) + version: 6.0.4(@babel/core@7.26.0)(@types/babel__core@7.20.1)(rollup@4.28.1) '@rollup/plugin-commonjs': specifier: ^28.0.0 - version: 28.0.1(rollup@4.28.0) + version: 28.0.1(rollup@4.28.1) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.28.0) + version: 6.1.0(rollup@4.28.1) '@rollup/plugin-node-resolve': specifier: ^15.3.0 - version: 15.3.0(rollup@4.28.0) + version: 15.3.0(rollup@4.28.1) '@rollup/plugin-replace': specifier: ^6.0.1 - version: 6.0.1(rollup@4.28.0) + version: 6.0.1(rollup@4.28.1) '@rollup/plugin-terser': specifier: ^0.4.4 - version: 0.4.4(rollup@4.28.0) + version: 0.4.4(rollup@4.28.1) '@types/bn.js': specifier: ^5.1.5 version: 5.1.6 @@ -158,7 +158,7 @@ importers: version: 10.5.0(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.1) + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2) esm: specifier: ^3.2.25 version: 3.2.25 @@ -176,16 +176,16 @@ importers: version: 3.1.1 prettier: specifier: ^3.3 - version: 3.4.1 + version: 3.4.2 rimraf: specifier: 6.0.1 version: 6.0.1 rollup: specifier: ^4.24.0 - version: 4.28.0 + version: 4.28.1 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.28.0)(typescript@5.6.3) + version: 6.1.1(rollup@4.28.1)(typescript@5.6.3) rollup-plugin-node-polyfills: specifier: ^0.2.1 version: 0.2.1 @@ -209,7 +209,7 @@ importers: version: 4.19.2 typedoc: specifier: ^0.27.0 - version: 0.27.2(typescript@5.6.3) + version: 0.27.4(typescript@5.6.3) typescript: specifier: ^5.5.4 version: 5.6.3 @@ -1241,93 +1241,98 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.28.0': - resolution: {integrity: sha512-wLJuPLT6grGZsy34g4N1yRfYeouklTgPhH1gWXCYspenKYD0s3cR99ZevOGw5BexMNywkbV3UkjADisozBmpPQ==} + '@rollup/rollup-android-arm-eabi@4.28.1': + resolution: {integrity: sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.28.0': - resolution: {integrity: sha512-eiNkznlo0dLmVG/6wf+Ifi/v78G4d4QxRhuUl+s8EWZpDewgk7PX3ZyECUXU0Zq/Ca+8nU8cQpNC4Xgn2gFNDA==} + '@rollup/rollup-android-arm64@4.28.1': + resolution: {integrity: sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.28.0': - resolution: {integrity: sha512-lmKx9yHsppblnLQZOGxdO66gT77bvdBtr/0P+TPOseowE7D9AJoBw8ZDULRasXRWf1Z86/gcOdpBrV6VDUY36Q==} + '@rollup/rollup-darwin-arm64@4.28.1': + resolution: {integrity: sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.28.0': - resolution: {integrity: sha512-8hxgfReVs7k9Js1uAIhS6zq3I+wKQETInnWQtgzt8JfGx51R1N6DRVy3F4o0lQwumbErRz52YqwjfvuwRxGv1w==} + '@rollup/rollup-darwin-x64@4.28.1': + resolution: {integrity: sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.28.0': - resolution: {integrity: sha512-lA1zZB3bFx5oxu9fYud4+g1mt+lYXCoch0M0V/xhqLoGatbzVse0wlSQ1UYOWKpuSu3gyN4qEc0Dxf/DII1bhQ==} + '@rollup/rollup-freebsd-arm64@4.28.1': + resolution: {integrity: sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.28.0': - resolution: {integrity: sha512-aI2plavbUDjCQB/sRbeUZWX9qp12GfYkYSJOrdYTL/C5D53bsE2/nBPuoiJKoWp5SN78v2Vr8ZPnB+/VbQ2pFA==} + '@rollup/rollup-freebsd-x64@4.28.1': + resolution: {integrity: sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.28.0': - resolution: {integrity: sha512-WXveUPKtfqtaNvpf0iOb0M6xC64GzUX/OowbqfiCSXTdi/jLlOmH0Ba94/OkiY2yTGTwteo4/dsHRfh5bDCZ+w==} + '@rollup/rollup-linux-arm-gnueabihf@4.28.1': + resolution: {integrity: sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.28.0': - resolution: {integrity: sha512-yLc3O2NtOQR67lI79zsSc7lk31xjwcaocvdD1twL64PK1yNaIqCeWI9L5B4MFPAVGEVjH5k1oWSGuYX1Wutxpg==} + '@rollup/rollup-linux-arm-musleabihf@4.28.1': + resolution: {integrity: sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.28.0': - resolution: {integrity: sha512-+P9G9hjEpHucHRXqesY+3X9hD2wh0iNnJXX/QhS/J5vTdG6VhNYMxJ2rJkQOxRUd17u5mbMLHM7yWGZdAASfcg==} + '@rollup/rollup-linux-arm64-gnu@4.28.1': + resolution: {integrity: sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.28.0': - resolution: {integrity: sha512-1xsm2rCKSTpKzi5/ypT5wfc+4bOGa/9yI/eaOLW0oMs7qpC542APWhl4A37AENGZ6St6GBMWhCCMM6tXgTIplw==} + '@rollup/rollup-linux-arm64-musl@4.28.1': + resolution: {integrity: sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.28.0': - resolution: {integrity: sha512-zgWxMq8neVQeXL+ouSf6S7DoNeo6EPgi1eeqHXVKQxqPy1B2NvTbaOUWPn/7CfMKL7xvhV0/+fq/Z/J69g1WAQ==} + '@rollup/rollup-linux-loongarch64-gnu@4.28.1': + resolution: {integrity: sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': + resolution: {integrity: sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.28.0': - resolution: {integrity: sha512-VEdVYacLniRxbRJLNtzwGt5vwS0ycYshofI7cWAfj7Vg5asqj+pt+Q6x4n+AONSZW/kVm+5nklde0qs2EUwU2g==} + '@rollup/rollup-linux-riscv64-gnu@4.28.1': + resolution: {integrity: sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.28.0': - resolution: {integrity: sha512-LQlP5t2hcDJh8HV8RELD9/xlYtEzJkm/aWGsauvdO2ulfl3QYRjqrKW+mGAIWP5kdNCBheqqqYIGElSRCaXfpw==} + '@rollup/rollup-linux-s390x-gnu@4.28.1': + resolution: {integrity: sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.28.0': - resolution: {integrity: sha512-Nl4KIzteVEKE9BdAvYoTkW19pa7LR/RBrT6F1dJCV/3pbjwDcaOq+edkP0LXuJ9kflW/xOK414X78r+K84+msw==} + '@rollup/rollup-linux-x64-gnu@4.28.1': + resolution: {integrity: sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.28.0': - resolution: {integrity: sha512-eKpJr4vBDOi4goT75MvW+0dXcNUqisK4jvibY9vDdlgLx+yekxSm55StsHbxUsRxSTt3JEQvlr3cGDkzcSP8bw==} + '@rollup/rollup-linux-x64-musl@4.28.1': + resolution: {integrity: sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.28.0': - resolution: {integrity: sha512-Vi+WR62xWGsE/Oj+mD0FNAPY2MEox3cfyG0zLpotZdehPFXwz6lypkGs5y38Jd/NVSbOD02aVad6q6QYF7i8Bg==} + '@rollup/rollup-win32-arm64-msvc@4.28.1': + resolution: {integrity: sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.28.0': - resolution: {integrity: sha512-kN/Vpip8emMLn/eOza+4JwqDZBL6MPNpkdaEsgUtW1NYN3DZvZqSQrbKzJcTL6hd8YNmFTn7XGWMwccOcJBL0A==} + '@rollup/rollup-win32-ia32-msvc@4.28.1': + resolution: {integrity: sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.28.0': - resolution: {integrity: sha512-Bvno2/aZT6usSa7lRDL2+hMjVAGjuqaymF1ApZm31JXzniR/hvr14jpU+/z4X6Gt5BPlzosscyJZGUvguXIqeQ==} + '@rollup/rollup-win32-x64-msvc@4.28.1': + resolution: {integrity: sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==} cpu: [x64] os: [win32] @@ -3748,8 +3753,8 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} - prettier@3.4.1: - resolution: {integrity: sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==} + prettier@3.4.2: + resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} hasBin: true @@ -3925,8 +3930,8 @@ packages: rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - rollup@4.28.0: - resolution: {integrity: sha512-G9GOrmgWHBma4YfCcX8PjH0qhXSdH8B4HDE2o4/jaxj93S4DPCIDoLcXz99eWMji4hB29UFCEd7B2gwGJDR9cQ==} + rollup@4.28.1: + resolution: {integrity: sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -4346,8 +4351,8 @@ packages: resolution: {integrity: sha512-Z48LU67/qJ+vyA7lh3ozELqpTp3pvQoY5RtLi5wQ/UGSrEidBhlVSqhjr8B3iqbGpjqAoJYrtSYXWMDtidWGkA==} engines: {node: '>=6.0.0', npm: '>=3.0.0'} - typedoc@0.27.2: - resolution: {integrity: sha512-C2ima5TZJHU3ecnRIz50lKd1BsYck5LhYQIy7MRPmjuSEJreUEAt+uAVcZgY7wZsSORzEI7xW8miZIdxv/cbmw==} + typedoc@0.27.4: + resolution: {integrity: sha512-wXPQs1AYC2Crk+1XFpNuutLIkNWleokZf1UNf/X8w9KsMnirkvT+LzxTXDvfF6ug3TSLf3Xu5ZXRKGfoXPX7IA==} engines: {node: '>= 18'} hasBin: true peerDependencies: @@ -5718,24 +5723,24 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@rollup/plugin-alias@5.1.1(rollup@4.28.0)': + '@rollup/plugin-alias@5.1.1(rollup@4.28.1)': optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/plugin-babel@6.0.4(@babel/core@7.26.0)(@types/babel__core@7.20.1)(rollup@4.28.0)': + '@rollup/plugin-babel@6.0.4(@babel/core@7.26.0)(@types/babel__core@7.20.1)(rollup@4.28.1)': dependencies: '@babel/core': 7.26.0 '@babel/helper-module-imports': 7.24.7 - '@rollup/pluginutils': 5.1.2(rollup@4.28.0) + '@rollup/pluginutils': 5.1.2(rollup@4.28.1) optionalDependencies: '@types/babel__core': 7.20.1 - rollup: 4.28.0 + rollup: 4.28.1 transitivePeerDependencies: - supports-color - '@rollup/plugin-commonjs@28.0.1(rollup@4.28.0)': + '@rollup/plugin-commonjs@28.0.1(rollup@4.28.1)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.28.0) + '@rollup/pluginutils': 5.1.2(rollup@4.28.1) commondir: 1.0.1 estree-walker: 2.0.2 fdir: 6.3.0(picomatch@4.0.2) @@ -5743,99 +5748,102 @@ snapshots: magic-string: 0.30.10 picomatch: 4.0.2 optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/plugin-json@6.1.0(rollup@4.28.0)': + '@rollup/plugin-json@6.1.0(rollup@4.28.1)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.28.0) + '@rollup/pluginutils': 5.1.2(rollup@4.28.1) optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/plugin-node-resolve@15.3.0(rollup@4.28.0)': + '@rollup/plugin-node-resolve@15.3.0(rollup@4.28.1)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.28.0) + '@rollup/pluginutils': 5.1.2(rollup@4.28.1) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/plugin-replace@6.0.1(rollup@4.28.0)': + '@rollup/plugin-replace@6.0.1(rollup@4.28.1)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.28.0) + '@rollup/pluginutils': 5.1.2(rollup@4.28.1) magic-string: 0.30.10 optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/plugin-terser@0.4.4(rollup@4.28.0)': + '@rollup/plugin-terser@0.4.4(rollup@4.28.1)': dependencies: serialize-javascript: 6.0.1 smob: 1.4.0 terser: 5.18.0 optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 - '@rollup/pluginutils@5.1.2(rollup@4.28.0)': + '@rollup/pluginutils@5.1.2(rollup@4.28.1)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.28.0 + rollup: 4.28.1 + + '@rollup/rollup-android-arm-eabi@4.28.1': + optional: true - '@rollup/rollup-android-arm-eabi@4.28.0': + '@rollup/rollup-android-arm64@4.28.1': optional: true - '@rollup/rollup-android-arm64@4.28.0': + '@rollup/rollup-darwin-arm64@4.28.1': optional: true - '@rollup/rollup-darwin-arm64@4.28.0': + '@rollup/rollup-darwin-x64@4.28.1': optional: true - '@rollup/rollup-darwin-x64@4.28.0': + '@rollup/rollup-freebsd-arm64@4.28.1': optional: true - '@rollup/rollup-freebsd-arm64@4.28.0': + '@rollup/rollup-freebsd-x64@4.28.1': optional: true - '@rollup/rollup-freebsd-x64@4.28.0': + '@rollup/rollup-linux-arm-gnueabihf@4.28.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.28.0': + '@rollup/rollup-linux-arm-musleabihf@4.28.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.28.0': + '@rollup/rollup-linux-arm64-gnu@4.28.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.28.0': + '@rollup/rollup-linux-arm64-musl@4.28.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.28.0': + '@rollup/rollup-linux-loongarch64-gnu@4.28.1': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.28.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.28.0': + '@rollup/rollup-linux-riscv64-gnu@4.28.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.28.0': + '@rollup/rollup-linux-s390x-gnu@4.28.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.28.0': + '@rollup/rollup-linux-x64-gnu@4.28.1': optional: true - '@rollup/rollup-linux-x64-musl@4.28.0': + '@rollup/rollup-linux-x64-musl@4.28.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.28.0': + '@rollup/rollup-win32-arm64-msvc@4.28.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.28.0': + '@rollup/rollup-win32-ia32-msvc@4.28.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.28.0': + '@rollup/rollup-win32-x64-msvc@4.28.1': optional: true '@rtsao/scc@1.1.0': {} @@ -7029,10 +7037,10 @@ snapshots: globals: 13.24.0 rambda: 7.5.0 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.1): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2): dependencies: eslint: 8.57.0 - prettier: 3.4.1 + prettier: 3.4.2 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 optionalDependencies: @@ -8443,7 +8451,7 @@ snapshots: dependencies: fast-diff: 1.3.0 - prettier@3.4.1: {} + prettier@3.4.2: {} pretty-ms@9.0.0: dependencies: @@ -8603,10 +8611,10 @@ snapshots: glob: 11.0.0 package-json-from-dist: 1.0.0 - rollup-plugin-dts@6.1.1(rollup@4.28.0)(typescript@5.6.3): + rollup-plugin-dts@6.1.1(rollup@4.28.1)(typescript@5.6.3): dependencies: magic-string: 0.30.10 - rollup: 4.28.0 + rollup: 4.28.1 typescript: 5.6.3 optionalDependencies: '@babel/code-frame': 7.24.7 @@ -8625,28 +8633,29 @@ snapshots: dependencies: estree-walker: 0.6.1 - rollup@4.28.0: + rollup@4.28.1: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.28.0 - '@rollup/rollup-android-arm64': 4.28.0 - '@rollup/rollup-darwin-arm64': 4.28.0 - '@rollup/rollup-darwin-x64': 4.28.0 - '@rollup/rollup-freebsd-arm64': 4.28.0 - '@rollup/rollup-freebsd-x64': 4.28.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.28.0 - '@rollup/rollup-linux-arm-musleabihf': 4.28.0 - '@rollup/rollup-linux-arm64-gnu': 4.28.0 - '@rollup/rollup-linux-arm64-musl': 4.28.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.28.0 - '@rollup/rollup-linux-riscv64-gnu': 4.28.0 - '@rollup/rollup-linux-s390x-gnu': 4.28.0 - '@rollup/rollup-linux-x64-gnu': 4.28.0 - '@rollup/rollup-linux-x64-musl': 4.28.0 - '@rollup/rollup-win32-arm64-msvc': 4.28.0 - '@rollup/rollup-win32-ia32-msvc': 4.28.0 - '@rollup/rollup-win32-x64-msvc': 4.28.0 + '@rollup/rollup-android-arm-eabi': 4.28.1 + '@rollup/rollup-android-arm64': 4.28.1 + '@rollup/rollup-darwin-arm64': 4.28.1 + '@rollup/rollup-darwin-x64': 4.28.1 + '@rollup/rollup-freebsd-arm64': 4.28.1 + '@rollup/rollup-freebsd-x64': 4.28.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.28.1 + '@rollup/rollup-linux-arm-musleabihf': 4.28.1 + '@rollup/rollup-linux-arm64-gnu': 4.28.1 + '@rollup/rollup-linux-arm64-musl': 4.28.1 + '@rollup/rollup-linux-loongarch64-gnu': 4.28.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.28.1 + '@rollup/rollup-linux-riscv64-gnu': 4.28.1 + '@rollup/rollup-linux-s390x-gnu': 4.28.1 + '@rollup/rollup-linux-x64-gnu': 4.28.1 + '@rollup/rollup-linux-x64-musl': 4.28.1 + '@rollup/rollup-win32-arm64-msvc': 4.28.1 + '@rollup/rollup-win32-ia32-msvc': 4.28.1 + '@rollup/rollup-win32-x64-msvc': 4.28.1 fsevents: 2.3.3 rpc-websockets@9.0.4: @@ -9140,7 +9149,7 @@ snapshots: typed-error@3.2.2: {} - typedoc@0.27.2(typescript@5.6.3): + typedoc@0.27.4(typescript@5.6.3): dependencies: '@gerrit0/mini-shiki': 1.24.1 lunr: 2.3.9 diff --git a/src/connection.ts b/src/connection.ts index 950a4a808f21..659ae830f78a 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -5225,7 +5225,7 @@ export class Connection { commitment?: Finality, ): Promise { const args = this._buildArgsAtLeastConfirmed([slot], commitment); - const unsafeRes = await this._rpcRequest('getConfirmedBlock', args); + const unsafeRes = await this._rpcRequest('getBlock', args); const res = create(unsafeRes, GetConfirmedBlockRpcResult); if ('error' in res) { @@ -5331,7 +5331,7 @@ export class Connection { rewards: false, }, ); - const unsafeRes = await this._rpcRequest('getConfirmedBlock', args); + const unsafeRes = await this._rpcRequest('getBlock', args); const res = create(unsafeRes, GetBlockSignaturesRpcResult); if ('error' in res) { throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block'); diff --git a/test/connection.test.ts b/test/connection.test.ts index 0b708e385776..563a2805a417 100644 --- a/test/connection.test.ts +++ b/test/connection.test.ts @@ -2351,7 +2351,7 @@ describe('Connection', function () { await waitForSlot.call(this, connection, 1); await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [1], value: { blockTime: 1614281964, @@ -2433,7 +2433,7 @@ describe('Connection', function () { const mockSignature = '5SHZ9NwpnS9zYnauN7pnuborKf39zGMr11XpMC59VvRSeDJNcnYLecmdxXCVuBFPNQLdCBBjyZiNCL4KoHKr3tvz'; await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [slot, {transactionDetails: 'signatures', rewards: false}], value: { blockTime: 1614281964, @@ -2449,7 +2449,7 @@ describe('Connection', function () { value: 123, }); await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [slot + 2, {transactionDetails: 'signatures', rewards: false}], value: { blockTime: 1614281964, @@ -2482,7 +2482,7 @@ describe('Connection', function () { const badSlot = Number.MAX_SAFE_INTEGER - 1; await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [badSlot - 1, {transactionDetails: 'signatures', rewards: false}], error: {message: 'Block not available for slot ' + badSlot}, }); @@ -2531,7 +2531,7 @@ describe('Connection', function () { await waitForSlot.call(this, connection, 1); await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [1], value: { blockTime: 1614281964, @@ -2640,7 +2640,7 @@ describe('Connection', function () { await waitForSlot.call(this, connection, 1); await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [1], value: { blockTime: 1614281964, @@ -3294,7 +3294,7 @@ describe('Connection', function () { await waitForSlot.call(this, connection, 1); await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [1], value: { blockTime: 1614281964, @@ -4252,7 +4252,7 @@ describe('Connection', function () { it('gets the genesis block', async function () { await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [0], value: { blockHeight: 0, @@ -4290,7 +4290,7 @@ describe('Connection', function () { it('gets a block having a parent', async function () { // Mock parent of block with transaction. await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [0], value: { blockHeight: 0, @@ -4303,7 +4303,7 @@ describe('Connection', function () { }); // Mock block with transaction. await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [1], value: { blockTime: 1614281964, @@ -4390,7 +4390,7 @@ describe('Connection', function () { .null; await mockRpcResponse({ - method: 'getConfirmedBlock', + method: 'getBlock', params: [Number.MAX_SAFE_INTEGER], error: { message: `Block not available for slot ${Number.MAX_SAFE_INTEGER}`,