@funkit/connect-rn 8.2.0 → 9.0.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.
Files changed (297) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/README.md +25 -12
  3. package/dist/{chunk-GG2WCQ6N.js → chunk-3ZNAGQHD.js} +3 -3
  4. package/dist/chunk-BC4RXFI7.js +319 -0
  5. package/dist/chunk-BC4RXFI7.js.map +7 -0
  6. package/dist/{chunk-J5K2FSAI.js → chunk-MVQH4YFI.js} +330 -146
  7. package/dist/chunk-MVQH4YFI.js.map +7 -0
  8. package/dist/{chunk-D64EJ57D.js → chunk-ZE77GVDW.js} +94 -10
  9. package/dist/chunk-ZE77GVDW.js.map +7 -0
  10. package/dist/clients/lighter.js +2 -2
  11. package/dist/clients/nado.js +3 -3
  12. package/dist/clients/solana.js +1 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +9859 -6316
  16. package/dist/index.js.map +4 -4
  17. package/dist/preview.d.ts +5 -0
  18. package/dist/preview.d.ts.map +1 -0
  19. package/dist/preview.js +1159 -0
  20. package/dist/preview.js.map +7 -0
  21. package/dist/src/components/DepositActionMotion.d.ts +4 -1
  22. package/dist/src/components/DepositActionMotion.d.ts.map +1 -1
  23. package/dist/src/components/DismissibleToast.d.ts +35 -0
  24. package/dist/src/components/DismissibleToast.d.ts.map +1 -0
  25. package/dist/src/components/GlassSurface.d.ts +3 -1
  26. package/dist/src/components/GlassSurface.d.ts.map +1 -1
  27. package/dist/src/components/PillButton.d.ts +20 -2
  28. package/dist/src/components/PillButton.d.ts.map +1 -1
  29. package/dist/src/components/StateSwap.d.ts +17 -0
  30. package/dist/src/components/StateSwap.d.ts.map +1 -0
  31. package/dist/src/components/WithdrawSourceCard.d.ts.map +1 -1
  32. package/dist/src/components/v2/AmountDisplay.d.ts.map +1 -1
  33. package/dist/src/components/v2/PaymentMethodPicker.d.ts +18 -0
  34. package/dist/src/components/v2/PaymentMethodPicker.d.ts.map +1 -0
  35. package/dist/src/components/v2/QuickAmountsRow.d.ts.map +1 -1
  36. package/dist/src/fiat/FiatBackButton.d.ts +5 -1
  37. package/dist/src/fiat/FiatBackButton.d.ts.map +1 -1
  38. package/dist/src/fiat/FiatChoiceField.d.ts +4 -3
  39. package/dist/src/fiat/FiatChoiceField.d.ts.map +1 -1
  40. package/dist/src/fiat/FiatContactScreen.d.ts.map +1 -1
  41. package/dist/src/fiat/FiatCountrySheet.d.ts.map +1 -1
  42. package/dist/src/fiat/FiatDocumentCaptureStep.d.ts +7 -2
  43. package/dist/src/fiat/FiatDocumentCaptureStep.d.ts.map +1 -1
  44. package/dist/src/fiat/FiatFailureBanner.d.ts +4 -1
  45. package/dist/src/fiat/FiatFailureBanner.d.ts.map +1 -1
  46. package/dist/src/fiat/FiatFormAdvance.d.ts.map +1 -1
  47. package/dist/src/fiat/FiatFormFieldRow.d.ts +15 -1
  48. package/dist/src/fiat/FiatFormFieldRow.d.ts.map +1 -1
  49. package/dist/src/fiat/FiatFormHeading.d.ts +21 -0
  50. package/dist/src/fiat/FiatFormHeading.d.ts.map +1 -0
  51. package/dist/src/fiat/FiatFormScreen.d.ts +7 -1
  52. package/dist/src/fiat/FiatFormScreen.d.ts.map +1 -1
  53. package/dist/src/fiat/FiatIdentityStep.d.ts +16 -1
  54. package/dist/src/fiat/FiatIdentityStep.d.ts.map +1 -1
  55. package/dist/src/fiat/FiatKycFieldControl.d.ts +0 -2
  56. package/dist/src/fiat/FiatKycFieldControl.d.ts.map +1 -1
  57. package/dist/src/fiat/FiatKycIntroScreen.d.ts +14 -3
  58. package/dist/src/fiat/FiatKycIntroScreen.d.ts.map +1 -1
  59. package/dist/src/fiat/FiatKycOptionsScreen.d.ts +1 -1
  60. package/dist/src/fiat/FiatKycOptionsScreen.d.ts.map +1 -1
  61. package/dist/src/fiat/FiatKycOutcomeScreen.d.ts +8 -6
  62. package/dist/src/fiat/FiatKycOutcomeScreen.d.ts.map +1 -1
  63. package/dist/src/fiat/FiatKycPhoneField.d.ts +2 -3
  64. package/dist/src/fiat/FiatKycPhoneField.d.ts.map +1 -1
  65. package/dist/src/fiat/FiatOtpScreen.d.ts.map +1 -1
  66. package/dist/src/fiat/FiatPhoneField.d.ts +17 -4
  67. package/dist/src/fiat/FiatPhoneField.d.ts.map +1 -1
  68. package/dist/src/fiat/FiatReceipt.d.ts +9 -3
  69. package/dist/src/fiat/FiatReceipt.d.ts.map +1 -1
  70. package/dist/src/fiat/FiatRegionUnsupportedScreen.d.ts.map +1 -1
  71. package/dist/src/fiat/FiatSsnField.d.ts.map +1 -1
  72. package/dist/src/fiat/FiatSubmissionIndicator.d.ts +7 -1
  73. package/dist/src/fiat/FiatSubmissionIndicator.d.ts.map +1 -1
  74. package/dist/src/fiat/FiatTermsNotice.d.ts +4 -2
  75. package/dist/src/fiat/FiatTermsNotice.d.ts.map +1 -1
  76. package/dist/src/fiat/FiatUnsupportedStep.d.ts +11 -0
  77. package/dist/src/fiat/FiatUnsupportedStep.d.ts.map +1 -0
  78. package/dist/src/fiat/SurfaceSlot.d.ts +8 -3
  79. package/dist/src/fiat/SurfaceSlot.d.ts.map +1 -1
  80. package/dist/src/fiat/closeFailure.d.ts +19 -0
  81. package/dist/src/fiat/closeFailure.d.ts.map +1 -0
  82. package/dist/src/fiat/countryListEntries.d.ts +2 -3
  83. package/dist/src/fiat/countryListEntries.d.ts.map +1 -1
  84. package/dist/src/fiat/depositOutcome.d.ts +18 -1
  85. package/dist/src/fiat/depositOutcome.d.ts.map +1 -1
  86. package/dist/src/fiat/fieldLabel.d.ts +14 -0
  87. package/dist/src/fiat/fieldLabel.d.ts.map +1 -0
  88. package/dist/src/fiat/formLayout.d.ts +16 -3
  89. package/dist/src/fiat/formLayout.d.ts.map +1 -1
  90. package/dist/src/fiat/formValidationError.d.ts +4 -2
  91. package/dist/src/fiat/formValidationError.d.ts.map +1 -1
  92. package/dist/src/fiat/kycFailover.d.ts +6 -0
  93. package/dist/src/fiat/kycFailover.d.ts.map +1 -0
  94. package/dist/src/fiat/kycFormState.d.ts +12 -0
  95. package/dist/src/fiat/kycFormState.d.ts.map +1 -1
  96. package/dist/src/fiat/kycFormTheme.d.ts +8 -0
  97. package/dist/src/fiat/kycFormTheme.d.ts.map +1 -1
  98. package/dist/src/fiat/kycUnavailableAlert.d.ts.map +1 -1
  99. package/dist/src/fiat/legalLinks.d.ts +4 -3
  100. package/dist/src/fiat/legalLinks.d.ts.map +1 -1
  101. package/dist/src/fiat/otpScreenProps.d.ts.map +1 -1
  102. package/dist/src/fiat/paymentSurfaceFailure.d.ts +56 -0
  103. package/dist/src/fiat/paymentSurfaceFailure.d.ts.map +1 -0
  104. package/dist/src/fiat/phoneDraft.d.ts +20 -0
  105. package/dist/src/fiat/phoneDraft.d.ts.map +1 -1
  106. package/dist/src/fiat/postalCodeCountries.d.ts +16 -0
  107. package/dist/src/fiat/postalCodeCountries.d.ts.map +1 -0
  108. package/dist/src/fiat/providers/CoinbaseCheckoutSurface.d.ts +8 -2
  109. package/dist/src/fiat/providers/CoinbaseCheckoutSurface.d.ts.map +1 -1
  110. package/dist/src/fiat/providers/SumsubKycSurface.d.ts.map +1 -1
  111. package/dist/src/fiat/providers/TransakApplePaySurface.d.ts.map +1 -1
  112. package/dist/src/fiat/providers/adapter.d.ts +33 -5
  113. package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
  114. package/dist/src/fiat/providers/applePayButtonMetrics.d.ts +1 -2
  115. package/dist/src/fiat/providers/applePayButtonMetrics.d.ts.map +1 -1
  116. package/dist/src/fiat/providers/applePayPaintGate.d.ts +5 -2
  117. package/dist/src/fiat/providers/applePayPaintGate.d.ts.map +1 -1
  118. package/dist/src/fiat/providers/banxaRedirect.d.ts.map +1 -1
  119. package/dist/src/fiat/providers/coinbaseApplePay.d.ts +2 -1
  120. package/dist/src/fiat/providers/coinbaseApplePay.d.ts.map +1 -1
  121. package/dist/src/fiat/providers/coinbaseFailureCopy.d.ts +7 -1
  122. package/dist/src/fiat/providers/coinbaseFailureCopy.d.ts.map +1 -1
  123. package/dist/src/fiat/providers/describeThrown.d.ts.map +1 -1
  124. package/dist/src/fiat/providers/kycIntro.d.ts +20 -0
  125. package/dist/src/fiat/providers/kycIntro.d.ts.map +1 -0
  126. package/dist/src/fiat/providers/moonpay.d.ts +6 -1
  127. package/dist/src/fiat/providers/moonpay.d.ts.map +1 -1
  128. package/dist/src/fiat/providers/moonpayApplePayPainted.d.ts +6 -3
  129. package/dist/src/fiat/providers/moonpayApplePayPainted.d.ts.map +1 -1
  130. package/dist/src/fiat/providers/moonpayApplePayStyle.d.ts +5 -10
  131. package/dist/src/fiat/providers/moonpayApplePayStyle.d.ts.map +1 -1
  132. package/dist/src/fiat/providers/moonpayAuthStyle.d.ts +19 -0
  133. package/dist/src/fiat/providers/moonpayAuthStyle.d.ts.map +1 -0
  134. package/dist/src/fiat/providers/moonpayFeeQuote.d.ts +26 -0
  135. package/dist/src/fiat/providers/moonpayFeeQuote.d.ts.map +1 -0
  136. package/dist/src/fiat/providers/stripeAuthorize.d.ts.map +1 -1
  137. package/dist/src/fiat/providers/stripeCheckout.d.ts.map +1 -1
  138. package/dist/src/fiat/providers/stripeKyc.d.ts +2 -0
  139. package/dist/src/fiat/providers/stripeKyc.d.ts.map +1 -1
  140. package/dist/src/fiat/providers/stripeKycIntro.d.ts +10 -0
  141. package/dist/src/fiat/providers/stripeKycIntro.d.ts.map +1 -0
  142. package/dist/src/fiat/providers/stripePayment.d.ts +2 -2
  143. package/dist/src/fiat/providers/stripePayment.d.ts.map +1 -1
  144. package/dist/src/fiat/providers/stripeRoundPush.d.ts +45 -0
  145. package/dist/src/fiat/providers/stripeRoundPush.d.ts.map +1 -0
  146. package/dist/src/fiat/providers/stripeSeamlessSignIn.d.ts +5 -0
  147. package/dist/src/fiat/providers/stripeSeamlessSignIn.d.ts.map +1 -1
  148. package/dist/src/fiat/providers/stripeSessionAuth.d.ts.map +1 -1
  149. package/dist/src/fiat/providers/sumsubKyc.d.ts.map +1 -1
  150. package/dist/src/fiat/providers/surfaceParams.d.ts +30 -0
  151. package/dist/src/fiat/providers/surfaceParams.d.ts.map +1 -0
  152. package/dist/src/fiat/providers/transakApplePay.d.ts.map +1 -1
  153. package/dist/src/fiat/providers/useStripeOnrampClient.d.ts +0 -10
  154. package/dist/src/fiat/providers/useStripeOnrampClient.d.ts.map +1 -1
  155. package/dist/src/fiat/providers/useStripeSessionAuth.d.ts +42 -0
  156. package/dist/src/fiat/providers/useStripeSessionAuth.d.ts.map +1 -0
  157. package/dist/src/fiat/providers/useWebViewTermination.d.ts +15 -0
  158. package/dist/src/fiat/providers/useWebViewTermination.d.ts.map +1 -0
  159. package/dist/src/fiat/quoteNoRoute.d.ts +11 -0
  160. package/dist/src/fiat/quoteNoRoute.d.ts.map +1 -0
  161. package/dist/src/fiat/renderCaptureSurface.d.ts +2 -0
  162. package/dist/src/fiat/renderCaptureSurface.d.ts.map +1 -1
  163. package/dist/src/fiat/sectionDetail.d.ts +8 -1
  164. package/dist/src/fiat/sectionDetail.d.ts.map +1 -1
  165. package/dist/src/fiat/shownFieldIssues.d.ts +17 -0
  166. package/dist/src/fiat/shownFieldIssues.d.ts.map +1 -0
  167. package/dist/src/fiat/stepDetails.d.ts +13 -14
  168. package/dist/src/fiat/stepDetails.d.ts.map +1 -1
  169. package/dist/src/fiat/subdivisions.d.ts +6 -0
  170. package/dist/src/fiat/subdivisions.d.ts.map +1 -1
  171. package/dist/src/fiat/useContactAutoSubmit.d.ts +20 -0
  172. package/dist/src/fiat/useContactAutoSubmit.d.ts.map +1 -0
  173. package/dist/src/fiat/useFiatCheckoutPreparation.d.ts +2 -1
  174. package/dist/src/fiat/useFiatCheckoutPreparation.d.ts.map +1 -1
  175. package/dist/src/fiat/useKycCaptureRound.d.ts +16 -0
  176. package/dist/src/fiat/useKycCaptureRound.d.ts.map +1 -0
  177. package/dist/src/fiat/useKycCompletion.d.ts.map +1 -1
  178. package/dist/src/fiat/useOtpAutoSubmit.d.ts +15 -2
  179. package/dist/src/fiat/useOtpAutoSubmit.d.ts.map +1 -1
  180. package/dist/src/fiat/useOtpReceipt.d.ts +3 -2
  181. package/dist/src/fiat/useOtpReceipt.d.ts.map +1 -1
  182. package/dist/src/fiat/useReceiptTitles.d.ts +6 -0
  183. package/dist/src/fiat/useReceiptTitles.d.ts.map +1 -0
  184. package/dist/src/flow/DepositAmountStep.d.ts.map +1 -1
  185. package/dist/src/flow/DepositAssetPicker.d.ts +4 -2
  186. package/dist/src/flow/DepositAssetPicker.d.ts.map +1 -1
  187. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  188. package/dist/src/flow/DepositReceivedToast.d.ts +2 -2
  189. package/dist/src/flow/DepositReceivedToast.d.ts.map +1 -1
  190. package/dist/src/flow/FeeDetailsSheet.d.ts +3 -1
  191. package/dist/src/flow/FeeDetailsSheet.d.ts.map +1 -1
  192. package/dist/src/flow/FiatDepositAmountStep.d.ts +11 -1
  193. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
  194. package/dist/src/flow/FlowPage.d.ts +3 -0
  195. package/dist/src/flow/FlowPage.d.ts.map +1 -1
  196. package/dist/src/flow/FlowSheet.d.ts +10 -2
  197. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  198. package/dist/src/flow/FunkitFlowProvider.d.ts +3 -0
  199. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  200. package/dist/src/flow/SheetMaterial.d.ts +7 -6
  201. package/dist/src/flow/SheetMaterial.d.ts.map +1 -1
  202. package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
  203. package/dist/src/flow/depositFlowConfig.d.ts +24 -7
  204. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  205. package/dist/src/flow/depositRailCopy.d.ts +2 -0
  206. package/dist/src/flow/depositRailCopy.d.ts.map +1 -1
  207. package/dist/src/flow/flowError.d.ts +3 -1
  208. package/dist/src/flow/flowError.d.ts.map +1 -1
  209. package/dist/src/flow/guardHostCallbacks.d.ts +8 -1
  210. package/dist/src/flow/guardHostCallbacks.d.ts.map +1 -1
  211. package/dist/src/flow/sheetPressHold.d.ts +24 -0
  212. package/dist/src/flow/sheetPressHold.d.ts.map +1 -0
  213. package/dist/src/flow/swipeBack.d.ts +30 -0
  214. package/dist/src/flow/swipeBack.d.ts.map +1 -0
  215. package/dist/src/flow/useDepositReceivedToast.d.ts.map +1 -1
  216. package/dist/src/flow/useFlowTransitions.d.ts +47 -0
  217. package/dist/src/flow/useFlowTransitions.d.ts.map +1 -0
  218. package/dist/src/flow/useKeyboardHeight.d.ts +2 -2
  219. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -1
  220. package/dist/src/flow/v2DepositCustomers.d.ts +2 -0
  221. package/dist/src/flow/v2DepositCustomers.d.ts.map +1 -0
  222. package/dist/src/flow/validateClientMetadata.d.ts.map +1 -1
  223. package/dist/src/hooks/usePressScale.d.ts +2 -6
  224. package/dist/src/hooks/usePressScale.d.ts.map +1 -1
  225. package/dist/src/icons/assetLogos.d.ts.map +1 -1
  226. package/dist/src/identity/IdentityContext.d.ts +8 -0
  227. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  228. package/dist/src/logging/datadogHttpLogTransport.d.ts +10 -3
  229. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  230. package/dist/src/logging/logger.d.ts.map +1 -1
  231. package/dist/src/native/glassEffect.d.ts +20 -0
  232. package/dist/src/native/glassEffect.d.ts.map +1 -1
  233. package/dist/src/preview/fixtures/kycForms.d.ts +45 -0
  234. package/dist/src/preview/fixtures/kycForms.d.ts.map +1 -0
  235. package/dist/src/preview/flowPreview.d.ts +142 -0
  236. package/dist/src/preview/flowPreview.d.ts.map +1 -0
  237. package/dist/src/preview/previewFetch.d.ts +10 -0
  238. package/dist/src/preview/previewFetch.d.ts.map +1 -0
  239. package/dist/src/preview/scenarioCatalog.d.ts +380 -0
  240. package/dist/src/preview/scenarioCatalog.d.ts.map +1 -0
  241. package/dist/src/preview/scenarios.d.ts +57 -0
  242. package/dist/src/preview/scenarios.d.ts.map +1 -0
  243. package/dist/src/providers/FunkitI18nProvider.d.ts +2 -0
  244. package/dist/src/providers/FunkitI18nProvider.d.ts.map +1 -1
  245. package/dist/src/providers/useFunkitCheckout.d.ts +6 -0
  246. package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -1
  247. package/dist/src/screens/DepositAmountScreen.d.ts +9 -2
  248. package/dist/src/screens/DepositAmountScreen.d.ts.map +1 -1
  249. package/dist/src/screens/FeeDetailsScreen.d.ts.map +1 -1
  250. package/dist/src/screens/TokenAndChainPickerScreen.d.ts +3 -1
  251. package/dist/src/screens/TokenAndChainPickerScreen.d.ts.map +1 -1
  252. package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -1
  253. package/dist/src/screens/depositMetrics.d.ts +40 -3
  254. package/dist/src/screens/depositMetrics.d.ts.map +1 -1
  255. package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
  256. package/dist/src/theme/keyboardAppearance.d.ts +10 -0
  257. package/dist/src/theme/keyboardAppearance.d.ts.map +1 -0
  258. package/dist/src/theme/tokens.d.ts +4 -1
  259. package/dist/src/theme/tokens.d.ts.map +1 -1
  260. package/dist/src/transfer/depositAssets.d.ts +6 -4
  261. package/dist/src/transfer/depositAssets.d.ts.map +1 -1
  262. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts +19 -1
  263. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts.map +1 -1
  264. package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -1
  265. package/dist/src/transfer/lockedQuoteSource.d.ts +23 -0
  266. package/dist/src/transfer/lockedQuoteSource.d.ts.map +1 -0
  267. package/dist/src/transfer/lockedTokenAmount.d.ts +25 -0
  268. package/dist/src/transfer/lockedTokenAmount.d.ts.map +1 -1
  269. package/dist/src/utils/formatAmount.d.ts +1 -0
  270. package/dist/src/utils/formatAmount.d.ts.map +1 -1
  271. package/dist/src/utils/motion.d.ts +6 -0
  272. package/dist/src/utils/motion.d.ts.map +1 -1
  273. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts +3 -2
  274. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts.map +1 -1
  275. package/ios/FrostedGlassView.swift +207 -0
  276. package/ios/FunkitGlassEffect.podspec +1 -1
  277. package/ios/FunkitGlassEffectModule.swift +42 -0
  278. package/package.json +14 -8
  279. package/dist/chunk-D64EJ57D.js.map +0 -7
  280. package/dist/chunk-J5K2FSAI.js.map +0 -7
  281. package/dist/src/components/ActionLoading.d.ts +0 -19
  282. package/dist/src/components/ActionLoading.d.ts.map +0 -1
  283. package/dist/src/fiat/FiatConsentCheck.d.ts +0 -11
  284. package/dist/src/fiat/FiatConsentCheck.d.ts.map +0 -1
  285. package/dist/src/fiat/FiatFormConsent.d.ts +0 -6
  286. package/dist/src/fiat/FiatFormConsent.d.ts.map +0 -1
  287. package/dist/src/fiat/FiatQuotePrice.d.ts +0 -12
  288. package/dist/src/fiat/FiatQuotePrice.d.ts.map +0 -1
  289. package/dist/src/fiat/providerFailover.d.ts +0 -12
  290. package/dist/src/fiat/providerFailover.d.ts.map +0 -1
  291. package/dist/src/fiat/providers/StripeSessionAuthController.d.ts +0 -29
  292. package/dist/src/fiat/providers/StripeSessionAuthController.d.ts.map +0 -1
  293. package/dist/src/fiat/providers/moonpayTrace.d.ts +0 -25
  294. package/dist/src/fiat/providers/moonpayTrace.d.ts.map +0 -1
  295. package/dist/src/fiat/useQuoteableCeiling.d.ts +0 -28
  296. package/dist/src/fiat/useQuoteableCeiling.d.ts.map +0 -1
  297. /package/dist/{chunk-GG2WCQ6N.js.map → chunk-3ZNAGQHD.js.map} +0 -0
@@ -0,0 +1,1159 @@
1
+ import {
2
+ EXPECTED_AMOUNT_PER_MONTH,
3
+ FunkitFlowPreview,
4
+ GROSS_ANNUAL_INCOME,
5
+ TRANSACTIONS_PER_MONTH
6
+ } from "./chunk-BC4RXFI7.js";
7
+ import {
8
+ logger
9
+ } from "./chunk-ZE77GVDW.js";
10
+
11
+ // src/preview/scenarioCatalog.ts
12
+ var AMOUNT = [
13
+ "flow/FiatDepositAmountStep.tsx",
14
+ "screens/DepositAmountScreen.tsx"
15
+ ];
16
+ var FORM = [
17
+ "fiat/FiatIdentityStep.tsx",
18
+ "fiat/FiatFormScreen.tsx",
19
+ "fiat/formLayout.ts",
20
+ "fiat/FiatKycFieldControl.tsx"
21
+ ];
22
+ var INTRO = ["fiat/FiatIdentityStep.tsx", "fiat/FiatKycIntroScreen.tsx"];
23
+ var STATUS = ["fiat/FiatStatusScreen.tsx", "fiat/depositOutcome.ts"];
24
+ var WITHDRAW = [
25
+ "flow/WithdrawalFlowContent.tsx",
26
+ "screens/WithdrawCryptoSteps.tsx"
27
+ ];
28
+ var PREVIEW_SCENARIO_CATALOG = {
29
+ // Fiat rail — amount entry and sign-in.
30
+ "fiat.amount": {
31
+ title: "Amount entry, priced",
32
+ flow: "deposit",
33
+ requires: "fiatRail",
34
+ touches: AMOUNT
35
+ },
36
+ "fiat.amount.empty": {
37
+ title: "Amount entry, empty",
38
+ flow: "deposit",
39
+ requires: "fiatRail",
40
+ touches: AMOUNT
41
+ },
42
+ "fiat.amount.belowMinimum": {
43
+ title: "Amount entry, below the provider minimum",
44
+ flow: "deposit",
45
+ requires: "fiatRail",
46
+ touches: AMOUNT
47
+ },
48
+ "fiat.amount.noProvider": {
49
+ title: "Amount entry, no provider serves this buyer (fun-backend #4936)",
50
+ flow: "deposit",
51
+ requires: "fiatRail",
52
+ touches: AMOUNT
53
+ },
54
+ "fiat.amount.kycUnservable": {
55
+ title: "Amount entry, identity no provider can take (fun-backend #4875)",
56
+ flow: "deposit",
57
+ requires: "fiatRail",
58
+ touches: AMOUNT
59
+ },
60
+ "fiat.amount.userLimit": {
61
+ title: "Amount entry, over the buyer's provider limit (fun-backend #4936)",
62
+ flow: "deposit",
63
+ requires: "fiatRail",
64
+ touches: AMOUNT
65
+ },
66
+ "fiat.amount.providerOutage": {
67
+ title: "Amount entry, providers down (fun-backend #4936)",
68
+ flow: "deposit",
69
+ requires: "fiatRail",
70
+ touches: AMOUNT
71
+ },
72
+ "fiat.amount.noRouteToday": {
73
+ title: "Amount entry, today's no-route refusal (still Try again)",
74
+ flow: "deposit",
75
+ requires: "fiatRail",
76
+ touches: AMOUNT
77
+ },
78
+ "fiat.amount.currencyLookupFailed": {
79
+ title: "Amount entry, the buyer's currency lookup failed",
80
+ flow: "deposit",
81
+ requires: "fiatRail",
82
+ touches: AMOUNT
83
+ },
84
+ "fiat.contact.email": {
85
+ title: "Contact: email",
86
+ flow: "deposit",
87
+ requires: "fiatRail",
88
+ touches: ["fiat/FiatContactScreen.tsx", "fiat/sessionContact.ts"]
89
+ },
90
+ "fiat.contact.phone": {
91
+ title: "Contact: phone",
92
+ flow: "deposit",
93
+ requires: "fiatRail",
94
+ touches: [
95
+ "fiat/FiatContactScreen.tsx",
96
+ "fiat/FiatPhoneField.tsx",
97
+ "fiat/useContactAutoSubmit.ts"
98
+ ]
99
+ },
100
+ "fiat.otp.email": {
101
+ title: "OTP: email code",
102
+ flow: "deposit",
103
+ requires: "fiatRail",
104
+ touches: ["fiat/FiatOtpScreen.tsx"]
105
+ },
106
+ "fiat.otp.sms": {
107
+ title: "OTP: SMS code",
108
+ flow: "deposit",
109
+ requires: "fiatRail",
110
+ touches: ["fiat/FiatOtpScreen.tsx"]
111
+ },
112
+ // KYC — identity rounds.
113
+ "kyc.l1.intro": {
114
+ title: "KYC L1: consent faceplate",
115
+ flow: "deposit",
116
+ requires: "fiatRail",
117
+ touches: INTRO
118
+ },
119
+ "kyc.l1.name": {
120
+ title: "KYC L1: name",
121
+ flow: "deposit",
122
+ requires: "fiatRail",
123
+ touches: FORM
124
+ },
125
+ "kyc.l1.dob": {
126
+ title: "KYC L1: date of birth",
127
+ flow: "deposit",
128
+ requires: "fiatRail",
129
+ touches: [...FORM, "fiat/FiatBirthDateField.tsx"]
130
+ },
131
+ "kyc.l1.address": {
132
+ title: "KYC L1: address",
133
+ flow: "deposit",
134
+ requires: "fiatRail",
135
+ touches: [...FORM, "fiat/subdivisions.ts"]
136
+ },
137
+ "kyc.l1.ssn": {
138
+ title: "KYC L1: SSN",
139
+ flow: "deposit",
140
+ requires: "fiatRail",
141
+ touches: [...FORM, "fiat/FiatSsnField.tsx"]
142
+ },
143
+ "kyc.nationality": {
144
+ title: "KYC: nationality",
145
+ flow: "deposit",
146
+ requires: "fiatRail",
147
+ touches: [...FORM, "fiat/FiatCountrySheet.tsx"]
148
+ },
149
+ "kyc.country": {
150
+ title: "KYC: country of residence",
151
+ flow: "deposit",
152
+ requires: "fiatRail",
153
+ touches: [...FORM, "fiat/FiatCountrySheet.tsx"]
154
+ },
155
+ "kyc.ssnLastFour": {
156
+ title: "KYC: SSN last four",
157
+ flow: "deposit",
158
+ requires: "fiatRail",
159
+ touches: [...FORM, "fiat/FiatSsnField.tsx"]
160
+ },
161
+ "kyc.l2.intro": {
162
+ title: "KYC L2: additional-information faceplate",
163
+ flow: "deposit",
164
+ requires: "fiatRail",
165
+ touches: INTRO
166
+ },
167
+ "kyc.stripe.l1.intro": {
168
+ title: "KYC Stripe L1: step-up faceplate",
169
+ flow: "deposit",
170
+ requires: "fiatRail",
171
+ touches: [
172
+ ...INTRO,
173
+ "fiat/providers/kycIntro.ts",
174
+ "fiat/providers/stripeKycIntro.ts"
175
+ ]
176
+ },
177
+ "kyc.l2.dob": {
178
+ title: "KYC L2: age",
179
+ flow: "deposit",
180
+ requires: "fiatRail",
181
+ touches: FORM
182
+ },
183
+ "kyc.l2.occupation": {
184
+ title: "KYC L2: occupation",
185
+ flow: "deposit",
186
+ requires: "fiatRail",
187
+ touches: [...FORM, "fiat/FiatChoiceList.tsx"]
188
+ },
189
+ "kyc.l2.purpose": {
190
+ title: "KYC L2: purpose",
191
+ flow: "deposit",
192
+ requires: "fiatRail",
193
+ touches: [...FORM, "fiat/FiatChoiceList.tsx"]
194
+ },
195
+ "kyc.dueDiligence": {
196
+ title: "KYC: due diligence",
197
+ flow: "deposit",
198
+ requires: "fiatRail",
199
+ touches: FORM
200
+ },
201
+ "kyc.dueDiligence.income": {
202
+ title: "KYC: due diligence figures",
203
+ flow: "deposit",
204
+ requires: "fiatRail",
205
+ touches: FORM
206
+ },
207
+ "kyc.form.unsupported": {
208
+ title: "KYC: form this build cannot draw",
209
+ flow: "deposit",
210
+ requires: "fiatRail",
211
+ touches: [...FORM, ...STATUS]
212
+ },
213
+ "kyc.form.retry": {
214
+ title: "KYC: form send failed",
215
+ flow: "deposit",
216
+ requires: "fiatRail",
217
+ touches: [...FORM, "fiat/FiatErrorNotice.tsx"]
218
+ },
219
+ // KYC — capture and verdicts.
220
+ "kyc.capture.intro": {
221
+ title: "KYC: document-capture intro",
222
+ flow: "deposit",
223
+ requires: "fiatRail",
224
+ touches: [
225
+ "fiat/FiatDocumentCaptureStep.tsx",
226
+ "fiat/FiatKycIntroScreen.tsx"
227
+ ]
228
+ },
229
+ "kyc.completion.review": {
230
+ title: "KYC completion: in review",
231
+ flow: "deposit",
232
+ requires: "fiatRail",
233
+ touches: ["fiat/FiatKycOutcomeScreen.tsx", "fiat/useKycCompletion.ts"]
234
+ },
235
+ "kyc.completion.hold": {
236
+ title: "KYC completion: on hold",
237
+ flow: "deposit",
238
+ requires: "fiatRail",
239
+ touches: ["fiat/FiatKycOutcomeScreen.tsx", "fiat/useKycCompletion.ts"]
240
+ },
241
+ "kyc.completion.restricted": {
242
+ title: "KYC completion: rejected",
243
+ flow: "deposit",
244
+ requires: "fiatRail",
245
+ touches: ["fiat/FiatKycOutcomeScreen.tsx", "fiat/useKycCompletion.ts"]
246
+ },
247
+ "kyc.verdict.review": {
248
+ title: "Amount entry after KYC: in review",
249
+ flow: "deposit",
250
+ requires: "fiatRail",
251
+ touches: [...AMOUNT, "fiat/FiatKycNotice.tsx"]
252
+ },
253
+ "kyc.verdict.hold": {
254
+ title: "Amount entry after KYC: on hold",
255
+ flow: "deposit",
256
+ requires: "fiatRail",
257
+ touches: [...AMOUNT, "fiat/FiatKycNotice.tsx"]
258
+ },
259
+ "kyc.verdict.rejected": {
260
+ title: "Amount entry after KYC: rejected",
261
+ flow: "deposit",
262
+ requires: "fiatRail",
263
+ touches: [...AMOUNT, "fiat/FiatKycNotice.tsx"]
264
+ },
265
+ "kyc.options.review": {
266
+ title: "KYC options card: in review",
267
+ flow: "deposit",
268
+ requires: "fiatRail",
269
+ touches: ["fiat/FiatKycOptionsScreen.tsx", "fiat/FiatKycOptionRow.tsx"]
270
+ },
271
+ "kyc.options.hold": {
272
+ title: "KYC options card: on hold",
273
+ flow: "deposit",
274
+ requires: "fiatRail",
275
+ touches: ["fiat/FiatKycOptionsScreen.tsx", "fiat/FiatKycOptionRow.tsx"]
276
+ },
277
+ "kyc.options.rejected": {
278
+ title: "KYC options card: rejected",
279
+ flow: "deposit",
280
+ requires: "fiatRail",
281
+ touches: ["fiat/FiatKycOptionsScreen.tsx", "fiat/FiatKycOptionRow.tsx"]
282
+ },
283
+ // Orders.
284
+ "order.review": {
285
+ title: "Order review",
286
+ flow: "deposit",
287
+ requires: "fiatRail",
288
+ touches: STATUS
289
+ },
290
+ "order.bankInstructions": {
291
+ title: "Bank transfer instructions (not drawn on RN yet)",
292
+ flow: "deposit",
293
+ requires: "fiatRail",
294
+ touches: STATUS
295
+ },
296
+ "order.pending": {
297
+ title: "Pending order: resume or cancel",
298
+ flow: "deposit",
299
+ requires: "fiatRail",
300
+ touches: ["fiat/FiatPendingOrderScreen.tsx"]
301
+ },
302
+ "order.tracking": {
303
+ title: "Order processing",
304
+ flow: "deposit",
305
+ requires: "fiatRail",
306
+ touches: STATUS
307
+ },
308
+ "order.success": {
309
+ title: "Order settled (closes into the deposit toast)",
310
+ flow: "deposit",
311
+ requires: "fiatRail",
312
+ touches: [...STATUS, "fiat/FiatReceipt.tsx"]
313
+ },
314
+ "order.failed": {
315
+ title: "Order failed",
316
+ flow: "deposit",
317
+ requires: "fiatRail",
318
+ touches: STATUS
319
+ },
320
+ "order.cancelled": {
321
+ title: "Order cancelled",
322
+ flow: "deposit",
323
+ requires: "fiatRail",
324
+ touches: STATUS
325
+ },
326
+ "order.refunded": {
327
+ title: "Order refunded",
328
+ flow: "deposit",
329
+ requires: "fiatRail",
330
+ touches: STATUS
331
+ },
332
+ "fiat.blocked": {
333
+ title: "Blocked by the rail",
334
+ flow: "deposit",
335
+ requires: "fiatRail",
336
+ touches: STATUS
337
+ },
338
+ "fiat.unsupported": {
339
+ title: "State this build predates",
340
+ flow: "deposit",
341
+ requires: "fiatRail",
342
+ touches: STATUS
343
+ },
344
+ "fiat.surfaceFailed": {
345
+ title: "Provider surface failed",
346
+ flow: "deposit",
347
+ requires: "fiatRail",
348
+ touches: STATUS
349
+ },
350
+ "fiat.retryable": {
351
+ title: "Submission failed, retryable",
352
+ flow: "deposit",
353
+ requires: "fiatRail",
354
+ touches: STATUS
355
+ },
356
+ // Crypto deposit.
357
+ "deposit.addMoney": {
358
+ title: "Add money: method list",
359
+ flow: "deposit",
360
+ requires: "cryptoDeposit",
361
+ touches: ["screens/SelectMethodScreen.tsx"]
362
+ },
363
+ "deposit.transfer": {
364
+ title: "Transfer crypto: deposit address",
365
+ flow: "deposit",
366
+ requires: "cryptoDeposit",
367
+ touches: ["screens/TransferCryptoScreen.tsx"]
368
+ },
369
+ // Crypto withdrawal.
370
+ "withdraw.method": {
371
+ title: "Withdraw: payout methods",
372
+ flow: "withdrawal",
373
+ requires: "cryptoWithdrawal",
374
+ touches: [
375
+ "flow/WithdrawalFlowContent.tsx",
376
+ "screens/WithdrawMethodScreen.tsx"
377
+ ]
378
+ },
379
+ "withdraw.amount": {
380
+ title: "Withdraw: amount",
381
+ flow: "withdrawal",
382
+ requires: "cryptoWithdrawal",
383
+ touches: [...WITHDRAW, "screens/WithdrawAmountScreen.tsx"]
384
+ },
385
+ "withdraw.address": {
386
+ title: "Withdraw: recipient address",
387
+ flow: "withdrawal",
388
+ requires: "cryptoWithdrawal",
389
+ touches: [...WITHDRAW, "screens/WithdrawAddressScreen.tsx"]
390
+ },
391
+ "withdraw.receiveToken": {
392
+ title: "Withdraw: receive token and chain",
393
+ flow: "withdrawal",
394
+ requires: "cryptoWithdrawal",
395
+ touches: [...WITHDRAW, "screens/SelectReceiveTokenAndChainScreen.tsx"]
396
+ },
397
+ "withdraw.complete": {
398
+ title: "Withdraw: submitted",
399
+ flow: "withdrawal",
400
+ requires: "cryptoWithdrawal",
401
+ touches: [
402
+ "screens/WithdrawCryptoComplete.tsx",
403
+ "screens/WithdrawCompleteScreen.tsx"
404
+ ]
405
+ },
406
+ "withdraw.error": {
407
+ title: "Withdraw: execution failed",
408
+ flow: "withdrawal",
409
+ requires: "cryptoWithdrawal",
410
+ touches: [
411
+ "flow/WithdrawalFlowContent.tsx",
412
+ "screens/WithdrawMethodScreen.tsx"
413
+ ]
414
+ }
415
+ };
416
+ var PREVIEW_SCENARIO_IDS = Object.keys(
417
+ PREVIEW_SCENARIO_CATALOG
418
+ );
419
+
420
+ // src/preview/fixtures/kycForms.ts
421
+ var text = (id, label, required = true) => ({
422
+ id,
423
+ type: "TEXT",
424
+ labelFallback: label,
425
+ required
426
+ });
427
+ var US_ROUND = {
428
+ formId: "us-v2:0",
429
+ fields: [
430
+ text("LEGAL_FIRST_NAME", "First name"),
431
+ text("LEGAL_LAST_NAME", "Last Name"),
432
+ {
433
+ id: "DATE_OF_BIRTH",
434
+ type: "DATE",
435
+ labelFallback: "Date of Birth",
436
+ required: true
437
+ },
438
+ text("RESIDENTIAL_ADDRESS_LINE_1", "Address"),
439
+ text("RESIDENTIAL_ADDRESS_LINE_2", "Apartment, suite, etc.", false),
440
+ text("RESIDENTIAL_ADDRESS_CITY", "City"),
441
+ {
442
+ id: "RESIDENTIAL_ADDRESS_REGION",
443
+ type: "SELECT",
444
+ labelFallback: "State",
445
+ required: true,
446
+ options: [
447
+ { id: "CA", labelFallback: "California" },
448
+ { id: "NY", labelFallback: "New York" },
449
+ { id: "TX", labelFallback: "Texas" }
450
+ ]
451
+ },
452
+ text("RESIDENTIAL_ADDRESS_POSTAL_CODE", "ZIP code"),
453
+ text("TAX_IDENTIFIER", "SSN")
454
+ ]
455
+ };
456
+ var LAST_FOUR_FORM = {
457
+ formId: "last-four",
458
+ fields: [
459
+ {
460
+ id: "TAX_IDENTIFIER",
461
+ type: "TEXT",
462
+ labelFallback: "SSN",
463
+ required: true,
464
+ regex: "^\\d{4}$"
465
+ }
466
+ ]
467
+ };
468
+ var COUNTRY_FORM = {
469
+ formId: "country",
470
+ fields: [
471
+ {
472
+ id: "RESIDENTIAL_ADDRESS_COUNTRY",
473
+ type: "COUNTRY",
474
+ labelFallback: "Country",
475
+ required: true
476
+ }
477
+ ]
478
+ };
479
+ var ADDRESS_ROUND = {
480
+ formId: "address",
481
+ fields: [
482
+ ...COUNTRY_FORM.fields,
483
+ text("RESIDENTIAL_ADDRESS_LINE_1", "Address line 1"),
484
+ text("RESIDENTIAL_ADDRESS_CITY", "City"),
485
+ text("RESIDENTIAL_ADDRESS_REGION", "State, province, or region"),
486
+ text("RESIDENTIAL_ADDRESS_POSTAL_CODE", "Postal code")
487
+ ]
488
+ };
489
+ var NATIONALITY_FORM = {
490
+ formId: "nationality",
491
+ fields: [
492
+ {
493
+ id: "NATIONALITY",
494
+ type: "COUNTRY",
495
+ labelFallback: "Nationality",
496
+ required: true
497
+ }
498
+ ]
499
+ };
500
+ var OCCUPATION_FORM = {
501
+ formId: "kyc-r2-occupation",
502
+ fields: [
503
+ {
504
+ id: "OCCUPATION_TITLE",
505
+ type: "SELECT",
506
+ labelFallback: "Please select occupation",
507
+ required: true,
508
+ options: [
509
+ "Consulting, IT, or business services",
510
+ "Design, marketing or communication",
511
+ "Travel, accommodation, or transport",
512
+ "Entertainment, arts or photography",
513
+ "Health, sports or personal care",
514
+ "Food, beverages, or tobacco",
515
+ "Retail, eCommerce, wholesale or manufacturing",
516
+ "Dealers & Resellers",
517
+ "Financial services, products, or holding companies"
518
+ ].map((labelFallback, index) => ({
519
+ id: `occupation-${index}`,
520
+ labelFallback
521
+ }))
522
+ }
523
+ ]
524
+ };
525
+ var PURPOSE_FORM = {
526
+ formId: "kyc-r2-purpose",
527
+ fields: [
528
+ {
529
+ id: "PURPOSE_OF_TRANSACTION",
530
+ type: "SELECT",
531
+ labelFallback: "Please select",
532
+ required: true,
533
+ options: [
534
+ { id: "investment", labelFallback: "Investment" },
535
+ { id: "payments", labelFallback: "Payments" }
536
+ ]
537
+ }
538
+ ]
539
+ };
540
+ var AMOUNT_REGEX = "^(?!0+(\\.0{1,2})?$)\\d{1,12}(\\.\\d{1,2})?$";
541
+ var pattern = (id, label, regex) => ({
542
+ id,
543
+ type: "TEXT",
544
+ labelFallback: label,
545
+ required: true,
546
+ regex
547
+ });
548
+ var select = (id, label, options) => ({
549
+ id,
550
+ type: "SELECT",
551
+ labelFallback: label,
552
+ required: true,
553
+ options: options.map(([optionId, labelFallback]) => ({
554
+ id: optionId,
555
+ labelFallback
556
+ }))
557
+ });
558
+ var DUE_DILIGENCE_FORM = {
559
+ formId: "moonpay-cdd",
560
+ fields: [
561
+ {
562
+ id: "TAX_RESIDENCE_COUNTRY",
563
+ type: "COUNTRY",
564
+ labelFallback: "Tax residence",
565
+ required: true
566
+ },
567
+ pattern("TAX_IDENTIFIER", "SSN", "^\\d{9}$"),
568
+ pattern("PHONE_NUMBER", "Mobile phone number", "^\\+[1-9]\\d{1,14}$"),
569
+ select("EMPLOYMENT_STATUS", "Employment status", [
570
+ ["employedOrSelfEmployed", "Employed or self-employed"],
571
+ ["retired", "Retired"],
572
+ ["student", "Student"],
573
+ ["unemployed", "Unemployed"]
574
+ ]),
575
+ select("PURPOSE_OF_SERVICE", "What will you use this for?", [
576
+ ["investing", "Investing"],
577
+ ["payments", "Payments"],
578
+ ["purchasingDigitalAssets", "Buying digital assets"],
579
+ ["purchasingGoodsOrServices", "Buying goods or services"],
580
+ ["trading", "Trading"]
581
+ ]),
582
+ select("SOURCE_OF_WEALTH_DECLARATION", "Source of wealth", [
583
+ ["salary", "Salary"],
584
+ ["savings", "Savings"],
585
+ ["investments", "Investments"],
586
+ ["cryptoTrading", "Crypto trading"],
587
+ ["other", "Other"]
588
+ ]),
589
+ pattern(GROSS_ANNUAL_INCOME, "Gross annual income", AMOUNT_REGEX),
590
+ pattern(
591
+ EXPECTED_AMOUNT_PER_MONTH,
592
+ "Expected amount per month",
593
+ AMOUNT_REGEX
594
+ ),
595
+ pattern(
596
+ TRANSACTIONS_PER_MONTH,
597
+ "Transactions per month",
598
+ "^[1-9]\\d{0,3}$"
599
+ )
600
+ ]
601
+ };
602
+ var L2_FORM = {
603
+ formId: "kyc-r2-l2",
604
+ fields: [
605
+ {
606
+ id: "DATE_OF_BIRTH",
607
+ type: "DATE",
608
+ labelFallback: "Date of Birth",
609
+ required: true
610
+ },
611
+ ...OCCUPATION_FORM.fields,
612
+ ...PURPOSE_FORM.fields
613
+ ]
614
+ };
615
+ var UNSUPPORTED_FORM = {
616
+ formId: "unsupported",
617
+ fields: [
618
+ {
619
+ id: "QUESTIONNAIRE_RESPONSE:us-v2:passport",
620
+ type: "FILE",
621
+ labelFallback: "Passport",
622
+ required: true
623
+ }
624
+ ]
625
+ };
626
+ var US_QUOTE = {
627
+ quoteRef: "q_kyc_story",
628
+ fiat: { currency: "USD", amount: "105.00" },
629
+ crypto: { currency: "USDC", network: "solana", amount: "104.50" },
630
+ rate: "0.995238",
631
+ totalFee: "0.50",
632
+ feeBreakdown: [{ id: "provider_fee", labelFallback: "Fee", amount: "0.50" }],
633
+ paymentMethod: "apple_pay",
634
+ expiresAt: "2027-01-01T00:00:00Z"
635
+ };
636
+
637
+ // src/preview/scenarios.ts
638
+ var PROVIDER = "MOONPAY";
639
+ var { quoteRef } = US_QUOTE;
640
+ var AMOUNT2 = "105";
641
+ var CREATED_AT = "2026-09-01T12:00:00Z";
642
+ var TX_HASH = "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060";
643
+ var pricedQuote = (inputs) => ({
644
+ state: {
645
+ kind: "QUOTE",
646
+ quote: US_QUOTE,
647
+ limits: { min: "20.00", max: "2000.00" }
648
+ },
649
+ provider: PROVIDER,
650
+ transitions: [
651
+ {
652
+ id: "continue",
653
+ mode: "SUBMIT",
654
+ endpoint: "POST /fiat/session",
655
+ params: { quoteRef },
656
+ ...inputs === void 0 ? {} : { inputs }
657
+ }
658
+ ]
659
+ });
660
+ var PRICED = pricedQuote();
661
+ var otp = (channel) => ({
662
+ state: { kind: "SESSION_AUTH", channel },
663
+ provider: PROVIDER,
664
+ transitions: [
665
+ {
666
+ id: "verify",
667
+ mode: "SUBMIT",
668
+ endpoint: "POST /fiat/session/verify",
669
+ params: { quoteRef },
670
+ inputs: { code: { type: "TEXT", length: 6 } }
671
+ },
672
+ {
673
+ id: "resend",
674
+ mode: "SUBMIT",
675
+ endpoint: "POST /fiat/session",
676
+ params: { quoteRef }
677
+ }
678
+ ]
679
+ });
680
+ var kycForm = (form2, stripeTier) => ({
681
+ state: { kind: "KYC", phase: "INPUT_REQUIRED", quote: US_QUOTE, form: form2 },
682
+ provider: stripeTier === void 0 ? PROVIDER : "STRIPE",
683
+ transitions: [
684
+ {
685
+ id: "submit_round",
686
+ mode: "SUBMIT",
687
+ endpoint: "POST /fiat/kyc/form",
688
+ params: {
689
+ quoteRef,
690
+ formId: form2.formId,
691
+ ...stripeTier === void 0 ? {} : { kycTier: stripeTier }
692
+ },
693
+ inputs: { values: { type: "FORM_VALUES" } }
694
+ }
695
+ ]
696
+ });
697
+ var IN_REVIEW = {
698
+ state: {
699
+ kind: "KYC",
700
+ phase: "NO_ACTION_REQUIRED",
701
+ reason: "IN_REVIEW",
702
+ quote: US_QUOTE
703
+ },
704
+ provider: PROVIDER,
705
+ transitions: [
706
+ {
707
+ id: "poll",
708
+ mode: "AWAIT",
709
+ poll: {
710
+ endpoint: `GET /fiat/quotes/${quoteRef}`,
711
+ intervalMs: 3e3,
712
+ backoffFactor: 1.5,
713
+ maxIntervalMs: 1e4,
714
+ giveUpAfterMs: 9e4
715
+ }
716
+ }
717
+ ]
718
+ };
719
+ var ON_HOLD = {
720
+ state: {
721
+ kind: "KYC",
722
+ phase: "NO_ACTION_REQUIRED",
723
+ reason: "ON_HOLD",
724
+ retryAfter: "2026-12-01T09:00:00Z",
725
+ quote: US_QUOTE
726
+ },
727
+ provider: PROVIDER,
728
+ transitions: []
729
+ };
730
+ var REJECTED = {
731
+ state: {
732
+ kind: "KYC",
733
+ phase: "NO_ACTION_REQUIRED",
734
+ reason: "REJECTED",
735
+ quote: US_QUOTE,
736
+ failureReason: {
737
+ category: "KYC_REJECTED",
738
+ retryable: false,
739
+ recovery: "CONTACT_SUPPORT"
740
+ }
741
+ },
742
+ provider: PROVIDER,
743
+ transitions: []
744
+ };
745
+ var KYC_CAPTURE = {
746
+ state: {
747
+ kind: "KYC",
748
+ phase: "CAPTURE",
749
+ quote: US_QUOTE,
750
+ surface: {
751
+ kind: "KYC_SDK",
752
+ provider: "SUMSUB",
753
+ params: { accessToken: "preview-token" },
754
+ expiresAt: "2027-01-01T00:00:00Z"
755
+ }
756
+ },
757
+ provider: PROVIDER,
758
+ transitions: [
759
+ {
760
+ id: "capture",
761
+ mode: "CLIENT_SURFACE",
762
+ report: {
763
+ endpoint: "POST /fiat/kyc/capture",
764
+ params: { quoteRef },
765
+ result: { type: "KYC_SDK_RESULT", bodyKey: "result" }
766
+ }
767
+ }
768
+ ]
769
+ };
770
+ var ORDER_REVIEW = {
771
+ state: { kind: "ORDER", phase: "AWAITING_CONFIRMATION", quote: US_QUOTE },
772
+ provider: PROVIDER,
773
+ transitions: [
774
+ {
775
+ id: "confirm",
776
+ mode: "SUBMIT",
777
+ endpoint: "POST /fiat/orders",
778
+ params: { quoteRef }
779
+ }
780
+ ]
781
+ };
782
+ var ORDER = {
783
+ orderId: "o_preview",
784
+ fiat: US_QUOTE.fiat,
785
+ crypto: US_QUOTE.crypto,
786
+ method: "apple_pay",
787
+ createdAt: CREATED_AT
788
+ };
789
+ var orderCreated = (state) => ({
790
+ state: { kind: "ORDER", phase: "CREATED", order: ORDER, ...state },
791
+ provider: PROVIDER,
792
+ transitions: []
793
+ });
794
+ var PENDING_ORDER = {
795
+ state: {
796
+ kind: "PENDING_ORDER",
797
+ order: { ...ORDER, status: "AWAITING_PAYMENT" }
798
+ },
799
+ provider: PROVIDER,
800
+ transitions: [
801
+ { id: "resume", mode: "SUBMIT", endpoint: "GET /fiat/orders/o_preview" },
802
+ {
803
+ id: "cancel",
804
+ mode: "SUBMIT",
805
+ endpoint: "POST /fiat/orders/o_preview/cancel"
806
+ }
807
+ ]
808
+ };
809
+ var BANK_INSTRUCTIONS = {
810
+ state: {
811
+ kind: "PAYMENT",
812
+ phase: "INSTRUCT",
813
+ orderId: "o_preview",
814
+ instructions: {
815
+ kind: "BANK_FIELDS",
816
+ fields: [
817
+ { id: "beneficiary", labelFallback: "Beneficiary", value: "MoonPay" },
818
+ { id: "routing", labelFallback: "Routing number", value: "021000021" },
819
+ { id: "account", labelFallback: "Account number", value: "12345678" },
820
+ { id: "reference", labelFallback: "Reference", value: "o_preview" }
821
+ ],
822
+ expiresAt: "2027-01-01T00:00:00Z"
823
+ }
824
+ },
825
+ provider: PROVIDER,
826
+ transitions: [
827
+ {
828
+ id: "confirm_paid",
829
+ mode: "SUBMIT",
830
+ endpoint: "POST /fiat/orders/o_preview/confirm-payment"
831
+ }
832
+ ]
833
+ };
834
+ var UNDRAWN = {
835
+ state: { kind: "FUN_AUTH", challenge: { kind: "SIWE", message: "\u2026" } },
836
+ provider: PROVIDER,
837
+ transitions: []
838
+ };
839
+ var UNAVAILABLE = { status: 503 };
840
+ var JOURNEY = {
841
+ "/fiat/session": otp("EMAIL_OTP"),
842
+ "/fiat/session/verify": kycForm(US_ROUND),
843
+ "/fiat/kyc/form": ORDER_REVIEW,
844
+ "/fiat/orders": orderCreated({
845
+ status: "SETTLED",
846
+ tx: { chainId: 1151111081099710, hash: TX_HASH }
847
+ })
848
+ };
849
+ var fiat = (fiatSeed, backend = {}) => ({
850
+ seed: { deposit: { fiat: { amount: AMOUNT2, ...fiatSeed } } },
851
+ backend: { ...backend, responses: { ...JOURNEY, ...backend.responses } }
852
+ });
853
+ var form = (formDescriptor, identity) => fiat({ step: kycForm(formDescriptor), identity });
854
+ var DEMO_RECIPIENT = "0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6";
855
+ var DEFINITIONS = {
856
+ // Transak's entry isn't sent ahead of the tap, so the priced entry stays up until pressed.
857
+ "fiat.amount": fiat({}, { quote: { ...PRICED, provider: "TRANSAK" } }),
858
+ "fiat.amount.empty": fiat(
859
+ { amount: "" },
860
+ { quote: { ...PRICED, provider: "TRANSAK" } }
861
+ ),
862
+ "fiat.amount.belowMinimum": fiat(
863
+ { amount: "10" },
864
+ { quote: PRICED, minimum: "20" }
865
+ ),
866
+ "fiat.amount.noProvider": fiat({}, { noRoute: "NO_CANDIDATE" }),
867
+ "fiat.amount.kycUnservable": fiat({}, { noRoute: "KYC_INSUFFICIENT" }),
868
+ "fiat.amount.userLimit": fiat({}, { noRoute: "USER_LIMIT" }),
869
+ "fiat.amount.providerOutage": fiat({}, { noRoute: "PROVIDER_OUTAGE" }),
870
+ "fiat.amount.noRouteToday": fiat({}, { noRoute: "NO_CANDIDATE_LEGACY" }),
871
+ "fiat.amount.currencyLookupFailed": fiat({}, { currencyLookupFails: true }),
872
+ "fiat.contact.email": fiat(
873
+ { pressEntry: true },
874
+ { quote: pricedQuote({ email: { type: "TEXT" } }) }
875
+ ),
876
+ "fiat.contact.phone": fiat(
877
+ { pressEntry: true },
878
+ { quote: pricedQuote({ phone: { type: "TEXT" } }) }
879
+ ),
880
+ "fiat.otp.email": fiat({ step: otp("EMAIL_OTP") }),
881
+ "fiat.otp.sms": fiat({ step: otp("SMS_OTP") }),
882
+ "kyc.l1.intro": form(US_ROUND, { page: "consent" }),
883
+ "kyc.l1.name": form(US_ROUND, { page: "form", section: "NAME" }),
884
+ "kyc.l1.dob": form(US_ROUND, { page: "form", section: "DOB" }),
885
+ "kyc.l1.address": form(US_ROUND, { page: "form", section: "ADDRESS" }),
886
+ "kyc.l1.ssn": form(US_ROUND, { page: "form", section: "SSN" }),
887
+ "kyc.nationality": form(NATIONALITY_FORM, { page: "form" }),
888
+ "kyc.country": form(COUNTRY_FORM, { page: "form" }),
889
+ "kyc.ssnLastFour": form(LAST_FOUR_FORM, { page: "form" }),
890
+ "kyc.l2.intro": form(L2_FORM, { page: "consent" }),
891
+ "kyc.stripe.l1.intro": fiat({
892
+ step: kycForm(US_ROUND, "l1"),
893
+ identity: { page: "consent" }
894
+ }),
895
+ "kyc.l2.dob": form(L2_FORM, { page: "form", section: "DOB" }),
896
+ "kyc.l2.occupation": form(L2_FORM, { page: "form", section: "OCCUPATION" }),
897
+ "kyc.l2.purpose": form(L2_FORM, { page: "form", section: "PURPOSE" }),
898
+ "kyc.dueDiligence": form(DUE_DILIGENCE_FORM, { page: "form" }),
899
+ "kyc.dueDiligence.income": form(DUE_DILIGENCE_FORM, {
900
+ page: "form",
901
+ section: "INCOME"
902
+ }),
903
+ "kyc.form.unsupported": form(UNSUPPORTED_FORM, { page: "form" }),
904
+ "kyc.form.retry": fiat(
905
+ {
906
+ step: kycForm(US_ROUND),
907
+ identity: { page: "form", section: "SSN" },
908
+ submitOnOpen: "submit_round"
909
+ },
910
+ { responses: { "/fiat/kyc/form": UNAVAILABLE } }
911
+ ),
912
+ "kyc.capture.intro": fiat({ step: KYC_CAPTURE }),
913
+ "kyc.completion.review": fiat({ step: IN_REVIEW, kycCompletion: "review" }),
914
+ "kyc.completion.hold": fiat({ step: ON_HOLD, kycCompletion: "hold" }),
915
+ "kyc.completion.restricted": fiat({
916
+ step: REJECTED,
917
+ kycCompletion: "restricted"
918
+ }),
919
+ "kyc.verdict.review": fiat({ step: IN_REVIEW }),
920
+ "kyc.verdict.hold": fiat({ step: ON_HOLD }),
921
+ "kyc.verdict.rejected": fiat({ step: REJECTED }),
922
+ "kyc.options.review": fiat({ step: IN_REVIEW, pressEntry: true }),
923
+ "kyc.options.hold": fiat({ step: ON_HOLD, pressEntry: true }),
924
+ "kyc.options.rejected": fiat({ step: REJECTED, pressEntry: true }),
925
+ "order.review": fiat({ step: ORDER_REVIEW }),
926
+ "order.bankInstructions": fiat({ step: BANK_INSTRUCTIONS }),
927
+ "order.pending": fiat({ step: PENDING_ORDER }),
928
+ "order.tracking": fiat({ step: orderCreated({ status: "PROCESSING" }) }),
929
+ "order.success": fiat({
930
+ step: orderCreated({
931
+ status: "SETTLED",
932
+ tx: { chainId: 1151111081099710, hash: TX_HASH }
933
+ })
934
+ }),
935
+ "order.failed": fiat({
936
+ step: orderCreated({
937
+ status: "FAILED",
938
+ failureReason: {
939
+ category: "PAYMENT_DECLINED",
940
+ retryable: true,
941
+ recovery: "RETRY_PAYMENT"
942
+ }
943
+ })
944
+ }),
945
+ "order.cancelled": fiat({
946
+ step: orderCreated({ status: "CANCELLED" })
947
+ }),
948
+ "order.refunded": fiat({
949
+ step: orderCreated({
950
+ status: "REFUNDED",
951
+ refund: { ...US_QUOTE.fiat, expectedBy: "2026-09-08T12:00:00Z" }
952
+ })
953
+ }),
954
+ "fiat.blocked": fiat({
955
+ step: {
956
+ state: {
957
+ kind: "BLOCKED",
958
+ reason: "REGION_UNSUPPORTED",
959
+ retryAfter: null
960
+ },
961
+ transitions: []
962
+ }
963
+ }),
964
+ "fiat.unsupported": fiat({ step: UNDRAWN }),
965
+ "fiat.surfaceFailed": fiat({
966
+ step: ORDER_REVIEW,
967
+ surfaceFailure: {
968
+ code: "provider_error",
969
+ detail: "The provider could not start this payment."
970
+ }
971
+ }),
972
+ "fiat.retryable": fiat(
973
+ { step: ORDER_REVIEW, submitOnOpen: "confirm" },
974
+ { responses: { "/fiat/orders": UNAVAILABLE } }
975
+ ),
976
+ "deposit.addMoney": {
977
+ seed: { deposit: { screen: "addMoney" } },
978
+ backend: {}
979
+ },
980
+ "deposit.transfer": {
981
+ seed: { deposit: { screen: "transfer", chainId: "8453" } },
982
+ backend: {}
983
+ },
984
+ "withdraw.method": { seed: { withdrawal: {} }, backend: {} },
985
+ "withdraw.amount": {
986
+ seed: {
987
+ withdrawal: { stack: ["withdrawMethod", "withdrawAmount"], amount: "25" }
988
+ },
989
+ backend: {}
990
+ },
991
+ "withdraw.address": {
992
+ seed: {
993
+ withdrawal: {
994
+ stack: ["withdrawMethod", "withdrawAmount", "withdrawAddress"],
995
+ amount: "25",
996
+ recipient: DEMO_RECIPIENT
997
+ }
998
+ },
999
+ backend: {}
1000
+ },
1001
+ "withdraw.receiveToken": {
1002
+ seed: {
1003
+ withdrawal: {
1004
+ stack: [
1005
+ "withdrawMethod",
1006
+ "withdrawAmount",
1007
+ "withdrawAddress",
1008
+ "withdrawReceiveToken"
1009
+ ],
1010
+ amount: "25",
1011
+ recipient: DEMO_RECIPIENT
1012
+ }
1013
+ },
1014
+ backend: {}
1015
+ },
1016
+ "withdraw.complete": {
1017
+ seed: {
1018
+ withdrawal: {
1019
+ stack: ["withdrawComplete"],
1020
+ complete: {
1021
+ txHash: TX_HASH,
1022
+ amountLabel: "25 USDG",
1023
+ usdLabel: "$25.00"
1024
+ }
1025
+ }
1026
+ },
1027
+ backend: {}
1028
+ },
1029
+ "withdraw.error": {
1030
+ seed: { withdrawal: { executionError: true } },
1031
+ backend: {}
1032
+ }
1033
+ };
1034
+ var PREVIEW_SCENARIOS = Object.fromEntries(
1035
+ Object.entries(DEFINITIONS).map(([id, definition]) => [
1036
+ id,
1037
+ {
1038
+ id,
1039
+ ...PREVIEW_SCENARIO_CATALOG[id],
1040
+ ...definition
1041
+ }
1042
+ ])
1043
+ );
1044
+ var DEFAULT_PREVIEW_QUOTE = PRICED;
1045
+
1046
+ // src/preview/previewFetch.ts
1047
+ import { API_BASE_URL, FROG_API_BASE_URL } from "@funkit/api-base";
1048
+ var json = (body, status = 200) => new Response(JSON.stringify(body), {
1049
+ status,
1050
+ headers: { "Content-Type": "application/json" }
1051
+ });
1052
+ function requestedAmount(init) {
1053
+ if (typeof init?.body !== "string") {
1054
+ return void 0;
1055
+ }
1056
+ try {
1057
+ const amount = Number(
1058
+ JSON.parse(init.body).fiatAmount
1059
+ );
1060
+ return Number.isFinite(amount) ? amount : void 0;
1061
+ } catch {
1062
+ return void 0;
1063
+ }
1064
+ }
1065
+ function belowMinimum(minimum) {
1066
+ return json(
1067
+ {
1068
+ errorCode: "FiatAmountBelowMinimumError",
1069
+ errorMsg: `The minimum for this purchase is ${minimum} USD.`,
1070
+ minFiatAmount: minimum,
1071
+ fiatCurrencyCode: "USD"
1072
+ },
1073
+ 400
1074
+ );
1075
+ }
1076
+ function noRoute(scenarioReason) {
1077
+ const legacy = scenarioReason === "NO_CANDIDATE_LEGACY";
1078
+ const reason = legacy ? "NO_CANDIDATE" : scenarioReason;
1079
+ const retryable = legacy ? {} : { retryable: reason === "PROVIDER_OUTAGE" };
1080
+ if (reason === "USER_LIMIT") {
1081
+ return json(
1082
+ {
1083
+ serviceableRanges: [],
1084
+ reason,
1085
+ ...retryable,
1086
+ code: "LIMITS_EXCEEDED",
1087
+ recovery: "REQUOTE",
1088
+ errorCode: "FiatNoRouteError",
1089
+ errorMsg: "Your current provider limits do not allow this purchase."
1090
+ },
1091
+ 400
1092
+ );
1093
+ }
1094
+ return json(
1095
+ {
1096
+ serviceableRanges: [],
1097
+ reason,
1098
+ ...retryable,
1099
+ errorCode: "FiatNoRouteError",
1100
+ errorMsg: "No provider can price that purchase right now."
1101
+ },
1102
+ 404
1103
+ );
1104
+ }
1105
+ function isStepResponse(response) {
1106
+ return "state" in response;
1107
+ }
1108
+ function createPreviewFetch(scenario, passThrough) {
1109
+ let current = scenario.seed.deposit?.fiat?.step;
1110
+ const quote = scenario.backend.quote ?? DEFAULT_PREVIEW_QUOTE;
1111
+ const { minimum, noRoute: noRouteReason } = scenario.backend;
1112
+ const answer = (path, method, amount) => {
1113
+ if (method === "POST" && path.endsWith("/fiat/quote")) {
1114
+ if (minimum !== void 0 && amount !== void 0 && amount < Number(minimum)) {
1115
+ return belowMinimum(minimum);
1116
+ }
1117
+ if (noRouteReason !== void 0) {
1118
+ return noRoute(noRouteReason);
1119
+ }
1120
+ current = quote;
1121
+ return json(quote);
1122
+ }
1123
+ const listed = Object.entries(scenario.backend.responses ?? {}).find(
1124
+ ([endpoint]) => path.endsWith(endpoint)
1125
+ )?.[1];
1126
+ if (listed !== void 0 && !isStepResponse(listed)) {
1127
+ return json({ errorMsg: "preview: unavailable" }, listed.status);
1128
+ }
1129
+ current = listed ?? current ?? quote;
1130
+ return json(current);
1131
+ };
1132
+ const fiatApi = `${API_BASE_URL}/fiat/`;
1133
+ const currencyLookup = `${FROG_API_BASE_URL}/api/swapped/supportedCountries`;
1134
+ return async (input, init) => {
1135
+ const url = input instanceof Request ? input.url : String(input);
1136
+ if (scenario.backend.currencyLookupFails && url.startsWith(currencyLookup)) {
1137
+ return json({ errorMsg: "preview: unavailable" }, 503);
1138
+ }
1139
+ if (!url.startsWith(fiatApi)) {
1140
+ return passThrough(input, init);
1141
+ }
1142
+ const method = init?.method ?? (input instanceof Request ? input.method : "GET");
1143
+ const { pathname } = new URL(url);
1144
+ logger.info("connect-rn:preview:fiat_request", {
1145
+ scenario: scenario.id,
1146
+ method,
1147
+ path: pathname
1148
+ });
1149
+ return answer(pathname, method.toUpperCase(), requestedAmount(init));
1150
+ };
1151
+ }
1152
+ export {
1153
+ FunkitFlowPreview,
1154
+ PREVIEW_SCENARIOS,
1155
+ PREVIEW_SCENARIO_CATALOG,
1156
+ PREVIEW_SCENARIO_IDS,
1157
+ createPreviewFetch
1158
+ };
1159
+ //# sourceMappingURL=preview.js.map