Skip to content

feat(xrpl): add keyring handler - #726

Merged
stanleyyconsensys merged 3 commits into
mainfrom
feat/xrpl/keyring
Dec 1, 2026
Merged

stanleyyconsensys merged 3 commits into
mainfrom
feat/xrpl/keyring

Conversation

@stanleyyconsensys

@stanleyyconsensys stanleyyconsensys commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

This PR add keyring handler, account resolver and base request handler

Out of scope:
SignTransaction will not inlcuded

References

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

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.

🟡 Changes recommended

Critical issues remain: signing validation rejects address options accepted by the resolver, and failure handling returns unvalidated error objects that violate declared response contracts.

2 open issues
What changed in this PR

Adds the XRPL Snap’s keyring handler and shared account-resolution infrastructure, connecting keyring operations to existing account, wallet, and on-chain services. Transaction signing itself remains out of scope.

Changes:

  • Adds account creation, discovery, export, asset and balance queries, transaction pagination, and request dispatch.
  • Introduces account resolution, base handlers, and request/response validation schemas.
  • Adds handler and schema tests and updates the private-key export encoding identifier.
File Description
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​keyring.ts Implements keyring operations and cached on-chain queries.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​keyring.test.ts Tests keyring operations, caching, validation, and failures.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​index.ts Exports keyring schemas and handlers.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​exceptions.ts Defines keyring and account-export exceptions.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​base.ts Adds account-aware request handling and error handling.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​api.ts Defines keyring request and response schemas.
packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​api.test.ts Tests schema validation and export defaults.
packages/​xrpl-wallet-snap/​src/​handlers/​base.ts Adds shared request validation, logging, and response validation.
packages/​xrpl-wallet-snap/​src/​handlers/​accountResolver.ts Resolves accounts with optional wallets and on-chain data.
packages/​xrpl-wallet-snap/​src/​constants.ts Renames the export encoding constant and uses hexadecimal.

Review effort: Balanced

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
71.0% Coverage on New Code (required ≥ 80%)
22.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

🔵 Needs a closer look

AccountResolver lacks direct tests for its loading branches and missing-snapshot exception, and wildcard keyring exports leave the public API boundary implicit.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Low severity Add AccountResolver tests for loading branches and missing snapshots

packages/​xrpl-wallet-snap/​src/​handlers/​accountResolver.ts:110

Please add an AccountResolver test suite covering live versus controller-state loading, disabled wallet/on-chain loading, and the missing-snapshot exception. Neither added suite instantiates this resolver, so none of these branches is exercised. The analogous resolver has focused coverage in packages/stellar-wallet-snap/src/handlers/accountResolver.test.ts.

Low severity Replace wildcard exports with explicit named exports

packages/​xrpl-wallet-snap/​src/​handlers/​keyring/​index.ts:3

Please enumerate the symbols exposed here instead of forwarding every export from these modules. Wildcard forwarding lets a future internal helper silently become part of the keyring module's public API; named exports keep that boundary explicit, with export type for type-only symbols.

2 resolved since last review

Review effort: Balanced

@stanleyyconsensys
stanleyyconsensys added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit aae9a6b Dec 1, 2026
65 of 67 checks passed
@stanleyyconsensys
stanleyyconsensys deleted the feat/xrpl/keyring branch December 1, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants