@funkit/connect-rn 9.0.1 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +100 -0
- package/app.plugin.js +92 -0
- package/dist/{chunk-ZBWCG4O6.js → chunk-4EEB4ZBQ.js} +59 -6
- package/dist/chunk-4EEB4ZBQ.js.map +7 -0
- package/dist/{chunk-MMXSERQM.js → chunk-EWSXVFEF.js} +289 -65
- package/dist/chunk-EWSXVFEF.js.map +7 -0
- package/dist/{chunk-GCPIOARQ.js → chunk-FRXLZQRI.js} +6 -2
- package/dist/chunk-FRXLZQRI.js.map +7 -0
- package/dist/clients/lighter.js +1 -1
- package/dist/clients/nado.js +2 -2
- package/dist/index.js +5621 -3274
- package/dist/index.js.map +4 -4
- package/dist/preview.js +260 -11
- package/dist/preview.js.map +3 -3
- package/dist/src/components/v2/PaymentMethodPicker.d.ts +10 -1
- package/dist/src/components/v2/PaymentMethodPicker.d.ts.map +1 -1
- package/dist/src/components/v2/methodMerge.d.ts +40 -0
- package/dist/src/components/v2/methodMerge.d.ts.map +1 -0
- package/dist/src/fiat/FiatContactScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatDocumentCaptureStep.d.ts +2 -1
- package/dist/src/fiat/FiatDocumentCaptureStep.d.ts.map +1 -1
- package/dist/src/fiat/FiatFormFieldRow.d.ts +6 -3
- package/dist/src/fiat/FiatFormFieldRow.d.ts.map +1 -1
- package/dist/src/fiat/FiatFormScreen.d.ts +1 -4
- package/dist/src/fiat/FiatFormScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatIdentityStep.d.ts +7 -2
- package/dist/src/fiat/FiatIdentityStep.d.ts.map +1 -1
- package/dist/src/fiat/FiatKycIntroLayout.d.ts +34 -0
- package/dist/src/fiat/FiatKycIntroLayout.d.ts.map +1 -0
- package/dist/src/fiat/FiatKycIntroScreen.d.ts +2 -0
- package/dist/src/fiat/FiatKycIntroScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatKycOptionRow.d.ts.map +1 -1
- package/dist/src/fiat/FiatKycOptionsScreen.d.ts +3 -8
- package/dist/src/fiat/FiatKycOptionsScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatKycOutcomeScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatOptionsScreen.d.ts +21 -0
- package/dist/src/fiat/FiatOptionsScreen.d.ts.map +1 -0
- package/dist/src/fiat/FiatOtpScreen.d.ts +1 -1
- package/dist/src/fiat/FiatOtpScreen.d.ts.map +1 -1
- package/dist/src/fiat/FiatPaymentFailedSheet.d.ts +26 -0
- package/dist/src/fiat/FiatPaymentFailedSheet.d.ts.map +1 -0
- package/dist/src/fiat/FiatReceipt.d.ts +6 -3
- package/dist/src/fiat/FiatReceipt.d.ts.map +1 -1
- package/dist/src/fiat/FiatSharingConsentNotice.d.ts +3 -0
- package/dist/src/fiat/FiatSharingConsentNotice.d.ts.map +1 -0
- package/dist/src/fiat/FiatTermsNotice.d.ts +6 -0
- package/dist/src/fiat/FiatTermsNotice.d.ts.map +1 -1
- package/dist/src/fiat/PaymentDisclosureNotice.d.ts +6 -0
- package/dist/src/fiat/PaymentDisclosureNotice.d.ts.map +1 -0
- package/dist/src/fiat/ctaLabel.d.ts +2 -0
- package/dist/src/fiat/ctaLabel.d.ts.map +1 -1
- package/dist/src/fiat/depositMatch.d.ts +20 -0
- package/dist/src/fiat/depositMatch.d.ts.map +1 -0
- package/dist/src/fiat/disclosureFooter.d.ts +21 -0
- package/dist/src/fiat/disclosureFooter.d.ts.map +1 -0
- package/dist/src/fiat/disclosureFooterContent.d.ts +28 -0
- package/dist/src/fiat/disclosureFooterContent.d.ts.map +1 -0
- package/dist/src/fiat/formLayout.d.ts +18 -5
- package/dist/src/fiat/formLayout.d.ts.map +1 -1
- package/dist/src/fiat/kycOptionRows.d.ts +23 -0
- package/dist/src/fiat/kycOptionRows.d.ts.map +1 -0
- package/dist/src/fiat/kycWait.d.ts +20 -0
- package/dist/src/fiat/kycWait.d.ts.map +1 -0
- package/dist/src/fiat/legalLinks.d.ts +2 -0
- package/dist/src/fiat/legalLinks.d.ts.map +1 -1
- package/dist/src/fiat/paymentReroute.d.ts +20 -2
- package/dist/src/fiat/paymentReroute.d.ts.map +1 -1
- package/dist/src/fiat/paymentSurfaceFailure.d.ts +4 -19
- package/dist/src/fiat/paymentSurfaceFailure.d.ts.map +1 -1
- package/dist/src/fiat/pricedLimit.d.ts +20 -0
- package/dist/src/fiat/pricedLimit.d.ts.map +1 -0
- package/dist/src/fiat/providers/CoinbaseCheckoutSurface.d.ts +2 -3
- package/dist/src/fiat/providers/CoinbaseCheckoutSurface.d.ts.map +1 -1
- package/dist/src/fiat/providers/StripeSessionAuthScreen.d.ts.map +1 -1
- package/dist/src/fiat/providers/SumsubKycSurface.d.ts.map +1 -1
- package/dist/src/fiat/providers/SumsubNativeKycSurface.d.ts +23 -0
- package/dist/src/fiat/providers/SumsubNativeKycSurface.d.ts.map +1 -0
- package/dist/src/fiat/providers/adapter.d.ts +20 -4
- package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
- package/dist/src/fiat/providers/kycIntro.d.ts +15 -0
- package/dist/src/fiat/providers/kycIntro.d.ts.map +1 -1
- package/dist/src/fiat/providers/moonpay.d.ts +3 -1
- package/dist/src/fiat/providers/moonpay.d.ts.map +1 -1
- package/dist/src/fiat/providers/moonpayAuthStyle.d.ts +39 -0
- package/dist/src/fiat/providers/moonpayAuthStyle.d.ts.map +1 -1
- package/dist/src/fiat/providers/moonpayFailureCopy.d.ts.map +1 -1
- package/dist/src/fiat/providers/moonpayHandoffCard.d.ts +11 -0
- package/dist/src/fiat/providers/moonpayHandoffCard.d.ts.map +1 -0
- package/dist/src/fiat/providers/moonpayPaymentDisclosures.d.ts +15 -0
- package/dist/src/fiat/providers/moonpayPaymentDisclosures.d.ts.map +1 -0
- package/dist/src/fiat/providers/moonpayPreparedPayment.d.ts +7 -0
- package/dist/src/fiat/providers/moonpayPreparedPayment.d.ts.map +1 -0
- package/dist/src/fiat/providers/moonpaySharingConsent.d.ts +14 -0
- package/dist/src/fiat/providers/moonpaySharingConsent.d.ts.map +1 -0
- package/dist/src/fiat/providers/stripeAccountCreation.d.ts +10 -1
- package/dist/src/fiat/providers/stripeAccountCreation.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripeApplePayButton.d.ts +15 -0
- package/dist/src/fiat/providers/stripeApplePayButton.d.ts.map +1 -0
- package/dist/src/fiat/providers/stripeKycIntro.d.ts +23 -1
- package/dist/src/fiat/providers/stripeKycIntro.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripeOnramp.d.ts +7 -0
- package/dist/src/fiat/providers/stripeOnramp.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripeSdk.d.ts +1 -1
- package/dist/src/fiat/providers/stripeSdk.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripeSignInStep.d.ts +23 -0
- package/dist/src/fiat/providers/stripeSignInStep.d.ts.map +1 -0
- package/dist/src/fiat/providers/sumsubKyc.d.ts +6 -0
- package/dist/src/fiat/providers/sumsubKyc.d.ts.map +1 -1
- package/dist/src/fiat/providers/sumsubNativeLaunch.d.ts +34 -0
- package/dist/src/fiat/providers/sumsubNativeLaunch.d.ts.map +1 -0
- package/dist/src/fiat/providers/sumsubSdk.d.ts +58 -0
- package/dist/src/fiat/providers/sumsubSdk.d.ts.map +1 -0
- package/dist/src/fiat/providers/sumsubTheme.d.ts +51 -0
- package/dist/src/fiat/providers/sumsubTheme.d.ts.map +1 -0
- package/dist/src/fiat/providers/useCreateStripeAccountWithExistingUserData.d.ts +41 -0
- package/dist/src/fiat/providers/useCreateStripeAccountWithExistingUserData.d.ts.map +1 -0
- package/dist/src/fiat/providers/useStripeOnrampClient.d.ts +1 -1
- package/dist/src/fiat/providers/useStripeOnrampClient.d.ts.map +1 -1
- package/dist/src/fiat/providers/useStripeSessionAuth.d.ts +2 -8
- package/dist/src/fiat/providers/useStripeSessionAuth.d.ts.map +1 -1
- package/dist/src/fiat/quoteNoRoute.d.ts +25 -0
- package/dist/src/fiat/quoteNoRoute.d.ts.map +1 -1
- package/dist/src/fiat/renderCaptureSurface.d.ts +1 -1
- package/dist/src/fiat/renderCaptureSurface.d.ts.map +1 -1
- package/dist/src/fiat/sectionDetail.d.ts +3 -1
- package/dist/src/fiat/sectionDetail.d.ts.map +1 -1
- package/dist/src/fiat/stepDetails.d.ts +6 -0
- package/dist/src/fiat/stepDetails.d.ts.map +1 -1
- package/dist/src/fiat/useKycCaptureRound.d.ts.map +1 -1
- package/dist/src/fiat/useKycRoundReporting.d.ts +12 -0
- package/dist/src/fiat/useKycRoundReporting.d.ts.map +1 -0
- package/dist/src/fiat/usePaymentFailureAnswer.d.ts +68 -0
- package/dist/src/fiat/usePaymentFailureAnswer.d.ts.map +1 -0
- package/dist/src/fiat/useResendCooldown.d.ts +25 -0
- package/dist/src/fiat/useResendCooldown.d.ts.map +1 -0
- package/dist/src/fiat/useSharingConsent.d.ts +15 -0
- package/dist/src/fiat/useSharingConsent.d.ts.map +1 -0
- package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
- package/dist/src/flow/DepositMatchSheet.d.ts +12 -0
- package/dist/src/flow/DepositMatchSheet.d.ts.map +1 -0
- package/dist/src/flow/DepositPreload.d.ts +13 -0
- package/dist/src/flow/DepositPreload.d.ts.map +1 -0
- package/dist/src/flow/Drawer.d.ts +7 -1
- package/dist/src/flow/Drawer.d.ts.map +1 -1
- package/dist/src/flow/FiatDepositAmountStep.d.ts +1 -4
- package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
- package/dist/src/flow/FunkitFlowProvider.d.ts +5 -1
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
- package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
- package/dist/src/flow/depositFlowConfig.d.ts +11 -3
- package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
- package/dist/src/flow/depositMethods.d.ts +8 -0
- package/dist/src/flow/depositMethods.d.ts.map +1 -1
- package/dist/src/flow/overlayStep.d.ts +25 -0
- package/dist/src/flow/overlayStep.d.ts.map +1 -0
- package/dist/src/flow/pageTurn.d.ts +19 -2
- package/dist/src/flow/pageTurn.d.ts.map +1 -1
- package/dist/src/flow/quickAmounts.d.ts +8 -0
- package/dist/src/flow/quickAmounts.d.ts.map +1 -0
- package/dist/src/flow/storedChain.d.ts +14 -0
- package/dist/src/flow/storedChain.d.ts.map +1 -0
- package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts +3 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -1
- package/dist/src/flow/withdrawalMethods.d.ts +8 -0
- package/dist/src/flow/withdrawalMethods.d.ts.map +1 -0
- package/dist/src/geo/useUserIpInfo.d.ts +7 -0
- package/dist/src/geo/useUserIpInfo.d.ts.map +1 -1
- package/dist/src/hooks/useGuardedAmountInput.d.ts +11 -0
- package/dist/src/hooks/useGuardedAmountInput.d.ts.map +1 -1
- package/dist/src/hooks/useNestedSheetHeight.d.ts +14 -0
- package/dist/src/hooks/useNestedSheetHeight.d.ts.map +1 -1
- package/dist/src/icons/ApplePayMark.d.ts +3 -1
- package/dist/src/icons/ApplePayMark.d.ts.map +1 -1
- package/dist/src/preview/fixtures/kycForms.d.ts +2 -0
- package/dist/src/preview/fixtures/kycForms.d.ts.map +1 -1
- package/dist/src/preview/flowPreview.d.ts +6 -3
- package/dist/src/preview/flowPreview.d.ts.map +1 -1
- package/dist/src/preview/previewFetch.d.ts.map +1 -1
- package/dist/src/preview/scenarioCatalog.d.ts +56 -2
- package/dist/src/preview/scenarioCatalog.d.ts.map +1 -1
- package/dist/src/preview/scenarios.d.ts +11 -0
- package/dist/src/preview/scenarios.d.ts.map +1 -1
- package/dist/src/screens/DepositAmountScreen.d.ts +24 -4
- package/dist/src/screens/DepositAmountScreen.d.ts.map +1 -1
- package/dist/src/screens/DepositMatchScreen.d.ts +18 -0
- package/dist/src/screens/DepositMatchScreen.d.ts.map +1 -0
- package/dist/src/screens/FeeDetailsScreen.d.ts +2 -0
- package/dist/src/screens/FeeDetailsScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWebView.d.ts +2 -2
- package/dist/src/swapped/webViewSwappedTransport.d.ts +4 -35
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -1
- package/dist/src/theme/FunkitThemeProvider.d.ts +6 -0
- package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -1
- package/dist/src/theme/buildFunkitTheme.d.ts +3 -0
- package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -1
- package/dist/src/theme/legibleBrandColor.d.ts +12 -0
- package/dist/src/theme/legibleBrandColor.d.ts.map +1 -0
- package/dist/src/theme/restyle.d.ts +99 -0
- package/dist/src/theme/restyle.d.ts.map +1 -1
- package/dist/src/theme/toRestyleTheme.d.ts +9 -0
- package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
- package/dist/src/theme/typeScale.d.ts +18 -0
- package/dist/src/theme/typeScale.d.ts.map +1 -1
- package/dist/src/utils/formatAmount.d.ts +2 -0
- package/dist/src/utils/formatAmount.d.ts.map +1 -1
- package/ios/FunkitGlassEffect.podspec +2 -0
- package/ios/assets/funkit-connect-rn/sumsub-back.png +0 -0
- package/package.json +17 -9
- package/dist/chunk-GCPIOARQ.js.map +0 -7
- package/dist/chunk-MMXSERQM.js.map +0 -7
- package/dist/chunk-ZBWCG4O6.js.map +0 -7
- package/dist/src/fiat/FiatKycPosition.d.ts +0 -7
- package/dist/src/fiat/FiatKycPosition.d.ts.map +0 -1
- package/dist/src/fiat/kycWalk.d.ts +0 -22
- package/dist/src/fiat/kycWalk.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @funkit/connect-rn
|
|
2
2
|
|
|
3
|
+
## 9.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4f31cae: MoonPay's required payment disclosures are shown instead of failing the payment.
|
|
8
|
+
- 4f31cae: The deposit amount, quick amounts and limits are written in the buyer's own currency.
|
|
9
|
+
- 4f31cae: The tax ID step names the tax ID the buyer's country uses and lets them type letters where it has them.
|
|
10
|
+
- 6866896: Ask MoonPay's net-worth question on its own page; iOS hosts must declare photo library access for Sumsub document uploads.
|
|
11
|
+
- 20a4d9c: Ask MoonPay buyers for document-sharing consent before ID and selfie capture.
|
|
12
|
+
- da26152: A failed Apple Pay payment now offers a choice to try another card or request a new quote
|
|
13
|
+
- 355d69b: A failed Apple Pay payment opens a full screen offering another card, a new quote when another provider can price it, or the host's payment-method picker when none can.
|
|
14
|
+
- b84836e: Run Sumsub identity capture in Sumsub's native SDK, themed from the host's theme, when `@sumsub/react-native-mobilesdk-module` is installed, with an Expo config plugin for its native setup
|
|
15
|
+
- 496f340: Report the outcome of Sumsub document capture to the backend.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 50c74d0: Add a deposit-match drawer that shows the waived fee and the bonus total.
|
|
20
|
+
- ccf7f04: The deposit amount screen can call out a deposit match in green on its fee line.
|
|
21
|
+
- 84a797a: The fiat amount screen can preview a deposit match and waived fee.
|
|
22
|
+
- bcbd0f3: When an amount falls between providers' ranges, buyers can change it to the nearest amount a provider serves.
|
|
23
|
+
- 429dc32: Refresh routing limits using authenticated provider information when available.
|
|
24
|
+
- 9609cdc: Fiat KYC, contact, OTP, receipt and Stripe Link screens no longer drag under a finger when their content already fits the screen.
|
|
25
|
+
- 9cef7e9: Keep the KYC Continue button flush over the keyboard: it now follows the keyboard down when the iOS suggestion row closes instead of holding the row's height.
|
|
26
|
+
- d16cefa: Show the new deposit limit on the banner after identity verification passes.
|
|
27
|
+
- 19f136d: After MoonPay's sharing consent, identity verification opens only when the buyer taps its button.
|
|
28
|
+
- b947fc2: Show a KYC round the provider sent back for correction with every field and its notice, including one that returns after the verifying screen
|
|
29
|
+
- 4384bcb: A Stripe buyer sent from the quick check straight on to the next round opens it on its fields, without a second faceplate.
|
|
30
|
+
- 5705269: Remove the "Have any questions?" link from the KYC review and hold screens
|
|
31
|
+
- 0fd8f33: Stop the name page flashing up when a KYC round whose name was already given is submitted
|
|
32
|
+
- 031f333: Keep the ID verification banner in progress after a recheck until the deposit can be paid, instead of briefly showing it as completed.
|
|
33
|
+
- 30047c2: Remove the step indicator dots from the KYC screens; a supplemental round made them read as a walk that never ended.
|
|
34
|
+
- 3a7271b: Verification screens now slide forward, and leaving them for the amount slides back
|
|
35
|
+
- 2e0ecca: While identity details are being verified, the screen tells the buyer they may be asked for more information.
|
|
36
|
+
- fe7bd78: When no provider will take the selected payment method, the amount screen folds its action into the payment-method row instead of showing a disabled "not available" button: the row drops the method for "Pick a payment method", and a toast says to try a different method.
|
|
37
|
+
- c2b0d16: MoonPay's hosted identity check now opens for the signed-in customer instead of closing straight away.
|
|
38
|
+
- 3da0768: MoonPay's hosted identity check now fills the screen, draws in the host's theme, and has a back button.
|
|
39
|
+
- 5c31014: Resume deposits after completing MoonPay identity verification and describe further verification without implying rejection.
|
|
40
|
+
- 38acaef: The fiat amount screen no longer shows the "Identity Verification Required" or "ID Verification in Progress" toasts; the button says it instead.
|
|
41
|
+
- cf21cbc: The fiat code screen stays put on a resend, shows "Sending…", then waits 60 seconds before another resend
|
|
42
|
+
- 88b2cce: A fiat deposit whose provider stops sending verification codes now explains the wait on a banner, and Continue retries once it passes.
|
|
43
|
+
- d7aa455: Stripe Apple Pay deposits use Apple's native "Pay with Apple Pay" button
|
|
44
|
+
- c3e65a5: Open the crypto-only deposit picker already populated instead of on a loading state
|
|
45
|
+
- 4c1f95f: Fix preview scenarios ending on "Try again" when they re-quote with fiat routing on.
|
|
46
|
+
- aef0114: Open crypto-only deposits on the crypto picker instead of the Add money screen
|
|
47
|
+
- c3e65a5: Open a withdrawal with only one crypto method on the amount step instead of the method list
|
|
48
|
+
- 7246d1c: Fail a refused Stripe identity check over to the next provider from the amount screen, instead of ending the flow on a support screen
|
|
49
|
+
- aa97719: Closing Stripe's code sheet goes back to the amount instead of a "Continue with Stripe" page whose only action reopened the same sheet.
|
|
50
|
+
- cc68c6a: Stripe buyers no longer retype account details Fun already holds when creating a Link account.
|
|
51
|
+
- 32e18d4: Stripe's Link code sheet opens over the screen that asked for it, such as the phone number the buyer just typed, instead of sending them back to the amount screen first.
|
|
52
|
+
- e9f096f: Keep Stripe's account form up after the buyer sends it, so its Link code sheet opens over that form instead of the amount screen
|
|
53
|
+
- c452755: Stop routing a fiat deposit to Stripe when the host passes no Stripe config
|
|
54
|
+
- 73d2148: Sumsub's native verification screen now closes with Fun's back chevron, on the left.
|
|
55
|
+
- 8d223a7: Closing a verification sheet that opens over the app returns to its introduction instead of the deposit amount.
|
|
56
|
+
- b84836e: Match the Sumsub WebView identity capture to Fun's colors, Inter type and rounded controls
|
|
57
|
+
- 2a14614: Fix card payments timing out after 15 seconds in the Swapped WebView.
|
|
58
|
+
- 4f31cae: The deposit footer shows a quote's payment disclosures beside the Apple Pay button and the provider's short terms everywhere else.
|
|
59
|
+
- Updated dependencies [08cdd7d]
|
|
60
|
+
- Updated dependencies [429dc32]
|
|
61
|
+
- Updated dependencies [429dc32]
|
|
62
|
+
- Updated dependencies [8ac4858]
|
|
63
|
+
- Updated dependencies [19f136d]
|
|
64
|
+
- Updated dependencies [20a4d9c]
|
|
65
|
+
- Updated dependencies [cf21cbc]
|
|
66
|
+
- Updated dependencies [4f4c319]
|
|
67
|
+
- Updated dependencies [cc68c6a]
|
|
68
|
+
- Updated dependencies [496f340]
|
|
69
|
+
- @funkit/api-base@8.7.0
|
|
70
|
+
- @funkit/connect-core@8.7.0
|
|
71
|
+
- @funkit/chains@2.5.0
|
|
72
|
+
|
|
3
73
|
## 9.0.1
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -140,6 +140,102 @@ import 'react-native-get-random-values'
|
|
|
140
140
|
MoonPay 1.17.0 includes the `about:srcdoc` WebView origin allowance. Consumers no
|
|
141
141
|
longer need a dependency patch for MoonPay's authorization frame.
|
|
142
142
|
|
|
143
|
+
## Identity verification permissions (iOS)
|
|
144
|
+
|
|
145
|
+
Sumsub's document capture photographs an ID, takes a selfie and uploads documents
|
|
146
|
+
such as proof of address, so iOS hosts must declare both usage strings:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"expo": {
|
|
151
|
+
"ios": {
|
|
152
|
+
"infoPlist": {
|
|
153
|
+
"NSCameraUsageDescription": "Used to photograph your ID and take a selfie when identity verification is required for a deposit.",
|
|
154
|
+
"NSPhotoLibraryUsageDescription": "Used to upload a photo of your ID or a document such as proof of address when identity verification is required for a deposit."
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
In bare React Native, add the same two keys to `ios/<App>/Info.plist`.
|
|
162
|
+
|
|
163
|
+
## Sumsub's native SDK (optional)
|
|
164
|
+
|
|
165
|
+
Sumsub's identity capture runs in a WebView by default. Its WebSDK takes no
|
|
166
|
+
colors, fonts or radii from code, so it never matches your theme. Install
|
|
167
|
+
Sumsub's mobile SDK and the same step opens Sumsub's native screens, themed
|
|
168
|
+
from your connect-rn theme (light/dark colors, brand overrides, Inter, button
|
|
169
|
+
and card radii).
|
|
170
|
+
|
|
171
|
+
`@sumsub/react-native-mobilesdk-module` is an **optional peer**. Without it, or
|
|
172
|
+
in a binary that doesn't link it (Expo Go included), Sumsub stays in the
|
|
173
|
+
WebView, unchanged. Sumsub's screens present modally over your app, so our back
|
|
174
|
+
button and step dots don't show on them; closing Sumsub before submitting
|
|
175
|
+
counts as a cancel.
|
|
176
|
+
|
|
177
|
+
### Expo
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
npx expo install @sumsub/react-native-mobilesdk-module
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Add connect-rn's config plugin, and embed the Inter cuts natively with
|
|
184
|
+
`expo-font` — Sumsub's native screens can't see a font loaded at runtime:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"expo": {
|
|
189
|
+
"plugins": [
|
|
190
|
+
[
|
|
191
|
+
"expo-font",
|
|
192
|
+
{
|
|
193
|
+
"fonts": [
|
|
194
|
+
"node_modules/@expo-google-fonts/inter/400Regular/Inter_400Regular.ttf",
|
|
195
|
+
"node_modules/@expo-google-fonts/inter/500Medium/Inter_500Medium.ttf",
|
|
196
|
+
"node_modules/@expo-google-fonts/inter/600SemiBold/Inter_600SemiBold.ttf"
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
"@funkit/connect-rn",
|
|
202
|
+
{
|
|
203
|
+
"sumsub": {
|
|
204
|
+
"cameraPermission": "Used to photograph your ID and take a selfie.",
|
|
205
|
+
"microphonePermission": "Used to record a short video when asked.",
|
|
206
|
+
"photoLibraryPermission": "Used to upload a photo of your ID or a document.",
|
|
207
|
+
"locationPermission": "Used to confirm your country when asked."
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The plugin:
|
|
217
|
+
|
|
218
|
+
- adds Sumsub's CocoaPods spec repo (`https://github.com/sumsub/Specs.git`) and
|
|
219
|
+
the CocoaPods CDN to the Podfile;
|
|
220
|
+
- adds Sumsub's Maven repository (`https://maven.sumsub.com/repository/maven-public/`)
|
|
221
|
+
to the Android project;
|
|
222
|
+
- sets `NSCameraUsageDescription`, `NSMicrophoneUsageDescription`,
|
|
223
|
+
`NSPhotoLibraryUsageDescription` and `NSLocationWhenInUseUsageDescription`.
|
|
224
|
+
Each `sumsub` option overrides its key; without one, a reason your app
|
|
225
|
+
already declares is kept, and a default is written otherwise.
|
|
226
|
+
|
|
227
|
+
Every option is optional, so `"@funkit/connect-rn"` alone works. Pass
|
|
228
|
+
`{ "sumsub": false }` to skip the native setup. Then rebuild the native app
|
|
229
|
+
(`npx expo prebuild` / `expo run:ios`).
|
|
230
|
+
|
|
231
|
+
### Bare React Native
|
|
232
|
+
|
|
233
|
+
Follow [Sumsub's React Native setup](https://docs.sumsub.com/docs/react-native-module):
|
|
234
|
+
the two `source` lines at the top of the Podfile, the Maven repository, and the
|
|
235
|
+
four Info.plist keys above. Bundle the Inter `.ttf` files natively (`UIAppFonts`
|
|
236
|
+
on iOS, `android/app/src/main/assets/fonts` on Android), named
|
|
237
|
+
`Inter-Regular`, `Inter-Medium` and `Inter-SemiBold` as the theme uses them.
|
|
238
|
+
|
|
143
239
|
## Peer dependencies
|
|
144
240
|
|
|
145
241
|
These are declared as **peer dependencies** (not bundled), so the host app links a
|
|
@@ -206,6 +302,10 @@ Two deliberate choices keep it that way:
|
|
|
206
302
|
`includeOnramp: true`; bare RN: `stripe-react-native/Onramp` in the Podfile and
|
|
207
303
|
`StripeSdk_includeOnramp=true` in `gradle.properties`), and rebuilds; that
|
|
208
304
|
rail cannot run in Expo Go.
|
|
305
|
+
- **Sumsub's native SDK is an optional peer, loaded on demand.** The capture
|
|
306
|
+
step checks for its native module first and `import()`s
|
|
307
|
+
`@sumsub/react-native-mobilesdk-module` only when it is linked
|
|
308
|
+
(`src/fiat/providers/sumsubSdk.ts`); otherwise Sumsub runs in the WebView.
|
|
209
309
|
- **The glass module is optional at runtime.** `FunkitGlassEffect` (this
|
|
210
310
|
package's `ios/`) is not in Expo Go. `src/native/glassEffect.ts` looks it up
|
|
211
311
|
with `requireOptionalNativeModule`, so an unlinked binary renders the
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// plugin/index.ts
|
|
2
|
+
import configPlugins from "expo/config-plugins.js";
|
|
3
|
+
|
|
4
|
+
// plugin/sumsubNative.ts
|
|
5
|
+
var SUMSUB_SPECS = "source 'https://github.com/sumsub/Specs.git'";
|
|
6
|
+
var COCOAPODS_CDN = "source 'https://cdn.cocoapods.org/'";
|
|
7
|
+
var SUMSUB_MAVEN = "https://maven.sumsub.com/repository/maven-public/";
|
|
8
|
+
var MAVEN_MARKER = "// @funkit/connect-rn: Sumsub mobile SDK";
|
|
9
|
+
var SUMSUB_USAGE_DESCRIPTIONS = {
|
|
10
|
+
NSCameraUsageDescription: "Used to photograph your ID and take a selfie when identity verification is required.",
|
|
11
|
+
NSMicrophoneUsageDescription: "Used to record a short video when identity verification asks for one.",
|
|
12
|
+
NSPhotoLibraryUsageDescription: "Used to upload a photo of your ID or a document when identity verification is required.",
|
|
13
|
+
NSLocationWhenInUseUsageDescription: "Used to confirm your country when identity verification asks for it."
|
|
14
|
+
};
|
|
15
|
+
var OPTION_FOR_KEY = {
|
|
16
|
+
NSCameraUsageDescription: "cameraPermission",
|
|
17
|
+
NSMicrophoneUsageDescription: "microphonePermission",
|
|
18
|
+
NSPhotoLibraryUsageDescription: "photoLibraryPermission",
|
|
19
|
+
NSLocationWhenInUseUsageDescription: "locationPermission"
|
|
20
|
+
};
|
|
21
|
+
function addSumsubPodSources(podfile) {
|
|
22
|
+
if (podfile.includes(SUMSUB_SPECS)) {
|
|
23
|
+
return podfile;
|
|
24
|
+
}
|
|
25
|
+
const sources = podfile.includes(COCOAPODS_CDN) ? [SUMSUB_SPECS] : [COCOAPODS_CDN, SUMSUB_SPECS];
|
|
26
|
+
return `${sources.join("\n")}
|
|
27
|
+
${podfile}`;
|
|
28
|
+
}
|
|
29
|
+
function addSumsubMavenRepository(buildGradle) {
|
|
30
|
+
if (buildGradle.includes(SUMSUB_MAVEN)) {
|
|
31
|
+
return buildGradle;
|
|
32
|
+
}
|
|
33
|
+
return `${buildGradle.trimEnd()}
|
|
34
|
+
|
|
35
|
+
${MAVEN_MARKER}
|
|
36
|
+
allprojects {
|
|
37
|
+
repositories {
|
|
38
|
+
maven { url "${SUMSUB_MAVEN}" }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
function withSumsubUsageDescriptions(infoPlist, options = {}) {
|
|
44
|
+
const next = { ...infoPlist };
|
|
45
|
+
for (const [key, fallback] of Object.entries(SUMSUB_USAGE_DESCRIPTIONS)) {
|
|
46
|
+
const override = options[OPTION_FOR_KEY[key]];
|
|
47
|
+
if (override !== void 0) {
|
|
48
|
+
next[key] = override;
|
|
49
|
+
} else if (typeof next[key] !== "string" || next[key] === "") {
|
|
50
|
+
next[key] = fallback;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return next;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// plugin/index.ts
|
|
57
|
+
var {
|
|
58
|
+
createRunOncePlugin,
|
|
59
|
+
withInfoPlist,
|
|
60
|
+
withPodfile,
|
|
61
|
+
withProjectBuildGradle
|
|
62
|
+
} = configPlugins;
|
|
63
|
+
var withSumsubNative = (config, options) => {
|
|
64
|
+
config = withPodfile(config, (podfile) => {
|
|
65
|
+
podfile.modResults.contents = addSumsubPodSources(
|
|
66
|
+
podfile.modResults.contents
|
|
67
|
+
);
|
|
68
|
+
return podfile;
|
|
69
|
+
});
|
|
70
|
+
config = withProjectBuildGradle(config, (gradle) => {
|
|
71
|
+
if (gradle.modResults.language === "groovy") {
|
|
72
|
+
gradle.modResults.contents = addSumsubMavenRepository(
|
|
73
|
+
gradle.modResults.contents
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return gradle;
|
|
77
|
+
});
|
|
78
|
+
return withInfoPlist(config, (plist) => {
|
|
79
|
+
plist.modResults = withSumsubUsageDescriptions(plist.modResults, options);
|
|
80
|
+
return plist;
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
var withFunkitConnectRn = (config, options = {}) => {
|
|
84
|
+
if (options.sumsub === false) {
|
|
85
|
+
return config;
|
|
86
|
+
}
|
|
87
|
+
return withSumsubNative(config, options.sumsub ?? {});
|
|
88
|
+
};
|
|
89
|
+
var index_default = createRunOncePlugin(withFunkitConnectRn, "@funkit/connect-rn");
|
|
90
|
+
export {
|
|
91
|
+
index_default as default
|
|
92
|
+
};
|
|
@@ -36,7 +36,7 @@ var SEED = {
|
|
|
36
36
|
fiatPressEntry: (p) => p.deposit?.fiat?.pressEntry,
|
|
37
37
|
fiatSubmitOnOpen: (p) => p.deposit?.fiat?.submitOnOpen,
|
|
38
38
|
fiatSurfaceFailure: (p) => p.deposit?.fiat?.surfaceFailure,
|
|
39
|
-
|
|
39
|
+
fiatDepositMatch: (p) => p.deposit?.fiat?.depositMatch,
|
|
40
40
|
kycCompletion: (p) => p.deposit?.fiat?.kycCompletion,
|
|
41
41
|
identityPage: (p) => p.deposit?.fiat?.identity?.page,
|
|
42
42
|
identitySection: (p) => {
|
|
@@ -44,6 +44,7 @@ var SEED = {
|
|
|
44
44
|
return identity?.page === "form" ? identity.section : void 0;
|
|
45
45
|
},
|
|
46
46
|
documentStarted: (p) => p.deposit?.fiat?.documentStarted,
|
|
47
|
+
fiatCaptureReissued: (p) => p.deposit?.fiat?.captureReissued,
|
|
47
48
|
depositChainId: (p) => p.deposit?.chainId,
|
|
48
49
|
withdrawalMethodId: (p) => p.withdrawal?.methodId,
|
|
49
50
|
withdrawalAmount: (p) => p.withdrawal?.amount,
|
|
@@ -77,6 +78,21 @@ function useSeededState(pick, initial, fromSeed) {
|
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
// src/fiat/legalLinks.ts
|
|
82
|
+
var PRIVACY_POLICY_URL = "https://fun.xyz/privacy";
|
|
83
|
+
var CONSENT_COPY_VERSION = "fun-kyc-consent-2026-09-11";
|
|
84
|
+
var PERSONA_PRIVACY_POLICY_URL = "https://withpersona.com/legal/privacy-policy";
|
|
85
|
+
var KYC_PROVIDER_NAMES = {
|
|
86
|
+
SUMSUB: "Sumsub"
|
|
87
|
+
};
|
|
88
|
+
var titleCase = (value) => value.charAt(0) + value.slice(1).toLowerCase();
|
|
89
|
+
function kycProviderDisplayName(provider, fallback) {
|
|
90
|
+
if (provider === void 0) {
|
|
91
|
+
return fallback;
|
|
92
|
+
}
|
|
93
|
+
return KYC_PROVIDER_NAMES[provider] ?? titleCase(provider);
|
|
94
|
+
}
|
|
95
|
+
|
|
80
96
|
// src/fiat/formLayout.ts
|
|
81
97
|
import { Platform } from "react-native";
|
|
82
98
|
|
|
@@ -116,6 +132,17 @@ function postalCodeForm(alpha2) {
|
|
|
116
132
|
var GROSS_ANNUAL_INCOME = "QUESTIONNAIRE_RESPONSE:customerDueDiligence:grossAnnualIncome";
|
|
117
133
|
var EXPECTED_AMOUNT_PER_MONTH = "QUESTIONNAIRE_RESPONSE:customerDueDiligence:expectedTransactionAmountPerMonth";
|
|
118
134
|
var TRANSACTIONS_PER_MONTH = "QUESTIONNAIRE_RESPONSE:customerDueDiligence:transactionFrequencyPerMonth";
|
|
135
|
+
var NET_WORTH = "QUESTIONNAIRE_RESPONSE:enhancedDueDiligence:netWorth";
|
|
136
|
+
var LABELLED_CURRENCY = / \(([A-Z]{3})\)$/;
|
|
137
|
+
function fieldCurrency(field) {
|
|
138
|
+
return LABELLED_CURRENCY.exec(field.labelFallback)?.[1];
|
|
139
|
+
}
|
|
140
|
+
function withoutLabelledCurrency(field) {
|
|
141
|
+
return {
|
|
142
|
+
...field,
|
|
143
|
+
labelFallback: field.labelFallback.replace(LABELLED_CURRENCY, "")
|
|
144
|
+
};
|
|
145
|
+
}
|
|
119
146
|
var SECTION_BY_ID = {
|
|
120
147
|
// 1508:2616 — "First name", "M.I.", "Last Name".
|
|
121
148
|
LEGAL_FIRST_NAME: "NAME",
|
|
@@ -144,14 +171,15 @@ var SECTION_BY_ID = {
|
|
|
144
171
|
SOURCE_OF_WEALTH_DECLARATION: "SOURCE_OF_WEALTH",
|
|
145
172
|
[GROSS_ANNUAL_INCOME]: "INCOME",
|
|
146
173
|
[EXPECTED_AMOUNT_PER_MONTH]: "ACTIVITY",
|
|
147
|
-
[TRANSACTIONS_PER_MONTH]: "ACTIVITY"
|
|
174
|
+
[TRANSACTIONS_PER_MONTH]: "ACTIVITY",
|
|
175
|
+
[NET_WORTH]: "NET_WORTH"
|
|
148
176
|
};
|
|
149
177
|
var KEYBOARD_BY_ID = {
|
|
150
|
-
TAX_IDENTIFIER: "number-pad",
|
|
151
178
|
PHONE_NUMBER: "phone-pad",
|
|
152
179
|
[GROSS_ANNUAL_INCOME]: "decimal-pad",
|
|
153
180
|
[EXPECTED_AMOUNT_PER_MONTH]: "decimal-pad",
|
|
154
|
-
[TRANSACTIONS_PER_MONTH]: "number-pad"
|
|
181
|
+
[TRANSACTIONS_PER_MONTH]: "number-pad",
|
|
182
|
+
[NET_WORTH]: "decimal-pad"
|
|
155
183
|
};
|
|
156
184
|
var DRAWN_TYPES = /* @__PURE__ */ new Set(["TEXT", "SELECT", "DATE", "COUNTRY"]);
|
|
157
185
|
var GROUPED_SECTIONS = /* @__PURE__ */ new Set(["ADDRESS"]);
|
|
@@ -168,6 +196,7 @@ var SECTION_ORDER = [
|
|
|
168
196
|
"PURPOSE",
|
|
169
197
|
"SOURCE_OF_WEALTH",
|
|
170
198
|
"INCOME",
|
|
199
|
+
"NET_WORTH",
|
|
171
200
|
"ACTIVITY",
|
|
172
201
|
"DETAILS"
|
|
173
202
|
];
|
|
@@ -219,6 +248,9 @@ var POSTAL_CODE_KEYBOARD = {
|
|
|
219
248
|
digits: "number-pad",
|
|
220
249
|
separated: Platform.OS === "ios" ? "numbers-and-punctuation" : void 0
|
|
221
250
|
};
|
|
251
|
+
function fieldCountry(field, countries) {
|
|
252
|
+
return field.id === "TAX_IDENTIFIER" ? countries.taxResidence : countries.address;
|
|
253
|
+
}
|
|
222
254
|
function fieldKeyboardType(field, country) {
|
|
223
255
|
if (field.type !== "TEXT") {
|
|
224
256
|
return void 0;
|
|
@@ -227,8 +259,21 @@ function fieldKeyboardType(field, country) {
|
|
|
227
259
|
const form = postalCodeForm(country);
|
|
228
260
|
return form === void 0 ? void 0 : POSTAL_CODE_KEYBOARD[form];
|
|
229
261
|
}
|
|
262
|
+
if (field.id === "TAX_IDENTIFIER") {
|
|
263
|
+
return taxIdentifierKeyboard(country);
|
|
264
|
+
}
|
|
230
265
|
return KEYBOARD_BY_ID[field.id];
|
|
231
266
|
}
|
|
267
|
+
var DIGIT_TAX_IDENTIFIER_COUNTRIES = /* @__PURE__ */ new Set([
|
|
268
|
+
"US",
|
|
269
|
+
"BR"
|
|
270
|
+
]);
|
|
271
|
+
function taxIdentifierKeyboard(country) {
|
|
272
|
+
if (country === void 0 || DIGIT_TAX_IDENTIFIER_COUNTRIES.has(country.toUpperCase())) {
|
|
273
|
+
return "number-pad";
|
|
274
|
+
}
|
|
275
|
+
return void 0;
|
|
276
|
+
}
|
|
232
277
|
function isDigitsField(field, country) {
|
|
233
278
|
const keyboardType = fieldKeyboardType(field, country);
|
|
234
279
|
return keyboardType !== void 0 && PADS_WITHOUT_RETURN_KEY.has(keyboardType);
|
|
@@ -306,15 +351,23 @@ export {
|
|
|
306
351
|
GROSS_ANNUAL_INCOME,
|
|
307
352
|
EXPECTED_AMOUNT_PER_MONTH,
|
|
308
353
|
TRANSACTIONS_PER_MONTH,
|
|
354
|
+
NET_WORTH,
|
|
355
|
+
fieldCurrency,
|
|
356
|
+
withoutLabelledCurrency,
|
|
309
357
|
isIdentityField,
|
|
310
358
|
isInlineChoiceSection,
|
|
311
359
|
pickedDateField,
|
|
312
360
|
isFocusableField,
|
|
313
361
|
returnHop,
|
|
362
|
+
fieldCountry,
|
|
314
363
|
fieldKeyboardType,
|
|
315
364
|
isDigitsField,
|
|
316
365
|
isFixedWidthField,
|
|
317
366
|
unsupportedFields,
|
|
318
|
-
sectionPages
|
|
367
|
+
sectionPages,
|
|
368
|
+
PRIVACY_POLICY_URL,
|
|
369
|
+
CONSENT_COPY_VERSION,
|
|
370
|
+
PERSONA_PRIVACY_POLICY_URL,
|
|
371
|
+
kycProviderDisplayName
|
|
319
372
|
};
|
|
320
|
-
//# sourceMappingURL=chunk-
|
|
373
|
+
//# sourceMappingURL=chunk-4EEB4ZBQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/preview/flowPreview.tsx", "../src/fiat/legalLinks.ts", "../src/fiat/formLayout.ts", "../src/fiat/keyboardReturnKey.ts", "../src/fiat/postalCodeCountries.ts"],
|
|
4
|
+
"sourcesContent": ["import type { FiatStepResponse } from '@funkit/connect-core'\nimport {\n type Dispatch,\n type ReactNode,\n type SetStateAction,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react'\n\nimport type { KycCompletion } from '../fiat/useKycCompletion'\nimport type { KycSection } from '../fiat/formLayout'\nimport type { FlowScreen } from '../flow/FunkitFlowProvider'\n\n/**\n * Where the fiat session opens. Each field seeds one piece of state a user would otherwise reach\n * by tapping through, so any screen of the rail is one seed away.\n */\nexport interface FiatPreviewSeed {\n /** The step response the session opens on, as if the backend had just sent it. */\n step?: FiatStepResponse\n /** The amount entry's value. */\n amount?: string\n /** Presses the entry CTA once it is ready: opens the contact round, or the KYC options card. */\n pressEntry?: boolean\n /** An identity round's consent intro, or its form open at a section. */\n identity?: { page: 'consent' } | { page: 'form'; section?: KycSection }\n /** Past the document-capture intro, onto the provider's own surface. */\n documentStarted?: boolean\n /** The provider asked for its capture again after the buyer finished one. */\n captureReissued?: boolean\n /** The acknowledgement a finished identity form shows before its verdict. */\n kycCompletion?: KycCompletion\n /** A provider surface that failed, as the adapter reports it. */\n surfaceFailure?: { code: string; detail?: string }\n /** Submits the seeded step's CTA with this id on open \u2014 how a failed send is reached. */\n submitOnOpen?: string\n /** Turns the deposit-match preview on, as the host's internal flag does. */\n depositMatch?: boolean\n}\n\nexport interface DepositPreviewSeed {\n /** The screen the flow opens on; defaults to the root `beginDeposit` picks. Transfer opens above it. */\n screen?: Extract<FlowScreen, 'depositAmount' | 'addMoney' | 'transfer'>\n fiat?: FiatPreviewSeed\n /** The deposit chain, by id, as if picked from the Crypto row \u2014 Transfer needs one. */\n chainId?: string\n}\n\ntype WithdrawalStackScreen = Extract<\n FlowScreen,\n | 'withdrawMethod'\n | 'withdrawAmount'\n | 'withdrawAddress'\n | 'withdrawReceiveToken'\n>\n\n/** The submitted withdrawal the completion screen reports on. */\nexport interface WithdrawalPreviewCompletion {\n txHash: `0x${string}`\n amountLabel: string\n usdLabel?: string\n tokenLabel?: string\n}\n\ninterface WithdrawalPreviewFields {\n /** The payout method picked on the list, by `WithdrawalMethodOption.id`. */\n methodId?: string\n amount?: string\n recipient?: string\n /** The retryable error that replaces every screen after a failed execution. */\n executionError?: boolean\n}\n\n/**\n * The withdrawal flow's opening state. The type rules out the stacks that render nothing: an\n * empty one, and a completion screen with no withdrawal to report.\n */\nexport type WithdrawalPreviewSeed = WithdrawalPreviewFields &\n (\n | {\n /** The screens on the stack, root first; defaults to the payout-method list. */\n stack?: [WithdrawalStackScreen, ...WithdrawalStackScreen[]]\n complete?: undefined\n }\n | { stack: ['withdrawComplete']; complete: WithdrawalPreviewCompletion }\n )\n\n/**\n * A state to open the SDK's flow at, for hosted previews and QA builds.\n * - Consumed by the next matching `begin*` only; closing and reopening starts clean.\n * - Never set in production: every read falls back to the flow's own start.\n */\nexport interface FlowPreviewSeed {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n}\n\nconst HostPreviewContext = createContext<FlowPreviewSeed | undefined>(undefined)\n\n/**\n * Opens the next `beginDeposit` / `beginWithdrawal` below it at `seed`.\n * - Mount it above `<FunkitProvider>`.\n * - Memoize `seed`: a new object is a new preview, so one built inline reopens every flow seeded.\n */\nexport function FunkitFlowPreview({\n seed,\n children,\n}: {\n seed: FlowPreviewSeed | undefined\n children: ReactNode\n}) {\n return (\n <HostPreviewContext.Provider value={seed}>\n {children}\n </HostPreviewContext.Provider>\n )\n}\n\n/** The seed a host mounted; read by the flow provider when a flow opens. */\nexport function useHostFlowPreview(): FlowPreviewSeed | undefined {\n return useContext(HostPreviewContext)\n}\n\n/** The seeds of the flow session a host preview opened; empty everywhere else. */\nexport interface ActivePreview {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n}\n\nconst NO_PREVIEW: ActivePreview = {}\nconst ActivePreviewContext = createContext<ActivePreview>(NO_PREVIEW)\n\n/** Scopes a consumed seed to the one flow session it opened. */\nexport function ActiveFlowPreview({\n deposit,\n withdrawal,\n children,\n}: {\n deposit?: DepositPreviewSeed\n withdrawal?: WithdrawalPreviewSeed\n children: ReactNode\n}) {\n // The value names the session: readers are tracked against it.\n const preview = useMemo(\n () =>\n deposit === undefined && withdrawal === undefined\n ? NO_PREVIEW\n : { deposit, withdrawal },\n [deposit, withdrawal],\n )\n return (\n <ActivePreviewContext.Provider value={preview}>\n {children}\n </ActivePreviewContext.Provider>\n )\n}\n\n/** Reads one seed value out of the session's preview. */\nexport type PreviewPick<T> = (preview: ActivePreview) => T | undefined\n\n/**\n * Every seed value a flow reads, one reader each. Readers are tracked by identity, so each is\n * declared once here rather than inline where it is read.\n */\nexport const SEED = {\n fiatAmount: (p) => p.deposit?.fiat?.amount,\n fiatStep: (p) => p.deposit?.fiat?.step,\n fiatPressEntry: (p) => p.deposit?.fiat?.pressEntry,\n fiatSubmitOnOpen: (p) => p.deposit?.fiat?.submitOnOpen,\n fiatSurfaceFailure: (p) => p.deposit?.fiat?.surfaceFailure,\n fiatDepositMatch: (p) => p.deposit?.fiat?.depositMatch,\n kycCompletion: (p) => p.deposit?.fiat?.kycCompletion,\n identityPage: (p) => p.deposit?.fiat?.identity?.page,\n identitySection: (p) => {\n const identity = p.deposit?.fiat?.identity\n return identity?.page === 'form' ? identity.section : undefined\n },\n documentStarted: (p) => p.deposit?.fiat?.documentStarted,\n fiatCaptureReissued: (p) => p.deposit?.fiat?.captureReissued,\n depositChainId: (p) => p.deposit?.chainId,\n withdrawalMethodId: (p) => p.withdrawal?.methodId,\n withdrawalAmount: (p) => p.withdrawal?.amount,\n withdrawalRecipient: (p) => p.withdrawal?.recipient,\n withdrawalComplete: (p) => p.withdrawal?.complete,\n withdrawalExecutionError: (p) => p.withdrawal?.executionError,\n} satisfies Record<string, PreviewPick<unknown>>\n\nconst readers = new WeakMap<ActivePreview, Set<PreviewPick<unknown>>>()\n\n/**\n * The seed value for the first mount that reads it; `undefined` for every mount after.\n * - A later mount of the same reader is the user moving on (a new round, a return to the entry),\n * so a seed never re-applies after the state it describes.\n * - Marked read on commit, so Strict Mode's double render still sees it.\n */\nexport function useSeed<T>(pick: PreviewPick<T>): T | undefined {\n const preview = useContext(ActivePreviewContext)\n const [seed] = useState(() =>\n readers.get(preview)?.has(pick) === true ? undefined : pick(preview),\n )\n useEffect(() => {\n if (preview === NO_PREVIEW) {\n return\n }\n const read = readers.get(preview) ?? new Set()\n read.add(pick)\n readers.set(preview, read)\n }, [preview, pick])\n return seed\n}\n\n/**\n * `useState` whose initial value a host preview may seed; production always starts at `initial`.\n * `fromSeed` shapes a seed value into the state when the two differ.\n */\nexport function useSeededState<T>(\n pick: PreviewPick<T>,\n initial: T,\n): [T, Dispatch<SetStateAction<T>>]\nexport function useSeededState<S, T>(\n pick: PreviewPick<S>,\n initial: T,\n fromSeed: (seed: S) => T,\n): [T, Dispatch<SetStateAction<T>>]\nexport function useSeededState<S, T>(\n pick: PreviewPick<S>,\n initial: T,\n fromSeed?: (seed: S) => T,\n): [T, Dispatch<SetStateAction<T>>] {\n const seed = useSeed(pick)\n return useState<T>(() => {\n if (seed === undefined) {\n return initial\n }\n return fromSeed === undefined ? (seed as unknown as T) : fromSeed(seed)\n })\n}\n", "import type { FiatProvider, KYCProvider } from '@funkit/connect-core'\n\n/**\n * The documents the identity step points at.\n *\n * Held together because two screens link them, and a provider change is one\n * edit rather than a hunt through the copy.\n */\n\n/** Fun's own policy, linked from the consent the buyer has to give. */\nexport const PRIVACY_POLICY_URL = 'https://fun.xyz/privacy'\n\n/**\n * Bumped whenever the consent copy changes, and logged and recorded with every\n * consent, so a record can be matched to the words the buyer actually read.\n * The backend must publish the same revision (`FUN_KYC_CONSENT_TERMS`).\n */\nexport const CONSENT_COPY_VERSION = 'fun-kyc-consent-2026-09-11'\n\n/** Persona's policy, linked from MoonPay's sharing disclosure (`MOONPAY_SHARING_CONSENT_VERSION`). */\nexport const PERSONA_PRIVACY_POLICY_URL =\n 'https://withpersona.com/legal/privacy-policy'\n\n/**\n * The terms of the provider that settles the order, keyed by the provider the\n * round names.\n *\n * Only verified URLs belong here. A provider absent from the map is named in\n * the copy without a link and logged (`kyc_provider_terms_url_missing`) \u2014 it\n * is never guessed, and never falls back to another provider's terms.\n */\nconst PROVIDER_TERMS_URLS: Partial<Record<FiatProvider, string>> = {\n BANXA: 'https://banxa.com/terms-of-use/',\n}\n\n/** How each provider writes its own name; the enum is upper-case. */\nconst PROVIDER_NAMES: Partial<Record<FiatProvider, string>> = {\n BANXA: 'Banxa',\n TRANSAK: 'Transak',\n}\n\n/** The identity vendors, which settle no orders and so are kept apart. */\nconst KYC_PROVIDER_NAMES: Partial<Record<KYCProvider, string>> = {\n SUMSUB: 'Sumsub',\n}\n\n/** Title-cases an upper-case enum member for a provider with no name on record. */\nconst titleCase = (value: string) =>\n value.charAt(0) + value.slice(1).toLowerCase()\n\n/** The provider's terms, or `undefined` when none is on record for it. */\nexport function providerTermsUrl(\n provider: FiatProvider | undefined,\n): string | undefined {\n return provider === undefined ? undefined : PROVIDER_TERMS_URLS[provider]\n}\n\n/**\n * The provider's name as the copy should print it. `fallback` is what a\n * screen drawn with no round to name one says instead.\n */\nexport function providerDisplayName(\n provider: FiatProvider | undefined,\n fallback: string,\n): string {\n if (provider === undefined) {\n return fallback\n }\n return PROVIDER_NAMES[provider] ?? titleCase(provider)\n}\n\n/**\n * The identity vendor's name as the copy should print it. Separate from the\n * settling provider: the two enums name different things and never mix.\n */\nexport function kycProviderDisplayName(\n provider: KYCProvider | undefined,\n fallback: string,\n): string {\n if (provider === undefined) {\n return fallback\n }\n return KYC_PROVIDER_NAMES[provider] ?? titleCase(provider)\n}\n", "import type { FormField, KycFieldId } from '@funkit/connect-core'\nimport { isValueField } from '@funkit/connect-core'\nimport { Platform, type TextInputProps } from 'react-native'\n\nimport { PADS_WITHOUT_RETURN_KEY } from './keyboardReturnKey'\nimport { type PostalCodeForm, postalCodeForm } from './postalCodeCountries'\n\n/**\n * The pages the US form is drawn as, in the order the design steps them.\n *\n * Figma \"EDIT: KYC Enhancements\": 1508:2616 (name), 1844:17471 (date of\n * birth), 1631:7256 (address), 1631:7883 (SSN). `DETAILS` is not a frame \u2014 it\n * is where a field the design never drew goes, so a form the server words its\n * own way still renders.\n */\nexport type KycSection =\n | 'NAME'\n | 'DOB'\n | 'NATIONALITY'\n | 'COUNTRY'\n | 'ADDRESS'\n | 'SSN'\n | 'PHONE'\n | 'OCCUPATION'\n | 'EMPLOYMENT'\n | 'PURPOSE'\n | 'SOURCE_OF_WEALTH'\n | 'INCOME'\n | 'NET_WORTH'\n | 'ACTIVITY'\n | 'DETAILS'\n\nexport interface KycSectionPage {\n section: KycSection\n /** Drawn as one card with a rule between rows, rather than loose boxes. */\n grouped: boolean\n /** Fields sharing a row sit side by side, as the design pairs them. */\n rows: FormField[][]\n}\n\n/**\n * The questionnaire answers this build draws a page for. The contract types a\n * questionnaire id as a template; any other lands in `DETAILS`.\n */\nexport const GROSS_ANNUAL_INCOME =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:grossAnnualIncome'\nexport const EXPECTED_AMOUNT_PER_MONTH =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:expectedTransactionAmountPerMonth'\nexport const TRANSACTIONS_PER_MONTH =\n 'QUESTIONNAIRE_RESPONSE:customerDueDiligence:transactionFrequencyPerMonth'\nexport const NET_WORTH = 'QUESTIONNAIRE_RESPONSE:enhancedDueDiligence:netWorth'\n\n/**\n * - `FormField` has no currency key, so a figure's reporting currency rides its\n * label as a trailing \" (XXX)\".\n * - Any other label names no currency.\n */\nconst LABELLED_CURRENCY = / \\(([A-Z]{3})\\)$/\n\nexport function fieldCurrency(field: FormField): string | undefined {\n return LABELLED_CURRENCY.exec(field.labelFallback)?.[1]\n}\n\n/** The label without its currency, for a field whose caption already names it. */\nexport function withoutLabelledCurrency(field: FormField): FormField {\n return {\n ...field,\n labelFallback: field.labelFallback.replace(LABELLED_CURRENCY, ''),\n }\n}\n\n/**\n * Which page a field belongs to, by id.\n *\n * The contract closes the id set, so these are the canonical names and there\n * is no second spelling to carry. An id with no page here lands in `DETAILS`\n * rather than being refused: the server owns the list, and a form is not\n * undrawable just because it asks for something the frames do not group.\n */\nconst SECTION_BY_ID: Readonly<Partial<Record<KycFieldId, KycSection>>> = {\n // 1508:2616 \u2014 \"First name\", \"M.I.\", \"Last Name\".\n LEGAL_FIRST_NAME: 'NAME',\n LEGAL_MIDDLE_NAME: 'NAME',\n LEGAL_LAST_NAME: 'NAME',\n // 1844:17471 \u2014 its own page, asked for on its own over the date picker.\n DATE_OF_BIRTH: 'DOB',\n NATIONALITY: 'NATIONALITY',\n // 1631:7256 \u2014 \"Address\", \"Apartment, suite, etc.\", \"City\", \"State\", \"ZIP code\".\n RESIDENTIAL_ADDRESS_LINE_1: 'ADDRESS',\n RESIDENTIAL_ADDRESS_LINE_2: 'ADDRESS',\n RESIDENTIAL_ADDRESS_CITY: 'ADDRESS',\n RESIDENTIAL_ADDRESS_REGION: 'ADDRESS',\n RESIDENTIAL_ADDRESS_POSTAL_CODE: 'ADDRESS',\n RESIDENTIAL_ADDRESS_COUNTRY: 'COUNTRY',\n // 1631:7883 \u2014 \"SSN\".\n TAX_IDENTIFIER: 'SSN',\n TAX_RESIDENCE_COUNTRY: 'COUNTRY',\n OCCUPATION_TITLE: 'OCCUPATION',\n OCCUPATION_INDUSTRY: 'OCCUPATION',\n PURPOSE_OF_TRANSACTION: 'PURPOSE',\n PURPOSE_OF_SERVICE: 'PURPOSE',\n // MoonPay's customer due diligence round, asked after the SSN.\n PHONE_NUMBER: 'PHONE',\n EMPLOYMENT_STATUS: 'EMPLOYMENT',\n SOURCE_OF_WEALTH_DECLARATION: 'SOURCE_OF_WEALTH',\n [GROSS_ANNUAL_INCOME]: 'INCOME',\n [EXPECTED_AMOUNT_PER_MONTH]: 'ACTIVITY',\n [TRANSACTIONS_PER_MONTH]: 'ACTIVITY',\n [NET_WORTH]: 'NET_WORTH',\n}\n\n/**\n * The keyboard a typed field raises. The SSN page is drawn over a number pad\n * (1631:7883) and the due-diligence figures over the pads that fit them;\n * every other page in the form is drawn over letters.\n */\nconst KEYBOARD_BY_ID: Readonly<\n Partial<Record<KycFieldId, TextInputProps['keyboardType']>>\n> = {\n PHONE_NUMBER: 'phone-pad',\n [GROSS_ANNUAL_INCOME]: 'decimal-pad',\n [EXPECTED_AMOUNT_PER_MONTH]: 'decimal-pad',\n [TRANSACTIONS_PER_MONTH]: 'number-pad',\n [NET_WORTH]: 'decimal-pad',\n}\n\n/**\n * Field types a page can draw. A date and a country are typed into the same\n * filled box as any other answer; a hosted step is an errand the user runs\n * elsewhere and a document streams to an endpoint this build has not\n * installed, so neither has a box to draw.\n */\nconst DRAWN_TYPES = new Set(['TEXT', 'SELECT', 'DATE', 'COUNTRY'])\n\n/** One card ruled between its rows (1631:7256, \"address\"). */\nconst GROUPED_SECTIONS = new Set<KycSection>(['ADDRESS'])\n\n/**\n * The order 1508:2616 \u2192 1844:17471 \u2192 1631:7256 \u2192 1631:7883 walks, anything\n * else trailing.\n */\nconst SECTION_ORDER: readonly KycSection[] = [\n 'NAME',\n 'DOB',\n 'NATIONALITY',\n 'COUNTRY',\n 'ADDRESS',\n 'SSN',\n 'PHONE',\n 'OCCUPATION',\n 'EMPLOYMENT',\n 'PURPOSE',\n 'SOURCE_OF_WEALTH',\n 'INCOME',\n 'NET_WORTH',\n 'ACTIVITY',\n 'DETAILS',\n]\n\n/**\n * The page's field a date picker can answer, when that is the whole page.\n *\n * A picker takes the keyboard's slot, so it can only be offered on a page\n * with nothing else to type: a date beside two names would leave one of the\n * two controls covering the other. Anywhere else the date is typed.\n */\nconst IDENTITY_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'NAME',\n 'DOB',\n 'NATIONALITY',\n 'COUNTRY',\n 'ADDRESS',\n 'SSN',\n])\n\n/**\n * The server owns the field list, so an id this build does not know is not\n * identity: only the frames that collect who someone is qualify.\n */\nexport function isIdentityField(field: FormField): boolean {\n const section = SECTION_BY_ID[field.id]\n return section !== undefined && IDENTITY_SECTIONS.has(section)\n}\n\n/**\n * The pages that draw their answers on the page rather than behind a chooser\n * (2475:8992).\n *\n * Named, not inferred from the field's type: `DETAILS` also collects a\n * `SELECT`, but it holds whatever the server asks for that no frame drew, and\n * a list of unknown length is what the chooser's sheet is for.\n */\nconst INLINE_CHOICE_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'OCCUPATION',\n 'EMPLOYMENT',\n 'PURPOSE',\n 'SOURCE_OF_WEALTH',\n])\n\nexport function isInlineChoiceSection(section: KycSection): boolean {\n return INLINE_CHOICE_SECTIONS.has(section)\n}\n\nexport function pickedDateField(page: KycSectionPage): FormField | undefined {\n const fields = page.rows.flat()\n const only = fields.length === 1 ? fields[0] : undefined\n return only?.type === 'DATE' ? only : undefined\n}\n\n/**\n * Whether the field is typed into, and so takes a turn in the return-key\n * chain. A choice is not.\n */\nexport function isFocusableField(field: FormField): boolean {\n return field.type === 'TEXT' || field.type === 'DATE'\n}\n\n/** Pages whose keyboards read \"next\" on the field that tries the page too (1950:2055, 1951:9265). */\nconst NEXT_TO_TRY_SECTIONS: ReadonlySet<KycSection> = new Set<KycSection>([\n 'NAME',\n 'ADDRESS',\n])\n\nexport interface ReturnHop {\n label: 'next' | 'done'\n /** Absent where the return key tries the page instead. */\n to?: FormField\n}\n\n/**\n * Where a typed field's return key goes: the next required typed field.\n *\n * - An optional line is stepped over (2334:7164) but still hands on when the\n * user taps into it.\n */\nexport function returnHop(\n section: KycSection,\n typedFields: readonly FormField[],\n fieldId: string,\n): ReturnHop | undefined {\n const at = typedFields.findIndex((field) => field.id === fieldId)\n if (at < 0) {\n return undefined\n }\n const to = typedFields.slice(at + 1).find((field) => field.required)\n if (to !== undefined) {\n return { label: 'next', to }\n }\n return { label: NEXT_TO_TRY_SECTIONS.has(section) ? 'next' : 'done' }\n}\n\n/**\n * - Digits alone take the number pad, whose missing return key the page\n * answers with Continue (`isDigitsField`).\n * - A hyphen or space needs iOS's digits-first keyboard, which can type it;\n * Android has none, so it keeps letters.\n */\nconst POSTAL_CODE_KEYBOARD: Readonly<\n Record<PostalCodeForm, TextInputProps['keyboardType']>\n> = {\n digits: 'number-pad',\n separated: Platform.OS === 'ios' ? 'numbers-and-punctuation' : undefined,\n}\n\n/**\n * The country a field's keyboard and choices follow.\n *\n * - The tax ID takes the tax residence's, which also names it in the heading.\n * - Every other field takes the address's.\n */\nexport function fieldCountry(\n field: FormField,\n countries: { address?: string; taxResidence?: string },\n): string | undefined {\n return field.id === 'TAX_IDENTIFIER'\n ? countries.taxResidence\n : countries.address\n}\n\n/** `country` is the field's own, from `fieldCountry`. */\nexport function fieldKeyboardType(\n field: FormField,\n country?: string,\n): TextInputProps['keyboardType'] | undefined {\n if (field.type !== 'TEXT') {\n return undefined\n }\n if (field.id === 'RESIDENTIAL_ADDRESS_POSTAL_CODE') {\n const form = postalCodeForm(country)\n return form === undefined ? undefined : POSTAL_CODE_KEYBOARD[form]\n }\n if (field.id === 'TAX_IDENTIFIER') {\n return taxIdentifierKeyboard(country)\n }\n return KEYBOARD_BY_ID[field.id]\n}\n\nconst DIGIT_TAX_IDENTIFIER_COUNTRIES: ReadonlySet<string> = new Set([\n 'US',\n 'BR',\n])\n\nfunction taxIdentifierKeyboard(\n country: string | undefined,\n): TextInputProps['keyboardType'] | undefined {\n if (\n country === undefined ||\n DIGIT_TAX_IDENTIFIER_COUNTRIES.has(country.toUpperCase())\n ) {\n return 'number-pad'\n }\n return undefined\n}\n\n/** Whether the field raises a pad rather than letters, and so has no return key. */\nexport function isDigitsField(field: FormField, country?: string): boolean {\n const keyboardType = fieldKeyboardType(field, country)\n return keyboardType !== undefined && PADS_WITHOUT_RETURN_KEY.has(keyboardType)\n}\n\n/** Whether the field is drawn at a fixed width rather than growing to fill. */\nexport function isFixedWidthField(field: FormField): boolean {\n return field.id === 'LEGAL_MIDDLE_NAME'\n}\n\n/**\n * The form's fields that no page draws.\n *\n * Type only: an unknown id has a page (`DETAILS`), so refusing one would\n * reject a whole form over a field the screens can draw perfectly well. A\n * form with any of these cannot be completed here, so the caller shows its\n * unsupported state rather than a form missing a field the server requires.\n */\nexport function unsupportedFields(fields: readonly FormField[]): FormField[] {\n return fields.filter((field) => !DRAWN_TYPES.has(field.type))\n}\n\n/**\n * Splits a form into the pages the design steps through.\n *\n * Pages keep the design's order; fields keep the server's, so a page that\n * gains a field it already draws renders it without a client release. A page\n * with no fields is not a page.\n */\nexport function sectionPages(fields: readonly FormField[]): KycSectionPage[] {\n const bySection = new Map<KycSection, FormField[]>()\n for (const field of fields) {\n if (!DRAWN_TYPES.has(field.type)) {\n continue\n }\n // A state the provider does not require is not asked: European\n // addresses have none, and the design draws no row for it.\n if (field.id === 'RESIDENTIAL_ADDRESS_REGION' && !field.required) {\n continue\n }\n const section = SECTION_BY_ID[field.id] ?? 'DETAILS'\n const collected = bySection.get(section) ?? []\n collected.push(field)\n bySection.set(section, collected)\n }\n\n return SECTION_ORDER.flatMap<KycSectionPage>((section) => {\n const collected = bySection.get(section)\n if (collected === undefined) {\n return []\n }\n if (isInlineChoiceSection(section) || section === 'DETAILS') {\n return collected.map((field) => ({\n section,\n grouped: false,\n rows: [[field]],\n }))\n }\n return [\n {\n section,\n grouped: GROUPED_SECTIONS.has(section),\n rows:\n section === 'ADDRESS'\n ? addressRows(collected)\n : collected.map((field) => [field]),\n },\n ]\n })\n}\n\n/**\n * The address card as the design lays it out for the country (1631:7256):\n * the street, the apartment line, then the city with the state and ZIP paired\n * under it \u2014 or, where the provider asks for no state, the postal code paired\n * before the city, as a European address reads. A field the design does not\n * place trails on its own row.\n */\nfunction addressRows(fields: readonly FormField[]): FormField[][] {\n const byId = new Map(fields.map((field) => [field.id, field]))\n const take = (id: KycFieldId) => {\n const field = byId.get(id)\n byId.delete(id)\n return field\n }\n const line1 = take('RESIDENTIAL_ADDRESS_LINE_1')\n const line2 = take('RESIDENTIAL_ADDRESS_LINE_2')\n const city = take('RESIDENTIAL_ADDRESS_CITY')\n const region = take('RESIDENTIAL_ADDRESS_REGION')\n const postal = take('RESIDENTIAL_ADDRESS_POSTAL_CODE')\n const rows: (FormField | undefined)[][] = [[line1], [line2]]\n if (region === undefined) {\n rows.push([postal, city])\n } else {\n rows.push([city], [region, postal])\n }\n return [...rows, ...[...byId.values()].map((field) => [field])]\n .map((row) => row.filter((field) => field !== undefined))\n .filter((row) => row.length > 0)\n}\n", "import type { TextInputProps } from 'react-native'\n\n/**\n * Keyboards with no return key. iOS draws a floating button of its own when\n * one of these is asked for a return key, and it lands over the screen's\n * bottom-right \u2014 where the advance control already is.\n */\nexport const PADS_WITHOUT_RETURN_KEY = new Set<TextInputProps['keyboardType']>([\n 'number-pad',\n 'numeric',\n 'decimal-pad',\n 'phone-pad',\n])\n", "/**\n * How a country writes its postal codes, where Google's address metadata\n * (libaddressinput, chromium-i18n.appspot.com/ssl-address/data) and\n * `postcode-validator` agree. Anywhere they disagree is on neither list, so\n * the keyboard stays letters (`postalCodeCountries.drift.test.ts`).\n *\n * - `digits`: codes are written as digits alone. The US ZIP+4 extension and\n * FR's space are optional, and neither is how the post office writes them.\n * - `separated`: digits the country writes split by a hyphen or space\n * (`12345-678`, `123 45`), which a number pad cannot type.\n * - A country whose codes carry any letter (GB, CA, NL, IE, AR, MT, LV\u2026), or\n * that has no postal code, is on neither list.\n */\nexport type PostalCodeForm = 'digits' | 'separated'\n\nconst codes = (list: string): ReadonlySet<string> =>\n new Set(list.trim().split(/\\s+/))\n\nconst DIGIT_COUNTRIES = codes(`\n AF AL AM AS AT AU AX AZ BA BD BE BG BH BL BT BY CC CH CL CN CO CU CV\n CX CY DE DK DO DZ EC EE EG EH ES ET FI FM FO FR GE GF GL GN GP GT GU\n GW HM HN HR HT HU ID IL IN IQ IS IT JO KE KG KH KR KW KZ LA LI LK LR\n LS LT LU MA MC MD ME MF MG MH MK MM MN MP MQ MV MX MY MZ NA NC NE NF\n NG NO NP NZ PF PG PH PK PM PR PW PY RE RO RS RU SA SD SG SI SJ SM SN\n TH TJ TM TN TR TW TZ UA UM US UY UZ VA VE VI VN WF XK YT ZA ZM\n`)\n\nconst SEPARATED_COUNTRIES = codes(`\n BR CR CZ GR IR JP LB PL PT SE SK\n`)\n\nexport function postalCodeForm(\n alpha2: string | undefined,\n): PostalCodeForm | undefined {\n const code = alpha2?.toUpperCase()\n if (code === undefined) {\n return undefined\n }\n if (DIGIT_COUNTRIES.has(code)) {\n return 'digits'\n }\n return SEPARATED_COUNTRIES.has(code) ? 'separated' : undefined\n}\n"],
|
|
5
|
+
"mappings": ";AACA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyGH;AAfJ,IAAM,qBAAqB,cAA2C,MAAS;AAOxE,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAGG;AACD,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MACjC,UACH;AAEJ;AAGO,SAAS,qBAAkD;AAChE,SAAO,WAAW,kBAAkB;AACtC;AAQA,IAAM,aAA4B,CAAC;AACnC,IAAM,uBAAuB,cAA6B,UAAU;AAG7D,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AAED,QAAM,UAAU;AAAA,IACd,MACE,YAAY,UAAa,eAAe,SACpC,aACA,EAAE,SAAS,WAAW;AAAA,IAC5B,CAAC,SAAS,UAAU;AAAA,EACtB;AACA,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACnC,UACH;AAEJ;AASO,IAAM,OAAO;AAAA,EAClB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM;AAAA,EACpC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