Skip to content

Conversation

@feruzm
Copy link
Member

@feruzm feruzm commented Feb 2, 2026

Summary by CodeRabbit

  • New Features

    • Warning shown when existing external wallet tokens are detected during seed import
    • Continue button disabled until all wallet derivations are complete
    • Import step and header icon added to surface existing-token warnings
    • Loading spinner shown during wallet creation
    • Support for supplying an imported seed phrase during wallet setup
    • Added localized warning about replacing existing wallet addresses
  • Bug Fixes

    • Improved validation and error handling in wallet key/linking and token save flow

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Add an import-step validation and UI warning for existing external tokens, require all derived wallet addresses before continuing, always include hive key data in private API calls, add a loading state for token address items, and allow wallet creation to accept an imported seed.

Changes

Cohort / File(s) Summary
External Wallet Import / Flow
apps/web/src/app/wallet/setup-external/_components/setup-external-import.tsx
Add derived states hasExistingChainTokens and allWalletsDerived; show an orange warning block when existing tokens detected; add an import step and adjust step transitions; require derivation completion before enabling continue; add exclamation-triangle header icon.
Hive keys / Private API payloads
apps/web/src/app/wallet/setup-external/_components/setup-external-import.tsx
Always include hiveKeys object (ownerPublicKey, activePublicKey, postingPublicKey, memoPublicKey) in private API link/save calls; add guard in handleLinkByKey to error and stop if hive keys are missing.
Wallet Token UI
apps/web/src/features/wallet/components/wallet-token-address-item.tsx
Import UilSpinner; render spinner and loading text when createWallet.isPending is true; keep address+copy UI when not pending; guard onClick to call onSelect only if wallet exists.
Wallet Creation Hook
packages/wallets/src/modules/wallets/mutations/use-wallet-create.ts
Extend useWalletCreate signature to accept optional importedSeed; prefer importedSeed inside the mutation over the generated mnemonic from useSeedPhrase; throw if no mnemonic available.
Localization
apps/web/src/features/i18n/locales/en-US.json
Add existing-tokens-warning translation string under import/import token to warn that importing a seed will replace existing external wallet addresses.
Changelog & Version
packages/wallets/CHANGELOG.md, packages/wallets/package.json
Bump package version to 1.5.22 and add changelog entry noting "External import fixes (#637)".

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant UI as SetupExternalImport (Client)
    participant Deriver as WalletDerivationService
    participant API as Private API

    User->>UI: Start import (seed or link)
    UI->>Deriver: Request address derivation for configured tokens
    Deriver-->>UI: Return derived addresses (incremental)
    UI->>UI: compute allWalletsDerived & hasExistingChainTokens
    alt hasExistingChainTokens
        UI-->>User: Show existing-tokens-warning, require confirmation
    end
    User->>UI: Continue (only when allWalletsDerived true)
    UI->>API: Send link/save payload (always includes hiveKeys)
    API-->>UI: Success / Error
    UI-->>User: Show result (spinner while pending / final state)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • External importing and missing sdk #635 — touches the external wallet import flow and modifies overlapping components/hooks (setup-external-import.tsx, wallet-token-address-item.tsx, use-wallet-create).

Poem

🐇 I twitched my whiskers, seeds in tow,
Warnings glowed where old addresses grow,
Spinners hummed while keys aligned,
Seeds accepted, every wallet signed,
A happy hop — imports now flow.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'External import fixes' directly aligns with the primary changes in the PR, which focus on fixing the external wallet import flow with validation guards, UI warnings, and payload handling improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch import

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Feb 2, 2026
@feruzm feruzm merged commit f6dec7c into develop Feb 2, 2026
1 check passed
@feruzm feruzm deleted the import branch February 2, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants