diff --git a/.github/workflows/node-build.yml b/.github/workflows/node-build.yml index bef460e97..d75cfb9cb 100644 --- a/.github/workflows/node-build.yml +++ b/.github/workflows/node-build.yml @@ -22,38 +22,6 @@ on: - crates/node-litesvm/docs/** jobs: - lint: - name: Lint - runs-on: ubuntu-latest - defaults: - run: - working-directory: crates/node-litesvm - steps: - - uses: actions/checkout@v6 - - - name: Setup node - uses: actions/setup-node@v6 - with: - node-version: 22 - cache: 'yarn' - cache-dependency-path: crates/node-litesvm/yarn.lock - - - name: Install - uses: dtolnay/rust-toolchain@nightly - with: - components: clippy, rustfmt - - - name: Install dependencies - run: yarn install - - - name: Oxlint - run: yarn lint - - - name: Cargo fmt - run: cargo fmt -- --check - - - name: Clippy - run: cargo clippy build: strategy: fail-fast: false @@ -61,27 +29,24 @@ jobs: settings: - host: macos-latest target: x86_64-apple-darwin - build: yarn build --target x86_64-apple-darwin + build: yarn workspace litesvm-core build --target x86_64-apple-darwin - host: macos-latest target: aarch64-apple-darwin - build: yarn build --target aarch64-apple-darwin + build: yarn workspace litesvm-core build --target aarch64-apple-darwin - host: ubuntu-22.04 target: x86_64-unknown-linux-gnu - build: yarn build --target x86_64-unknown-linux-gnu --use-napi-cross + build: yarn workspace litesvm-core build --target x86_64-unknown-linux-gnu --use-napi-cross - host: ubuntu-22.04 target: aarch64-unknown-linux-gnu - build: yarn build --target aarch64-unknown-linux-gnu --use-napi-cross + build: yarn workspace litesvm-core build --target aarch64-unknown-linux-gnu --use-napi-cross - host: ubuntu-latest target: x86_64-unknown-linux-musl - build: yarn build --target x86_64-unknown-linux-musl -x + build: yarn workspace litesvm-core build --target x86_64-unknown-linux-musl -x - host: ubuntu-latest target: aarch64-unknown-linux-musl - build: yarn build --target aarch64-unknown-linux-musl -x + build: yarn workspace litesvm-core build --target aarch64-unknown-linux-musl -x name: stable - ${{ matrix.settings.target }} - node@22 runs-on: ${{ matrix.settings.host }} - defaults: - run: - working-directory: crates/node-litesvm steps: - uses: actions/checkout@v6 - name: Setup node @@ -89,8 +54,8 @@ jobs: with: node-version: 22 cache: yarn - cache-dependency-path: crates/node-litesvm/yarn.lock - - name: Install + cache-dependency-path: yarn.lock + - name: Install Rust uses: dtolnay/rust-toolchain@nightly with: toolchain: stable @@ -122,7 +87,7 @@ jobs: if: ${{ matrix.settings.setup }} shell: bash - name: Install dependencies - run: yarn install + run: corepack enable && yarn install --immutable - name: Build run: ${{ matrix.settings.build }} shell: bash @@ -130,8 +95,9 @@ jobs: uses: actions/upload-artifact@v6 with: name: bindings-${{ matrix.settings.target }} - path: crates/node-litesvm/litesvm/litesvm.*.node + path: crates/node-litesvm-core/litesvm/litesvm.*.node if-no-files-found: error + test-macOS-binding: name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} needs: @@ -150,9 +116,6 @@ jobs: - '20' - '22' runs-on: ${{ matrix.settings.host }} - defaults: - run: - working-directory: crates/node-litesvm steps: - uses: actions/checkout@v6 - name: Setup node @@ -161,19 +124,25 @@ jobs: node-version: ${{ matrix.node }} cache: yarn architecture: ${{ matrix.settings.architecture }} - cache-dependency-path: crates/node-litesvm/yarn.lock + cache-dependency-path: yarn.lock - name: Install dependencies - run: yarn install + run: corepack enable && yarn install --immutable - name: Download artifacts uses: actions/download-artifact@v4 with: name: bindings-${{ matrix.settings.target }} - path: crates/node-litesvm/litesvm - - name: List packages - run: ls -R . + path: crates/node-litesvm-core/litesvm + - name: List bindings + run: ls -R crates/node-litesvm-core/litesvm shell: bash - - name: Test bindings - run: yarn test + - name: Test core and wrappers + run: | + yarn workspace litesvm-core test + yarn workspace litesvm build + yarn workspace litesvm test + yarn workspace litesvm-web3js build + yarn workspace litesvm-web3js test + test-linux-binding: name: Test ${{ matrix.target }} - node@${{ matrix.node }} needs: @@ -186,14 +155,10 @@ jobs: - x86_64-unknown-linux-musl - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl - # - armv7-unknown-linux-gnueabihf node: - '20' - '22' runs-on: ${{ contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} - defaults: - run: - working-directory: crates/node-litesvm steps: - uses: actions/checkout@v6 - name: Setup node @@ -201,15 +166,13 @@ jobs: with: node-version: ${{ matrix.node }} cache: yarn - cache-dependency-path: crates/node-litesvm/yarn.lock + cache-dependency-path: yarn.lock - name: Output docker params id: docker run: | node -e " if ('${{ matrix.target }}'.startsWith('aarch64')) { console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') } else { console.log('PLATFORM=linux/amd64') } @@ -223,27 +186,21 @@ jobs: " >> $GITHUB_OUTPUT - name: Install dependencies run: | - yarn config set --json supportedArchitectures.cpu '["current", "arm64", "x64", "arm"]' + corepack enable + yarn config set --json supportedArchitectures.cpu '["current", "arm64", "x64"]' yarn config set --json supportedArchitectures.libc '["current", "musl", "gnu"]' - yarn install + yarn install --immutable - name: Download artifacts uses: actions/download-artifact@v6 with: name: bindings-${{ matrix.target }} - path: crates/node-litesvm/litesvm - - name: List packages - run: ls -R . + path: crates/node-litesvm-core/litesvm + - name: List bindings + run: ls -R crates/node-litesvm-core/litesvm shell: bash - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # if: ${{ contains(matrix.target, 'armv7') }} - # with: - # platforms: all - # - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - # if: ${{ contains(matrix.target, 'armv7') }} - - name: Test bindings + - name: Test core and wrappers uses: addnab/docker-run-action@v3 with: image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }}/crates/node-litesvm --platform ${{ steps.docker.outputs.PLATFORM }} -e RUST_MIN_STACK=8388608 - run: yarn test + options: -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }} -e RUST_MIN_STACK=8388608 + run: corepack enable && yarn workspace litesvm-core test && yarn workspace litesvm build && yarn workspace litesvm test && yarn workspace litesvm-web3js build && yarn workspace litesvm-web3js test diff --git a/.github/workflows/node-docs-check.yml b/.github/workflows/node-docs-check.yml index e5264fbf9..f82fbe91d 100644 --- a/.github/workflows/node-docs-check.yml +++ b/.github/workflows/node-docs-check.yml @@ -25,10 +25,8 @@ jobs: with: node-version: 22 cache: yarn - cache-dependency-path: crates/node-litesvm/yarn.lock + cache-dependency-path: yarn.lock - name: Install dependencies - working-directory: crates/node-litesvm - run: yarn install + run: corepack enable && yarn install --immutable - name: Build with VitePress - working-directory: crates/node-litesvm - run: yarn predocs && yarn docs:build + run: yarn workspace litesvm predocs && yarn workspace litesvm docs:build diff --git a/.github/workflows/node-docs.yml b/.github/workflows/node-docs.yml index 96a100a2b..fec4e7f7e 100644 --- a/.github/workflows/node-docs.yml +++ b/.github/workflows/node-docs.yml @@ -25,15 +25,13 @@ jobs: with: node-version: 22 cache: yarn - cache-dependency-path: crates/node-litesvm/yarn.lock + cache-dependency-path: yarn.lock - name: Setup Pages uses: actions/configure-pages@v5 - name: Install dependencies - working-directory: crates/node-litesvm - run: yarn install + run: corepack enable && yarn install --immutable - name: Build with VitePress - working-directory: crates/node-litesvm - run: yarn predocs && yarn docs:build + run: yarn workspace litesvm predocs && yarn workspace litesvm docs:build - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: @@ -49,4 +47,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/node-lint.yml b/.github/workflows/node-lint.yml index db132c851..71039cfe9 100644 --- a/.github/workflows/node-lint.yml +++ b/.github/workflows/node-lint.yml @@ -9,7 +9,7 @@ on: - LICENSE - '**/*.gitignore' - .editorconfig - - node-litesvm/docs/** + - crates/node-litesvm/docs/** jobs: lint: runs-on: ubuntu-latest @@ -20,13 +20,19 @@ jobs: with: node-version: 22 check-latest: true - - name: Rustup install + cache: yarn + cache-dependency-path: yarn.lock + - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - components: clippy + components: clippy, rustfmt - name: Install dependencies - run: cd crates/node-litesvm && corepack enable && yarn install - - name: Lint rust - run: cd crates/node-litesvm && yarn lint:rust - - name: Lint JS - run: cd crates/node-litesvm && yarn lint:js + run: corepack enable && yarn install --immutable + - name: Check Rust formatting + run: cargo fmt --all -- --check + - name: Lint Rust core + run: yarn workspace litesvm-core lint + - name: Lint Kit wrapper + run: yarn workspace litesvm lint:js + - name: Lint Web3.js wrapper + run: yarn workspace litesvm-web3js lint diff --git a/.github/workflows/release-node.yml b/.github/workflows/release-node.yml index 2bd05128d..5a129307a 100644 --- a/.github/workflows/release-node.yml +++ b/.github/workflows/release-node.yml @@ -3,8 +3,9 @@ name: release NodeJS on: push: tags: - - "node-v[0-9]+.[0-9]+.[0-9]+" - - "node-v[0-9]+.[0-9]+.[0-9]+-*" + - "node-v[0-9]+.[0-9]+.[0-9]+" + - "node-v[0-9]+.[0-9]+.[0-9]+-*" + permissions: contents: read id-token: write @@ -20,28 +21,49 @@ jobs: with: node-version: 22 check-latest: true + registry-url: https://registry.npmjs.org cache: yarn - cache-dependency-path: crates/node-litesvm/yarn.lock + cache-dependency-path: yarn.lock + - name: Check package versions match the release tag + run: | + node <<'NODE' + const assert = require('node:assert/strict'); + const version = process.env.GITHUB_REF_NAME.replace(/^node-v/, ''); + for (const workspace of require('./package.json').workspaces) { + const pkg = require(`./${workspace}/package.json`); + assert.equal(pkg.version, version, `${pkg.name} must match release version ${version}`); + } + NODE - name: Upgrade npm for trusted publishing run: npm install -g npm@latest - name: Install dependencies - run: cd crates/node-litesvm/ && corepack enable && yarn install - - name: Create npm dirs - run: cd crates/node-litesvm/ && yarn napi create-npm-dirs - - name: Download all artifacts + run: corepack enable && yarn install --immutable + - name: Create native package directories + run: yarn workspace litesvm-core napi create-npm-dirs + - name: Download all native artifacts uses: dawidd6/action-download-artifact@v11 with: workflow: node-build.yml - path: crates/node-litesvm/artifacts - - name: Move artifacts - run: cd crates/node-litesvm/ && yarn artifacts - - name: Compile Typescript - run: cd crates/node-litesvm/ && yarn build:js - - name: List packages - run: cd crates/node-litesvm/ && ls -R ./npm - - name: Publish + path: crates/node-litesvm-core/artifacts + - name: Move native artifacts + run: yarn workspace litesvm-core artifacts + - name: Build wrappers + run: | + yarn workspace litesvm build + yarn workspace litesvm-web3js build + - name: List native packages + run: ls -R crates/node-litesvm-core/npm + - name: Publish core and wrappers + env: + # Bootstrap the eight new packages with a granular write token that can + # create packages and bypass 2FA. After configuring trusted publishing + # for litesvm-core, litesvm-web3js and all six platform packages, remove it. + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - cd crates/node-litesvm/ TAG=latest [[ "$GITHUB_REF_NAME" == *-rc.* ]] && TAG=next - npm publish --access public --tag "$TAG" + (cd crates/node-litesvm-core && npm publish --access public --tag "$TAG") + yarn workspace litesvm pack --out "$RUNNER_TEMP/litesvm.tgz" + yarn workspace litesvm-web3js pack --out "$RUNNER_TEMP/litesvm-web3js.tgz" + npm publish "$RUNNER_TEMP/litesvm.tgz" --access public --tag "$TAG" + npm publish "$RUNNER_TEMP/litesvm-web3js.tgz" --access public --tag "$TAG" diff --git a/.gitignore b/.gitignore index 517a5a841..5ccc1603f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ target/ tarpaulin-out/ -tarpaulin-out-up/ \ No newline at end of file +tarpaulin-out-up/ +node_modules/ +.yarn/* +!.yarn/releases +!.yarn/releases/yarn-4.10.3.cjs diff --git a/crates/node-litesvm/.yarn/releases/yarn-4.10.3.cjs b/.yarn/releases/yarn-4.10.3.cjs similarity index 100% rename from crates/node-litesvm/.yarn/releases/yarn-4.10.3.cjs rename to .yarn/releases/yarn-4.10.3.cjs diff --git a/crates/node-litesvm/.yarnrc.yml b/.yarnrc.yml similarity index 100% rename from crates/node-litesvm/.yarnrc.yml rename to .yarnrc.yml diff --git a/Cargo.toml b/Cargo.toml index 6fc548c1f..6c424810c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = ["crates/*"] +exclude = ["crates/node-litesvm", "crates/node-litesvm-web3js"] [workspace.package] version = "0.18.0" diff --git a/README.md b/README.md index 3dc255ca8..9942e4aa2 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,10 @@ See the [anchor-litesvm testing guide](https://www.litesvm.com/docs/additional-c - Full documentation: [litesvm.com](https://litesvm.com) - Full API reference: [docs.rs/litesvm](https://docs.rs/litesvm/latest/litesvm/) -- Node.js wrapper: [`litesvm` on npm](https://www.npmjs.com/package/litesvm) — see [`crates/node-litesvm`](crates/node-litesvm) for its README and tutorial +- Node.js packages: + - [`litesvm`](https://www.npmjs.com/package/litesvm) provides the `@solana/kit` wrapper. + - [`litesvm-web3js`](https://www.npmjs.com/package/litesvm-web3js) provides the `@solana/web3.js` v3 wrapper. + - [`litesvm-core`](https://www.npmjs.com/package/litesvm-core) exposes the raw NAPI bindings used by both wrappers. ### 🛠️ Developing litesvm diff --git a/crates/node-litesvm/.cargo/config.toml b/crates/node-litesvm-core/.cargo/config.toml similarity index 100% rename from crates/node-litesvm/.cargo/config.toml rename to crates/node-litesvm-core/.cargo/config.toml diff --git a/crates/node-litesvm-core/.gitignore b/crates/node-litesvm-core/.gitignore new file mode 100644 index 000000000..5e0f041cd --- /dev/null +++ b/crates/node-litesvm-core/.gitignore @@ -0,0 +1,202 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node +# Edit at https://www.toptal.com/developers/gitignore?templates=node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# End of https://www.toptal.com/developers/gitignore/api/node + +# Created by https://www.toptal.com/developers/gitignore/api/macos +# Edit at https://www.toptal.com/developers/gitignore?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +# End of https://www.toptal.com/developers/gitignore/api/macos + +# Created by https://www.toptal.com/developers/gitignore/api/windows +# Edit at https://www.toptal.com/developers/gitignore?templates=windows + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows + +#Added by cargo + +/target +Cargo.lock + +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +*.node + +cache + +# NAPI-RS generated platform packages (build output) +npm/ diff --git a/crates/node-litesvm-core/.npmignore b/crates/node-litesvm-core/.npmignore new file mode 100644 index 000000000..ec144db2a --- /dev/null +++ b/crates/node-litesvm-core/.npmignore @@ -0,0 +1,13 @@ +target +Cargo.lock +.cargo +.github +npm +.eslintrc +.prettierignore +rustfmt.toml +yarn.lock +*.node +.yarn +__test__ +renovate.json diff --git a/crates/node-litesvm-core/.npmrc b/crates/node-litesvm-core/.npmrc new file mode 100644 index 000000000..589e81379 --- /dev/null +++ b/crates/node-litesvm-core/.npmrc @@ -0,0 +1,2 @@ +engine-strict=false +ignore-engines=true diff --git a/crates/node-litesvm/Cargo.toml b/crates/node-litesvm-core/Cargo.toml similarity index 100% rename from crates/node-litesvm/Cargo.toml rename to crates/node-litesvm-core/Cargo.toml diff --git a/crates/node-litesvm-core/README.md b/crates/node-litesvm-core/README.md new file mode 100644 index 000000000..151529795 --- /dev/null +++ b/crates/node-litesvm-core/README.md @@ -0,0 +1,26 @@ +# LiteSVM Core + +`litesvm-core` contains the raw Node.js NAPI bindings for +[LiteSVM](https://github.com/LiteSVM/litesvm). It is the shared native runtime +used by the SDK-specific `litesvm` and `litesvm-web3js` packages. + +Most applications should install one of the SDK wrappers instead: + +- `litesvm` for `@solana/kit` +- `litesvm-web3js` for `@solana/web3.js` v3 + +Install this package directly only when you need the byte-oriented generated +NAPI API: + +```sh +yarn add litesvm-core +``` + +```ts +import { LiteSvm } from "litesvm-core"; + +const svm = new LiteSvm(); +``` + +The core package intentionally has no dependency on either Solana JavaScript +SDK. diff --git a/crates/node-litesvm/build.rs b/crates/node-litesvm-core/build.rs similarity index 100% rename from crates/node-litesvm/build.rs rename to crates/node-litesvm-core/build.rs diff --git a/crates/node-litesvm/litesvm/internal.d.ts b/crates/node-litesvm-core/litesvm/index.d.ts similarity index 100% rename from crates/node-litesvm/litesvm/internal.d.ts rename to crates/node-litesvm-core/litesvm/index.d.ts diff --git a/crates/node-litesvm/litesvm/internal.js b/crates/node-litesvm-core/litesvm/index.js similarity index 85% rename from crates/node-litesvm/litesvm/internal.js rename to crates/node-litesvm-core/litesvm/index.js index 00e814a72..3d360868b 100644 --- a/crates/node-litesvm/litesvm/internal.js +++ b/crates/node-litesvm-core/litesvm/index.js @@ -75,8 +75,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-android-arm64') - const bindingPackageVersion = require('litesvm-android-arm64/package.json').version + const binding = require('litesvm-core-android-arm64') + const bindingPackageVersion = require('litesvm-core-android-arm64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -91,8 +91,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-android-arm-eabi') - const bindingPackageVersion = require('litesvm-android-arm-eabi/package.json').version + const binding = require('litesvm-core-android-arm-eabi') + const bindingPackageVersion = require('litesvm-core-android-arm-eabi/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -112,8 +112,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-win32-x64-gnu') - const bindingPackageVersion = require('litesvm-win32-x64-gnu/package.json').version + const binding = require('litesvm-core-win32-x64-gnu') + const bindingPackageVersion = require('litesvm-core-win32-x64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -128,8 +128,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-win32-x64-msvc') - const bindingPackageVersion = require('litesvm-win32-x64-msvc/package.json').version + const binding = require('litesvm-core-win32-x64-msvc') + const bindingPackageVersion = require('litesvm-core-win32-x64-msvc/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -145,8 +145,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-win32-ia32-msvc') - const bindingPackageVersion = require('litesvm-win32-ia32-msvc/package.json').version + const binding = require('litesvm-core-win32-ia32-msvc') + const bindingPackageVersion = require('litesvm-core-win32-ia32-msvc/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -161,8 +161,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-win32-arm64-msvc') - const bindingPackageVersion = require('litesvm-win32-arm64-msvc/package.json').version + const binding = require('litesvm-core-win32-arm64-msvc') + const bindingPackageVersion = require('litesvm-core-win32-arm64-msvc/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -180,8 +180,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-darwin-universal') - const bindingPackageVersion = require('litesvm-darwin-universal/package.json').version + const binding = require('litesvm-core-darwin-universal') + const bindingPackageVersion = require('litesvm-core-darwin-universal/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -196,8 +196,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-darwin-x64') - const bindingPackageVersion = require('litesvm-darwin-x64/package.json').version + const binding = require('litesvm-core-darwin-x64') + const bindingPackageVersion = require('litesvm-core-darwin-x64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -212,8 +212,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-darwin-arm64') - const bindingPackageVersion = require('litesvm-darwin-arm64/package.json').version + const binding = require('litesvm-core-darwin-arm64') + const bindingPackageVersion = require('litesvm-core-darwin-arm64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -232,8 +232,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-freebsd-x64') - const bindingPackageVersion = require('litesvm-freebsd-x64/package.json').version + const binding = require('litesvm-core-freebsd-x64') + const bindingPackageVersion = require('litesvm-core-freebsd-x64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -248,8 +248,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-freebsd-arm64') - const bindingPackageVersion = require('litesvm-freebsd-arm64/package.json').version + const binding = require('litesvm-core-freebsd-arm64') + const bindingPackageVersion = require('litesvm-core-freebsd-arm64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -269,8 +269,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-x64-musl') - const bindingPackageVersion = require('litesvm-linux-x64-musl/package.json').version + const binding = require('litesvm-core-linux-x64-musl') + const bindingPackageVersion = require('litesvm-core-linux-x64-musl/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -285,8 +285,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-x64-gnu') - const bindingPackageVersion = require('litesvm-linux-x64-gnu/package.json').version + const binding = require('litesvm-core-linux-x64-gnu') + const bindingPackageVersion = require('litesvm-core-linux-x64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -303,8 +303,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-arm64-musl') - const bindingPackageVersion = require('litesvm-linux-arm64-musl/package.json').version + const binding = require('litesvm-core-linux-arm64-musl') + const bindingPackageVersion = require('litesvm-core-linux-arm64-musl/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -319,8 +319,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-arm64-gnu') - const bindingPackageVersion = require('litesvm-linux-arm64-gnu/package.json').version + const binding = require('litesvm-core-linux-arm64-gnu') + const bindingPackageVersion = require('litesvm-core-linux-arm64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -337,8 +337,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-arm-musleabihf') - const bindingPackageVersion = require('litesvm-linux-arm-musleabihf/package.json').version + const binding = require('litesvm-core-linux-arm-musleabihf') + const bindingPackageVersion = require('litesvm-core-linux-arm-musleabihf/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -353,8 +353,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-arm-gnueabihf') - const bindingPackageVersion = require('litesvm-linux-arm-gnueabihf/package.json').version + const binding = require('litesvm-core-linux-arm-gnueabihf') + const bindingPackageVersion = require('litesvm-core-linux-arm-gnueabihf/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -371,8 +371,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-loong64-musl') - const bindingPackageVersion = require('litesvm-linux-loong64-musl/package.json').version + const binding = require('litesvm-core-linux-loong64-musl') + const bindingPackageVersion = require('litesvm-core-linux-loong64-musl/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -387,8 +387,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-loong64-gnu') - const bindingPackageVersion = require('litesvm-linux-loong64-gnu/package.json').version + const binding = require('litesvm-core-linux-loong64-gnu') + const bindingPackageVersion = require('litesvm-core-linux-loong64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -405,8 +405,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-riscv64-musl') - const bindingPackageVersion = require('litesvm-linux-riscv64-musl/package.json').version + const binding = require('litesvm-core-linux-riscv64-musl') + const bindingPackageVersion = require('litesvm-core-linux-riscv64-musl/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -421,8 +421,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-riscv64-gnu') - const bindingPackageVersion = require('litesvm-linux-riscv64-gnu/package.json').version + const binding = require('litesvm-core-linux-riscv64-gnu') + const bindingPackageVersion = require('litesvm-core-linux-riscv64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -438,8 +438,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-ppc64-gnu') - const bindingPackageVersion = require('litesvm-linux-ppc64-gnu/package.json').version + const binding = require('litesvm-core-linux-ppc64-gnu') + const bindingPackageVersion = require('litesvm-core-linux-ppc64-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -454,8 +454,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-linux-s390x-gnu') - const bindingPackageVersion = require('litesvm-linux-s390x-gnu/package.json').version + const binding = require('litesvm-core-linux-s390x-gnu') + const bindingPackageVersion = require('litesvm-core-linux-s390x-gnu/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -474,8 +474,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-openharmony-arm64') - const bindingPackageVersion = require('litesvm-openharmony-arm64/package.json').version + const binding = require('litesvm-core-openharmony-arm64') + const bindingPackageVersion = require('litesvm-core-openharmony-arm64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -490,8 +490,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-openharmony-x64') - const bindingPackageVersion = require('litesvm-openharmony-x64/package.json').version + const binding = require('litesvm-core-openharmony-x64') + const bindingPackageVersion = require('litesvm-core-openharmony-x64/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -506,8 +506,8 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('litesvm-openharmony-arm') - const bindingPackageVersion = require('litesvm-openharmony-arm/package.json').version + const binding = require('litesvm-core-openharmony-arm') + const bindingPackageVersion = require('litesvm-core-openharmony-arm/package.json').version if (bindingPackageVersion !== '1.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { throw new Error(`Native binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } @@ -643,16 +643,16 @@ if (!nativeBinding || forceWasi) { let candidateError = null let candidateFailed = false try { - candidateError = __napiWasiResolveCandidate('litesvm-wasm32-wasi', true, undefined) + candidateError = __napiWasiResolveCandidate('litesvm-core-wasm32-wasi', true, undefined) candidateFailed = candidateError !== null if (!candidateFailed) { if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - const bindingPackageVersion = require('litesvm-wasm32-wasi/package.json').version + const bindingPackageVersion = require('litesvm-core-wasm32-wasi/package.json').version if (bindingPackageVersion !== '1.6.0') { throw new Error(`WASI binding package version mismatch, expected 1.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } } - wasiBinding = require('litesvm-wasm32-wasi') + wasiBinding = require('litesvm-core-wasm32-wasi') nativeBinding = wasiBinding wasiBindingLoaded = true } diff --git a/crates/node-litesvm-core/package.json b/crates/node-litesvm-core/package.json new file mode 100644 index 000000000..37bf79a04 --- /dev/null +++ b/crates/node-litesvm-core/package.json @@ -0,0 +1,46 @@ +{ + "name": "litesvm-core", + "version": "1.6.0", + "description": "Raw Node.js NAPI bindings for LiteSVM", + "main": "litesvm/index.js", + "types": "litesvm/index.d.ts", + "files": [ + "litesvm/" + ], + "napi": { + "binaryName": "litesvm", + "targets": [ + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl" + ] + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/LiteSVM/litesvm.git" + }, + "devDependencies": { + "@napi-rs/cli": "^3.8.6" + }, + "engines": { + "node": ">= 20" + }, + "scripts": { + "artifacts": "napi artifacts", + "build": "napi build --platform --release --output-dir litesvm --dts index.d.ts --js index.js", + "build:debug": "napi build --platform --output-dir litesvm --dts index.d.ts --js index.js", + "prepublishOnly": "napi prepublish -t npm --no-gh-release", + "fmt": "cargo fmt", + "lint": "cargo clippy", + "test": "node --test tests/*.test.js", + "universal": "napi universal", + "cargoBump": "cargo set-version --package litesvm-node --bump", + "bumpPatch": "yarn version patch && napi version && cargo tree", + "bumpMinor": "yarn version minor && napi version && cargo tree", + "bumpMajor": "yarn version major && napi version && cargo tree" + } +} diff --git a/crates/node-litesvm/src/account.rs b/crates/node-litesvm-core/src/account.rs similarity index 100% rename from crates/node-litesvm/src/account.rs rename to crates/node-litesvm-core/src/account.rs diff --git a/crates/node-litesvm/src/compute_budget.rs b/crates/node-litesvm-core/src/compute_budget.rs similarity index 100% rename from crates/node-litesvm/src/compute_budget.rs rename to crates/node-litesvm-core/src/compute_budget.rs diff --git a/crates/node-litesvm/src/feature_set.rs b/crates/node-litesvm-core/src/feature_set.rs similarity index 100% rename from crates/node-litesvm/src/feature_set.rs rename to crates/node-litesvm-core/src/feature_set.rs diff --git a/crates/node-litesvm/src/lib.rs b/crates/node-litesvm-core/src/lib.rs similarity index 100% rename from crates/node-litesvm/src/lib.rs rename to crates/node-litesvm-core/src/lib.rs diff --git a/crates/node-litesvm/src/native_mint.rs b/crates/node-litesvm-core/src/native_mint.rs similarity index 100% rename from crates/node-litesvm/src/native_mint.rs rename to crates/node-litesvm-core/src/native_mint.rs diff --git a/crates/node-litesvm/src/sysvar/clock.rs b/crates/node-litesvm-core/src/sysvar/clock.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/clock.rs rename to crates/node-litesvm-core/src/sysvar/clock.rs diff --git a/crates/node-litesvm/src/sysvar/epoch_rewards.rs b/crates/node-litesvm-core/src/sysvar/epoch_rewards.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/epoch_rewards.rs rename to crates/node-litesvm-core/src/sysvar/epoch_rewards.rs diff --git a/crates/node-litesvm/src/sysvar/epoch_schedule.rs b/crates/node-litesvm-core/src/sysvar/epoch_schedule.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/epoch_schedule.rs rename to crates/node-litesvm-core/src/sysvar/epoch_schedule.rs diff --git a/crates/node-litesvm/src/sysvar/mod.rs b/crates/node-litesvm-core/src/sysvar/mod.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/mod.rs rename to crates/node-litesvm-core/src/sysvar/mod.rs diff --git a/crates/node-litesvm/src/sysvar/rent.rs b/crates/node-litesvm-core/src/sysvar/rent.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/rent.rs rename to crates/node-litesvm-core/src/sysvar/rent.rs diff --git a/crates/node-litesvm/src/sysvar/slot_hashes.rs b/crates/node-litesvm-core/src/sysvar/slot_hashes.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/slot_hashes.rs rename to crates/node-litesvm-core/src/sysvar/slot_hashes.rs diff --git a/crates/node-litesvm/src/sysvar/slot_history.rs b/crates/node-litesvm-core/src/sysvar/slot_history.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/slot_history.rs rename to crates/node-litesvm-core/src/sysvar/slot_history.rs diff --git a/crates/node-litesvm/src/sysvar/stake_history.rs b/crates/node-litesvm-core/src/sysvar/stake_history.rs similarity index 100% rename from crates/node-litesvm/src/sysvar/stake_history.rs rename to crates/node-litesvm-core/src/sysvar/stake_history.rs diff --git a/crates/node-litesvm/src/transaction_error.rs b/crates/node-litesvm-core/src/transaction_error.rs similarity index 100% rename from crates/node-litesvm/src/transaction_error.rs rename to crates/node-litesvm-core/src/transaction_error.rs diff --git a/crates/node-litesvm/src/transaction_metadata.rs b/crates/node-litesvm-core/src/transaction_metadata.rs similarity index 100% rename from crates/node-litesvm/src/transaction_metadata.rs rename to crates/node-litesvm-core/src/transaction_metadata.rs diff --git a/crates/node-litesvm/src/util.rs b/crates/node-litesvm-core/src/util.rs similarity index 100% rename from crates/node-litesvm/src/util.rs rename to crates/node-litesvm-core/src/util.rs diff --git a/crates/node-litesvm-core/tests/smoke.test.js b/crates/node-litesvm-core/tests/smoke.test.js new file mode 100644 index 000000000..98c37fbf6 --- /dev/null +++ b/crates/node-litesvm-core/tests/smoke.test.js @@ -0,0 +1,20 @@ +const assert = require("node:assert/strict"); +const { test } = require("node:test"); +const { Account, LiteSvm, TransactionMetadata } = require(".."); + +test("core bindings work without a Solana JavaScript SDK", () => { + const svm = new LiteSvm(); + const address = new Uint8Array(32).fill(1); + const owner = new Uint8Array(32); + const data = new Uint8Array([1, 2, 3]); + + assert.equal(svm.getAccount(address), null); + assert(svm.airdrop(address, 1_000_000n) instanceof TransactionMetadata); + assert.equal(svm.getBalance(address), 1_000_000n); + + svm.setAccount(address, new Account(2_000_000n, data, owner, false, 0n)); + const account = svm.getAccount(address); + assert.deepEqual(account.data(), data); + assert.deepEqual(account.owner(), owner); + assert.equal(account.lamports(), 2_000_000n); +}); diff --git a/crates/node-litesvm-web3js/.gitignore b/crates/node-litesvm-web3js/.gitignore new file mode 100644 index 000000000..f4e2c6d6b --- /dev/null +++ b/crates/node-litesvm-web3js/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +*.tsbuildinfo diff --git a/crates/node-litesvm-web3js/README.md b/crates/node-litesvm-web3js/README.md new file mode 100644 index 000000000..d091209d8 --- /dev/null +++ b/crates/node-litesvm-web3js/README.md @@ -0,0 +1,57 @@ +# LiteSVM for Web3.js + +`litesvm-web3js` provides a Web3.js v3 interface for +[LiteSVM](https://github.com/LiteSVM/litesvm). It uses `litesvm-core` for native +execution and `@solana/web3.js@3.0.0-rc.2` for addresses, accounts, and +transactions. + +```sh +yarn add litesvm-web3js @solana/web3.js@3.0.0-rc.2 +``` + +Use the `litesvm` package instead when building transactions with +`@solana/kit`. + +## Example + +```ts +import { + FailedTransactionMetadata, + LiteSVM, +} from "litesvm-web3js"; +import { + Keypair, + LAMPORTS_PER_SOL, + SystemProgram, + Transaction, +} from "@solana/web3.js"; + +const svm = new LiteSVM(); +const payer = await Keypair.generate(); +const recipient = await Keypair.generate(); + +svm.airdrop(payer.publicKey, BigInt(LAMPORTS_PER_SOL)); + +const transaction = new Transaction({ + feePayer: payer.publicKey, + blockhash: svm.latestBlockhash(), + lastValidBlockHeight: 0n, +}).add( + SystemProgram.transfer({ + fromPubkey: payer.publicKey, + toPubkey: recipient.publicKey, + lamports: 1_000_000n, + }), +); + +await transaction.sign(payer); +const result = await svm.sendTransaction(transaction); +if (result instanceof FailedTransactionMetadata) { + throw new Error(`Transaction failed: ${result.err()}`); +} +``` + +Web3.js v3 signing and legacy transaction serialization are asynchronous, so +`sendTransaction` and `simulateTransaction` return promises in this package. +Account data uses `Uint8Array`; lamports, rent epochs, account space, slots, and +block heights use `bigint`. diff --git a/crates/node-litesvm-web3js/package.json b/crates/node-litesvm-web3js/package.json new file mode 100644 index 000000000..23e45e96d --- /dev/null +++ b/crates/node-litesvm-web3js/package.json @@ -0,0 +1,43 @@ +{ + "name": "litesvm-web3js", + "version": "1.6.0", + "description": "LiteSVM wrapper for @solana/web3.js v3", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist/" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/LiteSVM/litesvm.git" + }, + "dependencies": { + "litesvm-core": "workspace:*" + }, + "peerDependencies": { + "@solana/web3.js": "^3.0.0-rc.2" + }, + "devDependencies": { + "@solana/web3.js": "3.0.0-rc.2", + "@types/node": "22.20.1", + "rome": "^12.1.3", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.2.0", + "typescript": "^5.9.3" + }, + "engines": { + "node": ">= 20" + }, + "scripts": { + "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"", + "build": "yarn clean && tsc --build", + "prepublishOnly": "yarn build", + "fmt": "rome format --write src/ tests/ tsconfig.json package.json", + "lint": "rome check src/ tests/ tsconfig.json package.json", + "test": "node -r ts-node/register -r tsconfig-paths/register --test --test-concurrency=1 tests/*.test.ts", + "bumpPatch": "yarn version patch", + "bumpMinor": "yarn version minor", + "bumpMajor": "yarn version major" + } +} diff --git a/crates/node-litesvm-web3js/rome.json b/crates/node-litesvm-web3js/rome.json new file mode 100644 index 000000000..b946f01c1 --- /dev/null +++ b/crates/node-litesvm-web3js/rome.json @@ -0,0 +1,12 @@ +{ + "$schema": "./node_modules/rome/configuration_schema.json", + "organizeImports": { + "enabled": false + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + } +} diff --git a/crates/node-litesvm-web3js/src/index.ts b/crates/node-litesvm-web3js/src/index.ts new file mode 100644 index 000000000..f3daa6912 --- /dev/null +++ b/crates/node-litesvm-web3js/src/index.ts @@ -0,0 +1,583 @@ +import { + Account, + AddressAndAccount, + Clock, + ComputeBudget, + EpochRewards, + EpochSchedule, + FailedTransactionMetadata, + FeatureSet, + LiteSvm as LiteSVMInner, + Rent, + SimulatedTransactionInfo as SimulatedTransactionInfoInner, + SlotHash, + SlotHistory, + StakeHistory, + TransactionMetadata, +} from "litesvm-core"; +export { + Account, + Clock, + ComputeBudget, + EpochRewards, + EpochSchedule, + FailedTransactionMetadata, + FeatureSet, + InnerInstruction, + Rent, + SlotHash, + SlotHistory, + SlotHistoryCheck, + StakeHistory, + StakeHistoryEntry, + TransactionMetadata, + TransactionReturnData, +} from "litesvm-core"; +import { + AccountInfo, + Address, + Blockhash, + Transaction, + VersionedTransaction, +} from "@solana/web3.js"; + +export type AccountInfoBytes = Readonly< + AccountInfo & { space: bigint } +>; + +function toAccountInfo(acc: Account): AccountInfoBytes { + const data = acc.data(); + const owner = new Address(acc.owner()); + return { + executable: acc.executable(), + owner, + lamports: acc.lamports(), + data, + rentEpoch: acc.rentEpoch(), + space: BigInt(data.length), + }; +} + +function fromAccountInfo(acc: AccountInfoBytes): Account { + return new Account( + acc.lamports, + acc.data, + acc.owner.toBytes(), + acc.executable, + acc.rentEpoch, + ); +} + +function convertAddressAndAccount( + val: AddressAndAccount, +): [Address, AccountInfoBytes] { + return [new Address(val.address), toAccountInfo(val.account())]; +} + +async function serializeTransaction( + tx: Transaction | VersionedTransaction, + verifySignatures: boolean, +): Promise { + return tx instanceof Transaction + ? tx.serialize({ + requireAllSignatures: true, + verifySignatures, + }) + : tx.serialize(); +} + +export class SimulatedTransactionInfo { + constructor(inner: SimulatedTransactionInfoInner) { + this.inner = inner; + } + private inner: SimulatedTransactionInfoInner; + meta(): TransactionMetadata { + return this.inner.meta(); + } + postAccounts(): [Address, AccountInfoBytes][] { + return this.inner.postAccounts().map(convertAddressAndAccount); + } +} + +/** + * The main class in the litesvm library. + * + * Use this to send transactions, query accounts and configure the runtime. + */ +export class LiteSVM { + /** Create a new LiteSVM instance with standard functionality enabled */ + constructor() { + const inner = new LiteSVMInner(); + this.inner = inner; + } + private inner: LiteSVMInner; + + /** Create a new LiteSVM instance with minimal functionality enabled */ + static default(): LiteSVM { + const svm = new LiteSVM(); + const inner = LiteSVMInner.default(); + svm.inner = inner; + return svm; + } + + /** + * Restore a LiteSVM instance from a snapshot file written by {@link saveToFile}. + * @param path - The path of the snapshot file + * @returns A new LiteSVM instance with the saved state + */ + static loadFromFile(path: string): LiteSVM { + const svm = new LiteSVM(); + svm.inner = LiteSVMInner.loadFromFile(path); + return svm; + } + + /** + * Restore a LiteSVM instance from snapshot bytes produced by {@link toBytes}. + * @param bytes - The snapshot bytes + * @returns A new LiteSVM instance with the saved state + */ + static fromBytes(bytes: Uint8Array): LiteSVM { + const svm = new LiteSVM(); + svm.inner = LiteSVMInner.fromBytes(bytes); + return svm; + } + + /** + * Save the full state (accounts, sysvars, feature set, transaction history) + * to a file. Restore it with {@link LiteSVM.loadFromFile}. + * @param path - The path to write the snapshot to + */ + saveToFile(path: string) { + this.inner.saveToFile(path); + } + + /** + * Serialize the full state (accounts, sysvars, feature set, transaction history) + * to bytes. Restore it with {@link LiteSVM.fromBytes}. + * @returns The snapshot bytes + */ + toBytes(): Uint8Array { + return this.inner.toBytes(); + } + + /** + * Set the compute budget + * @param budget - The new compute budget + * @returns The modified LiteSVM instance + */ + withComputeBudget(budget: ComputeBudget): LiteSVM { + this.inner.setComputeBudget(budget); + return this; + } + + /** + * Enable or disable sigverify + * @param sigverify - if false, transaction signatures will not be checked. + * @returns The modified LiteSVM instance + */ + withSigverify(sigverify: boolean): LiteSVM { + this.inner.setSigverify(sigverify); + return this; + } + + /** + * Enables or disables transaction blockhash checking. + * @param check - If false, the blockhash check will be skipped + * @returns The modified LiteSVM instance + */ + withBlockhashCheck(check: boolean): LiteSVM { + this.inner.setBlockhashCheck(check); + return this; + } + + /** + * Sets up the standard sysvars. + * @returns The modified LiteSVM instance + */ + withSysvars(): LiteSVM { + this.inner.setSysvars(); + return this; + } + + /** + * Set the FeatureSet used by the VM instance. + * @param featureSet The FeatureSet to use. + * @returns The modified LiteSVM instance + */ + withFeatureSet(featureSet: FeatureSet): LiteSVM { + this.inner.setFeatureSet(featureSet); + return this; + } + + /** + * Adds the standard builtin programs. Use `withFeatureSet` beforehand to change change what builtins are added. + * @returns The modified LiteSVM instance + */ + withBuiltins(): LiteSVM { + this.inner.setBuiltins(); + return this; + } + + /** + * Changes the initial lamports in LiteSVM's airdrop account. + * @param lamports - The number of lamports to set in the airdrop account + * @returns The modified LiteSVM instance + */ + withLamports(lamports: bigint): LiteSVM { + this.inner.setLamports(lamports); + return this; + } + + /** + * Adds the standard SPL programs. + * @returns The modified LiteSVM instance + */ + withDefaultPrograms(): LiteSVM { + this.inner.setDefaultPrograms(); + return this; + } + + /** + * Adds the native mint accounts for SPL Token and Token-2022, if the programs are loaded. + * @returns The modified LiteSVM instance + */ + withNativeMints(): LiteSVM { + this.inner.withNativeMints(); + return this; + } + + /** + * Changes the capacity of the transaction history. + * @param capacity - How many transactions to store in history. + * Set this to 0 to disable transaction history and allow duplicate transactions. + * @returns The modified LiteSVM instance + */ + withTransactionHistory(capacity: bigint): LiteSVM { + this.inner.setTransactionHistory(capacity); + return this; + } + + /** + * Set a limit for transaction logs, beyond which they will be truncated. + * @param limit - The limit in bytes. If null, no limit is enforced. + * @returns The modified LiteSVM instance + */ + withLogBytesLimit(limit?: bigint): LiteSVM { + this.inner.setLogBytesLimit(limit); + return this; + } + + /** + * Adds the standard precompiles. Use `withFeatureSet` beforehand to change change what builtins are added. + * @returns The modified LiteSVM instance + */ + withPrecompiles(): LiteSVM { + this.inner.setPrecompiles(); + return this; + } + + /** + * Calculates the minimum balance required to make an account with specified data length rent exempt. + * @param dataLen - The number of bytes in the account. + * @returns The required balance in lamports + */ + minimumBalanceForRentExemption(dataLen: bigint): bigint { + return this.inner.minimumBalanceForRentExemption(dataLen); + } + + /** + * Return the account at the given address. + * If the account is not found, None is returned. + * @param address - The account address to look up. + * @returns The account object, if the account exists. + */ + getAccount(address: Address): AccountInfoBytes | null { + const inner = this.inner.getAccount(address.toBytes()); + return inner === null ? null : toAccountInfo(inner); + } + + /** + * Return all accounts owned by the given program, together with their addresses. + * @param programAddress - The owner program address to look up. + * @returns The list of accounts owned by the program. + */ + getProgramAccounts(programAddress: Address): [Address, AccountInfoBytes][] { + return this.inner + .getProgramAccounts(programAddress.toBytes()) + .map(convertAddressAndAccount); + } + + /** + * Create or overwrite an account, subverting normal runtime checks. + * + * This method exists to make it easier to set up artificial situations + * that would be difficult to replicate by sending individual transactions. + * Beware that it can be used to create states that would not be reachable + * by sending transactions! + * + * @param address - The address to write to. + * @param account - The account object to write. + */ + setAccount(address: Address, account: AccountInfoBytes) { + this.inner.setAccount(address.toBytes(), fromAccountInfo(account)); + } + + /** + * Gets the balance of the provided account address. + * @param address - The account address. + * @returns The account's balance in lamports. + */ + getBalance(address: Address): bigint | null { + return this.inner.getBalance(address.toBytes()); + } + + /** + * Gets the latest blockhash. + * Since LiteSVM doesn't have blocks, this is an arbitrary value controlled by LiteSVM + * @returns The designated latest blockhash. + */ + latestBlockhash(): Blockhash { + return this.inner.latestBlockhash() as Blockhash; + } + + /** + * Gets a transaction from the transaction history. + * @param signature - The transaction signature bytes + * @returns The transaction, if it is found in the history. + */ + getTransaction( + signature: Uint8Array, + ): TransactionMetadata | FailedTransactionMetadata | null { + return this.inner.getTransaction(signature); + } + + /** + * Airdrops the lamport amount specified to the given address. + * @param address The airdrop recipient. + * @param lamports - The amount to airdrop. + * @returns The transaction result. + */ + airdrop( + address: Address, + lamports: bigint, + ): TransactionMetadata | FailedTransactionMetadata | null { + return this.inner.airdrop(address.toBytes(), lamports); + } + + /** + * Adds an SBF program to the test environment from the file specified. + * @param programId - The program ID. + * @param path - The path to the .so file. + */ + addProgramFromFile(programId: Address, path: string) { + return this.inner.addProgramFromFile(programId.toBytes(), path); + } + + /** + * Adds am SBF program to the test environment. + * @param programId - The program ID. + * @param programBytes - The raw bytes of the compiled program. + */ + addProgram(programId: Address, programBytes: Uint8Array) { + return this.inner.addProgram(programId.toBytes(), programBytes); + } + + /** + * Adds an SBF program with a specific loader. + * @param programId - The program ID. + * @param programBytes - The raw bytes of the compiled program. + * @param loaderId - The loader program ID. + */ + addProgramWithLoader( + programId: Address, + programBytes: Uint8Array, + loaderId: Address, + ) { + return this.inner.addProgramWithLoader( + programId.toBytes(), + programBytes, + loaderId.toBytes(), + ); + } + + /** + * Processes a transaction and returns the result. + * @param tx - The transaction to send. + * @returns TransactionMetadata if the transaction succeeds, else FailedTransactionMetadata + */ + async sendTransaction( + tx: Transaction | VersionedTransaction, + ): Promise { + const internal = this.inner; + const serialized = await serializeTransaction(tx, internal.getSigverify()); + + if (tx instanceof Transaction) { + return internal.sendLegacyTransaction(serialized); + } + return internal.sendVersionedTransaction(serialized); + } + + /** + * Simulates a transaction + * @param tx The transaction to simulate + * @returns SimulatedTransactionInfo if simulation succeeds, else FailedTransactionMetadata + */ + async simulateTransaction( + tx: Transaction | VersionedTransaction, + ): Promise { + const internal = this.inner; + const serialized = await serializeTransaction(tx, internal.getSigverify()); + const inner = + tx instanceof Transaction + ? internal.simulateLegacyTransaction(serialized) + : internal.simulateVersionedTransaction(serialized); + return inner instanceof FailedTransactionMetadata + ? inner + : new SimulatedTransactionInfo(inner); + } + + /** + * Expires the current blockhash. + * The return value of `latestBlockhash()` will be different after calling this. + */ + expireBlockhash() { + this.inner.expireBlockhash(); + } + + /** + * Warps the clock to the specified slot. This is a convenience wrapper + * around `setClock()`. + * @param slot - The new slot. + */ + warpToSlot(slot: bigint) { + this.inner.warpToSlot(slot); + } + + /** + * Get the cluster clock. + * @returns the clock object. + */ + getClock(): Clock { + return this.inner.getClock(); + } + + /** + * Overwrite the clock sysvar. + * @param clock - The clock object. + */ + setClock(clock: Clock) { + this.inner.setClock(clock); + } + + /** + * Get the EpochRewards sysvar. + * @returns the EpochRewards object. + */ + getEpochRewards(): EpochRewards { + return this.inner.getEpochRewards(); + } + + /** + * Overwrite the EpochRewards sysvar. + * @param rewards - The EpochRewards object. + */ + setEpochRewards(rewards: EpochRewards) { + this.inner.setEpochRewards(rewards); + } + + /** + * Get the EpochSchedule sysvar. + * @returns the EpochSchedule object. + */ + getEpochSchedule(): EpochSchedule { + return this.inner.getEpochSchedule(); + } + + /** + * Overwrite the EpochSchedule sysvar. + * @param schedule - The EpochSchedule object. + */ + setEpochSchedule(schedule: EpochSchedule) { + this.inner.setEpochSchedule(schedule); + } + + /** + * Get the last restart slot sysvar. + * @returns the last restart slot. + */ + getLastRestartSlot(): bigint { + return this.inner.getLastRestartSlot(); + } + + /** + * Overwrite the last restart slot sysvar. + * @param slot - The last restart slot. + */ + setLastRestartSlot(slot: bigint) { + this.inner.setLastRestartSlot(slot); + } + + /** + * Get the cluster rent. + * @returns The rent object. + */ + getRent(): Rent { + return this.inner.getRent(); + } + + /** + * Overwrite the rent sysvar. + * @param rent - The new rent object. + */ + setRent(rent: Rent) { + this.inner.setRent(rent); + } + + /** + * Get the SlotHashes sysvar. + * @returns The SlotHash array. + */ + getSlotHashes(): SlotHash[] { + return this.inner.getSlotHashes(); + } + + /** + * Overwrite the SlotHashes sysvar. + * @param hashes - The SlotHash array. + */ + setSlotHashes(hashes: SlotHash[]) { + this.inner.setSlotHashes(hashes); + } + + /** + * Get the SlotHistory sysvar. + * @returns The SlotHistory object. + */ + getSlotHistory(): SlotHistory { + return this.inner.getSlotHistory(); + } + + /** + * Overwrite the SlotHistory sysvar. + * @param history - The SlotHistory object + */ + setSlotHistory(history: SlotHistory) { + this.inner.setSlotHistory(history); + } + + /** + * Get the StakeHistory sysvar. + * @returns The StakeHistory object. + */ + getStakeHistory(): StakeHistory { + return this.inner.getStakeHistory(); + } + + /** + * Overwrite the StakeHistory sysvar. + * @param history - The StakeHistory object + */ + setStakeHistory(history: StakeHistory) { + this.inner.setStakeHistory(history); + } +} diff --git a/crates/node-litesvm-web3js/tests/snapshot.test.ts b/crates/node-litesvm-web3js/tests/snapshot.test.ts new file mode 100644 index 000000000..b68cf18a4 --- /dev/null +++ b/crates/node-litesvm-web3js/tests/snapshot.test.ts @@ -0,0 +1,36 @@ +import { Keypair } from "@solana/web3.js"; +import { LiteSVM, TransactionMetadata } from "litesvm-web3js"; +import assert from "node:assert/strict"; +import { mkdtempSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { test } from "node:test"; + +test("web3.js snapshots round trip through bytes and files", async () => { + const svm = new LiteSVM(); + const { publicKey } = await Keypair.generate(); + assert(svm.airdrop(publicKey, 1_000_000n) instanceof TransactionMetadata); + svm.warpToSlot(42n); + const directory = mkdtempSync(join(tmpdir(), "litesvm-web3js-snapshot-")); + try { + const path = join(directory, "state.bin"); + svm.saveToFile(path); + for (const restored of [ + LiteSVM.fromBytes(svm.toBytes()), + LiteSVM.loadFromFile(path), + ]) { + assert(restored instanceof LiteSVM); + assert.deepEqual(restored.getAccount(publicKey), svm.getAccount(publicKey)); + assert.equal(restored.getClock().slot, 42n); + assert.equal(restored.latestBlockhash(), svm.latestBlockhash()); + restored.warpToSlot(43n); + assert.equal(svm.getClock().slot, 42n); + } + } finally { + rmSync(directory, { recursive: true, force: true }); + } + assert.throws( + () => LiteSVM.fromBytes(new Uint8Array([255, 1, 2, 3])), + /Failed to load snapshot/, + ); +}); diff --git a/crates/node-litesvm-web3js/tests/web3jsSmoke.test.ts b/crates/node-litesvm-web3js/tests/web3jsSmoke.test.ts new file mode 100644 index 000000000..82fc0401e --- /dev/null +++ b/crates/node-litesvm-web3js/tests/web3jsSmoke.test.ts @@ -0,0 +1,144 @@ +import { + FailedTransactionMetadata, + LiteSVM, + TransactionMetadata, + type AccountInfoBytes, +} from "litesvm-web3js"; +import assert from "node:assert/strict"; +import { test } from "node:test"; +import { + Address, + Keypair, + LAMPORTS_PER_SOL, + SystemProgram, + Transaction, + TransactionMessage, + VersionedTransaction, +} from "@solana/web3.js"; + +test("web3.js legacy transactions can simulate, send, and read state", async () => { + const svm = new LiteSVM(); + const [payer, recipientKeypair, dataKeypair] = await Promise.all([ + Keypair.generate(), + Keypair.generate(), + Keypair.generate(), + ]); + const recipient = recipientKeypair.publicKey; + + const airdropResult = svm.airdrop( + payer.publicKey, + BigInt(LAMPORTS_PER_SOL), + ); + assert(!(airdropResult instanceof FailedTransactionMetadata)); + + const transferLamports = 1_000_000n; + const transaction = new Transaction({ + feePayer: payer.publicKey, + blockhash: svm.latestBlockhash(), + lastValidBlockHeight: 0n, + }).add( + SystemProgram.transfer({ + fromPubkey: payer.publicKey, + toPubkey: recipient, + lamports: transferLamports, + }), + ); + await transaction.sign(payer); + + const simulation = await svm.simulateTransaction(transaction); + assert(!(simulation instanceof FailedTransactionMetadata)); + const postAccounts: [Address, AccountInfoBytes][] = simulation.postAccounts(); + const simulatedRecipient = postAccounts.find(([address]) => + address.equals(recipient), + )?.[1]; + assert(simulatedRecipient); + assert(simulatedRecipient.owner instanceof Address); + assert.equal(simulatedRecipient.lamports, transferLamports); + + const result = await svm.sendTransaction(transaction); + assert(result instanceof TransactionMetadata); + assert.strictEqual(svm.getBalance(recipient), transferLamports); + assert(transaction.signature !== null); + assert(svm.getTransaction(transaction.signature) instanceof TransactionMetadata); + + const recipientAccount = svm.getAccount(recipient); + assert(recipientAccount !== null); + assert(recipientAccount.owner instanceof Address); + assert.equal(recipientAccount.space, 0n); + assert.deepEqual(simulatedRecipient, recipientAccount); + + const account: AccountInfoBytes = { + executable: false, + owner: Address.default, + lamports: BigInt(LAMPORTS_PER_SOL), + data: new Uint8Array([1, 2, 3]), + rentEpoch: 0n, + space: 3n, + }; + svm.setAccount(dataKeypair.publicKey, account); + assert.deepStrictEqual(svm.getAccount(dataKeypair.publicKey)?.data, account.data); + const programAccounts = svm.getProgramAccounts(Address.default); + assert( + programAccounts.some( + ([address, programAccount]) => + address.equals(dataKeypair.publicKey) && + programAccount.space === account.space, + ), + ); +}); + +test("web3.js v0 transactions use the versioned native path", async () => { + const svm = new LiteSVM(); + const [payer, recipient] = await Promise.all([ + Keypair.generate(), + Keypair.generate(), + ]); + svm.airdrop(payer.publicKey, BigInt(LAMPORTS_PER_SOL)); + + const transferLamports = 2_000_000n; + const message = new TransactionMessage({ + payerKey: payer.publicKey, + recentBlockhash: svm.latestBlockhash(), + instructions: [ + SystemProgram.transfer({ + fromPubkey: payer.publicKey, + toPubkey: recipient.publicKey, + lamports: transferLamports, + }), + ], + }).compileToV0Message(); + const transaction = new VersionedTransaction(message); + await transaction.sign([payer]); + + const result = await svm.sendTransaction(transaction); + assert(result instanceof TransactionMetadata); + assert.equal(svm.getBalance(recipient.publicKey), transferLamports); + assert(svm.getTransaction(transaction.signatures[0]) instanceof TransactionMetadata); +}); + +test("disabled signature verification accepts an invalid legacy signature", async () => { + const svm = new LiteSVM().withSigverify(false); + const [payer, recipient] = await Promise.all([ + Keypair.generate(), + Keypair.generate(), + ]); + svm.airdrop(payer.publicKey, BigInt(LAMPORTS_PER_SOL)); + + const transaction = new Transaction({ + feePayer: payer.publicKey, + blockhash: svm.latestBlockhash(), + lastValidBlockHeight: 0n, + }).add( + SystemProgram.transfer({ + fromPubkey: payer.publicKey, + toPubkey: recipient.publicKey, + lamports: 1_000_000n, + }), + ); + await transaction.sign(payer); + transaction.signatures[0].signature = new Uint8Array(64).fill(42); + + const result = await svm.sendTransaction(transaction); + assert(result instanceof TransactionMetadata); + assert.equal(svm.getBalance(recipient.publicKey), 1_000_000n); +}); diff --git a/crates/node-litesvm-web3js/tsconfig.json b/crates/node-litesvm-web3js/tsconfig.json new file mode 100644 index 000000000..8a9f87420 --- /dev/null +++ b/crates/node-litesvm-web3js/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "declaration": true, + "module": "CommonJS", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "target": "es2020", + "noImplicitAny": true, + "sourceMap": true, + "outDir": "dist", + "baseUrl": "./src", + "paths": { + "litesvm-web3js": ["./"] + }, + "resolveJsonModule": true, + "skipLibCheck": true + }, + "include": ["src/**/*"] +} diff --git a/crates/node-litesvm/README.md b/crates/node-litesvm/README.md index ae52d547d..b3179f9e5 100644 --- a/crates/node-litesvm/README.md +++ b/crates/node-litesvm/README.md @@ -9,6 +9,10 @@ This is the NodeJS wrapper for [LiteSVM](https://github.com/LiteSVM/litesvm). It brings best-in-class Solana testing to NodeJS, giving you a powerful, fast and ergonomic way to test Solana programs in TS/JS. +This package provides the `@solana/kit` API and delegates native execution to +`litesvm-core`. Install `litesvm-web3js` instead when using +`@solana/web3.js` v3. + For a standard testing workflow, LiteSVM offers an experience superior to `solana-test-validator` (slow, unwieldy) and `bankrun` (reasonably fast and powerful, but inherits a lot of warts from `solana-program-test`). @@ -84,4 +88,14 @@ yarn add litesvm Make sure you have Yarn and the Rust toolchain installed. -Then run `yarn` to install deps, run `yarn build` to build the binary and `yarn test` to run the tests. +From the repository root, run: + +```sh +yarn install --immutable +yarn build +yarn test +``` + +The root build compiles the native binary and both wrappers. Running `yarn build` +inside this package only compiles TypeScript; to build the native binary from +there, run `yarn workspace litesvm-core build` first. diff --git a/crates/node-litesvm/litesvm/index.ts b/crates/node-litesvm/litesvm/index.ts index 727285734..b72dcf4fa 100644 --- a/crates/node-litesvm/litesvm/index.ts +++ b/crates/node-litesvm/litesvm/index.ts @@ -34,7 +34,7 @@ import { SlotHistory, StakeHistory, TransactionMetadata, -} from "./internal"; +} from "litesvm-core"; export { Account, Clock, @@ -52,7 +52,7 @@ export { StakeHistoryEntry, TransactionMetadata, TransactionReturnData, -} from "./internal"; +} from "litesvm-core"; function toEncodedAccount(address: Address, account: Account): EncodedAccount { const data = account.data(); diff --git a/crates/node-litesvm/package.json b/crates/node-litesvm/package.json index 00d238cc8..2df4d3b11 100644 --- a/crates/node-litesvm/package.json +++ b/crates/node-litesvm/package.json @@ -6,17 +6,6 @@ "files": [ "dist/" ], - "napi": { - "binaryName": "litesvm", - "targets": [ - "x86_64-apple-darwin", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-apple-darwin", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl" - ] - }, "license": "MIT", "repository": { "type": "git", @@ -25,10 +14,13 @@ "dependencies": { "@solana-program/system": "^0.14.0", "@solana-program/token": "^0.16.0", + "litesvm-core": "workspace:*" + }, + "peerDependencies": { "@solana/kit": "^8.0.0" }, "devDependencies": { - "@napi-rs/cli": "^3.8.6", + "@solana/kit": "^8.0.0", "@types/node": "22.20.1", "rome": "^12.1.3", "ts-node": "^10.9.2", @@ -43,27 +35,21 @@ "node": ">= 20" }, "scripts": { - "artifacts": "napi artifacts", - "build": "napi build --platform --release --output-dir litesvm --dts internal.d.ts --js internal.js", - "build:debug": "napi build --platform litesvm --dts internal.d.ts --js internal.js", - "prepublishOnly": "napi prepublish -t npm --no-gh-release", - "fmt": "yarn fmt:rust && yarn fmt:js", - "fmt:rust": "cargo fmt", + "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"", + "build": "yarn clean && tsc --build", + "prepublishOnly": "yarn build", + "fmt": "yarn fmt:js", "fmt:js": "rome format --write litesvm/index.ts tests/ tsconfig.json package.json", - "lint": "yarn lint:rust && yarn lint:js", - "lint:rust": "cargo clippy", + "lint": "yarn lint:js", "lint:js": "rome check litesvm/index.ts tests/ tsconfig.json package.json", "test": "node -r ts-node/register -r tsconfig-paths/register --max-old-space-size=4096 --test --test-concurrency=1 tests/*.test.ts", - "build:js": "tsc --build && cp litesvm/internal.d.ts dist/internal.d.ts", - "universal": "napi universal", - "cargoBump": "cargo set-version --package litesvm-node --bump", - "bumpPatch": "yarn version patch && napi version && cargo tree", - "bumpMinor": "yarn version minor && napi version && cargo tree", - "bumpMajor": "yarn version major && napi version && cargo tree", + "build:js": "yarn build", + "bumpPatch": "yarn version patch", + "bumpMinor": "yarn version minor", + "bumpMajor": "yarn version major", "predocs": "typedoc", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:preview": "vitepress preview docs" - }, - "packageManager": "yarn@4.10.3" + } } diff --git a/crates/node-litesvm/tests/computeLimit.test.ts b/crates/node-litesvm/tests/computeLimit.test.ts index ccf7788db..8f3fe6a6c 100644 --- a/crates/node-litesvm/tests/computeLimit.test.ts +++ b/crates/node-litesvm/tests/computeLimit.test.ts @@ -1,6 +1,6 @@ import { generateKeyPairSigner, lamports } from "@solana/kit"; -import { TransactionErrorFieldless } from "internal"; import { FailedTransactionMetadata, LiteSVM } from "litesvm"; +import { TransactionErrorFieldless } from "litesvm-core"; import assert from "node:assert/strict"; import { test } from "node:test"; import { diff --git a/crates/node-litesvm/tests/getTransaction.test.ts b/crates/node-litesvm/tests/getTransaction.test.ts index ebdf0377d..def435d9d 100644 --- a/crates/node-litesvm/tests/getTransaction.test.ts +++ b/crates/node-litesvm/tests/getTransaction.test.ts @@ -3,7 +3,6 @@ import { getSignatureFromTransaction, lamports, } from "@solana/kit"; -import { TransactionMetadata } from "internal"; import assert from "node:assert/strict"; import { test } from "node:test"; import { @@ -14,7 +13,7 @@ import { setHelloWorldAccount, setHelloWorldProgram, } from "./util"; -import { LiteSVM } from "index"; +import { LiteSVM, TransactionMetadata } from "litesvm"; test("get transaction", async () => { // Given the following addresses and signers. diff --git a/crates/node-litesvm/tests/nonExistentProgram.test.ts b/crates/node-litesvm/tests/nonExistentProgram.test.ts index 0b41ec5ab..532d7bf15 100644 --- a/crates/node-litesvm/tests/nonExistentProgram.test.ts +++ b/crates/node-litesvm/tests/nonExistentProgram.test.ts @@ -1,6 +1,6 @@ import { generateKeyPairSigner, lamports } from "@solana/kit"; -import { TransactionErrorFieldless } from "internal"; import { FailedTransactionMetadata, LiteSVM } from "litesvm"; +import { TransactionErrorFieldless } from "litesvm-core"; import assert from "node:assert/strict"; import { test } from "node:test"; import { diff --git a/package.json b/package.json new file mode 100644 index 000000000..a8bde850c --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "private": true, + "packageManager": "yarn@4.10.3", + "workspaces": [ + "crates/node-litesvm-core", + "crates/node-litesvm", + "crates/node-litesvm-web3js" + ], + "scripts": { + "build": "yarn build:core && yarn workspace litesvm build && yarn workspace litesvm-web3js build", + "build:debug": "yarn build:core:debug && yarn workspace litesvm build && yarn workspace litesvm-web3js build", + "build:core": "yarn workspace litesvm-core build", + "build:core:debug": "yarn workspace litesvm-core build:debug", + "test": "yarn test:core && yarn workspace litesvm test && yarn workspace litesvm-web3js test", + "lint": "yarn workspace litesvm-core lint && yarn workspace litesvm lint && yarn workspace litesvm-web3js lint", + "test:core": "yarn workspace litesvm-core test" + } +} diff --git a/crates/node-litesvm/yarn.lock b/yarn.lock similarity index 85% rename from crates/node-litesvm/yarn.lock rename to yarn.lock index b63d35193..ac2cebe85 100644 --- a/crates/node-litesvm/yarn.lock +++ b/yarn.lock @@ -1418,6 +1418,22 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.4.2": + version: 1.9.7 + resolution: "@noble/curves@npm:1.9.7" + dependencies: + "@noble/hashes": "npm:1.8.0" + checksum: 10c0/150014751ebe8ca06a8654ca2525108452ea9ee0be23430332769f06808cddabfe84f248b6dbf836916bc869c27c2092957eec62c7506d68a1ed0a624017c2a3 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.4.0": + version: 1.8.0 + resolution: "@noble/hashes@npm:1.8.0" + checksum: 10c0/06a0b52c81a6fa7f04d67762e08b2c476a00285858150caeaaff4037356dd5e119f45b2a530f638b77a5eeca013168ec1b655db41bae3236cb2e9d511484fc77 + languageName: node + linkType: hard + "@npmcli/agent@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/agent@npm:3.0.0" @@ -1871,6 +1887,51 @@ __metadata: languageName: node linkType: hard +"@solana-program/address-lookup-table@npm:^0.11.0": + version: 0.11.0 + resolution: "@solana-program/address-lookup-table@npm:0.11.0" + peerDependencies: + "@solana/kit": ^6.0 + checksum: 10c0/28271e452a9e6caa1cb5ad0365cf7f4a193920fd3fd3f5261fa655fb84e7b6a3d911e602125ad5718cdb4a8d6980e09d54f9f97016423b9d13051c3dde332cac + languageName: node + linkType: hard + +"@solana-program/compute-budget@npm:^0.15.0": + version: 0.15.0 + resolution: "@solana-program/compute-budget@npm:0.15.0" + peerDependencies: + "@solana/kit": ^6.3.0 + checksum: 10c0/b2c29063932dee2f5da77d63ab7db95834a0c6fc6ff79f99951093accebdd942d14a6db5bd97412a0e8b58f8b4e0ed20c084e60389ce6751da39afdd651a9d2b + languageName: node + linkType: hard + +"@solana-program/loader-v3@npm:^0.3.0": + version: 0.3.0 + resolution: "@solana-program/loader-v3@npm:0.3.0" + peerDependencies: + "@solana/kit": ^6.0.0 + checksum: 10c0/b1acdf7591f96b41e99b3dbd4b64eb77887a4e4c954e35046bc89402acc8c76f7938e8f9be7decb6aaf6bbb9c6c04fce8b3d761f5803d6cddb5294b69d9ee528 + languageName: node + linkType: hard + +"@solana-program/stake@npm:^0.6.1": + version: 0.6.1 + resolution: "@solana-program/stake@npm:0.6.1" + peerDependencies: + "@solana/kit": ^6.0 + checksum: 10c0/8f4fa7e54f2509ee968c11057f001f1123e1a94b6820f9a9d1ba2894db4352e3078f3321d0ea95365c093546e4989197e0daff80a7a4ba4d193a2f5a4124863e + languageName: node + linkType: hard + +"@solana-program/system@npm:^0.12.0": + version: 0.12.2 + resolution: "@solana-program/system@npm:0.12.2" + peerDependencies: + "@solana/kit": ^6.4.0 + checksum: 10c0/cb57baf73d2b6c56ed5c43cf08839afbd37e1bbeef1df2c7af33d0d6e413db62e5bb825db749ca3ef4486a3f60195b3ae3e9298232774fea4fd5514374bff292 + languageName: node + linkType: hard + "@solana-program/system@npm:^0.14.0": version: 0.14.0 resolution: "@solana-program/system@npm:0.14.0" @@ -1891,6 +1952,25 @@ __metadata: languageName: node linkType: hard +"@solana/accounts@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/accounts@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/rpc-spec": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/ba28efb46aa8e83723cbe93e7e4f364f0d1b5cbc53e59529a39dcc2f9df0f57f47ce65519341b41ae7798971cd0a28e42f94f0b4b9cc6e2f4163c09865770ab5 + languageName: node + linkType: hard + "@solana/accounts@npm:8.0.0": version: 8.0.0 resolution: "@solana/accounts@npm:8.0.0" @@ -1910,6 +1990,24 @@ __metadata: languageName: node linkType: hard +"@solana/addresses@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/addresses@npm:6.10.0" + dependencies: + "@solana/assertions": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/5169bb86b4d04c53c1d7cf531df59e855a5c8353e46686a18697f197ba906053bbf252beee2862f039e6abcf7dfe23345c73d8ff8311af6899125af78dc6692b + languageName: node + linkType: hard + "@solana/addresses@npm:8.0.0": version: 8.0.0 resolution: "@solana/addresses@npm:8.0.0" @@ -1928,6 +2026,20 @@ __metadata: languageName: node linkType: hard +"@solana/assertions@npm:6.10.0, @solana/assertions@npm:^6.8.0": + version: 6.10.0 + resolution: "@solana/assertions@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/a3d27741db5424e0ef54bc788d10eac206a4fd278a19dbe0a3a34fd22c33cd8e08930af04b10cd1faa1d559230f4de2f3705518cf651f0ed568b411a3e6e44f7 + languageName: node + linkType: hard + "@solana/assertions@npm:8.0.0": version: 8.0.0 resolution: "@solana/assertions@npm:8.0.0" @@ -1942,6 +2054,20 @@ __metadata: languageName: node linkType: hard +"@solana/codecs-core@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/codecs-core@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/eadf65a0298c3c8b170c5ab02a7963777799463c0134f06af9999c6992c3ba97988be4cbe5efbf0001397efdac960fa59ebbf3e40b721dd40e2bc1a0b9fead2c + languageName: node + linkType: hard + "@solana/codecs-core@npm:8.0.0": version: 8.0.0 resolution: "@solana/codecs-core@npm:8.0.0" @@ -1956,6 +2082,22 @@ __metadata: languageName: node linkType: hard +"@solana/codecs-data-structures@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/codecs-data-structures@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/523984f42fd68ad1f3f0da10ee2a8d417af99fcc804a4adb2ade082766fbfa3a5d4a3d0ef15fd521e8f8f4ca8d825e536d783a4edf5b336e4ec88a3a451c5377 + languageName: node + linkType: hard + "@solana/codecs-data-structures@npm:8.0.0": version: 8.0.0 resolution: "@solana/codecs-data-structures@npm:8.0.0" @@ -1972,6 +2114,21 @@ __metadata: languageName: node linkType: hard +"@solana/codecs-numbers@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/codecs-numbers@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/9ff619b50c51d86a8b6ad39f5fe12f336b55ba45f30057b9bade94ef53c03f3b86d8eef8858d7ebb9777c559d28609e9c35fdc4d80ac6ba26614d0fef98f87fa + languageName: node + linkType: hard + "@solana/codecs-numbers@npm:8.0.0": version: 8.0.0 resolution: "@solana/codecs-numbers@npm:8.0.0" @@ -1987,6 +2144,25 @@ __metadata: languageName: node linkType: hard +"@solana/codecs-strings@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/codecs-strings@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + typescript: ">=5.4.0" + peerDependenciesMeta: + fastestsmallesttextencoderdecoder: + optional: true + typescript: + optional: true + checksum: 10c0/b1144f4e180c13fdd9926b085336c82fee145e6a7104d7b68eb95d7ccccbf4650b47fd2cee1f5c823cab67c989251d91c64fcaa107c8ad61f7ed192f07ab4b25 + languageName: node + linkType: hard + "@solana/codecs-strings@npm:8.0.0": version: 8.0.0 resolution: "@solana/codecs-strings@npm:8.0.0" @@ -2006,6 +2182,25 @@ __metadata: languageName: node linkType: hard +"@solana/codecs@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/codecs@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/fixed-points": "npm:6.10.0" + "@solana/options": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/d92b0350dd33da2245aac5795d0ec72a076f9490803ffcdd9c9f98405f746c9ff22d19e17b3cebb21322cc63f356d84436124cfa7a7d6623eb33bd0eba6551c2 + languageName: node + linkType: hard + "@solana/codecs@npm:8.0.0": version: 8.0.0 resolution: "@solana/codecs@npm:8.0.0" @@ -2025,6 +2220,23 @@ __metadata: languageName: node linkType: hard +"@solana/errors@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/errors@npm:6.10.0" + dependencies: + chalk: "npm:5.6.2" + commander: "npm:15.0.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + bin: + errors: bin/cli.mjs + checksum: 10c0/fe81aed0b2e026b707d24a742a941bb55d620f3d5b4a673ee1c56b700d8928e26e6ad29d462821a73b9653ca75e2bded1ee384bbfd2f1f845dd5ba52fe0b1323 + languageName: node + linkType: hard + "@solana/errors@npm:8.0.0": version: 8.0.0 resolution: "@solana/errors@npm:8.0.0" @@ -2042,6 +2254,18 @@ __metadata: languageName: node linkType: hard +"@solana/fast-stable-stringify@npm:6.10.0, @solana/fast-stable-stringify@npm:^6.8.0": + version: 6.10.0 + resolution: "@solana/fast-stable-stringify@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/1a9d7bf7b6efe946866993e250b900f3a709520deb4c934c2935bc28b09ebce19e30b0a9fdad04b05fbd83f1cb81ad3f1ff03e480bdbc77dd69f01bbd5666744 + languageName: node + linkType: hard + "@solana/fast-stable-stringify@npm:8.0.0": version: 8.0.0 resolution: "@solana/fast-stable-stringify@npm:8.0.0" @@ -2054,6 +2278,21 @@ __metadata: languageName: node linkType: hard +"@solana/fixed-points@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/fixed-points@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/2bef959422a1bc0a8d2b27a16f76a832b38c60a5b6f8ff92e7e5628c1613b4f1b2150b7e0bb2fd3ba1dd0872ef75366c4539951af1bb5cea8d7fa27f1f5c3285 + languageName: node + linkType: hard + "@solana/fixed-points@npm:8.0.0": version: 8.0.0 resolution: "@solana/fixed-points@npm:8.0.0" @@ -2069,6 +2308,18 @@ __metadata: languageName: node linkType: hard +"@solana/functional@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/functional@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/ecd3a49e12a3c4afe985d8f7c37f6e0744159d89d5fba984c44b56e20a7ebdbf0ebe29731ccbb59f8d7edd73c7c8ae29570b8d05eeea9b39172158207d114a37 + languageName: node + linkType: hard + "@solana/functional@npm:8.0.0": version: 8.0.0 resolution: "@solana/functional@npm:8.0.0" @@ -2081,6 +2332,25 @@ __metadata: languageName: node linkType: hard +"@solana/instruction-plans@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/instruction-plans@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/0c647c018e96761bf0918ce9674c31f8df98b8b90ee56d8a3bb800e183ee5419a467f89a58cd910815fb21924bfc2b94b319fe85bb84350f9a13a5d1062c82c6 + languageName: node + linkType: hard + "@solana/instruction-plans@npm:8.0.0": version: 8.0.0 resolution: "@solana/instruction-plans@npm:8.0.0" @@ -2100,6 +2370,21 @@ __metadata: languageName: node linkType: hard +"@solana/instructions@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/instructions@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/2e87a599778c9e0c96517020192af0e7a3fb291c1c0e07743d2dbe4bd44521de01009af37591dcc3a145859386164f71d3d78ba3d558c685de9eeb97339c4967 + languageName: node + linkType: hard + "@solana/instructions@npm:8.0.0": version: 8.0.0 resolution: "@solana/instructions@npm:8.0.0" @@ -2115,6 +2400,25 @@ __metadata: languageName: node linkType: hard +"@solana/keys@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/keys@npm:6.10.0" + dependencies: + "@solana/assertions": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/d8ddd66d5ac6c3b07167c25f8ca204fbe90e51456a78e20942a3ff9321d160e1776f564c663e88bcfb58746a55cac13354c6d7d66cb02acf0ab161eb33f72b0a + languageName: node + linkType: hard + "@solana/keys@npm:8.0.0": version: 8.0.0 resolution: "@solana/keys@npm:8.0.0" @@ -2134,6 +2438,44 @@ __metadata: languageName: node linkType: hard +"@solana/kit@npm:^6.8.0": + version: 6.10.0 + resolution: "@solana/kit@npm:6.10.0" + dependencies: + "@solana/accounts": "npm:6.10.0" + "@solana/addresses": "npm:6.10.0" + "@solana/codecs": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/instruction-plans": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/offchain-messages": "npm:6.10.0" + "@solana/plugin-core": "npm:6.10.0" + "@solana/plugin-interfaces": "npm:6.10.0" + "@solana/program-client-core": "npm:6.10.0" + "@solana/programs": "npm:6.10.0" + "@solana/rpc": "npm:6.10.0" + "@solana/rpc-api": "npm:6.10.0" + "@solana/rpc-parsed-types": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/rpc-subscriptions": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/signers": "npm:6.10.0" + "@solana/subscribable": "npm:6.10.0" + "@solana/sysvars": "npm:6.10.0" + "@solana/transaction-confirmation": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/234f81edb07910d56ebf8962e6a8bdff2814be84567b007687794e53df80b61fb21614bf87145abd6223e28eae1a270df1d302bfe4230cae42413cab06b32222 + languageName: node + linkType: hard + "@solana/kit@npm:^8.0.0": version: 8.0.0 resolution: "@solana/kit@npm:8.0.0" @@ -2174,6 +2516,18 @@ __metadata: languageName: node linkType: hard +"@solana/nominal-types@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/nominal-types@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/b7d50e18278e5b4529778b0d8f350f2cd83fee63e16731b41d1727a9990450656c57628361ccac64d9f091f3ead7070cd886d411d6824494a6899e525a655cc1 + languageName: node + linkType: hard + "@solana/nominal-types@npm:8.0.0": version: 8.0.0 resolution: "@solana/nominal-types@npm:8.0.0" @@ -2186,6 +2540,27 @@ __metadata: languageName: node linkType: hard +"@solana/offchain-messages@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/offchain-messages@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/ec24fe2e072da23f3ebe4b8bb293a8f6cd4f8e4d51153096723322ce4100d39748c073beca7a0444d0199a4f8989158f9c25ff6c75d9433c9a6f55e4975334fb + languageName: node + linkType: hard + "@solana/offchain-messages@npm:8.0.0": version: 8.0.0 resolution: "@solana/offchain-messages@npm:8.0.0" @@ -2207,6 +2582,24 @@ __metadata: languageName: node linkType: hard +"@solana/options@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/options@npm:6.10.0" + dependencies: + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/4f750bbabee7e8a073d5c8697dc29d81672f1e08a272c5e8b22b53244de5a2dffb384205777c964fd080caf3be2cc8230f20a5cd8c4ef8587daff7c54033642f + languageName: node + linkType: hard + "@solana/options@npm:8.0.0": version: 8.0.0 resolution: "@solana/options@npm:8.0.0" @@ -2225,6 +2618,18 @@ __metadata: languageName: node linkType: hard +"@solana/plugin-core@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/plugin-core@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/f8295296702146f952ba466d7eadc12440855a33955c2a07b2e54e12de8af1a345b9b46fcbb100554947fb19bad21adfb3f1d2c1271ea19aaf75d47d009f6ec8 + languageName: node + linkType: hard + "@solana/plugin-core@npm:8.0.0": version: 8.0.0 resolution: "@solana/plugin-core@npm:8.0.0" @@ -2237,6 +2642,26 @@ __metadata: languageName: node linkType: hard +"@solana/plugin-interfaces@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/plugin-interfaces@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/instruction-plans": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/rpc-spec": "npm:6.10.0" + "@solana/rpc-subscriptions-spec": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/signers": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/844485f3f65e1297d8813a03e7f3007536f34b88bf2de01fd37ddf51ac0f944a184da00b168ac611a95987e1d9cc895789fc11fc858a7b9e8ed32a832e4cf65b + languageName: node + linkType: hard + "@solana/plugin-interfaces@npm:8.0.0": version: 8.0.0 resolution: "@solana/plugin-interfaces@npm:8.0.0" @@ -2259,6 +2684,28 @@ __metadata: languageName: node linkType: hard +"@solana/program-client-core@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/program-client-core@npm:6.10.0" + dependencies: + "@solana/accounts": "npm:6.10.0" + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/instruction-plans": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/plugin-interfaces": "npm:6.10.0" + "@solana/rpc-api": "npm:6.10.0" + "@solana/signers": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/839ef123431999e7ed83930bcf22329072bdfe9692a0e1126b36c159a6fbb8f3c3db2e4a3d3867dd3d62ef0e4515c18c64af3b88b9828421866dc5568e525e52 + languageName: node + linkType: hard + "@solana/program-client-core@npm:8.0.0": version: 8.0.0 resolution: "@solana/program-client-core@npm:8.0.0" @@ -2281,6 +2728,21 @@ __metadata: languageName: node linkType: hard +"@solana/programs@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/programs@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/2cc2f0df31d908ed338f810a8d5c775566db9a45fc7537574a517518b52665aa61849479344ab0739e27037a4516925b427ab3fbdccf057d516bfcd8e58e99c7 + languageName: node + linkType: hard + "@solana/programs@npm:8.0.0": version: 8.0.0 resolution: "@solana/programs@npm:8.0.0" @@ -2296,6 +2758,18 @@ __metadata: languageName: node linkType: hard +"@solana/promises@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/promises@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/72448b0cd2b0dbf91a5c01f69e305eb00d99e17c253a6e1cd3b7d4fef4a709a6760a69d3e256c2ae980bbf31b3d4e2e6a1efdb55b96c83d1a2addf7ef3eb9e33 + languageName: node + linkType: hard + "@solana/promises@npm:8.0.0": version: 8.0.0 resolution: "@solana/promises@npm:8.0.0" @@ -2308,6 +2782,30 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-api@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-api@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/rpc-parsed-types": "npm:6.10.0" + "@solana/rpc-spec": "npm:6.10.0" + "@solana/rpc-transformers": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/b702b518862930e2636ab98dbb1a87627b1f21d99ebdb021e109e7e1a35fb91d510a2ec094ce3d0be9d1950ddbb276fe86596c8f19c35e9d0cb0b28e176ff480 + languageName: node + linkType: hard + "@solana/rpc-api@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-api@npm:8.0.0" @@ -2332,6 +2830,18 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-parsed-types@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-parsed-types@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/6754307ab2adcefc4f57941bd85362cdd2411484fdcdf902f4048423b7e38282436da3c7dd4a5786d1d81849420831c841b71c6b8b5cbc0f051d347c9c1bc69e + languageName: node + linkType: hard + "@solana/rpc-parsed-types@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-parsed-types@npm:8.0.0" @@ -2344,6 +2854,18 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-spec-types@npm:6.10.0, @solana/rpc-spec-types@npm:^6.8.0": + version: 6.10.0 + resolution: "@solana/rpc-spec-types@npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/5e4c0d0ad8f9d30b48426f11ca12e5321e3bc6643adb5486d3848729af307f2072017430034ee0cf46d57b3732bb0b0e0ceac5bfbb911a83bb0e89badb4ca0e0 + languageName: node + linkType: hard + "@solana/rpc-spec-types@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-spec-types@npm:8.0.0" @@ -2358,6 +2880,22 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-spec@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-spec@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/subscribable": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/75d35548b788e3b392f8dca0a641b7ee9341f82c40490023be6567bc6065a44bf536817e6809a262b55d87347b44c6161946289ee35fa3e3894e6bf3f3b57eb8 + languageName: node + linkType: hard + "@solana/rpc-spec@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-spec@npm:8.0.0" @@ -2374,6 +2912,26 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-subscriptions-api@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-subscriptions-api@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/rpc-subscriptions-spec": "npm:6.10.0" + "@solana/rpc-transformers": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/ab88865b50fb4fd6545fc7220e7bd91efa4bb71d06e7c279d4540f1e2d52185d018708bb46b8054ba4ef937791e3686de1487dc24d9e194812df9b8b6464c1d1 + languageName: node + linkType: hard + "@solana/rpc-subscriptions-api@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-subscriptions-api@npm:8.0.0" @@ -2394,6 +2952,24 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-subscriptions-channel-websocket@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-subscriptions-channel-websocket@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/rpc-subscriptions-spec": "npm:6.10.0" + "@solana/subscribable": "npm:6.10.0" + ws: "npm:^8.21.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/e455b432d3b09a07c501eb35d582f5f5cd86761d781581fe2ddff350ca07ff1721e06908fdcfbf63721b62478978d3da465b0049d212ccd33519d496fc66f7c1 + languageName: node + linkType: hard + "@solana/rpc-subscriptions-channel-websocket@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-subscriptions-channel-websocket@npm:8.0.0" @@ -2412,6 +2988,23 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-subscriptions-spec@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-subscriptions-spec@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/subscribable": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/023d0b9bbc6a74df22a2d931ea9770bd3df941ddb876a947977b4433430ef9796a5999f9856b5f1a4705aa08dfdcc2f11957533de90b54bdbe263d32d49cb5ff + languageName: node + linkType: hard + "@solana/rpc-subscriptions-spec@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-subscriptions-spec@npm:8.0.0" @@ -2429,6 +3022,30 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-subscriptions@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-subscriptions@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/fast-stable-stringify": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/rpc-subscriptions-api": "npm:6.10.0" + "@solana/rpc-subscriptions-channel-websocket": "npm:6.10.0" + "@solana/rpc-subscriptions-spec": "npm:6.10.0" + "@solana/rpc-transformers": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/subscribable": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/bc30ef8e9ae1d60df94a6312a98c3337a136e9638ed08dd865a359e9d3573d565d3c570d0445313dc5d3a541b26230d525cd041e8a03481c1f2360aef289d150 + languageName: node + linkType: hard + "@solana/rpc-subscriptions@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-subscriptions@npm:8.0.0" @@ -2453,6 +3070,24 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-transformers@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-transformers@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/c8ca9dd2a77fd9936247070b9cf26b686d06fd6ce5b2351c00e318aae0fdc4d6edf64cab952bf060709dc34aa278587ece7939c2412f3f5da6244bce4398e6fa + languageName: node + linkType: hard + "@solana/rpc-transformers@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-transformers@npm:8.0.0" @@ -2471,6 +3106,23 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-transport-http@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-transport-http@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/rpc-spec": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + undici-types: "npm:^8.4.1" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/807fb49b90dc2df7fc57899e071bc9b8c34c2acb73bf5f4712597bc0def1be5cbd222495548927b4ad47682883e62f3ff77e4dae9d0937f8b70a543240fce53a + languageName: node + linkType: hard + "@solana/rpc-transport-http@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-transport-http@npm:8.0.0" @@ -2488,6 +3140,26 @@ __metadata: languageName: node linkType: hard +"@solana/rpc-types@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc-types@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/fixed-points": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/7e9b83ec6b8ff8d026e854bb24892c279969fedacd8254fc2af7bc333ca7733d6ca2eba6bcc3a5b1b1bf81c9bee38c83964f74bbf3a2a70b553d18c0ac396e38 + languageName: node + linkType: hard + "@solana/rpc-types@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc-types@npm:8.0.0" @@ -2508,6 +3180,28 @@ __metadata: languageName: node linkType: hard +"@solana/rpc@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/rpc@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/fast-stable-stringify": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/rpc-api": "npm:6.10.0" + "@solana/rpc-spec": "npm:6.10.0" + "@solana/rpc-spec-types": "npm:6.10.0" + "@solana/rpc-transformers": "npm:6.10.0" + "@solana/rpc-transport-http": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/ace737874897d497a26156aeeeb86c4b146c4f96bb74b81a7bfd1044ef1560e075d7e3b9dbf9cd5d99b6b4805d80bc00f65d043ae15567689db8c44c052f6909 + languageName: node + linkType: hard + "@solana/rpc@npm:8.0.0": version: 8.0.0 resolution: "@solana/rpc@npm:8.0.0" @@ -2530,6 +3224,28 @@ __metadata: languageName: node linkType: hard +"@solana/signers@npm:6.10.0, @solana/signers@npm:^6.8.0": + version: 6.10.0 + resolution: "@solana/signers@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + "@solana/offchain-messages": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/50b5b604daeb35999d3d0b498f2800cd1cc39aff219acfb692e7c504734d97200f428b81d625921939a89575343eb851bb84877757bdff7316010252ad7a5d17 + languageName: node + linkType: hard + "@solana/signers@npm:8.0.0": version: 8.0.0 resolution: "@solana/signers@npm:8.0.0" @@ -2552,6 +3268,21 @@ __metadata: languageName: node linkType: hard +"@solana/subscribable@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/subscribable@npm:6.10.0" + dependencies: + "@solana/errors": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/d5c32559c9877fa546bf976eb6c497fac5df5bcf172472df39087795763a976eebce85ee20de81765095949076a89a4247a3d51d1a366cb444a256bacd123dac + languageName: node + linkType: hard + "@solana/subscribable@npm:8.0.0": version: 8.0.0 resolution: "@solana/subscribable@npm:8.0.0" @@ -2567,6 +3298,25 @@ __metadata: languageName: node linkType: hard +"@solana/sysvars@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/sysvars@npm:6.10.0" + dependencies: + "@solana/accounts": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/100b8bd114645ca5c2ad1c8172014c907362720d096e323bd47afb945905fe648bb1115faea91c0c14f8f44d538e38b26fc185373431659c257ad26f12cc9545 + languageName: node + linkType: hard + "@solana/sysvars@npm:8.0.0": version: 8.0.0 resolution: "@solana/sysvars@npm:8.0.0" @@ -2586,6 +3336,29 @@ __metadata: languageName: node linkType: hard +"@solana/transaction-confirmation@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/transaction-confirmation@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/promises": "npm:6.10.0" + "@solana/rpc": "npm:6.10.0" + "@solana/rpc-subscriptions": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + "@solana/transactions": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/c0353afe2ca1a25e1e0850cfc5e07356c7b0b70852c46fd2c6f9adf6f6243fff96918e42207b616b57fda805353601d39fd13d2730478fa03b587bd4fc1a5daa + languageName: node + linkType: hard + "@solana/transaction-confirmation@npm:8.0.0": version: 8.0.0 resolution: "@solana/transaction-confirmation@npm:8.0.0" @@ -2630,6 +3403,28 @@ __metadata: languageName: node linkType: hard +"@solana/transaction-messages@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/transaction-messages@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/00937463f1f7681a3e77462f223380d053959362b5c9afa35d9a3ce27934e3e318d349a0594793174db13c9fef6d268826300a438d7a295c2db905791e77e016 + languageName: node + linkType: hard + "@solana/transaction-messages@npm:8.0.0": version: 8.0.0 resolution: "@solana/transaction-messages@npm:8.0.0" @@ -2652,6 +3447,31 @@ __metadata: languageName: node linkType: hard +"@solana/transactions@npm:6.10.0": + version: 6.10.0 + resolution: "@solana/transactions@npm:6.10.0" + dependencies: + "@solana/addresses": "npm:6.10.0" + "@solana/codecs-core": "npm:6.10.0" + "@solana/codecs-data-structures": "npm:6.10.0" + "@solana/codecs-numbers": "npm:6.10.0" + "@solana/codecs-strings": "npm:6.10.0" + "@solana/errors": "npm:6.10.0" + "@solana/functional": "npm:6.10.0" + "@solana/instructions": "npm:6.10.0" + "@solana/keys": "npm:6.10.0" + "@solana/nominal-types": "npm:6.10.0" + "@solana/rpc-types": "npm:6.10.0" + "@solana/transaction-messages": "npm:6.10.0" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/a2e406cb155e491f5c619fe9a7c08851647c29bdcbfde37b828cfeea6b1939dfae1259af0d7a4ec0139d3db1dc30fed94b8d9d18d6ae7a8adc861e2d6796360a + languageName: node + linkType: hard + "@solana/transactions@npm:8.0.0": version: 8.0.0 resolution: "@solana/transactions@npm:8.0.0" @@ -2677,6 +3497,26 @@ __metadata: languageName: node linkType: hard +"@solana/web3.js@npm:3.0.0-rc.2": + version: 3.0.0-rc.2 + resolution: "@solana/web3.js@npm:3.0.0-rc.2" + dependencies: + "@noble/curves": "npm:^1.4.2" + "@noble/hashes": "npm:^1.4.0" + "@solana-program/address-lookup-table": "npm:^0.11.0" + "@solana-program/compute-budget": "npm:^0.15.0" + "@solana-program/loader-v3": "npm:^0.3.0" + "@solana-program/stake": "npm:^0.6.1" + "@solana-program/system": "npm:^0.12.0" + "@solana/assertions": "npm:^6.8.0" + "@solana/fast-stable-stringify": "npm:^6.8.0" + "@solana/kit": "npm:^6.8.0" + "@solana/rpc-spec-types": "npm:^6.8.0" + "@solana/signers": "npm:^6.8.0" + checksum: 10c0/99bf934c5b83470bb08fcf15aedd3c9b4cbb04d8cad2c5a28627fb68bb1157ef5d5e69cfe5287afe55613fbef7d5d0b852a53b76b89318a0df4a3335cab04c65 + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.11 resolution: "@tsconfig/node10@npm:1.0.11" @@ -3803,15 +4643,39 @@ __metadata: languageName: node linkType: hard -"litesvm@workspace:.": +"litesvm-core@workspace:*, litesvm-core@workspace:crates/node-litesvm-core": version: 0.0.0-use.local - resolution: "litesvm@workspace:." + resolution: "litesvm-core@workspace:crates/node-litesvm-core" dependencies: "@napi-rs/cli": "npm:^3.8.6" + languageName: unknown + linkType: soft + +"litesvm-web3js@workspace:crates/node-litesvm-web3js": + version: 0.0.0-use.local + resolution: "litesvm-web3js@workspace:crates/node-litesvm-web3js" + dependencies: + "@solana/web3.js": "npm:3.0.0-rc.2" + "@types/node": "npm:22.20.1" + litesvm-core: "workspace:*" + rome: "npm:^12.1.3" + ts-node: "npm:^10.9.2" + tsconfig-paths: "npm:^4.2.0" + typescript: "npm:^5.9.3" + peerDependencies: + "@solana/web3.js": ^3.0.0-rc.2 + languageName: unknown + linkType: soft + +"litesvm@workspace:crates/node-litesvm": + version: 0.0.0-use.local + resolution: "litesvm@workspace:crates/node-litesvm" + dependencies: "@solana-program/system": "npm:^0.14.0" "@solana-program/token": "npm:^0.16.0" "@solana/kit": "npm:^8.0.0" "@types/node": "npm:22.20.1" + litesvm-core: "workspace:*" rome: "npm:^12.1.3" ts-node: "npm:^10.9.2" tsconfig-paths: "npm:^4.2.0" @@ -3820,6 +4684,8 @@ __metadata: typedoc-vitepress-theme: "npm:^1.1.3" typescript: "npm:^5.9.3" vitepress: "npm:^1.6.4" + peerDependencies: + "@solana/kit": ^8.0.0 languageName: unknown linkType: soft @@ -4408,6 +5274,12 @@ __metadata: languageName: node linkType: hard +"root-workspace-0b6124@workspace:.": + version: 0.0.0-use.local + resolution: "root-workspace-0b6124@workspace:." + languageName: unknown + linkType: soft + "safer-buffer@npm:>= 2.1.2 < 3.0.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -4786,6 +5658,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:^8.4.1": + version: 8.11.0 + resolution: "undici-types@npm:8.11.0" + checksum: 10c0/792c144d73a1a5c467557ebd54322a96cd88cfc84f4d00395c87a87063c6a54b61188b3a23a77f59618fd816ac742826cd2fe23d2c7f76a145953359544a17dd + languageName: node + linkType: hard + "undici-types@npm:~6.21.0": version: 6.21.0 resolution: "undici-types@npm:6.21.0"