Skip to content

add multiple guardian endpoints for selection during onboarding#303

Open
0xnullifier wants to merge 3 commits into
mainfrom
utk-multi-guardian
Open

add multiple guardian endpoints for selection during onboarding#303
0xnullifier wants to merge 3 commits into
mainfrom
utk-multi-guardian

Conversation

@0xnullifier

Copy link
Copy Markdown
Collaborator

No description provided.

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

Adds support for selecting among multiple Guardian providers (endpoints) during onboarding and in settings, instead of defaulting to a single Guardian URL.

Changes:

  • Introduces a multi-provider Guardian catalog (GUARDIAN_OPTIONS) and derives per-network endpoint lists.
  • Adds a new onboarding step and UI for choosing a Guardian provider, plus an informational drawer.
  • Updates import flow and Guardian settings to use presets and normalize Guardian URLs.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/screens/onboarding/types.ts Adds ChooseGuardian step and associated onboarding action type.
src/screens/onboarding/navigator.tsx Wires the new Choose Guardian step into the onboarding navigator flow.
src/screens/onboarding/import-wallet-flow/ImportRecoveryMethod.tsx Adds Guardian provider presets and sanitizes Guardian URL input before submit.
src/screens/onboarding/common/GuardianInfoDrawer.tsx Adds a new drawer explaining what a Guardian is and does.
src/screens/onboarding/common/Confirmation.tsx Adjusts loading handling to include creating in button loading state.
src/screens/onboarding/common/ChooseGuardian.tsx Adds a new Guardian picker screen component used by onboarding and settings.
src/lib/shared/types.ts Introduces GuardianOption type for selectable Guardian providers.
src/lib/settings/helpers.ts Adds sanitizeGuardianUrl helper for normalized storage/comparison.
src/lib/settings/helpers.test.ts Adds unit tests for sanitizeGuardianUrl.
src/lib/miden-chain/constants.ts Adds multi-provider Guardian configuration and derives per-network endpoints + default.
src/lib/miden-chain/constants.test.ts Adds tests for GUARDIAN_OPTIONS and derived MIDEN_GUARDIAN_ENDPOINTS.
src/app/templates/GuardianSettings.tsx Replaces manual endpoint form with ChooseGuardianScreen and two-step confirmation logic.
src/app/pages/Welcome.tsx Adds routing/handling for the new choose-guardian onboarding step.
src/app/icons/onboarding/guardian-avatar.svg Adds Guardian avatar icon for the new picker UI.
public/_locales/zh_TW/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/zh_CN/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/uk/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/tr/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/ru/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/pt/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/pl/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/ko/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/ja/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/fr/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/es/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/en/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/en/en.json Adds localized strings for the Guardian picker/info drawer (app locale file).
public/_locales/en_GB/messages.json Adds localized strings for the Guardian picker/info drawer.
public/_locales/de/messages.json Adds localized strings for the Guardian picker/info drawer.
CHANGELOG.md Documents the new multi-Guardian selection feature for the next release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/shared/types.ts
@@ -1,4 +1,5 @@
import { MidenMessageType, MidenRequest, MidenResponse } from 'lib/miden/types';
import { MIDEN_NETWORK_NAME } from 'lib/miden-chain/constants';
Comment on lines +70 to +76
const [selectedId, setSelectedId] = useState<string>(defaultId);

const handleSelect = (id: string) => {
hapticLight();
setSelectedId(id);
setIsCustom(false);
};
<div className="mt-4 flex flex-col gap-2" onClick={e => e.stopPropagation()}>
<div className="grid grid-cols-3 gap-2">
{guardianPresets.map(provider => {
const isActive = !isCustomizing && endpointInput.trim() === provider.endpoint;
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