Skip to content

✨ app: enable kyc onboarding from add-funds#941

Open
franm91 wants to merge 1 commit intomainfrom
kyc
Open

✨ app: enable kyc onboarding from add-funds#941
franm91 wants to merge 1 commit intomainfrom
kyc

Conversation

@franm91
Copy link
Copy Markdown
Member

@franm91 franm91 commented Apr 8, 2026


Open with Devin

Summary by CodeRabbit

  • New Features

    • KYC onboarding can now be started from the Add Funds flow to enable additional payment methods and networks.
  • Improvements

    • Bank transfers hidden on base chains and gated until identity is approved; shows loading state during KYC initiation.
    • Fiat flow waits for verification; crypto flow surfaces a verification prompt and launches KYC when requested.
    • KYC completion refreshes account/country data without unexpected navigation.
  • Localization

    • Added Spanish (es, es-AR) and Portuguese translations for verification prompts and CTA.
  • Chores

    • Prepared a patch release entry enabling the KYC onboarding change.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 8, 2026

🦋 Changeset detected

Latest commit: c259fda

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

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Fetches KYC status and gates add-funds flows; adds KYC initiation hooks and UI loading/disable states; unifies KYC result typing, removes persona navigation side-effects, invalidates user/country on KYC completion, and adds i18n and a changeset for a patch release.

Changes

Cohort / File(s) Summary
KYC core & hook
src/utils/persona.ts, src/utils/useBeginKYC.ts
Unify KYCResult typing, return startKYC() from mutation, remove expo-router navigation from persona handlers, and invalidate ["user","country"] on KYC complete; retain error filtering and query invalidation.
Add Funds UI
src/components/add-funds/AddFunds.tsx, src/components/add-funds/AddFundsOption.tsx
Query ["kyc","status"], integrate useBeginKYC(); hide/disable bank/fiat options when KYC not approved; add loading prop and spinner for options; show InfoAlert for unverified crypto users and fiat loading skeleton when ramp providers pending.
Onboarding / Getting started
src/components/getting-started/GettingStarted.tsx
Use full useBeginKYC() return value; call mutateAsync() and only navigate when result.status !== "cancel"; add explicit catch for rejected promise.
Localization & spellcheck
src/i18n/es-AR.json, src/i18n/es.json, src/i18n/pt.json, cspell.json
Add identity-check prompt and “Get verified” translations (ES / ES-AR / PT); update cspell overrides with new Spanish forms.
Release metadata
.changeset/stale-teams-say.md
Add changeset for a patch release of @exactly/mobile noting KYC onboarding from add-funds.

Sequence Diagram

sequenceDiagram
    participant User
    participant AddFunds as AddFunds Component
    participant KYCQuery as KYC Status Query
    participant BeginKYC as useBeginKYC Hook
    participant Persona as persona.startKYC()
    participant Cache as Query Cache
    participant Ramp as Ramp Providers Query

    User->>AddFunds: Open add-funds / select option
    AddFunds->>KYCQuery: Read ["kyc","status"]
    alt KYC approved
        AddFunds->>AddFunds: Navigate to chosen flow (fiat/crypto)
    else KYC not approved
        AddFunds->>BeginKYC: Call mutate() / mutateAsync()
        BeginKYC->>Persona: startKYC()
        Persona->>Persona: External KYC flow (complete / cancel / error)
        Persona->>Cache: Invalidate ["kyc","status"]
        Persona->>Cache: Invalidate ["user","country"] on complete
        Persona-->>BeginKYC: Resolve with KYCResult
        BeginKYC-->>AddFunds: Promise settles
        AddFunds->>Ramp: Invalidate / refetch ramp providers (if applicable)
        AddFunds->>AddFunds: Proceed to flow unless cancelled
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • diegueguille
  • cruzdanilo
🚥 Pre-merge checks | ✅ 2
✅ 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 accurately describes the main objective of the changeset: enabling KYC onboarding flow from the add-funds component, which is reflected across multiple modified files including AddFunds.tsx, persona.ts, useBeginKYC.ts, and GettingStarted.tsx.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kyc

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.

gemini-code-assist[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

sentry[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@sentry
Copy link
Copy Markdown

sentry bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.68%. Comparing base (a967f8e) to head (c259fda).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/utils/persona.ts 0.00% 7 Missing ⚠️
src/components/card/Card.tsx 0.00% 4 Missing ⚠️
src/utils/useBeginKYC.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #941      +/-   ##
==========================================
- Coverage   71.69%   71.68%   -0.01%     
==========================================
  Files         228      228              
  Lines        8277     8279       +2     
  Branches     2661     2663       +2     
==========================================
+ Hits         5934     5935       +1     
- Misses       2113     2115       +2     
+ Partials      230      229       -1     
Flag Coverage Δ
e2e 71.68% <0.00%> (+19.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

coderabbitai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 6 additional findings in Devin Review.

Open in Devin Review

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
src/components/getting-started/GettingStarted.tsx (1)

152-157: 🧹 Nitpick | 🔵 Trivial

Clarify the navigation condition for explicitness.

The basic KYC flow rejects (rather than resolves) on error, so result?.status !== "cancel" effectively means result?.status === "complete". However, making this explicit improves readability and guards against future changes to the error handling pattern.

💡 Suggested clarification
         beginKYC
           .mutateAsync()
           .then((result) => {
-            if (result?.status !== "cancel") router.replace("/(main)/(home)");
+            if (!result || result.status === "complete") router.replace("/(main)/(home)");
           })
           .catch(() => {}); // eslint-disable-line `@typescript-eslint/no-empty-function` -- error handled by useBeginKYC
src/components/add-funds/AddFunds.tsx (1)

209-213: ⚠️ Potential issue | 🟡 Minor

Consider showing a loading state while countryCode is unresolved.

When countryCode is falsy (empty string or undefined), neither the skeleton nor the providers content renders, leaving a blank content area. This can occur during the initial countryCode fetch or on direct navigation to the fiat URL.

You could destructure isLoading from the countryCode query and show a skeleton while it resolves:

- const { data: countryCode } = useQuery({
+ const { data: countryCode, isLoading: isCountryLoading } = useQuery({

Then update the fiat skeleton condition:

- {type === "fiat" && countryCode && isPending && (
+ {type === "fiat" && (isCountryLoading || (countryCode && isPending)) && (

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4b9b1a08-1801-4366-98bc-f6d2748ac4a0

📥 Commits

Reviewing files that changed from the base of the PR and between 1ecb585 and fd1c662.

📒 Files selected for processing (10)
  • .changeset/stale-teams-say.md
  • cspell.json
  • src/components/add-funds/AddFunds.tsx
  • src/components/add-funds/AddFundsOption.tsx
  • src/components/getting-started/GettingStarted.tsx
  • src/i18n/es-AR.json
  • src/i18n/es.json
  • src/i18n/pt.json
  • src/utils/persona.ts
  • src/utils/useBeginKYC.ts

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 11 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c259fdadf9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 11 additional findings in Devin Review.

Open in Devin Review

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.

1 participant