@funkit/connect-rn 12.1.2 → 12.3.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 (449) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +1 -1
  3. package/app.plugin.js +63 -0
  4. package/dist/{chunk-Q74I4SOP.js → chunk-5QHEW234.js} +2 -2
  5. package/dist/{chunk-GOFKXSDM.js → chunk-HXOQOPQY.js} +147 -75
  6. package/dist/chunk-HXOQOPQY.js.map +7 -0
  7. package/dist/{chunk-AICRSY7K.js → chunk-NW2EYUCE.js} +17 -12
  8. package/dist/chunk-NW2EYUCE.js.map +7 -0
  9. package/dist/clients/lighter/lighterWithdrawalConfig.d.ts +1 -1
  10. package/dist/clients/lighter.js +1 -1
  11. package/dist/clients/lighter.js.map +1 -1
  12. package/dist/clients/nado.js +2 -2
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +30535 -25254
  16. package/dist/index.js.map +4 -4
  17. package/dist/preview.js +454 -6
  18. package/dist/preview.js.map +4 -4
  19. package/dist/src/components/DepositActionMotion.d.ts +7 -5
  20. package/dist/src/components/DepositActionMotion.d.ts.map +1 -1
  21. package/dist/src/components/Grabber.d.ts +1 -1
  22. package/dist/src/components/Grabber.d.ts.map +1 -1
  23. package/dist/src/components/LoadingSpinner.d.ts +12 -4
  24. package/dist/src/components/LoadingSpinner.d.ts.map +1 -1
  25. package/dist/src/components/PillButton.d.ts +1 -1
  26. package/dist/src/components/PillButton.d.ts.map +1 -1
  27. package/dist/src/components/v2/AmountDisplay.d.ts.map +1 -1
  28. package/dist/src/components/v2/FeeLine.d.ts +6 -5
  29. package/dist/src/components/v2/FeeLine.d.ts.map +1 -1
  30. package/dist/src/components/v2/ListRow.d.ts +1 -1
  31. package/dist/src/components/v2/QuickAmountsRow.d.ts +1 -1
  32. package/dist/src/components/v2/QuickAmountsRow.d.ts.map +1 -1
  33. package/dist/src/components/waitingRingHandoff.d.ts +28 -0
  34. package/dist/src/components/waitingRingHandoff.d.ts.map +1 -0
  35. package/dist/src/fiat/common/FiatStepFailedScreen.d.ts +3 -2
  36. package/dist/src/fiat/common/FiatStepFailedScreen.d.ts.map +1 -1
  37. package/dist/src/fiat/common/ctaLabel.d.ts +1 -1
  38. package/dist/src/fiat/common/stepDetails.d.ts +5 -6
  39. package/dist/src/fiat/common/stepDetails.d.ts.map +1 -1
  40. package/dist/src/fiat/contact/contactRound.d.ts +1 -0
  41. package/dist/src/fiat/contact/contactRound.d.ts.map +1 -1
  42. package/dist/src/fiat/contact/knownContacts.d.ts +1 -1
  43. package/dist/src/fiat/contact/phoneRegionRedirect.d.ts +2 -0
  44. package/dist/src/fiat/contact/phoneRegionRedirect.d.ts.map +1 -1
  45. package/dist/src/fiat/contact/sessionContact.d.ts +2 -0
  46. package/dist/src/fiat/contact/sessionContact.d.ts.map +1 -1
  47. package/dist/src/fiat/country/FiatCountrySheet.d.ts +1 -1
  48. package/dist/src/fiat/country/countryListEntries.d.ts +1 -1
  49. package/dist/src/fiat/country/countrySections.d.ts +1 -1
  50. package/dist/src/fiat/entry/useCaptureHold.d.ts +3 -3
  51. package/dist/src/fiat/entry/useCaptureHold.d.ts.map +1 -1
  52. package/dist/src/fiat/entry/useEntryQuote.d.ts +18 -4
  53. package/dist/src/fiat/entry/useEntryQuote.d.ts.map +1 -1
  54. package/dist/src/fiat/entry/useEntrySubmit.d.ts +2 -2
  55. package/dist/src/fiat/entry/useEntrySubmit.d.ts.map +1 -1
  56. package/dist/src/fiat/form/FiatBirthDateField.d.ts +1 -1
  57. package/dist/src/fiat/form/FiatBirthDateField.d.ts.map +1 -1
  58. package/dist/src/fiat/form/FiatFormFieldRow.d.ts +1 -1
  59. package/dist/src/fiat/form/FiatFormScreen.d.ts.map +1 -1
  60. package/dist/src/fiat/form/fieldAutofill.d.ts +1 -1
  61. package/dist/src/fiat/kyc/FiatKycFieldControl.d.ts +1 -1
  62. package/dist/src/fiat/kyc/FiatKycIntroScreen.d.ts +3 -1
  63. package/dist/src/fiat/kyc/FiatKycIntroScreen.d.ts.map +1 -1
  64. package/dist/src/fiat/kyc/FiatKycOutcomeScreen.d.ts +1 -1
  65. package/dist/src/fiat/kyc/SumsubCaptureStep.d.ts +25 -0
  66. package/dist/src/fiat/kyc/SumsubCaptureStep.d.ts.map +1 -0
  67. package/dist/src/fiat/kyc/formValidationError.d.ts +1 -1
  68. package/dist/src/fiat/kyc/kycCapture.d.ts +3 -4
  69. package/dist/src/fiat/kyc/kycCapture.d.ts.map +1 -1
  70. package/dist/src/fiat/kyc/kycFieldValidators.d.ts +3 -1
  71. package/dist/src/fiat/kyc/kycFieldValidators.d.ts.map +1 -1
  72. package/dist/src/fiat/kyc/kycForm.d.ts +4 -5
  73. package/dist/src/fiat/kyc/kycForm.d.ts.map +1 -1
  74. package/dist/src/fiat/kyc/kycFormState.d.ts +7 -1
  75. package/dist/src/fiat/kyc/kycFormState.d.ts.map +1 -1
  76. package/dist/src/fiat/kyc/kycFormTheme.d.ts +1 -1
  77. package/dist/src/fiat/kyc/kycFormTheme.d.ts.map +1 -1
  78. package/dist/src/fiat/kyc/kycReaskCopy.d.ts +6 -0
  79. package/dist/src/fiat/kyc/kycReaskCopy.d.ts.map +1 -0
  80. package/dist/src/fiat/kyc/kycRoutes.d.ts +2 -2
  81. package/dist/src/fiat/kyc/kycRoutes.d.ts.map +1 -1
  82. package/dist/src/fiat/kyc/kycUnavailableAlert.d.ts +1 -1
  83. package/dist/src/fiat/kyc/kycValues.d.ts +4 -0
  84. package/dist/src/fiat/kyc/kycValues.d.ts.map +1 -0
  85. package/dist/src/fiat/kyc/kycVerdict.d.ts +1 -1
  86. package/dist/src/fiat/kyc/kycVerdict.d.ts.map +1 -1
  87. package/dist/src/fiat/kyc/useKycCompletion.d.ts +4 -4
  88. package/dist/src/fiat/kyc/useKycScreens.d.ts +1 -1
  89. package/dist/src/fiat/otp/FunReauthStep.d.ts +4 -1
  90. package/dist/src/fiat/otp/FunReauthStep.d.ts.map +1 -1
  91. package/dist/src/fiat/payment/failoverKind.d.ts +14 -6
  92. package/dist/src/fiat/payment/failoverKind.d.ts.map +1 -1
  93. package/dist/src/fiat/payment/failoverPrompt.d.ts +5 -2
  94. package/dist/src/fiat/payment/failoverPrompt.d.ts.map +1 -1
  95. package/dist/src/fiat/payment/methodName.d.ts.map +1 -1
  96. package/dist/src/fiat/payment/paymentAttempts.d.ts +1 -1
  97. package/dist/src/fiat/payment/paymentReroute.d.ts.map +1 -1
  98. package/dist/src/fiat/payment/paymentSurfaceFailure.d.ts.map +1 -1
  99. package/dist/src/fiat/payment/platformPayAttempt.d.ts +31 -0
  100. package/dist/src/fiat/payment/platformPayAttempt.d.ts.map +1 -0
  101. package/dist/src/fiat/payment/providerFailover.d.ts +3 -1
  102. package/dist/src/fiat/payment/providerFailover.d.ts.map +1 -1
  103. package/dist/src/fiat/payment/usePaymentAttempts.d.ts +3 -0
  104. package/dist/src/fiat/payment/usePaymentAttempts.d.ts.map +1 -1
  105. package/dist/src/fiat/payment/usePaymentFailureAnswer.d.ts +10 -7
  106. package/dist/src/fiat/payment/usePaymentFailureAnswer.d.ts.map +1 -1
  107. package/dist/src/fiat/payment/useRegionCurrencySheet.d.ts +24 -0
  108. package/dist/src/fiat/payment/useRegionCurrencySheet.d.ts.map +1 -0
  109. package/dist/src/fiat/processing/DepositCardSheet.d.ts +3 -0
  110. package/dist/src/fiat/processing/DepositCardSheet.d.ts.map +1 -1
  111. package/dist/src/fiat/processing/FailoverPrompt.d.ts +1 -1
  112. package/dist/src/fiat/processing/FailoverPrompt.d.ts.map +1 -1
  113. package/dist/src/fiat/processing/ProcessingAurora.d.ts +1 -1
  114. package/dist/src/fiat/processing/ProcessingAurora.d.ts.map +1 -1
  115. package/dist/src/fiat/processing/failoverArtwork.d.ts +5 -0
  116. package/dist/src/fiat/processing/failoverArtwork.d.ts.map +1 -1
  117. package/dist/src/fiat/providerFlow.d.ts +16 -2
  118. package/dist/src/fiat/providerFlow.d.ts.map +1 -1
  119. package/dist/src/fiat/providerFlows.d.ts +8 -0
  120. package/dist/src/fiat/providerFlows.d.ts.map +1 -1
  121. package/dist/src/fiat/providerHandoff.d.ts +4 -1
  122. package/dist/src/fiat/providerHandoff.d.ts.map +1 -1
  123. package/dist/src/fiat/providers/adapter.d.ts +3 -3
  124. package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
  125. package/dist/src/fiat/providers/alchemypay/AlchemyPayButtonSurface.d.ts +36 -0
  126. package/dist/src/fiat/providers/alchemypay/AlchemyPayButtonSurface.d.ts.map +1 -0
  127. package/dist/src/fiat/providers/alchemypay/Checkout.d.ts +27 -0
  128. package/dist/src/fiat/providers/alchemypay/Checkout.d.ts.map +1 -0
  129. package/dist/src/fiat/providers/alchemypay/alchemyPayButtonEvents.d.ts +87 -0
  130. package/dist/src/fiat/providers/alchemypay/alchemyPayButtonEvents.d.ts.map +1 -0
  131. package/dist/src/fiat/providers/alchemypay/alchemyPayPage.d.ts +19 -0
  132. package/dist/src/fiat/providers/alchemypay/alchemyPayPage.d.ts.map +1 -0
  133. package/dist/src/fiat/providers/alchemypay/checkoutRules.d.ts +29 -0
  134. package/dist/src/fiat/providers/alchemypay/checkoutRules.d.ts.map +1 -0
  135. package/dist/src/fiat/providers/alchemypay/googlePayBuyLabel.d.ts +7 -0
  136. package/dist/src/fiat/providers/alchemypay/googlePayBuyLabel.d.ts.map +1 -0
  137. package/dist/src/fiat/providers/alchemypay/index.d.ts +4 -0
  138. package/dist/src/fiat/providers/alchemypay/index.d.ts.map +1 -0
  139. package/dist/src/fiat/providers/alchemypay/prefetch.d.ts +35 -0
  140. package/dist/src/fiat/providers/alchemypay/prefetch.d.ts.map +1 -0
  141. package/dist/src/fiat/providers/alchemypay/useAlchemyPayCheckout.d.ts +47 -0
  142. package/dist/src/fiat/providers/alchemypay/useAlchemyPayCheckout.d.ts.map +1 -0
  143. package/dist/src/fiat/providers/banxa/BanxaCheckoutSurface.d.ts +2 -2
  144. package/dist/src/fiat/providers/banxa/BanxaCheckoutSurface.d.ts.map +1 -1
  145. package/dist/src/fiat/providers/checkout/retryProviderRequest.d.ts +16 -0
  146. package/dist/src/fiat/providers/checkout/retryProviderRequest.d.ts.map +1 -0
  147. package/dist/src/fiat/providers/checkout/slotOutlets.d.ts +5 -0
  148. package/dist/src/fiat/providers/checkout/slotOutlets.d.ts.map +1 -1
  149. package/dist/src/fiat/providers/checkout/useFiatNextApi.d.ts +10 -2
  150. package/dist/src/fiat/providers/checkout/useFiatNextApi.d.ts.map +1 -1
  151. package/dist/src/fiat/providers/coinbase/CoinbaseCheckoutSurface.d.ts +1 -1
  152. package/dist/src/fiat/providers/coinbase/CoinbaseCheckoutSurface.d.ts.map +1 -1
  153. package/dist/src/fiat/providers/coinbase/coinbaseApplePay.d.ts +2 -2
  154. package/dist/src/fiat/providers/coinbase/coinbaseApplePay.d.ts.map +1 -1
  155. package/dist/src/fiat/providers/coinbase/coinbaseCardRefusal.d.ts +5 -0
  156. package/dist/src/fiat/providers/coinbase/coinbaseCardRefusal.d.ts.map +1 -1
  157. package/dist/src/fiat/providers/coinbase/coinbasePlatformPayStyle.d.ts +22 -0
  158. package/dist/src/fiat/providers/coinbase/coinbasePlatformPayStyle.d.ts.map +1 -0
  159. package/dist/src/fiat/providers/coinbase/coinbasePreparedPayment.d.ts +2 -2
  160. package/dist/src/fiat/providers/coinbase/coinbasePreparedPayment.d.ts.map +1 -1
  161. package/dist/src/fiat/providers/coinbase/coinbaseWallet.d.ts +15 -0
  162. package/dist/src/fiat/providers/coinbase/coinbaseWallet.d.ts.map +1 -0
  163. package/dist/src/fiat/providers/coinbase/next/Checkout.d.ts.map +1 -1
  164. package/dist/src/fiat/providers/coinbase/next/coinbaseCheckoutTerms.d.ts.map +1 -1
  165. package/dist/src/fiat/providers/coinbase/next/useCoinbaseCheckout.d.ts +4 -1
  166. package/dist/src/fiat/providers/coinbase/next/useCoinbaseCheckout.d.ts.map +1 -1
  167. package/dist/src/fiat/providers/moonpay/Capture.d.ts +1 -1
  168. package/dist/src/fiat/providers/moonpay/Capture.d.ts.map +1 -1
  169. package/dist/src/fiat/providers/moonpay/KycForm.d.ts +0 -2
  170. package/dist/src/fiat/providers/moonpay/KycForm.d.ts.map +1 -1
  171. package/dist/src/fiat/providers/moonpay/errors.d.ts +1 -1
  172. package/dist/src/fiat/providers/moonpay/errors.d.ts.map +1 -1
  173. package/dist/src/fiat/providers/moonpay/fullCheckout/checkoutScreens.d.ts.map +1 -1
  174. package/dist/src/fiat/providers/moonpay/fullCheckout/moonPayCheckoutTerms.d.ts.map +1 -1
  175. package/dist/src/fiat/providers/moonpay/fullCheckout/useCheckoutCalls.d.ts +3 -5
  176. package/dist/src/fiat/providers/moonpay/fullCheckout/useCheckoutCalls.d.ts.map +1 -1
  177. package/dist/src/fiat/providers/moonpay/fullCheckout/useCheckoutModel.d.ts +4 -3
  178. package/dist/src/fiat/providers/moonpay/fullCheckout/useCheckoutModel.d.ts.map +1 -1
  179. package/dist/src/fiat/providers/moonpay/guestCheckout/checkoutScreens.d.ts +0 -2
  180. package/dist/src/fiat/providers/moonpay/guestCheckout/checkoutScreens.d.ts.map +1 -1
  181. package/dist/src/fiat/providers/moonpay/guestCheckout/connection.d.ts.map +1 -1
  182. package/dist/src/fiat/providers/moonpay/guestCheckout/useGuestCheck.d.ts +2 -2
  183. package/dist/src/fiat/providers/moonpay/guestCheckout/useGuestCheck.d.ts.map +1 -1
  184. package/dist/src/fiat/providers/moonpay/guestCheckout/useGuestCheckoutModel.d.ts +5 -4
  185. package/dist/src/fiat/providers/moonpay/guestCheckout/useGuestCheckoutModel.d.ts.map +1 -1
  186. package/dist/src/fiat/providers/moonpay/index.d.ts.map +1 -1
  187. package/dist/src/fiat/providers/moonpay/moonpay.d.ts +2 -2
  188. package/dist/src/fiat/providers/moonpay/moonpay.d.ts.map +1 -1
  189. package/dist/src/fiat/providers/moonpay/moonpayAuthStyle.d.ts +7 -7
  190. package/dist/src/fiat/providers/moonpay/moonpayAuthStyle.d.ts.map +1 -1
  191. package/dist/src/fiat/providers/moonpay/{moonpayApplePayPainted.d.ts → moonpayPlatformPayPainted.d.ts} +3 -3
  192. package/dist/src/fiat/providers/moonpay/moonpayPlatformPayPainted.d.ts.map +1 -0
  193. package/dist/src/fiat/providers/moonpay/moonpayPlatformPayStyle.d.ts +13 -0
  194. package/dist/src/fiat/providers/moonpay/moonpayPlatformPayStyle.d.ts.map +1 -0
  195. package/dist/src/fiat/providers/moonpay/sdk/{ApplePayButton.d.ts → PlatformPayButton.d.ts} +14 -8
  196. package/dist/src/fiat/providers/moonpay/sdk/PlatformPayButton.d.ts.map +1 -0
  197. package/dist/src/fiat/providers/moonpay/sdk/{ApplePaySlot.d.ts → PlatformPaySlot.d.ts} +4 -4
  198. package/dist/src/fiat/providers/moonpay/sdk/PlatformPaySlot.d.ts.map +1 -0
  199. package/dist/src/fiat/providers/moonpay/useReadiness.d.ts +4 -4
  200. package/dist/src/fiat/providers/moonpay/useReadiness.d.ts.map +1 -1
  201. package/dist/src/fiat/providers/{applePayButtonMetrics.d.ts → platformPayButtonMetrics.d.ts} +6 -6
  202. package/dist/src/fiat/providers/platformPayButtonMetrics.d.ts.map +1 -0
  203. package/dist/src/fiat/providers/{applePayPaintGate.d.ts → platformPayPaintGate.d.ts} +8 -8
  204. package/dist/src/fiat/providers/platformPayPaintGate.d.ts.map +1 -0
  205. package/dist/src/fiat/providers/stripe/next/Checkout.d.ts +2 -2
  206. package/dist/src/fiat/providers/stripe/next/Checkout.d.ts.map +1 -1
  207. package/dist/src/fiat/providers/stripe/next/index.d.ts.map +1 -1
  208. package/dist/src/fiat/providers/stripe/next/stripeCheckoutTerms.d.ts.map +1 -1
  209. package/dist/src/fiat/providers/stripe/next/useStripeAccountEmail.d.ts +17 -0
  210. package/dist/src/fiat/providers/stripe/next/useStripeAccountEmail.d.ts.map +1 -0
  211. package/dist/src/fiat/providers/stripe/next/useStripeAttestation.d.ts +3 -1
  212. package/dist/src/fiat/providers/stripe/next/useStripeAttestation.d.ts.map +1 -1
  213. package/dist/src/fiat/providers/stripe/next/useStripeCheckout.d.ts +13 -4
  214. package/dist/src/fiat/providers/stripe/next/useStripeCheckout.d.ts.map +1 -1
  215. package/dist/src/fiat/providers/stripe/next/useStripeCheckoutCalls.d.ts +4 -2
  216. package/dist/src/fiat/providers/stripe/next/useStripeCheckoutCalls.d.ts.map +1 -1
  217. package/dist/src/fiat/providers/stripe/next/useStripeExit.d.ts.map +1 -1
  218. package/dist/src/fiat/providers/stripe/next/useStripeFunnel.d.ts +2 -2
  219. package/dist/src/fiat/providers/stripe/next/useStripeFunnel.d.ts.map +1 -1
  220. package/dist/src/fiat/providers/stripe/next/useStripeIdentifiers.d.ts +4 -1
  221. package/dist/src/fiat/providers/stripe/next/useStripeIdentifiers.d.ts.map +1 -1
  222. package/dist/src/fiat/providers/stripe/next/useStripeOrderSlot.d.ts +2 -1
  223. package/dist/src/fiat/providers/stripe/next/useStripeOrderSlot.d.ts.map +1 -1
  224. package/dist/src/fiat/providers/stripe/next/useStripePayment.d.ts +4 -2
  225. package/dist/src/fiat/providers/stripe/next/useStripePayment.d.ts.map +1 -1
  226. package/dist/src/fiat/providers/stripe/stripeApplePaySelection.d.ts +9 -2
  227. package/dist/src/fiat/providers/stripe/stripeApplePaySelection.d.ts.map +1 -1
  228. package/dist/src/fiat/providers/stripe/stripeCheckout.d.ts +1 -1
  229. package/dist/src/fiat/providers/stripe/stripeIdentifierField.d.ts +2 -0
  230. package/dist/src/fiat/providers/stripe/stripeIdentifierField.d.ts.map +1 -1
  231. package/dist/src/fiat/providers/stripe/stripeKycInfo.d.ts +1 -1
  232. package/dist/src/fiat/providers/stripe/stripeOnramp.d.ts +15 -4
  233. package/dist/src/fiat/providers/stripe/stripeOnramp.d.ts.map +1 -1
  234. package/dist/src/fiat/providers/stripe/stripePayment.d.ts +2 -0
  235. package/dist/src/fiat/providers/stripe/stripePayment.d.ts.map +1 -1
  236. package/dist/src/fiat/providers/stripe/{stripeApplePayButton.d.ts → stripePlatformPayButton.d.ts} +4 -4
  237. package/dist/src/fiat/providers/stripe/stripePlatformPayButton.d.ts.map +1 -0
  238. package/dist/src/fiat/providers/stripe/stripePlatformPayReady.d.ts +18 -0
  239. package/dist/src/fiat/providers/stripe/stripePlatformPayReady.d.ts.map +1 -0
  240. package/dist/src/fiat/providers/stripe/stripeSeamlessSignIn.d.ts +1 -1
  241. package/dist/src/fiat/providers/stripe/useCreateStripeAccountWithExistingUserData.d.ts +5 -4
  242. package/dist/src/fiat/providers/stripe/useCreateStripeAccountWithExistingUserData.d.ts.map +1 -1
  243. package/dist/src/fiat/providers/stripe/useStripeKycFailover.d.ts +1 -1
  244. package/dist/src/fiat/providers/stripe/useStripeKycFailover.d.ts.map +1 -1
  245. package/dist/src/fiat/providers/stripe/useStripeOnrampClient.d.ts.map +1 -1
  246. package/dist/src/fiat/providers/stripe/useStripePayButton.d.ts +5 -5
  247. package/dist/src/fiat/providers/stripe/useStripePayButton.d.ts.map +1 -1
  248. package/dist/src/fiat/providers/transak/TransakApplePayFrame.d.ts +17 -0
  249. package/dist/src/fiat/providers/transak/TransakApplePayFrame.d.ts.map +1 -0
  250. package/dist/src/fiat/providers/transak/TransakApplePaySurface.d.ts +6 -0
  251. package/dist/src/fiat/providers/transak/TransakApplePaySurface.d.ts.map +1 -1
  252. package/dist/src/fiat/providers/transak/next/Capture.d.ts +15 -0
  253. package/dist/src/fiat/providers/transak/next/Capture.d.ts.map +1 -0
  254. package/dist/src/fiat/providers/transak/next/Checkout.d.ts +25 -0
  255. package/dist/src/fiat/providers/transak/next/Checkout.d.ts.map +1 -0
  256. package/dist/src/fiat/providers/transak/next/KycForm.d.ts +22 -0
  257. package/dist/src/fiat/providers/transak/next/KycForm.d.ts.map +1 -0
  258. package/dist/src/fiat/providers/transak/next/checkoutRules.d.ts +32 -0
  259. package/dist/src/fiat/providers/transak/next/checkoutRules.d.ts.map +1 -0
  260. package/dist/src/fiat/providers/transak/next/index.d.ts +4 -0
  261. package/dist/src/fiat/providers/transak/next/index.d.ts.map +1 -0
  262. package/dist/src/fiat/providers/transak/next/prefetch.d.ts +25 -0
  263. package/dist/src/fiat/providers/transak/next/prefetch.d.ts.map +1 -0
  264. package/dist/src/fiat/providers/transak/next/useTransakCheckout.d.ts +49 -0
  265. package/dist/src/fiat/providers/transak/next/useTransakCheckout.d.ts.map +1 -0
  266. package/dist/src/fiat/quote/providerSelection.d.ts.map +1 -1
  267. package/dist/src/fiat/settlement/depositSettlement.d.ts.map +1 -1
  268. package/dist/src/fiat/surface/SurfaceSlot.d.ts +1 -1
  269. package/dist/src/fiat/surface/SurfaceSlot.d.ts.map +1 -1
  270. package/dist/src/fiat/surface/actionSlot.d.ts +2 -2
  271. package/dist/src/fiat/surface/actionSlot.d.ts.map +1 -1
  272. package/dist/src/fiat/surface/stepSurface.d.ts +4 -1
  273. package/dist/src/fiat/surface/stepSurface.d.ts.map +1 -1
  274. package/dist/src/fiat/surface/useFailureAnnouncements.d.ts +3 -2
  275. package/dist/src/fiat/surface/useFailureAnnouncements.d.ts.map +1 -1
  276. package/dist/src/fiat/surface/useSurfaceAttempt.d.ts +5 -3
  277. package/dist/src/fiat/surface/useSurfaceAttempt.d.ts.map +1 -1
  278. package/dist/src/fiat/useProviderCheckout.d.ts +21 -3
  279. package/dist/src/fiat/useProviderCheckout.d.ts.map +1 -1
  280. package/dist/src/flow/CryptoAddressPage.d.ts.map +1 -1
  281. package/dist/src/flow/CryptoDepositStep.d.ts +5 -3
  282. package/dist/src/flow/CryptoDepositStep.d.ts.map +1 -1
  283. package/dist/src/flow/CryptoTokenPage.d.ts +1 -1
  284. package/dist/src/flow/CryptoTokenPage.d.ts.map +1 -1
  285. package/dist/src/flow/DepositAmountStep.d.ts.map +1 -1
  286. package/dist/src/flow/DepositFlowContent.d.ts +11 -8
  287. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  288. package/dist/src/flow/DimLayer.d.ts +1 -1
  289. package/dist/src/flow/DimLayer.d.ts.map +1 -1
  290. package/dist/src/flow/Drawer.d.ts +3 -2
  291. package/dist/src/flow/Drawer.d.ts.map +1 -1
  292. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
  293. package/dist/src/flow/FiatRegionBlockedStep.d.ts +2 -1
  294. package/dist/src/flow/FiatRegionBlockedStep.d.ts.map +1 -1
  295. package/dist/src/flow/FiatRegionPendingStep.d.ts +3 -1
  296. package/dist/src/flow/FiatRegionPendingStep.d.ts.map +1 -1
  297. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  298. package/dist/src/flow/FunkitFlowProvider.d.ts +2 -0
  299. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  300. package/dist/src/flow/MoonPayHostedAmountStep.d.ts.map +1 -1
  301. package/dist/src/flow/PaymentMethodPickerSheet.d.ts +4 -1
  302. package/dist/src/flow/PaymentMethodPickerSheet.d.ts.map +1 -1
  303. package/dist/src/flow/PaymentMethodRows.d.ts +2 -1
  304. package/dist/src/flow/PaymentMethodRows.d.ts.map +1 -1
  305. package/dist/src/flow/SwappedAmountStep.d.ts +2 -2
  306. package/dist/src/flow/SwappedAmountStep.d.ts.map +1 -1
  307. package/dist/src/flow/WalletDepositStep.d.ts +6 -1
  308. package/dist/src/flow/WalletDepositStep.d.ts.map +1 -1
  309. package/dist/src/flow/cryptoDepositFlow.d.ts +1 -1
  310. package/dist/src/flow/cryptoDepositFlow.d.ts.map +1 -1
  311. package/dist/src/flow/cryptoTokenPick.d.ts +4 -3
  312. package/dist/src/flow/cryptoTokenPick.d.ts.map +1 -1
  313. package/dist/src/flow/depositFlowConfig.d.ts +5 -0
  314. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  315. package/dist/src/flow/depositMethods.d.ts.map +1 -1
  316. package/dist/src/flow/depositRailCopy.d.ts.map +1 -1
  317. package/dist/src/flow/fiatStepScreens.d.ts +10 -9
  318. package/dist/src/flow/fiatStepScreens.d.ts.map +1 -1
  319. package/dist/src/flow/fiatSubmitRenderer.d.ts +9 -7
  320. package/dist/src/flow/fiatSubmitRenderer.d.ts.map +1 -1
  321. package/dist/src/flow/moonPayHostedMethodRows.d.ts +3 -1
  322. package/dist/src/flow/moonPayHostedMethodRows.d.ts.map +1 -1
  323. package/dist/src/flow/quickAmounts.d.ts.map +1 -1
  324. package/dist/src/flow/renderFiatFlowScreen.d.ts +15 -9
  325. package/dist/src/flow/renderFiatFlowScreen.d.ts.map +1 -1
  326. package/dist/src/flow/screenBundles.d.ts +16 -5
  327. package/dist/src/flow/screenBundles.d.ts.map +1 -1
  328. package/dist/src/flow/sheetSizing.d.ts +15 -0
  329. package/dist/src/flow/sheetSizing.d.ts.map +1 -1
  330. package/dist/src/flow/swappedLongtail.d.ts +7 -4
  331. package/dist/src/flow/swappedLongtail.d.ts.map +1 -1
  332. package/dist/src/flow/swappedMethodRows.d.ts +4 -3
  333. package/dist/src/flow/swappedMethodRows.d.ts.map +1 -1
  334. package/dist/src/flow/useFeeDetails.d.ts +5 -2
  335. package/dist/src/flow/useFeeDetails.d.ts.map +1 -1
  336. package/dist/src/flow/useFunkitDepositWallet.d.ts +8 -0
  337. package/dist/src/flow/useFunkitDepositWallet.d.ts.map +1 -0
  338. package/dist/src/flow/useMoonPayHostedMethods.d.ts.map +1 -1
  339. package/dist/src/flow/useWalletDeposit.d.ts +3 -0
  340. package/dist/src/flow/useWalletDeposit.d.ts.map +1 -1
  341. package/dist/src/flow/useWalletReceiveQuote.d.ts +21 -0
  342. package/dist/src/flow/useWalletReceiveQuote.d.ts.map +1 -0
  343. package/dist/src/flow/walletMethods.d.ts +32 -0
  344. package/dist/src/flow/walletMethods.d.ts.map +1 -0
  345. package/dist/src/flow/withdrawalFlowConfig.d.ts +1 -1
  346. package/dist/src/hooks/track/StepViewContext.d.ts +33 -0
  347. package/dist/src/hooks/track/StepViewContext.d.ts.map +1 -0
  348. package/dist/src/hooks/track/StepViewProvider.d.ts +8 -0
  349. package/dist/src/hooks/track/StepViewProvider.d.ts.map +1 -0
  350. package/dist/src/hooks/track/cryptoDepositContext.d.ts +19 -0
  351. package/dist/src/hooks/track/cryptoDepositContext.d.ts.map +1 -0
  352. package/dist/src/hooks/track/events.d.ts +158 -15
  353. package/dist/src/hooks/track/events.d.ts.map +1 -1
  354. package/dist/src/hooks/track/paymentQuoteConfirmer.d.ts +1 -1
  355. package/dist/src/hooks/track/paymentQuoteConfirmer.d.ts.map +1 -1
  356. package/dist/src/hooks/track/paymentRecovery.d.ts +15 -0
  357. package/dist/src/hooks/track/paymentRecovery.d.ts.map +1 -0
  358. package/dist/src/hooks/track/providerQuoteForAnalytics.d.ts +11 -0
  359. package/dist/src/hooks/track/providerQuoteForAnalytics.d.ts.map +1 -0
  360. package/dist/src/hooks/track/stepViewHistory.d.ts +29 -0
  361. package/dist/src/hooks/track/stepViewHistory.d.ts.map +1 -0
  362. package/dist/src/hooks/track/useCryptoDepositSelectionEvents.d.ts +4 -0
  363. package/dist/src/hooks/track/useCryptoDepositSelectionEvents.d.ts.map +1 -0
  364. package/dist/src/hooks/track/useCryptoDepositTransferEvents.d.ts +23 -0
  365. package/dist/src/hooks/track/useCryptoDepositTransferEvents.d.ts.map +1 -0
  366. package/dist/src/hooks/track/useDepositFlowEvents.d.ts +8 -2
  367. package/dist/src/hooks/track/useDepositFlowEvents.d.ts.map +1 -1
  368. package/dist/src/hooks/track/usePaymentButtonEvents.d.ts +1 -0
  369. package/dist/src/hooks/track/usePaymentButtonEvents.d.ts.map +1 -1
  370. package/dist/src/hooks/track/usePaymentRecoveryEvents.d.ts +15 -0
  371. package/dist/src/hooks/track/usePaymentRecoveryEvents.d.ts.map +1 -0
  372. package/dist/src/hooks/track/useProviderCheckoutEvents.d.ts +26 -10
  373. package/dist/src/hooks/track/useProviderCheckoutEvents.d.ts.map +1 -1
  374. package/dist/src/hooks/track/useTrackFiatDepositQuoteEvents.d.ts +7 -5
  375. package/dist/src/hooks/track/useTrackFiatDepositQuoteEvents.d.ts.map +1 -1
  376. package/dist/src/hooks/track/useTrackFiatPaymentEvents.d.ts +18 -6
  377. package/dist/src/hooks/track/useTrackFiatPaymentEvents.d.ts.map +1 -1
  378. package/dist/src/hooks/track/useTrackSessionAuthEvents.d.ts +4 -3
  379. package/dist/src/hooks/track/useTrackSessionAuthEvents.d.ts.map +1 -1
  380. package/dist/src/hooks/track/useTrackedNav.d.ts +4 -0
  381. package/dist/src/hooks/track/useTrackedNav.d.ts.map +1 -0
  382. package/dist/src/hooks/useNestedSheet.d.ts.map +1 -1
  383. package/dist/src/icons/KycIdentityIcon.d.ts +1 -1
  384. package/dist/src/icons/PaymentBrandIcons.d.ts +4 -0
  385. package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -1
  386. package/dist/src/icons/TokenChainIcon.d.ts +1 -1
  387. package/dist/src/icons/iconSvg.d.ts.map +1 -1
  388. package/dist/src/icons/kycArtwork.d.ts +3 -3
  389. package/dist/src/icons/kycArtwork.d.ts.map +1 -1
  390. package/dist/src/moonpayHosted/MoonPayHostedCheckout.d.ts +2 -1
  391. package/dist/src/moonpayHosted/MoonPayHostedCheckout.d.ts.map +1 -1
  392. package/dist/src/moonpayHosted/checkout.d.ts +1 -2
  393. package/dist/src/moonpayHosted/checkout.d.ts.map +1 -1
  394. package/dist/src/preview/fixtures/alchemyPayCheckout.d.ts +13 -0
  395. package/dist/src/preview/fixtures/alchemyPayCheckout.d.ts.map +1 -0
  396. package/dist/src/preview/fixtures/stripeCheckout.d.ts +8 -0
  397. package/dist/src/preview/fixtures/stripeCheckout.d.ts.map +1 -0
  398. package/dist/src/preview/fixtures/transakCheckout.d.ts +17 -0
  399. package/dist/src/preview/fixtures/transakCheckout.d.ts.map +1 -0
  400. package/dist/src/preview/flowPreview.d.ts +35 -5
  401. package/dist/src/preview/flowPreview.d.ts.map +1 -1
  402. package/dist/src/preview/replay/ReplayMoonPay.d.ts +11 -2
  403. package/dist/src/preview/replay/ReplayMoonPay.d.ts.map +1 -1
  404. package/dist/src/preview/replay/replayFetch.d.ts.map +1 -1
  405. package/dist/src/preview/scenarioCatalog.d.ts +92 -2
  406. package/dist/src/preview/scenarioCatalog.d.ts.map +1 -1
  407. package/dist/src/preview/scenarios.d.ts +1 -1
  408. package/dist/src/preview/scenarios.d.ts.map +1 -1
  409. package/dist/src/providers/useFrozenIdentity.d.ts +1 -1
  410. package/dist/src/screens/DepositAmountScreen.d.ts.map +1 -1
  411. package/dist/src/screens/FeeDetailsScreen.d.ts +1 -1
  412. package/dist/src/screens/PaymentConfirmScreen.d.ts +2 -1
  413. package/dist/src/screens/PaymentConfirmScreen.d.ts.map +1 -1
  414. package/dist/src/screens/TokenAndChainPickerScreen.d.ts.map +1 -1
  415. package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -1
  416. package/dist/src/statsig/useStatsigReady.d.ts +1 -1
  417. package/dist/src/swapped/useSwappedBuyingCrypto.d.ts +1 -1
  418. package/dist/src/theme/inputTextStyle.d.ts +1 -1
  419. package/dist/src/theme/legibleBrandColor.d.ts +2 -2
  420. package/dist/src/transfer/fops.d.ts +5 -1
  421. package/dist/src/transfer/fops.d.ts.map +1 -1
  422. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
  423. package/dist/src/transfer/hooks/useWithdrawalFops.d.ts +3 -1
  424. package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -1
  425. package/dist/src/transfer/lockedQuoteSource.d.ts +5 -0
  426. package/dist/src/transfer/lockedQuoteSource.d.ts.map +1 -1
  427. package/dist/src/utils/assetGrid.d.ts +1 -1
  428. package/dist/src/utils/colorMotion.d.ts +5 -5
  429. package/dist/src/utils/customers.d.ts +1 -0
  430. package/dist/src/utils/customers.d.ts.map +1 -1
  431. package/dist/src/utils/motion.d.ts +1 -1
  432. package/package.json +5 -5
  433. package/dist/chunk-AICRSY7K.js.map +0 -7
  434. package/dist/chunk-GOFKXSDM.js.map +0 -7
  435. package/dist/src/fiat/payment/applePayAttempt.d.ts +0 -31
  436. package/dist/src/fiat/payment/applePayAttempt.d.ts.map +0 -1
  437. package/dist/src/fiat/providers/applePayButtonMetrics.d.ts.map +0 -1
  438. package/dist/src/fiat/providers/applePayPaintGate.d.ts.map +0 -1
  439. package/dist/src/fiat/providers/moonpay/moonpayApplePayPainted.d.ts.map +0 -1
  440. package/dist/src/fiat/providers/moonpay/moonpayApplePayStyle.d.ts +0 -7
  441. package/dist/src/fiat/providers/moonpay/moonpayApplePayStyle.d.ts.map +0 -1
  442. package/dist/src/fiat/providers/moonpay/reask.d.ts +0 -5
  443. package/dist/src/fiat/providers/moonpay/reask.d.ts.map +0 -1
  444. package/dist/src/fiat/providers/moonpay/sdk/ApplePayButton.d.ts.map +0 -1
  445. package/dist/src/fiat/providers/moonpay/sdk/ApplePaySlot.d.ts.map +0 -1
  446. package/dist/src/fiat/providers/stripe/stripeApplePayButton.d.ts.map +0 -1
  447. package/dist/src/fiat/providers/stripe/stripeApplePayReady.d.ts +0 -18
  448. package/dist/src/fiat/providers/stripe/stripeApplePayReady.d.ts.map +0 -1
  449. /package/dist/{chunk-Q74I4SOP.js.map → chunk-5QHEW234.js.map} +0 -0
@@ -52,7 +52,11 @@ var SEED = {
52
52
  moonPayBuyerRequested: (p) => p.deposit?.fiat?.pressEntry ?? (p.deposit?.fiat?.moonPayChallenge === void 0 ? void 0 : true),
53
53
  moonPayChallenge: (p) => p.deposit?.fiat?.moonPayChallenge,
54
54
  coinbaseBuyerRequested: (p) => p.deposit?.fiat?.pressEntry,
55
- stripeBuyerRequested: (p) => p.deposit?.fiat?.pressEntry,
55
+ alchemyPayCheckout: (p) => p.deposit?.fiat?.alchemyPayCheckout,
56
+ stripeBuyerRequested: (p) => p.deposit?.fiat?.pressEntry ?? (p.deposit?.fiat?.stripeCheckout === void 0 ? void 0 : true),
57
+ stripeCheckout: (p) => p.deposit?.fiat?.stripeCheckout,
58
+ transakCheckout: (p) => p.deposit?.fiat?.transakCheckout,
59
+ stripeAccountEmail: (p) => p.deposit?.fiat?.stripeAccountEmail,
56
60
  moonPayKycIntroduced: (p) => {
57
61
  const page = p.deposit?.fiat?.identity?.page;
58
62
  return page === void 0 ? void 0 : page === "form";
@@ -63,6 +67,7 @@ var SEED = {
63
67
  fiatFailoverVerified: (p) => p.deposit?.fiat?.failoverVerified,
64
68
  fiatFailoverLanded: (p) => p.deposit?.fiat?.failoverLanded,
65
69
  fiatFailoverKept: (p) => p.deposit?.fiat?.failoverKept,
70
+ fiatRegionCurrency: (p) => p.deposit?.fiat?.regionCurrency,
66
71
  fiatHandoffPaymentFailure: (p) => p.deposit?.fiat?.handoffPaymentFailure,
67
72
  fiatAccountIneligible: (p) => p.deposit?.fiat?.accountIneligible,
68
73
  fiatDepositMatch: (p) => p.deposit?.fiat?.depositMatch,
@@ -72,7 +77,7 @@ var SEED = {
72
77
  fiatPaymentMethodContent: (p) => p.deposit?.fiat?.paymentMethodContent,
73
78
  fiatHostedCheckout: (p) => p.deposit?.fiat?.hostedPayment !== void 0 && p.deposit.fiat.hostedPayment !== "amount",
74
79
  fiatHostedConnecting: (p) => p.deposit?.fiat?.hostedPayment === "moonPayConnecting",
75
- fiatHostedRevealed: (p) => p.deposit?.fiat?.hostedPayment === "moonPayCheckout" || p.deposit?.fiat?.hostedPayment === "moonPayFailed",
80
+ fiatHostedRevealed: (p) => p.deposit?.fiat?.hostedPayment === "moonPayCheckout",
76
81
  fiatPaymentMethodCrypto: (p) => p.deposit?.fiat?.paymentMethodCrypto,
77
82
  fiatPaymentMethodSwapped: (p) => p.deposit?.fiat?.paymentMethodSwapped,
78
83
  fiatPaymentMethodSwappedPending: (p) => p.deposit?.fiat?.paymentMethodSwappedPending,
@@ -467,6 +472,14 @@ export {
467
472
  SEED,
468
473
  useSeed,
469
474
  useSeededState,
475
+ PRIVACY_POLICY_URL,
476
+ CONSENT_COPY_VERSION,
477
+ PERSONA_PRIVACY_POLICY_URL,
478
+ kycProviderDisplayName,
479
+ isReplayMounted,
480
+ FunkitSessionReplay,
481
+ useIsReplaying,
482
+ useRecordedEndings,
470
483
  PADS_WITHOUT_RETURN_KEY,
471
484
  GROSS_ANNUAL_INCOME,
472
485
  EXPECTED_AMOUNT_PER_MONTH,
@@ -484,14 +497,6 @@ export {
484
497
  isDigitsField,
485
498
  isFixedWidthField,
486
499
  unsupportedFields,
487
- sectionPages,
488
- isReplayMounted,
489
- FunkitSessionReplay,
490
- useIsReplaying,
491
- useRecordedEndings,
492
- PRIVACY_POLICY_URL,
493
- CONSENT_COPY_VERSION,
494
- PERSONA_PRIVACY_POLICY_URL,
495
- kycProviderDisplayName
500
+ sectionPages
496
501
  };
497
- //# sourceMappingURL=chunk-AICRSY7K.js.map
502
+ //# sourceMappingURL=chunk-NW2EYUCE.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/preview/flowPreview.tsx", "../src/preview/replay/FunkitSessionReplay.tsx", "../src/fiat/kyc/legalLinks.ts", "../src/fiat/form/formLayout.ts", "../src/fiat/form/keyboardReturnKey.ts", "../src/fiat/country/postalCodeCountries.ts"],
4
+ "sourcesContent": ["import type {\n AlchemyPayCheckoutState,\n FiatProvider,\n FiatStepResponse,\n MoonPayCheckoutState,\n StripeCheckoutState,\n TransakCheckoutState,\n} 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 { HeldContact } from '../fiat/contact/phoneRegionRedirect'\nimport type { KycCompletion } from '../fiat/kyc/useKycCompletion'\nimport type { KycSection } from '../fiat/form/formLayout'\nimport type { CryptoFlowScreen } from '../flow/cryptoDepositFlow'\nimport type { FlowScreen } from '../flow/FunkitFlowProvider'\nimport type { DepositMatchTerms } from '../flow/depositFlowConfig'\nimport type { DepositLinkOutApp } from '../flow/depositFlowConfig'\nimport type { AssetBalanceInfo } from '@funkit/api-base'\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 /**\n * The step response the session opens on, as if the backend had just sent it.\n * - A function builds it as the session opens, for a step whose times count from then.\n */\n step?: FiatStepResponse | (() => 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 /** Past the MoonPay retake choice, onto the document intro. */\n moonPayCaptureRedoing?: boolean\n /**\n * A handed-off MoonPay checkout opens at MoonPay's own extra check, past the buyer's Continue:\n * its intro, or its \"additional verification\" card after one completed check.\n * - Builds the checkout's state from its start, so the replay ships with the preview entry only.\n */\n moonPayChallenge?: (start: MoonPayCheckoutState) => MoonPayCheckoutState\n /**\n * A handed-off AlchemyPay checkout opens at a later step, past the buyer's Continue. The preview's\n * backend answers no `/fiat/next`, so the checkout's state is built from its start.\n */\n alchemyPayCheckout?: (\n start: AlchemyPayCheckoutState,\n ) => AlchemyPayCheckoutState\n /**\n * A handed-off Stripe checkout opens at a later step, past the buyer's Continue. The preview's\n * backend answers no `/fiat/next`, so the checkout's state is built from its start.\n */\n stripeCheckout?: (start: StripeCheckoutState) => StripeCheckoutState\n /**\n * A handed-off Transak checkout opens at a later step, past the buyer's Continue. The preview's\n * backend answers no `/fiat/next`, so the checkout's state is built from its start.\n */\n transakCheckout?: (start: TransakCheckoutState) => TransakCheckoutState\n /** The Link account email the buyer typed on Stripe's account-email step. */\n stripeAccountEmail?: string\n /** The acknowledgment 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 /** The buyer signed in where a payment failover moved them: the payment waits for a tap. */\n failoverVerified?: boolean\n /** A failover's Continue led to a provider ready to pay: the verified sheet hosts its button. */\n failoverLanded?: boolean\n /** A failover's Continue, from Coinbase, kept this prompt up while the next provider starts. */\n failoverKept?: 'cardNotFound' | 'prepaidDeclined'\n /** A provider that sells the buyer only this currency: the region sheet asks over the amount. */\n regionCurrency?: { provider: FiatProvider; currency: string }\n /** The quote's own pay sheet failed, reported once a quote has drawn it. */\n quoteSurfaceFailure?: { code: string; detail?: string }\n /** A `/fiat/next` checkout's payment page failed with this code, as its `onExit` reports it. */\n handoffPaymentFailure?: { provider: FiatProvider; code: string }\n /** Submits the seeded step's CTA with this id on open \u2014 how a failed send is reached. */\n submitOnOpen?: string\n /** The host's identity minter refused this account. */\n accountIneligible?: boolean\n /** Turns the deposit-match preview on, as the host's internal flag does. */\n depositMatch?: DepositMatchTerms\n /** The pay sheet already took the payment, so the seeded order is one the buyer just paid for. */\n paymentCaptured?: boolean\n /** The payment-method picker open over the amount; a stand-in when the host supplies none. */\n paymentMethodPicker?: boolean\n /** Fun's login ended over the seeded order, so the flow asks the buyer to sign in again. */\n funReauth?: boolean\n /** A stand-in host payment-method page inside the open picker. */\n paymentMethodContent?: boolean\n hostedPayment?:\n | 'amount'\n | 'moonPayHandoff'\n | 'moonPayConnecting'\n | 'moonPayCheckout'\n | 'moonPayFailed'\n /** The crypto page inside the open payment-method picker, with its back history. */\n paymentMethodCrypto?: CryptoFlowScreen\n /** Stand-in Swapped long-tail methods under the open picker's host rows. */\n paymentMethodSwapped?: boolean\n /** Swapped's section in the open picker while `/fops` is still answering. */\n paymentMethodSwappedPending?: boolean\n /** A stand-in Swapped method picked, its embed drawn inside the open picker. */\n paymentMethodSwappedPage?: boolean\n /** A stand-in Swapped v2 method picked, waiting on the amount screen for Continue. */\n paymentMethodSwappedChosen?: boolean\n /** The contact screen a non-US-number redirect holds up while MoonPay quotes. */\n redirectHold?: HeldContact\n /**\n * The provider checkouts this session hands quotes to, whatever their Statsig gates say: how QA\n * runs a `/fiat/next` flow before its gate is on. Held for the whole session, not one mount.\n */\n handoffProviders?: readonly FiatProvider[]\n}\n\nexport interface DepositPreviewSeed {\n /**\n * The screen the flow opens on; defaults to the root `beginDeposit` picks.\n * Transfer opens above it; a crypto page opens above the pages before it.\n */\n screen?: Extract<\n FlowScreen,\n | 'depositAmount'\n | 'walletConfirm'\n | 'addMoney'\n | 'transfer'\n | 'cryptoToken'\n | 'cryptoNetwork'\n | 'cryptoAddress'\n | 'cryptoLearnMore'\n >\n fiat?: FiatPreviewSeed\n /** A simulated link-out session: no wallet connection, signing, or submission. */\n wallet?: {\n app: DepositLinkOutApp\n from: string\n to: string\n tokens: AssetBalanceInfo[]\n amount: string\n status: 'idle' | 'sent' | 'failed' | 'pending'\n /** Where the wallet connection stands, before any account is linked. */\n connection?: 'connecting' | 'loading' | 'failed'\n menuOpen?: boolean\n assetListOpen?: boolean\n /** The asset sheet open on its failed-unlink notice. */\n unlinkFailed?: boolean\n }\n /** The deposit chain, by id, as if picked from the Crypto row \u2014 Transfer needs one. */\n chainId?: string\n /** A locked deposit's source token, by symbol, as if picked with `chainId` \u2014 its Transfer needs both. */\n sourceSymbol?: string\n /** The V2 crypto currency page's search, open on this query (`''` for an empty field). */\n tokenQuery?: string\n /** The V2 crypto address page's address, tapped open to its full length. */\n addressExpanded?: boolean\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 paste-panel address field, open for editing (its tail gives way to the address start). */\n addressFocused?: boolean\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/** The session's forced provider checkouts, if its preview names any. Read on every mount. */\nexport function usePreviewHandoffProviders():\n | readonly FiatProvider[]\n | undefined {\n return useContext(ActivePreviewContext).deposit?.fiat?.handoffProviders\n}\n\nexport function useActivePreview(): ActivePreview {\n return useContext(ActivePreviewContext)\n}\n\nexport const ActivePreviewProvider = ActivePreviewContext.Provider\n\nexport function usePreviewHostedPayment(): FiatPreviewSeed['hostedPayment'] {\n return useContext(ActivePreviewContext).deposit?.fiat?.hostedPayment\n}\n\n/** The step a fiat seed opens on, built now when it is timed. */\nexport function openingStep(\n seed: FiatPreviewSeed | undefined,\n): FiatStepResponse | undefined {\n const step = seed?.step\n return typeof step === 'function' ? step() : step\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) => openingStep(p.deposit?.fiat),\n fiatPressEntry: (p) => p.deposit?.fiat?.pressEntry,\n moonPayCaptureRedoing: (p) => p.deposit?.fiat?.moonPayCaptureRedoing,\n moonPayBuyerRequested: (p) =>\n p.deposit?.fiat?.pressEntry ??\n (p.deposit?.fiat?.moonPayChallenge === undefined ? undefined : true),\n moonPayChallenge: (p) => p.deposit?.fiat?.moonPayChallenge,\n coinbaseBuyerRequested: (p) => p.deposit?.fiat?.pressEntry,\n alchemyPayCheckout: (p) => p.deposit?.fiat?.alchemyPayCheckout,\n stripeBuyerRequested: (p) =>\n p.deposit?.fiat?.pressEntry ??\n (p.deposit?.fiat?.stripeCheckout === undefined ? undefined : true),\n stripeCheckout: (p) => p.deposit?.fiat?.stripeCheckout,\n transakCheckout: (p) => p.deposit?.fiat?.transakCheckout,\n stripeAccountEmail: (p) => p.deposit?.fiat?.stripeAccountEmail,\n moonPayKycIntroduced: (p) => {\n const page = p.deposit?.fiat?.identity?.page\n return page === undefined ? undefined : page === 'form'\n },\n fiatSubmitOnOpen: (p) => p.deposit?.fiat?.submitOnOpen,\n fiatSurfaceFailure: (p) => p.deposit?.fiat?.surfaceFailure,\n fiatQuoteSurfaceFailure: (p) => p.deposit?.fiat?.quoteSurfaceFailure,\n fiatFailoverVerified: (p) => p.deposit?.fiat?.failoverVerified,\n fiatFailoverLanded: (p) => p.deposit?.fiat?.failoverLanded,\n fiatFailoverKept: (p) => p.deposit?.fiat?.failoverKept,\n fiatRegionCurrency: (p) => p.deposit?.fiat?.regionCurrency,\n fiatHandoffPaymentFailure: (p) => p.deposit?.fiat?.handoffPaymentFailure,\n fiatAccountIneligible: (p) => p.deposit?.fiat?.accountIneligible,\n fiatDepositMatch: (p) => p.deposit?.fiat?.depositMatch,\n fiatPaymentCaptured: (p) => p.deposit?.fiat?.paymentCaptured,\n fiatPaymentMethodPicker: (p) => p.deposit?.fiat?.paymentMethodPicker,\n fiatFunReauth: (p) => p.deposit?.fiat?.funReauth,\n fiatPaymentMethodContent: (p) => p.deposit?.fiat?.paymentMethodContent,\n fiatHostedCheckout: (p) =>\n p.deposit?.fiat?.hostedPayment !== undefined &&\n p.deposit.fiat.hostedPayment !== 'amount',\n fiatHostedConnecting: (p) =>\n p.deposit?.fiat?.hostedPayment === 'moonPayConnecting',\n fiatHostedRevealed: (p) =>\n p.deposit?.fiat?.hostedPayment === 'moonPayCheckout',\n fiatPaymentMethodCrypto: (p) => p.deposit?.fiat?.paymentMethodCrypto,\n fiatPaymentMethodSwapped: (p) => p.deposit?.fiat?.paymentMethodSwapped,\n fiatPaymentMethodSwappedPending: (p) =>\n p.deposit?.fiat?.paymentMethodSwappedPending,\n fiatPaymentMethodSwappedPage: (p) =>\n p.deposit?.fiat?.paymentMethodSwappedPage,\n fiatPaymentMethodSwappedChosen: (p) =>\n p.deposit?.fiat?.paymentMethodSwappedChosen,\n fiatRedirectHold: (p) => p.deposit?.fiat?.redirectHold,\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 depositSourceSymbol: (p) => p.deposit?.sourceSymbol,\n cryptoTokenQuery: (p) => p.deposit?.tokenQuery,\n cryptoAddressExpanded: (p) => p.deposit?.addressExpanded,\n walletDeposit: (p) => p.deposit?.wallet,\n walletAccount: (p) => {\n const wallet = p.deposit?.wallet\n // A failed connection never linked an account.\n return wallet && wallet.connection !== 'failed'\n ? { address: wallet.from, tokens: wallet.tokens }\n : undefined\n },\n walletAmount: (p) => p.deposit?.wallet?.amount,\n walletStatus: (p) => p.deposit?.wallet?.status,\n walletConnection: (p) => p.deposit?.wallet?.connection,\n walletMenuOpen: (p) => p.deposit?.wallet?.menuOpen,\n walletUnlinkFailed: (p) => p.deposit?.wallet?.unlinkFailed,\n walletAssetListOpen: (p) => p.deposit?.wallet?.assetListOpen,\n walletToken: (p) => p.deposit?.wallet?.tokens[0],\n withdrawalMethodId: (p) => p.withdrawal?.methodId,\n withdrawalAmount: (p) => p.withdrawal?.amount,\n withdrawalRecipient: (p) => p.withdrawal?.recipient,\n withdrawalAddressFocused: (p) => p.withdrawal?.addressFocused,\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 { TapeEnding } from '@funkit/connect-core'\nimport {\n type ReactNode,\n createContext,\n useContext,\n useLayoutEffect,\n useMemo,\n} from 'react'\n\n/** Which recorded ending a screen can play. */\ninterface EndingMatch {\n /** Its code starts with this: a Stripe stage, `perform_checkout:`. */\n prefix?: string\n /** A sign-in screen plays only what ended a sign-in, and a payment screen only the rest. */\n auth?: boolean\n}\n\n/** The provider screens' recorded endings, each played back once. */\nexport interface RecordedEndings {\n /** The next unplayed one recorded for `provider` that this screen can play. */\n next: (provider: string, match?: EndingMatch) => TapeEnding | undefined\n played: (ending: TapeEnding) => void\n}\n\n/** The screen a sign-in surface draws on, as the failure logs name it. */\nconst AUTH_SCREEN = 'AUTH_CAPTURE'\n\nfunction recordedEndings(endings: readonly TapeEnding[]): RecordedEndings {\n const played = new Set<TapeEnding>()\n // a tape from before endings named their screen plays on any\n const fits = (ending: TapeEnding, auth: boolean | undefined) =>\n auth === undefined ||\n ending.screen === undefined ||\n (ending.screen === AUTH_SCREEN) === auth\n return {\n next: (provider, { prefix = '', auth }: EndingMatch = {}) =>\n endings.find(\n (ending) =>\n !played.has(ending) &&\n ending.provider === provider &&\n ending.code.startsWith(prefix) &&\n fits(ending, auth),\n ),\n played: (ending) => {\n played.add(ending)\n },\n }\n}\n\nconst NONE = recordedEndings([])\n\nconst ReplayContext = createContext({ active: false, endings: NONE })\n\n/** Read where no context reaches: which adapter claims a surface is decided outside render. */\nlet replayMounted = false\nexport const isReplayMounted = (): boolean => replayMounted\n\n/**\n * Marks the flows below it as running on a recorded attempt's answers (`createReplayFetch`),\n * so provider screens, which need a live provider session, stand aside.\n * - `endings` are how the buyer's provider screens failed or closed: the backend never hears a\n * decline, so the stand-ins play them back.\n */\nexport function FunkitSessionReplay({\n active,\n endings,\n children,\n}: {\n active: boolean\n endings?: readonly TapeEnding[]\n children: ReactNode\n}) {\n useLayoutEffect(() => {\n replayMounted = active\n return () => {\n replayMounted = false\n }\n }, [active])\n const value = useMemo(\n () => ({\n active,\n endings: endings === undefined ? NONE : recordedEndings(endings),\n }),\n [active, endings],\n )\n return (\n <ReplayContext.Provider value={value}>{children}</ReplayContext.Provider>\n )\n}\n\nexport function useIsReplaying(): boolean {\n return useContext(ReplayContext).active\n}\n\nexport function useRecordedEndings(): RecordedEndings {\n return useContext(ReplayContext).endings\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 {\n type PostalCodeForm,\n postalCodeForm,\n} from '../country/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 | 'BIRTHPLACE'\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 // No frame: Stripe's EU round asks both, so they share a page after the nationality.\n COUNTRY_OF_BIRTH: 'BIRTHPLACE',\n CITY_OF_BIRTH: 'BIRTHPLACE',\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 'BIRTHPLACE',\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 'BIRTHPLACE',\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": ";AAQA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA6NH;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;AAGO,SAAS,6BA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KAAK,4BAA4B;AAC/C,QAAM,QAAQ,KAAK,4BAA4B;AAC/C,QAAM,OAAO,KAAK,0BAA0B;AAC5C,QAAM,SAAS,KAAK,4BAA4B;AAChD,QAAM,SAAS,KAAK,iCAAiC;AACrD,QAAM,OAAoC,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;AAC3D,MAAI,WAAW,QAAW;AACxB,SAAK,KAAK,CAAC,QAAQ,IAAI,CAAC;AAAA,EAC1B,OAAO;AACL,SAAK,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,MAAM,CAAC;AAAA,EACpC;AACA,SAAO,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAC3D,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,UAAU,UAAU,MAAS,CAAC,EACvD,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC;AACnC;",
6
+ "names": ["createContext", "useContext", "useMemo", "jsx"]
7
+ }
@@ -60,7 +60,7 @@ export interface LighterWithdrawalFlowConfig {
60
60
  * nonce, prompts, or submits.
61
61
  *
62
62
  * Lighter strategies and withdrawals share one L2 signing account, so a
63
- * strategy still placing or cancelling orders bumps the nonce out from under
63
+ * strategy still placing or canceling orders bumps the nonce out from under
64
64
  * the withdrawal and the signed tx is rejected. Cancel in-flight strategies
65
65
  * here so the withdrawal signs against a stable nonce. Throw to abort — no
66
66
  * nonce is consumed.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useFunkitIdentity,
3
3
  useFunkitTranslation
4
- } from "../chunk-GOFKXSDM.js";
4
+ } from "../chunk-HXOQOPQY.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-2HFFVYAZ.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../clients/lighter/useLighterWithdrawalMethods.ts", "../../clients/lighter/lighterWithdrawalConfig.ts", "../../clients/lighter/lighterFastWithdrawal.ts", "../../clients/lighter/useLighterUnstakedFee.ts", "../../clients/lighter/useLighterWithdrawal.ts", "../../clients/lighter/useLighterSecureWithdrawal.ts"],
4
- "sourcesContent": ["import { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { useLighterAccountsQuery } from '@funkit/connect-core'\nimport { getLighterWithdrawalDelay } from '@funkit/connect-core/clients/lighter'\nimport { useQuery } from '@tanstack/react-query'\nimport type { TFunction } from 'i18next'\nimport { useEffect, useRef } from 'react'\n\nimport { logger } from '../../src/logging/logger'\nimport { useFunkitTranslation } from '../../src/providers/FunkitI18nProvider'\nimport {\n LIGHTER_FAST_METHOD_ID,\n LIGHTER_SECURE_METHOD_ID,\n type LighterWithdrawalFlowConfig,\n} from './lighterWithdrawalConfig'\n\n/** One row on the withdrawal method screen, before icons are attached. */\nexport interface LighterWithdrawalMethod {\n id: typeof LIGHTER_FAST_METHOD_ID | typeof LIGHTER_SECURE_METHOD_ID\n title: string\n subtitle: string\n}\n\nexport interface UseLighterWithdrawalMethodsResult {\n /** Fast then Secure, in web's order. Empty until the account resolves. */\n methods: LighterWithdrawalMethod[]\n /**\n * The user's Lighter L2 main-account index. Both rails address the account\n * by index, so neither can run before this resolves.\n */\n accountIndex: string | undefined\n /** Unified accounts hold one USDC balance \u2014 no spot/perps split. */\n isUnifiedTradingMode: boolean\n /** The account lookup is in flight; rows are expected to be empty. */\n isLoading: boolean\n}\n\nconst SECONDS_PER_MINUTE = 60\nconst MINUTES_PER_HOUR = 60\nconst SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR\n\n/**\n * Formats Lighter's live L2\u2192L1 delay for the Secure row (e.g. \"1 h 50 min\").\n * - Reproduces web's `formatSecondsToReadableForm(seconds, false, true)` output\n * for every input, including its two oddities: a sub-minute delay reads in\n * seconds, and exactly one hour reads \"60 min\". The two SDKs quote the same\n * bridge, so they must not disagree on the wait.\n * - Rounds up otherwise: an estimate must not promise finality early.\n * - One literal `t` key per shape \u2014 never a computed key.\n */\nfunction formatDelay(t: TFunction, seconds: number): string {\n const normalized = Math.ceil(seconds)\n if (normalized === 1) {\n return t('withdrawLighter.delaySecond')\n }\n if (normalized <= SECONDS_PER_MINUTE) {\n return t('withdrawLighter.delaySeconds', { seconds: normalized })\n }\n // Round to minutes first: rounding the remainder alone can yield \"1 h 60 min\".\n const minutes = Math.ceil(normalized / SECONDS_PER_MINUTE) % MINUTES_PER_HOUR\n const hours = Math.ceil(\n (normalized - minutes * SECONDS_PER_MINUTE) / SECONDS_PER_HOUR,\n )\n if (hours === 1 && minutes === 0) {\n return t('withdrawLighter.delayMinutes', { minutes: MINUTES_PER_HOUR })\n }\n if (hours > 0 && minutes > 0) {\n return t('withdrawLighter.delayHoursMinutes', { hours, minutes })\n }\n if (hours > 0) {\n return t('withdrawLighter.delayHours', { hours })\n }\n return t('withdrawLighter.delayMinutes', { minutes })\n}\n\n/**\n * Secure-withdrawal delay as display copy. Shown live because it tracks L2\u2192L1\n * batch cadence; `undefined` until it loads.\n */\nfunction useLighterSecureDelayText(enabled: boolean): string | undefined {\n const { t } = useFunkitTranslation()\n const { data } = useQuery({\n queryKey: ['lighterWithdrawalDelay', LIGHTER_CHAIN_ID],\n queryFn: () => getLighterWithdrawalDelay(LIGHTER_CHAIN_ID),\n // This hook runs for every withdrawal flow, Lighter or not \u2014 a host with no\n // Lighter config must never reach Lighter's API.\n enabled,\n staleTime: 60_000,\n retry: 2,\n })\n const seconds = data?.seconds\n if (seconds === undefined || !Number.isFinite(seconds) || seconds <= 0) {\n return undefined\n }\n return formatDelay(t, seconds)\n}\n\ntype RailOutcome = 'not_configured' | 'loading' | 'offered' | 'no_account_index'\n\n/**\n * Whether Lighter's rails replace the generic crypto row, and why not when they\n * don't.\n * - `isFetched`, not `isLoading`: the latter is false on the first render,\n * before the query starts, which would record a premature \"no account\".\n */\nfunction resolveRailOutcome({\n isConfigured,\n isFetched,\n hasAccountIndex,\n}: {\n isConfigured: boolean\n isFetched: boolean\n hasAccountIndex: boolean\n}): RailOutcome {\n if (!isConfigured) {\n return 'not_configured'\n }\n if (!isFetched) {\n return 'loading'\n }\n if (!hasAccountIndex) {\n return 'no_account_index'\n }\n return 'offered'\n}\n\n/**\n * The Fast / Secure rows plus the account state both rails need. Port of the\n * row-building half of web's `useLighterWithdrawalConfig`.\n *\n * Pass `undefined` when the host configured no Lighter: the inner hooks still\n * run (Rules of Hooks) but every query stays disabled.\n */\nexport function useLighterWithdrawalMethods(\n config: LighterWithdrawalFlowConfig | undefined,\n): UseLighterWithdrawalMethodsResult {\n const { t } = useFunkitTranslation()\n const { mainAccountIndex, isUnifiedTradingMode, isLoading, isFetched } =\n useLighterAccountsQuery({\n address: config?.l1Address,\n chainId: LIGHTER_CHAIN_ID,\n })\n const secureDelayText = useLighterSecureDelayText(!!config)\n\n // Lighter addresses accounts by a numeric index; anything else means the\n // lookup returned something unusable and neither rail can address the user.\n const accountIndex =\n mainAccountIndex && /^\\d+$/.test(mainAccountIndex)\n ? mainAccountIndex\n : undefined\n\n const outcome = resolveRailOutcome({\n isConfigured: !!config,\n isFetched,\n hasAccountIndex: !!accountIndex,\n })\n // Rail-availability decision point, recorded once per outcome so a re-render\n // or a background refetch doesn't re-emit the same one.\n const loggedOutcome = useRef<RailOutcome | undefined>(undefined)\n useEffect(() => {\n if (outcome === 'loading' || loggedOutcome.current === outcome) {\n return\n }\n loggedOutcome.current = outcome\n if (outcome === 'not_configured') {\n return\n }\n const payload = {\n outcome,\n isUnifiedTradingMode,\n hasAccountIndex: !!accountIndex,\n }\n if (outcome === 'no_account_index') {\n // Recovered, but the user loses Lighter's rails for this session \u2014 that\n // is a visible capability change, so it belongs above INFO.\n logger.warn('lighter:withdrawal:rails', payload)\n return\n }\n logger.info('lighter:withdrawal:rails', payload)\n }, [outcome, isUnifiedTradingMode, accountIndex])\n\n const methods: LighterWithdrawalMethod[] =\n config && accountIndex\n ? [\n {\n id: LIGHTER_FAST_METHOD_ID,\n title: t('withdrawLighter.methodFast'),\n subtitle: isUnifiedTradingMode\n ? t('withdrawLighter.fastDisclaimerUnified')\n : t('withdrawLighter.fastDisclaimer'),\n },\n {\n id: LIGHTER_SECURE_METHOD_ID,\n title: t('withdrawLighter.methodSecure'),\n subtitle: t('withdrawLighter.secureDisclaimer', {\n // Until the live value loads, show the localized \"60+ minutes\"\n // historical estimate. The \"+\" lives in the per-locale fallback\n // string so it doesn't bleed into live values, which are exact.\n delay:\n secureDelayText ?? t('withdrawLighter.secureFallbackDelay'),\n }),\n },\n ]\n : []\n\n return {\n methods,\n accountIndex,\n isUnifiedTradingMode,\n isLoading: !!config && isLoading,\n }\n}\n", "import type { LighterRouteType } from '@funkit/connect-core/clients/lighter'\nimport type { LighterSigner } from '@funkit/connect-core/clients/lighter'\nimport type { Address } from 'viem'\n\nimport type { WithdrawalSourceTokenParams } from '../../src/flow/withdrawalFlowConfig'\n\n/** Stable ids for the two rails \u2014 used for row identity, routing and logs. */\nexport const LIGHTER_FAST_METHOD_ID = 'lighter-fast'\nexport const LIGHTER_SECURE_METHOD_ID = 'lighter-secure'\n\n/** What the host must implement to submit a Secure withdrawal on Lighter's L2. */\nexport interface LighterSecureWithdrawalParams {\n /** Withdrawal amount in token units (e.g. \"1.5\" for 1.5 ETH). */\n amountTokenUnits: string\n /** The Lighter asset index (e.g. 1 for ETH, 3 for USDC). */\n assetIndex: number\n /**\n * 0 = perps / USDC collateral, 1 = spot. USDC shares asset index 3 across\n * both routes, so the route type is what selects Perps vs Spot.\n */\n routeType: LighterRouteType\n}\n\n/**\n * Lighter withdrawal, as the host configures it. Mirrors web's\n * `LighterWithdrawalConfig` (`@funkit/connect/clients/lighter`) so an\n * integrator's web and mobile wiring read the same.\n *\n * Passed on `WithdrawalFlowConfig.lighter`; its presence is what turns the\n * withdrawal flow's single crypto row into the Fast / Secure pair.\n */\nexport interface LighterWithdrawalFlowConfig {\n /**\n * The connected user's L1 address. The SDK resolves the L2 main-account\n * index from it \u2014 Lighter addresses accounts by index, not by address.\n */\n l1Address: Address\n /**\n * Host-built Lighter L2 signer, used by the Fast rail's relay adapter. The\n * SDK never holds L2 key material.\n */\n signerClient: LighterSigner\n /**\n * Submits the Secure withdrawal on Lighter's L2 and resolves with the L2 tx\n * hash. Funds bridge directly to Ethereum mainnet \u2014 no relay, no swap.\n */\n sendLighterSecureWithdrawal: (\n params: LighterSecureWithdrawalParams,\n ) => Promise<string>\n /**\n * Withdrawable balance for the selected source token, applied to both rails.\n * Lighter's own accounting \u2014 it must account for what the SDK cannot see\n * (margin requirements, locked collateral), so the integrator owns it.\n */\n withdrawalSourceTokenBalance?: (\n params: WithdrawalSourceTokenParams,\n ) => string | number\n /**\n * Minimum Secure withdrawal in token units. Takes the same\n * {@link WithdrawalSourceTokenParams} as every other source-token callback,\n * so the shape carries over to any venue rather than being symbol-only.\n * Perps and spot USDC stay distinguishable \u2014 they are separate source tokens\n * with their own addresses. Return `undefined` for the default.\n */\n getSecureMinWithdrawalAmount?: (\n params: WithdrawalSourceTokenParams,\n ) => number | undefined\n /**\n * Awaited after the user taps Withdraw but before either rail fetches a\n * nonce, prompts, or submits.\n *\n * Lighter strategies and withdrawals share one L2 signing account, so a\n * strategy still placing or cancelling orders bumps the nonce out from under\n * the withdrawal and the signed tx is rejected. Cancel in-flight strategies\n * here so the withdrawal signs against a stable nonce. Throw to abort \u2014 no\n * nonce is consumed.\n */\n onBeforeSign?: () => Promise<void> | void\n}\n", "import { type WithdrawalClient } from '@funkit/connect-core'\nimport { LIGHTER_FAST_MAX_WITHDRAWAL_USD } from '@funkit/connect-core/clients/lighter'\nimport { createLighterAdaptedWallet } from '@funkit/connect-core/clients/lighter'\nimport { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport type { Address } from 'viem'\n\nimport type { WithdrawalFlowConfig } from '../../src/flow/withdrawalFlowConfig'\nimport { logger } from '../../src/logging/logger'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\n\n/**\n * Lighter USDC Perps, addressed as relay does: the zero address maps to relay\n * asset '0' via `RELAY_LIGHTER_FUN_ADDRESS_MAP` in fun-relay.\n */\nconst LIGHTER_USDC_PERPS_ADDRESS =\n '0x0000000000000000000000000000000000000000' as Address\n\n/** Same id relay calls `RELAY_LIGHTER_CHAIN_ID`; the config carries it as a string. */\nconst LIGHTER_SOURCE_CHAIN_ID = `${LIGHTER_CHAIN_ID}`\n\n/** Fast is USDC-only, so web's USD floor is also its token-unit floor. */\nconst LIGHTER_FAST_MIN_WITHDRAWAL_USD = 4\n\n/**\n * Wraps the host's signer so `onBeforeSign` is awaited before the first\n * transfer. Lighter strategies and withdrawals share one L2 signing account, so\n * an in-flight strategy would bump the nonce out from under a Fast withdrawal\n * exactly as it would a Secure one. Throwing aborts before any nonce is used.\n */\nfunction withPreSignHook(\n signerClient: LighterWithdrawalFlowConfig['signerClient'],\n onBeforeSign: LighterWithdrawalFlowConfig['onBeforeSign'],\n): LighterWithdrawalFlowConfig['signerClient'] {\n if (!onBeforeSign) {\n return signerClient\n }\n return {\n ...signerClient,\n transfer: async (params) => {\n await onBeforeSign()\n return signerClient.transfer(params)\n },\n }\n}\n\n/**\n * A {@link WithdrawalClient} for Lighter Fast. Relay drives `adaptedWallet`\n * directly \u2014 the EVM members exist to satisfy the interface and to throw\n * loudly if something ever routes an EVM leg through this client, which for\n * Fast would mean signing on the wrong rail.\n *\n * `address()` is the L2 account index, not an EVM address: Lighter addresses\n * accounts by index, and that is what relay and the tracking row record.\n */\nexport function createLighterFastWithdrawalClient({\n signerClient,\n accountIndex,\n onBeforeSign,\n}: {\n signerClient: LighterWithdrawalFlowConfig['signerClient']\n accountIndex: string\n /**\n * Host hook awaited before the first L2 signature. Relay drives the adapter,\n * so the only point Fast controls is the signer itself.\n */\n onBeforeSign?: LighterWithdrawalFlowConfig['onBeforeSign']\n // The adapter is narrowed to Lighter's own wallet: the interface field is\n // relay's per-VM union, and callers of this client know which vm they got.\n}): WithdrawalClient & {\n adaptedWallet: ReturnType<typeof createLighterAdaptedWallet>\n} {\n // Fail here rather than let a NaN account index reach relay, where it\n // surfaces much later as an unattributable signing failure.\n if (!/^\\d+$/.test(accountIndex)) {\n throw new Error(\n `Lighter Fast needs a numeric account index, got: ${accountIndex}`,\n )\n }\n return {\n adaptedWallet: createLighterAdaptedWallet({\n signerClient: withPreSignHook(signerClient, onBeforeSign),\n accountIndex: Number(accountIndex),\n logger,\n chainId: LIGHTER_CHAIN_ID,\n }),\n address: () => accountIndex,\n getChainId: async () => LIGHTER_CHAIN_ID,\n // Lighter is single-chain \u2014 nothing to switch to.\n switchChain: async () => undefined,\n sendTransaction: async () => {\n throw new Error('Lighter Fast executes through its relay adapter')\n },\n confirmTransaction: async () => {\n throw new Error('Lighter Fast executes through its relay adapter')\n },\n }\n}\n\n/**\n * The withdrawal the crypto rail runs for Lighter Fast: USDC Perps out of the\n * user's L2 account, quoted and executed through Fun + Relay to any supported\n * destination. Port of web's `buildLighterFastWalletWithdrawalConfig`.\n *\n * Limits are web's USD numbers expressed in token units. Fast is USDC-only, so\n * the two are the same number; RN has no price feed yet, and a USD limit\n * without one is inert (see `withdrawal/validation.ts`).\n */\nexport function buildLighterFastWithdrawalConfig({\n config,\n lighter,\n accountIndex,\n isUnifiedTradingMode,\n}: {\n /** The host's withdrawal config \u2014 title and callbacks carry over. */\n config: WithdrawalFlowConfig\n lighter: LighterWithdrawalFlowConfig\n accountIndex: string\n /** Unified accounts hold one USDC balance, so the label drops \"(Perps)\". */\n isUnifiedTradingMode: boolean\n}): WithdrawalFlowConfig {\n const sourceToken = {\n chainId: LIGHTER_SOURCE_CHAIN_ID,\n address: LIGHTER_USDC_PERPS_ADDRESS,\n symbol: 'USDC',\n decimals: 6,\n }\n return {\n ...config,\n sourceToken,\n sourceTokens: [\n {\n token: sourceToken,\n label: isUnifiedTradingMode ? 'USDC' : 'USDC (Perps)',\n },\n ],\n withdrawalSourceTokenBalance: lighter.withdrawalSourceTokenBalance,\n defaultReceiveToken: 'USDC',\n withdrawalWallet: createLighterFastWithdrawalClient({\n signerClient: lighter.signerClient,\n accountIndex,\n onBeforeSign: lighter.onBeforeSign,\n }),\n // Both in token units, not USD: the price API can't resolve Lighter's\n // source (an L2 balance behind a pseudo-address), and a USD bound with no\n // price silently goes unenforced. Fast is USDC-only, so the numbers match.\n getMinWithdrawalAmount: () => LIGHTER_FAST_MIN_WITHDRAWAL_USD,\n getMaxWithdrawalAmount: () => LIGHTER_FAST_MAX_WITHDRAWAL_USD,\n }\n}\n", "import type { LighterAccountIndex } from '@funkit/api-base'\nimport { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { useLogOnce } from '@funkit/connect-core'\nimport { useLighterFastUnstakedFeeTokens } from '@funkit/connect-core/clients/lighter'\n\nimport { logger } from '../../src/logging/logger'\n\n/**\n * The Lighter Fast \"unstaked fee\": a flat deduction taken off the withdrawal\n * before quoting, waived for users staked at or above Lighter's own threshold.\n *\n * Reads Lighter's `transferFeeInfo` endpoint (via `useLighterFastUnstakedFeeTokens`)\n * rather than deriving the fee from share price locally \u2014 Lighter's backend\n * already knows the account's stake. `feeTokens` is 0 while the lookup is in\n * flight and for every non-Fast caller; a failed lookup fails closed to the\n * flat historical fee rather than 0. Callers must wait for `isFetched` before\n * quoting off `feeTokens` \u2014 see `quoteInputFeeSettled`.\n */\nexport function useLighterUnstakedFee({\n accountIndex,\n enabled,\n}: {\n accountIndex: string | undefined\n /** Fast only \u2014 Secure charges no such fee. */\n enabled: boolean\n}): {\n feeTokens: number\n /** `true` for a non-Fast caller: nothing to wait on. */\n isFetched: boolean\n} {\n const isEnabled = enabled && !!accountIndex\n const { feeTokens, isFetched, isError } = useLighterFastUnstakedFeeTokens({\n accountIndex: isEnabled ? (accountIndex as LighterAccountIndex) : undefined,\n enabled: isEnabled,\n chainId: LIGHTER_CHAIN_ID,\n })\n\n useLogOnce(\n isEnabled && isFetched\n ? `${accountIndex}|${isError}|${feeTokens}`\n : undefined,\n () => {\n if (isError) {\n // The fee is charged from Lighter's own view of the stake, which we\n // could not read \u2014 so it is applied blind and worth surfacing.\n logger.warn('lighter:fast:unstaked-fee:account-unavailable', {\n accountIndex,\n unstakedFeeTokens: feeTokens,\n })\n return\n }\n logger.info('lighter:fast:unstaked-fee:resolved', {\n accountIndex,\n unstakedFeeTokens: feeTokens,\n })\n },\n )\n\n return { feeTokens, isFetched: !isEnabled || isFetched }\n}\n", "import type {\n WithdrawalFlowConfig,\n WithdrawalMethodOption,\n} from '../../src/flow/withdrawalFlowConfig'\nimport { buildLighterFastWithdrawalConfig } from './lighterFastWithdrawal'\nimport { LIGHTER_FAST_METHOD_ID } from './lighterWithdrawalConfig'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\nimport { useLighterUnstakedFee } from './useLighterUnstakedFee'\nimport { useLighterWithdrawalMethods } from './useLighterWithdrawalMethods'\n\n/**\n * The Lighter methods to hand `beginWithdrawal`, each carrying the config it\n * runs. Mirrors web's `useLighterWithdrawalConfig`: the host calls this and\n * passes the result on, so the SDK never holds Lighter config.\n *\n * Empty until the L2 account resolves \u2014 both rails address the account by\n * index, so there is nothing to offer before then, and the flow falls back to\n * its generic crypto row.\n */\nexport function useLighterWithdrawal({\n lighter,\n config,\n}: {\n lighter: LighterWithdrawalFlowConfig | undefined\n /**\n * The host's own withdrawal config; title and callbacks carry over. Absent\n * until the host has one \u2014 a hook can't be called conditionally, so there is\n * no placeholder worth inventing.\n */\n config: WithdrawalFlowConfig | undefined\n}): WithdrawalMethodOption[] {\n const { methods, accountIndex, isUnifiedTradingMode } =\n useLighterWithdrawalMethods(lighter)\n // Fast only; Secure charges no such fee. Keyed off the row actually being\n // offered, so the two account lookups stay off the wire when it isn't.\n const isFastOffered = methods.some(\n (method) => method.id === LIGHTER_FAST_METHOD_ID,\n )\n const { feeTokens: quoteInputFeeTokens, isFetched: quoteInputFeeSettled } =\n useLighterUnstakedFee({\n accountIndex,\n enabled: isFastOffered,\n })\n\n if (!lighter || !config || !accountIndex) {\n return []\n }\n\n // Native Bridge is filtered out: its screens have not shipped, and a row\n // that fails on tap is worse than no row.\n return methods\n .filter((method) => method.id === LIGHTER_FAST_METHOD_ID)\n .map((method) => ({\n id: method.id,\n title: method.title,\n subtitle: method.subtitle,\n config: {\n ...buildLighterFastWithdrawalConfig({\n config,\n lighter,\n accountIndex,\n isUnifiedTradingMode,\n }),\n // Lighter takes this off the amount before it is quoted.\n quoteInputFeeTokens,\n quoteInputFeeSettled,\n },\n }))\n}\n", "import { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { isUserRejectedError } from '@funkit/connect-core'\nimport {\n type LighterRouteType,\n getLighterBaseSymbol,\n getLighterSecureL1Address,\n trackLighterSecureWithdrawal,\n} from '@funkit/connect-core/clients/lighter'\nimport { useCallback, useRef, useState } from 'react'\nimport type { Address } from 'viem'\n\nimport { useFunkitIdentity } from '../../src/providers/IdentityContext'\nimport { logger } from '../../src/logging/logger'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\n\n// Module-scoped: closing the sheet mid-withdrawal unmounts the hook, and the\n// fresh one a reopen mounts would know nothing about the in-flight submission.\nconst inFlightSecureWithdrawals = new Set<string>()\n\n/** What makes two presses the same withdrawal rather than two of them. */\nfunction secureWithdrawalKey({\n accountIndex,\n assetIndex,\n routeType,\n amountTokenUnits,\n}: {\n accountIndex: string\n assetIndex: number\n routeType: LighterRouteType\n amountTokenUnits: string\n}): string {\n return [accountIndex, assetIndex, routeType, amountTokenUnits].join('|')\n}\n\n/**\n * @internal Test-only: clear the process-wide in-flight set so suites that\n * reuse withdrawal details stay isolated. Not part of the public API.\n */\nexport function __resetInFlightSecureWithdrawals(): void {\n inFlightSecureWithdrawals.clear()\n}\n\nexport type LighterSecureSubmission =\n | { status: 'idle' }\n | { status: 'submitting' }\n | { status: 'submitted'; txHash: string; amountTokenUnits: string }\n // Carries the message, not the error: Lighter's SDK surfaces rate limits and\n // nonce collisions as plain strings the screen classifies for itself.\n | { status: 'failed'; message: string }\n\nexport interface UseLighterSecureWithdrawalParams {\n lighter: LighterWithdrawalFlowConfig\n /** The user's L2 main-account index \u2014 also the tracking key. */\n accountIndex: string | undefined\n /** Connected wallet: Secure locks the destination to it. */\n recipientAddress: Address\n}\n\n/**\n * Submits a Lighter Secure withdrawal: the host's L2 signer bridges the asset\n * to Ethereum 1:1, with no relay and no quote in the path. Fun is not in that\n * path, so the direct-execution row is attribution only and fire-and-forget.\n */\nexport function useLighterSecureWithdrawal({\n lighter,\n accountIndex,\n recipientAddress,\n}: UseLighterSecureWithdrawalParams) {\n const { apiKey } = useFunkitIdentity()\n const isSubmittingRef = useRef(false)\n const [submission, setSubmission] = useState<LighterSecureSubmission>({\n status: 'idle',\n })\n\n const submit = useCallback(\n async ({\n amountTokenUnits,\n assetIndex,\n routeType,\n sourceSymbol,\n withdrawalUSD,\n }: {\n amountTokenUnits: string\n /** Resolved from the account's asset list; never guessed. */\n assetIndex: number\n routeType: LighterRouteType\n /** May carry a ` (Spot)` suffix \u2014 tracking wants the base symbol. */\n sourceSymbol: string\n /** Token amount \u00D7 spot price, for attribution. '0' when unpriced. */\n withdrawalUSD: string\n }) => {\n if (!accountIndex) {\n // Neither rail can address the user without it; the screen blocks the\n // CTA on the same condition, so this is a belt-and-braces guard.\n logger.warn('lighter:withdrawal:secure:noAccountIndex')\n return\n }\n if (isSubmittingRef.current) {\n logger.warn('lighter:withdrawal:secure:already_submitting')\n return\n }\n const key = secureWithdrawalKey({\n accountIndex,\n assetIndex,\n routeType,\n amountTokenUnits,\n })\n if (inFlightSecureWithdrawals.has(key)) {\n logger.warn('lighter:withdrawal:secure:already_in_flight')\n return\n }\n isSubmittingRef.current = true\n inFlightSecureWithdrawals.add(key)\n setSubmission({ status: 'submitting' })\n\n let txHash: string\n try {\n // Lighter strategies and withdrawals share one L2 signing account, so\n // an in-flight strategy would bump the nonce out from under this.\n await lighter.onBeforeSign?.()\n\n logger.info('lighter:withdrawal:secure:start', {\n assetIndex,\n routeType,\n amountTokenUnits,\n destinationAddress: recipientAddress,\n })\n txHash = await lighter.sendLighterSecureWithdrawal({\n amountTokenUnits,\n assetIndex,\n routeType,\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n if (isUserRejectedError(error)) {\n // Declining is recoverable \u2014 the form stays as it was.\n logger.warn('lighter:withdrawal:secure:user_rejected')\n setSubmission({ status: 'idle' })\n return\n }\n // Recovered: the screen offers the on-chain fallback for a rate limit,\n // and a retry otherwise. Not an alertable ERROR.\n logger.warn('lighter:withdrawal:secure:failed', {\n error: message,\n assetIndex,\n routeType,\n })\n setSubmission({ status: 'failed', message })\n return\n } finally {\n isSubmittingRef.current = false\n inFlightSecureWithdrawals.delete(key)\n }\n\n logger.info('lighter:withdrawal:secure:submitted', {\n amountTokenUnits,\n assetIndex,\n routeType,\n txHash,\n })\n\n const mainnetTokenAddress = getLighterSecureL1Address(\n sourceSymbol,\n LIGHTER_CHAIN_ID,\n )\n if (mainnetTokenAddress) {\n // Fire-and-forget \u2014 never block the success screen on tracking.\n void trackLighterSecureWithdrawal({\n apiKey,\n logger,\n // Secure locks the destination to the connected wallet, so the L1\n // recipient address doubles as the userId for tracking purposes.\n userId: recipientAddress,\n txHash,\n recipientAddr: recipientAddress,\n assetIndex,\n l1TokenAddress: mainnetTokenAddress,\n amountTokenUnits,\n withdrawalUSD,\n chainId: LIGHTER_CHAIN_ID,\n })\n } else {\n // Attribution only, so a symbol we can't map is a monitoring problem,\n // not a user-facing one.\n logger.warn('lighter:withdrawal:secure:unknownMainnetToken', {\n sourceSymbol: getLighterBaseSymbol(sourceSymbol),\n txHash,\n })\n }\n\n setSubmission({ status: 'submitted', txHash, amountTokenUnits })\n },\n [apiKey, accountIndex, lighter, recipientAddress],\n )\n\n const reset = useCallback(() => setSubmission({ status: 'idle' }), [])\n\n return { submission, submit, reset }\n}\n"],
4
+ "sourcesContent": ["import { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { useLighterAccountsQuery } from '@funkit/connect-core'\nimport { getLighterWithdrawalDelay } from '@funkit/connect-core/clients/lighter'\nimport { useQuery } from '@tanstack/react-query'\nimport type { TFunction } from 'i18next'\nimport { useEffect, useRef } from 'react'\n\nimport { logger } from '../../src/logging/logger'\nimport { useFunkitTranslation } from '../../src/providers/FunkitI18nProvider'\nimport {\n LIGHTER_FAST_METHOD_ID,\n LIGHTER_SECURE_METHOD_ID,\n type LighterWithdrawalFlowConfig,\n} from './lighterWithdrawalConfig'\n\n/** One row on the withdrawal method screen, before icons are attached. */\nexport interface LighterWithdrawalMethod {\n id: typeof LIGHTER_FAST_METHOD_ID | typeof LIGHTER_SECURE_METHOD_ID\n title: string\n subtitle: string\n}\n\nexport interface UseLighterWithdrawalMethodsResult {\n /** Fast then Secure, in web's order. Empty until the account resolves. */\n methods: LighterWithdrawalMethod[]\n /**\n * The user's Lighter L2 main-account index. Both rails address the account\n * by index, so neither can run before this resolves.\n */\n accountIndex: string | undefined\n /** Unified accounts hold one USDC balance \u2014 no spot/perps split. */\n isUnifiedTradingMode: boolean\n /** The account lookup is in flight; rows are expected to be empty. */\n isLoading: boolean\n}\n\nconst SECONDS_PER_MINUTE = 60\nconst MINUTES_PER_HOUR = 60\nconst SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR\n\n/**\n * Formats Lighter's live L2\u2192L1 delay for the Secure row (e.g. \"1 h 50 min\").\n * - Reproduces web's `formatSecondsToReadableForm(seconds, false, true)` output\n * for every input, including its two oddities: a sub-minute delay reads in\n * seconds, and exactly one hour reads \"60 min\". The two SDKs quote the same\n * bridge, so they must not disagree on the wait.\n * - Rounds up otherwise: an estimate must not promise finality early.\n * - One literal `t` key per shape \u2014 never a computed key.\n */\nfunction formatDelay(t: TFunction, seconds: number): string {\n const normalized = Math.ceil(seconds)\n if (normalized === 1) {\n return t('withdrawLighter.delaySecond')\n }\n if (normalized <= SECONDS_PER_MINUTE) {\n return t('withdrawLighter.delaySeconds', { seconds: normalized })\n }\n // Round to minutes first: rounding the remainder alone can yield \"1 h 60 min\".\n const minutes = Math.ceil(normalized / SECONDS_PER_MINUTE) % MINUTES_PER_HOUR\n const hours = Math.ceil(\n (normalized - minutes * SECONDS_PER_MINUTE) / SECONDS_PER_HOUR,\n )\n if (hours === 1 && minutes === 0) {\n return t('withdrawLighter.delayMinutes', { minutes: MINUTES_PER_HOUR })\n }\n if (hours > 0 && minutes > 0) {\n return t('withdrawLighter.delayHoursMinutes', { hours, minutes })\n }\n if (hours > 0) {\n return t('withdrawLighter.delayHours', { hours })\n }\n return t('withdrawLighter.delayMinutes', { minutes })\n}\n\n/**\n * Secure-withdrawal delay as display copy. Shown live because it tracks L2\u2192L1\n * batch cadence; `undefined` until it loads.\n */\nfunction useLighterSecureDelayText(enabled: boolean): string | undefined {\n const { t } = useFunkitTranslation()\n const { data } = useQuery({\n queryKey: ['lighterWithdrawalDelay', LIGHTER_CHAIN_ID],\n queryFn: () => getLighterWithdrawalDelay(LIGHTER_CHAIN_ID),\n // This hook runs for every withdrawal flow, Lighter or not \u2014 a host with no\n // Lighter config must never reach Lighter's API.\n enabled,\n staleTime: 60_000,\n retry: 2,\n })\n const seconds = data?.seconds\n if (seconds === undefined || !Number.isFinite(seconds) || seconds <= 0) {\n return undefined\n }\n return formatDelay(t, seconds)\n}\n\ntype RailOutcome = 'not_configured' | 'loading' | 'offered' | 'no_account_index'\n\n/**\n * Whether Lighter's rails replace the generic crypto row, and why not when they\n * don't.\n * - `isFetched`, not `isLoading`: the latter is false on the first render,\n * before the query starts, which would record a premature \"no account\".\n */\nfunction resolveRailOutcome({\n isConfigured,\n isFetched,\n hasAccountIndex,\n}: {\n isConfigured: boolean\n isFetched: boolean\n hasAccountIndex: boolean\n}): RailOutcome {\n if (!isConfigured) {\n return 'not_configured'\n }\n if (!isFetched) {\n return 'loading'\n }\n if (!hasAccountIndex) {\n return 'no_account_index'\n }\n return 'offered'\n}\n\n/**\n * The Fast / Secure rows plus the account state both rails need. Port of the\n * row-building half of web's `useLighterWithdrawalConfig`.\n *\n * Pass `undefined` when the host configured no Lighter: the inner hooks still\n * run (Rules of Hooks) but every query stays disabled.\n */\nexport function useLighterWithdrawalMethods(\n config: LighterWithdrawalFlowConfig | undefined,\n): UseLighterWithdrawalMethodsResult {\n const { t } = useFunkitTranslation()\n const { mainAccountIndex, isUnifiedTradingMode, isLoading, isFetched } =\n useLighterAccountsQuery({\n address: config?.l1Address,\n chainId: LIGHTER_CHAIN_ID,\n })\n const secureDelayText = useLighterSecureDelayText(!!config)\n\n // Lighter addresses accounts by a numeric index; anything else means the\n // lookup returned something unusable and neither rail can address the user.\n const accountIndex =\n mainAccountIndex && /^\\d+$/.test(mainAccountIndex)\n ? mainAccountIndex\n : undefined\n\n const outcome = resolveRailOutcome({\n isConfigured: !!config,\n isFetched,\n hasAccountIndex: !!accountIndex,\n })\n // Rail-availability decision point, recorded once per outcome so a re-render\n // or a background refetch doesn't re-emit the same one.\n const loggedOutcome = useRef<RailOutcome | undefined>(undefined)\n useEffect(() => {\n if (outcome === 'loading' || loggedOutcome.current === outcome) {\n return\n }\n loggedOutcome.current = outcome\n if (outcome === 'not_configured') {\n return\n }\n const payload = {\n outcome,\n isUnifiedTradingMode,\n hasAccountIndex: !!accountIndex,\n }\n if (outcome === 'no_account_index') {\n // Recovered, but the user loses Lighter's rails for this session \u2014 that\n // is a visible capability change, so it belongs above INFO.\n logger.warn('lighter:withdrawal:rails', payload)\n return\n }\n logger.info('lighter:withdrawal:rails', payload)\n }, [outcome, isUnifiedTradingMode, accountIndex])\n\n const methods: LighterWithdrawalMethod[] =\n config && accountIndex\n ? [\n {\n id: LIGHTER_FAST_METHOD_ID,\n title: t('withdrawLighter.methodFast'),\n subtitle: isUnifiedTradingMode\n ? t('withdrawLighter.fastDisclaimerUnified')\n : t('withdrawLighter.fastDisclaimer'),\n },\n {\n id: LIGHTER_SECURE_METHOD_ID,\n title: t('withdrawLighter.methodSecure'),\n subtitle: t('withdrawLighter.secureDisclaimer', {\n // Until the live value loads, show the localized \"60+ minutes\"\n // historical estimate. The \"+\" lives in the per-locale fallback\n // string so it doesn't bleed into live values, which are exact.\n delay:\n secureDelayText ?? t('withdrawLighter.secureFallbackDelay'),\n }),\n },\n ]\n : []\n\n return {\n methods,\n accountIndex,\n isUnifiedTradingMode,\n isLoading: !!config && isLoading,\n }\n}\n", "import type { LighterRouteType } from '@funkit/connect-core/clients/lighter'\nimport type { LighterSigner } from '@funkit/connect-core/clients/lighter'\nimport type { Address } from 'viem'\n\nimport type { WithdrawalSourceTokenParams } from '../../src/flow/withdrawalFlowConfig'\n\n/** Stable ids for the two rails \u2014 used for row identity, routing and logs. */\nexport const LIGHTER_FAST_METHOD_ID = 'lighter-fast'\nexport const LIGHTER_SECURE_METHOD_ID = 'lighter-secure'\n\n/** What the host must implement to submit a Secure withdrawal on Lighter's L2. */\nexport interface LighterSecureWithdrawalParams {\n /** Withdrawal amount in token units (e.g. \"1.5\" for 1.5 ETH). */\n amountTokenUnits: string\n /** The Lighter asset index (e.g. 1 for ETH, 3 for USDC). */\n assetIndex: number\n /**\n * 0 = perps / USDC collateral, 1 = spot. USDC shares asset index 3 across\n * both routes, so the route type is what selects Perps vs Spot.\n */\n routeType: LighterRouteType\n}\n\n/**\n * Lighter withdrawal, as the host configures it. Mirrors web's\n * `LighterWithdrawalConfig` (`@funkit/connect/clients/lighter`) so an\n * integrator's web and mobile wiring read the same.\n *\n * Passed on `WithdrawalFlowConfig.lighter`; its presence is what turns the\n * withdrawal flow's single crypto row into the Fast / Secure pair.\n */\nexport interface LighterWithdrawalFlowConfig {\n /**\n * The connected user's L1 address. The SDK resolves the L2 main-account\n * index from it \u2014 Lighter addresses accounts by index, not by address.\n */\n l1Address: Address\n /**\n * Host-built Lighter L2 signer, used by the Fast rail's relay adapter. The\n * SDK never holds L2 key material.\n */\n signerClient: LighterSigner\n /**\n * Submits the Secure withdrawal on Lighter's L2 and resolves with the L2 tx\n * hash. Funds bridge directly to Ethereum mainnet \u2014 no relay, no swap.\n */\n sendLighterSecureWithdrawal: (\n params: LighterSecureWithdrawalParams,\n ) => Promise<string>\n /**\n * Withdrawable balance for the selected source token, applied to both rails.\n * Lighter's own accounting \u2014 it must account for what the SDK cannot see\n * (margin requirements, locked collateral), so the integrator owns it.\n */\n withdrawalSourceTokenBalance?: (\n params: WithdrawalSourceTokenParams,\n ) => string | number\n /**\n * Minimum Secure withdrawal in token units. Takes the same\n * {@link WithdrawalSourceTokenParams} as every other source-token callback,\n * so the shape carries over to any venue rather than being symbol-only.\n * Perps and spot USDC stay distinguishable \u2014 they are separate source tokens\n * with their own addresses. Return `undefined` for the default.\n */\n getSecureMinWithdrawalAmount?: (\n params: WithdrawalSourceTokenParams,\n ) => number | undefined\n /**\n * Awaited after the user taps Withdraw but before either rail fetches a\n * nonce, prompts, or submits.\n *\n * Lighter strategies and withdrawals share one L2 signing account, so a\n * strategy still placing or canceling orders bumps the nonce out from under\n * the withdrawal and the signed tx is rejected. Cancel in-flight strategies\n * here so the withdrawal signs against a stable nonce. Throw to abort \u2014 no\n * nonce is consumed.\n */\n onBeforeSign?: () => Promise<void> | void\n}\n", "import { type WithdrawalClient } from '@funkit/connect-core'\nimport { LIGHTER_FAST_MAX_WITHDRAWAL_USD } from '@funkit/connect-core/clients/lighter'\nimport { createLighterAdaptedWallet } from '@funkit/connect-core/clients/lighter'\nimport { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport type { Address } from 'viem'\n\nimport type { WithdrawalFlowConfig } from '../../src/flow/withdrawalFlowConfig'\nimport { logger } from '../../src/logging/logger'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\n\n/**\n * Lighter USDC Perps, addressed as relay does: the zero address maps to relay\n * asset '0' via `RELAY_LIGHTER_FUN_ADDRESS_MAP` in fun-relay.\n */\nconst LIGHTER_USDC_PERPS_ADDRESS =\n '0x0000000000000000000000000000000000000000' as Address\n\n/** Same id relay calls `RELAY_LIGHTER_CHAIN_ID`; the config carries it as a string. */\nconst LIGHTER_SOURCE_CHAIN_ID = `${LIGHTER_CHAIN_ID}`\n\n/** Fast is USDC-only, so web's USD floor is also its token-unit floor. */\nconst LIGHTER_FAST_MIN_WITHDRAWAL_USD = 4\n\n/**\n * Wraps the host's signer so `onBeforeSign` is awaited before the first\n * transfer. Lighter strategies and withdrawals share one L2 signing account, so\n * an in-flight strategy would bump the nonce out from under a Fast withdrawal\n * exactly as it would a Secure one. Throwing aborts before any nonce is used.\n */\nfunction withPreSignHook(\n signerClient: LighterWithdrawalFlowConfig['signerClient'],\n onBeforeSign: LighterWithdrawalFlowConfig['onBeforeSign'],\n): LighterWithdrawalFlowConfig['signerClient'] {\n if (!onBeforeSign) {\n return signerClient\n }\n return {\n ...signerClient,\n transfer: async (params) => {\n await onBeforeSign()\n return signerClient.transfer(params)\n },\n }\n}\n\n/**\n * A {@link WithdrawalClient} for Lighter Fast. Relay drives `adaptedWallet`\n * directly \u2014 the EVM members exist to satisfy the interface and to throw\n * loudly if something ever routes an EVM leg through this client, which for\n * Fast would mean signing on the wrong rail.\n *\n * `address()` is the L2 account index, not an EVM address: Lighter addresses\n * accounts by index, and that is what relay and the tracking row record.\n */\nexport function createLighterFastWithdrawalClient({\n signerClient,\n accountIndex,\n onBeforeSign,\n}: {\n signerClient: LighterWithdrawalFlowConfig['signerClient']\n accountIndex: string\n /**\n * Host hook awaited before the first L2 signature. Relay drives the adapter,\n * so the only point Fast controls is the signer itself.\n */\n onBeforeSign?: LighterWithdrawalFlowConfig['onBeforeSign']\n // The adapter is narrowed to Lighter's own wallet: the interface field is\n // relay's per-VM union, and callers of this client know which vm they got.\n}): WithdrawalClient & {\n adaptedWallet: ReturnType<typeof createLighterAdaptedWallet>\n} {\n // Fail here rather than let a NaN account index reach relay, where it\n // surfaces much later as an unattributable signing failure.\n if (!/^\\d+$/.test(accountIndex)) {\n throw new Error(\n `Lighter Fast needs a numeric account index, got: ${accountIndex}`,\n )\n }\n return {\n adaptedWallet: createLighterAdaptedWallet({\n signerClient: withPreSignHook(signerClient, onBeforeSign),\n accountIndex: Number(accountIndex),\n logger,\n chainId: LIGHTER_CHAIN_ID,\n }),\n address: () => accountIndex,\n getChainId: async () => LIGHTER_CHAIN_ID,\n // Lighter is single-chain \u2014 nothing to switch to.\n switchChain: async () => undefined,\n sendTransaction: async () => {\n throw new Error('Lighter Fast executes through its relay adapter')\n },\n confirmTransaction: async () => {\n throw new Error('Lighter Fast executes through its relay adapter')\n },\n }\n}\n\n/**\n * The withdrawal the crypto rail runs for Lighter Fast: USDC Perps out of the\n * user's L2 account, quoted and executed through Fun + Relay to any supported\n * destination. Port of web's `buildLighterFastWalletWithdrawalConfig`.\n *\n * Limits are web's USD numbers expressed in token units. Fast is USDC-only, so\n * the two are the same number; RN has no price feed yet, and a USD limit\n * without one is inert (see `withdrawal/validation.ts`).\n */\nexport function buildLighterFastWithdrawalConfig({\n config,\n lighter,\n accountIndex,\n isUnifiedTradingMode,\n}: {\n /** The host's withdrawal config \u2014 title and callbacks carry over. */\n config: WithdrawalFlowConfig\n lighter: LighterWithdrawalFlowConfig\n accountIndex: string\n /** Unified accounts hold one USDC balance, so the label drops \"(Perps)\". */\n isUnifiedTradingMode: boolean\n}): WithdrawalFlowConfig {\n const sourceToken = {\n chainId: LIGHTER_SOURCE_CHAIN_ID,\n address: LIGHTER_USDC_PERPS_ADDRESS,\n symbol: 'USDC',\n decimals: 6,\n }\n return {\n ...config,\n sourceToken,\n sourceTokens: [\n {\n token: sourceToken,\n label: isUnifiedTradingMode ? 'USDC' : 'USDC (Perps)',\n },\n ],\n withdrawalSourceTokenBalance: lighter.withdrawalSourceTokenBalance,\n defaultReceiveToken: 'USDC',\n withdrawalWallet: createLighterFastWithdrawalClient({\n signerClient: lighter.signerClient,\n accountIndex,\n onBeforeSign: lighter.onBeforeSign,\n }),\n // Both in token units, not USD: the price API can't resolve Lighter's\n // source (an L2 balance behind a pseudo-address), and a USD bound with no\n // price silently goes unenforced. Fast is USDC-only, so the numbers match.\n getMinWithdrawalAmount: () => LIGHTER_FAST_MIN_WITHDRAWAL_USD,\n getMaxWithdrawalAmount: () => LIGHTER_FAST_MAX_WITHDRAWAL_USD,\n }\n}\n", "import type { LighterAccountIndex } from '@funkit/api-base'\nimport { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { useLogOnce } from '@funkit/connect-core'\nimport { useLighterFastUnstakedFeeTokens } from '@funkit/connect-core/clients/lighter'\n\nimport { logger } from '../../src/logging/logger'\n\n/**\n * The Lighter Fast \"unstaked fee\": a flat deduction taken off the withdrawal\n * before quoting, waived for users staked at or above Lighter's own threshold.\n *\n * Reads Lighter's `transferFeeInfo` endpoint (via `useLighterFastUnstakedFeeTokens`)\n * rather than deriving the fee from share price locally \u2014 Lighter's backend\n * already knows the account's stake. `feeTokens` is 0 while the lookup is in\n * flight and for every non-Fast caller; a failed lookup fails closed to the\n * flat historical fee rather than 0. Callers must wait for `isFetched` before\n * quoting off `feeTokens` \u2014 see `quoteInputFeeSettled`.\n */\nexport function useLighterUnstakedFee({\n accountIndex,\n enabled,\n}: {\n accountIndex: string | undefined\n /** Fast only \u2014 Secure charges no such fee. */\n enabled: boolean\n}): {\n feeTokens: number\n /** `true` for a non-Fast caller: nothing to wait on. */\n isFetched: boolean\n} {\n const isEnabled = enabled && !!accountIndex\n const { feeTokens, isFetched, isError } = useLighterFastUnstakedFeeTokens({\n accountIndex: isEnabled ? (accountIndex as LighterAccountIndex) : undefined,\n enabled: isEnabled,\n chainId: LIGHTER_CHAIN_ID,\n })\n\n useLogOnce(\n isEnabled && isFetched\n ? `${accountIndex}|${isError}|${feeTokens}`\n : undefined,\n () => {\n if (isError) {\n // The fee is charged from Lighter's own view of the stake, which we\n // could not read \u2014 so it is applied blind and worth surfacing.\n logger.warn('lighter:fast:unstaked-fee:account-unavailable', {\n accountIndex,\n unstakedFeeTokens: feeTokens,\n })\n return\n }\n logger.info('lighter:fast:unstaked-fee:resolved', {\n accountIndex,\n unstakedFeeTokens: feeTokens,\n })\n },\n )\n\n return { feeTokens, isFetched: !isEnabled || isFetched }\n}\n", "import type {\n WithdrawalFlowConfig,\n WithdrawalMethodOption,\n} from '../../src/flow/withdrawalFlowConfig'\nimport { buildLighterFastWithdrawalConfig } from './lighterFastWithdrawal'\nimport { LIGHTER_FAST_METHOD_ID } from './lighterWithdrawalConfig'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\nimport { useLighterUnstakedFee } from './useLighterUnstakedFee'\nimport { useLighterWithdrawalMethods } from './useLighterWithdrawalMethods'\n\n/**\n * The Lighter methods to hand `beginWithdrawal`, each carrying the config it\n * runs. Mirrors web's `useLighterWithdrawalConfig`: the host calls this and\n * passes the result on, so the SDK never holds Lighter config.\n *\n * Empty until the L2 account resolves \u2014 both rails address the account by\n * index, so there is nothing to offer before then, and the flow falls back to\n * its generic crypto row.\n */\nexport function useLighterWithdrawal({\n lighter,\n config,\n}: {\n lighter: LighterWithdrawalFlowConfig | undefined\n /**\n * The host's own withdrawal config; title and callbacks carry over. Absent\n * until the host has one \u2014 a hook can't be called conditionally, so there is\n * no placeholder worth inventing.\n */\n config: WithdrawalFlowConfig | undefined\n}): WithdrawalMethodOption[] {\n const { methods, accountIndex, isUnifiedTradingMode } =\n useLighterWithdrawalMethods(lighter)\n // Fast only; Secure charges no such fee. Keyed off the row actually being\n // offered, so the two account lookups stay off the wire when it isn't.\n const isFastOffered = methods.some(\n (method) => method.id === LIGHTER_FAST_METHOD_ID,\n )\n const { feeTokens: quoteInputFeeTokens, isFetched: quoteInputFeeSettled } =\n useLighterUnstakedFee({\n accountIndex,\n enabled: isFastOffered,\n })\n\n if (!lighter || !config || !accountIndex) {\n return []\n }\n\n // Native Bridge is filtered out: its screens have not shipped, and a row\n // that fails on tap is worse than no row.\n return methods\n .filter((method) => method.id === LIGHTER_FAST_METHOD_ID)\n .map((method) => ({\n id: method.id,\n title: method.title,\n subtitle: method.subtitle,\n config: {\n ...buildLighterFastWithdrawalConfig({\n config,\n lighter,\n accountIndex,\n isUnifiedTradingMode,\n }),\n // Lighter takes this off the amount before it is quoted.\n quoteInputFeeTokens,\n quoteInputFeeSettled,\n },\n }))\n}\n", "import { LIGHTER_CHAIN_ID } from '@funkit/chains'\nimport { isUserRejectedError } from '@funkit/connect-core'\nimport {\n type LighterRouteType,\n getLighterBaseSymbol,\n getLighterSecureL1Address,\n trackLighterSecureWithdrawal,\n} from '@funkit/connect-core/clients/lighter'\nimport { useCallback, useRef, useState } from 'react'\nimport type { Address } from 'viem'\n\nimport { useFunkitIdentity } from '../../src/providers/IdentityContext'\nimport { logger } from '../../src/logging/logger'\nimport type { LighterWithdrawalFlowConfig } from './lighterWithdrawalConfig'\n\n// Module-scoped: closing the sheet mid-withdrawal unmounts the hook, and the\n// fresh one a reopen mounts would know nothing about the in-flight submission.\nconst inFlightSecureWithdrawals = new Set<string>()\n\n/** What makes two presses the same withdrawal rather than two of them. */\nfunction secureWithdrawalKey({\n accountIndex,\n assetIndex,\n routeType,\n amountTokenUnits,\n}: {\n accountIndex: string\n assetIndex: number\n routeType: LighterRouteType\n amountTokenUnits: string\n}): string {\n return [accountIndex, assetIndex, routeType, amountTokenUnits].join('|')\n}\n\n/**\n * @internal Test-only: clear the process-wide in-flight set so suites that\n * reuse withdrawal details stay isolated. Not part of the public API.\n */\nexport function __resetInFlightSecureWithdrawals(): void {\n inFlightSecureWithdrawals.clear()\n}\n\nexport type LighterSecureSubmission =\n | { status: 'idle' }\n | { status: 'submitting' }\n | { status: 'submitted'; txHash: string; amountTokenUnits: string }\n // Carries the message, not the error: Lighter's SDK surfaces rate limits and\n // nonce collisions as plain strings the screen classifies for itself.\n | { status: 'failed'; message: string }\n\nexport interface UseLighterSecureWithdrawalParams {\n lighter: LighterWithdrawalFlowConfig\n /** The user's L2 main-account index \u2014 also the tracking key. */\n accountIndex: string | undefined\n /** Connected wallet: Secure locks the destination to it. */\n recipientAddress: Address\n}\n\n/**\n * Submits a Lighter Secure withdrawal: the host's L2 signer bridges the asset\n * to Ethereum 1:1, with no relay and no quote in the path. Fun is not in that\n * path, so the direct-execution row is attribution only and fire-and-forget.\n */\nexport function useLighterSecureWithdrawal({\n lighter,\n accountIndex,\n recipientAddress,\n}: UseLighterSecureWithdrawalParams) {\n const { apiKey } = useFunkitIdentity()\n const isSubmittingRef = useRef(false)\n const [submission, setSubmission] = useState<LighterSecureSubmission>({\n status: 'idle',\n })\n\n const submit = useCallback(\n async ({\n amountTokenUnits,\n assetIndex,\n routeType,\n sourceSymbol,\n withdrawalUSD,\n }: {\n amountTokenUnits: string\n /** Resolved from the account's asset list; never guessed. */\n assetIndex: number\n routeType: LighterRouteType\n /** May carry a ` (Spot)` suffix \u2014 tracking wants the base symbol. */\n sourceSymbol: string\n /** Token amount \u00D7 spot price, for attribution. '0' when unpriced. */\n withdrawalUSD: string\n }) => {\n if (!accountIndex) {\n // Neither rail can address the user without it; the screen blocks the\n // CTA on the same condition, so this is a belt-and-braces guard.\n logger.warn('lighter:withdrawal:secure:noAccountIndex')\n return\n }\n if (isSubmittingRef.current) {\n logger.warn('lighter:withdrawal:secure:already_submitting')\n return\n }\n const key = secureWithdrawalKey({\n accountIndex,\n assetIndex,\n routeType,\n amountTokenUnits,\n })\n if (inFlightSecureWithdrawals.has(key)) {\n logger.warn('lighter:withdrawal:secure:already_in_flight')\n return\n }\n isSubmittingRef.current = true\n inFlightSecureWithdrawals.add(key)\n setSubmission({ status: 'submitting' })\n\n let txHash: string\n try {\n // Lighter strategies and withdrawals share one L2 signing account, so\n // an in-flight strategy would bump the nonce out from under this.\n await lighter.onBeforeSign?.()\n\n logger.info('lighter:withdrawal:secure:start', {\n assetIndex,\n routeType,\n amountTokenUnits,\n destinationAddress: recipientAddress,\n })\n txHash = await lighter.sendLighterSecureWithdrawal({\n amountTokenUnits,\n assetIndex,\n routeType,\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n if (isUserRejectedError(error)) {\n // Declining is recoverable \u2014 the form stays as it was.\n logger.warn('lighter:withdrawal:secure:user_rejected')\n setSubmission({ status: 'idle' })\n return\n }\n // Recovered: the screen offers the on-chain fallback for a rate limit,\n // and a retry otherwise. Not an alertable ERROR.\n logger.warn('lighter:withdrawal:secure:failed', {\n error: message,\n assetIndex,\n routeType,\n })\n setSubmission({ status: 'failed', message })\n return\n } finally {\n isSubmittingRef.current = false\n inFlightSecureWithdrawals.delete(key)\n }\n\n logger.info('lighter:withdrawal:secure:submitted', {\n amountTokenUnits,\n assetIndex,\n routeType,\n txHash,\n })\n\n const mainnetTokenAddress = getLighterSecureL1Address(\n sourceSymbol,\n LIGHTER_CHAIN_ID,\n )\n if (mainnetTokenAddress) {\n // Fire-and-forget \u2014 never block the success screen on tracking.\n void trackLighterSecureWithdrawal({\n apiKey,\n logger,\n // Secure locks the destination to the connected wallet, so the L1\n // recipient address doubles as the userId for tracking purposes.\n userId: recipientAddress,\n txHash,\n recipientAddr: recipientAddress,\n assetIndex,\n l1TokenAddress: mainnetTokenAddress,\n amountTokenUnits,\n withdrawalUSD,\n chainId: LIGHTER_CHAIN_ID,\n })\n } else {\n // Attribution only, so a symbol we can't map is a monitoring problem,\n // not a user-facing one.\n logger.warn('lighter:withdrawal:secure:unknownMainnetToken', {\n sourceSymbol: getLighterBaseSymbol(sourceSymbol),\n txHash,\n })\n }\n\n setSubmission({ status: 'submitted', txHash, amountTokenUnits })\n },\n [apiKey, accountIndex, lighter, recipientAddress],\n )\n\n const reset = useCallback(() => setSubmission({ status: 'idle' }), [])\n\n return { submission, submit, reset }\n}\n"],
5
5
  "mappings": ";;;;;;;;;AAAA,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAC1C,SAAS,gBAAgB;AAEzB,SAAS,WAAW,cAAc;;;ACE3B,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;;;AD4BxC,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AACzB,IAAM,mBAAmB,qBAAqB;AAW9C,SAAS,YAAY,GAAc,SAAyB;AAC1D,QAAM,aAAa,KAAK,KAAK,OAAO;AACpC,MAAI,eAAe,GA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KAAK,iDAAiD;AAAA,UAC3D,cAAc,qBAAqB,YAAY;AAAA,UAC/C;AAAA,QACF,CAAC;AAAA,MACH;AAEA,oBAAc,EAAE,QAAQ,aAAa,QAAQ,iBAAiB,CAAC;AAAA,IACjE;AAAA,IACA,CAAC,QAAQ,cAAc,SAAS,gBAAgB;AAAA,EAClD;AAEA,QAAM,QAAQ,YAAY,MAAM,cAAc,EAAE,QAAQ,OAAO,CAAC,GAAG,CAAC,CAAC;AAErE,SAAO,EAAE,YAAY,QAAQ,MAAM;AACrC;",
6
6
  "names": ["LIGHTER_CHAIN_ID", "LIGHTER_CHAIN_ID", "LIGHTER_CHAIN_ID", "LIGHTER_CHAIN_ID", "LIGHTER_CHAIN_ID", "useRef", "useRef", "LIGHTER_CHAIN_ID"]
7
7
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  useSourceTokenUsdPrice
3
- } from "../chunk-Q74I4SOP.js";
3
+ } from "../chunk-5QHEW234.js";
4
4
  import {
5
5
  i18n,
6
6
  useFunkitTranslation
7
- } from "../chunk-GOFKXSDM.js";
7
+ } from "../chunk-HXOQOPQY.js";
8
8
  import {
9
9
  logger
10
10
  } from "../chunk-2HFFVYAZ.js";
package/dist/index.d.ts CHANGED
@@ -36,6 +36,8 @@ export { MOONPAY_METHOD_IDS } from './src/flow/depositFlowConfig';
36
36
  export type { FunkitFlowError, FunkitFlowErrorCode } from './src/flow/flowError';
37
37
  export { FunkitFeatureDisabledError, FunkitMisconfiguredError, } from './src/flow/flowError';
38
38
  export { useFunkitPurchaseSheetEnabled } from './src/flow/useFunkitPurchaseSheetEnabled';
39
+ export { useFunkitDepositWallet } from './src/flow/useFunkitDepositWallet';
40
+ export type { WalletPaymentMethod } from './src/flow/walletMethods';
39
41
  export type { CustomWithdrawalSubmission, FiatWithdrawalSubmission, FiatWithdrawalSubmissionResult, WithdrawalFlowCallbacks, WithdrawalFlowConfig, WithdrawalMethodOption, WithdrawalSourceTokenOption, WithdrawalSourceTokenParams, WithdrawalToken, } from './src/flow/withdrawalFlowConfig';
40
42
  export type { PaymentMethodOption, ReceiveTokenOption, } from './src/screens/SelectMethodScreen';
41
43
  export type { ChainOption } from './src/flow/depositFlowConfig';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAmBA,YAAY,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAI7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGhE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGpD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAG/E,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