Skip to content

feat(snaps-networks-utils): add getKeys - #356

Open
hmalik88 wants to merge 19 commits into
mainfrom
hm/add-get-keys
Open

hmalik88 wants to merge 19 commits into
mainfrom
hm/add-get-keys

Conversation

@hmalik88

@hmalik88 hmalik88 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

snap_getState was updated to allow fetching of multiple keys from state at once. Accordingly, the getKeys method is being added to the State class to benefit all snaps. This means less rpc calls, smaller payloads.

References

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@socket-security

socket-security Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​snaps-sdk@​12.0.1 ⏵ 12.1.0991007896 +3100

View full report

@hmalik88
hmalik88 marked this pull request as ready for review September 23, 2026 15:33
@hmalik88
hmalik88 requested review from a team as code owners September 23, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The package template manifest remains stale, and the public breaking change and dependency upgrade are not fully documented or tested.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
What changed in this PR

Adds batched state-key retrieval to snap-networks-utils and upgrades Snaps SDK/platform versions to support it.

Changes:

  • Adds getKeys to state interfaces and implementations.
  • Adds tests and updates state-manager mocks.
  • Upgrades Snaps SDK dependencies, manifests, lockfile, and changelogs.
File Description
package.json Updates the SDK resolution.
yarn.lock Locks Snaps SDK 12.1.0.
scripts/​create-package/​snap-template/​package.json Updates the template SDK dependency.
packages/​snap-networks-utils/​src/​utils/​state/​State.ts Implements batched state reads.
packages/​snap-networks-utils/​src/​utils/​state/​State.test.ts Tests State.getKeys.
packages/​snap-networks-utils/​src/​utils/​state/​IStateManager.ts Adds the getKeys contract.
packages/​snap-networks-utils/​src/​utils/​state/​InMemoryState.ts Implements in-memory batch reads.
packages/​snap-networks-utils/​src/​utils/​state/​InMemoryState.test.ts Tests in-memory batch reads.
packages/​snap-networks-utils/​package.json Upgrades the SDK dependency.
packages/​snap-networks-utils/​CHANGELOG.md Documents getKeys.
packages/​bitcoin-wallet-snap/​package.json Upgrades the SDK dependency.
packages/​bitcoin-wallet-snap/​snap.manifest.json Updates the platform version.
packages/​bitcoin-wallet-snap/​CHANGELOG.md Documents the SDK upgrade.
packages/​solana-wallet-snap/​package.json Upgrades the SDK dependency.
packages/​solana-wallet-snap/​snap.manifest.json Updates the platform version.
packages/​solana-wallet-snap/​CHANGELOG.md Documents the SDK upgrade.
packages/​solana-wallet-snap/​src/​core/​services/​subscriptions/​SubscriptionRepository.test.ts Updates a state-manager mock.
packages/​stellar-wallet-snap/​package.json Upgrades the SDK dependency.
packages/​stellar-wallet-snap/​snap.manifest.json Updates the platform version.
packages/​stellar-wallet-snap/​CHANGELOG.md Documents the SDK upgrade.
packages/​stellar-wallet-snap/​src/​services/​asset-metadata/​AssetMetadataRepository.test.ts Updates a state-manager mock.
packages/​tron-wallet-snap/​package.json Upgrades the SDK dependency.
packages/​tron-wallet-snap/​snap.manifest.json Updates the platform version.
packages/​tron-wallet-snap/​CHANGELOG.md Documents the SDK upgrade.
packages/​tron-wallet-snap/​src/​services/​assets/​AssetsRepository.test.ts Updates a state-manager mock.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/snap-networks-utils/src/utils/state/State.test.ts Outdated
Comment thread scripts/create-package/snap-template/package.json
Comment thread packages/snap-networks-utils/CHANGELOG.md
Comment thread packages/snap-networks-utils/package.json
Comment thread packages/snap-networks-utils/src/utils/state/IStateManager.ts Outdated
@sonarqubecloud

Copy link
Copy Markdown

@Battambang

Copy link
Copy Markdown
Contributor

Networks team discussion prefers to have each snap its own isolated PR.
Could you please split the PR into different PRs snap package it's targeting.

This branch is waiting to be deployed

1 waiting (outdated) deployment
default-branch — 558547b2 Waiting Sep 23, 2026 by hmalik88 via Determine whether this PR is a release PR #1231
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.

3 participants