Skip to content

chore: solana wallet snap integrate packages - #72

Open
Battambang wants to merge 25 commits into
mainfrom
chore/solana-wallet-snap-integrate-packages
Open

chore: solana wallet snap integrate packages#72
Battambang wants to merge 25 commits into
mainfrom
chore/solana-wallet-snap-integrate-packages

Conversation

@Battambang

@Battambang Battambang commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This pull request integrates the Solana Wallet Snap into the monorepo, updates related configuration and documentation, and aligns dependencies and workflows to support the new package. It also includes license files for the Solana package and minor dependency updates for other packages.

Solana Wallet Snap Integration and Licensing:

  • Added the @metamask/solana-wallet-snap package to the monorepo, including its README and changelog, and updated the package list in README.md.
  • Added dual licensing (MIT and Apache 2.0) for the Solana Wallet Snap by including LICENSE, LICENSE.APACHE2, and referencing LICENSE.MIT.

Monorepo and Ownership Updates:

  • Added packages/solana-wallet-snap to .github/CODEOWNERS for ownership tracking.

CI/CD Workflow Enhancements:

  • Updated GitHub Actions workflows (lint-build-test.yml, main.yml, publish-release.yml, publish-preview.yml) to inject new Solana-related environment variables, handle Solana-specific test builds, and restore the Solana snap manifest after test builds.

Dependency and Manifest Updates:

  • Updated rimraf and @types/lodash dependencies in root and sample package manifests for improved compatibility and security.
  • Refreshed the snap.manifest.json shasum for the Bitcoin Wallet Snap after aligning Solana dependencies.

Changelog and Documentation:

  • Updated changelogs for both Bitcoin and Solana Wallet Snaps to reflect the migration and manifest refresh.

Place the snap under packages/ so Yarn workspaces can resolve it, and
update yarn.lock for the new workspace dependencies.
Match description, keywords, and test scripts to the monorepo
workspace constraints used by the other snaps.
Bump concurrently, dotenv, @metamask/superstruct, and bignumber.js to
match bitcoin-/tron-wallet-snap and clear yarn constraints mismatches.
Refresh snap.manifest.json after rebuild (shasum, repository, platformVersion).
@socket-security

socket-security Bot commented Jul 30, 2026

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Jul 30, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • @solana/rpc-transport-http@2.3.0
  • @solana/rpc-transport-http@2.1.0
  • @types/express-serve-static-core@5.1.2
  • @solana-program/compute-budget@0.7.0
  • @solana-program/system@0.7.0
  • glob@13.0.6

View full report

