Skip to content

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Dec 4, 2025

Similar implementation than KeyringClient but using the new unified keyring API (keyring v2) methods.


Note

Introduces keyring v2 JSON-RPC schema and adds v2 clients and SDK request handler, with comprehensive tests and exports.

  • API (packages/keyring-api)
    • RPC v2 schema: Add keyring-rpc.ts with KeyringRpcV2 types, KeyringRpcV2Method enum, type guard isKeyringRpcV2Method, and request/response structs for getAccounts, getAccount, createAccounts, deleteAccount, exportAccount, submitRequest.
    • Exports: Re-export ./keyring-rpc in api/v2/index.ts.
    • Type guard: Make isKeyringRpcMethod a type predicate; fix test description string.
    • Tests: Add keyring-rpc.test.ts for v2 method guard.
  • Snap Client (packages/keyring-snap-client)
    • New KeyringClientV2: Implements v2 methods; validates responses via structs; adds tests.
    • Exports: Export v2 from src/index.ts and v2/index.ts.
  • Internal Snap Client (packages/keyring-internal-snap-client)
    • New KeyringInternalSnapClientV2: Extends KeyringClientV2, sends via SnapControllerMessengerSender; supports withSnapId; tests added.
    • Sender: Export SnapControllerMessengerSender.
    • Exports: Re-export v2 from index.ts and v2/index.ts.
  • Snap SDK (packages/keyring-snap-sdk)
    • RPC handler v2: Add handleKeyringRequestV2 to dispatch/validate v2 requests; throws MethodNotSupportedError when appropriate; tests added.
    • Exports: Export v2 handler from index.ts and v2/index.ts.

Written by Cursor Bugbot for commit 533f9cf. This will update automatically on new commits. Configure here.

@ccharly ccharly marked this pull request as ready for review December 5, 2025 15:02
@ccharly ccharly requested a review from a team as a code owner December 5, 2025 15:02
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