@funkit/connect-rn 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +72 -0
  2. package/dist/index.d.ts +11 -8
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3595 -612
  5. package/dist/index.js.map +4 -4
  6. package/dist/src/flow/AddressCopiedToast.d.ts +18 -0
  7. package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -0
  8. package/dist/src/flow/FlowSheet.d.ts +47 -0
  9. package/dist/src/flow/FlowSheet.d.ts.map +1 -0
  10. package/dist/src/flow/FunkitFlowProvider.d.ts +23 -0
  11. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -0
  12. package/dist/src/flow/depositFlowConfig.d.ts +101 -0
  13. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -0
  14. package/dist/src/flow/useKeyboardHeight.d.ts +21 -0
  15. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -0
  16. package/dist/src/geo/isCountryBlocked.d.ts +3 -0
  17. package/dist/src/geo/isCountryBlocked.d.ts.map +1 -0
  18. package/dist/src/geo/useCheckoutBlocked.d.ts +10 -0
  19. package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -0
  20. package/dist/src/geo/useUserIpInfo.d.ts +22 -0
  21. package/dist/src/geo/useUserIpInfo.d.ts.map +1 -0
  22. package/dist/src/icons/CopyAddressIcon.d.ts +9 -0
  23. package/dist/src/icons/CopyAddressIcon.d.ts.map +1 -0
  24. package/dist/src/icons/CryptoBitcoinIcon.d.ts +9 -0
  25. package/dist/src/icons/CryptoBitcoinIcon.d.ts.map +1 -0
  26. package/dist/src/icons/CryptoTransferQRIcon.d.ts +9 -0
  27. package/dist/src/icons/CryptoTransferQRIcon.d.ts.map +1 -0
  28. package/dist/src/icons/FigmaSystemIcons.d.ts +19 -0
  29. package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -0
  30. package/dist/src/icons/FunIcon.d.ts +18 -0
  31. package/dist/src/icons/FunIcon.d.ts.map +1 -0
  32. package/dist/src/icons/PaymentBrandIcons.d.ts +24 -0
  33. package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -0
  34. package/dist/src/icons/QrChainCluster.d.ts +22 -0
  35. package/dist/src/icons/QrChainCluster.d.ts.map +1 -0
  36. package/dist/src/icons/SourceTokenCluster.d.ts +31 -0
  37. package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -0
  38. package/dist/src/icons/TokenChainIcon.d.ts +19 -0
  39. package/dist/src/icons/TokenChainIcon.d.ts.map +1 -0
  40. package/dist/src/icons/assetLogos.d.ts +12 -0
  41. package/dist/src/icons/assetLogos.d.ts.map +1 -0
  42. package/dist/src/icons/funIconUri.d.ts +16 -0
  43. package/dist/src/icons/funIconUri.d.ts.map +1 -0
  44. package/dist/src/identity/IdentityContext.d.ts +30 -1
  45. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  46. package/dist/src/logging/datadogHttpLogTransport.d.ts +0 -7
  47. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  48. package/dist/src/providers/FunkitProvider.d.ts +37 -6
  49. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  50. package/dist/src/providers/FunkitStatsigProvider.d.ts +6 -2
  51. package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
  52. package/dist/src/providers/useFunkitCheckout.d.ts +14 -0
  53. package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -0
  54. package/dist/src/screens/AddMoneyScreen.d.ts +57 -2
  55. package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -1
  56. package/dist/src/screens/AvailableChainsScreen.d.ts +33 -0
  57. package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -0
  58. package/dist/src/screens/CheckoutBlockedScreen.d.ts +2 -0
  59. package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -0
  60. package/dist/src/screens/NetworkSelector.d.ts +31 -0
  61. package/dist/src/screens/NetworkSelector.d.ts.map +1 -0
  62. package/dist/src/screens/QrCodeScreen.d.ts +30 -14
  63. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
  64. package/dist/src/screens/TransferCryptoScreen.d.ts +25 -12
  65. package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
  66. package/dist/src/statsig/statsigMetadata.d.ts.map +1 -1
  67. package/dist/src/swapped/SwappedScreen.d.ts +21 -0
  68. package/dist/src/swapped/SwappedScreen.d.ts.map +1 -0
  69. package/dist/src/swapped/SwappedWebView.d.ts +18 -0
  70. package/dist/src/swapped/SwappedWebView.d.ts.map +1 -0
  71. package/dist/src/swapped/buildSwappedTheme.d.ts +31 -0
  72. package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -0
  73. package/dist/src/swapped/webViewSwappedTransport.d.ts +74 -0
  74. package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -0
  75. package/dist/src/theme/FunkitThemeProvider.d.ts +14 -2
  76. package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -1
  77. package/dist/src/theme/restyle.d.ts +1140 -513
  78. package/dist/src/theme/restyle.d.ts.map +1 -1
  79. package/dist/src/theme/toRestyleTheme.d.ts +90 -48
  80. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  81. package/dist/src/theme/tokens.d.ts +52 -8
  82. package/dist/src/theme/tokens.d.ts.map +1 -1
  83. package/dist/src/theme/useFunkitTheme.d.ts +4 -10
  84. package/dist/src/theme/useFunkitTheme.d.ts.map +1 -1
  85. package/dist/src/transfer/QrCode.d.ts +24 -0
  86. package/dist/src/transfer/QrCode.d.ts.map +1 -0
  87. package/dist/src/transfer/availableChains.d.ts +53 -0
  88. package/dist/src/transfer/availableChains.d.ts.map +1 -0
  89. package/dist/src/transfer/clipboard.d.ts +23 -0
  90. package/dist/src/transfer/clipboard.d.ts.map +1 -0
  91. package/dist/src/transfer/fops.d.ts +26 -0
  92. package/dist/src/transfer/fops.d.ts.map +1 -0
  93. package/dist/src/transfer/formatDepositAddress.d.ts +9 -0
  94. package/dist/src/transfer/formatDepositAddress.d.ts.map +1 -0
  95. package/dist/src/transfer/hooks/useFops.d.ts +47 -0
  96. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -0
  97. package/dist/src/transfer/hooks/useSupportedTokens.d.ts +26 -0
  98. package/dist/src/transfer/hooks/useSupportedTokens.d.ts.map +1 -0
  99. package/dist/src/transfer/hooks/useTokenTransfer.d.ts +4 -2
  100. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  101. package/dist/src/transfer/hooks/useTransferInit.d.ts +1 -1
  102. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -1
  103. package/dist/src/transfer/hooks/useUDAParams.d.ts +1 -1
  104. package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -1
  105. package/dist/src/transfer/supportedTokens.d.ts +34 -0
  106. package/dist/src/transfer/supportedTokens.d.ts.map +1 -0
  107. package/dist/src/version.d.ts +2 -0
  108. package/dist/src/version.d.ts.map +1 -0
  109. package/package.json +31 -4
  110. package/dist/src/icons/CopyIcon.d.ts +0 -3
  111. package/dist/src/icons/CopyIcon.d.ts.map +0 -1
  112. package/dist/src/icons/NetworkIconFallback.d.ts +0 -3
  113. package/dist/src/icons/NetworkIconFallback.d.ts.map +0 -1
  114. package/dist/src/icons/QrCodeIcon.d.ts +0 -3
  115. package/dist/src/icons/QrCodeIcon.d.ts.map +0 -1
  116. package/dist/src/theme/colorSchemeContext.d.ts +0 -22
  117. package/dist/src/theme/colorSchemeContext.d.ts.map +0 -1
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../index.ts", "../src/theme/tokens.ts", "../src/theme/toRestyleTheme.ts", "../src/theme/useColorScheme.ts", "../src/theme/useFunkitTheme.ts", "../src/theme/colorSchemeContext.ts", "../src/theme/restyle.ts", "../src/theme/FunkitThemeProvider.tsx", "../src/providers/FunkitStatsigProvider.tsx", "../src/statsig/useClientAsyncInitRN.ts", "../src/statsig/StatsigClientRN.ts", "../src/statsig/rnSetup.ts", "../src/statsig/appVisibilityShim.ts", "../src/statsig/preloadedAsyncStorage.ts", "../src/statsig/statsigMetadata.ts", "../src/providers/FunkitProvider.tsx", "../src/screens/AddMoneyScreen.tsx", "../src/screens/QrCodeScreen.tsx", "../src/screens/TransferCryptoScreen.tsx", "../src/icons/CopyIcon.tsx", "../src/icons/NetworkIconFallback.tsx", "../src/icons/QrCodeIcon.tsx"],
4
- "sourcesContent": ["// @funkit/connect-rn\n//\n// React Native bindings for Funkit Connect. For now this package re-exports the\n// headless, platform-agnostic surface from @funkit/connect-core so RN consumers\n// have a single `@funkit/connect-rn` entry point. The React Native platform\n// halves \u2014 Restyle theme, WebView Swapped transport, Transfer/Swapped screens,\n// and logging \u2014 are added in subsequent releases.\n//\n// See docs/connect-rn-architecture.md for the rollout plan.\n//\n// TODO(connect-rn): this blanket re-export is a skeleton convenience. Once\n// connect-rn has its own curated public API, replace it with explicit named\n// re-exports (and drop core symbols RN consumers shouldn't reach for) \u2014 this\n// line may be removed entirely.\nexport * from '@funkit/connect-core'\n\n// React Native platform halves \u2014 exported explicitly (no barrels).\n\n// Theme: design tokens.\nexport { darkTokens, lightTokens } from './src/theme/tokens'\nexport type { FunkitColorTokens, FunkitTokens } from './src/theme/tokens'\n\n// Theme: Restyle adapter + prebuilt default themes.\nexport {\n defaultDarkTheme,\n defaultLightTheme,\n toRestyleTheme,\n} from './src/theme/toRestyleTheme'\nexport type { FunkitTheme } from './src/theme/toRestyleTheme'\n\n// Theme: color scheme.\nexport {\n normalizeColorScheme,\n resolveColorScheme,\n useColorScheme,\n} from './src/theme/useColorScheme'\nexport type { ColorScheme, SystemColorScheme } from './src/theme/useColorScheme'\n\n// Theme: standalone theme selector.\nexport { useFunkitTheme } from './src/theme/useFunkitTheme'\nexport type { FunkitThemeSet } from './src/theme/useFunkitTheme'\n\n// Theme: Restyle primitives.\nexport { Box, Text } from './src/theme/restyle'\n\n// Theme: styling provider + color-scheme hook.\nexport {\n FunkitThemeProvider,\n useFunkitColorScheme,\n} from './src/theme/FunkitThemeProvider'\nexport type { FunkitThemeProviderProps } from './src/theme/FunkitThemeProvider'\n\n// Top-level, user-facing provider.\nexport { FunkitProvider } from './src/providers/FunkitProvider'\nexport type { FunkitProviderProps } from './src/providers/FunkitProvider'\n\n// Screens.\nexport { AddMoneyScreen } from './src/screens/AddMoneyScreen'\nexport type {\n AddMoneyScreenProps,\n PaymentMethodOption,\n} from './src/screens/AddMoneyScreen'\nexport { QrCodeScreen } from './src/screens/QrCodeScreen'\nexport type { QrCodeScreenProps } from './src/screens/QrCodeScreen'\nexport { TransferCryptoScreen } from './src/screens/TransferCryptoScreen'\nexport type { TransferCryptoScreenProps } from './src/screens/TransferCryptoScreen'\n\n// NOTE: the React Native Statsig bindings (`src/statsig/*` \u2014 vendored from\n// @statsig/react-native-bindings, AsyncStorage-only, no device-info) are\n// intentionally NOT part of the public API, mirroring @funkit/connect (web),\n// which keeps its Statsig provider internal (`FunkitStatsigProvider`) and\n// exports nothing Statsig-related. connect-rn's `FunkitProvider` mounts the RN\n// provider internally; end customers never touch Statsig directly.\n", "// Local design tokens for @funkit/connect-rn, hand-authored from the \"Fun\n// Mobile\" Figma variables export (Light + Dark modes). Variable aliases are\n// resolved to concrete values here.\n//\n// This is connect-rn's OWN theme source \u2014 it is intentionally NOT shared with\n// @funkit/connect-core (web keeps its separate `ThemeVars`). The token taxonomy\n// mirrors the Figma groups: background, content, border, font, spacing, brand,\n// button.\n\nimport type { TextStyle } from 'react-native'\n\n/**\n * Flat color palette (Restyle `colors` must be a flat record). Keys group by\n * role: `bg*` / `btn*` / `pill*` are surface colors, `text*` is foreground\n * content, `onBtn*` is the label/icon color on a button surface, `border*` are\n * stroke colors. Both modes share the same keys; only the values differ.\n */\nexport interface FunkitColorTokens {\n // surfaces\n bgModal: string\n bgSecondary: string\n // primary button surface\n btnPrimary: string\n btnPrimaryHover: string\n btnPrimaryPressed: string\n btnPrimaryFocused: string\n btnPrimaryDisabled: string\n // secondary button surface\n btnSecondary: string\n btnSecondaryHover: string\n btnSecondaryPressed: string\n btnSecondaryFocused: string\n btnSecondaryDisabled: string\n // tertiary button surface\n btnTertiary: string\n btnTertiaryHover: string\n btnTertiaryPressed: string\n btnTertiaryFocused: string\n btnTertiaryDisabled: string\n // icon button surface\n btnIcon: string\n btnIconHover: string\n btnIconPressed: string\n btnIconFocused: string\n btnIconDisabled: string\n // destructive button surface\n btnDestructive: string\n btnDestructiveHover: string\n btnDestructivePressed: string\n btnDestructiveFocused: string\n btnDestructiveDisabled: string\n // pill surface\n pill: string\n pillHover: string\n pillPressed: string\n pillFocused: string\n pillDisabled: string\n // foreground content\n textPrimary: string\n textSecondary: string\n textSuccess: string\n textError: string\n textHyperlink: string\n textWarning: string\n // label/icon color on button surfaces\n onBtnPrimary: string\n onBtnPrimaryLoading: string\n onBtnSecondary: string\n onBtnSecondaryLoading: string\n onBtnTertiary: string\n onBtnIcon: string\n onBtnDestructive: string\n onBtnDestructiveLoading: string\n // strokes\n borderModal: string\n borderDefault: string\n borderFocused: string\n borderSelected: string\n borderBtnPrimary: string\n borderBtnSecondary: string\n // brand\n brandPrimary: string\n}\n\nexport interface FunkitTokens {\n colors: FunkitColorTokens\n radii: {\n modal: number\n element: number\n elementInner: number\n button: number\n rounded: number\n }\n borderWidths: {\n modal: number\n elementsDefault: number\n elementsFocused: number\n elementsSelected: number\n button: number\n }\n spacing: {\n none: number\n elementsHorizontal: number\n modalHorizontal: number\n }\n sizes: {\n topBar: number\n buttonHeight: number\n buttonXs: number\n buttonSm: number\n buttonMd: number\n buttonLg: number\n // Icon tiers intentionally collapse per the Figma export: xs === sm (16)\n // and md === lg (20). The four tiers are kept so call sites can stay\n // semantic even though some resolve to the same value today.\n iconXs: number\n iconSm: number\n iconMd: number\n iconLg: number\n }\n fontFamilies: {\n body: string\n header: string\n }\n // React Native fontWeight values ('Regular' \u2192 '400', 'Medium' \u2192 '500').\n fontWeights: {\n base: TextStyle['fontWeight']\n medium: TextStyle['fontWeight']\n }\n fontSizes: {\n bodyBase: number\n bodyDetail: number\n // Per Figma, `headerTitle` (13) is the small modal top-bar title and\n // `headerSubtitle` (15) sits below it slightly larger \u2014 intentionally the\n // reverse of the usual title>subtitle hierarchy. Not a typo.\n headerTitle: number\n headerSubtitle: number\n amountInput: number\n amountSummary: number\n }\n}\n\nexport const lightTokens: FunkitTokens = {\n colors: {\n bgModal: '#FFFFFF',\n bgSecondary: '#F9F9F9',\n btnPrimary: '#0F0F0F',\n btnPrimaryHover: '#1B1B1B',\n btnPrimaryPressed: '#1B1B1B',\n btnPrimaryFocused: '#0F0F0F',\n btnPrimaryDisabled: '#0F0F0F',\n btnSecondary: '#F9F9F9',\n btnSecondaryHover: '#EFEFEF',\n btnSecondaryPressed: '#DDDDDD',\n btnSecondaryFocused: '#F9F9F9',\n btnSecondaryDisabled: '#F9F9F9',\n btnTertiary: '#FFFFFF',\n btnTertiaryHover: '#F9F9F9',\n btnTertiaryPressed: '#EFEFEF',\n btnTertiaryFocused: '#FFFFFF',\n btnTertiaryDisabled: '#FFFFFF',\n btnIcon: '#FFFFFF',\n btnIconHover: '#F9F9F9',\n btnIconPressed: '#EFEFEF',\n btnIconFocused: '#FFFFFF',\n btnIconDisabled: '#FFFFFF',\n btnDestructive: '#F34126',\n btnDestructiveHover: '#DB3B22',\n btnDestructivePressed: '#C2341E',\n btnDestructiveFocused: '#F34126',\n btnDestructiveDisabled: '#F34126',\n pill: '#FFFFFF',\n pillHover: '#F9F9F9',\n pillPressed: '#EFEFEF',\n pillFocused: '#FFFFFF',\n pillDisabled: '#FFFFFF',\n textPrimary: '#0F0F0F',\n textSecondary: '#6C6C6C',\n textSuccess: '#52A300',\n textError: '#F34126',\n textHyperlink: '#0F0F0F',\n textWarning: '#F97316',\n onBtnPrimary: '#FFFFFF',\n onBtnPrimaryLoading: '#FFFFFF',\n onBtnSecondary: '#0F0F0F',\n onBtnSecondaryLoading: '#000000',\n onBtnTertiary: '#0F0F0F',\n onBtnIcon: '#6C6C6C',\n onBtnDestructive: '#FFFFFF',\n onBtnDestructiveLoading: '#FFFFFF',\n borderModal: '#FFFFFF',\n borderDefault: '#EFEFEF',\n borderFocused: '#BEBEBE',\n borderSelected: '#0F0F0F',\n borderBtnPrimary: '#0F0F0F',\n borderBtnSecondary: '#F9F9F9',\n brandPrimary: '#0F0F0F',\n },\n radii: {\n modal: 24,\n element: 12,\n elementInner: 8,\n button: 12,\n rounded: 999,\n },\n borderWidths: {\n modal: 1,\n elementsDefault: 1,\n elementsFocused: 2,\n elementsSelected: 1,\n button: 0,\n },\n spacing: {\n none: 0,\n elementsHorizontal: 12,\n modalHorizontal: 16,\n },\n sizes: {\n topBar: 56,\n buttonHeight: 42,\n buttonXs: 32,\n buttonSm: 36,\n buttonMd: 40,\n buttonLg: 48,\n iconXs: 16,\n iconSm: 16,\n iconMd: 20,\n iconLg: 20,\n },\n fontFamilies: {\n body: 'Inter',\n header: 'Inter',\n },\n fontWeights: {\n base: '400',\n medium: '500',\n },\n fontSizes: {\n bodyBase: 16,\n bodyDetail: 14,\n headerTitle: 13,\n headerSubtitle: 15,\n amountInput: 48,\n amountSummary: 48,\n },\n}\n\nexport const darkTokens: FunkitTokens = {\n colors: {\n bgModal: '#0F0F0F',\n bgSecondary: '#1B1B1B',\n btnPrimary: '#F9F9F9',\n btnPrimaryHover: '#EFEFEF',\n btnPrimaryPressed: '#EFEFEF',\n btnPrimaryFocused: '#F9F9F9',\n btnPrimaryDisabled: '#F9F9F9',\n btnSecondary: '#1B1B1B',\n btnSecondaryHover: '#2D2D2D',\n btnSecondaryPressed: '#464646',\n btnSecondaryFocused: '#1B1B1B',\n btnSecondaryDisabled: '#1B1B1B',\n btnTertiary: '#0F0F0F',\n btnTertiaryHover: '#2D2D2D',\n btnTertiaryPressed: '#464646',\n btnTertiaryFocused: '#0F0F0F',\n btnTertiaryDisabled: '#0F0F0F',\n btnIcon: '#0F0F0F',\n btnIconHover: '#1B1B1B',\n btnIconPressed: '#2D2D2D',\n btnIconFocused: '#0F0F0F',\n btnIconDisabled: '#0F0F0F',\n btnDestructive: '#DB3B22',\n btnDestructiveHover: '#F34126',\n btnDestructivePressed: '#F88877',\n btnDestructiveFocused: '#DB3B22',\n btnDestructiveDisabled: '#DB3B22',\n pill: '#0F0F0F',\n pillHover: '#1B1B1B',\n pillPressed: '#2D2D2D',\n pillFocused: '#0F0F0F',\n pillDisabled: '#0F0F0F',\n textPrimary: '#FFFFFF',\n textSecondary: '#929292',\n textSuccess: '#52A300',\n textError: '#F34126',\n textHyperlink: '#4971F0',\n textWarning: '#F97316',\n onBtnPrimary: '#000000',\n onBtnPrimaryLoading: '#000000',\n onBtnSecondary: '#F9F9F9',\n onBtnSecondaryLoading: '#FFFFFF',\n onBtnTertiary: '#F9F9F9',\n onBtnIcon: '#929292',\n onBtnDestructive: '#FFFFFF',\n onBtnDestructiveLoading: '#FFFFFF',\n borderModal: '#1B1B1B',\n borderDefault: '#2D2D2D',\n borderFocused: '#464646',\n borderSelected: '#F9F9F9',\n borderBtnPrimary: '#F9F9F9',\n borderBtnSecondary: '#1B1B1B',\n brandPrimary: '#FFFFFF',\n },\n radii: {\n modal: 24,\n element: 12,\n elementInner: 8,\n button: 24,\n rounded: 999,\n },\n borderWidths: {\n modal: 1,\n elementsDefault: 1,\n elementsFocused: 2,\n elementsSelected: 1,\n button: 0,\n },\n spacing: {\n none: 0,\n elementsHorizontal: 12,\n modalHorizontal: 16,\n },\n sizes: {\n topBar: 56,\n buttonHeight: 42,\n buttonXs: 32,\n buttonSm: 36,\n buttonMd: 40,\n buttonLg: 48,\n iconXs: 16,\n iconSm: 16,\n iconMd: 20,\n iconLg: 20,\n },\n fontFamilies: {\n body: 'Inter',\n header: 'Inter',\n },\n fontWeights: {\n base: '400',\n medium: '500',\n },\n fontSizes: {\n bodyBase: 16,\n bodyDetail: 14,\n headerTitle: 13,\n headerSubtitle: 15,\n amountInput: 32,\n amountSummary: 40,\n },\n}\n", "import { createTheme } from '@shopify/restyle'\n\nimport { type FunkitTokens, darkTokens, lightTokens } from './tokens'\n\n/**\n * Adapts connect-rn's local {@link FunkitTokens} into a `@shopify/restyle`\n * theme. Colors are concrete hex (no CSS-var indirection like web), and the\n * numeric tokens map straight onto the unitless values Restyle / RN style props\n * expect \u2014 so the mapping is a direct projection of the token groups onto\n * Restyle's standard keys (`colors`, `spacing`, `borderRadii`, `borderWidths`,\n * `textVariants`, `breakpoints`) plus a custom `sizes` group.\n */\nexport function toRestyleTheme(tokens: FunkitTokens) {\n return createTheme({\n colors: {\n ...tokens.colors,\n transparent: 'transparent',\n },\n spacing: tokens.spacing,\n borderRadii: tokens.radii,\n borderWidths: tokens.borderWidths,\n sizes: tokens.sizes,\n breakpoints: {\n phone: 0,\n tablet: 768,\n },\n textVariants: {\n defaults: {\n fontFamily: tokens.fontFamilies.body,\n fontWeight: tokens.fontWeights.base,\n fontSize: tokens.fontSizes.bodyBase,\n color: 'textPrimary',\n },\n body: {\n fontFamily: tokens.fontFamilies.body,\n fontWeight: tokens.fontWeights.base,\n fontSize: tokens.fontSizes.bodyBase,\n color: 'textPrimary',\n },\n bodyMedium: {\n fontFamily: tokens.fontFamilies.body,\n fontWeight: tokens.fontWeights.medium,\n fontSize: tokens.fontSizes.bodyBase,\n color: 'textPrimary',\n },\n detail: {\n fontFamily: tokens.fontFamilies.body,\n fontWeight: tokens.fontWeights.base,\n fontSize: tokens.fontSizes.bodyDetail,\n color: 'textSecondary',\n },\n headerTitle: {\n fontFamily: tokens.fontFamilies.header,\n fontWeight: tokens.fontWeights.medium,\n fontSize: tokens.fontSizes.headerTitle,\n color: 'textPrimary',\n textAlign: 'center',\n },\n headerSubtitle: {\n fontFamily: tokens.fontFamilies.header,\n fontWeight: tokens.fontWeights.medium,\n fontSize: tokens.fontSizes.headerSubtitle,\n color: 'textSecondary',\n textAlign: 'center',\n },\n amountInput: {\n fontFamily: tokens.fontFamilies.header,\n fontWeight: tokens.fontWeights.medium,\n fontSize: tokens.fontSizes.amountInput,\n color: 'textPrimary',\n },\n amountSummary: {\n fontFamily: tokens.fontFamilies.header,\n fontWeight: tokens.fontWeights.medium,\n fontSize: tokens.fontSizes.amountSummary,\n color: 'textPrimary',\n },\n },\n })\n}\n\n/** The Restyle theme type all connect-rn components are written against. */\nexport type FunkitTheme = ReturnType<typeof toRestyleTheme>\n\n/** Built-in default Restyle themes derived from the Fun Mobile Light/Dark tokens. */\nexport const defaultLightTheme = toRestyleTheme(lightTokens)\nexport const defaultDarkTheme = toRestyleTheme(darkTokens)\n", "import { useEffect, useState } from 'react'\nimport { Appearance, type ColorSchemeName } from 'react-native'\n\nexport type SystemColorScheme = 'light' | 'dark' | undefined\n\n/** A concrete, resolved color scheme (never undefined). */\nexport type ColorScheme = 'light' | 'dark'\n\n/**\n * Resolve the active color scheme with this precedence (pure, exported for\n * testing):\n * 1. `controlled` \u2014 the `FunkitProvider` `colorScheme` prop. When set, it\n * wins over everything, so a manual toggle / system change can't move it.\n * 2. `override` \u2014 a manual `toggleColorScheme()` choice (uncontrolled only).\n * 3. `system` \u2014 the live OS Appearance.\n * 4. `'light'` \u2014 fallback when the system scheme is unknown.\n */\nexport function resolveColorScheme(\n controlled: ColorScheme | undefined,\n override: ColorScheme | undefined,\n system: SystemColorScheme,\n): ColorScheme {\n if (controlled) {\n return controlled\n }\n return override ?? system ?? 'light'\n}\n\n/**\n * Normalize React Native's `ColorSchemeName` (`'light' | 'dark' | null |\n * undefined`) to `'light' | 'dark' | undefined`. Pure \u2014 exported for testing.\n */\nexport function normalizeColorScheme(\n scheme: ColorSchemeName | null | undefined,\n): SystemColorScheme {\n return scheme === 'light' || scheme === 'dark' ? scheme : undefined\n}\n\n/**\n * Reads the system color scheme from RN's `Appearance` API and re-renders on\n * change. The RN counterpart to web's `prefers-color-scheme` media query.\n */\nexport function useColorScheme(): SystemColorScheme {\n const [scheme, setScheme] = useState<SystemColorScheme>(() =>\n normalizeColorScheme(Appearance.getColorScheme()),\n )\n\n useEffect(() => {\n const subscription = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(normalizeColorScheme(colorScheme))\n })\n return () => subscription.remove()\n }, [])\n\n return scheme\n}\n", "import { useContext, useMemo } from 'react'\n\nimport { FunkitColorSchemeContext } from './colorSchemeContext'\nimport {\n type FunkitTheme,\n defaultDarkTheme,\n defaultLightTheme,\n} from './toRestyleTheme'\nimport { type SystemColorScheme, useColorScheme } from './useColorScheme'\n\n/**\n * A light/dark Restyle theme set. **At least one mode must be provided**; a\n * missing mode falls back to the one that is set. Only Restyle themes (produced\n * by `toRestyleTheme`) are accepted \u2014 raw token objects are not, so callers\n * can't accidentally pass a half-built theme.\n */\nexport type FunkitThemeSet =\n | { light: FunkitTheme; dark?: FunkitTheme }\n | { light?: FunkitTheme; dark: FunkitTheme }\n\nconst DEFAULT_THEME_SET: FunkitThemeSet = {\n light: defaultLightTheme,\n dark: defaultDarkTheme,\n}\n\n/**\n * Pick the Restyle theme for a color scheme, falling back to the other mode\n * when the requested one isn't in the set. The `FunkitThemeSet` union\n * guarantees at least one mode is present.\n */\nexport function selectTheme(\n themeSet: FunkitThemeSet,\n scheme: SystemColorScheme,\n): FunkitTheme {\n const primary = scheme === 'dark' ? themeSet.dark : themeSet.light\n const fallback = scheme === 'dark' ? themeSet.light : themeSet.dark\n if (primary) {\n return primary\n }\n if (fallback) {\n return fallback\n }\n // Unreachable for typed callers; guards untyped (JS) misuse.\n throw new Error(\n 'FunkitProvider: `themes` must include at least one of { light, dark }',\n )\n}\n\n/**\n * Resolves the active Restyle theme from the given theme set. Standalone hook\n * for use **outside** `FunkitProvider` (e.g. a small surface that wants a theme\n * without mounting the provider) \u2014 inside the provider, read the active theme\n * via Restyle's `useTheme()` and the scheme via `useFunkitColorScheme()`.\n *\n * Scheme precedence: when mounted inside a `FunkitProvider` it follows the\n * provider's **resolved** scheme (so it can't disagree with the theme the\n * provider rendered into Restyle after a `toggleColorScheme()` / a controlled\n * `colorScheme` prop); standalone it follows the live system Appearance,\n * falling back to light when that's unknown.\n */\nexport function useFunkitTheme(\n themeSet: FunkitThemeSet = DEFAULT_THEME_SET,\n): FunkitTheme {\n // Prefer the provider's resolved scheme when present; `useColorScheme` is the\n // standalone (no-provider) fallback. Both hooks run unconditionally.\n const providerScheme = useContext(FunkitColorSchemeContext)?.colorScheme\n const systemScheme = useColorScheme()\n const scheme = providerScheme ?? systemScheme\n // Depend on the individual theme refs, not the `themeSet` object \u2014 an inline\n // set is a new object each render and would defeat the memo.\n return useMemo(\n () => selectTheme(themeSet, scheme),\n [scheme, themeSet.light, themeSet.dark],\n )\n}\n", "import { createContext } from 'react'\n\nimport type { ColorScheme } from './useColorScheme'\n\n/**\n * The active color scheme + manual toggle published by `FunkitThemeProvider`.\n * Lives in its own module so both the provider and the standalone\n * `useFunkitTheme` hook can read it without importing each other (which would\n * create a circular dependency).\n */\nexport interface FunkitColorSchemeValue {\n /** The active, resolved color scheme. */\n colorScheme: ColorScheme\n /**\n * Flip light\u2194dark, or set a specific scheme when an argument is given.\n * **No-op when the provider's `colorScheme` prop is set** (controlled mode) \u2014\n * the host owns the scheme in that case.\n */\n toggleColorScheme: (next?: ColorScheme) => void\n /** True when the scheme is forced by the `colorScheme` prop (uncontrolled toggle disabled). */\n isControlled: boolean\n}\n\n/** `null` when read outside a `FunkitProvider`. */\nexport const FunkitColorSchemeContext =\n createContext<FunkitColorSchemeValue | null>(null)\n", "import { createBox, createText } from '@shopify/restyle'\n\nimport type { FunkitTheme } from './toRestyleTheme'\n\n/**\n * `@shopify/restyle` primitives bound to the connect-rn {@link FunkitTheme}.\n * Components use these instead of raw `View` / `Text` so style props\n * (`backgroundColor`, `padding`, `borderRadius`, `variant`, \u2026) resolve to theme\n * tokens with full type safety.\n */\nexport const Box = createBox<FunkitTheme>()\nexport const Text = createText<FunkitTheme>()\n", "import { ThemeProvider } from '@shopify/restyle'\nimport {\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport {\n FunkitColorSchemeContext,\n type FunkitColorSchemeValue,\n} from './colorSchemeContext'\nimport { defaultDarkTheme, defaultLightTheme } from './toRestyleTheme'\nimport {\n type ColorScheme,\n resolveColorScheme,\n useColorScheme,\n} from './useColorScheme'\nimport { type FunkitThemeSet, selectTheme } from './useFunkitTheme'\n\nconst DEFAULT_THEMES: FunkitThemeSet = {\n light: defaultLightTheme,\n dark: defaultDarkTheme,\n}\n\nexport interface FunkitThemeProviderProps {\n children: ReactNode\n /**\n * The light/dark Restyle theme set. Defaults to the built-in Fun Mobile\n * themes. Pass `{ light, dark }` from `toRestyleTheme(...)` to customize.\n */\n themes?: FunkitThemeSet\n /**\n * Force a color scheme. When provided the provider is **controlled**: it\n * always renders this scheme, ignores the system Appearance, and\n * `toggleColorScheme()` becomes a no-op. When omitted the provider is\n * **uncontrolled**: the scheme follows the system Appearance and can be\n * flipped with `toggleColorScheme()`.\n */\n colorScheme?: ColorScheme\n}\n\n/**\n * The styling layer for `@funkit/connect-rn`. Resolves the active Restyle theme\n * (selected from `themes` by color scheme), wires it into Restyle's\n * `ThemeProvider`, and exposes the scheme + a manual toggle via\n * {@link useFunkitColorScheme}.\n *\n * This is an internal-ish provider \u2014 host apps mount the user-facing\n * {@link FunkitProvider}, which passes `themes` / `colorScheme` down to this.\n */\nexport function FunkitThemeProvider({\n children,\n themes = DEFAULT_THEMES,\n colorScheme,\n}: FunkitThemeProviderProps) {\n const isControlled = colorScheme != null\n const systemScheme = useColorScheme()\n // Manual override, used only in uncontrolled mode. Sticky once set \u2014 later\n // system changes are ignored until the next toggle (matches web behavior).\n const [override, setOverride] = useState<ColorScheme | undefined>(undefined)\n\n const activeScheme = resolveColorScheme(colorScheme, override, systemScheme)\n\n const toggleColorScheme = useCallback(\n (next?: ColorScheme) => {\n if (colorScheme != null) {\n return // controlled: the host owns the scheme\n }\n setOverride((prev) => {\n if (next != null) {\n return next\n }\n const current = resolveColorScheme(undefined, prev, systemScheme)\n return current === 'dark' ? 'light' : 'dark'\n })\n },\n [colorScheme, systemScheme],\n )\n\n const theme = selectTheme(themes, activeScheme)\n\n const value = useMemo<FunkitColorSchemeValue>(\n () => ({ colorScheme: activeScheme, toggleColorScheme, isControlled }),\n [activeScheme, toggleColorScheme, isControlled],\n )\n\n return (\n <FunkitColorSchemeContext.Provider value={value}>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </FunkitColorSchemeContext.Provider>\n )\n}\n\n/**\n * Read the active color scheme and toggle it. Must be used within a\n * {@link FunkitProvider} (which mounts {@link FunkitThemeProvider}).\n * `toggleColorScheme` is a no-op when the provider is in controlled mode (a\n * `colorScheme` prop was passed).\n */\nexport function useFunkitColorScheme(): FunkitColorSchemeValue {\n const value = useContext(FunkitColorSchemeContext)\n if (value == null) {\n throw new Error('useFunkitColorScheme must be used within <FunkitProvider>')\n }\n return value\n}\n", "import {\n LogEventCompressionMode,\n LogLevel,\n StatsigProvider,\n} from '@statsig/react-bindings'\nimport type { ReactNode } from 'react'\n\nimport { useClientAsyncInitRN } from '../statsig/useClientAsyncInitRN'\n\n// React Native counterpart of @funkit/connect's FunkitStatsigProvider. Same Fun\n// client key + custom proxy (the Statsig domain is usually blocked by adblockers\n// \u2014 https://docs.statsig.com/infrastructure/api_proxy/custom_proxy), but the\n// client is created with the RN bindings (AsyncStorage persistence, AppState\n// visibility) via `useClientAsyncInitRN`. The web-only Datadog `values_updated`\n// correlation is omitted (RN logging is wired separately).\nconst STATSIG_API = 'https://data-api.fun.xyz/v1'\nexport const STATSIG_CLIENT_KEY =\n 'client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM' as const\n\ninterface FunkitStatsigProviderProps {\n children: ReactNode\n isDevelopment?: boolean\n}\n\nexport function FunkitStatsigProvider({\n children,\n isDevelopment = false,\n}: FunkitStatsigProviderProps) {\n const { client } = useClientAsyncInitRN(\n STATSIG_CLIENT_KEY,\n {},\n {\n networkConfig: {\n api: STATSIG_API,\n // default timeout (10s) is too large; statsig usually responds <200ms\n networkTimeoutMs: 5_000,\n },\n // Our proxy supports compression; force it on to save bandwidth.\n logEventCompressionMode: LogEventCompressionMode.Forced,\n // Silence harmless warnings from hooks running before async init (we have\n // bootstrap fallbacks).\n logLevel: isDevelopment ? undefined : LogLevel.Error,\n environment: {\n tier: isDevelopment ? 'development' : 'production',\n },\n },\n )\n\n return <StatsigProvider client={client}>{children}</StatsigProvider>\n}\n", "import {\n type StatsigOptions,\n type StatsigUser,\n useStatsigInternalClientFactoryAsync,\n} from '@statsig/react-bindings'\n\nimport { StatsigClientRN } from './StatsigClientRN'\n\n// Vendored from @statsig/react-native-bindings. Creates an RN client and runs\n// `initializeAsync` (network fetch); `isLoading` flips false when ready.\nexport function useClientAsyncInitRN(\n sdkKey: string,\n initialUser: StatsigUser,\n statsigOptions: StatsigOptions | null = null,\n): { isLoading: boolean; client: StatsigClientRN } {\n return useStatsigInternalClientFactoryAsync(\n (args) =>\n new StatsigClientRN(args.sdkKey, args.initialUser, args.statsigOptions),\n {\n sdkKey,\n initialUser,\n statsigOptions,\n },\n )\n}\n", "import {\n StatsigClient,\n type StatsigOptions,\n type StatsigUser,\n} from '@statsig/react-bindings'\n\nimport { setupStatsigForReactNative } from './rnSetup'\nimport { getStatsigMetadataAdditions } from './statsigMetadata'\n\n// Vendored from @statsig/react-native-bindings' StatsigClientRN. A StatsigClient\n// pre-configured for React Native: AsyncStorage persistence, AppState-driven\n// visibility, and (device-info-free) metadata additions.\nexport class StatsigClientRN extends StatsigClient {\n readonly __isRnClient = true\n\n constructor(\n sdkKey: string,\n user: StatsigUser,\n options: StatsigOptions | null = null,\n ) {\n const opts = options ?? {}\n setupStatsigForReactNative(getStatsigMetadataAdditions(), opts)\n\n super(sdkKey, user, opts)\n }\n}\n", "import {\n type AnyStatsigOptions,\n type NetworkArgs,\n SDKType,\n StatsigMetadataProvider,\n} from '@statsig/react-bindings'\n\nimport { applyAppStateVisibilityShim } from './appVisibilityShim'\nimport { createPreloadedAsyncStorage } from './preloadedAsyncStorage'\n\n// Vendored from @statsig/react-native-core's RNSetup. Wires the RN platform\n// concerns into a StatsigOptions before the client is constructed: the AppState\n// visibility shim, the binding type, the AsyncStorage-backed storage provider\n// (unless the host supplied its own), and a fetch-based network override that\n// sets the JSON content-type header.\n\nexport function setupStatsigForReactNative(\n statsigMetadataAdditions: Record<string, string | undefined> | null,\n options: AnyStatsigOptions,\n): void {\n applyAppStateVisibilityShim()\n\n SDKType._setBindingType('rn')\n if (statsigMetadataAdditions) {\n StatsigMetadataProvider.add(statsigMetadataAdditions)\n }\n\n if (options.storageProvider == null) {\n options.storageProvider = createPreloadedAsyncStorage()\n }\n\n applyNetworkFix(options)\n}\n\nfunction applyNetworkFix(options: AnyStatsigOptions) {\n if (options.networkConfig?.networkOverrideFunc != null) {\n return\n }\n\n const networkOverrideFunc = (url: string, args: NetworkArgs) => {\n if (args.body != null && args.method === 'POST') {\n args.headers = {\n 'Content-Type': 'application/json',\n ...args.headers,\n }\n }\n return fetch(url, args)\n }\n\n options.networkConfig = {\n networkOverrideFunc,\n ...options.networkConfig,\n }\n}\n", "import { _notifyVisibilityChanged } from '@statsig/react-bindings'\nimport { AppState } from 'react-native'\n\n// Vendored from @statsig/react-native-core's AppVisiblityShim. statsig's event\n// logger flushes on visibility changes; on web that's driven by\n// `document`/`window` events, which don't exist in RN. Bridge RN's `AppState`\n// to statsig's `_notifyVisibilityChanged` so flush-on-background works.\n\nlet isApplied = false\n\nexport function applyAppStateVisibilityShim(): void {\n if (isApplied) {\n return\n }\n\n isApplied = true\n AppState.addEventListener('change', (nextAppState) =>\n _notifyVisibilityChanged(\n nextAppState === 'active' ? 'foreground' : 'background',\n ),\n )\n}\n", "import AsyncStorage from '@react-native-async-storage/async-storage'\nimport { Log, type StorageProvider } from '@statsig/react-bindings'\n\n// Vendored from @statsig/react-native-core's PreloadedAsyncStorage, unchanged\n// except for sourcing `Log`/`StorageProvider` from `@statsig/react-bindings`\n// (which re-exports `@statsig/client-core`) so there's a single statsig copy.\n//\n// Statsig's storage API is synchronous, but AsyncStorage is async. This bridges\n// them: prefetch all `statsig.*` keys into an in-memory mirror once, serve reads\n// synchronously from the mirror, and write through to AsyncStorage in the\n// background. Persistence (warm cache across launches) without any native\n// module beyond AsyncStorage.\n\nconst NOT_READY_ERROR =\n 'Attempting to alter AsyncStorage before it is ready. Values will not be persisted.'\n\nexport function createPreloadedAsyncStorage(): StorageProvider {\n const inMemoryStore: Record<string, string> = {}\n let isResolved = false\n let readyPromise: Promise<void> | null = null\n\n const enforceIsResolved = () => {\n if (!isResolved) {\n Log.error(NOT_READY_ERROR)\n }\n\n return isResolved\n }\n\n const provider: StorageProvider = {\n getProviderName: (): string => 'AsyncStorage',\n\n isReady: () => isResolved,\n\n isReadyResolver: () => {\n if (!readyPromise) {\n readyPromise = prefetchFromAsyncStorage(inMemoryStore).finally(() => {\n isResolved = true\n })\n }\n return readyPromise\n },\n\n getItem: (key: string): string | null => {\n if (!enforceIsResolved()) {\n return null\n }\n\n return inMemoryStore[key] ?? null\n },\n\n setItem: (key: string, value: string): void => {\n inMemoryStore[key] = value\n if (!enforceIsResolved()) {\n return\n }\n\n AsyncStorage.setItem(key, value).catch(Log.error)\n },\n\n removeItem: (key: string): void => {\n delete inMemoryStore[key]\n if (!enforceIsResolved()) {\n return\n }\n\n AsyncStorage.removeItem(key).catch(Log.error)\n },\n\n getAllKeys: (): readonly string[] => {\n if (!enforceIsResolved()) {\n return []\n }\n\n return Object.keys(inMemoryStore)\n },\n }\n\n return provider\n}\n\nasync function prefetchFromAsyncStorage(\n inMemoryStore: Record<string, string>,\n): Promise<void> {\n const keys = await AsyncStorage.getAllKeys()\n\n await Promise.all(\n keys.map(async (key) => {\n if (!key.startsWith('statsig.')) {\n return\n }\n\n const cache = await AsyncStorage.getItem(key)\n if (!cache) {\n return\n }\n\n inMemoryStore[key] = cache\n }),\n )\n}\n", "import { NativeModules, Platform } from 'react-native'\n\n// Vendored from @statsig/react-native-core's StatsigMetadataAdditions, with the\n// `react-native-device-info` dependency intentionally REMOVED \u2014 that package is\n// a native module (not in Expo Go, needs a dev build) and we don't want to\n// require it. The app-version / device-model fields it provided are simply left\n// `undefined`; we still surface `systemName` (free via `Platform.OS`) and the\n// `locale` (read from RN's built-in NativeModules, no extra dependency).\n\n// NB: upstream Statsig misspells this field as `localIdentifer`; the real RN\n// Android `NativeModules.I18nManager` constant is `localeIdentifier`, so the\n// upstream spelling always reads `undefined`. Corrected here.\ntype I18nManagerModule = { localeIdentifier?: string }\ntype SettingsManagerModule = {\n settings?: { AppLocale?: string; AppleLanguages?: string[] }\n}\n\nfunction resolveLocale(): string | undefined {\n if (Platform.OS === 'android') {\n const i18nManager = NativeModules.I18nManager as\n | I18nManagerModule\n | undefined\n return i18nManager?.localeIdentifier ?? undefined\n }\n\n if (Platform.OS === 'ios') {\n const settings = (\n NativeModules.SettingsManager as SettingsManagerModule | undefined\n )?.settings\n return settings?.AppLocale ?? settings?.AppleLanguages?.[0] ?? undefined\n }\n\n return undefined\n}\n\nexport function getStatsigMetadataAdditions(): Record<\n string,\n string | undefined\n> {\n return {\n // Device-info-derived fields are dropped (no react-native-device-info).\n appVersion: undefined,\n systemVersion: undefined,\n deviceModelName: undefined,\n deviceModel: undefined,\n // Available without any native module:\n systemName: Platform.OS,\n locale: resolveLocale(),\n }\n}\n", "import type { ReactNode } from 'react'\n\nimport {\n FunkitThemeProvider,\n type FunkitThemeProviderProps,\n} from '../theme/FunkitThemeProvider'\nimport { FunkitStatsigProvider } from './FunkitStatsigProvider'\n\nexport interface FunkitProviderProps {\n children: ReactNode\n /**\n * Light/dark Restyle theme set. Defaults to the built-in Fun Mobile themes.\n * Forwarded to {@link FunkitThemeProvider}.\n */\n themes?: FunkitThemeProviderProps['themes']\n /**\n * Optional forced color scheme. When set, the scheme is controlled (system\n * Appearance ignored, `toggleColorScheme()` disabled); when omitted it\n * follows the system Appearance and is toggleable. Forwarded to\n * {@link FunkitThemeProvider}.\n */\n colorScheme?: FunkitThemeProviderProps['colorScheme']\n /**\n * Run Statsig in development mode (dev environment tier + verbose logging).\n * Mirrors `@funkit/connect`'s `debug`.\n */\n debug?: boolean\n}\n\n/**\n * Top-level, user-facing provider for `@funkit/connect-rn` \u2014 the single\n * provider host apps mount around their tree.\n *\n * Composes the platform halves: Statsig (RN bindings \u2014 AsyncStorage-backed, no\n * device-info) on the outside so flags are available everywhere, and styling\n * via {@link FunkitThemeProvider}. As more halves land (identity, query client,\n * logging) they compose here, keeping host integration a single\n * `<FunkitProvider>`.\n */\nexport function FunkitProvider({\n children,\n themes,\n colorScheme,\n debug = false,\n}: FunkitProviderProps) {\n return (\n <FunkitStatsigProvider isDevelopment={debug}>\n <FunkitThemeProvider themes={themes} colorScheme={colorScheme}>\n {children}\n </FunkitThemeProvider>\n </FunkitStatsigProvider>\n )\n}\n", "import { useTheme } from '@shopify/restyle'\nimport type { ReactNode } from 'react'\nimport { Pressable, ScrollView, StyleSheet } from 'react-native'\n\nimport { Box, Text } from '../theme/restyle'\nimport type { FunkitTheme } from '../theme/toRestyleTheme'\n\n/**\n * One selectable funding source in {@link AddMoneyScreen}. Brand icons are\n * host-supplied (`icon` / `trailing`) so the package stays asset- and\n * `react-native-svg`-free; the screen renders a themed circular slot for each.\n */\nexport interface PaymentMethodOption {\n /** Stable id passed back to `onSelectMethod`. */\n id: string\n title: string\n /** Secondary line: balance, limit, timing, etc. */\n subtitle?: string\n /** Leading icon, centered in the themed circle. */\n icon?: ReactNode\n /** Trailing accessory, e.g. a token cluster for the Crypto row. */\n trailing?: ReactNode\n}\n\nexport interface AddMoneyScreenProps {\n methods: PaymentMethodOption[]\n onSelectMethod: (id: string) => void\n title?: string\n}\n\n/**\n * The \"Add money\" funding-source picker (Figma: Fun Mobile / Add money). A\n * bottom-sheet-style surface \u2014 grabber + centered title + a scrollable list of\n * payment methods \u2014 built from the connect-rn Restyle theme so it tracks the\n * active light/dark scheme. Selecting a method (e.g. Crypto) routes the host to\n * the next screen (Transfer/UDA).\n */\nexport function AddMoneyScreen({\n methods,\n onSelectMethod,\n title = 'Add money',\n}: AddMoneyScreenProps) {\n const theme = useTheme<FunkitTheme>()\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n >\n <Box alignItems=\"center\" style={styles.topBar}>\n <Box backgroundColor=\"borderFocused\" style={styles.grabber} />\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n\n <ScrollView\n contentContainerStyle={[\n styles.listContent,\n // Bind the horizontal padding to the spacing token (ScrollView can't\n // take Restyle props) so it tracks the theme instead of a raw 16.\n { paddingHorizontal: theme.spacing.modalHorizontal },\n ]}\n showsVerticalScrollIndicator={false}\n >\n {methods.map((method) => (\n <Pressable\n key={method.id}\n onPress={() => onSelectMethod(method.id)}\n accessibilityRole=\"button\"\n accessibilityLabel={method.title}\n >\n <PaymentMethodRow method={method} />\n </Pressable>\n ))}\n </ScrollView>\n </Box>\n )\n}\n\nfunction PaymentMethodRow({ method }: { method: PaymentMethodOption }) {\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n style={styles.row}\n >\n <Box\n width={48}\n height={48}\n borderRadius=\"rounded\"\n backgroundColor=\"bgSecondary\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {method.icon}\n </Box>\n <Box flex={1} style={styles.details}>\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {method.title}\n </Text>\n {method.subtitle ? (\n <Text variant=\"detail\" color=\"textSecondary\">\n {method.subtitle}\n </Text>\n ) : null}\n </Box>\n {method.trailing}\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n topBar: { paddingTop: 20, paddingBottom: 12 },\n grabber: {\n position: 'absolute',\n top: 8,\n width: 36,\n height: 5,\n borderRadius: 999,\n },\n listContent: {\n paddingBottom: 16,\n gap: 6,\n },\n row: { paddingVertical: 10 },\n details: { gap: 2 },\n})\n", "import type { ReactNode } from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\n\nimport { Box, Text } from '../theme/restyle'\n\n/**\n * The deposit QR-code screen (Figma: Fun Mobile / qr-code-modal) \u2014 reached from\n * the Transfer screen's QR button. A caption, the framed QR code, and a share\n * action.\n *\n * Rendered as a content-sized bottom sheet (NOT `flex: 1`) so it shows correctly\n * inside the managed flow's bottom-anchored modal \u2014 a full-height layout would\n * collapse to nothing there.\n *\n * The scannable QR itself is host-supplied (`qrCode`, e.g.\n * `react-native-qrcode-svg`) so the package stays `react-native-svg`-free; this\n * screen renders the themed frame around it.\n */\nexport interface QrCodeScreenProps {\n /** The rendered QR code node (host-supplied). */\n qrCode: ReactNode\n /** Account name in the caption: \"Scan to deposit to this {accountName} account.\" */\n accountName?: string\n onClose?: () => void\n onShare?: () => void\n /** Makes \"supported chains\" a tappable link when provided. */\n onSupportedChainsPress?: () => void\n}\n\nexport function QrCodeScreen({\n qrCode,\n accountName,\n onClose,\n onShare,\n onSupportedChainsPress,\n}: QrCodeScreenProps) {\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={styles.sheet}\n >\n {/* Top bar: grabber + close */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={styles.topBar}>\n <Box\n backgroundColor=\"borderFocused\"\n borderRadius=\"rounded\"\n style={styles.grabber}\n />\n <Pressable\n onPress={onClose}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n >\n <Text color=\"textPrimary\" style={styles.closeGlyph}>\n \u2715\n </Text>\n </Pressable>\n </Box>\n\n {/* Content */}\n <Box alignItems=\"center\" style={styles.content}>\n <Text variant=\"body\" color=\"textSecondary\" style={styles.caption}>\n {`Scan to deposit to this ${\n accountName ? `${accountName} ` : ''\n }account.\\n`}\n Use it only for{' '}\n <Text\n variant=\"body\"\n color=\"textSecondary\"\n style={onSupportedChainsPress ? styles.link : undefined}\n onPress={onSupportedChainsPress}\n accessibilityRole={onSupportedChainsPress ? 'link' : undefined}\n >\n supported chains\n </Text>\n </Text>\n\n <Box\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={2}\n alignItems=\"center\"\n justifyContent=\"center\"\n style={styles.qrFrame}\n >\n {qrCode}\n </Box>\n\n <Pressable\n onPress={onShare}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Share\"\n >\n <Box\n width={68}\n height={68}\n borderRadius=\"rounded\"\n backgroundColor=\"bgSecondary\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Text color=\"textPrimary\" style={styles.shareGlyph}>\n \u2191\n </Text>\n </Box>\n </Pressable>\n </Box>\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n sheet: { paddingBottom: 32 },\n topBar: {\n paddingTop: 20,\n paddingBottom: 8,\n paddingHorizontal: 12,\n },\n grabber: {\n position: 'absolute',\n top: 8,\n left: '50%',\n marginLeft: -18,\n width: 36,\n height: 5,\n },\n content: { paddingHorizontal: 20, paddingTop: 16, gap: 32 },\n caption: { textAlign: 'center' },\n link: { textDecorationLine: 'underline' },\n qrFrame: {\n width: 275,\n height: 275,\n borderRadius: 20,\n padding: 16,\n },\n closeGlyph: { fontSize: 18, lineHeight: 22 },\n shareGlyph: { fontSize: 28, lineHeight: 32, fontWeight: '500' },\n})\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\n\nimport { CopyIcon } from '../icons/CopyIcon'\nimport { NetworkIconFallback } from '../icons/NetworkIconFallback'\nimport { QrCodeIcon } from '../icons/QrCodeIcon'\nimport { Box, Text } from '../theme/restyle'\n\n/**\n * The Transfer Crypto / Universal-Deposit-Address screen (Figma: Fun Mobile /\n * Transfer Crypto). A themed bottom-sheet surface showing the network selector\n * and the deposit address with copy/share actions. UI only \u2014 the host wires the\n * data (`depositAddress`, `networkLabel`) and the callbacks; the deposit-address\n * resolution lives in the transfer hooks.\n */\nexport interface TransferCryptoScreenProps {\n /** Pre-formatted deposit address, e.g. `0x7854...5139F0`. */\n depositAddress: string\n /** Network selector label, e.g. `EVM Chains`. */\n networkLabel: string\n /** Leading chain-cluster icon (host-supplied; falls back to a themed dot). */\n networkIcon?: ReactNode\n title?: string\n depositAddressLabel?: string\n /** How long the \"copied\" confirmation stays visible (ms). */\n copiedFeedbackMs?: number\n onBack?: () => void\n onShowQrCode?: () => void\n onChangeNetwork?: () => void\n onCopyAddress?: () => void\n onShareAddress?: () => void\n}\n\nexport function TransferCryptoScreen({\n depositAddress,\n networkLabel,\n networkIcon,\n title = 'Transfer Crypto',\n depositAddressLabel = 'Your deposit address',\n copiedFeedbackMs = 1800,\n onBack,\n onShowQrCode,\n onChangeNetwork,\n onCopyAddress,\n onShareAddress,\n}: TransferCryptoScreenProps) {\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n\n useEffect(() => () => clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n onCopyAddress?.()\n setCopied(true)\n clearTimeout(copyTimer.current)\n copyTimer.current = setTimeout(() => setCopied(false), copiedFeedbackMs)\n }\n\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n >\n {/* Top bar: back \u00B7 title \u00B7 QR */}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"none\"\n style={styles.topBar}\n >\n <Box\n backgroundColor=\"borderFocused\"\n borderRadius=\"rounded\"\n style={styles.grabber}\n />\n <Pressable\n onPress={onBack}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Back\"\n >\n <Text color=\"textPrimary\" style={styles.chevron}>\n \u2039\n </Text>\n </Pressable>\n <Box flex={1} alignItems=\"center\">\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n <Pressable\n onPress={onShowQrCode}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Show QR code\"\n // Match the back chevron's 24px width so the centered title sits at\n // the true screen center (both flanking elements are equal width).\n style={styles.qrButton}\n >\n <QrCodeIcon />\n </Pressable>\n </Box>\n\n <Box style={styles.content}>\n {/* Network selector */}\n <Pressable\n onPress={onChangeNetwork}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Change network\"\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n backgroundColor=\"bgSecondary\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"button\"\n style={styles.networkRow}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n >\n {networkIcon ?? <NetworkIconFallback />}\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {networkLabel}\n </Text>\n </Box>\n <Text variant=\"bodyMedium\" color=\"textSecondary\">\n Change\n </Text>\n </Box>\n </Pressable>\n\n {/* Deposit address */}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"button\"\n style={styles.addressCard}\n >\n <Box flex={1} style={styles.addressDetails}>\n <Text\n variant=\"detail\"\n color={copied ? 'textSuccess' : 'textSecondary'}\n >\n {copied ? 'Copied!' : depositAddressLabel}\n </Text>\n <Text\n variant=\"bodyMedium\"\n color=\"textPrimary\"\n numberOfLines={1}\n ellipsizeMode=\"middle\"\n >\n {depositAddress}\n </Text>\n </Box>\n <CircleIconButton\n label={copied ? 'Address copied' : 'Copy address'}\n onPress={handleCopy}\n >\n {copied ? (\n <Text color=\"textSuccess\" style={styles.actionGlyph}>\n \u2713\n </Text>\n ) : (\n <CopyIcon />\n )}\n </CircleIconButton>\n <CircleIconButton label=\"Share address\" onPress={onShareAddress}>\n <Text color=\"textPrimary\" style={styles.actionGlyph}>\n \u2191\n </Text>\n </CircleIconButton>\n </Box>\n </Box>\n </Box>\n )\n}\n\n/** 48px circular secondary-surface button (copy / share). */\nfunction CircleIconButton({\n children,\n label,\n onPress,\n}: {\n children: ReactNode\n label: string\n onPress?: () => void\n}) {\n return (\n <Pressable\n onPress={onPress}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n >\n <Box\n width={48}\n height={48}\n borderRadius=\"rounded\"\n backgroundColor=\"bgSecondary\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {children}\n </Box>\n </Pressable>\n )\n}\n\nconst styles = StyleSheet.create({\n topBar: {\n paddingTop: 20,\n paddingBottom: 12,\n paddingHorizontal: 12,\n },\n grabber: {\n position: 'absolute',\n top: 8,\n left: '50%',\n marginLeft: -18,\n width: 36,\n height: 5,\n },\n chevron: {\n fontSize: 26,\n lineHeight: 28,\n width: 24,\n textAlign: 'center',\n },\n qrButton: { width: 24, alignItems: 'center' },\n content: {\n paddingHorizontal: 20,\n paddingBottom: 16,\n paddingTop: 8,\n gap: 8,\n },\n networkRow: { paddingHorizontal: 16, paddingVertical: 10 },\n addressCard: { padding: 16 },\n addressDetails: { gap: 4 },\n actionGlyph: { fontSize: 18, lineHeight: 20, fontWeight: '500' },\n})\n", "import { StyleSheet } from 'react-native'\n\nimport { Box } from '../theme/restyle'\n\n/** Two overlapping rounded squares = copy icon. */\nexport function CopyIcon() {\n return (\n <Box width={18} height={18}>\n <Box borderWidth={1.5} borderColor=\"textPrimary\" style={styles.back} />\n <Box\n borderWidth={1.5}\n borderColor=\"textPrimary\"\n backgroundColor=\"bgSecondary\"\n style={styles.front}\n />\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n back: {\n position: 'absolute',\n right: 0,\n top: 0,\n width: 13,\n height: 13,\n borderRadius: 3,\n },\n front: {\n position: 'absolute',\n left: 0,\n bottom: 0,\n width: 13,\n height: 13,\n borderRadius: 3,\n },\n})\n", "import { Box } from '../theme/restyle'\n\n/** Themed circle placeholder for a host-supplied chain cluster. */\nexport function NetworkIconFallback() {\n return (\n <Box\n width={32}\n height={32}\n borderRadius=\"rounded\"\n backgroundColor=\"pillPressed\"\n />\n )\n}\n", "import { StyleSheet } from 'react-native'\n\nimport { Box } from '../theme/restyle'\n\n/** Minimal 2\u00D72 QR placeholder built from theme-colored boxes. */\nexport function QrCodeIcon() {\n return (\n <Box\n width={20}\n height={20}\n flexDirection=\"row\"\n flexWrap=\"wrap\"\n style={styles.grid}\n >\n {[0, 1, 2, 3].map((i) => (\n <Box\n key={i}\n width={8}\n height={8}\n backgroundColor=\"textPrimary\"\n borderRadius=\"elementInner\"\n />\n ))}\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n grid: { gap: 2 },\n})\n"],
5
- "mappings": ";AAcA,cAAc;;;ACgIP,IAAM,cAA4B;AAAA,EACvC,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,SAAS;AAAA,IACT,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,IACvB,wBAAwB;AAAA,IACxB,MAAM;AAAA,IACN,WAAW;AAAA,IACX,aAAa;AAAA,IACb,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,gBAAgB;AAA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,0BAAAL;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,cAAa;AAAA,UACb,iBAAgB;AAAA,UAChB,YAAW;AAAA,UACX,gBAAe;AAAA,UAEd;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;AAEA,IAAMI,UAASE,YAAW,OAAO;AAAA,EAC/B,QAAQ;AAAA,IACN,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,mBAAmB;AAAA,EACrB;AAAA,EACA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,WAAW;AAAA,EACb;AAAA,EACA,UAAU,EAAE,OAAO,IAAI,YAAY,SAAS;AAAA,EAC5C,SAAS;AAAA,IACP,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,KAAK;AAAA,EACP;AAAA,EACA,YAAY,EAAE,mBAAmB,IAAI,iBAAiB,GAAG;AAAA,EACzD,aAAa,EAAE,SAAS,GAAG;AAAA,EAC3B,gBAAgB,EAAE,KAAK,EAAE;AAAA,EACzB,aAAa,EAAE,UAAU,IAAI,YAAY,IAAI,YAAY,MAAM;AACjE,CAAC;",
6
- "names": ["useContext", "useMemo", "useState", "useState", "useMemo", "useContext", "jsx", "jsx", "jsx", "Pressable", "StyleSheet", "jsx", "jsxs", "styles", "Pressable", "StyleSheet", "useEffect", "useState", "Pressable", "StyleSheet", "StyleSheet", "jsx", "jsxs", "styles", "StyleSheet", "jsx", "StyleSheet", "jsx", "styles", "StyleSheet", "jsx", "jsxs", "useState", "useEffect", "styles", "Pressable", "StyleSheet"]
3
+ "sources": ["../index.ts", "../src/theme/tokens.ts", "../src/theme/toRestyleTheme.ts", "../src/theme/useColorScheme.ts", "../src/theme/useFunkitTheme.ts", "../src/theme/restyle.ts", "../src/flow/AddressCopiedToast.tsx", "../src/icons/FigmaSystemIcons.tsx", "../src/theme/FunkitThemeProvider.tsx", "../src/providers/FunkitProvider.tsx", "../src/flow/FunkitFlowProvider.tsx", "../src/geo/useCheckoutBlocked.ts", "../src/logging/logger.ts", "../src/logging/datadogHttpLogTransport.ts", "../src/geo/isCountryBlocked.ts", "../src/geo/useUserIpInfo.ts", "../src/icons/assetLogos.ts", "../src/icons/CryptoBitcoinIcon.tsx", "../src/icons/FunIcon.tsx", "../src/icons/funIconUri.ts", "../src/icons/QrChainCluster.tsx", "../src/icons/SourceTokenCluster.tsx", "../src/icons/TokenChainIcon.tsx", "../src/screens/AddMoneyScreen.tsx", "../src/screens/AvailableChainsScreen.tsx", "../src/screens/CheckoutBlockedScreen.tsx", "../src/screens/QrCodeScreen.tsx", "../src/icons/CopyAddressIcon.tsx", "../src/screens/TransferCryptoScreen.tsx", "../src/screens/NetworkSelector.tsx", "../src/swapped/SwappedScreen.tsx", "../src/swapped/SwappedWebView.tsx", "../src/swapped/buildSwappedTheme.ts", "../src/swapped/webViewSwappedTransport.ts", "../src/transfer/availableChains.ts", "../src/transfer/clipboard.ts", "../src/transfer/fops.ts", "../src/transfer/formatDepositAddress.ts", "../src/transfer/hooks/useFops.ts", "../src/identity/IdentityContext.tsx", "../src/transfer/hooks/useTransferInit.ts", "../src/transfer/hooks/useUDAParams.ts", "../src/transfer/hooks/useSupportedTokens.ts", "../src/transfer/supportedTokens.ts", "../src/transfer/hooks/useTokenTransfer.ts", "../src/transfer/QrCode.tsx", "../src/flow/depositFlowConfig.ts", "../src/flow/FlowSheet.tsx", "../src/flow/useKeyboardHeight.ts", "../src/version.ts", "../src/providers/FunkitStatsigProvider.tsx", "../src/statsig/useClientAsyncInitRN.ts", "../src/statsig/StatsigClientRN.ts", "../src/statsig/rnSetup.ts", "../src/statsig/appVisibilityShim.ts", "../src/statsig/preloadedAsyncStorage.ts", "../src/statsig/statsigMetadata.ts", "../src/providers/useFunkitCheckout.ts"],
4
+ "sourcesContent": ["// @funkit/connect-rn\n//\n// React Native bindings for Funkit Connect. For now this package re-exports the\n// headless, platform-agnostic surface from @funkit/connect-core so RN consumers\n// have a single `@funkit/connect-rn` entry point. The React Native platform\n// halves \u2014 Restyle theme, WebView Swapped transport, Transfer/Swapped screens,\n// and logging \u2014 are added in subsequent releases.\n//\n// See docs/connect-rn-architecture.md for the rollout plan.\n//\n// TODO(connect-rn): this blanket re-export is a skeleton convenience. Once\n// connect-rn has its own curated public API, replace it with explicit named\n// re-exports (and drop core symbols RN consumers shouldn't reach for) \u2014 this\n// line may be removed entirely.\nexport * from '@funkit/connect-core'\n\n// React Native platform halves \u2014 exported explicitly (no barrels).\n\n// Theme: design tokens.\nexport {\n darkTokens,\n fontFamilyForWeight,\n lightTokens,\n} from './src/theme/tokens'\nexport type {\n FunkitColorTokens,\n FunkitFontTokens,\n FunkitFontWeight,\n FunkitTokens,\n} from './src/theme/tokens'\n\n// Theme: Restyle adapter + prebuilt default themes.\nexport {\n defaultDarkTheme,\n defaultLightTheme,\n toRestyleTheme,\n} from './src/theme/toRestyleTheme'\nexport type { FunkitTheme } from './src/theme/toRestyleTheme'\n\n// Theme: color scheme.\nexport {\n normalizeColorScheme,\n resolveColorScheme,\n useColorScheme,\n} from './src/theme/useColorScheme'\nexport type { ColorScheme, SystemColorScheme } from './src/theme/useColorScheme'\n\n// Theme: standalone theme selector.\nexport { useFunkitTheme } from './src/theme/useFunkitTheme'\nexport type { FunkitThemeSet } from './src/theme/useFunkitTheme'\n\n// Theme: Restyle primitives.\nexport { Box, Text } from './src/theme/restyle'\nexport type { TextProps } from './src/theme/restyle'\n\n// Flow: the animated \"Address copied\" confirmation pill. Presentational +\n// self-animating (reanimated layout animations); the managed flow shows it on\n// deposit-address copy, and it's exported so hosts can reuse the same pill.\nexport { AddressCopiedToast } from './src/flow/AddressCopiedToast'\nexport type { AddressCopiedToastProps } from './src/flow/AddressCopiedToast'\n\n// Theme: styling provider + color-scheme hook.\nexport {\n FunkitThemeProvider,\n useFunkitColorScheme,\n} from './src/theme/FunkitThemeProvider'\nexport type { FunkitThemeProviderProps } from './src/theme/FunkitThemeProvider'\n\n// Top-level, user-facing provider.\nexport { FunkitProvider } from './src/providers/FunkitProvider'\nexport type { FunkitProviderProps } from './src/providers/FunkitProvider'\n// Identity config the host passes to `<FunkitProvider config={...}>`\n// (apiKey + optional externalUserId). The internal FunkitIdentity / identity\n// context stays private \u2014 the host configures via `config` + `walletAddress`.\nexport type { FunkitConfig } from './src/identity/IdentityContext'\n\n// SDK entry hook \u2014 mirrors @funkit/connect's `useFunkitCheckout`. Returns the\n// imperative `beginDeposit` that opens the managed modal flow.\nexport { useFunkitCheckout } from './src/providers/useFunkitCheckout'\nexport type {\n DepositFlowCallbacks,\n DepositFlowConfig,\n DynamicTargetAssetCandidate,\n} from './src/flow/depositFlowConfig'\n// Item/row shapes that make up a `DepositFlowConfig` (the screens that consume\n// them are internal \u2014 the host configures the flow, it never renders screens).\nexport type {\n PaymentMethodOption,\n ReceiveTokenOption,\n} from './src/screens/AddMoneyScreen'\nexport type { ChainOption } from './src/flow/depositFlowConfig'\nexport type {\n SupportedToken,\n TokenChainFilter,\n} from './src/transfer/supportedTokens'\n\n// NOTE on the internal surface (mirrors @funkit/connect, which exports none of\n// this): the screens (`src/screens/*`), the Statsig RN bindings (`src/statsig/*`,\n// AsyncStorage-only, no device-info), the logging transports, identity context,\n// and transfer hooks are all INTERNAL. The host mounts `<FunkitProvider>` and\n// calls `useFunkitCheckout().beginDeposit(...)`; the SDK owns the flow + screens.\n", "// Local design tokens for @funkit/connect-rn, hand-authored from the \"Fun\n// Mobile\" Figma variables export (Light + Dark modes). Variable aliases are\n// resolved to concrete values here.\n//\n// This is connect-rn's OWN theme source \u2014 it is intentionally NOT shared with\n// @funkit/connect-core (web keeps its separate `ThemeVars`). The token taxonomy\n// mirrors the Figma groups: background, content, border, font, spacing, brand,\n// button.\n\nimport type { TextStyle } from 'react-native'\n\n/**\n * Flat color palette (Restyle `colors` must be a flat record). Keys group by\n * role: `bg*` / `btn*` / `pill*` are surface colors, `text*` is foreground\n * content, `onBtn*` is the label/icon color on a button surface, `border*` are\n * stroke colors. Both modes share the same keys; only the values differ.\n */\nexport interface FunkitColorTokens {\n // surfaces\n bgModal: string\n bgSecondary: string\n // primary button surface\n btnPrimary: string\n btnPrimaryHover: string\n btnPrimaryPressed: string\n btnPrimaryFocused: string\n btnPrimaryDisabled: string\n // secondary button surface\n btnSecondary: string\n btnSecondaryHover: string\n btnSecondaryPressed: string\n btnSecondaryFocused: string\n btnSecondaryDisabled: string\n // tertiary button surface\n btnTertiary: string\n btnTertiaryHover: string\n btnTertiaryPressed: string\n btnTertiaryFocused: string\n btnTertiaryDisabled: string\n // icon button surface\n btnIcon: string\n btnIconHover: string\n btnIconPressed: string\n btnIconFocused: string\n btnIconDisabled: string\n // destructive button surface\n btnDestructive: string\n btnDestructiveHover: string\n btnDestructivePressed: string\n btnDestructiveFocused: string\n btnDestructiveDisabled: string\n // pill surface\n pill: string\n pillHover: string\n pillPressed: string\n pillFocused: string\n pillDisabled: string\n // foreground content\n textPrimary: string\n textSecondary: string\n textSuccess: string\n textError: string\n textHyperlink: string\n textWarning: string\n // label/icon color on button surfaces\n onBtnPrimary: string\n onBtnPrimaryLoading: string\n onBtnSecondary: string\n onBtnSecondaryLoading: string\n onBtnTertiary: string\n onBtnIcon: string\n onBtnDestructive: string\n onBtnDestructiveLoading: string\n // strokes\n borderModal: string\n borderDefault: string\n borderFocused: string\n borderSelected: string\n borderBtnPrimary: string\n borderBtnSecondary: string\n // brand\n brandPrimary: string\n}\n\n/**\n * Logical text weights connect-rn's text styles come in. The Fun Mobile design\n * only defines these two cuts \u2014 there is intentionally no semibold/bold in the\n * token set, so any `fontWeight: '600'`/`'700'` in a component is a smell that\n * should route through one of these instead.\n */\nexport type FunkitFontWeight = 'base' | 'medium'\n\nexport interface FunkitFontTokens {\n /**\n * Logical font family the design renders in. Defaults to `'System'` (the\n * platform UI font \u2014 SF on iOS, Roboto on Android) so connect-rn needs no\n * font assets out of the box. Hosts that want a custom typeface override this\n * in their tokens and register the matching font files. Concrete per-weight\n * family names are derived from this \u2014 see {@link fontFamilyForWeight}.\n */\n family: string\n /**\n * One entry per {@link FunkitFontWeight}. `familySuffix` builds the native\n * font family the host registers (`${family}-${familySuffix}` \u2192 e.g.\n * `Inter-Medium`); `cssWeight` is the matching numeric weight, kept for two\n * reasons: the Swapped WebView theme renders in CSS where `font-weight` works\n * normally, and it lets text degrade to the right weight on the *system* font\n * when the host hasn't loaded a custom font.\n *\n * Omit `familySuffix` only for the **system** font (`family: 'System'`) \u2014 the\n * one family where `fontWeight` actually selects the cut. Then every weight\n * shares the bare `family` and `cssWeight` does the work; see\n * {@link fontFamilyForWeight}.\n */\n weights: Record<\n FunkitFontWeight,\n { familySuffix?: string; cssWeight: TextStyle['fontWeight'] }\n >\n}\n\n/**\n * connect-rn's default font cuts \u2014 the **system** UI font. `family: 'System'`\n * resolves to SF on iOS and Roboto on Android, so the package renders correctly\n * with no font assets registered by the host. The system font is the one family\n * where `fontWeight` actually selects the cut, so each weight omits\n * `familySuffix` and leans on `cssWeight` (see {@link fontFamilyForWeight}).\n */\nconst systemFontTokens: FunkitFontTokens = {\n family: 'System',\n weights: {\n base: { cssWeight: '400' },\n medium: { cssWeight: '500' },\n },\n}\n\n/**\n * Resolves a logical font weight to the concrete native font-family name the\n * host must register \u2014 e.g. `'medium'` \u2192 `'Inter-Medium'`.\n *\n * This is connect-rn's whole answer to a React Native / Expo quirk: you cannot\n * reliably select a custom font's weight via `fontWeight`. Android matches custom\n * fonts by exact family-name string, and a font loaded at runtime (`expo-font`)\n * registers one native Typeface per name \u2014 so `fontWeight: '500'` on\n * `fontFamily: 'Inter'` is silently ignored and every weight renders identically.\n * Weight therefore has to be baked into the family name, and every text style\n * goes through here.\n */\nexport function fontFamilyForWeight(\n fonts: FunkitFontTokens,\n weight: FunkitFontWeight,\n): string {\n const { familySuffix } = fonts.weights[weight]\n // No suffix \u2192 a single family that selects its weight via `fontWeight`. Only\n // the system font behaves this way; custom fonts need a distinct family per cut.\n return familySuffix ? `${fonts.family}-${familySuffix}` : fonts.family\n}\n\nexport interface FunkitTokens {\n colors: FunkitColorTokens\n radii: {\n modal: number\n element: number\n elementInner: number\n button: number\n rounded: number\n }\n borderWidths: {\n modal: number\n elementsDefault: number\n elementsFocused: number\n elementsSelected: number\n button: number\n }\n spacing: {\n none: number\n elementsHorizontal: number\n modalHorizontal: number\n }\n sizes: {\n topBar: number\n buttonHeight: number\n buttonXs: number\n buttonSm: number\n buttonMd: number\n buttonLg: number\n // Icon tiers intentionally collapse per the Figma export: xs === sm (16)\n // and md === lg (20). The four tiers are kept so call sites can stay\n // semantic even though some resolve to the same value today.\n iconXs: number\n iconSm: number\n iconMd: number\n iconLg: number\n }\n fonts: FunkitFontTokens\n fontSizes: {\n bodyBase: number\n bodyDetail: number\n // Per Figma, `headerTitle` (13) is the small modal top-bar title and\n // `headerSubtitle` (15) sits below it slightly larger \u2014 intentionally the\n // reverse of the usual title>subtitle hierarchy. Not a typo.\n headerTitle: number\n headerSubtitle: number\n amountInput: number\n amountSummary: number\n }\n // Line heights (absolute px, per RN's TextStyle.lineHeight) for the body text\n // styles, mirroring the Figma `font/body/leading/*` variables (base 22,\n // detail 20). Optional so existing consumers that hand-build `FunkitTokens`\n // keep compiling; `toRestyleTheme` falls back to the Figma defaults when it's\n // absent. Header/amount styles are single-line and intentionally omitted.\n fontLineHeights?: {\n bodyBase: number\n bodyDetail: number\n }\n}\n\nexport const lightTokens: FunkitTokens = {\n colors: {\n bgModal: '#FFFFFF',\n bgSecondary: '#F9F9F9',\n btnPrimary: '#0F0F0F',\n btnPrimaryHover: '#1B1B1B',\n btnPrimaryPressed: '#1B1B1B',\n btnPrimaryFocused: '#0F0F0F',\n btnPrimaryDisabled: '#0F0F0F',\n btnSecondary: '#F9F9F9',\n btnSecondaryHover: '#EFEFEF',\n btnSecondaryPressed: '#DDDDDD',\n btnSecondaryFocused: '#F9F9F9',\n btnSecondaryDisabled: '#F9F9F9',\n btnTertiary: '#FFFFFF',\n btnTertiaryHover: '#F9F9F9',\n btnTertiaryPressed: '#EFEFEF',\n btnTertiaryFocused: '#FFFFFF',\n btnTertiaryDisabled: '#FFFFFF',\n btnIcon: '#FFFFFF',\n btnIconHover: '#F9F9F9',\n btnIconPressed: '#EFEFEF',\n btnIconFocused: '#FFFFFF',\n btnIconDisabled: '#FFFFFF',\n btnDestructive: '#F34126',\n btnDestructiveHover: '#DB3B22',\n btnDestructivePressed: '#C2341E',\n btnDestructiveFocused: '#F34126',\n btnDestructiveDisabled: '#F34126',\n pill: '#FFFFFF',\n pillHover: '#F9F9F9',\n pillPressed: '#EFEFEF',\n pillFocused: '#FFFFFF',\n pillDisabled: '#FFFFFF',\n textPrimary: '#0F0F0F',\n textSecondary: '#6C6C6C',\n textSuccess: '#52A300',\n textError: '#F34126',\n textHyperlink: '#0F0F0F',\n textWarning: '#F97316',\n onBtnPrimary: '#FFFFFF',\n onBtnPrimaryLoading: '#FFFFFF',\n onBtnSecondary: '#0F0F0F',\n onBtnSecondaryLoading: '#000000',\n onBtnTertiary: '#0F0F0F',\n onBtnIcon: '#6C6C6C',\n onBtnDestructive: '#FFFFFF',\n onBtnDestructiveLoading: '#FFFFFF',\n borderModal: '#FFFFFF',\n borderDefault: '#EFEFEF',\n borderFocused: '#BEBEBE',\n borderSelected: '#0F0F0F',\n borderBtnPrimary: '#0F0F0F',\n borderBtnSecondary: '#F9F9F9',\n brandPrimary: '#0F0F0F',\n },\n radii: {\n modal: 24,\n element: 12,\n elementInner: 8,\n button: 12,\n rounded: 999,\n },\n borderWidths: {\n modal: 1,\n elementsDefault: 1,\n elementsFocused: 2,\n elementsSelected: 1,\n button: 0,\n },\n spacing: {\n none: 0,\n elementsHorizontal: 12,\n modalHorizontal: 16,\n },\n sizes: {\n topBar: 56,\n buttonHeight: 42,\n buttonXs: 32,\n buttonSm: 36,\n buttonMd: 40,\n buttonLg: 48,\n iconXs: 16,\n iconSm: 16,\n iconMd: 20,\n iconLg: 20,\n },\n fonts: systemFontTokens,\n fontSizes: {\n bodyBase: 16,\n bodyDetail: 14,\n headerTitle: 13,\n headerSubtitle: 15,\n amountInput: 48,\n amountSummary: 48,\n },\n fontLineHeights: {\n bodyBase: 22,\n bodyDetail: 20,\n },\n}\n\nexport const darkTokens: FunkitTokens = {\n colors: {\n bgModal: '#0F0F0F',\n bgSecondary: '#1B1B1B',\n btnPrimary: '#F9F9F9',\n btnPrimaryHover: '#EFEFEF',\n btnPrimaryPressed: '#EFEFEF',\n btnPrimaryFocused: '#F9F9F9',\n btnPrimaryDisabled: '#F9F9F9',\n btnSecondary: '#1B1B1B',\n btnSecondaryHover: '#2D2D2D',\n btnSecondaryPressed: '#464646',\n btnSecondaryFocused: '#1B1B1B',\n btnSecondaryDisabled: '#1B1B1B',\n btnTertiary: '#0F0F0F',\n btnTertiaryHover: '#2D2D2D',\n btnTertiaryPressed: '#464646',\n btnTertiaryFocused: '#0F0F0F',\n btnTertiaryDisabled: '#0F0F0F',\n btnIcon: '#0F0F0F',\n btnIconHover: '#1B1B1B',\n btnIconPressed: '#2D2D2D',\n btnIconFocused: '#0F0F0F',\n btnIconDisabled: '#0F0F0F',\n btnDestructive: '#DB3B22',\n btnDestructiveHover: '#F34126',\n btnDestructivePressed: '#F88877',\n btnDestructiveFocused: '#DB3B22',\n btnDestructiveDisabled: '#DB3B22',\n pill: '#0F0F0F',\n pillHover: '#1B1B1B',\n pillPressed: '#2D2D2D',\n pillFocused: '#0F0F0F',\n pillDisabled: '#0F0F0F',\n textPrimary: '#FFFFFF',\n textSecondary: '#929292',\n textSuccess: '#52A300',\n textError: '#F34126',\n textHyperlink: '#4971F0',\n textWarning: '#F97316',\n onBtnPrimary: '#000000',\n onBtnPrimaryLoading: '#000000',\n onBtnSecondary: '#F9F9F9',\n onBtnSecondaryLoading: '#FFFFFF',\n onBtnTertiary: '#F9F9F9',\n onBtnIcon: '#929292',\n onBtnDestructive: '#FFFFFF',\n onBtnDestructiveLoading: '#FFFFFF',\n borderModal: '#1B1B1B',\n borderDefault: '#2D2D2D',\n borderFocused: '#464646',\n borderSelected: '#F9F9F9',\n borderBtnPrimary: '#F9F9F9',\n borderBtnSecondary: '#1B1B1B',\n brandPrimary: '#FFFFFF',\n },\n radii: {\n modal: 24,\n element: 12,\n elementInner: 8,\n button: 24,\n rounded: 999,\n },\n borderWidths: {\n modal: 1,\n elementsDefault: 1,\n elementsFocused: 2,\n elementsSelected: 1,\n button: 0,\n },\n spacing: {\n none: 0,\n elementsHorizontal: 12,\n modalHorizontal: 16,\n },\n sizes: {\n topBar: 56,\n buttonHeight: 42,\n buttonXs: 32,\n buttonSm: 36,\n buttonMd: 40,\n buttonLg: 48,\n iconXs: 16,\n iconSm: 16,\n iconMd: 20,\n iconLg: 20,\n },\n fonts: systemFontTokens,\n fontSizes: {\n bodyBase: 16,\n bodyDetail: 14,\n headerTitle: 13,\n headerSubtitle: 15,\n amountInput: 32,\n amountSummary: 40,\n },\n fontLineHeights: {\n bodyBase: 22,\n bodyDetail: 20,\n },\n}\n", "import { createTheme } from '@shopify/restyle'\n\nimport {\n darkTokens,\n type FunkitTokens,\n fontFamilyForWeight,\n lightTokens,\n} from './tokens'\n\n/**\n * Adapts connect-rn's local {@link FunkitTokens} into a `@shopify/restyle`\n * theme. Colors are concrete hex (no CSS-var indirection like web), and the\n * numeric tokens map straight onto the unitless values Restyle / RN style props\n * expect \u2014 so the mapping is a direct projection of the token groups onto\n * Restyle's standard keys (`colors`, `spacing`, `borderRadii`, `borderWidths`,\n * `textVariants`, `breakpoints`) plus a custom `sizes` group.\n */\nexport function toRestyleTheme(tokens: FunkitTokens) {\n // Figma `font/body/leading/*`: base 22, detail 20. `fontLineHeights` is\n // optional on FunkitTokens (back-compat for hand-built tokens), so fall back\n // to the design defaults when a consumer's tokens predate it.\n const bodyLineHeight = tokens.fontLineHeights?.bodyBase ?? 22\n const detailLineHeight = tokens.fontLineHeights?.bodyDetail ?? 20\n\n // Weight is carried by the family name (RN/Expo can't select a custom font's\n // weight via `fontWeight`); `cssWeight` is kept alongside only for the Swapped\n // WebView (CSS) theme and the system-font fallback. See `fontFamilyForWeight`.\n const base = {\n fontFamily: fontFamilyForWeight(tokens.fonts, 'base'),\n fontWeight: tokens.fonts.weights.base.cssWeight,\n }\n const medium = {\n fontFamily: fontFamilyForWeight(tokens.fonts, 'medium'),\n fontWeight: tokens.fonts.weights.medium.cssWeight,\n }\n\n return createTheme({\n colors: {\n ...tokens.colors,\n transparent: 'transparent',\n },\n spacing: tokens.spacing,\n borderRadii: tokens.radii,\n borderWidths: tokens.borderWidths,\n sizes: tokens.sizes,\n breakpoints: {\n phone: 0,\n tablet: 768,\n },\n textVariants: {\n defaults: {\n ...base,\n fontSize: tokens.fontSizes.bodyBase,\n lineHeight: bodyLineHeight,\n color: 'textPrimary',\n },\n body: {\n ...base,\n fontSize: tokens.fontSizes.bodyBase,\n lineHeight: bodyLineHeight,\n color: 'textPrimary',\n },\n bodyMedium: {\n ...medium,\n fontSize: tokens.fontSizes.bodyBase,\n lineHeight: bodyLineHeight,\n color: 'textPrimary',\n },\n detail: {\n ...base,\n fontSize: tokens.fontSizes.bodyDetail,\n lineHeight: detailLineHeight,\n color: 'textSecondary',\n },\n headerTitle: {\n ...medium,\n fontSize: tokens.fontSizes.headerTitle,\n color: 'textPrimary',\n textAlign: 'center',\n },\n headerSubtitle: {\n ...medium,\n fontSize: tokens.fontSizes.headerSubtitle,\n color: 'textSecondary',\n textAlign: 'center',\n },\n amountInput: {\n ...medium,\n fontSize: tokens.fontSizes.amountInput,\n color: 'textPrimary',\n },\n amountSummary: {\n ...medium,\n fontSize: tokens.fontSizes.amountSummary,\n color: 'textPrimary',\n },\n },\n // Per-weight `{ fontFamily, fontWeight }` the `Text` `weight` prop applies on\n // top of any variant. Weight selection must set BOTH for custom fonts (see\n // `fontFamilyForWeight`), so this reuses the exact `base`/`medium` the\n // variants use \u2014 letting a node override only its weight (e.g.\n // `variant=\"detail\" weight=\"medium\"`) without a `*Medium` twin per variant.\n textWeights: {\n base,\n medium,\n },\n })\n}\n\n/** The Restyle theme type all connect-rn components are written against. */\nexport type FunkitTheme = ReturnType<typeof toRestyleTheme>\n\n/** Built-in default Restyle themes derived from the Fun Mobile Light/Dark tokens. */\nexport const defaultLightTheme = toRestyleTheme(lightTokens)\nexport const defaultDarkTheme = toRestyleTheme(darkTokens)\n", "import { useEffect, useState } from 'react'\nimport { Appearance, type ColorSchemeName } from 'react-native'\n\nexport type SystemColorScheme = 'light' | 'dark' | undefined\n\n/** A concrete, resolved color scheme (never undefined). */\nexport type ColorScheme = 'light' | 'dark'\n\n/**\n * Resolve the active color scheme with this precedence (pure, exported for\n * testing):\n * 1. `controlled` \u2014 the `FunkitProvider` `colorScheme` prop. When set, it\n * wins over everything, so a manual toggle / system change can't move it.\n * 2. `override` \u2014 a manual `toggleColorScheme()` choice (uncontrolled only).\n * 3. `system` \u2014 the live OS Appearance.\n * 4. `'light'` \u2014 fallback when the system scheme is unknown.\n */\nexport function resolveColorScheme(\n controlled: ColorScheme | undefined,\n override: ColorScheme | undefined,\n system: SystemColorScheme,\n): ColorScheme {\n if (controlled) {\n return controlled\n }\n return override ?? system ?? 'light'\n}\n\n/**\n * Normalize React Native's `ColorSchemeName` (`'light' | 'dark' | null |\n * undefined`) to `'light' | 'dark' | undefined`. Pure \u2014 exported for testing.\n */\nexport function normalizeColorScheme(\n scheme: ColorSchemeName | null | undefined,\n): SystemColorScheme {\n return scheme === 'light' || scheme === 'dark' ? scheme : undefined\n}\n\n/**\n * Reads the system color scheme from RN's `Appearance` API and re-renders on\n * change. The RN counterpart to web's `prefers-color-scheme` media query.\n */\nexport function useColorScheme(): SystemColorScheme {\n const [scheme, setScheme] = useState<SystemColorScheme>(() =>\n normalizeColorScheme(Appearance.getColorScheme()),\n )\n\n useEffect(() => {\n const subscription = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(normalizeColorScheme(colorScheme))\n })\n return () => subscription.remove()\n }, [])\n\n return scheme\n}\n", "import { useMemo } from 'react'\n\nimport {\n defaultDarkTheme,\n defaultLightTheme,\n type FunkitTheme,\n} from './toRestyleTheme'\nimport { type SystemColorScheme, useColorScheme } from './useColorScheme'\n\n/**\n * A light/dark Restyle theme set. **At least one mode must be provided**; a\n * missing mode falls back to the one that is set. Only Restyle themes (produced\n * by `toRestyleTheme`) are accepted \u2014 raw token objects are not, so callers\n * can't accidentally pass a half-built theme.\n */\nexport type FunkitThemeSet =\n | { light: FunkitTheme; dark?: FunkitTheme }\n | { light?: FunkitTheme; dark: FunkitTheme }\n\nconst DEFAULT_THEME_SET: FunkitThemeSet = {\n light: defaultLightTheme,\n dark: defaultDarkTheme,\n}\n\n/**\n * Pick the Restyle theme for a color scheme, falling back to the other mode\n * when the requested one isn't in the set. The `FunkitThemeSet` union\n * guarantees at least one mode is present.\n */\nexport function selectTheme(\n themeSet: FunkitThemeSet,\n scheme: SystemColorScheme,\n): FunkitTheme {\n const primary = scheme === 'dark' ? themeSet.dark : themeSet.light\n const fallback = scheme === 'dark' ? themeSet.light : themeSet.dark\n if (primary) {\n return primary\n }\n if (fallback) {\n return fallback\n }\n // Unreachable for typed callers; guards untyped (JS) misuse.\n throw new Error(\n 'FunkitProvider: `themes` must include at least one of { light, dark }',\n )\n}\n\n/**\n * Resolves the active Restyle theme from the live system color scheme, to hand\n * to Restyle's `ThemeProvider`. Pass a custom theme set to override the\n * built-in Fun Mobile themes. Falls back to light when the system scheme is\n * unknown.\n */\nexport function useFunkitTheme(\n themeSet: FunkitThemeSet = DEFAULT_THEME_SET,\n): FunkitTheme {\n const scheme = useColorScheme()\n // Depend on the individual theme refs, not the `themeSet` object \u2014 an inline\n // set is a new object each render and would defeat the memo.\n return useMemo(\n () => selectTheme(themeSet, scheme),\n [scheme, themeSet.light, themeSet.dark],\n )\n}\n", "import {\n createBox,\n createText,\n useTheme as useRestyleTheme,\n} from '@shopify/restyle'\nimport {\n type ComponentProps,\n type ComponentRef,\n createElement,\n forwardRef,\n} from 'react'\n\nimport type { FunkitTheme } from './toRestyleTheme'\nimport type { FunkitFontWeight } from './tokens'\n\n/**\n * `@shopify/restyle` primitives bound to the connect-rn {@link FunkitTheme}.\n * Components use these instead of raw `View` / `Text` so style props\n * (`backgroundColor`, `padding`, `borderRadius`, `variant`, \u2026) resolve to theme\n * tokens with full type safety.\n */\nexport const Box = createBox<FunkitTheme>()\n\nconst RestyleText = createText<FunkitTheme>()\n\nexport interface TextProps extends ComponentProps<typeof RestyleText> {\n /**\n * Override the font weight for this node regardless of `variant`. Applies the\n * resolved per-cut family AND numeric weight \u2014 both are required, since RN/Expo\n * can't select a custom font's weight via `fontWeight` alone (see\n * {@link fontFamilyForWeight}). So `variant=\"detail\" weight=\"medium\"` renders\n * the detail style in `Inter-Medium`. An explicit `style` still wins over it.\n */\n weight?: FunkitFontWeight\n}\n\n/**\n * {@link FunkitTheme}-bound Restyle `Text` with a `weight` escape hatch: set\n * `weight` to render a single node at a different cut than its `variant` without\n * minting a `*Medium` twin variant. Without `weight` it's the plain Restyle Text.\n */\nexport const Text = forwardRef<ComponentRef<typeof RestyleText>, TextProps>(\n function Text({ weight, style, ...rest }, ref) {\n const theme = useRestyleTheme<FunkitTheme>()\n // Apply the weight override *before* `style` so a caller's explicit style\n // still wins; `?.` guards mocked themes that omit `textWeights`.\n const weightStyle = weight ? theme.textWeights?.[weight] : undefined\n return createElement(RestyleText, {\n ref,\n style: weightStyle ? [weightStyle, style] : style,\n ...rest,\n })\n },\n)\n\n/** {@link FunkitTheme}-typed `useTheme`, for reading raw token values. */\nexport const useTheme = () => useRestyleTheme<FunkitTheme>()\n", "import { StyleSheet, Text, type TextStyle, type ViewStyle } from 'react-native'\nimport Animated, { Easing, FadeOutUp, Keyframe } from 'react-native-reanimated'\n\nimport { FigmaSuccessCheckIcon } from '../icons/FigmaSystemIcons'\n\n/**\n * The \"Address copied\" confirmation pill (Figma: Fun Mobile deposit toast). A\n * white rounded pill with the label + a green success check, matching the\n * static reference used by the Storybook `screens-transfercrypto--address-copied`\n * frame 1:1 (white bg, h42, px16, radius999, gap6, soft shadow, #111/16/500).\n *\n * Purely presentational + self-animating on mount/unmount \u2014 it owns NO timer and\n * NO positioning. The parent (the deposit flow) mounts/unmounts it to show/hide\n * and absolutely-positions it; mounting plays the enter animation, unmounting\n * plays the exit. Built on `react-native-reanimated` layout animations, which\n * run inside the gorhom bottom-sheet the flow renders in.\n */\nexport interface AddressCopiedToastProps {\n /** Pill label. Defaults to \"Address copied\". */\n label?: string\n}\n\n// Enter: slide up ~8px + fade in + scale 0.96\u21921 with a bouncy overshoot,\n// matching the web motion spec (CSS cubic-bezier(0.34, 1.36, 0.64, 1) over\n// ~450ms). The easing on the final keyframe drives the transition into it.\nconst enterAnimation = new Keyframe({\n 0: {\n opacity: 0,\n transform: [{ translateY: 8 }, { scale: 0.96 }],\n },\n 100: {\n opacity: 1,\n transform: [{ translateY: 0 }, { scale: 1 }],\n easing: Easing.bezier(0.34, 1.36, 0.64, 1),\n },\n}).duration(450)\n\n// Exit: fade + lift away over 350ms, matching the toast-close timing.\nconst exitAnimation = FadeOutUp.duration(350)\n\nexport function AddressCopiedToast({\n label = 'Address copied',\n}: AddressCopiedToastProps) {\n return (\n <Animated.View\n entering={enterAnimation}\n exiting={exitAnimation}\n style={styles.pill}\n accessibilityRole=\"alert\"\n accessibilityLabel={label}\n >\n <Text style={styles.label}>{label}</Text>\n <FigmaSuccessCheckIcon size={16} />\n </Animated.View>\n )\n}\n\nconst pill: ViewStyle = {\n height: 42,\n paddingHorizontal: 16,\n borderRadius: 999,\n backgroundColor: '#ffffff',\n flexDirection: 'row',\n alignItems: 'center',\n gap: 6,\n shadowColor: '#000000',\n shadowOpacity: 0.08,\n shadowOffset: { width: 0, height: 4 },\n shadowRadius: 12,\n}\nconst label: TextStyle = {\n color: '#111111',\n fontSize: 16,\n fontWeight: '500',\n}\n\nconst styles = StyleSheet.create({ pill, label })\n", "import { SvgXml } from 'react-native-svg'\n\nimport { useTheme } from '../theme/restyle'\n\ntype IconProps = {\n size?: number\n color?: string\n}\n\nfunction useIconColor(color?: string) {\n const theme = useTheme()\n return color ?? theme.colors.textPrimary\n}\n\nfunction renderIcon(svg: string, size: number, color: string) {\n return (\n <SvgXml\n xml={svg.replace(/currentColor/g, color)}\n width={size}\n height={size}\n />\n )\n}\n\n// Exact SVG icons exported from the Fun Mobile Figma file (node 10121:4436,\n// \"Fun Mobile (Copy)\" icon export set). Monochrome fills/strokes are swapped to\n// `currentColor` so the icons inherit theme colors; the success check keeps its\n// semantic green. Geometry is byte-for-byte from the export \u2014 nothing composed.\nconst CLOSE_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.41291 3.08709C4.0468 2.72097 3.4532 2.72097 3.08709 3.08709C2.72097 3.4532 2.72097 4.0468 3.08709 4.41291L8.67417 10L3.08709 15.5871C2.72097 15.9532 2.72097 16.5468 3.08709 16.9129C3.4532 17.279 4.0468 17.279 4.41291 16.9129L10 11.3258L15.5871 16.9129C15.9532 17.279 16.5468 17.279 16.9129 16.9129C17.279 16.5468 17.279 15.9532 16.9129 15.5871L11.3258 10L16.9129 4.41291C17.279 4.0468 17.279 3.4532 16.9129 3.08709C16.5468 2.72097 15.9532 2.72097 15.5871 3.08709L10 8.67417L4.41291 3.08709Z\" fill=\"currentColor\"/></svg>'\n\nconst QR_SCAN_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.83333 9.99935H10V14.166M2.50833 9.99935H2.5M6.675 14.166H6.66667M10.0083 17.4993H10M17.5083 9.99935H17.5M2.5 14.166H3.75M12.9167 9.99935H14.5833M2.5 17.4993H6.66667M10 1.66602V6.66602M14.6667 17.4993H16.1667C16.6334 17.4993 16.8667 17.4993 17.045 17.4085C17.2018 17.3286 17.3293 17.2011 17.4092 17.0443C17.5 16.8661 17.5 16.6327 17.5 16.166V14.666C17.5 14.1993 17.5 13.966 17.4092 13.7877C17.3293 13.6309 17.2018 13.5034 17.045 13.4235C16.8667 13.3327 16.6334 13.3327 16.1667 13.3327H14.6667C14.2 13.3327 13.9666 13.3327 13.7883 13.4235C13.6315 13.5034 13.5041 13.6309 13.4242 13.7877C13.3333 13.966 13.3333 14.1993 13.3333 14.666V16.166C13.3333 16.6327 13.3333 16.8661 13.4242 17.0443C13.5041 17.2011 13.6315 17.3286 13.7883 17.4085C13.9666 17.4993 14.2 17.4993 14.6667 17.4993ZM14.6667 6.66602H16.1667C16.6334 6.66602 16.8667 6.66602 17.045 6.57519C17.2018 6.49529 17.3293 6.36781 17.4092 6.21101C17.5 6.03275 17.5 5.79939 17.5 5.33268V3.83268C17.5 3.36597 17.5 3.13262 17.4092 2.95436C17.3293 2.79756 17.2018 2.67007 17.045 2.59018C16.8667 2.49935 16.6334 2.49935 16.1667 2.49935H14.6667C14.2 2.49935 13.9666 2.49935 13.7883 2.59018C13.6315 2.67007 13.5041 2.79756 13.4242 2.95436C13.3333 3.13262 13.3333 3.36597 13.3333 3.83268V5.33268C13.3333 5.79939 13.3333 6.03275 13.4242 6.21101C13.5041 6.36781 13.6315 6.49529 13.7883 6.57519C13.9666 6.66602 14.2 6.66602 14.6667 6.66602ZM3.83333 6.66602H5.33333C5.80004 6.66602 6.0334 6.66602 6.21166 6.57519C6.36846 6.49529 6.49594 6.36781 6.57584 6.21101C6.66667 6.03275 6.66667 5.79939 6.66667 5.33268V3.83268C6.66667 3.36597 6.66667 3.13262 6.57584 2.95436C6.49594 2.79756 6.36846 2.67007 6.21166 2.59018C6.0334 2.49935 5.80004 2.49935 5.33333 2.49935H3.83333C3.36662 2.49935 3.13327 2.49935 2.95501 2.59018C2.79821 2.67007 2.67072 2.79756 2.59083 2.95436C2.5 3.13262 2.5 3.36597 2.5 3.83268V5.33268C2.5 5.79939 2.5 6.03275 2.59083 6.21101C2.67072 6.36781 2.79821 6.49529 2.95501 6.57519C3.13327 6.66602 3.36662 6.66602 3.83333 6.66602Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\nconst COPY_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.6 10.4V12.08C5.6 12.7521 5.6 13.0881 5.73079 13.3448C5.84584 13.5706 6.02942 13.7542 6.25521 13.8692C6.51191 14 6.84794 14 7.52 14H12.08C12.7521 14 13.0881 14 13.3448 13.8692C13.5706 13.7542 13.7542 13.5706 13.8692 13.3448C14 13.0881 14 12.7521 14 12.08V7.52C14 6.84794 14 6.51191 13.8692 6.25521C13.7542 6.02942 13.5706 5.84584 13.3448 5.73079C13.0881 5.6 12.7521 5.6 12.08 5.6H10.4M3.92 10.4H8.48C9.15206 10.4 9.48809 10.4 9.74479 10.2692C9.97058 10.1542 10.1542 9.97058 10.2692 9.74479C10.4 9.48809 10.4 9.15206 10.4 8.48V3.92C10.4 3.24794 10.4 2.91191 10.2692 2.65521C10.1542 2.42942 9.97058 2.24584 9.74479 2.13079C9.48809 2 9.15206 2 8.48 2H3.92C3.24794 2 2.91191 2 2.65521 2.13079C2.42942 2.24584 2.24584 2.42942 2.13079 2.65521C2 2.91191 2 3.24794 2 3.92V8.48C2 9.15206 2 9.48809 2.13079 9.74479C2.24584 9.97058 2.42942 10.1542 2.65521 10.2692C2.91191 10.4 3.24794 10.4 3.92 10.4Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\nconst SHARE_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M14 8V10.8C14 11.9201 14 12.4802 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.4802 14 11.9201 14 10.8 14H5.2C4.07989 14 3.51984 14 3.09202 13.782C2.71569 13.5903 2.40973 13.2843 2.21799 12.908C2 12.4802 2 11.9201 2 10.8V8M5.33333 4.66667L8 2L10.6667 4.66667M8 2V10\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\nconst CHEVRON_RIGHT_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.71967 12.5303C5.42678 12.2374 5.42678 11.7626 5.71967 11.4697L9.18934 8L5.71967 4.53033C5.42678 4.23744 5.42678 3.76256 5.71967 3.46967C6.01256 3.17678 6.48744 3.17678 6.78033 3.46967L10.7803 7.46967C11.0732 7.76256 11.0732 8.23744 10.7803 8.53033L6.78033 12.5303C6.48744 12.8232 6.01256 12.8232 5.71967 12.5303Z\" fill=\"currentColor\"/></svg>'\n\nconst CHEVRON_LEFT_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.8504 15.6629C13.2165 15.2968 13.2165 14.7032 12.8504 14.3371L8.51333 10L12.8504 5.66291C13.2165 5.2968 13.2165 4.7032 12.8504 4.33709C12.4843 3.97097 11.8907 3.97097 11.5246 4.33709L6.52459 9.33709C6.15847 9.7032 6.15847 10.2968 6.52459 10.6629L11.5246 15.6629C11.8907 16.029 12.4843 16.029 12.8504 15.6629Z\" fill=\"currentColor\"/></svg>'\n\n// Semantic success check-in-circle \u2014 keeps its Figma green (#52A300) regardless\n// of theme color, since it signals a confirmed action (\"Address copied\").\nconst SUCCESS_CHECK_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.5 8.5L7 10L10.5 6.5M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z\" stroke=\"#52A300\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\n// The Fun Mobile export set does not include a down-chevron or a plain selection\n// check (the token dropdown's expanded state is not part of the exported frames),\n// so these stay as the matching Fun Brand Guidelines system glyphs.\nconst CHEVRON_DOWN_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.46967 5.71967C3.76256 5.42678 4.23744 5.42678 4.53033 5.71967L8 9.18934L11.4697 5.71967C11.7626 5.42678 12.2374 5.42678 12.5303 5.71967C12.8232 6.01256 12.8232 6.48744 12.5303 6.78033L8.53033 10.7803C8.23744 11.0732 7.76256 11.0732 7.46967 10.7803L3.46967 6.78033C3.17678 6.48744 3.17678 6.01256 3.46967 5.71967Z\" fill=\"currentColor\"/></svg>'\n\nconst CHECK_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.8047 4.19526C14.0651 4.45561 14.0651 4.87772 13.8047 5.13807L6.80474 12.1381C6.54439 12.3984 6.12228 12.3984 5.86193 12.1381L2.5286 8.80474C2.26825 8.54439 2.26825 8.12228 2.5286 7.86193C2.78895 7.60158 3.21106 7.60158 3.4714 7.86193L6.33333 10.7239L12.8619 4.19526C13.1223 3.93491 13.5444 3.93491 13.8047 4.19526Z\" fill=\"currentColor\"/></svg>'\n\nexport function FigmaCloseIcon({ size = 20, color }: IconProps) {\n return renderIcon(CLOSE_SVG, size, useIconColor(color))\n}\n\nexport function FigmaQrScanIcon({ size = 20, color }: IconProps) {\n return renderIcon(QR_SCAN_SVG, size, useIconColor(color))\n}\n\nexport function FigmaCopyIcon({ size = 16, color }: IconProps) {\n return renderIcon(COPY_SVG, size, useIconColor(color))\n}\n\nexport function FigmaShareIcon({ size = 16, color }: IconProps) {\n return renderIcon(SHARE_SVG, size, useIconColor(color))\n}\n\nexport function FigmaChevronRightIcon({ size = 16, color }: IconProps) {\n return renderIcon(CHEVRON_RIGHT_SVG, size, useIconColor(color))\n}\n\nexport function FigmaChevronLeftIcon({ size = 20, color }: IconProps) {\n return renderIcon(CHEVRON_LEFT_SVG, size, useIconColor(color))\n}\n\nexport function FigmaSuccessCheckIcon({ size = 16 }: { size?: number }) {\n return <SvgXml xml={SUCCESS_CHECK_SVG} width={size} height={size} />\n}\n\nexport function FigmaChevronDownIcon({ size = 16, color }: IconProps) {\n return renderIcon(CHEVRON_DOWN_SVG, size, useIconColor(color))\n}\n\nexport function FigmaCheckIcon({ size = 16, color }: IconProps) {\n return renderIcon(CHECK_SVG, size, useIconColor(color))\n}\n\nconst INFO_CIRCLE_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 9.16667V13.3333M10 6.66667H10.0083M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\nexport function FigmaInfoCircleIcon({ size = 20, color }: IconProps) {\n return renderIcon(INFO_CIRCLE_SVG, size, useIconColor(color))\n}\n\n// Just the \"+\" stroke from the Add money Crypto-row overflow chip (Figma\n// list-item `plus.svg`). The source asset bakes in a #F9F9F9 circle, but the\n// SourceTokenCluster pill already draws the themed `bgSecondary` circle, so we\n// keep only the glyph and let it inherit the theme via `currentColor` \u2014 drawn\n// as geometry it centers cleanly where the text \"+\" did not.\nconst PLUS_SVG =\n '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.20833 5V11.4167M5 8.20833H11.4167\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\nexport function FigmaPlusIcon({ size = 16, color }: IconProps) {\n return renderIcon(PLUS_SVG, size, useIconColor(color))\n}\n", "import { ThemeProvider } from '@shopify/restyle'\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport { defaultDarkTheme, defaultLightTheme } from './toRestyleTheme'\nimport {\n type ColorScheme,\n resolveColorScheme,\n useColorScheme,\n} from './useColorScheme'\nimport { type FunkitThemeSet, selectTheme } from './useFunkitTheme'\n\nconst DEFAULT_THEMES: FunkitThemeSet = {\n light: defaultLightTheme,\n dark: defaultDarkTheme,\n}\n\ninterface FunkitColorSchemeValue {\n /** The active, resolved color scheme. */\n colorScheme: ColorScheme\n /**\n * Flip light\u2194dark, or set a specific scheme when an argument is given.\n * **No-op when the provider's `colorScheme` prop is set** (controlled mode) \u2014\n * the host owns the scheme in that case.\n */\n toggleColorScheme: (next?: ColorScheme) => void\n /** True when the scheme is forced by the `colorScheme` prop (uncontrolled toggle disabled). */\n isControlled: boolean\n}\n\nconst FunkitColorSchemeContext = createContext<FunkitColorSchemeValue | null>(\n null,\n)\n\nexport interface FunkitThemeProviderProps {\n children: ReactNode\n /**\n * The light/dark Restyle theme set. Defaults to the built-in Fun Mobile\n * themes. Pass `{ light, dark }` from `toRestyleTheme(...)` to customize.\n */\n themes?: FunkitThemeSet\n /**\n * Force a color scheme. When provided the provider is **controlled**: it\n * always renders this scheme, ignores the system Appearance, and\n * `toggleColorScheme()` becomes a no-op. When omitted the provider is\n * **uncontrolled**: the scheme follows the system Appearance and can be\n * flipped with `toggleColorScheme()`.\n */\n colorScheme?: ColorScheme\n}\n\n/**\n * The styling layer for `@funkit/connect-rn`. Resolves the active Restyle theme\n * (selected from `themes` by color scheme), wires it into Restyle's\n * `ThemeProvider`, and exposes the scheme + a manual toggle via\n * {@link useFunkitColorScheme}.\n *\n * This is an internal-ish provider \u2014 host apps mount the user-facing\n * {@link FunkitProvider}, which passes `themes` / `colorScheme` down to this.\n */\nexport function FunkitThemeProvider({\n children,\n themes = DEFAULT_THEMES,\n colorScheme,\n}: FunkitThemeProviderProps) {\n const isControlled = colorScheme != null\n const systemScheme = useColorScheme()\n // Manual override, used only in uncontrolled mode. Sticky once set \u2014 later\n // system changes are ignored until the next toggle (matches web behavior).\n const [override, setOverride] = useState<ColorScheme | undefined>(undefined)\n\n const activeScheme = resolveColorScheme(colorScheme, override, systemScheme)\n\n const toggleColorScheme = useCallback(\n (next?: ColorScheme) => {\n if (colorScheme != null) {\n return // controlled: the host owns the scheme\n }\n setOverride((prev) => {\n if (next != null) {\n return next\n }\n const current = resolveColorScheme(undefined, prev, systemScheme)\n return current === 'dark' ? 'light' : 'dark'\n })\n },\n [colorScheme, systemScheme],\n )\n\n const theme = selectTheme(themes, activeScheme)\n\n const value = useMemo<FunkitColorSchemeValue>(\n () => ({ colorScheme: activeScheme, toggleColorScheme, isControlled }),\n [activeScheme, toggleColorScheme, isControlled],\n )\n\n return (\n <FunkitColorSchemeContext.Provider value={value}>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </FunkitColorSchemeContext.Provider>\n )\n}\n\n/**\n * Read the active color scheme and toggle it. Must be used within a\n * {@link FunkitProvider} (which mounts {@link FunkitThemeProvider}).\n * `toggleColorScheme` is a no-op when the provider is in controlled mode (a\n * `colorScheme` prop was passed).\n */\nexport function useFunkitColorScheme(): FunkitColorSchemeValue {\n const value = useContext(FunkitColorSchemeContext)\n if (value == null) {\n throw new Error('useFunkitColorScheme must be used within <FunkitProvider>')\n }\n return value\n}\n", "import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react'\n\nimport { FunkitFlowProvider } from '../flow/FunkitFlowProvider'\nimport {\n type FunkitConfig,\n FunkitIdentityProvider,\n resolveFunkitIdentity,\n} from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport {\n FunkitThemeProvider,\n type FunkitThemeProviderProps,\n} from '../theme/FunkitThemeProvider'\nimport type { ClipboardWriter } from '../transfer/clipboard'\nimport { CONNECT_RN_VERSION } from '../version'\nimport { FunkitStatsigProvider } from './FunkitStatsigProvider'\n\nexport interface FunkitProviderProps {\n children: ReactNode\n /**\n * Identity config \u2014 `apiKey` (+ optional `externalUserId`). Mirrors the\n * identity-relevant subset of the web SDK's `funkitConfig`. Required for the\n * SDK to generate deposit addresses; when omitted, the deposit flow falls\n * back to any host-supplied `depositAddress` on the flow config.\n */\n config?: FunkitConfig\n /**\n * The connected wallet address (default transfer recipient). On web this\n * comes from wagmi; RN has no wallet provider, so the host passes it here.\n */\n walletAddress?: string\n /**\n * React Query client. Web requires the host to supply one; for single-provider\n * RN ergonomics we default to an internally-created client when omitted (pass\n * your own to share a cache with the rest of the app).\n */\n queryClient?: QueryClient\n /**\n * Light/dark Restyle theme set. Defaults to the built-in Fun Mobile themes.\n * Forwarded to {@link FunkitThemeProvider}.\n */\n themes?: FunkitThemeProviderProps['themes']\n /**\n * Optional forced color scheme. When set, the scheme is controlled (system\n * Appearance ignored, `toggleColorScheme()` disabled); when omitted it\n * follows the system Appearance and is toggleable. Forwarded to\n * {@link FunkitThemeProvider}.\n */\n colorScheme?: FunkitThemeProviderProps['colorScheme']\n /**\n * Run Statsig in development mode (dev environment tier + verbose logging).\n * Mirrors `@funkit/connect`'s `debug`.\n */\n debug?: boolean\n /**\n * Clipboard write used by the deposit flow's \"Copy address\" buttons. Defaults\n * to the bare-RN `@react-native-clipboard/clipboard` peer (lazily loaded).\n * Inject your own to use a different module \u2014 e.g. pass `setStringAsync` from\n * `expo-clipboard` when running in **Expo Go**, where the native module isn't\n * linked. Return the write's success to drive the \"Copied!\" confirmation; a\n * `void` return is treated as success.\n */\n copyToClipboard?: ClipboardWriter\n}\n\n// Sentinel identity used when the host mounts the provider without a `config`.\n// `'0x'` userId/address disables the transfer query (getCheckoutTokenTransferParams\n// returns undefined), so the flow shows its fallback rather than firing a bad\n// request.\nconst ANONYMOUS_CONFIG: FunkitConfig = { apiKey: '' }\n\n/**\n * Top-level, user-facing provider for `@funkit/connect-rn` \u2014 the single\n * provider host apps mount around their tree.\n *\n * Composes the platform halves, mirroring the web `FunkitProvider` nesting\n * (Statsig flags \u2192 React Query \u2192 identity \u2192 theme \u2192 the managed flow). Statsig\n * stays outermost so flags are available everywhere; the deposit-flow query\n * hooks below it read identity from {@link FunkitIdentityProvider} and run on\n * the {@link QueryClientProvider}. Host integration stays a single\n * `<FunkitProvider>`.\n */\nexport function FunkitProvider({\n children,\n config,\n walletAddress,\n queryClient,\n themes,\n colorScheme,\n debug = false,\n copyToClipboard,\n}: FunkitProviderProps) {\n // Stable default client when the host doesn't supply one.\n const fallbackClient = useRef<QueryClient>(undefined)\n fallbackClient.current ??= new QueryClient()\n const client = queryClient ?? fallbackClient.current\n\n const identity = useMemo(\n () => resolveFunkitIdentity(config ?? ANONYMOUS_CONFIG, walletAddress),\n [config, walletAddress],\n )\n\n // Configure the Datadog logger once the apiKey is known. Without this the\n // FunLogger stays unconfigured, queues every record, and never emits to the\n // transport. Mirrors the web FunkitProvider. Only configure when an apiKey is\n // present \u2014 configuring with none makes every log a console \"apiKey not set\"\n // error, and there's nothing to ship to Datadog anyway.\n useEffect(() => {\n if (!config?.apiKey) {\n return\n }\n logger.configure(config.apiKey, debug, CONNECT_RN_VERSION)\n }, [config?.apiKey, debug])\n\n // Attach user context to every log (no apiKey required).\n useEffect(() => {\n logger.setUserInfo(\n identity.userId,\n identity.walletAddress,\n '',\n identity.loginType ?? '',\n '',\n )\n }, [identity])\n\n return (\n <FunkitStatsigProvider\n apiKey={identity.apiKey}\n userId={identity.userId}\n isDevelopment={debug}\n >\n <QueryClientProvider client={client}>\n <FunkitIdentityProvider identity={identity}>\n <FunkitThemeProvider themes={themes} colorScheme={colorScheme}>\n <FunkitFlowProvider copyToClipboard={copyToClipboard}>\n {children}\n </FunkitFlowProvider>\n </FunkitThemeProvider>\n </FunkitIdentityProvider>\n </QueryClientProvider>\n </FunkitStatsigProvider>\n )\n}\n", "import { useDynamicConfig } from '@funkit/connect-core'\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {\n Platform,\n Share,\n StatusBar,\n StyleSheet,\n View,\n type ViewStyle,\n} from 'react-native'\nimport { useCheckoutBlocked } from '../geo/useCheckoutBlocked'\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport { CryptoBitcoinIcon } from '../icons/CryptoBitcoinIcon'\nimport { FunIcon } from '../icons/FunIcon'\nimport { QrChainCluster } from '../icons/QrChainCluster'\nimport { SourceTokenCluster } from '../icons/SourceTokenCluster'\nimport { TokenChainIcon } from '../icons/TokenChainIcon'\nimport {\n AddMoneyScreen,\n type PaymentMethodOption,\n type ReceiveTokenOption,\n} from '../screens/AddMoneyScreen'\nimport { AvailableChainsScreen } from '../screens/AvailableChainsScreen'\nimport { CheckoutBlockedScreen } from '../screens/CheckoutBlockedScreen'\nimport { QrCodeScreen } from '../screens/QrCodeScreen'\nimport { TransferCryptoScreen } from '../screens/TransferCryptoScreen'\nimport { SwappedScreen } from '../swapped/SwappedScreen'\nimport {\n belongsToNetwork,\n buildAvailableChains,\n buildDepositNetworks,\n EVM_NETWORK_ID,\n isNonEvmChainId,\n} from '../transfer/availableChains'\nimport {\n type ClipboardWriter,\n copyToClipboard as defaultCopyToClipboard,\n} from '../transfer/clipboard'\nimport { toFopRows } from '../transfer/fops'\nimport { formatDepositAddress } from '../transfer/formatDepositAddress'\nimport { useFops } from '../transfer/hooks/useFops'\nimport { useSupportedTokens } from '../transfer/hooks/useSupportedTokens'\nimport { useTokenTransfer } from '../transfer/hooks/useTokenTransfer'\nimport { QrCode } from '../transfer/QrCode'\nimport { AddressCopiedToast } from './AddressCopiedToast'\nimport type {\n DepositFlowCallbacks,\n DepositFlowConfig,\n} from './depositFlowConfig'\nimport { getDefaultDynamicTargetAsset } from './depositFlowConfig'\nimport { FlowSheet } from './FlowSheet'\n\ntype FlowScreen =\n | 'addMoney'\n | 'transfer'\n | 'availableChains'\n | 'qrCode'\n | 'swapped'\n\ninterface FlowState {\n isOpen: boolean\n stack: FlowScreen[]\n config: DepositFlowConfig | null\n callbacks: DepositFlowCallbacks\n /**\n * Bumped on every `beginDeposit`. The sheet keys its present on this, so a new\n * session opened while a previous one is mid-dismiss re-presents (cancelling\n * the stale dismiss) instead of letting the late `onDismiss` close it.\n */\n session: number\n}\n\nconst CLOSED: FlowState = {\n isOpen: false,\n stack: [],\n config: null,\n callbacks: {},\n session: 0,\n}\n\ninterface FunkitFlowContextValue {\n /** Open the managed deposit flow at the Add money screen. */\n beginDeposit: (\n config: DepositFlowConfig,\n callbacks?: DepositFlowCallbacks,\n ) => void\n /** Close the flow. */\n closeFlow: () => void\n}\n\nconst FunkitFlowContext = createContext<FunkitFlowContextValue | null>(null)\n\ninterface FlowNav {\n navigate: (s: FlowScreen) => void\n back: () => void\n closeFlow: () => void\n}\n\n/**\n * Mounts the managed deposit-flow modal and exposes `beginDeposit` to\n * {@link useFunkitCheckout}. The five screens are rendered + navigated here\n * (host apps never render them directly), mirroring how `@funkit/connect`'s\n * `FunkitProvider` owns the checkout modal.\n */\nexport function FunkitFlowProvider({\n children,\n copyToClipboard = defaultCopyToClipboard,\n}: {\n children: ReactNode\n /** Host clipboard override; defaults to the bare-RN clipboard peer. */\n copyToClipboard?: ClipboardWriter\n}) {\n const [state, setState] = useState<FlowState>(CLOSED)\n\n const beginDeposit = useCallback(\n (config: DepositFlowConfig, callbacks: DepositFlowCallbacks = {}) => {\n callbacks.onOpen?.()\n setState((prev) => ({\n isOpen: true,\n stack: ['addMoney'],\n config,\n callbacks,\n session: prev.session + 1,\n }))\n },\n [],\n )\n\n const clearToast = useCallback(() => {\n if (hideTimerRef.current) clearTimeout(hideTimerRef.current)\n if (unmountTimerRef.current) clearTimeout(unmountTimerRef.current)\n setCopiedToastShown(false)\n setToastMounted(false)\n }, [])\n\n const closeFlow = useCallback(() => {\n setState((prev) => {\n // Idempotent: fire onClose only on the open\u2192closed transition. The gorhom\n // sheet's dismiss animation re-invokes this (via onDismiss) after the host\n // has already closed, so a guard keeps onClose firing exactly once.\n if (!prev.isOpen) return prev\n prev.callbacks.onClose?.()\n return CLOSED\n })\n clearToast()\n }, [clearToast])\n\n const navigate = useCallback((screen: FlowScreen) => {\n setState((prev) => ({ ...prev, stack: [...prev.stack, screen] }))\n }, [])\n\n const back = useCallback(() => {\n setState((prev) => {\n if (!prev.isOpen) return prev\n if (prev.stack.length <= 1) {\n prev.callbacks.onClose?.()\n return CLOSED\n }\n return { ...prev, stack: prev.stack.slice(0, -1) }\n })\n }, [])\n\n const value = useMemo<FunkitFlowContextValue>(\n () => ({ beginDeposit, closeFlow }),\n [beginDeposit, closeFlow],\n )\n\n const current = state.stack[state.stack.length - 1]\n const nav = useMemo<FlowNav>(\n () => ({ navigate, back, closeFlow }),\n [navigate, back, closeFlow],\n )\n\n // \u2500\u2500 \"Address copied\" toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Hoisted here (above FlowSheet) so the toast renders as a later sibling of\n // the gorhom BottomSheetModalProvider in the native view tree \u2014 later\n // siblings sit on top in RN, so the toast floats above the sheet without a\n // <Modal> (which blocks all touches for its entire lifetime).\n //\n // Two pieces of state: `copiedToastShown` drives the pill's mount (its\n // reanimated enter/exit plays on mount/unmount), and `toastMounted` keeps\n // the overlay mounted across the pill's exit animation so the fade-out\n // isn't cut off by tearing the View down on the same frame.\n const [toastMounted, setToastMounted] = useState(false)\n const [copiedToastShown, setCopiedToastShown] = useState(false)\n const hideTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n )\n const unmountTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n )\n const showCopiedToast = useCallback(() => {\n if (hideTimerRef.current) clearTimeout(hideTimerRef.current)\n if (unmountTimerRef.current) clearTimeout(unmountTimerRef.current)\n setToastMounted(true)\n setCopiedToastShown(true)\n hideTimerRef.current = setTimeout(() => {\n setCopiedToastShown(false)\n unmountTimerRef.current = setTimeout(\n () => setToastMounted(false),\n TOAST_EXIT_MS,\n )\n }, TOAST_VISIBLE_MS)\n }, [])\n useEffect(() => () => clearToast(), [clearToast])\n\n return (\n <FunkitFlowContext.Provider value={value}>\n <View style={rootContainer}>\n {/* FlowSheet wraps the host app (children) so the gorhom path's portal\n host spans the full screen; the flow screens render as `content`. */}\n <FlowSheet\n isOpen={state.isOpen}\n session={state.session}\n onClose={closeFlow}\n // Only the Swapped embed (WebView) needs keyboard avoidance; its input\n // focus is invisible to gorhom. Other screens have no inputs.\n keyboardAvoidEnabled={current === 'swapped'}\n content={\n // Mounted only while open so the transfer query runs only then.\n state.isOpen && state.config ? (\n <FlowContent\n config={state.config}\n current={current}\n nav={nav}\n copyToClipboard={copyToClipboard}\n onCopySuccess={showCopiedToast}\n callbacks={state.callbacks}\n />\n ) : null\n }\n >\n {children}\n </FlowSheet>\n {toastMounted ? (\n <View style={screenTopOverlay} pointerEvents=\"none\">\n {copiedToastShown ? <AddressCopiedToast /> : null}\n </View>\n ) : null}\n </View>\n </FunkitFlowContext.Provider>\n )\n}\n\n// Any EVM chain selects the shared EVM deposit address; mainnet is the default\n// representative when the host's `sourceChain` is absent or non-EVM.\nconst DEFAULT_EVM_CHAIN_ID = 1\n\n// The synthetic id of the built-in \"Crypto\" funding row. Payment methods are\n// derived internally (not host-configured), mirroring web \u2014 the crypto row\n// routes into the Transfer screen; the rest are Swapped FOPs.\nconst CRYPTO_METHOD_ID = 'crypto'\n\n/**\n * Map the user-selected network segment id back to the chain id that drives\n * address/QR generation. Done WITHOUT the curated chain list (which resolves\n * async, after `useTokenTransfer`): the EVM segment uses a representative EVM\n * chain, every other segment id IS its numeric chain id.\n */\nfunction resolveSelectedChainId(\n selectedNetworkId: string | undefined,\n initialChainId: number | undefined,\n evmRepresentativeChainId: number,\n): number | undefined {\n if (selectedNetworkId == null) return initialChainId\n if (selectedNetworkId === EVM_NETWORK_ID) return evmRepresentativeChainId\n const id = Number(selectedNetworkId)\n return Number.isFinite(id) ? id : initialChainId\n}\n\n/**\n * The live flow body. Drives the deposit-address + QR generation\n * ({@link useTokenTransfer}) for the open flow and renders the active screen\n * with the resolved data. Kept separate from {@link FunkitFlowProvider} so its\n * hooks run only while the modal is open (it isn't mounted when closed).\n */\nfunction FlowContent({\n config,\n current,\n nav,\n copyToClipboard,\n onCopySuccess,\n callbacks,\n}: {\n config: DepositFlowConfig\n current: FlowScreen | undefined\n nav: FlowNav\n copyToClipboard: ClipboardWriter\n onCopySuccess: () => void\n callbacks: DepositFlowCallbacks\n}): ReactNode {\n const { isGeoblocked, isLoadingGeoCheck } = useCheckoutBlocked({\n onCheckoutBlocked: callbacks.onCheckoutBlocked,\n })\n\n // The network segment the user is depositing on (id only \u2014 the segment list\n // is derived from the curated chains below). Selecting a segment updates this,\n // which re-derives the network label + icon on the Transfer screen AND the\n // generated address + QR (via its chain id). Defaults to the config's chain.\n const [selectedNetworkId, setSelectedNetworkId] = useState<string>()\n\n // The selected target-asset candidate (web: `selectedTargetAsset` in\n // SourceChange). Selecting a row in the receive-token dropdown rebinds it,\n // which re-targets the deposit address + QR and the `dynamicRoutingId` in\n // lockstep \u2014 the RN analogue of web's `applyDynamicTargetAssetCandidate` /\n // `mergeDynamicTargetAssetCandidateIntoConfig`. Initialised to the resolved\n // default for the config's `dynamicRoutingId`.\n const [selectedCandidate, setSelectedCandidate] = useState(() =>\n getDefaultDynamicTargetAsset(\n config.dynamicTargetAssetCandidates,\n config.dynamicRoutingId,\n ),\n )\n\n // Rebind the target token (chain + asset) and routing id from the selected\n // candidate, mirroring web's merge: the candidate's fields win, the routing\n // id falls back to the config's existing value (NOT cleared) when the\n // candidate omits one. Anything keyed off these stays in lockstep with the\n // active target.\n const activeCheckoutConfig = selectedCandidate\n ? {\n ...config.checkoutConfig,\n targetChain: selectedCandidate.tokenChainId,\n targetAsset: selectedCandidate.tokenAddress,\n }\n : config.checkoutConfig\n const activeDynamicRoutingId =\n selectedCandidate?.dynamicRoutingId ?? config.dynamicRoutingId\n\n // Representative EVM chain for the grouped \"EVM Chains\" segment: the host's\n // `sourceChain` (a string chain id, web-aligned) when it's EVM, else mainnet.\n const parsedSourceChain = config.sourceChain\n ? Number(config.sourceChain)\n : undefined\n const initialChainId =\n parsedSourceChain != null && Number.isFinite(parsedSourceChain)\n ? parsedSourceChain\n : undefined\n const evmRepresentativeChainId =\n initialChainId != null && !isNonEvmChainId(initialChainId)\n ? initialChainId\n : DEFAULT_EVM_CHAIN_ID\n const selectedChainId = resolveSelectedChainId(\n selectedNetworkId,\n initialChainId,\n evmRepresentativeChainId,\n )\n\n const {\n depositAddress: generatedAddress,\n qrCodeUri,\n transferInit,\n isLoading: isAddressLoading,\n } = useTokenTransfer({\n checkoutConfig: activeCheckoutConfig,\n selectedChainId,\n dynamicRoutingId: activeDynamicRoutingId,\n enabled: true,\n })\n\n // Curated deposit chains, fetched + resolved from the Statsig\n // `tokentransferconfig` (host config can override). `transferInit` gates\n // Solana/Bitcoin/Tron until their deposit address exists. The chain list\n // drives the \"Available chains\" screen.\n const fetched = useSupportedTokens({ transferInit })\n const tokenChainFilters = config.tokenChainFilters ?? fetched.chainFilters\n\n // The Transfer screen's network switcher, derived from the curated chains\n // (EVM chains \u2192 one \"EVM Chains\" segment, each non-EVM chain \u2192 its own). The\n // selected segment is the user's pick, else the segment owning the host's\n // `selectedChainId`, else the first.\n const depositNetworks = useMemo(\n () => buildDepositNetworks(tokenChainFilters),\n [tokenChainFilters],\n )\n const initialNetwork =\n initialChainId == null\n ? undefined\n : depositNetworks.find(\n (n) =>\n n.chainId != null && belongsToNetwork(initialChainId, n.chainId),\n )\n const selectedChain =\n depositNetworks.find((n) => n.id === selectedNetworkId) ??\n initialNetwork ??\n depositNetworks[0]\n\n // Per-chain minimum transfer values (Statsig), mirroring web's TransferToken.\n const minTransferLimits = useDynamicConfig('mintokentransfervalue')\n\n // Swapped forms of payment (Card / Apple Pay / Revolut Pay / Bank Transfer),\n // fetched the same way web does (minus geo). Mobile has no Crypto/Cash tabs \u2014\n // these are merged into the single Add money list (saved FOPs on top, then\n // Crypto, then the rest), so `isSwappedEnabled` just decides whether the cash\n // methods are present.\n const {\n savedFops,\n genericFops,\n isSwappedEnabled,\n isLoading: isFopsLoading,\n isError: isFopsError,\n refetch: refetchFops,\n } = useFops({\n checkoutConfig: activeCheckoutConfig,\n dynamicRoutingId: activeDynamicRoutingId,\n })\n\n // The embedded-flow URL of the cash method the user picked (drives the\n // Swapped WebView screen).\n const [selectedSwappedUrl, setSelectedSwappedUrl] = useState<string>()\n\n // The selected network's member chains for the \"Available chains\" screen:\n // the curated chains filtered to the network (EVM group vs single non-EVM),\n // enriched with @funkit/chains logos and per-chain minimum-deposit labels.\n const availableChains = buildAvailableChains({\n chainFilters: tokenChainFilters,\n networkChainId: selectedChainId,\n minTransferLimits,\n target: {\n targetChain: activeCheckoutConfig?.targetChain,\n targetAsset: activeCheckoutConfig?.targetAsset,\n dynamicRoutingId: activeDynamicRoutingId,\n getMinDepositUSD: (\n config.checkoutConfig as\n | {\n getMinDepositUSD?: (ctx: {\n tokenChainId?: string\n tokenAddress?: string\n dynamicRoutingId?: string\n }) => number\n }\n | undefined\n )?.getMinDepositUSD,\n },\n })\n\n // A single-chain network (Solana / Tron / Bitcoin, or a lone EVM chain) has\n // no chain list to open. Instead of the tappable logo cluster + chevron, the\n // Transfer screen shows that chain's minimum deposit (Figma 11317:3845).\n const singleChain =\n availableChains.length === 1 ? availableChains[0] : undefined\n\n // Prefer the generated address; fall back to a host-supplied one while it\n // loads or when no identity is configured.\n const rawAddress = generatedAddress ?? config.depositAddress\n const displayAddress = rawAddress\n ? formatDepositAddress(rawAddress)\n : 'Generating\u2026'\n\n const copyAddressAndToast = useCallback(\n async (value: string): Promise<boolean> => {\n const ok = (await copyToClipboard(value)) !== false\n if (ok) onCopySuccess()\n return ok\n },\n [copyToClipboard, onCopySuccess],\n )\n\n const screen = ((): ReactNode => {\n switch (current) {\n case 'addMoney': {\n // The built-in crypto/transfer row (Figma: Add money crypto row): a\n // Bitcoin glyph leading + a trailing stack of supported source-chain\n // logos with a \"+N\" overflow. The row is derived internally (not\n // host-supplied, like web); its source icons come from the curated\n // deposit networks (deduped), not a host-passed list.\n const cryptoSourceIcons = [\n ...new Set(depositNetworks.flatMap((n) => n.iconKeys ?? [])),\n ]\n const cryptoMethod: PaymentMethodOption[] = [\n {\n id: CRYPTO_METHOD_ID,\n title: 'Crypto',\n subtitle: 'No limit',\n icon: <CryptoBitcoinIcon />,\n trailing: cryptoSourceIcons.length ? (\n <SourceTokenCluster\n icons={cryptoSourceIcons}\n overflowMode=\"plus\"\n />\n ) : undefined,\n },\n ]\n const toCashRows = (fops: typeof savedFops): PaymentMethodOption[] =>\n toFopRows(fops).map((row) => ({\n id: row.id,\n title: row.name,\n subtitle: row.subtitle,\n icon: (\n <FunIcon uri={row.iconUri} fallbackUri={FALLBACK_ASSET_LOGO} />\n ),\n }))\n // Single flat list (no tabs on mobile): saved FOPs on top, then the\n // Crypto row, then the generic cash FOPs \u2014 matching the Figma order. When\n // Swapped is off there are no FOPs, so it's just the host's methods.\n const methods: PaymentMethodOption[] = isSwappedEnabled\n ? [\n ...toCashRows(savedFops),\n ...cryptoMethod,\n ...toCashRows(genericFops),\n ]\n : cryptoMethod\n // Receive-token dropdown options. Keyed by array index \u2014 the only handle\n // guaranteed unique + stable across candidates, since `tokenSymbol` can\n // repeat (USDG with Perps/Spot `badgeText`) and `dynamicRoutingId` can be\n // absent. Selecting one rebinds `selectedCandidate` (see above).\n const candidates = config.dynamicTargetAssetCandidates\n const receiveTokens: ReceiveTokenOption[] | undefined = candidates?.map(\n (c, i) => ({\n id: String(i),\n label: c.badgeText\n ? `${c.tokenSymbol} (${c.badgeText})`\n : c.tokenSymbol,\n icon: <TokenChainIcon symbol={c.tokenSymbol} iconSrc={c.iconSrc} />,\n }),\n )\n const selectedReceiveTokenId =\n selectedCandidate && candidates\n ? String(candidates.indexOf(selectedCandidate))\n : undefined\n return (\n <AddMoneyScreen\n methods={methods}\n receiveTokens={receiveTokens}\n selectedReceiveTokenId={selectedReceiveTokenId}\n onSelectReceiveToken={(id) => {\n const picked = candidates?.[Number(id)]\n if (picked) {\n setSelectedCandidate(picked)\n }\n }}\n // Keep the loading skeleton until the gating async work is done:\n // the geo check (so the list doesn't flash before a blocked user is\n // routed to CheckoutBlockedScreen) and the deposit-address / QR\n // generation (so Transfer/QR open with a ready address, not\n // \"Generating\u2026\").\n loading={\n isLoadingGeoCheck ||\n isAddressLoading ||\n (isSwappedEnabled && isFopsLoading)\n }\n error={isSwappedEnabled && isFopsError}\n onRetry={refetchFops}\n onSelectMethod={(id) => {\n if (id === CRYPTO_METHOD_ID) {\n nav.navigate('transfer')\n return\n }\n // FOP rows use a `<fopType>:<name>` id (see `toFopRows`). Open the\n // selected method's Swapped embedded flow in the WebView screen.\n if (id.includes(':')) {\n const fop = [...savedFops, ...genericFops].find(\n (f) => `${f.fopType}:${f.name}` === id,\n )\n if (fop?.embeddedFlowUrl) {\n setSelectedSwappedUrl(fop.embeddedFlowUrl)\n nav.navigate('swapped')\n }\n return\n }\n // TODO(connect-rn): other host methods route to their own flows\n // once those land.\n }}\n />\n )\n }\n case 'transfer': {\n // Inline network switcher: each derived network is a segment; picking one\n // updates `selectedNetworkId`, which re-derives the generated address + QR.\n const networks = depositNetworks.map((chain) => ({\n id: chain.id,\n label: chain.label,\n iconKeys: chain.iconKeys ?? [],\n }))\n return (\n <TransferCryptoScreen\n depositAddress={displayAddress}\n networks={networks}\n selectedNetworkId={selectedChain?.id ?? networks[0]?.id ?? ''}\n onSelectNetwork={setSelectedNetworkId}\n // The cluster shows the SELECTED network's chains: the resolved\n // available chains (EVM \u2192 several, \"+N\"), falling back to the\n // network's own icon while they load. Single-chain networks show a\n // minimum-deposit label instead (see minimumDepositLabel below), so\n // they pass no cluster icons.\n supportedTokenIcons={\n singleChain\n ? undefined\n : availableChains.length\n ? availableChains.map((c) => c.iconUri)\n : (selectedChain?.iconKeys ?? [])\n }\n // Single-chain networks (Solana / Tron / Bitcoin) show \"Min $X\" with\n // the network logo in place of the cluster \u2014 there's no chain list.\n minimumDepositLabel={singleChain?.minLabel}\n onBack={nav.back}\n // Tapping the chain-logo cluster opens \"Available chains\" \u2014 only when\n // the selected network resolves more than one member chain.\n onShowChains={\n availableChains.length > 1\n ? () => nav.navigate('availableChains')\n : undefined\n }\n onShowQrCode={() => nav.navigate('qrCode')}\n // Copy/share the FULL address (the screen only shows it truncated).\n // Clipboard is loaded lazily + guarded (see copyToClipboard) so a\n // missing native module degrades gracefully instead of crashing. The\n // toast is shown only after the write lands (see copyAddressAndToast).\n onCopyAddress={\n rawAddress\n ? () => void copyAddressAndToast(rawAddress)\n : undefined\n }\n onShareAddress={\n rawAddress\n ? () => void Share.share({ message: rawAddress })\n : undefined\n }\n />\n )\n }\n case 'availableChains':\n return (\n <AvailableChainsScreen\n networkLabel={selectedChain?.label ?? ''}\n chains={availableChains}\n onClose={nav.back}\n />\n )\n case 'qrCode':\n return (\n <QrCodeScreen\n qrCode={\n config.qrCode ??\n (qrCodeUri ? <QrCode value={qrCodeUri} size={235} /> : null)\n }\n // Selected network's logos overlaid on the QR center (single network \u2192\n // one logo; multi-chain \u2192 a 2\u00D72 grid).\n centerIcon={\n <QrChainCluster iconKeys={selectedChain?.iconKeys ?? []} />\n }\n // The full (untruncated) address; omitted while it's still\n // generating (the QR screen hides the address block until then).\n address={rawAddress}\n // Returns the copy's success so the screen only confirms \"Copied!\"\n // when the write actually landed (copyToClipboard is warn-only on\n // failure). Clipboard is loaded lazily + guarded (see copyToClipboard)\n // so a missing native module degrades gracefully instead of crashing.\n // The \"Address copied\" toast is also shown only on a successful write\n // (see copyAddressAndToast).\n onCopyAddress={\n rawAddress ? () => copyAddressAndToast(rawAddress) : undefined\n }\n onClose={nav.back}\n />\n )\n case 'swapped':\n return selectedSwappedUrl ? (\n <SwappedScreen\n url={selectedSwappedUrl}\n onBack={nav.back}\n onClose={nav.closeFlow}\n />\n ) : null\n default:\n return null\n }\n })()\n\n if (isGeoblocked) {\n return <CheckoutBlockedScreen />\n }\n\n return screen\n}\n\n// How long the pill stays fully shown, and the duration of its exit animation\n// (kept in sync with AddressCopiedToast's FadeOutUp) used to defer the overlay\n// teardown until the fade-out finishes.\nconst TOAST_VISIBLE_MS = 1800\nconst TOAST_EXIT_MS = 350\n\nconst rootContainer: ViewStyle = { flex: 1 }\n\n// Full-screen, top-anchored, non-interactive overlay. Rendered as a later\n// sibling of FlowSheet so it sits above the gorhom sheet in RN's z-order.\n// pointerEvents=\"none\" on the View lets all touches pass through.\nconst screenTopOverlay: ViewStyle = {\n ...StyleSheet.absoluteFill,\n zIndex: 1,\n alignItems: 'center',\n paddingTop:\n Platform.select({\n ios: 60,\n android: (StatusBar?.currentHeight ?? 0) + 16,\n default: 16,\n }) ?? 16,\n}\n\nexport function useFunkitFlow(): FunkitFlowContextValue {\n const value = useContext(FunkitFlowContext)\n if (value == null) {\n throw new Error('useFunkitFlow must be used within <FunkitProvider>')\n }\n return value\n}\n", "import { useEffect, useMemo } from 'react'\nimport { useDynamicConfig, useEffectEvent } from '@funkit/connect-core'\n\nimport { isCountryBlocked } from './isCountryBlocked'\nimport { useUserIpInfo } from './useUserIpInfo'\n\ninterface UseCheckoutBlockedParams {\n onCheckoutBlocked?: () => void\n}\n\ninterface UseCheckoutBlockedResult {\n isGeoblocked: boolean\n isLoadingGeoCheck: boolean\n}\n\nexport function useCheckoutBlocked(\n params: UseCheckoutBlockedParams,\n): UseCheckoutBlockedResult {\n const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo()\n const blockedCountries = useDynamicConfig('blockedcountries')\n\n const isGeoblocked = useMemo(() => {\n if (isLoadingGeoCheck) {\n return false\n }\n if (!userIpInfo) {\n return true\n }\n return isCountryBlocked(blockedCountries, userIpInfo)\n }, [blockedCountries, isLoadingGeoCheck, userIpInfo])\n\n const onCheckoutBlockedEvent = useEffectEvent(() => {\n params.onCheckoutBlocked?.()\n })\n\n useEffect(() => {\n if (isGeoblocked) {\n onCheckoutBlockedEvent()\n }\n }, [isGeoblocked])\n\n return { isGeoblocked, isLoadingGeoCheck }\n}\n", "import { FunLogger } from '@funkit/connect-core'\n\nimport { DatadogHttpLogTransport } from './datadogHttpLogTransport'\n\n// Public Datadog client token (same one `@funkit/connect` uses for web). A\n// client token is safe to embed in client apps.\nconst DDOG_CLIENT_TOKEN = 'pub4f86c6be8c792cb48dc156a8c17d9a47'\n\n/**\n * The React Native `FunLogger` singleton. Mirrors `@funkit/connect`'s web\n * `logger`, but injects the raw-HTTP {@link DatadogHttpLogTransport} (no Datadog\n * SDK, no native modules) instead of `@datadog/browser-logs`. The host wires\n * `logger.configure(...)` / `setUserInfo(...)` once identity is available.\n */\nexport const logger = new FunLogger(\n new DatadogHttpLogTransport({\n clientToken: DDOG_CLIENT_TOKEN,\n // service defaults to 'connect-rn' (see DatadogHttpLogTransport).\n }),\n)\n", "import type {\n LogRecord,\n LogTransport,\n TrackingConsent,\n} from '@funkit/connect-core'\n\n/**\n * React Native `LogTransport` that ships records to Datadog over **raw HTTP**\n * (`fetch`) \u2014 deliberately NOT the Datadog SDK. `@datadog/mobile-react-native`\n * pulls in native modules (autolinking, pods, no Expo Go); a plain `fetch` to\n * the logs intake needs none, so this works in Expo Go and any RN runtime.\n *\n * Records are batched and flushed fire-and-forget on a timer (or when the batch\n * fills); network errors are swallowed so logging never breaks a user flow.\n * Authenticates with the public Datadog **client token** via `dd-api-key`\n * (the same credential the browser SDK uses \u2014 safe to embed), so no server-side\n * API key is needed.\n */\nexport interface DatadogHttpLogTransportOptions {\n /** Datadog client token (`pub\u2026`). Safe to ship in client apps. */\n clientToken: string\n /** Service name attached to every log. */\n service?: string\n /** Datadog site, e.g. `datadoghq.com` (default), `datadoghq.eu`. */\n site?: string\n /** Initial environment tag; also settable later via {@link setEnv}. */\n env?: string\n /** Flush the batch at most this often (ms). Default 5000. */\n flushIntervalMs?: number\n /** Flush immediately once the batch reaches this size. Default 50. */\n maxBatchSize?: number\n}\n\ninterface DatadogLogEntry {\n ddsource: string\n service: string\n status: LogRecord['level']\n message: string\n ddtags?: string\n error?: { message: string; stack?: string; kind: string }\n [attribute: string]: unknown\n}\n\nconst DEFAULT_SERVICE = 'connect-rn'\nconst DEFAULT_SITE = 'datadoghq.com'\nconst DEFAULT_FLUSH_INTERVAL_MS = 5_000\nconst DEFAULT_MAX_BATCH_SIZE = 50\n\nexport class DatadogHttpLogTransport implements LogTransport {\n private readonly intakeUrl: string\n private readonly service: string\n private readonly flushIntervalMs: number\n private readonly maxBatchSize: number\n\n private env: string | undefined\n private consent: TrackingConsent = 'granted'\n private queue: DatadogLogEntry[] = []\n private flushTimer: ReturnType<typeof setTimeout> | null = null\n\n constructor(options: DatadogHttpLogTransportOptions) {\n const site = options.site ?? DEFAULT_SITE\n this.service = options.service ?? DEFAULT_SERVICE\n this.env = options.env\n this.flushIntervalMs = options.flushIntervalMs ?? DEFAULT_FLUSH_INTERVAL_MS\n this.maxBatchSize = options.maxBatchSize ?? DEFAULT_MAX_BATCH_SIZE\n // Browser/mobile logs intake; the client token authenticates via dd-api-key.\n this.intakeUrl =\n `https://browser-intake-${site}/api/v2/logs` +\n `?dd-api-key=${encodeURIComponent(options.clientToken)}` +\n `&ddsource=react-native&dd-evp-origin=react-native`\n }\n\n setEnv(environment: string): void {\n this.env = environment\n }\n\n setTrackingConsent(consent: TrackingConsent): void {\n this.consent = consent\n if (consent !== 'granted') {\n // Drop anything buffered when consent is withdrawn.\n this.queue = []\n this.clearTimer()\n }\n }\n\n log({ level, title, context, error }: LogRecord): void {\n if (this.consent !== 'granted') {\n return\n }\n\n const entry: DatadogLogEntry = {\n // Caller context first so the mandatory Datadog fields below always win \u2014\n // a future LogContext attribute named e.g. `message`/`status` can't\n // silently corrupt the record.\n ...context,\n ddsource: 'react-native',\n service: this.service,\n status: level,\n message: title,\n ...(this.env ? { ddtags: `env:${this.env}` } : {}),\n ...(error\n ? {\n error: {\n message: error.message,\n stack: error.stack,\n kind: error.name,\n },\n }\n : {}),\n }\n\n this.queue.push(entry)\n\n if (this.queue.length >= this.maxBatchSize) {\n this.flush()\n } else {\n this.scheduleFlush()\n }\n }\n\n /** Send the buffered batch. Fire-and-forget; network errors are swallowed. */\n flush(): void {\n this.clearTimer()\n if (this.queue.length === 0) {\n return\n }\n if (typeof fetch !== 'function') {\n // No fetch (e.g. SSR import) \u2014 drop rather than throw.\n this.queue = []\n return\n }\n\n const batch = this.queue\n this.queue = []\n\n fetch(this.intakeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(batch),\n }).catch(() => {\n // Swallow: logging must never break a user flow.\n })\n }\n\n private scheduleFlush(): void {\n if (this.flushTimer != null) {\n return\n }\n this.flushTimer = setTimeout(() => {\n this.flushTimer = null\n this.flush()\n }, this.flushIntervalMs)\n }\n\n private clearTimer(): void {\n if (this.flushTimer != null) {\n clearTimeout(this.flushTimer)\n this.flushTimer = null\n }\n }\n}\n", "import { logger } from '../logging/logger'\nimport type { FunkitUserIpInfo } from './useUserIpInfo'\n\nconst ALL_MATCH = '*'\n\nexport function isCountryBlocked(\n blockedList: readonly string[],\n userIpInfo: FunkitUserIpInfo,\n): boolean {\n if (!userIpInfo.alpha2) {\n logger.log('isUserBlockedForCheckout_NoIpDetected')\n return true\n }\n\n const isBlocked =\n blockedList.includes(ALL_MATCH) || blockedList.includes(userIpInfo.alpha2)\n\n logger.info('isUserBlockedForCheckoutResult', {\n isBlocked,\n blockedList,\n alpha2: userIpInfo.alpha2,\n })\n return isBlocked\n}\n", "import { useQuery } from '@tanstack/react-query'\n\nimport { logger } from '../logging/logger'\n\n// Public Moonpay live key (web uses the same one purely to read the caller's IP\n// \u2192 country; it grants no account access). ipapi.co is the keyless fallback.\nconst MOONPAY_LIVE_API_KEY = 'pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO'\n\n/** ISO 3166-1 alpha-2 country + region code for the current user's IP. */\nexport interface FunkitUserIpInfo {\n alpha2: string\n state: string\n}\n\nexport interface UseUserIpInfoResult {\n userIpInfo: FunkitUserIpInfo | undefined\n isLoadingGeoCheck: boolean\n}\n\nfunction errData(error: unknown): { error: string } {\n return { error: error instanceof Error ? error.message : String(error) }\n}\n\nasync function getIpViaMoonpay(): Promise<FunkitUserIpInfo> {\n const res = await fetch(\n `https://api.moonpay.com/v3/ip_address?apiKey=${MOONPAY_LIVE_API_KEY}`,\n )\n if (!res.ok) {\n throw new Error(res.statusText)\n }\n const data = (await res.json()) as { alpha2: string; state: string }\n return { alpha2: data.alpha2, state: data.state }\n}\n\nasync function getIpViaIpApi(): Promise<FunkitUserIpInfo> {\n const res = await fetch('https://ipapi.co/json')\n if (!res.ok) {\n throw new Error(res.statusText)\n }\n const data = (await res.json()) as {\n country_code: string\n region_code: string\n }\n return { alpha2: data.country_code, state: data.region_code }\n}\n\n/**\n * RN port of web's `useUserIpInfo`: resolves the user's country (ISO alpha-2) +\n * region from their IP. Moonpay's IP endpoint is primary, ipapi.co the fallback\n * \u2014 both plain `fetch` (no native modules, Expo-Go-safe). The resolved country\n * feeds `getFops` so Swapped lists the right region's methods (see {@link\n * useFops}); a failed lookup degrades to the default country there rather than\n * blocking the cash list.\n *\n * Failures log at WARN, not ERROR: the lookup is recoverable (fallback service,\n * then default country), so it's never an unrecoverable state.\n */\nexport function useUserIpInfo(): UseUserIpInfoResult {\n const { data: userIpInfo, isLoading: isLoadingGeoCheck } = useQuery({\n queryKey: ['getUserIpInfo'] as const,\n queryFn: async (): Promise<FunkitUserIpInfo> => {\n try {\n return await getIpViaMoonpay()\n } catch (moonpayError) {\n logger.warn(\n 'connect-rn:getUserIpViaMoonpay:error',\n errData(moonpayError),\n )\n try {\n return await getIpViaIpApi()\n } catch (ipApiError) {\n logger.warn('connect-rn:getUserIpViaIpApi:error', errData(ipApiError))\n throw ipApiError\n }\n }\n },\n // Location is stable within a session; don't refetch aggressively.\n staleTime: Number.POSITIVE_INFINITY,\n refetchOnMount: false,\n refetchOnReconnect: true,\n refetchOnWindowFocus: false,\n })\n\n return { userIpInfo, isLoadingGeoCheck }\n}\n", "// Symbol \u2192 Fun CDN logo map, duplicated verbatim from `@funkit/fun-relay`\n// (`src/assets.ts`). We copy rather than import because `@funkit/fun-relay` has\n// no subpath export \u2014 importing it would pull its relay-sdk / bitcoin adapter\n// graph into the React Native bundle. This is a pure data map with no deps, so\n// the cost of duplication is low; keep it in sync with fun-relay when symbols\n// are added there.\n//\n// This is the primary symbol\u2192logo source for the deposit token list. See\n// `funIconUri.ts#tokenLogoUri` for how the transfer screen resolves icons\n// (mirrors web's `getTokenIconUrl`, NOT the wallet-assets `getAssetLogoSrc`).\nexport const ASSET_LOGO_SRCS: Record<string, string> = {\n $MFER: 'https://sdk-cdn.fun.xyz/images/mfer.png',\n AARBUSDCN: 'https://sdk-cdn.fun.xyz/images/aarbusdcn.png',\n AAVE: 'https://sdk-cdn.fun.xyz/images/aave.svg',\n AERO: 'https://sdk-cdn.fun.xyz/images/aero.svg',\n APE: 'https://sdk-cdn.fun.xyz/images/ape.svg',\n APOLWMATIC: 'https://sdk-cdn.fun.xyz/images/apolwmatic.png',\n ARB: 'https://sdk-cdn.fun.xyz/images/arb.svg',\n BEHYPE: 'https://sdk-cdn.fun.xyz/images/behype.svg',\n BENTO: 'https://sdk-cdn.fun.xyz/images/bento.png',\n BLERF: 'https://sdk-cdn.fun.xyz/images/blerf.png',\n BRETT: 'https://sdk-cdn.fun.xyz/images/brett.svg',\n BSHIB: 'https://sdk-cdn.fun.xyz/images/bshib.png',\n BTC: 'https://sdk-cdn.fun.xyz/images/btc.svg',\n CBBTC: 'https://sdk-cdn.fun.xyz/images/cbbtc.svg',\n CBETH: 'https://sdk-cdn.fun.xyz/images/cbeth.png',\n CRO: 'https://sdk-cdn.fun.xyz/images/cro.svg',\n CRV: 'https://sdk-cdn.fun.xyz/images/crv.svg',\n DAI: 'https://sdk-cdn.fun.xyz/images/dai.svg',\n DEGEN: 'https://sdk-cdn.fun.xyz/images/degen.svg',\n ETH: 'https://sdk-cdn.fun.xyz/images/eth.svg',\n GMX: 'https://sdk-cdn.fun.xyz/images/gmx.svg',\n GRT: 'https://sdk-cdn.fun.xyz/images/grt.svg',\n HYPE: 'https://sdk-cdn.fun.xyz/images/hype.svg',\n IMX: 'https://sdk-cdn.fun.xyz/images/imx.svg',\n INJ: 'https://sdk-cdn.fun.xyz/images/inj.svg',\n LDO: 'https://sdk-cdn.fun.xyz/images/ldo.svg',\n LINK: 'https://sdk-cdn.fun.xyz/images/link.png',\n LUCK: 'https://sdk-cdn.fun.xyz/images/luck.png',\n MATIC: 'https://sdk-cdn.fun.xyz/images/matic.svg',\n MFER: 'https://sdk-cdn.fun.xyz/images/mfer.png',\n MKR: 'https://sdk-cdn.fun.xyz/images/mkr.svg',\n MNT: 'https://sdk-cdn.fun.xyz/images/mnt.svg',\n OP: 'https://sdk-cdn.fun.xyz/images/optimism.svg',\n PENDLE: 'https://sdk-cdn.fun.xyz/images/pendle.svg',\n POL: 'https://sdk-cdn.fun.xyz/images/matic.svg',\n PYUSD: 'https://sdk-cdn.fun.xyz/images/pyusd.svg',\n QNT: 'https://sdk-cdn.fun.xyz/images/qnt.svg',\n RNDR: 'https://sdk-cdn.fun.xyz/images/rndr.svg',\n ROOST: 'https://sdk-cdn.fun.xyz/images/roost.png',\n SAND: 'https://sdk-cdn.fun.xyz/images/sand.svg',\n SHIB: 'https://sdk-cdn.fun.xyz/images/shib.svg',\n SNX: 'https://sdk-cdn.fun.xyz/images/snx.svg',\n SOL: 'https://sdk-cdn.fun.xyz/images/sol.svg',\n SUSDS: 'https://sdk-cdn.fun.xyz/images/susds.svg',\n TYBG: 'https://sdk-cdn.fun.xyz/images/tybg.png',\n UNI: 'https://sdk-cdn.fun.xyz/images/uni.png',\n USDC: 'https://sdk-cdn.fun.xyz/images/usdc.svg',\n 'USDC.E': 'https://sdk-cdn.fun.xyz/images/usdc.svg',\n USDBC: 'https://sdk-cdn.fun.xyz/images/usdc.svg',\n USDE: 'https://sdk-cdn.fun.xyz/images/usde.svg',\n WUSDE: 'https://sdk-cdn.fun.xyz/images/usde.svg',\n EUSDE: 'https://sdk-cdn.fun.xyz/images/eusde.svg',\n USDT: 'https://sdk-cdn.fun.xyz/images/usdt.svg',\n 'USD\u20AE0': 'https://sdk-cdn.fun.xyz/images/usdt0.svg',\n USDT0: 'https://sdk-cdn.fun.xyz/images/usdt0.svg',\n USDS: 'https://sdk-cdn.fun.xyz/images/usds.svg',\n USDH: 'https://sdk-cdn.fun.xyz/images/usdh.svg',\n VRTX: 'https://sdk-cdn.fun.xyz/images/vrtx.svg',\n WBTC: 'https://sdk-cdn.fun.xyz/images/wbtc.svg',\n WEETH: 'https://sdk-cdn.fun.xyz/images/weeth.png',\n WETH: 'https://sdk-cdn.fun.xyz/images/weth.svg',\n WHYPE: 'https://sdk-cdn.fun.xyz/images/whype.png',\n WSTETH: 'https://sdk-cdn.fun.xyz/images/wsteth.png',\n TRUMP: 'https://sdk-cdn.fun.xyz/images/trump.png',\n BNB: 'https://sdk-cdn.fun.xyz/images/bsc.svg',\n WBNB: 'https://sdk-cdn.fun.xyz/images/bsc.svg',\n BTCB: 'https://sdk-cdn.fun.xyz/images/btc.svg',\n UBTC: 'https://sdk-cdn.fun.xyz/images/btc.svg',\n BUSD: 'https://sdk-cdn.fun.xyz/images/busd.svg',\n XAUT: 'https://sdk-cdn.fun.xyz/images/xaut.png',\n ADA: 'https://sdk-cdn.fun.xyz/images/ada.svg',\n XRP: 'https://sdk-cdn.fun.xyz/images/xrp.svg',\n UDOGE: 'https://sdk-cdn.fun.xyz/images/doge.svg',\n DOGE: 'https://sdk-cdn.fun.xyz/images/doge.svg',\n LTC: 'https://sdk-cdn.fun.xyz/images/ltc.svg',\n HNT: 'https://sdk-cdn.fun.xyz/images/hnt.svg',\n COMP: 'https://sdk-cdn.fun.xyz/images/comp.svg',\n PEPE: 'https://sdk-cdn.fun.xyz/images/pepe.svg',\n LSTHYPE: 'https://sdk-cdn.fun.xyz/images/lsthype.svg',\n HBUSDT: 'https://sdk-cdn.fun.xyz/images/hbusdt.svg',\n WVLP: 'https://sdk-cdn.fun.xyz/images/wvlp.svg',\n LIQUIDHYPE: 'https://sdk-cdn.fun.xyz/images/liquidhype.svg',\n VHYPE: 'https://sdk-cdn.fun.xyz/images/vhype.png',\n HBHYPE: 'https://sdk-cdn.fun.xyz/images/hbhype.svg',\n MON: 'https://sdk-cdn.fun.xyz/images/monad.svg',\n WMON: 'https://sdk-cdn.fun.xyz/images/wmon.svg',\n AUSD: 'https://sdk-cdn.fun.xyz/images/ausd.svg',\n SUSHI: 'https://sdk-cdn.fun.xyz/images/sushi.svg',\n SKY: 'https://sdk-cdn.fun.xyz/images/sky.svg',\n LIT: 'https://sdk-cdn.fun.xyz/images/lit.svg',\n AZTEC: 'https://sdk-cdn.fun.xyz/images/aztec.svg',\n U: 'https://sdk-cdn.fun.xyz/images/u.png',\n PUSD: 'https://sdk-cdn.fun.xyz/images/pusd.svg',\n}\n\n/** Generic fallback logo when a symbol isn't in the map. */\nexport const FALLBACK_ASSET_LOGO =\n 'https://sdk-cdn.fun.xyz/images/dollar_circle.png'\n\n/**\n * Verbatim mirror of `@funkit/fun-relay`'s `getAssetLogoSrc`: resolve a token's\n * logo URL by symbol (case-insensitive), falling back to a generic dollar-circle.\n * This is web's *wallet-assets* resolver. NOTE: the deposit/transfer token list\n * does NOT use this \u2014 it uses {@link tokenLogoUri} (web's `getTokenIconUrl`),\n * which falls back to `<symbol>.svg` rather than the dollar-circle.\n */\nexport function getAssetLogoSrc(symbol: string): string {\n return ASSET_LOGO_SRCS[symbol.toUpperCase()] ?? FALLBACK_ASSET_LOGO\n}\n", "import { SvgXml } from 'react-native-svg'\n\nimport { useTheme } from '../theme/restyle'\n\n// Verbatim port of web's `CircleBitcoinIcon`\n// (`packages/connect/src/components/Icons/New/CircleBitcoinIcon.tsx`) \u2014 the\n// glyph the web \"Use Crypto\" tab uses. Kept as inline SVG (rendered via\n// `SvgXml`, like FunIcon) so the package stays asset-free. `fill=\"currentColor\"`\n// is resolved by the `color` prop below, so the disc tracks the active theme's\n// text color (dark disc in light mode, light disc in dark mode) \u2014 matching web.\nconst CIRCLE_BITCOIN_SVG = `<svg viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.9168 11.8737C12.9168 12.449 12.4505 12.9154 11.8752 12.9154H8.75016V10.832H11.8752C12.4505 10.832 12.9168 11.2984 12.9168 11.8737Z\" fill=\"currentColor\"/><path d=\"M11.4585 7.08203H8.75016V9.16536H11.4585C12.0338 9.16536 12.5002 8.69899 12.5002 8.1237C12.5002 7.5484 12.0338 7.08203 11.4585 7.08203Z\" fill=\"currentColor\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.0002 0.832031C4.93755 0.832031 0.833496 4.93609 0.833496 9.9987C0.833496 15.0613 4.93755 19.1654 10.0002 19.1654C15.0628 19.1654 19.1668 15.0613 19.1668 9.9987C19.1668 4.93609 15.0628 0.832031 10.0002 0.832031ZM8.3335 4.16536C8.79373 4.16536 9.16683 4.53846 9.16683 4.9987V5.41536H10.0002V4.9987C10.0002 4.53846 10.3733 4.16536 10.8335 4.16536C11.2937 4.16536 11.6668 4.53846 11.6668 4.9987V5.42326C13.0653 5.52964 14.1668 6.69803 14.1668 8.1237C14.1668 8.74941 13.9546 9.32557 13.5983 9.78413C14.2 10.2809 14.5835 11.0325 14.5835 11.8737C14.5835 13.3695 13.3709 14.582 11.8752 14.582H11.6668V14.9987C11.6668 15.4589 11.2937 15.832 10.8335 15.832C10.3733 15.832 10.0002 15.4589 10.0002 14.9987V14.582H9.16683V14.9987C9.16683 15.4589 8.79373 15.832 8.3335 15.832C7.87326 15.832 7.50016 15.4589 7.50016 14.9987V14.582H6.66683C6.20659 14.582 5.8335 14.2089 5.8335 13.7487C5.8335 13.2885 6.20659 12.9154 6.66683 12.9154H7.0835V7.08203H6.66683C6.20659 7.08203 5.8335 6.70894 5.8335 6.2487C5.8335 5.78846 6.20659 5.41536 6.66683 5.41536H7.50016V4.9987C7.50016 4.53846 7.87326 4.16536 8.3335 4.16536Z\" fill=\"currentColor\"/></svg>`\n\n/**\n * The \"Crypto\" funding-source glyph (Figma: Add money crypto row leading) \u2014 the\n * RN port of web's `CircleBitcoinIcon`. Renders the bitcoin disc in the theme's\n * primary text color.\n */\nexport function CryptoBitcoinIcon({ size = 28 }: { size?: number }) {\n const theme = useTheme()\n return (\n <SvgXml\n xml={CIRCLE_BITCOIN_SVG}\n width={size}\n height={size}\n color={theme.colors.textPrimary}\n />\n )\n}\n", "import { useEffect, useState } from 'react'\nimport { Image, type ViewStyle } from 'react-native'\nimport { SvgXml } from 'react-native-svg'\n\nimport { Box } from '../theme/restyle'\n\n/**\n * Fun's CDN chain logos are inconsistent: some ship `width`/`height` with **no\n * `viewBox`** (e.g. the 28\u00D728 EVM coins \u2014 these don't scale unless we add one),\n * while others ship their own `viewBox` at a different scale/origin (e.g. Solana\n * 16\u00D716, Tron `138.8 49.5 522 500.2`). A blanket `viewBox` override therefore\n * breaks the latter \u2014 squashing Solana into a corner and pushing Tron entirely\n * off-screen. So we fetch the SVG and **synthesize a `viewBox` only when one is\n * missing** (derived from width/height), never clobbering an existing one, then\n * render with {@link SvgXml}. Results are cached per URL.\n */\nconst svgCache = new Map<string, string>()\n\nfunction ensureViewBox(svg: string): string {\n if (/\\bviewBox\\s*=/.test(svg)) {\n return svg\n }\n const width = svg.match(/\\bwidth=\"([\\d.]+)\"/)?.[1]\n const height = svg.match(/\\bheight=\"([\\d.]+)\"/)?.[1]\n if (!width || !height) {\n return svg\n }\n return svg.replace(/<svg\\b/, `<svg viewBox=\"0 0 ${width} ${height}\"`)\n}\n\n/**\n * Renders a Fun CDN icon. SVG URLs (chain logos) are fetched, viewBox-normalized\n * and drawn via `react-native-svg`'s `SvgXml` (RN's built-in `Image` can't\n * render SVG); raster URLs (token PNGs) go through `Image`. Clipped to a circle.\n */\nexport interface FunIconProps {\n uri: string\n size?: number\n /**\n * Raster URL to swap in if `uri` fails to load (SVG fetch error or `<Image>`\n * `onError`). Mirrors web's `AsyncImage` `fallbackSrc` \u2014 the token list passes\n * `FALLBACK_ASSET_LOGO` (dollar-circle) so a dead CDN URL degrades to the same\n * icon web shows, rather than a blank placeholder.\n */\n fallbackUri?: string\n}\n\nexport function FunIcon({ uri, size = 32, fallbackUri }: FunIconProps) {\n // The URL we're actually rendering; on load failure we swap to `fallbackUri`\n // (once), matching web's `AsyncImage` fallback-on-error behavior.\n const [currentUri, setCurrentUri] = useState(uri)\n const isSvg = currentUri.endsWith('.svg')\n const [xml, setXml] = useState<string | null>(\n () => svgCache.get(currentUri) ?? null,\n )\n // Raster (Image) load state \u2014 drives the placeholder until the logo paints.\n const [rasterLoaded, setRasterLoaded] = useState(false)\n\n // Reset when the requested icon changes (e.g. a different token row).\n useEffect(() => {\n setCurrentUri(uri)\n setRasterLoaded(false)\n setXml(svgCache.get(uri) ?? null)\n }, [uri])\n\n // Swap to the fallback once if the current URL can't be rendered.\n const onFailure = () => {\n if (fallbackUri && currentUri !== fallbackUri) {\n setCurrentUri(fallbackUri)\n setRasterLoaded(false)\n setXml(svgCache.get(fallbackUri) ?? null)\n }\n }\n\n useEffect(() => {\n if (!isSvg) {\n return\n }\n const cached = svgCache.get(currentUri)\n if (cached != null) {\n setXml(cached)\n return\n }\n let active = true\n fetch(currentUri)\n .then((res) => {\n // A 404 still resolves; its body is an error page, not SVG. Treat a\n // non-OK response as a failure so it falls back instead of rendering a\n // blank circle (e.g. a mistyped CDN chain key like `bnb` vs `bsc`).\n if (!res.ok) {\n throw new Error(`icon fetch ${res.status}`)\n }\n return res.text()\n })\n .then((text) => {\n if (!text.includes('<svg')) {\n throw new Error('icon response is not an SVG')\n }\n const normalized = ensureViewBox(text)\n svgCache.set(currentUri, normalized)\n if (active) {\n setXml(normalized)\n }\n })\n .catch(() => {\n // Fetch failed: fall back to the dollar-circle (like web) if one was\n // supplied; otherwise the placeholder fill stays visible.\n if (active) {\n onFailure()\n }\n })\n return () => {\n active = false\n }\n }, [currentUri, isSvg])\n\n // Show a neutral placeholder circle until the icon is ready \u2014 i.e. while the\n // SVG is being fetched (or its fetch failed \u2192 `xml` stays null) or while the\n // raster logo hasn't painted (or 404'd \u2192 `onLoad` never fires). Avoids the\n // bare/broken icon gap seen on slow networks or missing CDN assets.\n const ready = isSvg ? xml != null : rasterLoaded\n const clip: ViewStyle = { overflow: 'hidden' }\n return (\n <Box\n width={size}\n height={size}\n borderRadius=\"rounded\"\n backgroundColor={ready ? undefined : 'bgSecondary'}\n style={clip}\n >\n {isSvg ? (\n xml != null ? (\n <SvgXml xml={xml} width={size} height={size} />\n ) : null\n ) : (\n <Image\n source={{ uri: currentUri }}\n style={{ width: size, height: size }}\n onLoad={() => setRasterLoaded(true)}\n onError={onFailure}\n />\n )}\n </Box>\n )\n}\n", "import { ASSET_LOGO_SRCS } from './assetLogos'\n\n// Fun's icon CDN. Chain logos are SVG; token logos vary (svg/png). {@link FunIcon}\n// picks the renderer by extension (SvgXml for `.svg`, Image otherwise).\nconst CDN_BASE = 'https://sdk-cdn.fun.xyz/images'\n\n/** CDN URL for a chain logo, e.g. `chainIconUri('ethereum')`. SVG. */\nexport const chainIconUri = (chainKey: string): string =>\n `${CDN_BASE}/${chainKey}.svg`\n\n/**\n * Resolve a deposit token's logo URL by symbol \u2014 a verbatim mirror of the web\n * SDK's `getLocalTokenIconUrl` (`packages/connect/src/utils/tokenIconUrl.ts`),\n * the resolver the web *token-transfer* screen uses via `getTokenIconUrl`.\n *\n * IMPORTANT: web's transfer screen resolves the icon PURELY by symbol \u2014 it does\n * NOT consult the `/assets/supported` API `logo` field (that field is only used\n * by the wallet-holdings screen, via `getAssetLogoSrc`). The fallback for an\n * unknown symbol is `<symbol>.svg` on the CDN, NOT the dollar-circle. Matching\n * this exactly is why most tokens (USDT/DAI/WETH \u2026) now render: the CDN files\n * are `.svg`, and special cases like POL live in {@link ASSET_LOGO_SRCS}.\n */\nexport const tokenLogoUri = (symbol: string): string =>\n ASSET_LOGO_SRCS[symbol.toUpperCase()] ??\n `${CDN_BASE}/${symbol.toLowerCase()}.svg`\n", "import type { ViewStyle } from 'react-native'\n\nimport { Box } from '../theme/restyle'\nimport { FALLBACK_ASSET_LOGO } from './assetLogos'\nimport { FunIcon } from './FunIcon'\nimport { chainIconUri } from './funIconUri'\n\n/**\n * The chain-logo cluster shown in the center of the deposit QR (Figma: qr-code\n * \u2192 `icon/chain`). It reflects the selected network: a single network renders\n * one large logo (e.g. Solana), a multi-chain network renders a 2\u00D72 grid of\n * small logos (e.g. EVM: Ethereum / Aptos / Base / BNB). Logos resolve from CDN\n * chain keys OR full image URLs so the package stays asset-free.\n *\n * The QR behind it is drawn at high error-correction ({@link QrCode} `ecl=\"H\"`),\n * so this central occlusion stays scannable.\n */\nexport interface QrChainClusterProps {\n /**\n * Logos for the selected network \u2014 either CDN chain **keys** (e.g.\n * `['ethereum', 'bsc']`) or full image **URLs** (`@funkit/chains` `iconUrl`s).\n * One entry \u2192 a single logo; 2\u20134 \u2192 a 2\u00D72 grid.\n */\n iconKeys: string[]\n /** Max logos in the grid before the rest are dropped (Figma shows 4). */\n max?: number\n}\n\n/** A full URL is used as-is; anything else is treated as a CDN chain key. */\nfunction toIconUri(icon: string): string {\n return icon.startsWith('http') ? icon : chainIconUri(icon)\n}\n\n// A single-network logo fills the center; grid logos are the small Figma size.\n// Figma `qr-code` \u2192 `icon/chain`: 51px quiet-zone card, single logo 40px, grid\n// logos 20px on a 3px gap.\nconst CARD_SIZE = 51\nconst SINGLE_SIZE = 40\nconst GRID_SIZE = 20\nconst GRID_GAP = 3\n\nexport function QrChainCluster({ iconKeys, max = 4 }: QrChainClusterProps) {\n const keys = iconKeys.slice(0, max)\n const first = keys[0]\n if (first == null) {\n return null\n }\n\n if (keys.length === 1) {\n return (\n <Box alignItems=\"center\" justifyContent=\"center\" style={card}>\n <Box style={ring(SINGLE_SIZE)}>\n <FunIcon\n uri={toIconUri(first)}\n size={SINGLE_SIZE}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n </Box>\n </Box>\n )\n }\n\n return (\n <Box alignItems=\"center\" justifyContent=\"center\" style={card}>\n <Box flexDirection=\"row\" flexWrap=\"wrap\" style={grid}>\n {keys.map((key) => (\n <Box key={key} style={ring(GRID_SIZE)}>\n <FunIcon\n uri={toIconUri(key)}\n size={GRID_SIZE}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n </Box>\n ))}\n </Box>\n </Box>\n )\n}\n\n// Cap the row at two columns so 3\u20134 logos wrap into a 2\u00D72.\nconst grid: ViewStyle = {\n width: GRID_SIZE * 2 + GRID_GAP,\n gap: GRID_GAP,\n}\n// The white rounded-square \"quiet zone\" behind the cluster (Figma `icon/chain`).\n// The QR is drawn at high error-correction so this central occlusion stays\n// scannable \u2014 without it the QR pattern bleeds through the gaps between the\n// circular logos. Padded so a little white shows around the 2\u00D72 grid.\nconst card: ViewStyle = {\n width: CARD_SIZE,\n height: CARD_SIZE,\n borderRadius: 16,\n backgroundColor: '#FFFFFF',\n}\n// A logo clipped to a circle (no border \u2014 the chain SVGs carry their own\n// shape). The fill is an opaque white \u2014 the QR is always drawn on white cells\n// ({@link QrCode}), so transparent chain-logo SVGs need a white backing or the\n// QR pattern bleeds through behind the icon.\nconst ring = (iconSize: number): ViewStyle => ({\n width: iconSize,\n height: iconSize,\n borderRadius: 999,\n backgroundColor: '#FFFFFF',\n overflow: 'hidden',\n})\n", "import type { ViewStyle } from 'react-native'\n\nimport { Box, Text, useTheme } from '../theme/restyle'\nimport { FALLBACK_ASSET_LOGO } from './assetLogos'\nimport { FigmaPlusIcon } from './FigmaSystemIcons'\nimport { FunIcon } from './FunIcon'\nimport { chainIconUri } from './funIconUri'\n\n/**\n * The crypto-row trailing avatar stack (Figma: Add money `list-item/base` \u2192\n * `trailing` \u2192 `crypto2`). A short row of supported source-asset logos \u2014\n * 16px thin-bordered circles \u2014 followed by a \"+N\" pill counting the rest, e.g.\n * `\u25C7 \u25CE \u2B21 \u2296 +7`. Logos resolve from CDN chain keys so the package stays\n * asset-free.\n */\nexport interface SourceTokenClusterProps {\n /**\n * Logos to show \u2014 either CDN chain **keys** (e.g. `['ethereum', 'base', \u2026]`)\n * or full image **URLs** (e.g. `@funkit/chains` `iconUrl`s); each entry is\n * resolved independently. The first `maxVisible` render as logos; the rest\n * collapse into the \"+N\" pill.\n */\n icons: string[]\n /** Logos shown before collapsing the rest into \"+N\". Defaults to 4 (Figma). */\n maxVisible?: number\n /** Logo diameter in px. Defaults to 16 (Add money row); 20 on Transfer. */\n size?: number\n /** Gap between chips. Figma: 2 on the Add money row, 4 on Transfer. */\n gap?: number\n /**\n * Overflow chip style. `'count'` (default) shows \"+N\" with the remaining count\n * in a `pillPressed` circle (Transfer deposit row, Figma `tap-target`).\n * `'plus'` shows a bare \"+\" glyph in a `bgSecondary` circle regardless of count\n * (Add money Crypto row, Figma `crypto2`).\n */\n overflowMode?: 'count' | 'plus'\n}\n\n/** A full URL is used as-is; anything else is treated as a CDN chain key. */\nfunction toIconUri(icon: string): string {\n return icon.startsWith('http') ? icon : chainIconUri(icon)\n}\n\nexport function SourceTokenCluster({\n icons,\n maxVisible = 4,\n size = 16,\n gap = 2,\n overflowMode = 'count',\n}: SourceTokenClusterProps) {\n const theme = useTheme()\n const visible = icons.slice(0, maxVisible)\n const overflow = icons.length - visible.length\n return (\n <Box flexDirection=\"row\" alignItems=\"center\" style={{ gap }}>\n {visible.map((icon) => (\n <Box key={icon} backgroundColor=\"bgSecondary\" style={iconRing(size)}>\n <FunIcon\n uri={toIconUri(icon)}\n size={size}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n </Box>\n ))}\n {overflow > 0 ? (\n // Both chips are a fixed `size`\u00D7`size` circle (Figma). The \"+\" glyph sits\n // on `bgSecondary` (Add money `crypto2`); the \"+N\" count on `pillPressed`\n // (Transfer `tap-target`).\n <Box\n backgroundColor={\n overflowMode === 'plus' ? 'bgSecondary' : 'pillPressed'\n }\n alignItems=\"center\"\n justifyContent=\"center\"\n style={overflowCircle(size)}\n >\n {overflowMode === 'plus' ? (\n // The geometric \"+\" glyph centers cleanly; the text \"+\" did not.\n <FigmaPlusIcon size={size} color={theme.colors.textSecondary} />\n ) : (\n <Text\n variant=\"bodyMedium\"\n color=\"textSecondary\"\n style={overflowText(size)}\n >\n {`+${overflow}`}\n </Text>\n )}\n </Box>\n ) : null}\n </Box>\n )\n}\n\n// A logo in a circle with the Figma `border/icon` hairline. `overflow: hidden`\n// clips the CDN logo to the circle so the border reads cleanly.\nconst iconRing = (size: number): ViewStyle => ({\n width: size,\n height: size,\n borderRadius: 999,\n borderWidth: 1,\n borderColor: 'rgba(0,0,0,0.1)',\n overflow: 'hidden',\n // Center the same-size FunIcon so the border-box hairline doesn't push it 1px\n // off and clip the bottom-right; it fills the circle with the border on edge.\n alignItems: 'center',\n justifyContent: 'center',\n})\n// Both overflow chips are a fixed `size`\u00D7`size` circle (Figma) \u2014 no horizontal\n// padding (which made the single-glyph \"+\" read as an oval).\nconst overflowCircle = (size: number): ViewStyle => ({\n width: size,\n height: size,\n borderRadius: 999,\n})\n// \"+N\" count text: Inter-Medium (via `bodyMedium`) at ~0.6\u00D7 the chip, tracking\n// -0.48 per the Figma `tap-target` (`+4`).\nconst overflowText = (size: number) =>\n ({\n fontSize: Math.round(size * 0.6),\n letterSpacing: -0.48,\n }) as const\n", "import type { ViewStyle } from 'react-native'\n\nimport { Box } from '../theme/restyle'\nimport { FALLBACK_ASSET_LOGO } from './assetLogos'\nimport { FunIcon } from './FunIcon'\nimport { chainIconUri, tokenLogoUri } from './funIconUri'\n\n/**\n * A token logo with a small chain badge overlaid bottom-right (Figma: the\n * `icon/crypto` avatar) \u2014 the RN analogue of web's `FunAssetAvatar`. The token\n * icon resolves from `iconSrc` (direct URL, matching web's\n * `DynamicTargetAssetCandidate.iconSrc`) or falls back to CDN via `symbol`\n * ({@link tokenLogoUri}). The badge resolves by CDN chain key. Omit `chainKey`\n * to render the token logo alone.\n */\nexport interface TokenChainIconProps {\n /** Token symbol \u2192 CDN token logo fallback, e.g. `\"USDG\"`. */\n symbol: string\n /** Direct URL for the token icon \u2014 preferred over CDN `symbol` lookup. */\n iconSrc?: string\n /** CDN chain key for the badge overlay, e.g. `\"ethereum\"`. Omit to hide it. */\n chainKey?: string\n size?: number\n}\n\nexport function TokenChainIcon({\n symbol,\n iconSrc,\n chainKey,\n size = 24,\n}: TokenChainIconProps) {\n const badge = Math.round(size * 0.5)\n return (\n <Box width={size} height={size}>\n <FunIcon\n uri={iconSrc ?? tokenLogoUri(symbol)}\n size={size}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n {chainKey ? (\n <Box\n backgroundColor=\"bgModal\"\n borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={badgeRing(badge)}\n >\n <FunIcon\n uri={chainIconUri(chainKey)}\n size={badge}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n </Box>\n ) : null}\n </Box>\n )\n}\n\nconst badgeRing = (badge: number): ViewStyle => ({\n position: 'absolute',\n right: -1,\n bottom: -1,\n width: badge + 2,\n height: badge + 2,\n})\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Animated, Pressable, ScrollView, type ViewStyle } from 'react-native'\n// `Animated` (above) is React Native's legacy API, still used by the loading\n// pulse. The \"Deposit to\" dropdown motion uses `react-native-reanimated`,\n// imported here as `Reanimated` so the two namespaces don't collide.\nimport Reanimated, {\n Easing,\n Keyframe,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\n\nimport { FigmaCheckIcon, FigmaChevronDownIcon } from '../icons/FigmaSystemIcons'\nimport { Box, Text } from '../theme/restyle'\n\n// Motion tokens for the \"Deposit to\" dropdown open/close \u2014 transitions.dev\n// `menu-dropdown` recipe translated to reanimated. The web recipe grows the\n// menu from its trigger (transform-origin top, scale 0.97\u21921, opacity 0\u21921); RN\n// has no transform-origin, so a small translateY (-4\u21920) gives the same\n// \"emerging from the trigger top\" read. Open = Fast (250ms), close = Quick\n// (150ms), Smooth ease-out easing (cubic-bezier(0.22, 1, 0.36, 1)).\nconst DROPDOWN_OPEN_DURATION = 250\nconst DROPDOWN_CLOSE_DURATION = 150\nconst DROPDOWN_EASING = Easing.bezier(0.22, 1, 0.36, 1)\nconst DROPDOWN_PRE_SCALE = 0.97\nconst DROPDOWN_TRANSLATE_Y = -4\n\nconst AnimatedPressable = Reanimated.createAnimatedComponent(Pressable)\n\n// The menu is conditionally rendered (closed = unmounted), so the open/close\n// motion rides reanimated layout animations \u2014 `entering` on mount, `exiting`\n// on unmount \u2014 the same pattern as AddressCopiedToast. Enter grows from the\n// trigger top (opacity + scale 0.97\u21921 + translateY -4\u21920); exit reverses it.\n// Easing lives on the destination keyframe (per reanimated's Keyframe API).\nconst menuEnter = new Keyframe({\n 0: {\n opacity: 0,\n transform: [\n { translateY: DROPDOWN_TRANSLATE_Y },\n { scale: DROPDOWN_PRE_SCALE },\n ],\n },\n 100: {\n opacity: 1,\n transform: [{ translateY: 0 }, { scale: 1 }],\n easing: DROPDOWN_EASING,\n },\n}).duration(DROPDOWN_OPEN_DURATION)\nconst menuExit = new Keyframe({\n 0: {\n opacity: 1,\n transform: [{ translateY: 0 }, { scale: 1 }],\n },\n 100: {\n opacity: 0,\n transform: [\n { translateY: DROPDOWN_TRANSLATE_Y },\n { scale: DROPDOWN_PRE_SCALE },\n ],\n easing: DROPDOWN_EASING,\n },\n}).duration(DROPDOWN_CLOSE_DURATION)\n// The dimming scrim fades in/out (opacity only) in sync with the menu.\nconst scrimEnter = new Keyframe({\n 0: { opacity: 0 },\n 100: { opacity: 1, easing: DROPDOWN_EASING },\n}).duration(DROPDOWN_OPEN_DURATION)\nconst scrimExit = new Keyframe({\n 0: { opacity: 1 },\n 100: { opacity: 0, easing: DROPDOWN_EASING },\n}).duration(DROPDOWN_CLOSE_DURATION)\n\n/**\n * One selectable funding source in {@link AddMoneyScreen}. Brand icons are\n * host-supplied (`icon` / `trailing`) so the package stays asset- and\n * `react-native-svg`-free; the screen renders a themed circular slot for each.\n */\nexport interface PaymentMethodOption {\n /** Stable id passed back to `onSelectMethod`. */\n id: string\n title: string\n /** Secondary line: balance, limit, timing, etc. */\n subtitle?: string\n /** Leading icon, centered in the themed circle. */\n icon?: ReactNode\n /** Trailing accessory, e.g. a token cluster for the Crypto row. */\n trailing?: ReactNode\n}\n\n/**\n * One option in the \"Deposit to\" receive-token dropdown (Figma: Fun Mobile /\n * Add money). Mirrors web's `ReceiveTokenDropdown` items. The icon is supplied\n * by the flow (keeping this screen asset-free) and `label` is the composed\n * destination text, e.g. `\"USDG (Perps)\"`.\n */\nexport interface ReceiveTokenOption {\n id: string\n label: string\n icon?: ReactNode\n}\n\nexport interface AddMoneyScreenProps {\n methods: PaymentMethodOption[]\n onSelectMethod: (id: string) => void\n title?: string\n /**\n * Receive-token candidates shown in the \"Deposit to\" dropdown above the\n * payment methods (web: `ReceiveTokenDropdown`). When set, the screen shows\n * the dropdown + a \"Pay with\" section label. Omit to render just the\n * methods list (back-compat with hosts that don't pass candidates).\n */\n receiveTokens?: ReceiveTokenOption[]\n selectedReceiveTokenId?: string\n onSelectReceiveToken?: (id: string) => void\n depositToLabel?: string\n payWithLabel?: string\n /**\n * Show the loading skeleton instead of the method list (Figma: Fun Mobile /\n * Add money, loading). Set while the funding sources are still being fetched\n * (e.g. the Swapped cash methods) so the list doesn't pop in row-by-row.\n */\n loading?: boolean\n /**\n * Number of skeleton rows rendered while `loading`. Defaults to 5 when the\n * deposit selector shows, 6 otherwise (it reclaims the selector's room).\n */\n skeletonCount?: number\n /**\n * Show the error state instead of the list (Figma: Fun Mobile / Add money,\n * error) \u2014 a \"Something went wrong\" message + a \"Try again\" button. Takes\n * precedence over `loading`. Set when fetching the funding sources failed.\n */\n error?: boolean\n /** \"Try again\" handler shown with the error state. */\n onRetry?: () => void\n errorTitle?: string\n errorMessage?: string\n retryLabel?: string\n /**\n * Open the \"Deposit to\" dropdown on mount. For previews/tests of the expanded\n * state (Figma node 11200:8055); hosts leave this `false` and let the user\n * tap the trigger.\n */\n initialDropdownOpen?: boolean\n}\n\nconst DEFAULT_ERROR_TITLE = 'Something went wrong'\nconst DEFAULT_ERROR_MESSAGE =\n 'There was a problem loading data.\\nCheck your internet and try again.'\nconst DEFAULT_RETRY_LABEL = 'Try again'\n\n/**\n * The \"Add money\" funding-source picker (Figma: Fun Mobile / Add money). A\n * bottom-sheet-style surface \u2014 grabber + centered title + a scrollable list of\n * payment methods \u2014 built from the connect-rn Restyle theme so it tracks the\n * active light/dark scheme. Selecting a method (e.g. Crypto) routes the host to\n * the next screen (Transfer/UDA).\n *\n * When `receiveTokens` are given, a fixed \"Deposit to\" selector sits above the\n * scrollable list. Opening it floats the option list as an overlay (it does\n * NOT reflow the list) over a dimming scrim \u2014 matching web's\n * `ReceiveTokenDropdown`.\n */\nexport function AddMoneyScreen({\n methods,\n onSelectMethod,\n title = 'Add money',\n loading = false,\n skeletonCount,\n error = false,\n onRetry,\n errorTitle = DEFAULT_ERROR_TITLE,\n errorMessage = DEFAULT_ERROR_MESSAGE,\n retryLabel = DEFAULT_RETRY_LABEL,\n receiveTokens,\n selectedReceiveTokenId,\n onSelectReceiveToken,\n depositToLabel = 'Deposit to',\n payWithLabel = 'Pay with',\n initialDropdownOpen = false,\n}: AddMoneyScreenProps) {\n const selected = receiveTokens?.find((t) => t.id === selectedReceiveTokenId)\n const showDropdown = receiveTokens && receiveTokens.length > 0 && selected\n\n // Dropdown open-state lives here (not in the dropdown) so the screen can lay\n // a dimming scrim over the whole sheet while the option list floats above it.\n const [dropdownOpen, setDropdownOpen] = useState(initialDropdownOpen)\n const scrimVisible = !error && showDropdown && dropdownOpen\n\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n >\n <Box alignItems=\"center\" style={topBar}>\n <Box backgroundColor=\"borderFocused\" style={grabber} />\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n\n {error ? (\n <AddMoneyError\n title={errorTitle}\n message={errorMessage}\n retryLabel={retryLabel}\n onRetry={onRetry}\n />\n ) : loading ? (\n <AddMoneyLoading\n count={skeletonCount}\n showDropdown={Boolean(showDropdown)}\n depositToLabel={depositToLabel}\n payWithLabel={payWithLabel}\n />\n ) : (\n <>\n {/* Fixed \"Deposit to\" selector. Sits above the scrollable list and\n stays above the scrim (so it reads bright while the rest dims). */}\n {showDropdown ? (\n <Box style={depositSection}>\n <Box style={sectionLabel}>\n <Text variant=\"detail\" weight=\"medium\" color=\"textSecondary\">\n {depositToLabel}\n </Text>\n </Box>\n <ReceiveTokenDropdown\n tokens={receiveTokens}\n selected={selected}\n open={dropdownOpen}\n onToggle={() => setDropdownOpen((o) => !o)}\n onSelect={(id) => {\n onSelectReceiveToken?.(id)\n setDropdownOpen(false)\n }}\n />\n </Box>\n ) : null}\n\n {showDropdown ? (\n // \"Pay with\" section: a labeled, bordered card wrapping the method\n // rows with hairline dividers between them (Figma node 11202:8282).\n <Box style={payWithSection}>\n <Box style={sectionLabel}>\n <Text variant=\"detail\" weight=\"medium\" color=\"textSecondary\">\n {payWithLabel}\n </Text>\n </Box>\n <Box\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"element\"\n style={methodsCard}\n >\n {methods.map((method, i) => (\n <Box key={method.id}>\n {i > 0 ? <MethodDivider /> : null}\n <Pressable\n onPress={() => onSelectMethod(method.id)}\n accessibilityRole=\"button\"\n accessibilityLabel={method.title}\n >\n <PaymentMethodRow method={method} />\n </Pressable>\n </Box>\n ))}\n </Box>\n </Box>\n ) : (\n // Methods-only: bare rows with full-width hairline dividers, no\n // outer border (Figma node 11202:8632).\n <ScrollView\n contentContainerStyle={listContent}\n showsVerticalScrollIndicator={false}\n >\n {methods.map((method, i) => (\n <Box key={method.id}>\n {i > 0 ? <MethodDivider /> : null}\n <Pressable\n onPress={() => onSelectMethod(method.id)}\n accessibilityRole=\"button\"\n accessibilityLabel={method.title}\n >\n <PaymentMethodRow method={method} />\n </Pressable>\n </Box>\n ))}\n </ScrollView>\n )}\n </>\n )}\n\n {/* Dimming scrim (Figma: background-overlay, rgba(0,0,0,0.2)). Sits below\n the deposit selector + option list but above the rest of the sheet;\n tapping it closes the dropdown. */}\n {scrimVisible ? (\n <AnimatedPressable\n entering={scrimEnter}\n exiting={scrimExit}\n style={scrim}\n onPress={() => setDropdownOpen(false)}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n />\n ) : null}\n </Box>\n )\n}\n\n/**\n * Error state for the Add money screen (Figma: Fun Mobile / Add money, error).\n * A centered \"Something went wrong\" message over a primary \"Try again\" pill\n * that re-runs the funding-source fetch.\n */\nfunction AddMoneyError({\n title,\n message,\n retryLabel,\n onRetry,\n}: {\n title: string\n message: string\n retryLabel: string\n onRetry?: () => void\n}) {\n return (\n <Box alignItems=\"center\" justifyContent=\"center\" style={errorContainer}>\n <Box alignItems=\"center\" style={errorText}>\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n <Text variant=\"detail\" color=\"textSecondary\" style={errorMessageText}>\n {message}\n </Text>\n </Box>\n <Pressable\n onPress={onRetry}\n accessibilityRole=\"button\"\n accessibilityLabel={retryLabel}\n >\n <Box\n backgroundColor=\"btnPrimary\"\n borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={retryButton}\n >\n <Text variant=\"bodyMedium\" color=\"onBtnPrimary\">\n {retryLabel}\n </Text>\n </Box>\n </Pressable>\n </Box>\n )\n}\n\nfunction PaymentMethodRow({ method }: { method: PaymentMethodOption }) {\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n style={row}\n >\n <Box\n width={48}\n height={48}\n borderRadius=\"rounded\"\n backgroundColor=\"bgSecondary\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {method.icon}\n </Box>\n <Box flex={1} style={details}>\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {method.title}\n </Text>\n {method.subtitle ? (\n <Text variant=\"detail\" color=\"textSecondary\">\n {method.subtitle}\n </Text>\n ) : null}\n </Box>\n {method.trailing}\n </Box>\n )\n}\n\n/**\n * Hairline divider between method rows (Figma `line-container`, 1px\n * `border/elements/default`), spanning the full row width.\n */\nfunction MethodDivider() {\n return <Box backgroundColor=\"borderDefault\" style={divider} />\n}\n\n/**\n * The \"Deposit to\" receive-token dropdown (Figma: Fun Mobile / Add money) \u2014\n * RN analogue of web's `ReceiveTokenDropdown`. A bordered trigger pill\n * (icon + label + chevron); when `open`, the option list floats below it as an\n * absolute overlay (`top: '100%'`) so it never reflows the list underneath.\n * Open-state is controlled by the screen (which also lays the scrim).\n */\nfunction ReceiveTokenDropdown({\n tokens,\n selected,\n open,\n onToggle,\n onSelect,\n}: {\n tokens: ReceiveTokenOption[]\n selected: ReceiveTokenOption\n open: boolean\n onToggle: () => void\n onSelect: (id: string) => void\n}) {\n const selectable = tokens.length > 1\n\n return (\n <Box style={dropdownAnchor}>\n <Pressable\n onPress={selectable ? onToggle : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={selected.label}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"element\"\n style={dropdownTrigger}\n >\n <Box flexDirection=\"row\" alignItems=\"center\" style={triggerLeft}>\n {selected.icon ?? <ReceiveTokenIconFallback />}\n <Text\n variant=\"bodyMedium\"\n color=\"textPrimary\"\n numberOfLines={1}\n style={triggerLabel}\n >\n {selected.label}\n </Text>\n </Box>\n {selectable ? <AnimatedChevron open={open} /> : null}\n </Box>\n </Pressable>\n {open && selectable ? (\n <Reanimated.View\n entering={menuEnter}\n exiting={menuExit}\n style={dropdownMenuOverlay}\n >\n <Box\n backgroundColor=\"bgModal\"\n borderRadius=\"element\"\n style={dropdownMenu}\n >\n {tokens.map((token) => (\n <Pressable\n key={token.id}\n onPress={() => onSelect(token.id)}\n accessibilityRole=\"menuitem\"\n accessibilityLabel={token.label}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n style={dropdownItem}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n style={triggerLeft}\n >\n {token.icon ?? <ReceiveTokenIconFallback />}\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {token.label}\n </Text>\n </Box>\n {token.id === selected.id ? <CheckIcon /> : null}\n </Box>\n </Pressable>\n ))}\n </Box>\n </Reanimated.View>\n ) : null}\n </Box>\n )\n}\n\nfunction ReceiveTokenIconFallback() {\n return (\n <Box\n width={24}\n height={24}\n borderRadius=\"rounded\"\n backgroundColor=\"pillPressed\"\n />\n )\n}\n\nfunction ChevronDownIcon() {\n return <FigmaChevronDownIcon size={16} />\n}\n\n/**\n * The trigger chevron, rotated ~180\u00B0 while the dropdown is open (same\n * timing/easing as the menu) so it reads as flipping up as the menu opens.\n */\nfunction AnimatedChevron({ open }: { open: boolean }) {\n const rotation = useSharedValue(open ? 1 : 0)\n useEffect(() => {\n rotation.value = withTiming(open ? 1 : 0, {\n duration: open ? DROPDOWN_OPEN_DURATION : DROPDOWN_CLOSE_DURATION,\n easing: DROPDOWN_EASING,\n })\n }, [open, rotation])\n const style = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotation.value * 180}deg` }],\n }))\n return (\n <Reanimated.View style={style}>\n <FigmaChevronDownIcon size={16} />\n </Reanimated.View>\n )\n}\n\nfunction CheckIcon() {\n return <FigmaCheckIcon size={16} />\n}\n\n/**\n * Loading skeleton for the Add money screen. Mirrors the populated layout so\n * content swaps in without a shift: when `showDropdown`, a \"Deposit to\"\n * selector skeleton + \"Pay with\" label sit above the method skeletons (matching\n * the loaded view's sections); otherwise just the method skeletons. Shapes\n * pulse opacity in sync; labels + chevron stay static.\n */\nfunction AddMoneyLoading({\n count,\n showDropdown,\n depositToLabel,\n payWithLabel,\n}: {\n count?: number\n showDropdown: boolean\n depositToLabel: string\n payWithLabel: string\n}) {\n const opacity = usePulse()\n // The deposit selector takes vertical room, so fewer method rows fit.\n const rowCount = count ?? (showDropdown ? 5 : 6)\n return (\n <>\n {showDropdown ? (\n <Box style={depositSection}>\n <Box style={sectionLabel}>\n <Text variant=\"detail\" color=\"textSecondary\">\n {depositToLabel}\n </Text>\n </Box>\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"element\"\n style={dropdownTrigger}\n >\n <Animated.View style={[loadingSelectorLeft, { opacity }]}>\n <Box\n width={20}\n height={20}\n borderRadius=\"rounded\"\n backgroundColor=\"pillPressed\"\n />\n <Box backgroundColor=\"pillPressed\" style={skeletonTitleBar} />\n </Animated.View>\n <ChevronDownIcon />\n </Box>\n </Box>\n ) : null}\n\n {showDropdown ? (\n <Box style={payWithSection}>\n <Box style={sectionLabel}>\n <Text variant=\"detail\" color=\"textSecondary\">\n {payWithLabel}\n </Text>\n </Box>\n <Box\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"element\"\n style={methodsCard}\n >\n <Animated.View\n style={{ opacity }}\n accessibilityLabel=\"Loading payment methods\"\n >\n {Array.from({ length: rowCount }, (_, i) => (\n <PaymentMethodRowSkeleton key={i} />\n ))}\n </Animated.View>\n </Box>\n </Box>\n ) : (\n <Box style={skeletonListContent}>\n <Animated.View\n style={{ opacity }}\n accessibilityLabel=\"Loading payment methods\"\n >\n {Array.from({ length: rowCount }, (_, i) => (\n <PaymentMethodRowSkeleton key={i} />\n ))}\n </Animated.View>\n </Box>\n )}\n </>\n )\n}\n\n/**\n * One skeleton row in the loading list (Figma node 11333:2346): a fixed 68px\n * row (48px circular leading slot + 10px vertical padding) plus two stacked\n * bars (157\u00D716, 83\u00D714, 4px gap) \u2014 the exact Figma loading geometry.\n */\nfunction PaymentMethodRowSkeleton() {\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n style={skeletonRow}\n >\n <Box\n width={48}\n height={48}\n borderRadius=\"rounded\"\n backgroundColor=\"pillPressed\"\n />\n <Box flex={1} style={skeletonDetails}>\n <Box backgroundColor=\"pillPressed\" style={skeletonTitleBar} />\n <Box backgroundColor=\"pillPressed\" style={skeletonSubtitleBar} />\n </Box>\n </Box>\n )\n}\n\nfunction usePulse() {\n const opacity = useRef(new Animated.Value(1)).current\n useEffect(() => {\n const loop = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, {\n toValue: 0.5,\n duration: 700,\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: 1,\n duration: 700,\n useNativeDriver: true,\n }),\n ]),\n )\n loop.start()\n return () => loop.stop()\n }, [opacity])\n return opacity\n}\n\nconst topBar: ViewStyle = { height: 64, paddingTop: 25, paddingBottom: 12 }\nconst grabber: ViewStyle = {\n position: 'absolute',\n top: 8,\n width: 36,\n height: 5,\n borderRadius: 999,\n}\n// Methods-only list (Figma node 11202:8632): rows padded 16 horizontal, no\n// outer border, hairline dividers between them.\nconst listContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: 16,\n}\n// list-item/base: 12px padding all sides (Figma), gap 12 between leading slot\n// and details supplied by the Box `gap` prop.\nconst row: ViewStyle = { padding: 12 }\nconst details: ViewStyle = { gap: 2 }\n// The fixed deposit selector. zIndex keeps it (and its overlaid option list)\n// above the scrim; the rest of the sheet sits below it and dims.\nconst depositSection: ViewStyle = {\n paddingHorizontal: 16,\n zIndex: 2,\n}\n// \"Pay with\" section: label + bordered method card, 12px gap between (Figma\n// node 11202:8279, pt-12 on the section).\nconst payWithSection: ViewStyle = {\n paddingHorizontal: 16,\n paddingTop: 12,\n paddingBottom: 16,\n}\n// Label rows sit with 12px horizontal padding so they align with the row text\n// inside the cards/triggers below them (Figma px-12 on the label).\nconst sectionLabel: ViewStyle = { paddingHorizontal: 12, paddingBottom: 6 }\n// Bordered card wrapping the method rows (Figma node 11202:8282): py-2 inset so\n// the first/last rows clear the rounded corners.\nconst methodsCard: ViewStyle = { paddingVertical: 2, overflow: 'hidden' }\n// Hairline divider between rows.\nconst divider: ViewStyle = { height: 1 }\nconst dropdownAnchor: ViewStyle = { position: 'relative' }\nconst dropdownTrigger: ViewStyle = { height: 48, paddingHorizontal: 12 }\nconst triggerLeft: ViewStyle = { gap: 6, flex: 1 }\nconst triggerLabel: ViewStyle = { flex: 1 }\n// Floating option list: anchored just below the trigger as an overlay, so it\n// never reflows the method list. The animated wrapper owns the positioning\n// (and the open/close transform + opacity); the inner Box owns the surface.\nconst dropdownMenuOverlay: ViewStyle = {\n position: 'absolute',\n top: '100%',\n left: 0,\n right: 0,\n marginTop: 4,\n zIndex: 30,\n}\n// shadow/lg from Figma (0,8 / blur 32\u219216 radius / rgba(0,0,0,0.12)); no border.\n// Kept on the surface Box (which has a background) so the iOS shadow renders.\nconst dropdownMenu: ViewStyle = {\n shadowColor: '#000',\n shadowOpacity: 0.12,\n shadowOffset: { width: 0, height: 8 },\n shadowRadius: 16,\n elevation: 8,\n}\nconst dropdownItem: ViewStyle = { height: 48, paddingHorizontal: 12 }\nconst scrim: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0,0,0,0.2)',\n zIndex: 1,\n}\nconst errorContainer: ViewStyle = {\n height: 468,\n gap: 24,\n paddingHorizontal: 16,\n}\nconst errorText: ViewStyle = { gap: 8 }\nconst errorMessageText = { textAlign: 'center' } as const\nconst retryButton: ViewStyle = { height: 48, paddingHorizontal: 20 }\n// The loading list (Figma node 11333:2342): same horizontal/bottom padding as\n// the loaded list but no inter-row gap \u2014 the 68px skeleton rows stack flush\n// (their py-10 supplies the breathing room), matching the Figma frame exactly.\nconst skeletonListContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: 16,\n}\n// Figma list-item/base: 12px padding all sides (48px leading circle + 12 each\n// side = 72px row). No inter-row gap; rows abut directly inside the card.\nconst skeletonRow: ViewStyle = { padding: 12 }\n// Row layout for the skeleton selector's left (Animated.View takes no Restyle\n// props, so flexDirection lives here, not as a prop).\nconst loadingSelectorLeft: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 6,\n flex: 1,\n}\nconst skeletonDetails: ViewStyle = { gap: 4 }\nconst skeletonTitleBar: ViewStyle = { width: 157, height: 16, borderRadius: 4 }\nconst skeletonSubtitleBar: ViewStyle = {\n width: 83,\n height: 14,\n borderRadius: 4,\n}\n", "import {\n Pressable,\n ScrollView,\n type ViewStyle,\n useWindowDimensions,\n} from 'react-native'\n\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport { FigmaCloseIcon } from '../icons/FigmaSystemIcons'\nimport { FunIcon } from '../icons/FunIcon'\nimport { Box, Text } from '../theme/restyle'\n\n/**\n * One chain row in {@link AvailableChainsScreen} \u2014 a member chain of the\n * selected deposit network (e.g. Ethereum within the EVM group). The SDK\n * derives these from the curated `tokentransferconfig` + `@funkit/chains`\n * metadata + the `mintokentransfervalue` config (see `buildAvailableChains`).\n */\nexport interface AvailableChain {\n id: string\n /** Display name, e.g. `Ethereum`, `Binance Smart Chain`. */\n name: string\n /** Full CDN logo URL for the 36px chain icon. */\n iconUri: string\n /** Minimum-deposit label shown on the trailing side, e.g. `Min $10`. */\n minLabel?: string\n}\n\n/**\n * The \"Available {network} Chains\" screen (Figma: qr-code-modal variant, node\n * 11238:25322) \u2014 reached by tapping the chain-logo cluster on the Transfer\n * screen. An X-close + centered title bar, then a read-only list of the\n * network's member chains with their minimum-deposit amounts. Presentational:\n * the host supplies the chain rows.\n */\nexport interface AvailableChainsScreenProps {\n /** Network whose chains are listed; the title reads `Available {networkLabel}`. */\n networkLabel: string\n chains: AvailableChain[]\n title?: string\n loading?: boolean\n skeletonCount?: number\n onClose?: () => void\n}\n\nexport function AvailableChainsScreen({\n networkLabel,\n chains,\n title = `Available ${networkLabel}`,\n loading = false,\n skeletonCount = 8,\n onClose,\n}: AvailableChainsScreenProps) {\n const { height } = useWindowDimensions()\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={sheet}\n >\n {/* Top bar: X close \u00B7 title \u00B7 spacer (keeps the title centered) */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Pressable\n onPress={onClose}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n >\n <Box alignItems=\"center\" justifyContent=\"center\" style={iconButton}>\n <FigmaCloseIcon />\n </Box>\n </Pressable>\n <Box flex={1} alignItems=\"center\">\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n\n <ScrollView\n style={[list, { maxHeight: height * 0.72 }]}\n showsVerticalScrollIndicator={false}\n contentContainerStyle={content}\n >\n {loading\n ? Array.from({ length: skeletonCount }, (_, index) => (\n <AvailableChainSkeleton key={index} />\n ))\n : chains.map((chain) => (\n <Box\n key={chain.id}\n flexDirection=\"row\"\n alignItems=\"center\"\n style={row}\n >\n <Box style={iconRing}>\n <FunIcon\n uri={chain.iconUri}\n size={36}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n </Box>\n <Box flex={1}>\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {chain.name}\n </Text>\n </Box>\n {chain.minLabel ? (\n <Text variant=\"detail\" color=\"textSecondary\">\n {chain.minLabel}\n </Text>\n ) : null}\n </Box>\n ))}\n </ScrollView>\n </Box>\n )\n}\n\nfunction AvailableChainSkeleton() {\n return (\n <Box flexDirection=\"row\" alignItems=\"center\" style={row}>\n <Box backgroundColor=\"pillPressed\" style={skeletonIcon} />\n <Box flex={1}>\n <Box backgroundColor=\"pillPressed\" style={skeletonName} />\n </Box>\n <Box backgroundColor=\"pillPressed\" style={skeletonMin} />\n </Box>\n )\n}\n\nconst sheet: ViewStyle = { paddingBottom: 20 }\nconst topBar: ViewStyle = {\n paddingVertical: 16,\n paddingHorizontal: 24,\n gap: 4,\n}\n// A 56px-wide touch target (32px box + 12px hitSlop each side), matching the\n// Transfer/QR close buttons.\nconst iconButton: ViewStyle = { width: 32, height: 32 }\n// Matches the close button's box so the flex-centered title stays centered.\nconst topBarSpacer: ViewStyle = { width: 32, height: 32 }\nconst list: ViewStyle = { width: '100%' }\nconst content: ViewStyle = { paddingHorizontal: 20 }\nconst row: ViewStyle = { gap: 12, paddingVertical: 10 }\nconst skeletonIcon: ViewStyle = { width: 36, height: 36, borderRadius: 999 }\nconst skeletonName: ViewStyle = { width: 157, height: 16, borderRadius: 4 }\nconst skeletonMin: ViewStyle = { width: 46, height: 16, borderRadius: 4 }\n// A logo clipped to a circle with the Figma `border/icon` hairline. Centering\n// the same-size FunIcon keeps it from sitting 1px off (the border-box hairline\n// shrinks the content box) \u2014 it fills the circle with the border on its edge.\nconst iconRing: ViewStyle = {\n width: 36,\n height: 36,\n borderRadius: 999,\n borderWidth: 1,\n borderColor: 'rgba(0,0,0,0.1)',\n overflow: 'hidden',\n alignItems: 'center',\n justifyContent: 'center',\n}\n", "import { StyleSheet } from 'react-native'\n\nimport { FigmaInfoCircleIcon } from '../icons/FigmaSystemIcons'\nimport { Box, Text } from '../theme/restyle'\n\nexport function CheckoutBlockedScreen() {\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n >\n <Box alignItems=\"center\" style={styles.topBar}>\n <Box backgroundColor=\"borderFocused\" style={styles.grabber} />\n </Box>\n\n <Box alignItems=\"center\" justifyContent=\"center\" style={styles.content}>\n <Box\n backgroundColor=\"bgSecondary\"\n borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={styles.iconCircle}\n >\n <FigmaInfoCircleIcon size={24} />\n </Box>\n <Box alignItems=\"center\" style={styles.textGroup}>\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n Not available\n </Text>\n <Text\n variant=\"detail\"\n color=\"textSecondary\"\n style={styles.descriptionText}\n >\n This service is not available in your region.\n </Text>\n </Box>\n </Box>\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n topBar: { paddingTop: 20, paddingBottom: 12 },\n grabber: {\n position: 'absolute',\n top: 8,\n width: 36,\n height: 5,\n borderRadius: 999,\n },\n content: {\n height: 468,\n gap: 16,\n paddingHorizontal: 16,\n },\n iconCircle: { width: 48, height: 48 },\n textGroup: { gap: 8 },\n descriptionText: { textAlign: 'center' },\n})\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport {\n Pressable,\n type TextStyle,\n type ViewStyle,\n useWindowDimensions,\n} from 'react-native'\n\nimport { CopyAddressIcon } from '../icons/CopyAddressIcon'\nimport { Box, Text } from '../theme/restyle'\n\n/**\n * The deposit QR-code screen (Figma: Fun Mobile / qr-code-modal, node\n * 11636:2663). A minimal sheet: an X-close + centered \"QR Code\" title bar, the\n * framed QR with the selected network's chain logos overlaid in its center, and\n * \u2014 below it \u2014 the full deposit address with a \"Copy address\" button.\n *\n * Rendered as a bottom sheet that fills at least half the screen (a `minHeight`\n * derived from the window, NOT `flex: 1` \u2014 a flex-filled layout collapses to\n * nothing inside the flow's content-sized modal wrapper). The QR + address group\n * center vertically in whatever height results.\n *\n * The scannable QR itself is host-supplied (`qrCode`, e.g.\n * `react-native-qrcode-svg`) so the package stays `react-native-svg`-free; this\n * screen renders the themed frame and the centered chain-logo overlay.\n */\nexport interface QrCodeScreenProps {\n /** The rendered QR code node (host-supplied). */\n qrCode: ReactNode\n /**\n * Chain logos centered on the QR \u2014 the selected network's icons (see\n * {@link QrChainCluster}). Omit to render the QR with no center overlay.\n */\n centerIcon?: ReactNode\n /** The full deposit address shown (wrapping) below the QR. */\n address?: string\n title?: string\n copyLabel?: string\n copiedLabel?: string\n /** How long the \"Copied\" confirmation stays on the Copy button (ms). */\n copiedFeedbackMs?: number\n onClose?: () => void\n /**\n * Copy the full address to the clipboard. Omit to hide the Copy button.\n * May return whether the copy succeeded; when it resolves `false` the\n * \"Copied!\" confirmation is suppressed (a `void` return is treated as\n * success).\n */\n onCopyAddress?: () => void | Promise<boolean>\n}\n\nexport function QrCodeScreen({\n qrCode,\n centerIcon,\n address,\n title = 'QR Code',\n copyLabel = 'Copy address',\n copiedLabel = 'Copied!',\n copiedFeedbackMs = 1800,\n onClose,\n onCopyAddress,\n}: QrCodeScreenProps) {\n const { height } = useWindowDimensions()\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n\n useEffect(() => () => clearTimeout(copyTimer.current), [])\n\n const handleCopy = async () => {\n // Only confirm \"Copied!\" when the write actually landed: copyToClipboard\n // returns false on its warn-only no-op path (e.g. no clipboard module), so\n // we don't claim success falsely. A void-returning handler is success.\n const ok = await onCopyAddress?.()\n if (ok === false) return\n setCopied(true)\n clearTimeout(copyTimer.current)\n copyTimer.current = setTimeout(() => setCopied(false), copiedFeedbackMs)\n }\n\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={sheet}\n >\n {/* Top bar: X close \u00B7 title \u00B7 spacer (keeps the title centered) */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Pressable\n onPress={onClose}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n >\n <Text color=\"textPrimary\" style={closeGlyph}>\n \u2715\n </Text>\n </Pressable>\n <Box flex={1} alignItems=\"center\">\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n\n {/* QR card + address group, centered in a region that makes the sheet at\n least half the screen tall. minHeight (not a flex child) so it reliably\n fills \u2014 a flexGrow child does NOT expand into a parent's minHeight under\n Yoga. */}\n <Box\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[content, { minHeight: height * 0.5 }]}\n >\n <Box\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1.5}\n alignItems=\"center\"\n justifyContent=\"center\"\n style={qrFrame}\n >\n {qrCode}\n {centerIcon ? (\n <Box\n alignItems=\"center\"\n justifyContent=\"center\"\n style={centerOverlay}\n >\n {centerIcon}\n </Box>\n ) : null}\n </Box>\n\n {address ? (\n <Box alignItems=\"center\" style={addressGroup}>\n <Text variant=\"body\" color=\"textSecondary\" style={addressText}>\n {address}\n </Text>\n {onCopyAddress ? (\n <Pressable\n onPress={handleCopy}\n accessibilityRole=\"button\"\n accessibilityLabel={copied ? 'Address copied' : 'Copy address'}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n backgroundColor=\"btnSecondary\"\n borderColor=\"btnSecondary\"\n borderWidth={1}\n borderRadius=\"element\"\n style={copyButton}\n >\n <CopyAddressIcon />\n <Text variant=\"bodyMedium\" color=\"onBtnSecondary\">\n {copied ? copiedLabel : copyLabel}\n </Text>\n </Box>\n </Pressable>\n ) : null}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n}\n\nconst sheet: ViewStyle = { paddingBottom: 32 }\nconst topBar: ViewStyle = {\n paddingVertical: 16,\n paddingHorizontal: 24,\n gap: 4,\n}\nconst closeGlyph: TextStyle = {\n fontSize: 20,\n lineHeight: 24,\n width: 32,\n textAlign: 'center',\n}\nconst topBarSpacer: ViewStyle = { width: 32, height: 32 }\n// QR card and address group share a 40px gap (Figma `content`).\nconst content: ViewStyle = {\n paddingHorizontal: 20,\n paddingVertical: 45,\n gap: 40,\n}\nconst qrFrame: ViewStyle = {\n width: 275,\n height: 275,\n borderRadius: 20,\n padding: 18,\n // Figma shadow/md: a soft lift under the card.\n shadowColor: '#000',\n shadowOpacity: 0.1,\n shadowOffset: { width: 0, height: 4 },\n shadowRadius: 16,\n elevation: 3,\n}\nconst centerOverlay: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n}\nconst addressGroup: ViewStyle = { gap: 16 }\n// Constrained so the 42-char address wraps to two centered lines (Figma).\nconst addressText: TextStyle = { textAlign: 'center', maxWidth: 220 }\nconst copyButton: ViewStyle = {\n height: 48,\n paddingHorizontal: 20,\n gap: 8,\n}\n", "import { SvgXml } from 'react-native-svg'\n\nimport { useTheme } from '../theme/restyle'\n\n// Verbatim port of web's `CopyDoubleRoundedSquareIcon`\n// (`packages/connect/src/components/Icons/CopyDoubleRoundedSquareIcon.tsx`) \u2014\n// two overlapping rounded squares. Kept as inline SVG (rendered via `SvgXml`,\n// like the other connect-rn glyphs) so the package stays asset-free.\n// `stroke=\"currentColor\"` is resolved by the `color` prop below, so the glyph\n// tracks the secondary-button label color.\nconst COPY_ADDRESS_SVG = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.2 5.8V4.26C10.2 3.64394 10.2 3.33591 10.0801 3.10061C9.97465 2.89363 9.80637 2.72535 9.59939 2.61989C9.36409 2.5 9.05606 2.5 8.44 2.5H4.26C3.64394 2.5 3.33591 2.5 3.10061 2.61989C2.89363 2.72535 2.72535 2.89363 2.61989 3.10061C2.5 3.33591 2.5 3.64394 2.5 4.26V8.44C2.5 9.05606 2.5 9.36409 2.61989 9.59939C2.72535 9.80637 2.89363 9.97465 3.10061 10.0801C3.33591 10.2 3.64394 10.2 4.26 10.2H5.8M7.56 13.5H11.74C12.3561 13.5 12.6641 13.5 12.8994 13.3801C13.1064 13.2746 13.2746 13.1064 13.3801 12.8994C13.5 12.6641 13.5 12.3561 13.5 11.74V7.56C13.5 6.94394 13.5 6.63591 13.3801 6.40061C13.2746 6.19363 13.1064 6.02535 12.8994 5.91989C12.6641 5.8 12.3561 5.8 11.74 5.8H7.56C6.94394 5.8 6.63591 5.8 6.40061 5.91989C6.19363 6.02535 6.02535 6.19363 5.91989 6.40061C5.8 6.63591 5.8 6.94394 5.8 7.56V11.74C5.8 12.3561 5.8 12.6641 5.91989 12.8994C6.02535 13.1064 6.19363 13.2746 6.40061 13.3801C6.63591 13.5 6.94394 13.5 7.56 13.5Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`\n\n/**\n * The \"Copy address\" button glyph \u2014 the RN port of web's\n * `CopyDoubleRoundedSquareIcon`. Renders in the theme's secondary-button label\n * color so it matches the button text.\n */\nexport function CopyAddressIcon({ size = 16 }: { size?: number }) {\n const theme = useTheme()\n return (\n <SvgXml\n xml={COPY_ADDRESS_SVG}\n width={size}\n height={size}\n color={theme.colors.onBtnSecondary}\n />\n )\n}\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, type ViewStyle } from 'react-native'\n\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport {\n FigmaChevronLeftIcon,\n FigmaChevronRightIcon,\n FigmaCopyIcon,\n FigmaQrScanIcon,\n FigmaShareIcon,\n} from '../icons/FigmaSystemIcons'\nimport { FunIcon } from '../icons/FunIcon'\nimport { chainIconUri } from '../icons/funIconUri'\nimport { SourceTokenCluster } from '../icons/SourceTokenCluster'\nimport { Box, Text, useTheme } from '../theme/restyle'\nimport { type NetworkOption, NetworkSelector } from './NetworkSelector'\n\n/**\n * The Transfer Crypto / Universal-Deposit-Address screen (Figma: Fun Mobile /\n * Transfer Crypto, node 10952:9834). A themed bottom-sheet surface: an X-close\n * + QR top bar, the inline {@link NetworkSelector}, a centered deposit-address\n * card with a tappable supported-token preview (\u2192 supported tokens), and\n * full-width Copy / Share buttons. UI only \u2014 the host wires the data + callbacks\n * (the deposit-address resolution lives in the transfer hooks).\n */\nexport interface TransferCryptoScreenProps {\n /** Pre-formatted deposit address, e.g. `0x7854...5139F0`. */\n depositAddress: string\n /** Networks for the inline switcher; the selected one expands with its label. */\n networks: NetworkOption[]\n selectedNetworkId: string\n onSelectNetwork: (id: string) => void\n /**\n * CDN chain keys for the chain-logo preview under the address (tapping it\n * opens the \"Available chains\" screen). Omit to hide the preview.\n */\n supportedTokenIcons?: string[]\n /** Single-network minimum deposit text, e.g. `Min $3` for Solana. */\n minimumDepositLabel?: string\n title?: string\n depositAddressLabel?: string\n copyLabel?: string\n copiedLabel?: string\n shareLabel?: string\n /** How long the \"Copied\" confirmation stays on the Copy button (ms). */\n copiedFeedbackMs?: number\n /** Leading top-bar action \u2014 returns to the Add money screen. */\n onBack?: () => void\n onShowQrCode?: () => void\n /** Tapping the chain-logo preview cluster (opens \"Available chains\"). */\n onShowChains?: () => void\n onCopyAddress?: () => void\n onShareAddress?: () => void\n}\n\nexport function TransferCryptoScreen({\n depositAddress,\n networks,\n selectedNetworkId,\n onSelectNetwork,\n supportedTokenIcons,\n minimumDepositLabel,\n title = 'Transfer Crypto',\n depositAddressLabel = 'Your deposit address',\n copyLabel = 'Copy',\n copiedLabel = 'Copied!',\n shareLabel = 'Share',\n copiedFeedbackMs = 1800,\n onBack,\n onShowQrCode,\n onShowChains,\n onCopyAddress,\n onShareAddress,\n}: TransferCryptoScreenProps) {\n const theme = useTheme()\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<ReturnType<typeof setTimeout>>(undefined)\n\n useEffect(() => () => clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n onCopyAddress?.()\n setCopied(true)\n clearTimeout(copyTimer.current)\n copyTimer.current = setTimeout(() => setCopied(false), copiedFeedbackMs)\n }\n\n const showPreview =\n supportedTokenIcons != null && supportedTokenIcons.length > 0\n const selectedNetwork = networks.find(\n (network) => network.id === selectedNetworkId,\n )\n\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n >\n {/* Top bar: back \u00B7 title \u00B7 QR */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Pressable\n onPress={onBack}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Back\"\n >\n <Box alignItems=\"center\" justifyContent=\"center\" style={iconButton}>\n <FigmaChevronLeftIcon />\n </Box>\n </Pressable>\n <Box flex={1} alignItems=\"center\">\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {title}\n </Text>\n </Box>\n <Pressable\n onPress={onShowQrCode}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Show QR code\"\n >\n <Box alignItems=\"center\" justifyContent=\"center\" style={iconButton}>\n <FigmaQrScanIcon />\n </Box>\n </Pressable>\n </Box>\n\n <Box style={content}>\n <NetworkSelector\n networks={networks}\n selectedId={selectedNetworkId}\n onSelect={onSelectNetwork}\n />\n\n {/* Fixed-height region: address card grows, buttons pinned below. */}\n <Box\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n style={addressRegion}\n >\n {/* Deposit address card */}\n <Box\n flex={1}\n alignItems=\"center\"\n justifyContent=\"center\"\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"element\"\n style={addressCard}\n >\n <Box alignItems=\"center\" style={addressColumn}>\n <Box alignItems=\"center\" style={addressGroup}>\n <Text variant=\"body\" color=\"textSecondary\">\n {depositAddressLabel}\n </Text>\n <Text\n variant=\"bodyMedium\"\n color=\"textPrimary\"\n style={addressText}\n >\n {depositAddress}\n </Text>\n </Box>\n {showPreview ? (\n <Pressable\n onPress={onShowChains}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Available chains\"\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n backgroundColor=\"bgSecondary\"\n style={previewPill}\n >\n <SourceTokenCluster\n icons={supportedTokenIcons}\n size={20}\n gap={4}\n />\n <FigmaChevronRightIcon\n size={16}\n color={theme.colors.textSecondary}\n />\n </Box>\n </Pressable>\n ) : minimumDepositLabel ? (\n <MinimumDepositPill\n label={minimumDepositLabel}\n iconKey={selectedNetwork?.iconKeys[0]}\n />\n ) : null}\n </Box>\n </Box>\n\n {/* Copy / Share */}\n <Box flexDirection=\"row\" style={buttonsRow}>\n <PillButton\n label={copied ? copiedLabel : copyLabel}\n accessibilityLabel={copied ? 'Address copied' : 'Copy address'}\n icon={<FigmaCopyIcon color={theme.colors.onBtnPrimary} />}\n onPress={handleCopy}\n />\n <PillButton\n label={shareLabel}\n accessibilityLabel=\"Share address\"\n icon={<FigmaShareIcon color={theme.colors.onBtnPrimary} />}\n onPress={onShareAddress}\n />\n </Box>\n </Box>\n </Box>\n </Box>\n )\n}\n\nfunction MinimumDepositPill({\n label,\n iconKey,\n}: {\n label: string\n iconKey?: string\n}) {\n return (\n <Box alignItems=\"center\" justifyContent=\"flex-start\" style={minimumPill}>\n <Box flexDirection=\"row\" alignItems=\"center\" style={minimumPillRow}>\n {iconKey ? (\n <FunIcon\n uri={iconKey.startsWith('http') ? iconKey : chainIconUri(iconKey)}\n size={16}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n ) : null}\n <Text variant=\"detail\" color=\"textSecondary\">\n {label}\n </Text>\n </Box>\n </Box>\n )\n}\n\n/** A full-width black pill action button (Copy / Share). */\nfunction PillButton({\n label,\n accessibilityLabel,\n icon,\n onPress,\n}: {\n label: string\n accessibilityLabel: string\n icon: ReactNode\n onPress?: () => void\n}) {\n return (\n <Pressable\n onPress={onPress}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n style={pillButtonPress}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n backgroundColor=\"btnPrimary\"\n borderRadius=\"rounded\"\n style={pillButton}\n >\n {icon}\n <Text variant=\"bodyMedium\" color=\"onBtnPrimary\">\n {label}\n </Text>\n </Box>\n </Pressable>\n )\n}\n\nconst topBar: ViewStyle = {\n paddingTop: 16,\n paddingBottom: 16,\n paddingHorizontal: 24,\n gap: 4,\n}\n// 32px touch target centers the 20px glyph so it visually aligns with the\n// px-20 content below (Figma top-bar icon buttons).\nconst iconButton: ViewStyle = { width: 32, height: 32 }\nconst content: ViewStyle = {\n paddingHorizontal: 20,\n // pb-16 in Figma + the iOS home-indicator space below the buttons, so the\n // sheet bottom sits flush with the 874px frame bottom.\n paddingBottom: 34,\n paddingTop: 8,\n gap: 16,\n}\nconst addressRegion: ViewStyle = { height: 320, gap: 16, width: '100%' }\nconst addressCard: ViewStyle = {\n width: '100%',\n paddingVertical: 64,\n paddingHorizontal: 20,\n // Subtle card shadow (Figma shadow/lg at 2% \u2014 a faint lift). The card MUST\n // keep an opaque `backgroundColor`: on Android `elevation` draws its shadow\n // from the view outline, and without a solid background it can't clip to the\n // rounded corners \u2014 it bleeds as a gray rectangular border around the card.\n shadowColor: '#000',\n shadowOpacity: 0.02,\n shadowOffset: { width: 0, height: 8 },\n shadowRadius: 32,\n elevation: 1,\n}\nconst addressColumn: ViewStyle = { gap: 4 }\nconst addressGroup: ViewStyle = { gap: 6 }\n// Weight (medium) comes from the `bodyMedium` variant's Inter-Medium family \u2014 an\n// inline `fontWeight` wouldn't select the cut on a custom font in RN/Expo.\nconst addressText = { fontSize: 24, lineHeight: 34 } as const\nconst previewPill: ViewStyle = {\n gap: 4,\n paddingHorizontal: 8,\n paddingVertical: 8,\n borderRadius: 999,\n}\n// Occupies the SAME 36px slot as the EVM cluster pill so switching networks\n// (EVM \u2194 Solana / Tron / Bitcoin) never shifts the deposit address. The label\n// is pinned to the top with a 2px inset \u2192 6px below the address (4px column gap\n// + 2px), per the Figma tap-target (11317:3845, content at y=2).\nconst minimumPill: ViewStyle = { height: 36, paddingTop: 2 }\nconst minimumPillRow: ViewStyle = { gap: 4, height: 20 }\nconst buttonsRow: ViewStyle = { gap: 10, width: '100%' }\nconst pillButtonPress: ViewStyle = { flex: 1 }\nconst pillButton: ViewStyle = { height: 56, paddingHorizontal: 24, gap: 8 }\n", "import { useEffect, useState } from 'react'\nimport type { ViewStyle } from 'react-native'\nimport { Pressable } from 'react-native'\nimport Animated, {\n Easing,\n FadeIn,\n FadeOut,\n LinearTransition,\n} from 'react-native-reanimated'\n\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport { FunIcon } from '../icons/FunIcon'\nimport { chainIconUri } from '../icons/funIconUri'\nimport { Box, Text } from '../theme/restyle'\n\n/**\n * One network in {@link NetworkSelector}. The leading glyph is built from chain\n * logos (asset-free): a single entry renders one logo, several render a 2\u00D72\n * cluster (e.g. the EVM group).\n */\nexport interface NetworkOption {\n /** Stable id passed back to `onSelect` (e.g. the deposit-chain id). */\n id: string\n /** Label shown when this network is selected, e.g. `\"EVM Chains\"`. */\n label: string\n /**\n * Chain logos \u2014 either CDN chain **keys** (e.g. `['ethereum']`) or full image\n * **URLs** (`@funkit/chains` `iconUrl`s). One \u2192 single logo, several \u2192 a 2\u00D72\n * cluster.\n */\n iconKeys: string[]\n}\n\n/** A full URL is used as-is; anything else is treated as a CDN chain key. */\nfunction toIconUri(icon: string): string {\n return icon.startsWith('http') ? icon : chainIconUri(icon)\n}\n\nexport interface NetworkSelectorProps {\n networks: NetworkOption[]\n selectedId: string\n onSelect: (id: string) => void\n}\n\n/**\n * The Transfer Crypto network switcher (Figma: Fun Mobile / Transfer Crypto\n * `selector-v2`). A pill-shaped segmented control: the selected network expands\n * to a white pill with its glyph + label, the rest collapse to icon-only\n * buttons. Built from the connect-rn Restyle theme; chain glyphs resolve from\n * the CDN so the package stays asset-free.\n */\nexport function NetworkSelector({\n networks,\n selectedId,\n onSelect,\n}: NetworkSelectorProps) {\n // Gate the layout/fade animations until after the first paint so the segments\n // settle into their initial widths statically \u2014 otherwise reanimated would\n // animate the freshly-mounted pill in from zero / fade the first label on\n // first render. Selection changes (always post-mount) then morph fluidly.\n const [animate, setAnimate] = useState(false)\n useEffect(() => setAnimate(true), [])\n\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n backgroundColor=\"bgSecondary\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"rounded\"\n style={track}\n >\n {networks.map((network) => {\n const selected = network.id === selectedId\n return (\n <AnimatedPressable\n key={network.id}\n onPress={() => onSelect(network.id)}\n accessibilityRole=\"button\"\n accessibilityState={{ selected }}\n accessibilityLabel={network.label}\n style={selected ? selectedPress : iconPress}\n // Tween each segment's width/flex when selection flips: the active\n // segment grows into place and the deselected one shrinks. This is\n // the expanding-pill analogue of tabs-sliding's pill translate \u2014\n // the growing white pill reads as the moving highlight.\n layout={animate ? segmentLayout : undefined}\n >\n {selected ? (\n <Animated.View\n // The white labeled pill fades in as the segment grows and out\n // as it collapses, so the label + pill background never pop.\n entering={animate ? FadeIn.duration(SLIDE_MS) : undefined}\n exiting={FadeOut.duration(COLLAPSE_MS)}\n style={selectedFill}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n backgroundColor=\"bgModal\"\n borderColor=\"borderDefault\"\n borderWidth={1}\n borderRadius=\"rounded\"\n style={selectedPill}\n >\n <ChainGlyph iconKeys={network.iconKeys} />\n <Text variant=\"bodyMedium\" color=\"textPrimary\">\n {network.label}\n </Text>\n </Box>\n </Animated.View>\n ) : (\n <ChainGlyph iconKeys={network.iconKeys} />\n )}\n </AnimatedPressable>\n )\n })}\n </Box>\n )\n}\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable)\n\n// transitions-dev \"tabs-sliding\" motion tokens: Fast 250ms with the Smooth\n// ease-out curve cubic-bezier(0.22, 1, 0.36, 1) for the morph, and the Quick\n// 150ms close for the collapsing pill's fade-out.\nconst SLIDE_MS = 250\nconst COLLAPSE_MS = 150\nconst segmentLayout = LinearTransition.duration(SLIDE_MS).easing(\n Easing.bezier(0.22, 1, 0.36, 1),\n)\n\n/**\n * A 24px chain glyph: a single CDN logo, or a 2\u00D72 cluster of 11px logos for\n * multi-chain groups like EVM. `FunIcon` already clips each logo to a centered\n * circle, so the logos are rendered directly \u2014 no wrapping ring. (An earlier\n * version wrapped them in a bordered box the same size as the icon, whose 1px\n * inset shrank/offset the logo and left a visible gray ring; Figma draws the\n * logo full-bleed so its `border/icon` hairline is flush, effectively unseen.)\n */\nfunction ChainGlyph({ iconKeys }: { iconKeys: string[] }) {\n if (iconKeys.length <= 1) {\n return (\n <FunIcon\n uri={toIconUri(iconKeys[0] ?? '')}\n size={24}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n )\n }\n return (\n <Box width={24} height={24} alignItems=\"center\" justifyContent=\"center\">\n <Box flexDirection=\"row\" flexWrap=\"wrap\" style={miniGrid}>\n {iconKeys.slice(0, 4).map((key) => (\n <FunIcon\n key={key}\n uri={toIconUri(key)}\n size={11}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n ))}\n </Box>\n </Box>\n )\n}\n\nconst track: ViewStyle = { height: 54, padding: 2 }\n// Selected segment grows to fill the track; the icon-only buttons sit to its\n// right (matching the Figma: a wide \"EVM Chains\" pill + Solana/Tron/Bitcoin).\nconst selectedPress: ViewStyle = { flex: 1, height: '100%' }\n// The fade wrapper stretches to fill the segment so the white pill it carries\n// keeps filling the growing/shrinking `selectedPress` (default cross-axis\n// stretch) while it fades.\nconst selectedFill: ViewStyle = { flex: 1 }\nconst selectedPill: ViewStyle = {\n height: '100%',\n paddingHorizontal: 16,\n gap: 10,\n}\nconst iconPress: ViewStyle = {\n width: 50,\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n}\nconst miniGrid: ViewStyle = { width: 23.5, gap: 1.5 }\n", "import type { SwappedInboundMessage } from '@funkit/connect-core'\nimport { useCallback } from 'react'\nimport type { ViewStyle } from 'react-native'\n\nimport { logger } from '../logging/logger'\nimport { Box } from '../theme/restyle'\nimport { SwappedWebView } from './SwappedWebView'\n\nexport interface SwappedScreenProps {\n /** The selected FOP's `embeddedFlowUrl` to load in the embed. */\n url: string\n /** Close the whole flow (embed asked to exit, e.g. its own \u2715). */\n onClose: () => void\n /** Go back to the Add money list (embed's own back, or a new deposit). */\n onBack: () => void\n /** Fired when the embed reports a successful transaction. */\n onSuccess?: () => void\n}\n\n/**\n * Full-screen host for the Swapped embedded payment flow ({@link SwappedWebView})\n * \u2014 reached when the user picks a cash method (Card / Apple Pay / \u2026) on Add\n * money. The embed ships its **own** top bar (back / title / close), so we\n * render no React Native header here (avoids a double nav bar) and instead drive\n * flow navigation from the embed's messages, mirroring web's\n * `SwappedIframeController`: back / new-deposit \u2192 {@link onBack}, close \u2192\n * {@link onClose}, transaction-successful \u2192 {@link onSuccess}. Others log only.\n */\nexport function SwappedScreen({\n url,\n onClose,\n onBack,\n onSuccess,\n}: SwappedScreenProps) {\n const handleMessage = useCallback(\n (msg: SwappedInboundMessage) => {\n switch (msg.type) {\n case 'SWAPPED_GO_BACK':\n case 'SWAPPED_NEW_DEPOSIT':\n onBack()\n break\n case 'SWAPPED_CLOSE':\n onClose()\n break\n case 'SWAPPED_TRANSACTION_SUCCESSFUL':\n logger.info('connect-rn:swapped:transaction_successful')\n onSuccess?.()\n break\n case 'SWAPPED_ERROR':\n // Recoverable \u2014 the embed surfaces its own error UI (WARN, not ERROR).\n logger.warn('connect-rn:swapped:error', {\n data: JSON.stringify(msg.data ?? {}),\n })\n break\n default:\n // SWAPPED_READY / NAVIGATION / ORDER_DATA / LOGOUT \u2014 tracked elsewhere.\n break\n }\n },\n [onBack, onClose, onSuccess],\n )\n\n return (\n <Box\n backgroundColor=\"bgModal\"\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={sheet}\n >\n <SwappedWebView url={url} onMessage={handleMessage} style={fill} />\n </Box>\n )\n}\n\n// Fixed sheet height (the embed needs a concrete area; a flex WebView in the\n// content-sized bottom sheet would collapse to grey). Clipped to the rounded\n// top corners.\nconst SHEET_HEIGHT = 550\nconst sheet: ViewStyle = { height: SHEET_HEIGHT, overflow: 'hidden' }\nconst fill: ViewStyle = { flex: 1 }\n", "import type { SwappedInboundMessage } from '@funkit/connect-core'\nimport { useTheme } from '@shopify/restyle'\nimport { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { ActivityIndicator, View, type ViewStyle } from 'react-native'\nimport { WebView, type WebViewMessageEvent } from 'react-native-webview'\n\nimport { logger } from '../logging/logger'\nimport { useFunkitColorScheme } from '../theme/FunkitThemeProvider'\nimport type { FunkitTheme } from '../theme/toRestyleTheme'\nimport { buildSwappedThemeRN } from './buildSwappedTheme'\nimport {\n SWAPPED_WEBVIEW_INJECTED_JS,\n createWebViewSwappedTransport,\n} from './webViewSwappedTransport'\n\nexport interface SwappedWebViewProps {\n /** The selected FOP's `embeddedFlowUrl` (a swapped.com/.dev widget URL). */\n url: string\n /** Typed, origin-validated inbound messages from the embed. */\n onMessage: (msg: SwappedInboundMessage) => void\n style?: ViewStyle\n}\n\n/**\n * Renders the Swapped embedded payment flow in a `WebView` and bridges its\n * messages to the typed {@link SwappedTransport} contract \u2014 the React Native\n * counterpart of web's iframe. The {@link SWAPPED_WEBVIEW_INJECTED_JS} bridge\n * redirects the embed's `postMessage` to the native channel; `onMessage` is\n * parsed + origin-validated before reaching the handler.\n */\nexport function SwappedWebView({ url, onMessage, style }: SwappedWebViewProps) {\n const webViewRef = useRef<WebView>(null)\n const { transport, dispatch } = useMemo(\n () =>\n createWebViewSwappedTransport({\n getWebView: () => webViewRef.current,\n }),\n [],\n )\n\n const theme = useTheme<FunkitTheme>()\n const { colorScheme } = useFunkitColorScheme()\n const swappedTheme = useMemo(\n () => buildSwappedThemeRN(theme, colorScheme === 'dark'),\n [theme, colorScheme],\n )\n // Latest theme/scheme without resubscribing the message handler below.\n const swappedThemeRef = useRef(swappedTheme)\n swappedThemeRef.current = swappedTheme\n const colorSchemeRef = useRef(colorScheme)\n colorSchemeRef.current = colorScheme\n\n // Keep the latest handler without re-subscribing on every render. When the\n // embed announces SWAPPED_READY (its message listener is attached \u2014 reaches\n // us via the bridge's `window.opener` shim), send it the active theme:\n // the same READY-gated send web's iframe does via core `useSwappedSession`.\n const handlerRef = useRef(onMessage)\n handlerRef.current = onMessage\n useEffect(\n () =>\n transport.onMessage((msg) => {\n if (msg.type === 'SWAPPED_READY') {\n transport.send({\n type: 'SWAPPED_THEME',\n data: swappedThemeRef.current,\n })\n logger.info('connect-rn:swapped:theme_sent', {\n colorScheme: colorSchemeRef.current,\n })\n }\n handlerRef.current(msg)\n }),\n [transport],\n )\n\n const handleMessage = (event: WebViewMessageEvent) => {\n dispatch(event.nativeEvent.data, event.nativeEvent.url)\n }\n\n // Native loading state, shown before the widget's HTML exists (so neither\n // the URL loading params nor SWAPPED_THEME can style it): without this,\n // `startInLoadingState` renders react-native-webview's default spinner \u2014\n // platform-colored on a white fill \u2014 which flashes unthemed.\n const renderLoading = useCallback(\n () => (\n <View style={[loadingOverlay, { backgroundColor: theme.colors.bgModal }]}>\n <ActivityIndicator color={theme.colors.textSecondary} />\n </View>\n ),\n [theme.colors.bgModal, theme.colors.textSecondary],\n )\n\n // Load failures are recoverable (the embed shows its own retry UI) \u2192 WARN.\n // Event types inlined: the exact exported names vary across webview versions.\n const handleError = (event: {\n nativeEvent: { code: number; description: string; url: string }\n }) => {\n logger.warn('connect-rn:swapped:webview:error', {\n code: String(event.nativeEvent.code),\n description: event.nativeEvent.description,\n url: event.nativeEvent.url,\n })\n }\n const handleHttpError = (event: {\n nativeEvent: { statusCode: number; url: string }\n }) => {\n logger.warn('connect-rn:swapped:webview:httpError', {\n status: String(event.nativeEvent.statusCode),\n url: event.nativeEvent.url,\n })\n }\n\n return (\n <WebView\n ref={webViewRef}\n source={{ uri: url }}\n onMessage={handleMessage}\n onError={handleError}\n onHttpError={handleHttpError}\n scrollEnabled={false}\n injectedJavaScriptBeforeContentLoaded={SWAPPED_WEBVIEW_INJECTED_JS}\n // Themed spinner while the embed loads (instead of a blank grey panel).\n startInLoadingState\n renderLoading={renderLoading}\n // The Swapped flow needs these to run its KYC / payment widgets.\n javaScriptEnabled\n domStorageEnabled\n // The embed relies on its own session cookies (login / KYC state).\n sharedCookiesEnabled\n thirdPartyCookiesEnabled\n // Cards / Apple Pay / Google Pay surfaces inside the embed.\n allowsInlineMediaPlayback\n // The embed auto-focuses its amount input on open. iOS suppresses the\n // keyboard for programmatic (non-tap) focus by default, so the input\n // would sit focused with no keyboard \u2014 raise it without a user gesture.\n // (iOS-only prop; Android already shows the keyboard on focus.)\n keyboardDisplayRequiresUserAction={false}\n // Drop iOS's form accessory bar (the \u2039 \u203A / Done toolbar above the\n // keyboard) \u2014 the embed has no multi-field navigation to drive it, so it\n // just adds a strip between the sheet and the keyboard. (iOS-only.)\n hideKeyboardAccessoryView\n // The embed renders its own bottom sheet anchored to the viewport bottom.\n // By default WKWebView ALSO insets its scroll view by the keyboard height,\n // so its content shifts up while the sheet itself (gorhom's `interactive`\n // keyboard behavior) is already moving up \u2014 double-compensating. Pin the\n // insets so the WebView stays a fixed canvas and the sheet is the single\n // thing that moves. (iOS-only.)\n automaticallyAdjustContentInsets={false}\n contentInsetAdjustmentBehavior=\"never\"\n // Some embed steps open provider pages in a new window.\n setSupportMultipleWindows={false}\n originWhitelist={['https://*']}\n // Match the theme while the page itself paints (the platform WebView\n // is opaque white by default \u2014 visible as a flash in dark/custom themes).\n style={[{ backgroundColor: theme.colors.bgModal }, style]}\n />\n )\n}\n\nconst loadingOverlay: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n}\n", "import type { SwappedTheme } from '@funkit/connect-core'\n\nimport type { FunkitTheme } from '../theme/toRestyleTheme'\n\nconst px = (value: number) => `${value}px`\nconst toRawHex = (color: string) => color.replace(/^#/, '')\n\n/**\n * Loading-state theme for the Swapped embed: the query params sent to `/fops`\n * (`thirdPartyPaymentConfigs.swapped.themeConfig`) that the API bakes into the\n * returned `embeddedFlowUrl` (e.g. `\u2026&iframeBackground=fbf9f4&textColor=282828`)\n * \u2014 the widget themes its boot spinner / skeleton straight from the URL, before\n * its message listener is up and any `SWAPPED_THEME` postMessage can land.\n * Mirrors web's `buildSwappedThemeQueryParams(resolvedTheme)`; colors are raw\n * hex (no `#`, they travel in a URL).\n *\n * Web also pins `height`/`width` to its dialog constants; omitted here \u2014 the\n * widget sizes to the WebView's real viewport.\n */\nexport function buildSwappedThemeQueryParamsRN(\n theme: FunkitTheme,\n): Record<string, string> {\n const { colors, borderRadii } = theme\n return {\n iframeBackground: toRawHex(colors.bgModal),\n widgetBackground: toRawHex(colors.bgModal),\n textColor: toRawHex(colors.textPrimary),\n spinnerColor: toRawHex(colors.textPrimary),\n modalRadii: px(borderRadii.modal),\n skeletonColor: toRawHex(colors.borderDefault),\n skeletonSecondaryColor: toRawHex(colors.bgSecondary),\n }\n}\n\n/**\n * Builds the {@link SwappedTheme} payload for the embedded Swapped flow from\n * the active Restyle theme \u2014 the React Native counterpart of web's\n * `buildSwappedTheme(ThemeVars)`. RN tokens are concrete hex / numbers (no\n * CSS-var indirection), so unlike web no `resolveObjectCssVars` pass is needed.\n *\n * The color/radius keys mirror the vocabulary the Swapped widget reads (the\n * same keys web sends \u2014 web ThemeVars names like `primaryText` /\n * `modalBackground` plus the widget-specific aliases like `secondaryButtonBg`);\n * connect-rn's `Funkit*Tokens` are projected onto them.\n *\n * Fonts are intentionally omitted: Swapped expects a slug from its hosted\n * webfont set, and RN font families (system/native names) don't map onto it.\n */\nexport function buildSwappedThemeRN(\n theme: FunkitTheme,\n isDarkMode: boolean,\n): SwappedTheme {\n const { colors, borderRadii, sizes, spacing, textVariants } = theme\n return {\n colors: {\n // \u2500\u2500 Core text \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n primaryText: colors.textPrimary,\n secondaryText: colors.textSecondary,\n tertiaryText: colors.textSecondary,\n\n // \u2500\u2500 Surfaces \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n modalBackground: colors.bgModal,\n offBackground: colors.bgSecondary,\n hoverState: colors.bgSecondary,\n lightStroke: colors.borderDefault,\n mediumStroke: colors.borderFocused,\n heavyStroke: colors.borderFocused,\n modalBorder: colors.borderModal,\n modalHeaderDivider: colors.borderDefault,\n modalFooterDivider: colors.borderDefault,\n\n // \u2500\u2500 Accent / brand \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n actionColor: colors.brandPrimary,\n accentColor: colors.brandPrimary,\n accentColorForeground: colors.onBtnPrimary,\n\n // \u2500\u2500 Status \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n error: colors.textError,\n success: colors.textSuccess,\n\n // \u2500\u2500 Spinner \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n spinnerIndicator: colors.textPrimary,\n spinnerBackground: colors.borderFocused,\n\n // \u2500\u2500 Primary button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // web spreads both `buttonBackground*` (ThemeVars) and `buttonPrimary*`\n // (widget aliases); the widget reads whichever is present.\n buttonBackground: colors.btnPrimary,\n buttonBackgroundHover: colors.btnPrimaryHover,\n buttonBackgroundPressed: colors.btnPrimaryPressed,\n buttonBackgroundDisabled: colors.btnPrimaryDisabled,\n buttonPrimary: colors.btnPrimary,\n buttonPrimaryHover: colors.btnPrimaryHover,\n buttonDisabled: colors.btnPrimaryDisabled,\n buttonTextPrimary: colors.onBtnPrimary,\n buttonTextHover: colors.onBtnPrimary,\n buttonTextDisabled: colors.onBtnPrimary,\n buttonTextSecondary: colors.onBtnSecondary,\n buttonTextSecondaryDisabled: colors.onBtnSecondary,\n buttonFocusedOutline: 'none',\n buttonBorderGradient: 'none',\n buttonHoverBorderGradient: 'none',\n buttonDisabledBorderGradient: 'none',\n\n // \u2500\u2500 Tertiary button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n buttonBackgroundTertiary: colors.btnTertiary,\n buttonBackgroundHoverTertiary: colors.btnTertiaryHover,\n buttonBackgroundDisabledTertiary: colors.btnTertiaryDisabled,\n buttonTextTertiary: colors.onBtnTertiary,\n buttonTextDisabledTertiary: colors.onBtnTertiary,\n buttonBorderTertiary: 'transparent',\n buttonBorderFocusedTertiary: colors.borderFocused,\n\n // \u2500\u2500 Icon button / top bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n headerButtonBackground: colors.btnIcon,\n buttonIconBackgroundHover: colors.btnIconHover,\n buttonIconBackgroundPressed: colors.btnIconPressed,\n buttonIconStroke: colors.onBtnIcon,\n modalTopbarIcon: colors.onBtnIcon,\n modalTopbarIconBackground: colors.btnIcon,\n modalTopbarIconBackgroundHover: colors.btnIconHover,\n modalTopbarIconBackgroundPressed: colors.btnIconPressed,\n\n // \u2500\u2500 Input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n inputBackground: colors.bgModal,\n inputBackgroundHover: colors.bgSecondary,\n inputBorderBase: colors.borderDefault,\n inputBorderHover: colors.borderFocused,\n inputLabel: colors.textPrimary,\n inputBorder: colors.borderDefault,\n inputBorderFocused: colors.textSecondary,\n inputBorderActive: colors.textSecondary,\n inputPlaceholder: colors.textSecondary,\n\n // \u2500\u2500 Selection \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n selectedOptionBorder: colors.borderSelected,\n focusedOptionBorder: colors.borderFocused,\n\n // \u2500\u2500 Widget aliases (mirrors web buildSwappedTheme) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n boxBackground: colors.bgSecondary,\n secondaryButtonBg: colors.btnTertiary,\n secondaryButtonText: colors.onBtnTertiary,\n secondaryButtonHover: colors.btnTertiaryHover,\n secondaryButtonTextHover: colors.onBtnTertiary,\n },\n radii: {\n modal: px(borderRadii.modal),\n actionButton: px(borderRadii.button),\n summaryBox: px(borderRadii.element),\n box: px(borderRadii.element),\n otpInput: px(borderRadii.button),\n calculatorInput: px(borderRadii.button),\n amountPill: px(borderRadii.button),\n },\n paymentMethodLightLogos: !isDarkMode,\n headerHeight: px(sizes.topBar),\n headerFontWeight: String(textVariants.headerTitle.fontWeight ?? '500'),\n // web: topbarIconColor \u2190 modalTopbarIcon (the icon on the top-bar buttons)\n topbarIconColor: colors.onBtnIcon,\n topbarTextFontSize: px(textVariants.headerTitle.fontSize ?? 13),\n headerIconWrapperSize: px(sizes.buttonXs),\n headerIconSize: px(sizes.iconMd),\n buttonFontWeight: String(textVariants.bodyMedium.fontWeight ?? '500'),\n modalBottomBarButtonHeight: px(sizes.buttonHeight),\n iframeBackground: colors.bgModal,\n // Same fixed paddings web sends (web: modalBaseHorizontalPadding + 6px).\n topbarPaddingX: px(spacing.modalHorizontal + 6),\n topbarPaddingY: '12px',\n boxPaddingY: '16px',\n boxPaddingX: '16px',\n paddingPrimary: '20px',\n paddingSecondary: '12px',\n paddingTertiary: '20px',\n }\n}\n", "import {\n type SwappedInboundMessage,\n type SwappedOutboundMessage,\n type SwappedTransport,\n getSwappedOrigin,\n} from '@funkit/connect-core'\n\n/**\n * Marker key on host \u2192 embed envelopes (see {@link buildSwappedSendScript}).\n * The injected bridge recognizes the mark, unwraps the payload, and delivers it\n * to the page; everything unmarked is embed traffic and goes to native.\n */\nexport const FUNKIT_ENVELOPE_KEY = '__funkitSwapped'\n\n/**\n * Injected into the Swapped WebView before its content loads. Installs one\n * bridged `postMessage` that routes BOTH directions:\n *\n * - **embed \u2192 native**: the embed talks to its host by calling\n * `window.parent.postMessage(obj, origin)` (the web iframe contract); at the\n * top level `window.parent === window`, so overriding `window.postMessage`\n * intercepts those calls and forwards them \u2014 JSON-stringified \u2014 to React\n * Native via `window.ReactNativeWebView.postMessage`. The RN side parses +\n * origin-validates via {@link handleWebViewMessage}.\n * - **native \u2192 embed**: messages injected by {@link buildSwappedSendScript}\n * arrive at the same bridged function wrapped in a funkit-marked envelope\n * ({@link FUNKIT_ENVELOPE_KEY}); the bridge unwraps them and re-dispatches\n * the payload through the REAL `postMessage` (captured before the override),\n * so the embed's `message` listeners receive a genuine, trusted MessageEvent\n * with an object `event.data` \u2014 exactly what they get from an iframe parent.\n *\n * It also installs a fake `window.opener` wired to the native channel: with no\n * parent frame the widget posts its lifecycle messages (`SWAPPED_READY`, \u2026) to\n * `opener` instead of `parent`, and a top-level WebView has neither \u2014 without\n * the shim those messages are silently dropped.\n */\nexport const SWAPPED_WEBVIEW_INJECTED_JS = `(function () {\n if (window.${FUNKIT_ENVELOPE_KEY}Bridge) { return; }\n window.${FUNKIT_ENVELOPE_KEY}Bridge = true;\n // The REAL postMessage, captured before the override below.\n var postToPage = window.postMessage.bind(window);\n function forwardToNative(message) {\n try {\n var data = typeof message === 'string' ? message : JSON.stringify(message);\n window.ReactNativeWebView && window.ReactNativeWebView.postMessage(data);\n } catch (e) {}\n }\n function bridged(message) {\n // funkit envelope (host \u2192 embed): unwrap + deliver to the page's listeners.\n if (message && message.${FUNKIT_ENVELOPE_KEY}) {\n try { postToPage(message.payload, '*'); } catch (e) {}\n return;\n }\n // Anything else is the embed talking to its host \u2192 forward to native.\n forwardToNative(message);\n }\n // The embed posts to window.parent (and sometimes window) \u2014 both are this\n // window at the top level, so both assignments install the same bridge.\n try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e) {}\n try { window.postMessage = bridged; } catch (e) {}\n // No parent frame \u2192 the widget posts lifecycle messages to window.opener.\n try { if (!window.opener) { window.opener = { postMessage: forwardToNative }; } } catch (e) {}\n true;\n})();\ntrue;`\n\n/**\n * Build the JS snippet that delivers an outbound message INTO the embed, run\n * via `webView.injectJavaScript`. One shape for every message type: the payload\n * is wrapped in a funkit-marked envelope and handed to the (bridged)\n * `window.postMessage` \u2014 the bridge unwraps it and re-dispatches via the real\n * `postMessage` (see {@link SWAPPED_WEBVIEW_INJECTED_JS}). If the bridge isn't\n * installed, the envelope dispatches as-is and the embed ignores it (no `type`).\n */\nexport function buildSwappedSendScript(msg: SwappedOutboundMessage): string {\n const envelope = JSON.stringify({ [FUNKIT_ENVELOPE_KEY]: true, payload: msg })\n return `(function () {\n try { window.postMessage(${envelope}, '*'); } catch (e) {}\n})();\ntrue;`\n}\n\n/**\n * Parse + validate a raw WebView `onMessage` payload into a typed inbound\n * Swapped message. Returns `null` (drop the message) when:\n * - the payload isn't valid JSON with a string `type`, or\n * - a `url` is supplied whose origin isn't a Swapped origin (mirrors web's\n * `isSwappedOrigin(event.origin)` guard in the iframe transport).\n *\n * `url` is the WebView's current page URL (`nativeEvent.url`); when omitted the\n * origin check is skipped (the caller already trusts the source).\n */\nexport function handleWebViewMessage(\n rawData: unknown,\n url?: string,\n): SwappedInboundMessage | null {\n if (url != null && getSwappedOrigin(url) == null) {\n return null\n }\n let parsed: unknown\n if (typeof rawData === 'string') {\n try {\n parsed = JSON.parse(rawData)\n } catch {\n return null\n }\n } else {\n parsed = rawData\n }\n const data = parsed as { type?: unknown } | null | undefined\n if (!data || typeof data.type !== 'string') {\n return null\n }\n return data as SwappedInboundMessage\n}\n\n/** Minimal surface of `react-native-webview`'s ref the transport needs. */\nexport interface WebViewLike {\n injectJavaScript(script: string): void\n}\n\nexport interface WebViewSwappedTransport {\n /** Implements the shared {@link SwappedTransport} contract. */\n transport: SwappedTransport\n /**\n * Feed a raw WebView `onMessage` payload (+ optional page url) through origin\n * validation and fan it out to `transport.onMessage` subscribers.\n */\n dispatch(rawData: unknown, url?: string): void\n}\n\n/**\n * React Native {@link SwappedTransport}: bridges the typed Swapped message\n * contract over a `WebView` instead of web's `<iframe>` + `window.postMessage`.\n * `send` delivers into the embed by injecting an in-page `postMessage` call\n * ({@link buildSwappedSendScript}); inbound messages arrive through\n * {@link dispatch} (wired to the WebView's `onMessage`).\n */\nexport function createWebViewSwappedTransport({\n getWebView,\n}: {\n getWebView: () => WebViewLike | null\n}): WebViewSwappedTransport {\n const handlers = new Set<(msg: SwappedInboundMessage) => void>()\n\n const transport: SwappedTransport = {\n send(msg: SwappedOutboundMessage): boolean {\n const webView = getWebView()\n if (!webView) {\n return false\n }\n webView.injectJavaScript(buildSwappedSendScript(msg))\n return true\n },\n onMessage(handler: (msg: SwappedInboundMessage) => void): () => void {\n handlers.add(handler)\n return () => {\n handlers.delete(handler)\n }\n },\n }\n\n function dispatch(rawData: unknown, url?: string): void {\n const msg = handleWebViewMessage(rawData, url)\n if (msg) {\n for (const handler of handlers) {\n handler(msg)\n }\n }\n }\n\n return { transport, dispatch }\n}\n", "import {\n bitcoinChain,\n chainMetadataById,\n solanaChain,\n tronChain,\n} from '@funkit/chains'\nimport {\n type MinTransferConfig,\n getMinTransferValueForChain,\n} from '@funkit/connect-core'\n\nimport type { ChainOption } from '../flow/depositFlowConfig'\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport type { AvailableChain } from '../screens/AvailableChainsScreen'\nimport type { TokenChainFilter } from './supportedTokens'\n\nconst NON_EVM_CHAIN_IDS = new Set<number>([\n solanaChain.id,\n tronChain.id,\n bitcoinChain.id,\n])\n\n/** Id of the grouped \"EVM Chains\" network segment. */\nexport const EVM_NETWORK_ID = 'evm'\nconst EVM_NETWORK_LABEL = 'EVM Chains'\n\n/** Whether a chain id is a single-chain non-EVM network (Solana / Tron / Bitcoin). */\nexport function isNonEvmChainId(chainId: number): boolean {\n return NON_EVM_CHAIN_IDS.has(chainId)\n}\n\n/**\n * The active deposit target \u2014 used (with the config's optional `getMinDepositUSD`)\n * to add the destination's minimum to each chain's transfer minimum, exactly as\n * web's `TransferToken` does.\n */\nexport interface MinDepositTarget {\n targetChain?: string\n targetAsset?: string\n dynamicRoutingId?: string\n getMinDepositUSD?: (ctx: {\n tokenChainId?: string\n tokenAddress?: string\n dynamicRoutingId?: string\n }) => number\n}\n\n/** Whether a chain belongs to the selected deposit network (EVM is the group). */\nexport function belongsToNetwork(\n chainId: number,\n networkChainId: number | undefined,\n): boolean {\n if (networkChainId == null) return true\n // Non-EVM networks (Solana / Tron / Bitcoin) are single-chain.\n if (NON_EVM_CHAIN_IDS.has(networkChainId)) return chainId === networkChainId\n // The EVM network is every EVM chain.\n return !NON_EVM_CHAIN_IDS.has(chainId)\n}\n\n/**\n * Build the \"Available {network} chains\" rows from the curated chain list (the\n * `tokentransferconfig` chains resolved by `useSupportedTokens`, as\n * chain-filter chips), enriched with `@funkit/chains` logos and the per-chain\n * minimum-deposit label.\n *\n * The minimum mirrors web's `TransferToken`:\n * `ceil(getMinTransferValueForChain(chainId, mintokentransfervalue) +\n * getMinDepositUSD(target))`.\n */\nexport function buildAvailableChains({\n chainFilters,\n networkChainId,\n minTransferLimits,\n target,\n}: {\n /** `useSupportedTokens().chainFilters` \u2014 `All` + one chip per curated chain. */\n chainFilters: TokenChainFilter[]\n /** Representative chainId of the selected network (decides EVM vs single). */\n networkChainId: number | undefined\n minTransferLimits: MinTransferConfig\n target?: MinDepositTarget\n}): AvailableChain[] {\n const minDepositAddOn =\n target?.getMinDepositUSD?.({\n tokenChainId: target.targetChain,\n tokenAddress: target.targetAsset,\n dynamicRoutingId: target.dynamicRoutingId,\n }) ?? 0\n\n return chainFilters\n .filter((f) => f.id !== 'all')\n .map((f) => ({ chainId: Number(f.id), name: f.label }))\n .filter(({ chainId }) => belongsToNetwork(chainId, networkChainId))\n .map(({ chainId, name }) => {\n const meta = chainMetadataById[chainId]\n const min = Math.ceil(\n getMinTransferValueForChain(chainId, minTransferLimits) +\n minDepositAddOn,\n )\n return {\n id: String(chainId),\n name: name || meta?.name || `Chain ${chainId}`,\n iconUri: meta?.iconUrl ?? FALLBACK_ASSET_LOGO,\n minLabel: `Min $${min}`,\n }\n })\n}\n\n/**\n * Derive the Transfer screen's network-switcher segments from the curated chain\n * list (the `tokentransferconfig` chains resolved by `useSupportedTokens`). The\n * networks are NOT host-configured \u2014 every EVM chain collapses into a single\n * \"EVM Chains\" segment (they share one deposit address), and each non-EVM chain\n * (Solana / Tron / Bitcoin) is its own single-chain segment. Segment glyphs use\n * `@funkit/chains` logo URLs.\n */\nexport function buildDepositNetworks(\n chainFilters: TokenChainFilter[],\n): ChainOption[] {\n const chains = chainFilters\n .filter((f) => f.id !== 'all')\n .map((f) => ({ chainId: Number(f.id), label: f.label }))\n\n const iconUrl = (chainId: number) =>\n chainMetadataById[chainId]?.iconUrl ?? FALLBACK_ASSET_LOGO\n\n const evmChains = chains.filter((c) => !isNonEvmChainId(c.chainId))\n const networks: ChainOption[] = []\n\n if (evmChains.length > 0) {\n networks.push({\n id: EVM_NETWORK_ID,\n label: EVM_NETWORK_LABEL,\n iconKeys: evmChains.map((c) => iconUrl(c.chainId)),\n // Any EVM chain selects the shared EVM deposit address.\n chainId: evmChains[0].chainId,\n })\n }\n\n for (const c of chains) {\n if (!isNonEvmChainId(c.chainId)) continue\n const meta = chainMetadataById[c.chainId]\n networks.push({\n id: String(c.chainId),\n label: c.label || meta?.name || `Chain ${c.chainId}`,\n iconKeys: [iconUrl(c.chainId)],\n chainId: c.chainId,\n })\n }\n\n return networks\n}\n", "import { logger } from '../logging/logger'\n\n/**\n * A clipboard write the host can inject via `FunkitProvider`'s `copyToClipboard`\n * to use their own clipboard module \u2014 e.g. `expo-clipboard` in Expo Go, where\n * the bare-RN native module isn't linked. Given the address text; returns\n * whether the write succeeded (a `void` return is treated as success).\n */\nexport type ClipboardWriter = (value: string) => void | Promise<boolean>\n\n/**\n * Default clipboard: lazily (dynamic import) loads the bare-RN\n * `@react-native-clipboard/clipboard` peer and writes via `setString`.\n *\n * The import is dynamic + guarded so the native module is only **evaluated when\n * a copy actually happens** \u2014 not at startup. A host that hasn't linked it\n * (e.g. Expo Go, where `getEnforcing('RNCClipboard')` would throw) should inject\n * its own writer through `FunkitProvider`'s `copyToClipboard`; that override\n * runs instead, so this path \u2014 and the throw \u2014 never execute. If the module is\n * absent and no override is provided, the copy degrades to a no-op + warning\n * instead of crashing.\n *\n * Returns whether the copy succeeded.\n */\nexport async function copyToClipboard(value: string): Promise<boolean> {\n try {\n const { default: Clipboard } =\n await import('@react-native-clipboard/clipboard')\n Clipboard.setString(value)\n return true\n } catch (error) {\n logger.warn(\n 'connect-rn: clipboard write failed; address not copied. Inject ' +\n 'FunkitProvider `copyToClipboard` to use your own clipboard module ' +\n '(e.g. expo-clipboard in Expo Go).',\n { error: error instanceof Error ? error.message : String(error) },\n )\n return false\n }\n}\n", "import {\n type ExchangeRates,\n FormOfPaymentType,\n type SwappedFormOfPayment,\n} from '@funkit/api-base'\nimport { getFopsLimit } from '@funkit/connect-core'\n\n/** A cash-tab payment row, derived from a Swapped form of payment. */\nexport interface FopRow {\n /** Stable id passed back to `onSelectFop`. */\n id: string\n /** Display name, e.g. \"Card\", \"Apple Pay\". */\n name: string\n /** CDN icon URL (rendered via `FunIcon`). */\n iconUri: string\n /** Subtitle, e.g. \"$10,000.00 limit \u2022 Instant\". */\n subtitle: string\n /**\n * Disabled when the FOP has no embedded-flow URL \u2014 these are the\n * \"coming soon\" placeholders Swapped returns when geoblocked/unavailable.\n */\n disabled: boolean\n}\n\n// Bank transfers settle in days; everything else is instant, and the Figma\n// only surfaces a timing suffix for bank transfers (\"\u2026 \u00B7 1-2 days\"). Literal\n// until connect-rn has translations (web pulls these from i18n).\nconst BANK_TRANSFER_TIME = '1-2 days'\n\n/**\n * Map Swapped forms of payment to Add money rows. Subtitle mirrors the Figma:\n * `\"<limit> limit\"`, with `\" \u00B7 1-2 days\"` appended for bank transfers. The\n * limit is the FOP's max converted to USD via {@link getFopsLimit} (falls back\n * to a default when no exchange rate is available \u2014 RN doesn't fetch rates in\n * V1).\n */\nexport function toFopRows(\n fops: SwappedFormOfPayment[],\n exchangeRates?: ExchangeRates,\n): FopRow[] {\n return fops.map((fop) => {\n const limit = `${getFopsLimit(fop, exchangeRates)} limit`\n const subtitle =\n fop.fopType === FormOfPaymentType.BANK_TRANSFER\n ? `${limit} \u00B7 ${BANK_TRANSFER_TIME}`\n : limit\n return {\n id: `${fop.fopType}:${fop.name}`,\n name: fop.name,\n iconUri: fop.iconImageUrl,\n subtitle,\n disabled: !fop.embeddedFlowUrl,\n }\n })\n}\n", "/**\n * Truncate a deposit address for display, e.g.\n * `0x7854f3\u20265139F0` (Figma: Transfer Crypto). Keeps the leading + trailing\n * characters with an ellipsis between; short strings are returned unchanged.\n * Kept local (not `@funkit/utils`) so connect-rn doesn't take that dep just for\n * one formatter, and so the lead/trail counts can match the RN design.\n */\nexport function formatDepositAddress(\n address: string | undefined,\n leading = 6,\n trailing = 6,\n): string {\n if (!address) {\n return ''\n }\n if (address.length <= leading + trailing) {\n return address\n }\n return `${address.slice(0, leading)}\u2026${address.slice(-trailing)}`\n}\n", "import {\n type RecipientTarget,\n type SwappedFormOfPayment,\n getFops,\n} from '@funkit/api-base'\nimport {\n FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS,\n solanaChain,\n} from '@funkit/chains'\nimport {\n type CheckoutTokenTransferConfig,\n DEFAULT_FIAT_CURRENCY,\n FOPS_STALE_TIME,\n getDepositAddressForChain,\n sortFops,\n useDynamicConfig,\n useSwappedDefaultCurrencyQuery,\n} from '@funkit/connect-core'\nimport { useTheme } from '@shopify/restyle'\nimport { useQuery } from '@tanstack/react-query'\nimport { useMemo } from 'react'\n\nimport { useUserIpInfo } from '../../geo/useUserIpInfo'\nimport { useFunkitIdentity } from '../../identity/IdentityContext'\nimport { logger } from '../../logging/logger'\nimport { buildSwappedThemeQueryParamsRN } from '../../swapped/buildSwappedTheme'\nimport type { FunkitTheme } from '../../theme/toRestyleTheme'\nimport { useTransferInit } from './useTransferInit'\n\n// Swapped enumerates region-specific payment methods by country, so the /fops\n// call needs *a* country. We send the user's real country (resolved from their\n// IP via {@link useUserIpInfo}), falling back to this default while the geo\n// lookup is in flight or if it fails \u2014 so the cash list still populates.\n//\n// TODO(connect-rn): per-region geoblocking. Web also compares `blockedcountries`\n// (Statsig) against the resolved country and disables/hides methods for blocked\n// regions (`useFunkitUserIp().isUserGeoblocked` \u2192\n// `PaymentMethodDisabledBadge reason=\"geoblocked\"`). This wires the country in;\n// the per-method gating is the remaining step.\nconst DEFAULT_COUNTRY_CODE = 'US'\n\nexport interface UseFopsParams {\n /** Destination chain/asset \u2014 drives the deposit recipient + FOP query. */\n checkoutConfig: CheckoutTokenTransferConfig | undefined\n dynamicRoutingId?: string\n enabled?: boolean\n}\n\nexport interface UseFopsResult {\n /**\n * The user's saved forms of payment (e.g. \"Mastercard (\u20263869)\"). Rendered at\n * the top of the Add money list, above the Crypto row \u2014 mirroring web, where\n * saved FOPs sort first.\n */\n savedFops: SwappedFormOfPayment[]\n /** Generic forms of payment (Card / Apple Pay / Revolut Pay / Bank Transfer). */\n genericFops: SwappedFormOfPayment[]\n isLoading: boolean\n isFetching: boolean\n /** The FOPs fetch failed (network / API). Drives the Add money error state. */\n isError: boolean\n /** Re-run the FOPs fetch (the Add money \"Try again\" action). */\n refetch: () => void\n /** Whether Swapped (cash) methods are offered at all. */\n isSwappedEnabled: boolean\n}\n\n/**\n * Thin RN port of `@funkit/connect`'s `useFops`: fetches the Swapped forms of\n * payment (`getFops`) that populate the \"Use Cash\" tab. Identity comes from\n * {@link useFunkitIdentity}; the deposit recipient is derived from\n * {@link useTransferInit} + the core `getDepositAddressForChain`.\n *\n * The active theme is forwarded as Swapped theme query params\n * ({@link buildSwappedThemeQueryParamsRN}); the API bakes them into each\n * returned `embeddedFlowUrl` so the widget's boot spinner/skeleton are themed\n * before its message listener (and the `SWAPPED_THEME` postMessage) is up.\n *\n * Adaptations vs. web (per the connect-rn V1 scope):\n * - **No geo-fencing.** Web gates the query on `useFunkitUserIp` and passes the\n * user's `countryCode`; RN omits both (`countryCode` is optional on\n * `GetFopsParams`), so FOPs are fetched regardless of region.\n * - The EUR min-amount (`checkoutLimitsCriteria`) and `validateFops` are\n * dropped for V1 (see TODOs). The fiat currency is resolved from the user's\n * region via the shared `useSwappedDefaultCurrencyQuery` (web parity).\n */\nexport function useFops({\n checkoutConfig,\n dynamicRoutingId,\n enabled = true,\n}: UseFopsParams): UseFopsResult {\n const { apiKey, userId } = useFunkitIdentity()\n const isSwappedEnabled = !!useDynamicConfig('enableswappeddeposit')\n const fopPriority = useDynamicConfig('foppriority')\n\n // Real country from the user's IP; default while it loads / if it fails.\n const { userIpInfo } = useUserIpInfo()\n const countryCode = userIpInfo?.alpha2 || DEFAULT_COUNTRY_CODE\n\n // Region-default fiat currency (web parity); falls back to USD. Resolved from\n // the *real* IP country (not the DEFAULT_COUNTRY_CODE fallback above) so a\n // non-US user isn't briefly quoted in USD. Gating /fops on its loading state\n // avoids an initial USD fetch that refetches once the region currency resolves.\n const {\n data: swappedCurrencyCode = DEFAULT_FIAT_CURRENCY,\n isLoading: isSwappedCurrencyCodeLoading,\n } = useSwappedDefaultCurrencyQuery({\n apiKey,\n countryCode: userIpInfo?.alpha2,\n logger,\n })\n\n // Loading-state theme baked into the returned embeddedFlowUrls (web parity).\n const theme = useTheme<FunkitTheme>()\n const themeConfig = useMemo(\n () => buildSwappedThemeQueryParamsRN(theme),\n [theme],\n )\n\n const {\n transferInit,\n isLoading: isTransferInitLoading,\n isFetching: isTransferInitFetching,\n } = useTransferInit({\n checkoutConfig,\n dynamicRoutingId,\n enabled: enabled && isSwappedEnabled,\n })\n\n const targetAsset = checkoutConfig?.targetAsset\n const targetChain = checkoutConfig?.targetChain\n const recipientAddress = targetChain\n ? getDepositAddressForChain(Number(targetChain), transferInit)\n : undefined\n\n const isEnabled =\n enabled &&\n isSwappedEnabled &&\n !!apiKey &&\n !!targetAsset &&\n !!targetChain &&\n !!recipientAddress &&\n !!transferInit &&\n !isSwappedCurrencyCodeLoading\n\n const query = useQuery({\n queryKey: [\n 'fops',\n userId,\n recipientAddress,\n targetAsset,\n targetChain,\n apiKey,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n ] as const,\n queryFn: async () => {\n if (!recipientAddress || !targetChain || !targetAsset) {\n return { genericFormsOfPayments: [], savedFormsOfPayments: [] }\n }\n const destinationToken = { chainId: targetChain, address: targetAsset }\n // Swapped recommends a Solana fallback recipient when one was minted.\n const recipientTargets: RecipientTarget[] = [\n { recipientAddress, destinationToken },\n ...(transferInit?.solanaAddr\n ? [\n {\n recipientAddress: transferInit.solanaAddr,\n destinationToken: {\n chainId: solanaChain.id.toString(),\n address: FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS,\n },\n },\n ]\n : []),\n ]\n\n const response = await getFops({\n apiKey,\n logger,\n params: {\n recipientAddress,\n userId,\n destinationToken,\n fiatCurrencyCode: swappedCurrencyCode,\n countryCode,\n recipientTargets,\n thirdPartyPaymentConfigs: { swapped: { themeConfig } },\n },\n })\n\n return {\n genericFormsOfPayments: sortFops(\n response.genericFormsOfPayments,\n fopPriority,\n ),\n savedFormsOfPayments: sortFops(\n response.savedFormsOfPayments,\n fopPriority,\n ),\n }\n },\n enabled: isEnabled,\n staleTime: FOPS_STALE_TIME,\n refetchOnWindowFocus: false,\n })\n\n return {\n savedFops: query.data?.savedFormsOfPayments ?? [],\n genericFops: query.data?.genericFormsOfPayments ?? [],\n isLoading: query.isLoading || isTransferInitLoading,\n isFetching: isTransferInitFetching,\n isError: query.isError,\n refetch: () => void query.refetch(),\n isSwappedEnabled,\n }\n}\n", "import { type ReactNode, createContext, useContext } from 'react'\n\n/**\n * Who the current user is, supplied by the host app. On web these fields come\n * from wagmi + the Funkit config providers; React Native has no wagmi, so the\n * host passes them in directly. The transfer hooks read identity from here\n * instead of reaching into platform-specific providers.\n */\nexport interface FunkitIdentity {\n /** Funkit API key. */\n apiKey: string\n /** Fun user id (external user id). */\n userId: string\n /** The user's wallet address (default transfer recipient). */\n walletAddress: string\n /** How the user authenticated, if known (analytics only). */\n loginType?: string\n}\n\n/**\n * Host-facing identity config, mirroring the identity-relevant subset of the\n * web SDK's `funkitConfig` ({@link https://github.com/fun-xyz}). The host passes\n * its `apiKey` and (optionally) the `externalUserId` that links Funkit users to\n * its own user system. `walletAddress` is supplied separately on\n * `<FunkitProvider>` because \u2014 unlike web, which reads it from wagmi \u2014 RN has no\n * wallet provider, so the host owns the connected address.\n */\nexport interface FunkitConfig {\n /** Funkit API key. */\n apiKey: string\n /**\n * Stable id linking Funkit users to the host's user system. When set, the\n * Funkit `userId` is derived from it (web's `generateSyntheticUserId`); when\n * omitted, the wallet address is used as the id.\n */\n externalUserId?: string\n /** How the user authenticated, if known (analytics only). */\n loginType?: string\n}\n\n// Mirrors the web SDK's `generateSyntheticUserId` (apiKey + externalUserId,\n// pipe-joined \u2014 apiKey contains no pipe). Kept inline (it's trivial and the web\n// helper lives in a DOM-coupled file).\nfunction generateSyntheticUserId(\n apiKey: string,\n externalUserId: string,\n): string {\n return `${apiKey}|${externalUserId}`\n}\n\n/**\n * Resolve the host's {@link FunkitConfig} + connected wallet address into the\n * internal {@link FunkitIdentity} the transfer hooks read. Mirrors the web\n * default (non-customer) path of `resolveUserId`/`resolveWalletAddress`: prefer\n * a synthetic id from `externalUserId`, else fall back to the wallet address;\n * missing values become the `'0x'` sentinel, which disables the transfer query\n * (see `getCheckoutTokenTransferParams`).\n */\nexport function resolveFunkitIdentity(\n config: FunkitConfig,\n walletAddress: string | undefined,\n): FunkitIdentity {\n const address = walletAddress || '0x'\n const userId = config.externalUserId\n ? generateSyntheticUserId(config.apiKey, config.externalUserId)\n : address\n return {\n apiKey: config.apiKey,\n userId,\n walletAddress: address,\n loginType: config.loginType,\n }\n}\n\nconst FunkitIdentityContext = createContext<FunkitIdentity | null>(null)\n\nexport function FunkitIdentityProvider({\n identity,\n children,\n}: {\n identity: FunkitIdentity\n children: ReactNode\n}) {\n return (\n <FunkitIdentityContext.Provider value={identity}>\n {children}\n </FunkitIdentityContext.Provider>\n )\n}\n\nexport function useFunkitIdentity(): FunkitIdentity {\n const identity = useContext(FunkitIdentityContext)\n if (identity == null) {\n throw new Error(\n 'useFunkitIdentity must be used within a <FunkitIdentityProvider> (mounted by <FunkitProvider>)',\n )\n }\n return identity\n}\n", "import {\n type CheckoutInitTokenTransferResponse,\n type FunAddress,\n initializeCheckoutTokenTransferAddress,\n} from '@funkit/api-base'\nimport {\n type CheckoutTokenTransferConfig,\n getCheckoutTokenTransferParams,\n} from '@funkit/connect-core'\nimport { useQuery } from '@tanstack/react-query'\n\nimport { useFunkitIdentity } from '../../identity/IdentityContext'\nimport { logger } from '../../logging/logger'\nimport { useUDAParams } from './useUDAParams'\n\n// clientMetadata is stored alongside the transfer record; web ships a full\n// HistoricalCheckoutItem stub, but the thin RN flow has no checkout history, so\n// an empty object is sent. It MUST be a stable reference \u2014 re-creating it each\n// render would change the query and cause refetch/flicker.\nconst TRANSFER_CLIENT_METADATA: NonNullable<object> = {}\n\nexport interface UseTransferInitParams {\n /** Destination chain/asset to derive the deposit address for. */\n checkoutConfig: CheckoutTokenTransferConfig | undefined\n /** Final recipient. Defaults to the identity's wallet address. */\n recipientAddr?: FunAddress\n /** Dynamic-routing id used to resolve UDA params. */\n dynamicRoutingId?: string\n /** Gate the network call (e.g. only when the screen is visible). */\n enabled?: boolean\n}\n\nexport interface UseTransferInitResult {\n transferInit: CheckoutInitTokenTransferResponse | undefined\n recipientAddr: FunAddress\n isLoading: boolean\n isFetching: boolean\n}\n\n/**\n * Thin RN reimplementation of `@funkit/connect`'s `useCheckoutTransferInit`:\n * builds the (customer-agnostic) transfer params via the core helper and\n * creates the deposit-address EOA through `@funkit/api-base`. Identity comes\n * from {@link useFunkitIdentity}; all web/customer branches (Lighter main\n * account, Polymarket target override, geo / post-action gating) are dropped.\n */\nexport function useTransferInit({\n checkoutConfig,\n recipientAddr,\n dynamicRoutingId,\n enabled = true,\n}: UseTransferInitParams): UseTransferInitResult {\n const { apiKey, userId, walletAddress } = useFunkitIdentity()\n const udaParams = useUDAParams(dynamicRoutingId)\n\n const resolvedRecipient = (recipientAddr ||\n walletAddress ||\n '0x') as FunAddress\n\n // `undefined` when required params are missing \u2014 also disables the query.\n const params = getCheckoutTokenTransferParams({\n checkoutConfig,\n userId,\n apiKey,\n recipientAddr: resolvedRecipient,\n udaParams,\n })\n\n const { data, isLoading, isFetching } = useQuery({\n queryKey: ['initializeCheckoutTokenTransferAddress', params] as const,\n queryFn: ({ queryKey: [, queryParams] }) =>\n queryParams\n ? initializeCheckoutTokenTransferAddress({\n ...queryParams,\n logger,\n clientMetadata: TRANSFER_CLIENT_METADATA,\n })\n : undefined,\n enabled: enabled && !!params,\n refetchOnWindowFocus: false,\n refetchOnMount: false,\n })\n\n return {\n transferInit: isFetching ? undefined : data,\n recipientAddr: resolvedRecipient,\n isLoading,\n isFetching,\n }\n}\n", "import { type UDAConfig, useDynamicConfig } from '@funkit/connect-core'\nimport { useMemo } from 'react'\n\n/**\n * Thin RN reimplementation of `@funkit/connect`'s `useUDAParams`. Resolves the\n * Universal Deposit Address config for a dynamic-routing id from the\n * `uda_params` Statsig dynamic config. Unlike web, the routing id is passed in\n * (web reads it from the checkout context, which RN doesn't have).\n */\nexport function useUDAParams(dynamicRoutingId?: string): UDAConfig | undefined {\n const udaParams = useDynamicConfig('uda_params')\n return useMemo(\n () =>\n udaParams.find((param) => param.dynamicRoutingId === dynamicRoutingId)\n ?.params,\n [udaParams, dynamicRoutingId],\n )\n}\n", "import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base'\nimport { getSupportedAssets } from '@funkit/api-base'\nimport {\n isTransferChainEnabled,\n resolveTokenTransferConfig,\n useDynamicConfig,\n} from '@funkit/connect-core'\nimport { useQuery } from '@tanstack/react-query'\nimport { useMemo } from 'react'\n\nimport { useFunkitIdentity } from '../../identity/IdentityContext'\nimport { logger } from '../../logging/logger'\nimport {\n buildSupportedTokenList,\n type SupportedToken,\n type TokenChainFilter,\n} from '../supportedTokens'\n\nexport interface UseSupportedTokensResult {\n /** Curated deposit tokens (no icons attached), priority symbols first. */\n tokens: SupportedToken[]\n /** `All` + one chip per configured chain. */\n chainFilters: TokenChainFilter[]\n isLoading: boolean\n}\n\n/**\n * Fetch + resolve the deposit token list the same way the web SDK does: the\n * curated Statsig `tokentransferconfig` (chains + asset addresses), filtered by\n * the disabled list and merged with `@funkit/api-base`'s `getSupportedAssets`\n * metadata (`resolveTokenTransferConfig`, shared via connect-core) \u2014 NOT the raw\n * allow-list. Identity (apiKey) comes from {@link useFunkitIdentity}; the query\n * is disabled until an apiKey is present.\n *\n * `transferInit` gates which chains are offered: Solana / Bitcoin / Tron only\n * appear once the deposit-init response carries their address (mirrors web's\n * `useEnabledTokenTransferChainTokens` via the shared `isTransferChainEnabled`).\n */\nexport function useSupportedTokens({\n enabled = true,\n transferInit,\n}: {\n enabled?: boolean\n transferInit?: CheckoutInitTokenTransferResponse\n} = {}): UseSupportedTokensResult {\n const { apiKey } = useFunkitIdentity()\n const tokenTransferConfig = useDynamicConfig('tokentransferconfig')\n const disabledChainAssets = useDynamicConfig(\n 'disabletokentransferchainsandassets',\n )\n\n const { data, isLoading } = useQuery({\n queryKey: ['getSupportedAssets', apiKey] as const,\n queryFn: ({ queryKey: [, key] }) =>\n getSupportedAssets({ apiKey: key, logger }),\n enabled: enabled && !!apiKey,\n staleTime: 5 * 60_000,\n refetchOnWindowFocus: false,\n })\n\n const { tokens, chainFilters } = useMemo(() => {\n if (!data) {\n return { tokens: [], chainFilters: [{ id: 'all', label: 'All' }] }\n }\n const resolved = resolveTokenTransferConfig({\n chainConfigs: tokenTransferConfig.chains ?? [],\n priorityTokens: tokenTransferConfig.priorityTokens ?? [],\n disabledChainAssets,\n supportedAssets: data,\n logger,\n })\n const built = buildSupportedTokenList(resolved)\n\n // Hide chains whose deposit address hasn't been minted (Solana/Bitcoin/Tron)\n // \u2014 leaving EVM chains always enabled. The `all` chip is always kept.\n const isEnabled = (chainId: number | undefined) =>\n chainId == null || isTransferChainEnabled(chainId, transferInit)\n return {\n tokens: built.tokens.filter((t) => isEnabled(t.chainId)),\n chainFilters: built.chainFilters.filter(\n (c) => c.id === 'all' || isEnabled(Number(c.id)),\n ),\n }\n }, [data, tokenTransferConfig, disabledChainAssets, transferInit])\n\n return { tokens, chainFilters, isLoading }\n}\n", "import type { TokenTransferConfigResult } from '@funkit/connect-core'\n\n/**\n * One curated deposit token (chain + asset), produced from the resolved\n * `tokentransferconfig`. Consumed by the deposit flow (its chains drive the\n * \"Available chains\" list).\n */\nexport interface SupportedToken {\n id: string\n symbol: string\n /** Chain shown on the trailing side, e.g. \"Ethereum\". */\n chainLabel: string\n /** Numeric chain id \u2014 used to derive the available-chains list + re-target. */\n chainId?: number\n /** Token contract address. */\n address?: string\n}\n\n/** A curated chain entry. The first is usually `{ id: 'all', label: 'All' }`. */\nexport interface TokenChainFilter {\n id: string\n label: string\n}\n\n/**\n * Flatten a resolved token-transfer config (the curated Statsig\n * `tokentransferconfig` merged with `/assets/supported` metadata \u2014 see\n * `resolveTokenTransferConfig`) into the supported-tokens screen's token rows +\n * chain-filter chips. One row per curated (chain, asset); chains keep their\n * config order; priority symbols float to the top. NOT the raw allow-list, so\n * no meme coins \u2014 only the customer's configured deposit tokens.\n */\nexport function buildSupportedTokenList(resolved: TokenTransferConfigResult): {\n tokens: SupportedToken[]\n chainFilters: TokenChainFilter[]\n} {\n const priorityIndex = new Map(\n resolved.priorityTokenSymbols.map((symbol, i) => [symbol, i]),\n )\n\n const tokens: SupportedToken[] = []\n const chainFilters: TokenChainFilter[] = [{ id: 'all', label: 'All' }]\n\n for (const chainId of resolved.chainIdSortOrder) {\n const assets = Object.values(resolved.supportedAssets[chainId] ?? {})\n if (assets.length === 0) {\n continue\n }\n chainFilters.push({ id: String(chainId), label: assets[0].chainName })\n for (const asset of assets) {\n tokens.push({\n id: `${asset.chainId}:${asset.address}`,\n symbol: asset.symbol,\n chainLabel: asset.chainName,\n chainId: Number(asset.chainId),\n address: asset.address,\n })\n }\n }\n\n // Stable sort: priority symbols first (in priority order); everything else\n // keeps its chain/insertion order.\n const rank = (symbol: string) =>\n priorityIndex.get(symbol) ?? Number.POSITIVE_INFINITY\n tokens.sort((a, b) => rank(a.symbol) - rank(b.symbol))\n\n return { tokens, chainFilters }\n}\n", "import type {\n CheckoutInitTokenTransferResponse,\n FunAddress,\n} from '@funkit/api-base'\nimport { bitcoinChain, solanaChain, tronChain } from '@funkit/chains'\nimport {\n type CheckoutTokenTransferConfig,\n type QRCodeUri,\n type TransferTokenQrCodeType,\n getDepositAddressForChain,\n getMinTransferValueForChain,\n getTransferTokenQrCodeUri,\n useDynamicConfig,\n} from '@funkit/connect-core'\n\nimport { useTransferInit } from './useTransferInit'\n\n// Web applies a per-customer slippage matrix; the thin RN flow uses a single\n// default (web's fallback value) until a customer needs otherwise.\nconst DEFAULT_MAX_SLIPPAGE_PERCENT = 0.25\n\nfunction resolveBlockchain(\n chainId: number | undefined,\n): TransferTokenQrCodeType {\n if (chainId === solanaChain.id) {\n return 'solana'\n }\n if (chainId === bitcoinChain.id) {\n return 'bitcoin'\n }\n if (chainId === tronChain.id) {\n return 'tron'\n }\n return 'ethereum'\n}\n\nexport interface UseTokenTransferParams {\n checkoutConfig: CheckoutTokenTransferConfig | undefined\n /** Chain the user picked to send funds on. */\n selectedChainId: number | undefined\n dynamicRoutingId?: string\n enabled?: boolean\n}\n\nexport interface UseTokenTransferResult {\n /** Where the user sends funds first. */\n depositAddress: FunAddress | undefined\n /** Raw deposit-init response (per-chain addresses); gates which chains show. */\n transferInit: CheckoutInitTokenTransferResponse | undefined\n /** Final destination of the funds. */\n recipientAddr: string\n /** Minimum transfer value (USD) for the selected chain, rounded up. */\n minTransferUsd: number\n /** Default max slippage, as a percent. */\n maxSlippagePercent: number\n qrCodeUri: QRCodeUri | undefined\n blockchain: TransferTokenQrCodeType\n isLoading: boolean\n}\n\n/**\n * Thin RN reimplementation of `@funkit/connect`'s `useTokenTransfer`: resolves\n * the deposit address + QR URI for the selected chain and the minimum transfer\n * value from the `mintokentransfervalue` dynamic config. The web hook's i18n\n * tooltips, fiat conversion, price-impact estimate, per-customer slippage, and\n * Polygon \"original recipient\" special-case are intentionally omitted.\n */\nexport function useTokenTransfer({\n checkoutConfig,\n selectedChainId,\n dynamicRoutingId,\n enabled,\n}: UseTokenTransferParams): UseTokenTransferResult {\n const { transferInit, recipientAddr, isLoading } = useTransferInit({\n checkoutConfig,\n dynamicRoutingId,\n enabled,\n })\n const minTransferLimits = useDynamicConfig('mintokentransfervalue')\n\n const minTransferUsd =\n selectedChainId !== undefined\n ? Math.ceil(\n getMinTransferValueForChain(selectedChainId, minTransferLimits),\n )\n : 0\n\n const depositAddress =\n selectedChainId !== undefined\n ? getDepositAddressForChain(selectedChainId, transferInit)\n : undefined\n\n const blockchain = resolveBlockchain(selectedChainId)\n\n const qrCodeUri = depositAddress\n ? getTransferTokenQrCodeUri({ depositAddress, type: blockchain })\n : undefined\n\n return {\n depositAddress,\n transferInit,\n recipientAddr,\n minTransferUsd,\n maxSlippagePercent: DEFAULT_MAX_SLIPPAGE_PERCENT,\n qrCodeUri,\n blockchain,\n isLoading,\n }\n}\n", "import QRCode from 'react-native-qrcode-svg'\n\n/**\n * Renders the scannable deposit QR from the EIP-681 URI produced by the\n * transfer hooks (e.g. `ethereum:0x\u2026`). Built on `react-native-qrcode-svg`\n * (which renders via `react-native-svg`, already a peer for the CDN icons).\n *\n * The QR is always drawn as near-black (`#101010`, matching the Figma deposit\n * frame) modules on a white cell \u2014 fixed colors, NOT the Restyle theme: in dark\n * mode `textPrimary` is light, which over the light cell background renders\n * white-on-white (invisible/unscannable). QR contrast must hold regardless of\n * the app's color scheme.\n */\nexport interface QrCodeProps {\n /** The value to encode \u2014 the EIP-681 URI / address from `useTokenTransfer`. */\n value: string\n size?: number\n /**\n * Error-correction level. Defaults to `'H'` (highest) so the centered\n * chain-logo overlay ({@link QrChainCluster}) stays within scannable\n * tolerance.\n */\n ecl?: 'L' | 'M' | 'Q' | 'H'\n}\n\nexport function QrCode({ value, size = 220, ecl = 'H' }: QrCodeProps) {\n return (\n <QRCode\n value={value}\n size={size}\n ecl={ecl}\n color=\"#101010\"\n backgroundColor=\"#FFFFFF\"\n />\n )\n}\n", "import type {\n CheckoutTokenTransferConfig,\n DynamicTargetAssetCandidate,\n} from '@funkit/connect-core'\nimport type { ReactNode } from 'react'\n\nimport type {\n SupportedToken,\n TokenChainFilter,\n} from '../transfer/supportedTokens'\n\nexport type { DynamicTargetAssetCandidate } from '@funkit/connect-core'\n\n/**\n * Resolve the active target-asset candidate from a list + routing id (RN-only).\n *\n * This is intentionally NOT a drop-in equivalent of web's\n * `getDefaultDynamicTargetAsset` (`packages/connect/src/utils/assets.ts`), which\n * takes the whole checkout config (synthesizing a guaranteed fallback) and adds\n * a `tokenSymbol === targetAssetTicker` match step. The RN flow only needs to\n * pick a candidate from the configured list:\n *\n * 1. Match `dynamicRoutingId`\n * 2. Match `isDefault`\n * 3. First candidate\n */\nexport function getDefaultDynamicTargetAsset(\n candidates: DynamicTargetAssetCandidate[] | undefined,\n dynamicRoutingId: string | undefined,\n): DynamicTargetAssetCandidate | undefined {\n if (!candidates?.length) return undefined\n if (candidates.length === 1) return candidates[0]\n\n const routingId = dynamicRoutingId ?? ''\n return (\n candidates.find((c) => c.dynamicRoutingId === routingId) ??\n candidates.find((c) => c.isDefault) ??\n candidates[0]\n )\n}\n\n/**\n * One deposit network \u2014 a segment in the Transfer screen's network switcher.\n * Derived internally by `buildDepositNetworks` from the curated chain list (NOT\n * host-configured): every EVM chain collapses into one \"EVM Chains\" segment,\n * each non-EVM chain (Solana / Tron / Bitcoin) is its own segment.\n */\nexport interface ChainOption {\n /** Stable id used for selection (e.g. the network id). */\n id: string\n label: string\n /**\n * CDN chain keys for the segment glyph: one \u2192 a single logo, several \u2192 a 2\u00D72\n * cluster (e.g. the EVM group).\n */\n iconKeys?: string[]\n /**\n * Numeric chain id this network selects \u2014 drives which generated deposit\n * address + QR (EVM / Solana / Bitcoin / Tron) the flow shows.\n */\n chainId?: number\n}\n\n/**\n * Data the managed deposit flow renders.\n *\n * The deposit address + QR are now SDK-generated: given `checkoutConfig` (the\n * destination chain/asset) and the identity on `<FunkitProvider>`, the flow\n * resolves the Universal Deposit Address and EIP-681 QR URI via the transfer\n * hooks. `depositAddress`/`qrCode` remain as optional host overrides / fallbacks\n * (shown while generation is loading or when no identity is configured).\n *\n * The network switcher is now sourced internally too (`buildDepositNetworks`\n * over the curated chain list \u2014 no host `depositChains`).\n *\n * TODO(connect-rn): source the remaining lists internally too \u2014 payment methods\n * from config/Statsig, supported tokens from `@funkit/api-base` \u2014 so\n * `beginDeposit` ultimately takes just a target, like the web `beginCheckout`.\n */\nexport interface DepositFlowConfig {\n /**\n * Candidate target assets for the \"Deposit to\" row, following web's\n * `FunkitCheckoutConfig.dynamicTargetAssetCandidates`. The active candidate is\n * resolved via {@link getDefaultDynamicTargetAsset} using `dynamicRoutingId`.\n * Omit to hide the deposit-target row.\n */\n dynamicTargetAssetCandidates?: DynamicTargetAssetCandidate[]\n /**\n * Destination of the deposit (target chain + asset). Drives deposit-address\n * generation via the transfer hooks. The web `FunkitCheckoutConfig` satisfies\n * this structurally.\n */\n checkoutConfig?: CheckoutTokenTransferConfig\n /**\n * Chain the user sends funds **from** (string id, matching web's\n * `FunkitCheckoutConfig.sourceChain`) \u2014 selects which generated address (EVM /\n * Solana / Bitcoin / Tron) and QR type to show, and which network-switcher\n * segment starts selected. The switcher segments themselves are derived from\n * the curated chain list (see `buildDepositNetworks`), not host-configured.\n */\n sourceChain?: string\n /** Dynamic-routing id used to resolve UDA params for `checkoutConfig`. */\n dynamicRoutingId?: string\n /**\n * Deposit address fallback/override. The flow prefers the SDK-generated\n * address; this is shown while it loads or when generation is unavailable\n * (no identity). Display formatting (truncation) is applied by the flow.\n */\n depositAddress?: string\n /** Tokens shown on the supported-tokens screen (host-filtered). */\n supportedTokens?: SupportedToken[]\n tokenChainFilters?: TokenChainFilter[]\n /**\n * QR code override. By default the flow renders the generated EIP-681 URI\n * with `react-native-qrcode-svg`; supply a node only to override.\n */\n qrCode?: ReactNode\n}\n\n/** Lifecycle callbacks passed to `useFunkitCheckout`. */\nexport interface DepositFlowCallbacks {\n onOpen?: () => void\n onClose?: () => void\n onCheckoutBlocked?: () => void\n}\n", "import {\n type ComponentProps,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n} from 'react'\nimport { View, type ViewStyle } from 'react-native'\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackgroundProps,\n BottomSheetModal,\n BottomSheetModalProvider,\n BottomSheetView,\n useBottomSheetTimingConfigs,\n} from '@gorhom/bottom-sheet'\nimport { Easing } from 'react-native-reanimated'\n\nimport { useTheme } from '../theme/restyle'\nimport { useKeyboardHeight } from './useKeyboardHeight'\n\nexport interface FlowSheetProps {\n isOpen: boolean\n /**\n * Per-`beginDeposit` id. A change while open re-presents the sheet, which\n * cancels an in-flight dismiss \u2014 so opening a new session mid-swipe-dismiss\n * isn't closed by the previous session's late `onDismiss`.\n */\n session: number\n onClose: () => void\n /** The flow screens rendered inside the sheet. */\n content: ReactNode\n /** The host app subtree the sheet is presented above. */\n children: ReactNode\n /**\n * Lift the sheet above the keyboard. Scoped to the screen that needs it (the\n * Swapped embed's WebView): a generic flow screen with no inputs shouldn't\n * subscribe to keyboard events, and a future `BottomSheetTextInput` screen\n * would be handled by gorhom natively instead. See {@link useKeyboardHeight}.\n */\n keyboardAvoidEnabled?: boolean\n}\n\n/** The subset of `BottomSheetModal`'s imperative handle the flow drives. */\ninterface SheetHandle {\n present: () => void\n dismiss: () => void\n}\n\n/**\n * Host for the managed deposit-flow surface: a `@gorhom/bottom-sheet` modal\n * (native gestures + spring physics), sized to its content. The flow screens\n * draw their own grabber, so the sheet runs handle-less; its surface is painted\n * by {@link FlowSheetBackground} (which also fills the over-drag gap).\n *\n * Requires the gorhom peer stack (`@gorhom/bottom-sheet`,\n * `react-native-gesture-handler`, `react-native-reanimated`) and a\n * `<GestureHandlerRootView>` at the app root.\n */\nexport function FlowSheet({\n isOpen,\n session,\n onClose,\n content,\n children,\n keyboardAvoidEnabled = false,\n}: FlowSheetProps) {\n const ref = useRef<SheetHandle | null>(null)\n const setRef = useCallback((instance: SheetHandle | null) => {\n ref.current = instance\n }, [])\n\n const keyboardHeight = useKeyboardHeight(keyboardAvoidEnabled)\n\n // Bridge the flow's `isOpen` state onto the modal's imperative present/dismiss.\n // Two guards avoid gorhom's \"dismiss on an already-closed modal \u2192 unmount +\n // mark DISMISSED (can't re-present)\" footgun:\n // - `hasPresented`: never dismiss a modal we never presented (initial mount).\n // - `sheetSelfDismissed`: when a swipe/backdrop closes the sheet, gorhom\n // already dismissed it and fired onDismiss \u2192 onClose \u2192 isOpen=false; skip\n // the redundant dismiss so it can reopen.\n const hasPresented = useRef(false)\n const sheetSelfDismissed = useRef(false)\n useEffect(() => {\n if (isOpen) {\n sheetSelfDismissed.current = false\n ref.current?.present()\n hasPresented.current = true\n return\n }\n if (!hasPresented.current) return\n hasPresented.current = false\n if (sheetSelfDismissed.current) {\n sheetSelfDismissed.current = false\n return\n }\n ref.current?.dismiss()\n // `session` is a dep so a new beginDeposit while open re-presents (and\n // cancels any in-flight dismiss) rather than leaving a stale close pending.\n }, [isOpen, session])\n\n const handleDismiss = useCallback(() => {\n sheetSelfDismissed.current = true\n onClose()\n }, [onClose])\n\n // Smooth the dynamic-size morph: when the active flow screen changes height,\n // gorhom recomputes the dynamic snap point and animates to it with these\n // configs (this also governs present/dismiss). Ease-out cubic-bezier\n // (0.22, 1, 0.36, 1) over 300ms matches the team's container-resize motion\n // token, so the sheet tweens between screen heights instead of snapping.\n const animationConfigs = useBottomSheetTimingConfigs({\n duration: 300,\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n })\n\n const renderBackdrop = useCallback(\n (props: ComponentProps<typeof BottomSheetBackdrop>) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n pressBehavior=\"close\"\n />\n ),\n [],\n )\n\n return (\n <BottomSheetModalProvider>\n {children}\n <BottomSheetModal\n ref={setRef}\n // Size the sheet to its content so it hugs each screen and sits flush at\n // the bottom (a fixed snap point leaves a gap below shorter screens).\n enableDynamicSizing\n // We lift the sheet ourselves by growing the content (the spacer below,\n // driven by `keyboardAvoidEnabled`). gorhom doesn't react to the\n // WebView's keyboard, so `extend` just keeps it at its (grown) content\n // height \u2014 our spacer is the single source of truth.\n keyboardBehavior=\"extend\"\n // While the keyboard is up, disable over-drag: rubber-banding the sheet\n // up would otherwise lift the keyboard-compensation spacer into view as\n // blank space. Over-drag (and its surface fill, see FlowSheetBackground)\n // stays on the rest of the time.\n enableOverDrag={keyboardHeight === 0}\n animationConfigs={animationConfigs}\n onDismiss={handleDismiss}\n backdropComponent={renderBackdrop}\n // The flow screens render their own grabber; the sheet paints the\n // surface (see FlowSheetBackground) so over-drag doesn't expose a gap.\n handleComponent={null}\n backgroundComponent={FlowSheetBackground}\n >\n <BottomSheetView>\n {content}\n {/* Lift the sheet above the keyboard. The Swapped embed focuses an\n input inside its WebView (see useKeyboardHeight) which gorhom's\n keyboard handling can't see, so the sheet won't move on its own.\n Growing the dynamically-sized content by the keyboard height\n slides the whole sheet up instead of letting the keyboard overlap\n it (which reflows the WebView's viewport smaller \u2014 the \"shrink\").\n gorhom tweens the resize with `animationConfigs`. */}\n {keyboardHeight > 0 ? (\n <View style={{ height: keyboardHeight }} />\n ) : null}\n </BottomSheetView>\n </BottomSheetModal>\n </BottomSheetModalProvider>\n )\n}\n\n/**\n * Sheet surface for the flow modal. gorhom sizes the sheet body to its content,\n * so a flat background fills only the content area; over-dragging the sheet\n * above its content height lifts the body off the bottom and would otherwise\n * expose the backdrop below it (ENG-4340: \"you can see how the drawer ends\").\n *\n * We paint the `bgModal` surface (matching each screen's own surface + rounded\n * top) and hang a tall extension off the content's bottom edge. Anchored at\n * `top: '100%'`, the extension tracks the body as it lifts, so the rubber-band\n * over-drag reveals more surface instead of empty space \u2014 the bounce is kept.\n */\nexport function FlowSheetBackground({\n pointerEvents,\n style,\n}: BottomSheetBackgroundProps) {\n const theme = useTheme()\n const surface: ViewStyle = {\n backgroundColor: theme.colors.bgModal,\n borderTopLeftRadius: theme.borderRadii.modal,\n borderTopRightRadius: theme.borderRadii.modal,\n }\n const extension: ViewStyle = {\n ...bottomExtension,\n backgroundColor: theme.colors.bgModal,\n }\n return (\n <View pointerEvents={pointerEvents} style={[style, surface]}>\n <View style={extension} />\n </View>\n )\n}\n\n// Comfortably taller than any phone screen so even a hard rubber-band pull never\n// drags past the surface; it extends below the device edge and stays off-screen\n// at rest.\nconst bottomExtension: ViewStyle = {\n position: 'absolute',\n top: '100%',\n left: 0,\n right: 0,\n height: 1000,\n}\n", "import { useEffect, useState } from 'react'\nimport { Keyboard, Platform } from 'react-native'\n\n/**\n * The on-screen keyboard height (0 when hidden), tracked from the global\n * keyboard events. Pass `enabled` to scope it to the screen that needs it: when\n * `false`, no listeners are registered and it always reports 0.\n *\n * `@gorhom/bottom-sheet`'s built-in keyboard handling only reacts to a focused\n * `BottomSheetTextInput`. The Swapped embed's WebView focuses its input in the\n * web context, invisible to gorhom, so the sheet never moves on its own. These\n * events, by contrast, fire for the WebView's web inputs too, letting the host\n * lift the sheet itself.\n *\n * Because these are *global* keyboard events, a screen that DOES use gorhom's\n * native avoidance (a `BottomSheetTextInput`) would otherwise be double-counted\n * \u2014 gorhom shifting the sheet AND this growing it. Gating on `enabled` keeps the\n * two from overlapping: only the Swapped screen opts in.\n *\n * iOS emits the `Will` events (ahead of the keyboard animation, so the sheet\n * lifts in sync); Android only reliably emits the `Did` events.\n */\nexport function useKeyboardHeight(enabled: boolean): number {\n const [height, setHeight] = useState(0)\n useEffect(() => {\n if (!enabled) {\n setHeight(0)\n return\n }\n const showEvent =\n Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow'\n const hideEvent =\n Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide'\n const show = Keyboard.addListener(showEvent, (e) =>\n setHeight(e.endCoordinates.height),\n )\n const hide = Keyboard.addListener(hideEvent, () => setHeight(0))\n return () => {\n show.remove()\n hide.remove()\n }\n }, [enabled])\n return height\n}\n", "// `__CONNECT_RN_VERSION__` is replaced at build time with the package version\n// via esbuild `define` (see build.js). The `typeof` guard keeps this safe under\n// vitest / tsc, where the define isn't applied and the identifier is undefined.\ndeclare const __CONNECT_RN_VERSION__: string\n\nexport const CONNECT_RN_VERSION: string =\n typeof __CONNECT_RN_VERSION__ === 'string'\n ? __CONNECT_RN_VERSION__\n : '0.0.0-dev'\n", "import {\n LogEventCompressionMode,\n LogLevel,\n StatsigProvider,\n type StatsigUser,\n} from '@statsig/react-bindings'\nimport { type ReactNode, useMemo } from 'react'\n\nimport { useClientAsyncInitRN } from '../statsig/useClientAsyncInitRN'\n\n// React Native counterpart of @funkit/connect's FunkitStatsigProvider. Same Fun\n// client key + custom proxy (the Statsig domain is usually blocked by adblockers\n// \u2014 https://docs.statsig.com/infrastructure/api_proxy/custom_proxy), but the\n// client is created with the RN bindings (AsyncStorage persistence, AppState\n// visibility) via `useClientAsyncInitRN`. The web-only Datadog `values_updated`\n// correlation is omitted (RN logging is wired separately).\nconst STATSIG_API = 'https://data-api.fun.xyz/v1'\nexport const STATSIG_CLIENT_KEY =\n 'client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM' as const\n\ninterface FunkitStatsigProviderProps {\n children: ReactNode\n /** Customer apiKey \u2014 gates customer-scoped configs (e.g. `enableswappeddeposit`). */\n apiKey: string\n /** Resolved funkit user id (apiKey|externalUserId, else wallet address). */\n userId: string\n isDevelopment?: boolean\n}\n\nexport function FunkitStatsigProvider({\n children,\n apiKey,\n userId,\n isDevelopment = false,\n}: FunkitStatsigProviderProps) {\n // Mirror web's Statsig user (`useTrack.updateUserAsync`): the customer apiKey\n // lives in `customIDs.apiKey`, which is what customer-gated configs evaluate\n // against. Without it every gated config falls back to its default (e.g.\n // `enableswappeddeposit: false`), so the Swapped cash methods never appear.\n const user = useMemo<StatsigUser>(\n () => ({ userID: userId, customIDs: { apiKey } }),\n [userId, apiKey],\n )\n\n const { client } = useClientAsyncInitRN(STATSIG_CLIENT_KEY, user, {\n networkConfig: {\n api: STATSIG_API,\n // default timeout (10s) is too large; statsig usually responds <200ms\n networkTimeoutMs: 5_000,\n },\n // Our proxy supports compression; force it on to save bandwidth.\n logEventCompressionMode: LogEventCompressionMode.Forced,\n // Silence harmless warnings from hooks running before async init (we have\n // bootstrap fallbacks).\n logLevel: isDevelopment ? undefined : LogLevel.Error,\n environment: {\n tier: isDevelopment ? 'development' : 'production',\n },\n })\n\n return <StatsigProvider client={client}>{children}</StatsigProvider>\n}\n", "import {\n type StatsigOptions,\n type StatsigUser,\n useStatsigInternalClientFactoryAsync,\n} from '@statsig/react-bindings'\n\nimport { StatsigClientRN } from './StatsigClientRN'\n\n// Vendored from @statsig/react-native-bindings. Creates an RN client and runs\n// `initializeAsync` (network fetch); `isLoading` flips false when ready.\nexport function useClientAsyncInitRN(\n sdkKey: string,\n initialUser: StatsigUser,\n statsigOptions: StatsigOptions | null = null,\n): { isLoading: boolean; client: StatsigClientRN } {\n return useStatsigInternalClientFactoryAsync(\n (args) =>\n new StatsigClientRN(args.sdkKey, args.initialUser, args.statsigOptions),\n {\n sdkKey,\n initialUser,\n statsigOptions,\n },\n )\n}\n", "import {\n StatsigClient,\n type StatsigOptions,\n type StatsigUser,\n} from '@statsig/react-bindings'\n\nimport { setupStatsigForReactNative } from './rnSetup'\nimport { getStatsigMetadataAdditions } from './statsigMetadata'\n\n// Vendored from @statsig/react-native-bindings' StatsigClientRN. A StatsigClient\n// pre-configured for React Native: AsyncStorage persistence, AppState-driven\n// visibility, and (device-info-free) metadata additions.\nexport class StatsigClientRN extends StatsigClient {\n readonly __isRnClient = true\n\n constructor(\n sdkKey: string,\n user: StatsigUser,\n options: StatsigOptions | null = null,\n ) {\n const opts = options ?? {}\n setupStatsigForReactNative(getStatsigMetadataAdditions(), opts)\n\n super(sdkKey, user, opts)\n }\n}\n", "import {\n type AnyStatsigOptions,\n type NetworkArgs,\n SDKType,\n StatsigMetadataProvider,\n} from '@statsig/react-bindings'\n\nimport { applyAppStateVisibilityShim } from './appVisibilityShim'\nimport { createPreloadedAsyncStorage } from './preloadedAsyncStorage'\n\n// Vendored from @statsig/react-native-core's RNSetup. Wires the RN platform\n// concerns into a StatsigOptions before the client is constructed: the AppState\n// visibility shim, the binding type, the AsyncStorage-backed storage provider\n// (unless the host supplied its own), and a fetch-based network override that\n// sets the JSON content-type header.\n\nexport function setupStatsigForReactNative(\n statsigMetadataAdditions: Record<string, string | undefined> | null,\n options: AnyStatsigOptions,\n): void {\n applyAppStateVisibilityShim()\n\n SDKType._setBindingType('rn')\n if (statsigMetadataAdditions) {\n StatsigMetadataProvider.add(statsigMetadataAdditions)\n }\n\n if (options.storageProvider == null) {\n options.storageProvider = createPreloadedAsyncStorage()\n }\n\n applyNetworkFix(options)\n}\n\nfunction applyNetworkFix(options: AnyStatsigOptions) {\n if (options.networkConfig?.networkOverrideFunc != null) {\n return\n }\n\n const networkOverrideFunc = (url: string, args: NetworkArgs) => {\n if (args.body != null && args.method === 'POST') {\n args.headers = {\n 'Content-Type': 'application/json',\n ...args.headers,\n }\n }\n return fetch(url, args)\n }\n\n options.networkConfig = {\n networkOverrideFunc,\n ...options.networkConfig,\n }\n}\n", "import { _notifyVisibilityChanged } from '@statsig/react-bindings'\nimport { AppState } from 'react-native'\n\n// Vendored from @statsig/react-native-core's AppVisiblityShim. statsig's event\n// logger flushes on visibility changes; on web that's driven by\n// `document`/`window` events, which don't exist in RN. Bridge RN's `AppState`\n// to statsig's `_notifyVisibilityChanged` so flush-on-background works.\n\nlet isApplied = false\n\nexport function applyAppStateVisibilityShim(): void {\n if (isApplied) {\n return\n }\n\n isApplied = true\n AppState.addEventListener('change', (nextAppState) =>\n _notifyVisibilityChanged(\n nextAppState === 'active' ? 'foreground' : 'background',\n ),\n )\n}\n", "import AsyncStorage from '@react-native-async-storage/async-storage'\nimport { Log, type StorageProvider } from '@statsig/react-bindings'\n\n// Vendored from @statsig/react-native-core's PreloadedAsyncStorage, unchanged\n// except for sourcing `Log`/`StorageProvider` from `@statsig/react-bindings`\n// (which re-exports `@statsig/client-core`) so there's a single statsig copy.\n//\n// Statsig's storage API is synchronous, but AsyncStorage is async. This bridges\n// them: prefetch all `statsig.*` keys into an in-memory mirror once, serve reads\n// synchronously from the mirror, and write through to AsyncStorage in the\n// background. Persistence (warm cache across launches) without any native\n// module beyond AsyncStorage.\n\nconst NOT_READY_ERROR =\n 'Attempting to alter AsyncStorage before it is ready. Values will not be persisted.'\n\nexport function createPreloadedAsyncStorage(): StorageProvider {\n const inMemoryStore: Record<string, string> = {}\n let isResolved = false\n let readyPromise: Promise<void> | null = null\n\n const enforceIsResolved = () => {\n if (!isResolved) {\n Log.error(NOT_READY_ERROR)\n }\n\n return isResolved\n }\n\n const provider: StorageProvider = {\n getProviderName: (): string => 'AsyncStorage',\n\n isReady: () => isResolved,\n\n isReadyResolver: () => {\n if (!readyPromise) {\n readyPromise = prefetchFromAsyncStorage(inMemoryStore).finally(() => {\n isResolved = true\n })\n }\n return readyPromise\n },\n\n getItem: (key: string): string | null => {\n if (!enforceIsResolved()) {\n return null\n }\n\n return inMemoryStore[key] ?? null\n },\n\n setItem: (key: string, value: string): void => {\n inMemoryStore[key] = value\n if (!enforceIsResolved()) {\n return\n }\n\n AsyncStorage.setItem(key, value).catch(Log.error)\n },\n\n removeItem: (key: string): void => {\n delete inMemoryStore[key]\n if (!enforceIsResolved()) {\n return\n }\n\n AsyncStorage.removeItem(key).catch(Log.error)\n },\n\n getAllKeys: (): readonly string[] => {\n if (!enforceIsResolved()) {\n return []\n }\n\n return Object.keys(inMemoryStore)\n },\n }\n\n return provider\n}\n\nasync function prefetchFromAsyncStorage(\n inMemoryStore: Record<string, string>,\n): Promise<void> {\n const keys = await AsyncStorage.getAllKeys()\n\n await Promise.all(\n keys.map(async (key) => {\n if (!key.startsWith('statsig.')) {\n return\n }\n\n const cache = await AsyncStorage.getItem(key)\n if (!cache) {\n return\n }\n\n inMemoryStore[key] = cache\n }),\n )\n}\n", "import { NativeModules, Platform } from 'react-native'\n\n// Vendored from @statsig/react-native-core's StatsigMetadataAdditions, with the\n// `react-native-device-info` dependency intentionally REMOVED \u2014 that package is\n// a native module (not in Expo Go, needs a dev build) and we don't want to\n// require it. The app-version / device-model fields it provided are simply left\n// `undefined`; we still surface `systemName` (free via `Platform.OS`) and the\n// `locale` (read from RN's built-in NativeModules, no extra dependency).\n\ntype I18nManagerModule = { localeIdentifier?: string }\ntype SettingsManagerModule = {\n settings?: { AppLocale?: string; AppleLanguages?: string[] }\n}\n\nfunction resolveLocale(): string | undefined {\n if (Platform.OS === 'android') {\n const i18nManager = NativeModules.I18nManager as\n | I18nManagerModule\n | undefined\n return i18nManager?.localeIdentifier ?? undefined\n }\n\n if (Platform.OS === 'ios') {\n const settings = (\n NativeModules.SettingsManager as SettingsManagerModule | undefined\n )?.settings\n return settings?.AppLocale ?? settings?.AppleLanguages?.[0] ?? undefined\n }\n\n return undefined\n}\n\nexport function getStatsigMetadataAdditions(): Record<\n string,\n string | undefined\n> {\n return {\n // Device-info-derived fields are dropped (no react-native-device-info).\n appVersion: undefined,\n systemVersion: undefined,\n deviceModelName: undefined,\n deviceModel: undefined,\n // Available without any native module:\n systemName: Platform.OS,\n locale: resolveLocale(),\n }\n}\n", "import { useCallback } from 'react'\n\nimport type {\n DepositFlowCallbacks,\n DepositFlowConfig,\n} from '../flow/depositFlowConfig'\nimport { useFunkitFlow } from '../flow/FunkitFlowProvider'\n\n/**\n * The connect-rn entry hook, mirroring `@funkit/connect`'s `useFunkitCheckout`.\n * Returns imperative `begin*` calls that open the SDK's managed modal flow \u2014 the\n * host renders no screens itself.\n *\n * `beginDeposit(config)` opens the deposit flow (Add money \u2192 Transfer/UDA \u2192\n * Choose chain / Supported tokens / QR). `beginCheckout` / `beginWithdrawal`\n * will be added here as those flows land, matching the web surface.\n */\nexport function useFunkitCheckout(callbacks: DepositFlowCallbacks = {}) {\n const { beginDeposit: begin } = useFunkitFlow()\n\n const beginDeposit = useCallback(\n (config: DepositFlowConfig) => begin(config, callbacks),\n [begin, callbacks],\n )\n\n return { beginDeposit }\n}\n"],
5
+ "mappings": ";AAcA,cAAc;;;ACiHd,IAAM,mBAAqC;AAAA,EACzC,QAAQ;AAAA,EACR,SAAS;AAAA,IACP,MAAM,EAAE,WAAW,MAAM;AAAA,IACzB,QAAQ,EAAE,WAAW,MAAM;AAAA,EAC7B;AACF;AAcO,SAAS,oBACd,OACA,QACQ;AACR,QAAM,EAAE,aAAa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ACd,QAAI,CAAC,QAAQ,QAAQ;AACnB;AAAA,IACF;AACA,WAAO,UAAU,OAAO,QAAQ,OAAO,kBAAkB;AAAA,EAC3D,GAAG,CAAC,QAAQ,QAAQ,KAAK,CAAC;AAG1B,EAAAA,YAAU,MAAM;AACd,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,MACA,SAAS,aAAa;AAAA,MACtB;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,gBAAAJ;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ,SAAS;AAAA,MACjB,QAAQ,SAAS;AAAA,MACjB,eAAe;AAAA,MAEf,0BAAAA,MAAC,uBAAoB,QACnB,0BAAAA,MAAC,0BAAuB,UACtB,0BAAAA,MAAC,uBAAoB,QAAgB,aACnC,0BAAAA,MAAC,sBAAmB,iBAAiBC,kBAClC,UACH,GACF,GACF,GACF;AAAA;AAAA,EACF;AAEJ;;;AgD/IA,SAAS,eAAAI,oBAAmB;AAiBrB,SAAS,kBAAkB,YAAkC,CAAC,GAAG;AACtE,QAAM,EAAE,cAAc,MAAM,IAAI,cAAc;AAE9C,QAAM,eAAeC;AAAA,IACnB,CAAC,WAA8B,MAAM,QAAQ,SAAS;AAAA,IACtD,CAAC,OAAO,SAAS;AAAA,EACnB;AAEA,SAAO,EAAE,aAAa;AACxB;",
6
+ "names": ["Text", "Text", "jsx", "label", "Text", "useMemo", "useState", "jsx", "useState", "useMemo", "useEffect", "useMemo", "useRef", "useDynamicConfig", "createContext", "useCallback", "useContext", "useEffect", "useMemo", "useRef", "useState", "Platform", "StyleSheet", "View", "useEffect", "useMemo", "useMemo", "useEffect", "SvgXml", "jsx", "SvgXml", "useEffect", "useState", "SvgXml", "jsx", "useState", "useEffect", "SvgXml", "jsx", "jsx", "jsxs", "toIconUri", "jsx", "jsxs", "useEffect", "useState", "Animated", "Easing", "Keyframe", "jsx", "jsxs", "Easing", "Keyframe", "useState", "useEffect", "Animated", "Pressable", "ScrollView", "jsx", "jsxs", "topBar", "Pressable", "ScrollView", "row", "iconRing", "StyleSheet", "jsx", "jsxs", "styles", "StyleSheet", "useEffect", "useRef", "useState", "Pressable", "useWindowDimensions", "SvgXml", "jsx", "SvgXml", "jsx", "jsxs", "useWindowDimensions", "useState", "useRef", "useEffect", "sheet", "topBar", "Pressable", "topBarSpacer", "content", "useEffect", "useRef", "useState", "Pressable", "useEffect", "useState", "Pressable", "Animated", "Easing", "jsx", "jsxs", "toIconUri", "useState", "useEffect", "AnimatedPressable", "Animated", "Pressable", "Easing", "jsx", "jsxs", "useState", "useRef", "useEffect", "topBar", "Pressable", "iconButton", "content", "addressGroup", "addressText", "label", "useCallback", "useTheme", "useCallback", "useEffect", "useMemo", "useRef", "jsx", "useRef", "useMemo", "useTheme", "useEffect", "useCallback", "jsx", "useCallback", "sheet", "solanaChain", "useDynamicConfig", "useTheme", "useQuery", "useMemo", "createContext", "useContext", "jsx", "useQuery", "useDynamicConfig", "useMemo", "useQuery", "useDynamicConfig", "useTheme", "useMemo", "useQuery", "solanaChain", "useDynamicConfig", "useQuery", "useMemo", "useDynamicConfig", "useQuery", "useMemo", "bitcoinChain", "solanaChain", "tronChain", "getDepositAddressForChain", "getMinTransferValueForChain", "useDynamicConfig", "solanaChain", "bitcoinChain", "tronChain", "useDynamicConfig", "getMinTransferValueForChain", "getDepositAddressForChain", "jsx", "useCallback", "useEffect", "useRef", "View", "Easing", "useEffect", "useState", "jsx", "jsxs", "content", "useRef", "useCallback", "useEffect", "Easing", "View", "jsx", "jsxs", "createContext", "copyToClipboard", "useState", "useCallback", "useMemo", "useRef", "useEffect", "View", "useDynamicConfig", "row", "StyleSheet", "Platform", "useContext", "useMemo", "Platform", "jsx", "useMemo", "jsx", "copyToClipboard", "useRef", "useMemo", "useEffect", "useCallback", "useCallback"]
7
7
  }