Skip to content

Ledger UI: Authorization - #403

Open
turbocrime wants to merge 1 commit into
introduce-custody-ledgerfrom
ledger-ui-authorization
Open

Ledger UI: Authorization#403
turbocrime wants to merge 1 commit into
introduce-custody-ledgerfrom
ledger-ui-authorization

Conversation

@turbocrime

@turbocrime turbocrime commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

This PR contains the authorization slice changes split out from PR #402. It implements the core transaction authorization flow updates needed to support Ledger hardware wallet signing through the custody abstraction.

Note that to access usb devices, authorization is now performed directly within the popup.

This PR focuses specifically on the authorization logic changes, while the UI components and onboarding flows remain in PR #402.

@turbocrime
turbocrime marked this pull request as ready for review August 18, 2025 20:14
@turbocrime
turbocrime requested a review from TalDerei August 18, 2025 20:14

@TalDerei TalDerei 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.

optimistically 👍

quite a few organizational changes here, with helpers split into separate files — but that looks fine.

Comment on lines +81 to +87
// }) satisfies LockGrantedCallback;

// return (await navigator.locks.request(
// `custody-${this.label}-${bech32mWalletId(this.id)}`,
// { mode: 'exclusive' },
// lockGrantedCallback,
// )) as never;

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.

comment: remove

import { throwIfNeedsLogin } from '../needs-login';
import { popup } from '../popup';

export const getAuthorization = async (plan: TransactionPlan): Promise<AuthorizationData> => {

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.

comment: general organizational question here – any downstream side-effects of relocating signing from background script to directly being owned by the popup context?

Comment on lines -29 to -32
.catch(error => {
console.error(error);
throw new ConnectError('Approval failed', Code.Internal);
});

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.

comment: if the user denies or the popup throws, popup should reject. why are we removing this, doesn't returning an error instead of rejecting crash on response!.authorizeResponse?

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.

2 participants