Skip to content

feat: add account.getPublicKey Wallet API method#587

Merged
Justkant merged 1 commit into
mainfrom
feat/account-get-public-key
Jun 22, 2026
Merged

feat: add account.getPublicKey Wallet API method#587
Justkant merged 1 commit into
mainfrom
feat/account-get-public-key

Conversation

@lysyi3m

@lysyi3m lysyi3m commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Adds a generic account.getPublicKey method to the Wallet API, letting a connected wallet return an account's public key over RPC. Modeled on the existing bitcoin.getPublicKey, but namespaced under account so any family can supply a resolver.

account.getPublicKey({ accountId: string, derivationPath?: string }) -> { publicKey: string }
  • core: new AccountGetPublicKey spec (zod params/result + handler type), exported and added to the WalletHandlers map
  • server: handler-map type plus an internal RPC handler that forwards to the wallet-side handler, rejecting with notImplementedByWallet when none is registered
  • client: account.getPublicKey(accountId, derivationPath?) returning the parsed publicKey
  • simulator: capability entry, stub, and tests covering the success, missing-permission, and not-implemented paths

Behavior notes:

  • derivationPath is optional, matching bitcoin.getPublicKey — families that derive keys at a path can use it; others ignore it.
  • publicKey is returned in the family's own encoding; the result schema is z.string().
  • Fail-closed: no resolver is registered in this package, so a wallet that does not implement one rejects. The method is opt-in per family.

Backward-compatible — an additive method on the shared packages. Peers that don't implement it reject with the standard "not implemented" error rather than failing to parse.

Minor bump for wallet-api-core, -client, -server, and -simulator via changeset.

Copilot AI review requested due to automatic review settings June 22, 2026 06:48
@lysyi3m lysyi3m requested review from a team, ComradeAERGO and Justkant as code owners June 22, 2026 06:48
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wallet-api-wallet-api-tools Ready Ready Preview, Comment Jun 22, 2026 6:58am

Request Review

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9bc0fa4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@ledgerhq/wallet-api-core Minor
@ledgerhq/wallet-api-client Minor
@ledgerhq/wallet-api-server Minor
@ledgerhq/wallet-api-simulator Minor
@ledgerhq/wallet-api-manifest-validator-cli Patch
@ledgerhq/wallet-api-manifest-validator Patch
@ledgerhq/wallet-api-tools Patch
@ledgerhq/wallet-api-client-react Patch
@ledgerhq/client-nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This comment was marked as resolved.

This comment was marked as outdated.

@lysyi3m lysyi3m force-pushed the feat/account-get-public-key branch from 2a27717 to 9bc0fa4 Compare June 22, 2026 08:58
@lysyi3m lysyi3m requested a review from Copilot June 22, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment on lines +115 to +117
* @param accountId - id of the account
* @param derivationPath - optional derivation path (used by UTXO families)
*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's fine for now, it's true that we could have more families use the derivation path but I'll let you decide if you want to update that or not

@Justkant Justkant merged commit 020cc67 into main Jun 22, 2026
11 checks passed
@Justkant Justkant deleted the feat/account-get-public-key branch June 22, 2026 09:18
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
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