@Battambang Battambang changed the title Chore/solana wallet snap integrate packages chore: solana wallet snap integrate packages Jul 30, 2026
Sync with Release/3.0.0 (#71) before continuing Phase C work.
Match bitcoin-/tron-wallet-snap exact ranges (11.1.1 and 2.0.0) so yarn
constraints version consistency passes for these deps.
Bump root @types/lodash to ^4.17.15 so yarn constraints version
consistency matches the Solana workspace declaration.
Align rimraf to ^6.0.1 across workspaces that declare it so yarn
constraints version consistency passes and installs a single v6.
Narrow @metamask/snaps-cli to ^8.3.0 so yarn constraints version
consistency matches bitcoin-/tron-/sample-snap (still resolves to 8.4.1).
Sync with bitcoin keyring v2 (#43) and regenerate yarn.lock after
resolving the lockfile conflict.
Bump snaps-cli, snaps-sdk, superstruct, keyring-api, and
keyring-snap-sdk declarations to match bitcoin-/tron-wallet-snap
after #43 (installed versions unchanged).
Align @metamask/key-tree to ^10.1.1 with bitcoin-/tron-wallet-snap so
yarn constraints pass.
Absorb existing Solana snap lint findings into eslint-suppressions.json,
and apply minor autofixes from eslint --fix.
Assign @MetaMask/networks as owners for packages/solana-wallet-snap,
matching bitcoin- and tron-wallet-snap.
Update the generated packages section so readme-content:check passes
with the new workspace.
Collapse ignore, minipass, and package-json-from-dist to their highest
resolved versions so yarn dedupe --check passes in CI.
Satisfy the Check changelog CI requirement that Unreleased entries
reference the current pull request.
@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@types/express-serve-static-core@5.1.2 package used in core repo

@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/glob@13.0.6 package used in core repo

@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@solana/rpc-transport-http@2.1.0 socket.dev security reporting has all security metrics very high score confidence (all metrics green >96)

@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@solana-program/compute-budget@0.7.0 socket.dev is showing the solana-devs author group with several package score confidence.

@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@solana/rpc-transport-http@2.3.0 socket.dev security reporting has all security metrics very high score confidence (all metrics green >96)

@Battambang

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@solana-program/system@0.7.0 socket.dev is showing the solana-devs author group with several package score confidence.

Treat Infura-keyed mainnet/devnet RPC and websocket URLs as secrets;
keep public testnet, localnet, and explorer URLs as repository vars.
Update solana and bitcoin shasums so yarn build leaves a clean tree
in CI (bitcoin drifts due to shared yarn.lock changes).
Avoid parallel workers colliding on the mock RPC port 8899 in CI,
matching the source snap-solana-wallet test script.
Keep the monorepo-required test script string, and run Solana tests
serially in jest.config to avoid mock RPC port 8899 collisions.
@Battambang
Battambang force-pushed the chore/solana-wallet-snap-integrate-packages branch from c968237 to fecb49a Compare July 30, 2026 17:06
Match bitcoin-/tron-/sample-snap after #75: split LICENSE.MIT /
LICENSE.APACHE2 and set package.json license to (MIT OR Apache-2.0).
Override production for Solana test matrix builds so snaps-jest gets
dev permissions, matching the source snap CI. Restore the production
snap.manifest shasum before the dirty-tree check.
Link the Unreleased entry to #72 so Check changelog passes for the
collateral bitcoin-wallet-snap change.
@Battambang
Battambang marked this pull request as ready for review July 30, 2026 17:44
@Battambang
Battambang requested review from a team as code owners July 30, 2026 17:44
@Battambang
Battambang deployed to default-branch July 30, 2026 17:45 — with GitHub Actions Active
Comment on lines +197 to +204
env:
ENVIRONMENT: ${{ matrix.package-name == '@metamask/solana-wallet-snap' && 'test' || 'production' }}
- run: yarn workspace ${{ matrix.package-name }} run test
env:
ENVIRONMENT: ${{ matrix.package-name == '@metamask/solana-wallet-snap' && 'test' || 'production' }}
- name: Restore solana snap.manifest after test build
if: matrix.package-name == '@metamask/solana-wallet-snap'
run: git checkout -- packages/solana-wallet-snap/snap.manifest.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Test job overrides ENVIRONMENT only for @metamask/solana-wallet-snap:

  • Build + test steps: test for Solana, production for other snaps
  • Then restore packages/solana-wallet-snap/snap.manifest.json so the dirty-tree check still passes (test builds change the shasum; the dedicated Build job still validates the production shasum)

Why Solana needs this (Bitcoin/Tron do not in this CI path)
Solana feature tests (snaps-jest / installSnap) call the snap as a localhost dapp (http://localhost:3000) and exercise send/confirmation RPCs. Solana’s permissions.ts allowlists that origin and those methods only when the baked-in environment is local or test. With production, dapp permissions are empty → CI fails with Permission denied (4100).

ENVIRONMENT is injected at snap build time, so the Test job must rebuild Solana with ENVIRONMENT=test. Matching the source snap-solana-wallet CI Test job.

Bitcoin: no ENVIRONMENT-gated origin allowlist.

Tron: has a similar gate, but its suites in this workflow mostly don’t depend on localhost dapp permissions the way Solana’s feature UI tests do (often unit tests or metamask origin, which stays allowed in production).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant