@funkit/connect-rn 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +4 -2
  3. package/dist/index.d.ts +2 -3
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1220 -568
  6. package/dist/index.js.map +4 -4
  7. package/dist/src/flow/AddressCopiedToast.d.ts +1 -18
  8. package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -1
  9. package/dist/src/flow/FlowSheet.d.ts +2 -1
  10. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  11. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  12. package/dist/src/flow/depositFlowConfig.d.ts +12 -4
  13. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  14. package/dist/src/history/useRecentDeposits.d.ts +30 -1
  15. package/dist/src/history/useRecentDeposits.d.ts.map +1 -1
  16. package/dist/src/identity/IdentityContext.d.ts +8 -0
  17. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  18. package/dist/src/locales/i18n.d.ts +15 -0
  19. package/dist/src/locales/i18n.d.ts.map +1 -0
  20. package/dist/src/providers/FunkitI18nProvider.d.ts +23 -0
  21. package/dist/src/providers/FunkitI18nProvider.d.ts.map +1 -0
  22. package/dist/src/providers/FunkitProvider.d.ts +8 -2
  23. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  24. package/dist/src/screens/AvailableChainsScreen.d.ts +1 -3
  25. package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -1
  26. package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -1
  27. package/dist/src/screens/QrCodeScreen.d.ts +1 -5
  28. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
  29. package/dist/src/screens/SelectMethodScreen.d.ts +7 -7
  30. package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -1
  31. package/dist/src/screens/TransferCryptoScreen.d.ts +1 -6
  32. package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
  33. package/dist/src/screens/WithdrawMethodScreen.d.ts +3 -3
  34. package/dist/src/screens/WithdrawMethodScreen.d.ts.map +1 -1
  35. package/dist/src/transfer/availableChains.d.ts +6 -21
  36. package/dist/src/transfer/availableChains.d.ts.map +1 -1
  37. package/dist/src/transfer/fops.d.ts +7 -6
  38. package/dist/src/transfer/fops.d.ts.map +1 -1
  39. package/dist/src/transfer/hooks/useFops.d.ts +8 -15
  40. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
  41. package/dist/src/transfer/hooks/useTokenTransfer.d.ts +3 -5
  42. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  43. package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -1
  44. package/package.json +4 -5
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/theme/tokens.ts", "../src/theme/toRestyleTheme.ts", "../src/theme/buildFunkitTheme.ts", "../src/theme/themes.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/statsig/useDynamicConfig.ts", "../src/geo/useUserIpInfo.ts", "../src/logging/logger.ts", "../src/logging/datadogHttpLogTransport.ts", "../src/geo/useCheckoutBlocked.ts", "../src/geo/isCountryBlocked.ts", "../src/icons/PaymentMethodIcon.tsx", "../src/icons/assetLogos.ts", "../src/icons/FunIcon.tsx", "../src/icons/PaymentBrandIcons.tsx", "../src/icons/CryptoBitcoinIcon.tsx", "../src/icons/funIconUri.ts", "../src/icons/QrChainCluster.tsx", "../src/icons/SourceTokenCluster.tsx", "../src/icons/TokenChainIcon.tsx", "../src/screens/SelectMethodScreen.tsx", "../src/icons/StatusIcon.tsx", "../src/screens/AvailableChainsScreen.tsx", "../src/screens/CheckoutBlockedScreen.tsx", "../src/screens/QrCodeScreen.tsx", "../src/hooks/useScreenSize.ts", "../src/icons/CopyAddressIcon.tsx", "../src/screens/TransferCryptoScreen.tsx", "../src/screens/NetworkSelector.tsx", "../src/screens/WithdrawMethodScreen.tsx", "../src/swapped/SwappedScreen.tsx", "../src/swapped/SwappedScreenShell.tsx", "../src/swapped/SwappedWebView.tsx", "../src/swapped/buildSwappedTheme.ts", "../src/swapped/webViewSwappedTransport.ts", "../src/swapped/SwappedWithdrawScreen.tsx", "../src/transfer/availableChains.ts", "../src/transfer/clipboard.ts", "../src/transfer/fops.ts", "../src/transfer/formatDepositAddress.ts", "../src/transfer/hooks/useFiatExchangeRates.ts", "../src/transfer/hooks/useFops.ts", "../src/identity/IdentityContext.tsx", "../src/utils/customers.ts", "../src/transfer/hooks/useTransferInit.ts", "../src/transfer/hooks/useUDAParams.ts", "../src/transfer/hooks/useWithdrawalFops.ts", "../src/withdrawal/useWithdrawalExecution.ts", "../src/withdrawal/publicClient.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", "../src/history/useRecentDeposits.ts", "../src/history/useCheckoutsListenerByUserId.ts"],
4
- "sourcesContent": ["// Local design tokens for @funkit/connect-rn, generated from the \"Fun Variables\"\n// Figma export (`Fun Variables/{Light,Dark}.tokens.json`). This file is a STRICT\n// mirror of that export: the token tree reproduces Figma's variable HIERARCHY\n// one-to-one (`background` / `content` / `border` / `font` / `spacing` / `brand`\n// / `button` / `opacity`), values are the resolved concrete values, and nothing\n// is invented \u2014 if a state (hover, focused, \u2026) or token isn't in Fun Variables,\n// it isn't here either.\n//\n// Multi-word Figma leaves are camelCased so they're valid TS identifiers\n// (`element-inner` \u2192 `elementInner`, `loading alpha` \u2192 `loadingAlpha`,\n// `amount input` \u2192 `amountInput`, `top bar` \u2192 `topBar`); the nesting is\n// otherwise identical to the JSON.\n//\n// `buildFunkitTheme` (buildFunkitTheme.ts) FLATTENS this tree into the flat\n// `@shopify/restyle` theme components consume (`bgButtonPrimary`, \u2026). The\n// Figma-path \u2192 flat-key convention is documented in\n// `packages/connect-rn/CLAUDE.md` (\u00A7 \"Figma Fun Variables \u2192 tokens.ts\").\n//\n// connect-rn's theme is intentionally NOT shared with @funkit/connect-core (web\n// keeps its separate `ThemeVars`).\n\nimport type { TextStyle } from 'react-native'\n\n/**\n * A Figma font-style name (`font/\u2026/weight`). The Fun Variables export defines\n * exactly these two cuts \u2014 there is no semibold/bold, so any `fontWeight: '600'`\n * in a component is a smell that should route through the token instead.\n */\nexport type FunkitFontStyleName = 'Regular' | 'Medium'\n\n/** Logical weight a component's `Text` can request; maps onto `font/body/weight/*`. */\nexport type FunkitFontWeight = 'base' | 'medium'\n\n/** `font/*` \u2014 body and header typography. Family is shared by both in Light/Dark. */\nexport interface FunkitFontTokens {\n body: {\n /**\n * `font/body/family`. The Fun Variables value is `Inter`, so the host must\n * register `Inter-Regular` / `Inter-Medium` (see {@link fontFamilyForWeight});\n * if it doesn't, RN falls back to the platform system font.\n */\n family: string\n weight: Record<FunkitFontWeight, FunkitFontStyleName>\n size: { base: number; detail: number }\n // Absolute px (RN's TextStyle.lineHeight).\n leading: { base: number; detail: number }\n }\n header: {\n family: string\n weight: FunkitFontStyleName\n alignment: 'Left' | 'Center' | 'Right'\n // `amount input` / `amount summary` are single-line; Figma defines no leading.\n size: {\n title: number\n subtitle: number\n amountInput: number\n amountSummary: number\n }\n }\n}\n\n/** One button state's fill (`background/button/*` \u2014 only `default` + `pressed`). */\nexport interface ButtonSurface {\n default: string\n pressed: string\n}\n\n/**\n * The full token set for one mode \u2014 a one-to-one mirror of the Fun Variables\n * Figma variable groups.\n */\nexport interface FunkitTokens {\n background: {\n modal: string\n secondary: string\n button: {\n primary: ButtonSurface\n secondary: ButtonSurface\n tertiary: ButtonSurface\n icon: ButtonSurface\n destructive: ButtonSurface & { disabled: string }\n }\n pill: { default: string; pressed: string; disabled: string }\n }\n /** `opacity/disabled` \u2014 a percentage (0\u2013100); divide by 100 for RN `opacity`. */\n opacity: {\n disabled: number\n }\n content: {\n elements: {\n primary: string\n secondary: string\n success: string\n error: string\n hyperlink: string\n warning: string\n }\n // Label/icon color on a button surface. `loadingAlpha` (`loading alpha`) is\n // the same color at reduced alpha, shown while the button is loading.\n button: {\n primary: { default: string; loadingAlpha: string }\n secondary: { default: string; loadingAlpha: string }\n tertiary: { default: string }\n icon: { default: string }\n destructive: { default: string; loadingAlpha: string }\n }\n }\n border: {\n radius: {\n modal: number\n element: number\n elementInner: number\n button: number\n }\n modal: { default: string; weight: number }\n elements: {\n default: { color: string; weight: number }\n selected: { color: string; weight: number }\n }\n button: { primary: string; secondary: string; weight: number }\n }\n font: FunkitFontTokens\n spacing: {\n padding: {\n elements: { horizontal: number }\n modal: { horizontal: number }\n }\n heights: { topBar: number; button: number }\n }\n brand: {\n primary: string\n }\n button: {\n // Icon tiers collapse per the export: xs === sm (16) and md === lg (20).\n // The four tiers are kept so call sites stay semantic.\n icon: {\n size: { xs: number; sm: number; md: number; lg: number }\n }\n size: { xs: number; sm: number; md: number; lg: number }\n }\n}\n\n/**\n * Resolves a font family + Figma style name to the concrete native font-family\n * name the host must register \u2014 e.g. `('Inter', '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 family: string,\n styleName: FunkitFontStyleName,\n): string {\n return `${family}-${styleName}`\n}\n\n/** Figma font-style name \u2192 CSS numeric weight (for the Swapped WebView / RN `fontWeight`). */\nexport const FONT_STYLE_CSS_WEIGHT: Record<\n FunkitFontStyleName,\n TextStyle['fontWeight']\n> = {\n Regular: '400',\n Medium: '500',\n}\n\nexport const lightTokens: FunkitTokens = {\n background: {\n modal: '#FFFFFF',\n secondary: '#F9F9F9',\n button: {\n primary: { default: '#0F0F0F', pressed: '#1B1B1B' },\n secondary: { default: '#F9F9F9', pressed: '#DDDDDD' },\n tertiary: { default: '#FFFFFF', pressed: '#EFEFEF' },\n icon: { default: '#FFFFFF', pressed: '#EFEFEF' },\n destructive: {\n default: '#F34126',\n pressed: '#C2341E',\n disabled: '#F34126',\n },\n },\n pill: { default: '#FFFFFF', pressed: '#EFEFEF', disabled: '#FFFFFF' },\n },\n opacity: {\n disabled: 40,\n },\n content: {\n elements: {\n primary: '#0F0F0F',\n secondary: '#6C6C6C',\n success: '#52A300',\n error: '#F34126',\n hyperlink: '#0F0F0F',\n warning: '#F97316',\n },\n button: {\n primary: { default: '#FFFFFF', loadingAlpha: '#FFFFFF4D' },\n secondary: { default: '#0F0F0F', loadingAlpha: '#0000004D' },\n tertiary: { default: '#0F0F0F' },\n icon: { default: '#6C6C6C' },\n destructive: { default: '#FFFFFF', loadingAlpha: '#FFFFFF80' },\n },\n },\n border: {\n radius: { modal: 24, element: 12, elementInner: 8, button: 999 },\n modal: { default: '#FFFFFF', weight: 1 },\n elements: {\n default: { color: '#EFEFEF', weight: 1 },\n selected: { color: '#0F0F0F', weight: 1 },\n },\n button: { primary: '#0F0F0F', secondary: '#F9F9F9', weight: 0 },\n },\n font: {\n body: {\n family: 'Inter',\n weight: { base: 'Regular', medium: 'Medium' },\n size: { base: 16, detail: 14 },\n leading: { base: 22, detail: 20 },\n },\n header: {\n family: 'Inter',\n weight: 'Medium',\n alignment: 'Center',\n size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 },\n },\n },\n spacing: {\n padding: {\n elements: { horizontal: 12 },\n modal: { horizontal: 16 },\n },\n heights: { topBar: 56, button: 42 },\n },\n brand: {\n primary: '#0F0F0F',\n },\n button: {\n icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },\n size: { xs: 36, sm: 40, md: 48, lg: 56 },\n },\n}\n\nexport const darkTokens: FunkitTokens = {\n background: {\n modal: '#0F0F0F',\n secondary: '#1B1B1B',\n button: {\n primary: { default: '#FFFFFF', pressed: '#F9F9F9' },\n secondary: { default: '#1B1B1B', pressed: '#2D2D2D' },\n tertiary: { default: '#1B1B1B', pressed: '#2D2D2D' },\n icon: { default: '#0F0F0F', pressed: '#1B1B1B' },\n destructive: {\n default: '#DB3B22',\n pressed: '#F34126',\n disabled: '#DB3B22',\n },\n },\n pill: { default: '#0F0F0F', pressed: '#1B1B1B', disabled: '#0F0F0F' },\n },\n opacity: {\n disabled: 40,\n },\n content: {\n elements: {\n primary: '#FFFFFF',\n secondary: '#929292',\n success: '#52A300',\n error: '#F34126',\n hyperlink: '#FFFFFF',\n warning: '#F97316',\n },\n button: {\n primary: { default: '#000000', loadingAlpha: '#0000004D' },\n secondary: { default: '#F9F9F9', loadingAlpha: '#FFFFFF4D' },\n tertiary: { default: '#F9F9F9' },\n icon: { default: '#929292' },\n destructive: { default: '#FFFFFF', loadingAlpha: '#FFFFFF80' },\n },\n },\n border: {\n radius: { modal: 24, element: 12, elementInner: 8, button: 999 },\n modal: { default: '#1B1B1B', weight: 1 },\n elements: {\n default: { color: '#2D2D2D', weight: 1 },\n selected: { color: '#FFFFFF', weight: 1 },\n },\n button: { primary: '#FFFFFF', secondary: '#1B1B1B', weight: 0 },\n },\n font: {\n body: {\n family: 'Inter',\n weight: { base: 'Regular', medium: 'Medium' },\n size: { base: 16, detail: 14 },\n leading: { base: 22, detail: 20 },\n },\n header: {\n family: 'Inter',\n weight: 'Medium',\n alignment: 'Center',\n size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 },\n },\n },\n spacing: {\n padding: {\n elements: { horizontal: 12 },\n modal: { horizontal: 16 },\n },\n heights: { topBar: 56, button: 42 },\n },\n brand: {\n primary: '#0F0F0F',\n },\n button: {\n icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },\n size: { xs: 36, sm: 40, md: 48, lg: 56 },\n },\n}\n", "import { createTheme } from '@shopify/restyle'\n\nimport { buildFunkitTheme } from './buildFunkitTheme'\nimport { type FunkitTokens, darkTokens, lightTokens } from './tokens'\n\n/**\n * Wraps the pure {@link buildFunkitTheme} projection in Restyle's `createTheme`.\n * All the real work \u2014 mirroring the Fun Variables Figma groups onto the theme \u2014\n * lives in `buildFunkitTheme`; this is just the thin Restyle boundary so the\n * projection stays testable without Restyle's react-native imports.\n */\nexport function toRestyleTheme(tokens: FunkitTokens) {\n return createTheme(buildFunkitTheme(tokens))\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 Variables Light/Dark tokens. */\nexport const defaultLightTheme = toRestyleTheme(lightTokens)\nexport const defaultDarkTheme = toRestyleTheme(darkTokens)\n", "import type { TextStyle } from 'react-native'\n\nimport {\n FONT_STYLE_CSS_WEIGHT,\n type FunkitFontStyleName,\n type FunkitTokens,\n fontFamilyForWeight,\n} from './tokens'\n\n// A resolved text cut: the native family (weight baked into the name, see\n// `fontFamilyForWeight`) plus the numeric weight kept for the Swapped WebView\n// (CSS) theme and the system-font fallback.\nfunction cut(family: string, styleName: FunkitFontStyleName) {\n return {\n fontFamily: fontFamilyForWeight(family, styleName),\n fontWeight: FONT_STYLE_CSS_WEIGHT[styleName],\n }\n}\n\n/**\n * Projects the nested Fun Variables {@link FunkitTokens} onto the object\n * `@shopify/restyle`'s `createTheme` consumes \u2014 kept as a pure function (no\n * Restyle import) so tests can build the theme without pulling Restyle's\n * react-native Flow source into the node env.\n *\n * The design deliberately DOESN'T use Restyle's `colors` prop system: `colors`\n * is empty and components read colors straight from the Figma-shaped groups\n * (`theme.background.button.primary.default`, `theme.content.elements.primary`,\n * \u2026) via `useTheme()`, so the theme stays a faithful mirror of Figma. Only the\n * non-color numeric buckets Restyle genuinely needs (`spacing`, `borderRadii`,\n * `borderWidths`, `sizes`, `breakpoints`) are projected onto its reserved keys.\n */\nexport function buildFunkitTheme(tokens: FunkitTokens) {\n const { font } = tokens\n const base = cut(font.body.family, font.body.weight.base)\n const medium = cut(font.body.family, font.body.weight.medium)\n const header = cut(font.header.family, font.header.weight)\n const headerAlign =\n font.header.alignment.toLowerCase() as TextStyle['textAlign']\n\n return {\n // Restyle's BaseTheme requires `colors`; intentionally empty \u2014 see above.\n colors: {},\n\n // \u2500\u2500 Figma variable groups, verbatim \u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 background: tokens.background,\n content: tokens.content,\n border: tokens.border,\n brand: tokens.brand,\n opacity: tokens.opacity,\n font: tokens.font,\n\n // \u2500\u2500 Non-color numeric buckets projected onto Restyle's reserved keys \u2500\n spacing: {\n none: 0,\n elementsHorizontal: tokens.spacing.padding.elements.horizontal,\n modalHorizontal: tokens.spacing.padding.modal.horizontal,\n },\n borderRadii: {\n modal: tokens.border.radius.modal,\n element: tokens.border.radius.element,\n elementInner: tokens.border.radius.elementInner,\n button: tokens.border.radius.button,\n // Structural (no Figma token): fully-circular avatars / icon wells.\n rounded: 999,\n },\n borderWidths: {\n modal: tokens.border.modal.weight,\n elementsDefault: tokens.border.elements.default.weight,\n elementsSelected: tokens.border.elements.selected.weight,\n button: tokens.border.button.weight,\n },\n sizes: {\n topBar: tokens.spacing.heights.topBar,\n buttonHeight: tokens.spacing.heights.button,\n buttonXs: tokens.button.size.xs,\n buttonSm: tokens.button.size.sm,\n buttonMd: tokens.button.size.md,\n buttonLg: tokens.button.size.lg,\n iconXs: tokens.button.icon.size.xs,\n iconSm: tokens.button.icon.size.sm,\n iconMd: tokens.button.icon.size.md,\n iconLg: tokens.button.icon.size.lg,\n },\n breakpoints: {\n phone: 0,\n tablet: 768,\n },\n\n // Text variants carry no `color` (Restyle colors is unused); the `Text`\n // component defaults the color from `content/elements/*` and callers\n // override per-node via `style`.\n textVariants: {\n defaults: {\n ...base,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n body: {\n ...base,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n bodyMedium: {\n ...medium,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n detail: {\n ...base,\n fontSize: font.body.size.detail,\n lineHeight: font.body.leading.detail,\n },\n headerTitle: {\n ...header,\n fontSize: font.header.size.title,\n textAlign: headerAlign,\n },\n headerSubtitle: {\n ...header,\n fontSize: font.header.size.subtitle,\n textAlign: headerAlign,\n },\n amountInput: {\n ...medium,\n fontSize: font.header.size.amountInput,\n },\n amountSummary: {\n ...medium,\n fontSize: font.header.size.amountSummary,\n },\n },\n // Per-weight `{ fontFamily, fontWeight }` the `Text` `weight` prop applies on\n // top of any variant (both are required for custom fonts \u2014 see\n // `fontFamilyForWeight`).\n textWeights: {\n base,\n medium,\n },\n }\n}\n", "import { type FunkitTheme, toRestyleTheme } from './toRestyleTheme'\nimport { type FunkitTokens, darkTokens, lightTokens } from './tokens'\n\n/** Recursive partial \u2014 every group/leaf of the nested token tree is optional. */\ntype DeepPartial<T> = T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T\n\n/**\n * A deep-partial override of the nested Fun Variables {@link FunkitTokens}\n * groups. Pass to {@link lightTheme} / {@link darkTheme} to restyle only the\n * leaves a brand changes (`background` / `content` / `border` / `brand` / \u2026);\n * anything omitted keeps the base token's value.\n */\nexport type FunkitTokensOverride = DeepPartial<FunkitTokens>\n\n/** A mergeable plain object \u2014 not null, not an array. */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/**\n * Deep-merge `override` onto a deep *clone* of `base`. The result shares no\n * object references with `base`, so the built-in tokens are never aliased into a\n * theme \u2014 and thus can't be mutated through one. Non-object values (and arrays)\n * replace the base value whole.\n */\nfunction deepMerge<T>(base: T, override?: DeepPartial<T>): T {\n if (!isPlainObject(base)) {\n return override === undefined ? base : (override as T)\n }\n const source: Record<string, unknown> = isPlainObject(override)\n ? override\n : {}\n const cloned: Record<string, unknown> = {}\n for (const key of Object.keys(base)) {\n cloned[key] = deepMerge(base[key], source[key])\n }\n return cloned as T\n}\n\n/**\n * Build a light {@link FunkitTheme}, deep-merging an optional brand override\n * onto the SDK's `lightTokens`. A brand specifies only the leaves it changes \u2014\n * the design defines `default` / `pressed` states \u2014 and everything else keeps\n * the default value. Called with no argument it returns the default light theme.\n *\n * @example\n * const theme = lightTheme({\n * background: { button: { primary: { default: '#1e3b25', pressed: '#264e30' } } },\n * brand: { primary: '#1e3b25' },\n * })\n */\nexport function lightTheme(override?: FunkitTokensOverride): FunkitTheme {\n return toRestyleTheme(deepMerge(lightTokens, override))\n}\n\n/**\n * Build a dark {@link FunkitTheme}, deep-merging an optional brand override onto\n * the SDK's `darkTokens`. See {@link lightTheme}. For a dark-only brand, call\n * this once and reuse the theme for both `light` and `dark`.\n */\nexport function darkTheme(override?: FunkitTokensOverride): FunkitTheme {\n return toRestyleTheme(deepMerge(darkTokens, override))\n}\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, variant, 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 // Text color isn't a Restyle color prop \u2014 the theme has no `colors` bucket;\n // colors live under the Figma groups. Default it here from `content/elements`\n // by variant (detail/subtitle are secondary, the rest primary); an explicit\n // `style` color still wins. `?.` guards mocked themes.\n const elements = theme.content?.elements\n const secondary = variant === 'detail' || variant === 'headerSubtitle'\n const colorStyle = elements\n ? { color: secondary ? elements.secondary : elements.primary }\n : undefined\n return createElement(RestyleText, {\n ref,\n variant,\n style: [colorStyle, weightStyle, 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, type ViewStyle } from 'react-native'\nimport Animated, { Easing, FadeOutUp, Keyframe } from 'react-native-reanimated'\n\nimport { FigmaSuccessCheckIcon } from '../icons/FigmaSystemIcons'\nimport { Text, useTheme } from '../theme/restyle'\n\n/**\n * The \"Address copied\" confirmation pill (Figma: Fun Mobile deposit toast). A\n * rounded pill with the label + a green success check. Surface + label track the\n * theme (`background/pill/default`, `content/elements/primary` via the medium\n * body cut) so it themes with light/dark; only the layout + soft shadow are\n * static (h42, px16, radius999, gap6).\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 const theme = useTheme()\n return (\n <Animated.View\n entering={enterAnimation}\n exiting={exitAnimation}\n style={[styles.pill, { backgroundColor: theme.background.pill.default }]}\n accessibilityRole=\"alert\"\n accessibilityLabel={label}\n >\n <Text variant=\"bodyMedium\">{label}</Text>\n <FigmaSuccessCheckIcon size={16} />\n </Animated.View>\n )\n}\n\n// Layout + soft shadow only \u2014 the surface color comes from the theme's\n// `background/pill/default` token, applied inline above.\nconst pill: ViewStyle = {\n height: 42,\n paddingHorizontal: 16,\n borderRadius: 999,\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}\n\nconst styles = StyleSheet.create({ pill })\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.content.elements.primary\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\nconst ALERT_CIRCLE_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 22.21 22.19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.0993 22.1908C9.5667 22.1908 8.1308 21.9008 6.7916 21.3207C5.4524 20.7478 4.2744 19.9529 3.2575 18.9359C2.2405 17.919 1.442 16.741 0.862 15.4018C0.289 14.0626 0.0026 12.6267 0.0026 11.0941C0.0026 9.5616 0.289 8.1257 0.862 6.7865C1.442 5.4402 2.2405 4.2621 3.2575 3.2523C4.2744 2.2354 5.4524 1.4405 6.7916 0.8676C8.1308 0.2875 9.5667 -0.0025 11.0993 -0.0025C12.6318 -0.0025 14.0677 0.2875 15.4069 0.8676C16.7532 1.4405 17.9349 2.2354 18.9518 3.2523C19.9687 4.2621 20.7636 5.4402 21.3366 6.7865C21.9166 8.1257 22.2067 9.5616 22.2067 11.0941C22.2067 12.6267 21.9166 14.0626 21.3366 15.4018C20.7636 16.741 19.9687 17.919 18.9518 18.9359C17.9349 19.9529 16.7532 20.7478 15.4069 21.3207C14.0677 21.9008 12.6318 22.1908 11.0993 22.1908ZM11.11 12.9525C11.7474 12.9525 12.0732 12.6195 12.0875 11.9535L12.2594 6.5609C12.2737 6.2315 12.1699 5.963 11.9479 5.7553C11.7259 5.5404 11.443 5.433 11.0993 5.433C10.7483 5.433 10.4655 5.5404 10.2506 5.7553C10.0358 5.963 9.9355 6.2279 9.9498 6.5502L10.1002 11.9643C10.1217 12.6231 10.4583 12.9525 11.11 12.9525ZM11.11 16.6479C11.4681 16.6479 11.776 16.5333 12.0338 16.3041C12.2916 16.0749 12.4205 15.7813 12.4205 15.4232C12.4205 15.0723 12.2916 14.7787 12.0338 14.5424C11.776 14.3061 11.4681 14.1879 11.11 14.1879C10.7448 14.1879 10.4332 14.3061 10.1754 14.5424C9.9176 14.7787 9.7887 15.0723 9.7887 15.4232C9.7887 15.7813 9.9176 16.0749 10.1754 16.3041C10.4404 16.5333 10.7519 16.6479 11.11 16.6479Z\" fill=\"currentColor\"/></svg>'\n\nexport function FigmaAlertCircleIcon({ size = 22, color }: IconProps) {\n return renderIcon(ALERT_CIRCLE_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'\nimport { SafeAreaProvider } from 'react-native-safe-area-context'\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// Metro's debug-build global; `typeof`-probed so non-RN runtimes (tests, SSR)\n// resolve to false. Declared locally \u2014 this tsconfig loads only node types.\ndeclare const __DEV__: boolean | undefined\nconst IS_DEV_BUILD = typeof __DEV__ !== 'undefined' && !!__DEV__\n\n// Conservative default for the internally-created fallback client. Stock\n// react-query staleTime of 0 marks data stale immediately, so every remount\n// refetches and needlessly hits the API on mobile; a 60s floor stops that.\n// Retry is intentionally left at the react-query default \u2014 lowering it would\n// weaken flaky-network resilience (the case this SDK most needs to survive) and\n// can make the geo-compliance lookup fail closed. Hooks that need fresher or\n// staler data set their own staleTime.\nfunction createFallbackQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60_000,\n },\n },\n })\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, 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 = IS_DEV_BUILD,\n copyToClipboard,\n}: FunkitProviderProps) {\n // Stable default client when the host doesn't supply one.\n const fallbackClient = useRef<QueryClient>(undefined)\n fallbackClient.current ??= createFallbackQueryClient()\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 <SafeAreaProvider>\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 </SafeAreaProvider>\n )\n}\n", "import {\n BottomSheetBackdrop,\n BottomSheetModal,\n BottomSheetView,\n} from '@gorhom/bottom-sheet'\nimport type { SwappedFormOfPayment } from '@funkit/api-base'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\nimport { useStatsigClient } from '@statsig/react-bindings'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n type ComponentProps,\n type ReactNode,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Share, StyleSheet, View, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useCheckoutBlocked } from '../geo/useCheckoutBlocked'\nimport { PaymentMethodIcon } from '../icons/PaymentMethodIcon'\nimport { logger } from '../logging/logger'\nimport { CryptoBitcoinIcon } from '../icons/CryptoBitcoinIcon'\nimport { QrChainCluster } from '../icons/QrChainCluster'\nimport { SourceTokenCluster } from '../icons/SourceTokenCluster'\nimport { TokenChainIcon } from '../icons/TokenChainIcon'\nimport {\n type PaymentMethodOption,\n type ReceiveTokenOption,\n SelectMethodScreen,\n} from '../screens/SelectMethodScreen'\nimport { AvailableChainsScreen } from '../screens/AvailableChainsScreen'\nimport { CheckoutBlockedScreen } from '../screens/CheckoutBlockedScreen'\nimport { QrCodeScreen } from '../screens/QrCodeScreen'\nimport { TransferCryptoScreen } from '../screens/TransferCryptoScreen'\nimport { WithdrawMethodScreen } from '../screens/WithdrawMethodScreen'\nimport { SwappedScreen } from '../swapped/SwappedScreen'\nimport { SwappedWithdrawScreen } from '../swapped/SwappedWithdrawScreen'\nimport {\n EVM_NETWORK_ID,\n belongsToNetwork,\n buildAvailableChains,\n buildDepositNetworks,\n isNonEvmChainId,\n} from '../transfer/availableChains'\nimport {\n type ClipboardWriter,\n copyToClipboard as defaultCopyToClipboard,\n} from '../transfer/clipboard'\nimport { toFopRows, toWithdrawFopRows } from '../transfer/fops'\nimport { formatDepositAddress } from '../transfer/formatDepositAddress'\nimport { useFiatExchangeRates } from '../transfer/hooks/useFiatExchangeRates'\nimport { useFops } from '../transfer/hooks/useFops'\nimport {\n WITHDRAW_FOPS_QUERY_KEY,\n useWithdrawalFops,\n} from '../transfer/hooks/useWithdrawalFops'\nimport { useWithdrawalExecution } from '../withdrawal/useWithdrawalExecution'\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, FlowSheetBackground } from './FlowSheet'\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from './withdrawalFlowConfig'\n\ntype FlowScreen = 'addMoney' | 'transfer' | 'swapped' | 'withdrawMethod'\n\n/** Screens presented as a nested sheet on top of the current FlowScreen. */\ntype NestedScreen = 'availableChains' | 'qrCode'\n\n/**\n * The open flow's mode + its config/callbacks, as a discriminated union so\n * deposit and withdrawal state can't cross-contaminate (a `beginDeposit` after\n * a withdrawal fully replaces the slot, and vice versa).\n */\ntype ActiveFlow =\n | {\n mode: 'deposit'\n config: DepositFlowConfig\n callbacks: DepositFlowCallbacks\n }\n | {\n mode: 'withdrawal'\n config: WithdrawalFlowConfig\n callbacks: WithdrawalFlowCallbacks\n }\n\ninterface FlowState {\n isOpen: boolean\n stack: FlowScreen[]\n flow: ActiveFlow | null\n /**\n * Bumped on every `begin*`. 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 flow: null,\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 /** Open the managed withdrawal flow at the payout-method screen. */\n beginWithdrawal: (\n config: WithdrawalFlowConfig,\n callbacks?: WithdrawalFlowCallbacks,\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 /** Replace the whole stack with a single screen (never closes the sheet). */\n reset: (s: FlowScreen) => 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 insets = useSafeAreaInsets()\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 flow: { mode: 'deposit', config, callbacks },\n session: prev.session + 1,\n }))\n },\n [],\n )\n\n const beginWithdrawal = useCallback(\n (config: WithdrawalFlowConfig, callbacks: WithdrawalFlowCallbacks = {}) => {\n callbacks.onOpen?.()\n setState((prev) => ({\n isOpen: true,\n stack: ['withdrawMethod'],\n flow: { mode: 'withdrawal', config, 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.flow?.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 reset = useCallback((screen: FlowScreen) => {\n setState((prev) => (prev.isOpen ? { ...prev, stack: [screen] } : prev))\n }, [])\n\n const back = useCallback(() => {\n setState((prev) => {\n if (!prev.isOpen) return prev\n if (prev.stack.length <= 1) {\n prev.flow?.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, beginWithdrawal, closeFlow }),\n [beginDeposit, beginWithdrawal, closeFlow],\n )\n\n const current = state.stack[state.stack.length - 1]\n const nav = useMemo<FlowNav>(\n () => ({ navigate, back, reset, closeFlow }),\n [navigate, back, reset, 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 flow queries run only then.\n state.isOpen && state.flow ? (\n state.flow.mode === 'deposit' ? (\n <FlowContent\n config={state.flow.config}\n current={current}\n nav={nav}\n copyToClipboard={copyToClipboard}\n onCopySuccess={showCopiedToast}\n callbacks={state.flow.callbacks}\n />\n ) : (\n <WithdrawalFlowContent\n config={state.flow.config}\n callbacks={state.flow.callbacks}\n current={current}\n nav={nav}\n />\n )\n ) : null\n }\n >\n {children}\n </FlowSheet>\n {toastMounted ? (\n <View\n style={[\n toastOverlay,\n { paddingTop: insets.top + TOAST_INSET_OFFSET },\n ]}\n pointerEvents=\"none\"\n >\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 // Only cash rows show a converted limit; skip the fetch when Swapped is off.\n const { data: exchangeRates } = useFiatExchangeRates(isSwappedEnabled)\n\n // Statsig readiness gates the Add money skeleton: until it resolves,\n // `isSwappedEnabled` reads its `false` fallback (see the `loading` prop below).\n const { isLoading: isStatsigLoading } = useStatsigClient()\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 // \u2500\u2500 Nested sheet \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // A single BottomSheetModal whose content is driven by `nestedScreen`.\n // Swiping it down reveals the parent FlowScreen instead of closing the\n // entire flow. Adding a new overlay screen is one type-union member + one\n // content branch.\n const nestedSheetRef = useRef<BottomSheetModal>(null)\n const [nestedScreen, setNestedScreen] = useState<NestedScreen | null>(null)\n const openNestedScreen = useCallback((screen: NestedScreen) => {\n setNestedScreen(screen)\n }, [])\n useEffect(() => {\n if (nestedScreen) {\n nestedSheetRef.current?.present()\n }\n }, [nestedScreen])\n const closeNestedScreen = useCallback(() => {\n nestedSheetRef.current?.dismiss()\n }, [])\n const renderNestedBackdrop = 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 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, exchangeRates).map((row, i) => ({\n id: row.id,\n title: row.name,\n subtitle: row.subtitle,\n icon: <PaymentMethodIcon fop={fops[i]} />,\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 <SelectMethodScreen\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), the deposit-address / QR\n // generation (so Transfer/QR open with a ready address, not\n // \"Generating\u2026\"), and Statsig init \u2014 while it's loading,\n // `isSwappedEnabled` reads its `false` fallback (indistinguishable\n // from a genuinely-off gate), so we must hold on `isStatsigLoading`\n // directly rather than let the `isSwappedEnabled` guard flash the\n // crypto-only list.\n loading={\n isLoadingGeoCheck ||\n isAddressLoading ||\n isStatsigLoading ||\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 ? () => openNestedScreen('availableChains')\n : undefined\n }\n onShowQrCode={() => openNestedScreen('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 '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 const bottomSheetScreen = ((): ReactNode => {\n switch (nestedScreen) {\n case 'availableChains':\n return (\n <AvailableChainsScreen\n networkLabel={selectedChain?.label ?? ''}\n chains={availableChains}\n onClose={closeNestedScreen}\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={closeNestedScreen}\n />\n )\n default:\n return null\n }\n })()\n\n if (isGeoblocked) {\n return <CheckoutBlockedScreen />\n }\n\n return (\n <>\n {screen}\n <BottomSheetModal\n ref={nestedSheetRef}\n enableDynamicSizing\n handleComponent={undefined}\n backgroundComponent={FlowSheetBackground}\n backdropComponent={renderNestedBackdrop}\n onDismiss={() => setNestedScreen(null)}\n >\n <BottomSheetView>{bottomSheetScreen}</BottomSheetView>\n </BottomSheetModal>\n </>\n )\n}\n\n/**\n * The live withdrawal-flow body (Swapped fiat offramp): payout-method list \u2192\n * the Swapped sell embed \u2192 on a validated order, the on-chain leg\n * ({@link useWithdrawalExecution}) delivers the exact ordered amount to\n * Swapped's deposit address through the host wallet. Sibling of\n * {@link FlowContent}, mounted only while a withdrawal flow is open so its\n * queries run only then.\n */\nfunction WithdrawalFlowContent({\n config,\n callbacks,\n current,\n nav,\n}: {\n config: WithdrawalFlowConfig\n callbacks: WithdrawalFlowCallbacks\n current: FlowScreen | undefined\n nav: FlowNav\n}): ReactNode {\n const { isGeoblocked, isLoadingGeoCheck } = useCheckoutBlocked({\n onCheckoutBlocked: callbacks.onCheckoutBlocked,\n })\n const queryClient = useQueryClient()\n\n const {\n fops,\n isLoading,\n noPaymentMethodsAvailable,\n isBelowMinimumBalance,\n isError,\n refetch,\n route,\n } = useWithdrawalFops({ config })\n\n // The payout method the user picked (the whole FOP \u2014 the embed URL drives\n // the Swapped screen; type/name feed the decision-point log).\n const [selectedFop, setSelectedFop] = useState<SwappedFormOfPayment>()\n\n // Unrecoverable execution failure \u2014 replaces the embed with a retryable\n // error state (web parity: the iframe controller's error branch).\n const [hasExecutionError, setHasExecutionError] = useState(false)\n\n // Stable so it doesn't rebuild `executeOrder` (it's in that useCallback's deps).\n const onExecutionError = useCallback(() => setHasExecutionError(true), [])\n const { executeOrder } = useWithdrawalExecution({\n config,\n route,\n callbacks,\n onError: onExecutionError,\n })\n\n // The embed's method list can go stale while it's open (web parity: the\n // controller invalidates on back/new-withdrawal/success).\n const invalidateWithdrawFops = useCallback(() => {\n void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] })\n }, [queryClient])\n\n if (isGeoblocked) {\n return <CheckoutBlockedScreen />\n }\n\n if (hasExecutionError) {\n return (\n <WithdrawMethodScreen\n title={config.title}\n methods={[]}\n hasError\n onRetry={() => {\n setHasExecutionError(false)\n invalidateWithdrawFops()\n // Reset to the method list \u2014 `back()` would close the whole sheet if\n // the user had already popped the embed before execution failed.\n nav.reset('withdrawMethod')\n }}\n onSelectMethod={() => undefined}\n />\n )\n }\n\n switch (current) {\n case 'withdrawMethod': {\n // Id by array index, not `<fopType>:<name>` \u2014 Swapped can return two\n // methods that share both yet carry distinct `embeddedFlowUrl`s, so a\n // key-based lookup could open the wrong payout embed. Rows are positional\n // 1:1 with `fops`, so the index resolves the exact selected FOP.\n const methods: PaymentMethodOption[] = toWithdrawFopRows(fops).map(\n (row, i) => ({\n id: String(i),\n title: row.name,\n subtitle: row.subtitle,\n icon: <PaymentMethodIcon fop={fops[i]} />,\n }),\n )\n return (\n <WithdrawMethodScreen\n title={config.title}\n methods={methods}\n loading={isLoadingGeoCheck || isLoading}\n hasError={isError}\n onRetry={refetch}\n // Gate confirmed off, or Swapped returned no methods for this\n // region/token \u2014 never during a transient load (see `noPaymentMethodsAvailable`).\n isEmpty={noPaymentMethodsAvailable}\n // Balance below Swapped's minimum sell \u2014 distinct terminal message.\n isBelowMinimum={isBelowMinimumBalance}\n onSelectMethod={(id) => {\n const fop = fops[Number(id)]\n if (!fop?.embeddedFlowUrl) return\n // Payout-provider decision point.\n logger.info('connect-rn:withdrawal:method_selected', {\n fopType: fop.fopType,\n fopName: fop.name,\n })\n setSelectedFop(fop)\n nav.navigate('swapped')\n }}\n />\n )\n }\n case 'swapped':\n return selectedFop?.embeddedFlowUrl ? (\n <SwappedWithdrawScreen\n url={selectedFop.embeddedFlowUrl}\n onBack={() => {\n invalidateWithdrawFops()\n nav.back()\n }}\n onClose={() => {\n invalidateWithdrawFops()\n nav.closeFlow()\n }}\n onNewWithdrawal={() => {\n invalidateWithdrawFops()\n nav.back()\n }}\n onWithdrawalSuccess={(data) => {\n invalidateWithdrawFops()\n callbacks.onWithdrawalSuccess?.(data)\n }}\n onOrderData={(order) => {\n // The host notification is informational \u2014 a throw from it must not\n // skip the on-chain execution (the critical leg for this order).\n try {\n callbacks.onWithdrawalOrder?.(order)\n } catch (error) {\n logger.warn('connect-rn:withdrawal:order_callback_threw', {\n order_id: order.order_id,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n void executeOrder(order)\n }}\n />\n ) : null\n default:\n return null\n }\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\nconst TOAST_INSET_OFFSET = 20\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.\n// paddingTop is set inline via `useSafeAreaInsets` (insets.top + 20).\nconst toastOverlay: ViewStyle = {\n ...StyleSheet.absoluteFill,\n zIndex: 1,\n alignItems: 'center',\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 {\n type DynamicConfigName,\n type DynamicConfigValue,\n useDynamicConfig as useCoreDynamicConfig,\n} from '@funkit/connect-core'\n\nimport { useUserIpInfo } from '../geo/useUserIpInfo'\n\n// RN counterpart of `@funkit/connect`'s `hooks/statsig/useDynamicConfig`. The\n// core hook takes `countryCode` as a parameter so it stays platform-agnostic;\n// this wrapper threads the user's IP-derived `alpha2` (Moonpay/ipapi) so\n// country-conditional variant configs (e.g. `enableswappeddeposit`) resolve\n// against the real region instead of falling to their default branch.\nexport type { DynamicConfigName, DynamicConfigValue }\n\nexport const useDynamicConfig = <Name extends DynamicConfigName>(\n name: Name,\n options?: {\n bypassCountryCode?: boolean\n },\n): DynamicConfigValue<Name> => {\n const { userIpInfo } = useUserIpInfo()\n return useCoreDynamicConfig(name, {\n bypassCountryCode: options?.bypassCountryCode,\n countryCode: userIpInfo?.alpha2,\n })\n}\n", "import { useUserIpInfo as useCoreUserIpInfo } from '@funkit/connect-core'\n\nimport { logger } from '../logging/logger'\n\n// Re-exported so existing RN importers (isCountryBlocked, the flow hooks, tests)\n// keep their type source unchanged after the fetch logic moved to core.\nexport type {\n FunkitUserIpInfo,\n UseUserIpInfoResult,\n} from '@funkit/connect-core'\n\n// Thin RN wrapper over the shared core `useUserIpInfo` (V1 PR13 moved the\n// Moonpay\u2192ipapi fetch logic there so web and RN don't duplicate it). RN is\n// login-agnostic, so the lookup always runs (`enabled: true`); web's wrapper\n// gates on `isUserLoggedIn` instead.\nexport function useUserIpInfo() {\n // Login-agnostic + session-stable: always run, never go stale.\n return useCoreUserIpInfo({\n logger,\n enabled: true,\n staleTime: Number.POSITIVE_INFINITY,\n })\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 // BigInt-safe: log context may carry bigints (relay-sdk quote/step\n // amounts) that plain JSON.stringify throws on \u2014 and flush() can run\n // synchronously inside a caller's log(). Coerce bigints to strings.\n body: JSON.stringify(batch, (_key, value) =>\n typeof value === 'bigint' ? value.toString() : value,\n ),\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 { useEffect, useMemo } from 'react'\nimport { useEffectEvent } from '@funkit/connect-core'\n\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\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 { 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 type { SwappedFormOfPayment } from '@funkit/api-base'\nimport { getSwappedIcon, isSavedFormOfPaymentType } from '@funkit/connect-core'\n\nimport { useFunkitColorScheme } from '../theme/FunkitThemeProvider'\nimport { FALLBACK_ASSET_LOGO } from './assetLogos'\nimport { FunIcon } from './FunIcon'\nimport {\n JcbIcon,\n MastercardIcon,\n UnionPayIcon,\n VisaIcon,\n} from './PaymentBrandIcons'\n\n// RN can't render the CDN card-brand logos (embedded-raster SVGs), so use local\n// vectors where we have them and fall back to this generic glyph otherwise.\nconst CARD_ICON = 'https://sdk-cdn.fun.xyz/images/swapped/card-payment.svg'\n\n// Local brand vectors, keyed by the normalized cardBrand (spaces\u2192_, lowercased)\n// to match SWAPPED_CARD_BRANDS. Cartes Bancaires is intentionally absent \u2014 its\n// only logo is a raster inside an SVG <pattern> RN can't draw, so it falls back\n// to the generic card glyph.\nconst BRAND_ICONS: Record<string, typeof MastercardIcon> = {\n mastercard: MastercardIcon,\n visa: VisaIcon,\n jcb: JcbIcon,\n unionpay: UnionPayIcon,\n}\n\nconst genericCardIcon = (isDarkMode: boolean) =>\n isDarkMode ? CARD_ICON.replace('.svg', '-light.svg') : CARD_ICON\n\nexport function PaymentMethodIcon({ fop }: { fop: SwappedFormOfPayment }) {\n const isDarkMode = useFunkitColorScheme().colorScheme === 'dark'\n if (isSavedFormOfPaymentType(fop)) {\n const BrandIcon =\n BRAND_ICONS[fop.cardBrand.replace(/ /g, '_').toLowerCase()]\n if (BrandIcon) {\n return <BrandIcon size={32} />\n }\n return (\n <FunIcon\n uri={genericCardIcon(isDarkMode)}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n )\n }\n return (\n <FunIcon\n uri={getSwappedIcon(fop, isDarkMode)}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n )\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 { useEffect, useState } from 'react'\nimport { Image, type ViewStyle } from 'react-native'\nimport { SvgXml } from 'react-native-svg'\n\nimport { Box, useTheme } 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 const theme = useTheme()\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 style={[\n clip,\n { backgroundColor: ready ? undefined : theme.background.secondary },\n ]}\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 { SvgXml } from 'react-native-svg'\n\nimport { useTheme } from '../theme/restyle'\n\n/**\n * Payment-method brand glyphs for the \"Add money\" funding-source picker (Figma:\n * Fun Mobile / Add money, node 11202:8263). Each is a byte-for-byte SVG export\n * from that Figma frame \u2014 Mastercard keeps its brand colors; the monochrome\n * marks (Apple, Revolut, Bank, Crypto) swap their fill/stroke to the theme's\n * primary content color so they track light/dark. Host apps may pass their own\n * brand icons instead; these are the package's design-matched defaults used by\n * the stories.\n */\n\ntype BrandIconProps = {\n /** Glyph box size in px (the leading slot centers it). */\n size?: number\n /** Override the monochrome color; defaults to the theme primary. */\n color?: string\n}\n\nfunction useGlyphColor(color?: string) {\n const theme = useTheme()\n return color ?? theme.content.elements.primary\n}\n\n// Mastercard: the two interlocking circles (red / amber + overlap), drawn at the\n// Figma 24\u00D718 aspect. Brand colors are fixed (not themed).\nconst MASTERCARD_SVG =\n '<svg width=\"24\" height=\"18\" viewBox=\"0 0 24 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"8.5\" cy=\"9\" r=\"7.5\" fill=\"#EB001B\"/><circle cx=\"15.5\" cy=\"9\" r=\"7.5\" fill=\"#F79E1B\"/><path d=\"M12 3.3A7.49 7.49 0 0 1 12 14.7 7.49 7.49 0 0 1 12 3.3Z\" fill=\"#FF5F00\"/></svg>'\n\n// Apple logo (Figma node 788:9641), rendered in the theme primary color.\nconst APPLE_SVG =\n '<svg width=\"11.7334\" height=\"14.4\" viewBox=\"0 0 11.7334 14.4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.63605 6.48119e-06C8.66955 6.48119e-06 8.70304 6.48119e-06 8.73843 6.48119e-06C8.82059 1.01552 8.43319 1.77432 7.96236 2.32381C7.50039 2.86951 6.86777 3.39877 5.8446 3.31846C5.77635 2.31749 6.16438 1.61497 6.63457 1.06674C7.07064 0.555823 7.87009 0.101179 8.63605 6.48119e-06Z\" fill=\"currentColor\"/><path d=\"M11.7334 10.57C11.7334 10.5801 11.7334 10.589 11.7334 10.5984C11.4459 11.4698 11.0357 12.2166 10.5352 12.9096C10.0783 13.5388 9.51835 14.3854 8.51856 14.3854C7.65465 14.3854 7.08081 13.8296 6.1954 13.8145C5.25881 13.7993 4.74375 14.2792 3.88741 14.4C3.78946 14.4 3.6915 14.4 3.59544 14.4C2.96662 14.3089 2.45914 13.8107 2.08943 13.3617C0.999267 12.0351 0.156839 10.3215 0.000107765 8.12857C0.000107765 7.91357 0.000107765 7.69922 0.000107765 7.48422C0.0664656 5.91479 0.828633 4.63875 1.8417 4.02033C2.37635 3.69152 3.11134 3.4114 3.92976 3.5366C4.28051 3.59098 4.63884 3.71112 4.95293 3.83C5.25059 3.94445 5.62283 4.14743 5.97548 4.13668C6.21436 4.12972 6.45199 4.00516 6.69277 3.91726C7.39806 3.66243 8.08945 3.3703 9.00076 3.50751C10.096 3.67318 10.8733 4.16008 11.3536 4.91128C10.4271 5.50124 9.69468 6.3903 9.81981 7.90852C9.93104 9.28762 10.7324 10.0945 11.7334 10.57Z\" fill=\"currentColor\"/></svg>'\n\n// Revolut \"R\" wordmark (Figma node 823426821), theme-colored.\nconst REVOLUT_SVG =\n '<svg width=\"15.9174\" height=\"20\" viewBox=\"0 0 15.9174 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.7156 4.90723H0V19.9531H3.7156V4.90723Z\" fill=\"currentColor\"/><path d=\"M15.4128 5.77982C15.4128 2.56881 12.7982 0 9.63303 0H0V3.21101H9.12844C10.5963 3.21101 11.789 4.3578 11.789 5.73395C11.789 6.42202 11.5596 7.11009 11.055 7.61468C10.5505 8.11927 9.90826 8.3945 9.22018 8.3945H5.6422C5.50459 8.3945 5.41284 8.48624 5.41284 8.62385V11.4679C5.41284 11.5138 5.41284 11.5596 5.45872 11.6055L11.5138 20H15.9174L9.90826 11.5596C12.9358 11.422 15.4128 8.85321 15.4128 5.77982Z\" fill=\"currentColor\"/></svg>'\n\n// Bitcoin \"B\" coin (Figma icon/system, node b8d97bb3), theme-colored.\nconst CRYPTO_SVG =\n '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.5 14.25C15.5 14.9404 14.9404 15.5 14.25 15.5H10.5V13H14.25C14.9404 13 15.5 13.5596 15.5 14.25Z\" fill=\"currentColor\"/><path d=\"M13.75 8.5H10.5V11H13.75C14.4404 11 15 10.4404 15 9.75C15 9.05964 14.4404 8.5 13.75 8.5Z\" fill=\"currentColor\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM10 5C10.5523 5 11 5.44772 11 6V6.5H12V6C12 5.44772 12.4477 5 13 5C13.5523 5 14 5.44772 14 6V6.50947C15.6781 6.63713 17 8.03919 17 9.75C17 10.5009 16.7454 11.1922 16.3178 11.7425C17.0398 12.3386 17.5 13.2406 17.5 14.25C17.5 16.0449 16.0449 17.5 14.25 17.5H14V18C14 18.5523 13.5523 19 13 19C12.4477 19 12 18.5523 12 18V17.5H11V18C11 18.5523 10.5523 19 10 19C9.44772 19 9 18.5523 9 18V17.5H8C7.44772 17.5 7 17.0523 7 16.5C7 15.9477 7.44772 15.5 8 15.5H8.5V8.5H8C7.44772 8.5 7 8.05228 7 7.5C7 6.94772 7.44772 6.5 8 6.5H9V6C9 5.44772 9.44772 5 10 5Z\" fill=\"currentColor\"/></svg>'\n\n// Bank \"source-and-destination\" line glyph (Figma node a82cc93d), theme-colored.\nconst BANK_SVG =\n '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 21H21M6 18V9.99998M10 18V9.99998M14 18V9.99998M18 18V9.99998M20 6.99998L12.424 2.26498C12.2702 2.16884 12.1933 2.12077 12.1108 2.10203C12.0379 2.08546 11.9621 2.08546 11.8892 2.10203C11.8067 2.12077 11.7298 2.16884 11.576 2.26498L4 6.99998H20Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\n// Card-brand marks below keep their fixed brand colors (like Mastercard) and\n// are byte-for-byte SVG path exports. RN can render these vectors where it\n// cannot draw the CDN logos, which embed a raster inside an SVG <pattern>.\nconst VISA_SVG =\n '<svg width=\"24\" height=\"19\" viewBox=\"0 0 24 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M24 0.00405757L15.7253 19H10.3255L6.25345 3.83691C6.17546 3.09873 5.70545 2.48223 5.05208 2.17398L5.03943 2.16789C3.58936 1.48244 1.90322 0.924752 0.139106 0.573914L0 0.551607L0.122245 0.00202878H8.81426C9.99877 0.00202878 10.9831 0.835522 11.1664 1.92454L11.1685 1.93671L13.3205 12.9303L18.636 0L24 0.00405757Z\" fill=\"#1B33C3\"/></svg>'\n\nconst JCB_SVG =\n '<svg width=\"24\" height=\"19\" viewBox=\"0 0 24 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_5933_159)\"><path d=\"M23.9201 15.1208C23.9201 17.2137 22.2589 18.9179 20.2188 18.9179H0.0800781V3.8791C0.0800781 1.78623 1.7413 0.0820312 3.7814 0.0820312H23.9201V15.1208Z\" fill=\"white\"/><path d=\"M17.3625 11.264H18.8926C18.9363 11.264 19.0383 11.249 19.0821 11.249C19.3735 11.1892 19.6212 10.9201 19.6212 10.5464C19.6212 10.1876 19.3735 9.91855 19.0821 9.84381C19.0383 9.82886 18.9509 9.82886 18.8926 9.82886H17.3625V11.264Z\" fill=\"url(#paint0_linear_5933_159)\"/><path d=\"M18.7177 1.35266C17.2605 1.35266 16.0656 2.56354 16.0656 4.0734V6.89878H19.8106C19.8981 6.89878 20.0001 6.89878 20.0729 6.91373C20.9181 6.95857 21.5447 7.40705 21.5447 8.1844C21.5447 8.79731 21.1221 9.32053 20.3352 9.42517V9.45507C21.195 9.51487 21.8507 10.0082 21.8507 10.7706C21.8507 11.5928 21.1221 12.131 20.1604 12.131H16.051V17.6621H19.9418C21.399 17.6621 22.5939 16.4512 22.5939 14.9414V1.35266H18.7177Z\" fill=\"url(#paint1_linear_5933_159)\"/><path d=\"M19.4318 8.36381C19.4318 8.00504 19.1841 7.76585 18.8926 7.721C18.8635 7.721 18.7906 7.70605 18.7469 7.70605H17.3625V9.02158H18.7469C18.7906 9.02158 18.8781 9.02158 18.8926 9.00663C19.1841 8.96178 19.4318 8.72259 19.4318 8.36381Z\" fill=\"url(#paint2_linear_5933_159)\"/><path d=\"M4.0583 1.35266C2.60109 1.35266 1.40617 2.56354 1.40617 4.0734V10.7855C2.14935 11.1593 2.92168 11.3985 3.694 11.3985C4.61204 11.3985 5.10749 10.8304 5.10749 10.053V6.88383H7.38075V10.0381C7.38075 11.2639 6.63757 12.2655 4.11659 12.2655C2.58652 12.2655 1.3916 11.9217 1.3916 11.9217V17.6472H5.28236C6.73957 17.6472 7.93449 16.4363 7.93449 14.9264V1.35266H4.0583Z\" fill=\"url(#paint3_linear_5933_159)\"/><path d=\"M11.388 1.35266C9.93075 1.35266 8.73584 2.56354 8.73584 4.0734V7.63128C9.40616 7.04827 10.5719 6.67454 12.4517 6.76423C13.4572 6.80908 14.5355 7.09311 14.5355 7.09311V8.24419C13.9964 7.96016 13.3552 7.70603 12.5246 7.64623C11.0965 7.54159 10.2368 8.25914 10.2368 9.51487C10.2368 10.7855 11.0965 11.5031 12.5246 11.3835C13.3552 11.3237 13.9964 11.0546 14.5355 10.7855V11.9366C14.5355 11.9366 13.4718 12.2207 12.4517 12.2655C10.5719 12.3552 9.40616 11.9815 8.73584 11.3985V17.6771H12.6266C14.0838 17.6771 15.2787 16.4662 15.2787 14.9563V1.35266H11.388Z\" fill=\"url(#paint4_linear_5933_159)\"/></g><defs><linearGradient id=\"paint0_linear_5933_159\" x1=\"16.0632\" y1=\"10.5482\" x2=\"22.6115\" y2=\"10.5482\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint1_linear_5933_159\" x1=\"16.063\" y1=\"9.50087\" x2=\"22.6118\" y2=\"9.50087\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint2_linear_5933_159\" x1=\"16.063\" y1=\"8.36194\" x2=\"22.6116\" y2=\"8.36194\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint3_linear_5933_159\" x1=\"1.40309\" y1=\"9.50086\" x2=\"8.05279\" y2=\"9.50086\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#1F286F\"/><stop offset=\"0.4751\" stop-color=\"#004E94\"/><stop offset=\"0.8261\" stop-color=\"#0066B1\"/><stop offset=\"1\" stop-color=\"#006FBC\"/></linearGradient><linearGradient id=\"paint4_linear_5933_159\" x1=\"8.69816\" y1=\"9.50086\" x2=\"15.1566\" y2=\"9.50086\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#6C2C2F\"/><stop offset=\"0.1735\" stop-color=\"#882730\"/><stop offset=\"0.5731\" stop-color=\"#BE1833\"/><stop offset=\"0.8585\" stop-color=\"#DC0436\"/><stop offset=\"1\" stop-color=\"#E60039\"/></linearGradient><clipPath id=\"clip0_5933_159\"><rect width=\"24\" height=\"19\" fill=\"white\"/></clipPath></defs></svg>'\n\nconst UNIONPAY_SVG =\n '<svg width=\"256px\" height=\"160px\" viewBox=\"0 0 256 160\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\"><g><path d=\"M50.041631,0.000667563305 L113.820211,0.000667563305 C122.723127,0.000667563305 128.260438,7.25731345 126.183558,16.1897657 L96.4900715,143.675416 C94.3945365,152.576777 85.480739,159.839641 76.571605,159.839641 L12.7992433,159.839641 C3.908764,159.839641 -1.64098444,152.576777 0.435896208,143.675416 L30.1418186,16.1897657 C32.2186993,7.25731345 41.1278333,0.000667563305 50.041631,0.000667563305\" fill=\"#E21836\"></path><path d=\"M108.513283,0.000667563305 L181.857018,0.000667563305 C190.758378,0.000667563305 186.744527,7.25731345 184.650546,16.1897657 L154.961724,143.675416 C152.878625,152.576777 153.528427,159.839641 144.608411,159.839641 L71.2646775,159.839641 C62.3446615,159.839641 56.8244495,152.576777 58.919985,143.675416 L88.6072525,16.1897657 C90.715224,7.25731345 99.6057035,0.000667563305 108.513283,0.000667563305\" fill=\"#00447C\"></path><path d=\"M178.94783,0.000667563305 L242.726409,0.000667563305 C251.641762,0.000667563305 257.179074,7.25731345 255.085093,16.1897657 L225.396271,143.675416 C223.300736,152.576777 214.380719,159.839641 205.466922,159.839641 L141.717879,159.839641 C132.797863,159.839641 127.265215,152.576777 129.354532,143.675416 L159.048017,16.1897657 C161.124899,7.25731345 170.027814,0.000667563305 178.94783,0.000667563305\" fill=\"#007B84\"></path><path d=\"M66.698338,40.8561434 C60.139686,40.9229891 58.202715,40.8561434 57.5840035,40.7100156 C57.346157,41.8401744 52.920349,62.256098 52.9079125,62.273198 C51.9549725,66.403641 51.261643,69.347961 48.9064975,71.2491775 C47.5695833,72.3544635 46.0088137,72.8876745 44.1993159,72.8876745 C41.2907503,72.8876745 39.5962892,71.4434965 39.3118063,68.704377 L39.2573971,67.7638735 C39.2573971,67.7638735 40.1434913,62.231225 40.1434913,62.200134 C40.1434913,62.200134 44.7884909,43.5952629 45.6201759,41.1359627 C45.6637033,40.9960531 45.6761397,40.9229891 45.6870215,40.8561434 C36.6457507,40.9354255 35.0430082,40.8561434 34.9326351,40.7100156 C34.8720075,40.9105527 34.6481522,42.0640298 34.6481522,42.0640298 L29.9052159,63.0333735 L29.4979234,64.8117805 L28.7097659,70.6289115 C28.7097659,72.3544635 29.0486581,73.762887 29.7233334,74.9536735 C31.8841598,78.729679 38.0479561,79.2955355 41.5348148,79.2955355 C46.0274683,79.2955355 50.241857,78.341041 53.089795,76.598389 C58.0332685,73.677387 59.3266555,69.1116695 60.4801325,65.0542905 L61.014898,62.972746 C61.014898,62.972746 65.7998075,43.6496723 66.6128375,41.1359627 C66.643929,40.9960531 66.656365,40.9229891 66.698338,40.8561434 Z M82.9786885,56.444252 C81.825211,56.444252 79.7172395,56.724071 77.823796,57.6521385 C77.1366845,58.0050215 76.486882,58.412314 75.8013245,58.818052 L76.420036,56.5841615 L76.081144,56.20796 C72.0657375,57.0209905 71.167207,57.129809 67.4580475,57.6521385 L67.147137,57.8588935 C66.7165265,61.4296985 66.3341065,64.1144085 64.7375825,71.133208 C64.129753,73.7199815 63.498605,76.331628 62.8659025,78.912183 L63.036903,79.2401935 C66.8377815,79.0396565 67.9912585,79.0396565 71.29468,79.0940655 L71.562063,78.8033645 C71.981792,76.65342 72.036201,76.1497455 72.965823,71.795447 C73.402652,69.7310025 74.313619,65.1948215 74.7628845,63.579643 C75.588351,63.197223 76.402936,62.8210215 77.1802115,62.8210215 C79.0316825,62.8210215 78.8062725,64.4362005 78.734763,65.079785 C78.655481,66.160198 77.9808055,69.68903 77.2890305,72.7188505 L76.8273285,74.674476 C76.5055365,76.1186545 76.152653,77.522414 75.830861,78.954156 L75.9707705,79.2401935 C79.7172395,79.0396565 80.859835,79.0396565 84.0591015,79.0940655 L84.435303,78.8033645 C85.013596,75.4455335 85.183042,74.547003 86.209046,69.6579385 L86.725157,67.411612 C87.727843,63.0153405 88.2315175,60.786114 87.4728965,58.970398 C86.670748,56.93549 84.7462135,56.444252 82.9786885,56.444252 Z M101.165696,61.047123 C99.1743155,61.429543 97.904247,61.684489 96.6419515,61.8492715 C95.3905375,62.049809 94.1702145,62.2316915 92.24568,62.499074 L92.093334,62.637429 L91.9534245,62.7478025 C91.7528875,64.181099 91.6129775,65.420076 91.3471495,66.876691 C91.1217395,68.383051 90.7750745,70.094612 90.2107725,72.5539125 C89.7739435,74.436474 89.5485335,75.092495 89.299805,75.754734 C89.057295,76.4169725 88.7899125,77.060557 88.298674,78.9120275 L88.413711,79.0830285 L88.510093,79.240038 C90.308709,79.1545375 91.4855045,79.09391 92.6949455,79.0830285 C93.902832,79.039501 95.1542455,79.0830285 97.0912165,79.09391 L97.260663,78.955555 L97.4425455,78.803209 C97.7223645,77.133621 97.7643375,76.6843555 97.935338,75.8697705 C98.104784,74.9961125 98.39704,73.786672 99.113688,70.556314 C99.4525805,69.039072 99.8303365,67.5264935 100.181665,65.97816 C100.546985,64.436045 100.929404,62.9172485 101.293169,61.4000065 L101.23876,61.2165695 L101.165696,61.047123 Z M101.208135,54.841043 C99.3986375,53.7730665 96.222689,54.1119585 94.0851805,55.587228 C91.953891,57.0329605 91.711381,59.0849685 93.5146605,60.166936 C95.293067,61.2053765 98.481452,60.896021 100.600305,59.408315 C102.726932,57.9314915 102.99276,55.898138 101.208135,54.841043 Z M112.151399,79.574733 C115.812368,79.574733 119.565055,78.565829 122.389675,75.571763 C124.562938,73.143554 125.559405,69.5307765 125.904516,68.043071 C127.028457,63.112034 126.153244,60.809743 125.054176,59.407538 C123.384588,57.2700295 120.43405,56.5844725 117.373138,56.5844725 C115.532549,56.5844725 111.148714,56.766355 107.724038,59.923649 C105.264737,62.2010665 104.12836,65.291515 103.442803,68.2544895 C102.751028,71.2734285 101.955097,76.70814 106.95298,78.7306115 C108.495095,79.3928505 110.718104,79.574733 112.151399,79.574733 Z M111.865362,68.4798995 C112.709484,64.7458675 113.705951,61.6118915 116.249197,61.6118915 C118.242132,61.6118915 118.386705,63.943719 117.500611,67.6901875 C117.342047,68.5218725 116.614517,71.6138755 115.630486,72.9305805 C114.943374,73.902175 114.130344,74.49135 113.231813,74.49135 C112.96443,74.49135 111.374124,74.49135 111.349251,72.1299865 C111.336815,70.964073 111.574661,69.7732865 111.865362,68.4798995 Z M135.05616,79.094532 L135.342197,78.803831 C135.747935,76.6538865 135.814781,76.148657 136.713312,71.7959135 C137.162577,69.731469 138.092198,65.195288 138.529028,63.580109 C139.356049,63.196135 140.156643,62.8199335 140.958791,62.8199335 C142.797825,62.8199335 142.57397,64.4351125 142.500907,65.0786965 C142.43406,66.1606645 141.759386,69.6879415 141.055173,72.717762 L140.618345,74.673388 C140.284116,76.1191205 139.920351,77.521326 139.598559,78.9546225 L139.738469,79.24066 C143.497374,79.0401225 144.596441,79.0401225 147.814363,79.094532 L148.203001,78.803831 C148.767303,75.4444455 148.919649,74.5459145 149.976744,69.658405 L150.480419,67.410524 C151.487768,63.0142525 151.99766,60.7865805 151.251476,58.9708645 C150.426009,56.9359565 148.489038,56.4447185 146.746386,56.4447185 C145.591354,56.4447185 143.472501,56.722983 141.589939,57.652605 C140.916819,58.005488 140.242143,58.411226 139.579904,58.8185185 L140.156643,56.584628 L139.847287,56.206872 C135.833436,57.021457 134.91625,57.1302755 131.211754,57.652605 L130.927271,57.85936 C130.478006,61.4301645 130.112686,64.1133205 128.516162,71.1336745 C127.908333,73.720448 127.277185,76.332094 126.646037,78.9126495 L126.815483,79.24066 C130.622579,79.0401225 131.758957,79.0401225 135.05616,79.094532 Z M162.673542,79.2398825 C162.909834,78.0864055 164.313594,71.2494885 164.32603,71.2494885 C164.32603,71.2494885 165.52148,66.232951 165.594545,66.0510685 C165.594545,66.0510685 165.970746,65.5287395 166.346947,65.321984 L166.900367,65.321984 C172.122106,65.321984 178.018519,65.321984 182.6402,61.92218 C185.785058,59.590353 187.935002,56.1470215 188.89416,51.9621695 C189.142889,50.9361655 189.326326,49.7158426 189.326326,48.4955199 C189.326326,46.8927774 189.004534,45.3071349 188.074912,44.0681575 C185.718212,40.770954 181.025022,40.7103265 175.60741,40.6854536 C175.59031,40.6854536 172.93669,40.7103265 172.93669,40.7103265 C166.001837,40.7958268 163.220744,40.770954 162.078149,40.6310444 C161.981767,41.1362735 161.799884,42.0348043 161.799884,42.0348043 C161.799884,42.0348043 159.315711,53.547812 159.315711,53.5664665 C159.315711,53.5664665 153.371107,78.0444325 153.091287,79.1979095 C159.146265,79.124846 161.628884,79.124846 162.673542,79.2398825 Z M167.276569,58.7882045 C167.276569,58.7882045 169.917752,47.2985153 169.905316,47.3420427 L169.990815,46.7528678 L170.028125,46.3036024 L171.083665,46.4124209 C171.083665,46.4124209 176.530813,46.8803409 176.658287,46.8927774 C178.808231,47.7244624 179.694325,49.8681887 179.075614,52.666381 C178.511312,55.223618 176.852606,57.373563 174.721316,58.412003 C172.966227,59.291879 170.816282,59.364943 168.601047,59.364943 L167.167751,59.364943 L167.276569,58.7882045 Z M183.721236,68.692718 C183.023242,71.668129 182.221093,77.102841 187.194103,79.039812 C188.779745,79.714487 190.200605,79.915024 191.644784,79.8419605 C193.169799,79.759569 194.582886,78.99473 195.891818,77.8941075 C195.773673,78.346482 195.655527,78.7988565 195.537381,79.2527855 L195.76279,79.5434865 C199.339813,79.392695 200.449763,79.392695 204.325259,79.4222315 L204.676588,79.1548485 C205.242445,75.8281085 205.775656,72.597751 207.246262,66.2334175 C207.962909,63.184942 208.678003,60.1660035 209.413306,57.1299645 L209.29827,56.795736 C205.296854,57.537257 204.227323,57.6958215 200.378253,58.241469 L200.085998,58.479315 C200.047134,58.788671 200.006716,59.08559 199.969406,59.3825095 C199.370904,58.4155785 198.503465,57.590112 197.164996,57.0755555 C195.453434,56.4024345 191.433365,57.269874 187.977597,60.416286 C185.549388,62.662613 184.383475,65.7406245 183.721236,68.692718 Z M192.12514,68.8746005 C192.981698,65.2074135 193.965729,62.104529 196.515194,62.104529 C198.127263,62.104529 198.976048,63.5922345 198.803493,66.1292625 C198.666693,66.761965 198.51901,67.4288675 198.343345,68.182825 C198.0884,69.2725655 197.811689,70.3529785 197.542752,71.4349465 C197.26915,72.174913 196.950468,72.8729065 196.600694,73.3377175 C195.944673,74.267339 194.383904,74.8440775 193.485373,74.8440775 C193.230426,74.8440775 191.65722,74.8440775 191.602811,72.524687 C191.590374,71.3696555 191.828221,70.1804235 192.12514,68.8746005 Z M236.010903,56.766044 L235.701548,56.413161 C231.742105,57.2153095 231.025456,57.3427825 227.387807,57.834021 L227.120423,58.1014035 C227.107988,58.144931 227.097105,58.211777 227.078451,58.2724045 L227.066014,58.211777 C224.357986,64.459519 224.437268,63.111723 222.232914,68.0303235 C222.220477,67.806468 222.220477,67.6665585 222.208042,67.428712 L221.656175,56.766044 L221.30951,56.413161 C217.161968,57.2153095 217.064031,57.3427825 213.233616,57.834021 L212.935143,58.1014035 C212.893169,58.228877 212.893169,58.3687865 212.868297,58.5211325 L212.893169,58.575542 C213.371971,61.022406 213.256934,60.4767585 213.737291,64.338264 C213.961146,66.233262 214.25962,68.139142 214.483475,70.010822 C214.861232,73.143243 215.072651,74.685358 215.534352,79.4656035 C212.947578,83.7344015 212.335085,85.3495805 209.844694,89.0960495 L209.861794,89.1333585 L208.10826,91.906678 C207.907723,92.198934 207.725841,92.399471 207.470894,92.4849715 C207.191075,92.6233265 206.82731,92.648199 206.32208,92.648199 L205.350486,92.648199 L203.906308,97.451763 L208.860663,97.5372635 C211.769228,97.524827 213.597381,96.1645945 214.581412,94.336442 L217.696733,88.9981125 L217.646987,88.9981125 L217.974998,88.621911 C220.070533,84.110603 236.010903,56.766044 236.010903,56.766044 Z M183.72108,119.853625 L181.619326,119.853625 L189.398302,94.1242455 L191.978857,94.1242455 L192.798105,91.4737355 L192.877387,94.421165 C192.781005,96.243099 194.214302,97.858278 197.979425,97.5908955 L202.333723,97.5908955 L203.832311,92.63654 L202.193814,92.63654 C201.251756,92.63654 200.814927,92.3986935 200.869337,91.888801 L200.790054,88.890071 L192.726596,88.890071 L192.726596,88.9056165 C190.119614,88.960026 182.33442,89.1558995 180.758105,89.5756285 C178.850671,90.0668665 176.840635,91.5125995 176.840635,91.5125995 L177.630347,88.85898 L170.087664,88.85898 L168.516013,94.1242455 L160.632883,120.246927 L159.103204,120.246927 L157.603062,125.165528 L172.626247,125.165528 L172.122572,126.805579 L179.525345,126.805579 L180.016584,125.165528 L182.093465,125.165528 L183.72108,119.853625 Z M177.557284,99.352202 C176.349398,99.6864305 174.101516,100.699998 174.101516,100.699998 L176.100669,94.1242455 L182.093465,94.1242455 L180.647732,98.915373 C180.647732,98.915373 178.796261,99.0241915 177.557284,99.352202 Z M177.672321,108.746356 C177.672321,108.746356 175.789759,108.982648 174.550781,109.262467 C173.330458,109.632451 171.042159,110.798364 171.042159,110.798364 L173.106603,103.955229 L179.13049,103.955229 L177.672321,108.746356 Z M174.31449,119.914253 L168.30304,119.914253 L170.045692,114.139095 L176.038487,114.139095 L174.31449,119.914253 Z M188.791404,103.955229 L197.456474,103.955229 L196.211278,107.987735 L187.431173,107.987735 L186.112912,112.396443 L193.795505,112.396443 L187.978375,120.587374 C187.571082,121.188986 187.205762,121.401959 186.800025,121.571405 C186.392732,121.77816 185.857967,122.02067 185.239255,122.02067 L183.107965,122.02067 L181.643577,126.849107 L187.218198,126.849107 C190.115882,126.849107 191.827443,125.530847 193.091294,123.800631 L197.080273,118.341047 L197.936831,123.884578 C198.118713,124.923017 198.864898,125.530847 199.370127,125.767139 C199.928211,126.046958 200.50495,126.527315 201.319535,126.598824 C202.193192,126.636133 202.82434,126.66567 203.244069,126.66567 L205.983189,126.66567 L207.627904,121.262049 L206.547491,121.262049 C205.927224,121.262049 204.859248,121.157894 204.677366,120.963575 C204.495483,120.727283 204.495483,120.363518 204.397546,119.810098 L203.528552,114.254131 L199.970183,114.254131 L201.530954,112.396443 L210.293959,112.396443 L211.641755,107.987735 L203.528552,107.987735 L204.792402,103.955229 L212.880733,103.955229 L214.380875,98.982219 L190.266674,98.982219 L188.791404,103.955229 Z M115.605924,121.037106 L117.628395,114.309008 L125.940582,114.309008 L127.459378,109.304907 L119.139419,109.304907 L120.409488,105.163582 L128.539791,105.163582 L130.046152,100.318045 L109.703292,100.318045 L108.228023,105.163582 L112.849704,105.163582 L111.616945,109.304907 L106.982827,109.304907 L105.446931,114.394508 L110.067057,114.394508 L107.371465,123.295869 C107.0077,124.474219 107.542466,124.923484 107.881358,125.470686 C108.228023,126.003897 108.579352,126.35678 109.369064,126.557317 C110.183649,126.7392 110.741733,126.848018 111.500354,126.848018 L120.87119,126.848018 L122.540778,121.304488 L118.387016,121.875009 C117.584868,121.875009 115.363414,121.778627 115.605924,121.037106 Z M116.55933,88.8286665 L114.452913,92.635763 C114.002093,93.4674475 113.596355,93.983559 113.231036,94.221405 C112.909244,94.4219425 112.271878,94.505888 111.348474,94.505888 L110.249406,94.505888 L108.780355,99.3762975 L112.430442,99.3762975 C114.18553,99.3762975 115.533326,98.7327135 116.176911,98.410921 C116.868686,98.040938 117.050568,98.252357 117.585334,97.736246 L118.818094,96.668269 L130.216064,96.668269 L131.728643,91.5973225 L123.385365,91.5973225 L124.84198,88.8286665 L116.55933,88.8286665 Z M133.386416,121.134887 C133.192097,120.855067 133.332007,120.362275 133.628926,119.336271 L136.744247,109.024932 L147.826644,109.024932 C149.441823,109.001614 150.607736,108.982959 151.366357,108.92855 C152.180942,108.843049 153.067037,108.552348 154.032413,108.030019 C155.028881,107.482817 155.538773,106.906078 155.969384,106.243839 C156.44974,105.583155 157.220798,104.137422 157.883037,101.908196 L161.798952,88.859291 L150.298381,88.926137 C150.298381,88.926137 146.757113,89.448466 145.197898,90.0252045 C143.624692,90.668789 141.37681,92.4658505 141.37681,92.4658505 L142.415251,88.8888275 L135.31095,88.8888275 L125.364931,121.874854 C125.012048,123.155803 124.775756,124.085425 124.721347,124.643509 C124.702692,125.245121 125.479968,125.840514 125.983643,126.289779 C126.579036,126.739045 127.458911,126.665981 128.303033,126.739045 C129.190682,126.805891 130.452978,126.847863 132.195629,126.847863 L137.655214,126.847863 L139.33102,121.189296 L134.443511,121.650998 C133.921182,121.650998 133.543426,121.371178 133.386416,121.134887 Z M138.754282,102.060541 L150.394763,102.060541 L149.654797,104.379932 C149.550642,104.434341 149.301913,104.264895 148.117345,104.404805 L138.037634,104.404805 L138.754282,102.060541 Z M141.086109,94.2815665 L152.824526,94.2815665 L151.980405,97.075095 C151.980405,97.075095 146.447757,97.020686 145.561663,97.1839135 C141.662847,97.858589 139.38543,99.941688 139.38543,99.941688 L141.086109,94.2815665 Z M149.915339,112.146937 C149.818957,112.493602 149.666611,112.705021 149.453638,112.863585 C149.217345,113.015931 148.834926,113.07034 148.264406,113.07034 L146.605699,113.07034 L146.703636,110.245721 L139.804537,110.245721 L139.524718,124.054801 C139.513836,125.051268 139.610218,125.628007 140.339303,126.089709 C141.068387,126.666447 143.314714,126.739511 146.338316,126.739511 L150.661524,126.739511 L152.222294,121.570628 L148.458724,121.777383 L147.207311,121.850447 C147.03631,121.777383 146.873082,121.710537 146.6912,121.528655 C146.532635,121.371645 146.265253,121.468028 146.30878,120.47156 L146.338316,116.931847 L150.285323,116.768619 C152.416613,116.768619 153.32758,116.075288 154.104855,115.414604 C154.846376,114.781902 155.088886,114.054372 155.368706,113.07034 L156.030945,109.936365 L150.607114,109.936365 L149.915339,112.146937 Z\" fill=\"#FEFEFE\"></path></g></svg>'\n\nexport function MastercardIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={MASTERCARD_SVG} width={size} height={size * (18 / 24)} />\n}\n\nexport function VisaIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={VISA_SVG} width={size} height={size * (19 / 24)} />\n}\n\nexport function JcbIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={JCB_SVG} width={size} height={size * (19 / 24)} />\n}\n\nexport function UnionPayIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={UNIONPAY_SVG} width={size} height={size * (160 / 256)} />\n}\n\nexport function ApplePayIcon({ size = 20, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n const w = size * (11.7334 / 14.4)\n return (\n <SvgXml\n xml={APPLE_SVG.replace('currentColor', c).replace('currentColor', c)}\n width={w}\n height={size}\n />\n )\n}\n\nexport function RevolutIcon({ size = 20, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n const w = size * (15.9174 / 20)\n return (\n <SvgXml\n xml={REVOLUT_SVG.replace('currentColor', c).replace('currentColor', c)}\n width={w}\n height={size}\n />\n )\n}\n\nexport function CryptoCoinIcon({ size = 24, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n return (\n <SvgXml\n xml={CRYPTO_SVG.replace(/currentColor/g, c)}\n width={size}\n height={size}\n />\n )\n}\n\nexport function BankIcon({ size = 24, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n return (\n <SvgXml\n xml={BANK_SVG.replace(/currentColor/g, c)}\n width={size}\n height={size}\n />\n )\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.content.elements.primary}\n />\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// Smaller logos with clear padding inside the quiet-zone card, so the center\n// occludes fewer QR modules (denser read) and the icons don't touch the edge.\n// Figma `icon/chain` card (node 12782:5552): 46px quiet-zone card, 12px radius\n// (border/radius/element). The 2\u00D72 grid is centered inside it, so the icons\n// keep a clean margin from the card edge.\nconst CARD_SIZE = 46\nconst CARD_RADIUS = 12\n// Single logo fills the card with the same ~6px margin the 2\u00D72 grid keeps.\nconst SINGLE_SIZE = 34\nconst GRID_SIZE = 16\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: CARD_RADIUS,\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\n key={icon}\n style={[\n iconRing(size),\n { backgroundColor: theme.background.secondary },\n ]}\n >\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 alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n overflowCircle(size),\n {\n backgroundColor:\n overflowMode === 'plus'\n ? theme.background.secondary\n : theme.background.pill.pressed,\n },\n ]}\n >\n {overflowMode === 'plus' ? (\n // The geometric \"+\" glyph centers cleanly; the text \"+\" did not.\n <FigmaPlusIcon\n size={size}\n color={theme.content.elements.secondary}\n />\n ) : (\n <Text\n variant=\"bodyMedium\"\n style={[\n overflowText(size),\n { color: theme.content.elements.secondary },\n ]}\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, useTheme } 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 theme = useTheme()\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 borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n badgeRing(badge),\n { backgroundColor: theme.background.modal },\n ]}\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 { StatusIcon } from '../icons/StatusIcon'\nimport { Box, Text, useTheme } 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 SelectMethodScreen}. 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 SelectMethodScreenProps {\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 SelectMethodScreen({\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}: SelectMethodScreenProps) {\n const theme = useTheme()\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.modal }}\n >\n <Box alignItems=\"center\" style={topBar}>\n <Box\n style={[\n grabber,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n </Box>\n\n {error ? (\n <SelectMethodError\n title={errorTitle}\n message={errorMessage}\n retryLabel={retryLabel}\n onRetry={onRetry}\n />\n ) : loading ? (\n <SelectMethodLoading\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\n variant=\"detail\"\n weight=\"medium\"\n style={{ color: theme.content.elements.secondary }}\n >\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\n variant=\"detail\"\n weight=\"medium\"\n style={{ color: theme.content.elements.secondary }}\n >\n {payWithLabel}\n </Text>\n </Box>\n <Box\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n methodsCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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\nfunction SelectMethodError({\n title,\n message,\n retryLabel,\n onRetry,\n}: {\n title: string\n message: string\n retryLabel: string\n onRetry?: () => void\n}) {\n const theme = useTheme()\n return (\n <Box alignItems=\"center\" justifyContent=\"center\" style={errorContainer}>\n <StatusIcon />\n <Box alignItems=\"center\" style={errorText}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n <Text\n variant=\"detail\"\n style={[\n errorMessageText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {message}\n </Text>\n </Box>\n {/* No handler \u2192 non-retryable state (e.g. withdrawals unavailable in\n region): show the message alone instead of a dead button. */}\n {onRetry ? (\n <Pressable\n onPress={onRetry}\n accessibilityRole=\"button\"\n accessibilityLabel={retryLabel}\n >\n <Box\n borderRadius=\"button\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n retryButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {retryLabel}\n </Text>\n </Box>\n </Pressable>\n ) : null}\n </Box>\n )\n}\n\nfunction PaymentMethodRow({ method }: { method: PaymentMethodOption }) {\n const theme = useTheme()\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n style={row}\n >\n <Box width={48} height={48} alignItems=\"center\" justifyContent=\"center\">\n {method.icon}\n </Box>\n <Box flex={1} style={details}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {method.title}\n </Text>\n {method.subtitle ? (\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\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 const theme = useTheme()\n return (\n <Box\n style={[\n divider,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n )\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 theme = useTheme()\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 borderWidth={1}\n borderRadius=\"element\"\n style={[\n dropdownTrigger,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Box flexDirection=\"row\" alignItems=\"center\" style={triggerLeft}>\n {selected.icon ?? <ReceiveTokenIconFallback />}\n <Text\n variant=\"bodyMedium\"\n numberOfLines={1}\n style={[triggerLabel, { color: theme.content.elements.primary }]}\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 borderRadius=\"element\"\n style={[dropdownMenu, { backgroundColor: theme.background.modal }]}\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\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\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 const theme = useTheme()\n return (\n <Box\n width={24}\n height={24}\n borderRadius=\"rounded\"\n style={{ backgroundColor: theme.background.pill.pressed }}\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 SelectMethodLoading({\n count,\n showDropdown,\n depositToLabel,\n payWithLabel,\n}: {\n count?: number\n showDropdown: boolean\n depositToLabel: string\n payWithLabel: string\n}) {\n const theme = useTheme()\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\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {depositToLabel}\n </Text>\n </Box>\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n dropdownTrigger,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Animated.View style={[loadingSelectorLeft, { opacity }]}>\n <Box\n width={20}\n height={20}\n borderRadius=\"rounded\"\n style={{ backgroundColor: theme.background.pill.pressed }}\n />\n <Box\n style={[\n skeletonTitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Animated.View>\n <ChevronDownIcon />\n </Box>\n </Box>\n ) : null}\n\n {showDropdown ? (\n <Box style={payWithSection}>\n <Box style={sectionLabel}>\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {payWithLabel}\n </Text>\n </Box>\n <Box\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n methodsCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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 const theme = useTheme()\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 style={{ backgroundColor: theme.background.pill.pressed }}\n />\n <Box flex={1} style={skeletonDetails}>\n <Box\n style={[\n skeletonTitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n <Box\n style={[\n skeletonSubtitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\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.\n// Gap between the last row and the screen bottom (Figma / design review).\nconst BOTTOM_GAP = 50\nconst listContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: BOTTOM_GAP,\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: BOTTOM_GAP,\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 (so the sheet doesn't jump height when loading finishes) but\n// no inter-row gap \u2014 the 68px skeleton rows stack flush (their py-10 supplies\n// the breathing room), matching the Figma frame exactly.\nconst skeletonListContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: BOTTOM_GAP,\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 { StyleSheet } from 'react-native'\n\nimport { Box, useTheme } from '../theme/restyle'\nimport { FigmaAlertCircleIcon } from './FigmaSystemIcons'\n\n// Shared status circle (Figma: Fun Mobile `status-icon`) for the geo-blocked\n// and unavailable/error screens.\nexport function StatusIcon() {\n const theme = useTheme()\n return (\n <Box\n borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[styles.circle, { backgroundColor: theme.background.secondary }]}\n >\n <FigmaAlertCircleIcon\n size={20}\n color={theme.content.button.icon.default}\n />\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n circle: { width: 48, height: 48 },\n})\n", "import { useRef, useState } from 'react'\nimport {\n type LayoutChangeEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n Pressable,\n ScrollView,\n View,\n type ViewStyle,\n useWindowDimensions,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg'\n\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport { FunIcon } from '../icons/FunIcon'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\n// Height of the full-width edge gradient.\nconst SCROLL_FADE_HEIGHT = 42\n// Tolerance (px) for scroll/size comparisons, so sub-pixel fractional offsets\n// don't flip a fade on/off at the very top/bottom.\nconst SCROLL_EPSILON = 1\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 \u2014 reached by tapping the chain-logo\n * cluster on the Transfer screen. An X-close + centered title bar, then a\n * 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 gotItLabel?: string\n loading?: boolean\n skeletonCount?: number\n onClose?: () => void\n}\n\nexport function AvailableChainsScreen({\n networkLabel,\n chains,\n title = `Available ${networkLabel}`,\n gotItLabel = 'Got it',\n loading = false,\n skeletonCount = 8,\n onClose,\n}: AvailableChainsScreenProps) {\n const { height } = useWindowDimensions()\n const theme = useTheme()\n const insets = useSafeAreaInsets()\n\n // Edge fades hint at off-screen rows once the list overflows its viewport:\n // top fade appears after scrolling down, bottom fade while more rows remain.\n const [showTopFade, setShowTopFade] = useState(false)\n const [showBottomFade, setShowBottomFade] = useState(false)\n const metrics = useRef({ scrollY: 0, viewportH: 0, contentH: 0 })\n const recomputeFades = () => {\n const { scrollY, viewportH, contentH } = metrics.current\n const overflows = contentH > viewportH + SCROLL_EPSILON\n setShowTopFade(overflows && scrollY > SCROLL_EPSILON)\n setShowBottomFade(\n overflows && scrollY + viewportH < contentH - SCROLL_EPSILON,\n )\n }\n const onScroll = (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n metrics.current.scrollY = e.nativeEvent.contentOffset.y\n recomputeFades()\n }\n const onViewportLayout = (e: LayoutChangeEvent) => {\n metrics.current.viewportH = e.nativeEvent.layout.height\n recomputeFades()\n }\n const onContentSizeChange = (_w: number, h: number) => {\n metrics.current.contentH = h\n // A shorter replacement list can clamp the native offset without firing\n // onScroll, so re-clamp scrollY to the new max or the bottom fade may hide\n // while the list still overflows.\n metrics.current.scrollY = Math.min(\n metrics.current.scrollY,\n Math.max(0, h - metrics.current.viewportH),\n )\n recomputeFades()\n }\n\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{\n backgroundColor: theme.background.modal,\n // 16px gap above the home indicator (design review), device-aware.\n paddingBottom: insets.bottom + 16,\n }}\n >\n {/* Top bar: spacer \u00B7 title \u00B7 spacer */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Box style={topBarSpacer} />\n <Box flex={1} alignItems=\"center\">\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n\n <View style={scrollArea}>\n <ScrollView\n style={[list, { maxHeight: height * 0.72 }]}\n showsVerticalScrollIndicator={false}\n contentContainerStyle={listContent}\n onScroll={onScroll}\n onLayout={onViewportLayout}\n onContentSizeChange={onContentSizeChange}\n scrollEventThrottle={16}\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\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {chain.name}\n </Text>\n </Box>\n {chain.minLabel ? (\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {chain.minLabel}\n </Text>\n ) : null}\n </Box>\n ))}\n </ScrollView>\n {showTopFade ? (\n <ScrollFade edge=\"top\" color={theme.background.modal} />\n ) : null}\n {showBottomFade ? (\n <ScrollFade edge=\"bottom\" color={theme.background.modal} />\n ) : null}\n </View>\n\n <Box style={buttonContainer}>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={gotItLabel}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderRadius=\"button\"\n style={[\n gotItButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {gotItLabel}\n </Text>\n </Box>\n </Pressable>\n </Box>\n </Box>\n )\n}\n\nfunction AvailableChainSkeleton() {\n const theme = useTheme()\n return (\n <Box flexDirection=\"row\" alignItems=\"center\" style={row}>\n <Box\n style={[\n skeletonIcon,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n <Box flex={1}>\n <Box\n style={[\n skeletonName,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Box>\n <Box\n style={[\n skeletonMin,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Box>\n )\n}\n\n/**\n * A gradient that fades the list into the modal surface at one edge. Drawn with\n * react-native-svg since RN has no CSS gradient; `pointerEvents=\"none\"` so it\n * never intercepts scroll touches.\n */\nfunction ScrollFade({\n edge,\n color,\n}: {\n edge: 'top' | 'bottom'\n color: string\n}) {\n const id = `chains-fade-${edge}`\n const topOpaque = edge === 'top'\n return (\n <View\n pointerEvents=\"none\"\n style={[fade, edge === 'top' ? { top: 0 } : { bottom: 0 }]}\n >\n <Svg width=\"100%\" height=\"100%\">\n <Defs>\n <LinearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <Stop\n offset=\"0\"\n stopColor={color}\n stopOpacity={topOpaque ? 1 : 0}\n />\n <Stop\n offset=\"1\"\n stopColor={color}\n stopOpacity={topOpaque ? 0 : 1}\n />\n </LinearGradient>\n </Defs>\n <Rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n </Svg>\n </View>\n )\n}\n\nconst scrollArea: ViewStyle = { position: 'relative' }\nconst fade: ViewStyle = {\n position: 'absolute',\n left: 0,\n right: 0,\n height: SCROLL_FADE_HEIGHT,\n}\nconst topBar: ViewStyle = {\n paddingBottom: 12,\n paddingHorizontal: 24,\n gap: 4,\n}\nconst topBarSpacer: ViewStyle = { width: 32, height: 32 }\nconst list: ViewStyle = { width: '100%' }\nconst listContent: ViewStyle = { paddingHorizontal: 20 }\nconst buttonContainer: ViewStyle = { paddingHorizontal: 20, paddingTop: 16 }\nconst gotItButton: ViewStyle = { height: 56, paddingHorizontal: 24 }\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 { Linking, Pressable, StyleSheet } from 'react-native'\n\nimport { StatusIcon } from '../icons/StatusIcon'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\nconst FUN_REGIONAL_RESTRICTIONS_URL =\n 'https://intercom.help/funxyz/en/articles/9827689-regional-restrictions'\n\nexport function CheckoutBlockedScreen() {\n const theme = useTheme()\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.modal }}\n >\n <Box alignItems=\"center\" style={styles.topBar}>\n <Box\n style={[\n styles.grabber,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n Add money\n </Text>\n </Box>\n\n <Box alignItems=\"center\" justifyContent=\"center\" style={styles.content}>\n <StatusIcon />\n <Box alignItems=\"center\" style={styles.textGroup}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n Not available\n </Text>\n <Box alignItems=\"center\">\n <Text\n variant=\"detail\"\n style={[\n styles.descriptionText,\n { color: theme.content.elements.secondary },\n ]}\n >\n This service is not available in your region.\n </Text>\n <Pressable\n onPress={() => Linking.openURL(FUN_REGIONAL_RESTRICTIONS_URL)}\n >\n <Text\n variant=\"detail\"\n style={[\n styles.linkText,\n { color: theme.content.elements.secondary },\n ]}\n >\n View available regions.\n </Text>\n </Pressable>\n </Box>\n </Box>\n </Box>\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n topBar: { height: 64, paddingTop: 25, paddingBottom: 12 },\n grabber: {\n position: 'absolute',\n top: 8,\n width: 36,\n height: 5,\n borderRadius: 999,\n },\n content: {\n height: 390,\n gap: 24,\n paddingHorizontal: 16,\n paddingBottom: 34,\n },\n textGroup: { gap: 8 },\n descriptionText: { textAlign: 'center' },\n linkText: { textAlign: 'center', textDecorationLine: 'underline' },\n})\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, type TextStyle, type ViewStyle } from 'react-native'\n\nimport { useScreenSize } from '../hooks/useScreenSize'\nimport { CopyAddressIcon } from '../icons/CopyAddressIcon'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\n/**\n * The deposit QR-code screen (Figma: Fun Mobile / qr-code-modal, node\n * 11636:2663). Presented as a nested bottom sheet: a centered \"QR Code\"\n * title (no close button), the framed QR with the selected network's chain\n * logos overlaid in its center, the full deposit address with a\n * \"Copy address\" button, and a \"Done\" primary button that dismisses the sheet.\n *\n * Vertical padding adapts to screen height via {@link useScreenSize} so the\n * sheet doesn't overflow on compact devices (iPhone SE).\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;\n * this 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 doneLabel?: 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 doneLabel = 'Done',\n copyLabel = 'Copy address',\n copiedLabel = 'Copied!',\n copiedFeedbackMs = 1800,\n onClose,\n onCopyAddress,\n}: QrCodeScreenProps) {\n const { isShort } = useScreenSize()\n const theme = useTheme()\n\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={[sheet, { backgroundColor: theme.background.modal }]}\n >\n {/* Top bar: spacer \u00B7 title \u00B7 spacer */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Box style={topBarSpacer} />\n <Box flex={1} alignItems=\"center\">\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n <Box style={{ paddingVertical: isShort ? 0 : 16 }}>\n <Box\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[content, { paddingVertical: isShort ? 24 : 82 }]}\n >\n <Box\n borderWidth={1.5}\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n qrFrame,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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\n variant=\"body\"\n style={[\n addressText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {address}\n </Text>\n {onCopyAddress ? (\n <Pressable\n onPress={handleCopy}\n accessibilityRole=\"button\"\n accessibilityLabel={\n copied ? 'Address copied' : 'Copy address'\n }\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n copyButton,\n {\n backgroundColor:\n theme.background.button.secondary.default,\n borderColor: theme.background.button.secondary.default,\n },\n ]}\n >\n <CopyAddressIcon />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.secondary.default }}\n >\n {copied ? copiedLabel : copyLabel}\n </Text>\n </Box>\n </Pressable>\n ) : null}\n </Box>\n ) : null}\n </Box>\n\n <Box style={buttonContainer}>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={doneLabel}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderRadius=\"button\"\n style={[\n doneButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {doneLabel}\n </Text>\n </Box>\n </Pressable>\n </Box>\n </Box>\n </Box>\n )\n}\n\nconst sheet: ViewStyle = { paddingBottom: 34 }\nconst topBar: ViewStyle = {\n paddingBottom: 12,\n paddingHorizontal: 24,\n gap: 4,\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 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}\nconst buttonContainer: ViewStyle = { paddingHorizontal: 20 }\nconst doneButton: ViewStyle = { height: 56, paddingHorizontal: 24 }\n", "import { useWindowDimensions } from 'react-native'\n\nexport function useScreenSize() {\n const { height } = useWindowDimensions()\n\n // Add additional breakpoints as needed (e.g. isTall).\n const isShort = height < 700\n\n return { isShort }\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.content.button.secondary.default}\n />\n )\n}\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\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 insets = useSafeAreaInsets()\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.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\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\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, { paddingBottom: insets.bottom + 16 }]}>\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 borderWidth={1}\n borderRadius=\"element\"\n style={[\n addressCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Box alignItems=\"center\" style={addressColumn}>\n <Box alignItems=\"center\" style={addressGroup}>\n <Text\n variant=\"body\"\n style={{ color: theme.content.elements.secondary }}\n >\n {depositAddressLabel}\n </Text>\n <Text\n variant=\"bodyMedium\"\n style={[\n addressText,\n { color: theme.content.elements.primary },\n ]}\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 style={[\n previewPill,\n { backgroundColor: theme.background.secondary },\n ]}\n >\n <SourceTokenCluster\n icons={supportedTokenIcons}\n size={20}\n gap={4}\n />\n <FigmaChevronRightIcon\n size={16}\n color={theme.content.elements.secondary}\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={\n <FigmaCopyIcon color={theme.content.button.primary.default} />\n }\n onPress={handleCopy}\n />\n <PillButton\n label={shareLabel}\n accessibilityLabel=\"Share address\"\n icon={\n <FigmaShareIcon color={theme.content.button.primary.default} />\n }\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 const theme = useTheme()\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\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\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 const theme = useTheme()\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 borderRadius=\"button\"\n style={[\n pillButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n {icon}\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\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 // paddingBottom is set inline: safe-area inset + 16 so the buttons keep a 16px\n // gap above the home indicator on every device.\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: 6 }\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, useTheme } 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 const theme = useTheme()\n\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n borderWidth={1}\n borderRadius=\"rounded\"\n style={[\n track,\n {\n backgroundColor: theme.background.secondary,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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 borderWidth={1}\n borderRadius=\"rounded\"\n style={[\n selectedPill,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <ChainGlyph iconKeys={network.iconKeys} />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\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 {\n type PaymentMethodOption,\n SelectMethodScreen,\n} from './SelectMethodScreen'\n\nexport interface WithdrawMethodScreenProps {\n /** Cash payout methods (Card / Bank Transfer / \u2026). */\n methods: PaymentMethodOption[]\n onSelectMethod: (id: string) => void\n /** Sheet title; defaults to 'Withdraw'. */\n title?: string\n loading?: boolean\n /** The payout-method fetch failed \u2014 shows the retryable error state. */\n hasError?: boolean\n onRetry?: () => void\n /**\n * Withdrawals unavailable (Statsig gate off, or Swapped returned no methods\n * for the user's region) \u2014 shows a terminal, non-retryable message.\n */\n isEmpty?: boolean\n /**\n * The balance can't meet Swapped's minimum sell \u2014 shows a distinct terminal\n * message instead of methods that would all reject.\n */\n isBelowMinimum?: boolean\n}\n\n// Literal until connect-rn has translations (deposit screens are the same).\nconst EMPTY_TITLE = 'Withdrawals unavailable'\nconst EMPTY_MESSAGE =\n \"Cash withdrawals aren't available in your region right now.\"\nconst BELOW_MIN_TITLE = 'Balance too low'\nconst BELOW_MIN_MESSAGE =\n 'Your balance is below the minimum for a cash withdrawal.'\n\n// Below-minimum wins over empty \u2014 a too-low balance is the more specific reason.\nfunction getTerminalError(isBelowMinimum: boolean, isEmpty: boolean) {\n if (isBelowMinimum) {\n return { title: BELOW_MIN_TITLE, message: BELOW_MIN_MESSAGE }\n }\n if (isEmpty) {\n return { title: EMPTY_TITLE, message: EMPTY_MESSAGE }\n }\n return null\n}\n\n/**\n * The withdrawal payout-method picker: the entry screen of `beginWithdrawal`,\n * listing the Swapped `CRYPTO_TO_FIAT` methods. A thin composition over\n * {@link SelectMethodScreen} (no receive-token dropdown \u2192 the bare-list layout),\n * so the list/loading/error visuals stay in lockstep with the deposit flow.\n */\nexport function WithdrawMethodScreen({\n methods,\n onSelectMethod,\n title = 'Withdraw',\n loading = false,\n hasError = false,\n onRetry,\n isEmpty = false,\n isBelowMinimum = false,\n}: WithdrawMethodScreenProps) {\n // Fetch errors and loading win over terminal states \u2014 a failed fetch says\n // nothing about availability or balance, and retrying may recover it.\n const terminalError = getTerminalError(isBelowMinimum, isEmpty)\n if (terminalError && !hasError && !loading) {\n return (\n <SelectMethodScreen\n title={title}\n methods={[]}\n onSelectMethod={onSelectMethod}\n error\n errorTitle={terminalError.title}\n errorMessage={terminalError.message}\n />\n )\n }\n return (\n <SelectMethodScreen\n title={title}\n methods={methods}\n onSelectMethod={onSelectMethod}\n loading={loading}\n error={hasError}\n onRetry={onRetry}\n />\n )\n}\n", "import type { SwappedInboundMessage } from '@funkit/connect-core'\nimport { useCallback } from 'react'\n\nimport { logger } from '../logging/logger'\nimport {\n type SwappedScreenBaseProps,\n SwappedScreenShell,\n} from './SwappedScreenShell'\n\nexport interface SwappedScreenProps extends SwappedScreenBaseProps {\n /** Fired when the embed reports a successful transaction. */\n onSuccess?: () => void\n}\n\n/**\n * Deposit-mode host for the Swapped embed (mirroring web's\n * `SwappedIframeController`): back / new-deposit \u2192 {@link onBack},\n * close \u2192 {@link onClose}, transaction-successful \u2192 {@link onSuccess}.\n * Withdrawal lifecycle messages are ignored \u2014 see `SwappedWithdrawScreen`.\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 default:\n // READY / NAVIGATION / LOGOUT / ERROR handled in the shell or\n // tracked elsewhere; withdrawal lifecycle messages belong to\n // SwappedWithdrawScreen.\n break\n }\n },\n [onBack, onClose, onSuccess],\n )\n\n return <SwappedScreenShell url={url} onMessage={handleMessage} />\n}\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, useTheme } from '../theme/restyle'\nimport { SwappedWebView } from './SwappedWebView'\n\n/** Props shared by both Swapped embed hosts (deposit and withdrawal). */\nexport interface SwappedScreenBaseProps {\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 method list (embed's own back). */\n onBack: () => void\n}\n\ninterface SwappedScreenShellProps {\n url: string\n onMessage: (msg: SwappedInboundMessage) => void\n}\n\n/**\n * Full-screen host frame for the Swapped embedded payment flow\n * ({@link SwappedWebView}). The embed ships its own top bar, so we render no\n * RN header. Mode-agnostic message handling (error logging) lives here;\n * mode-specific dispatch lives in `SwappedScreen` (deposit) and\n * `SwappedWithdrawScreen` (withdrawal).\n */\nexport function SwappedScreenShell({\n url,\n onMessage,\n}: SwappedScreenShellProps) {\n const theme = useTheme()\n const handleMessage = useCallback(\n (msg: SwappedInboundMessage) => {\n if (msg.type === 'SWAPPED_ERROR') {\n // Recoverable \u2014 the embed surfaces its own error UI (WARN, not ERROR).\n logger.warn('connect-rn:swapped:error', {\n data: msg.data ?? {},\n })\n }\n onMessage(msg)\n },\n [onMessage],\n )\n\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={[sheet, { backgroundColor: theme.background.modal }]}\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 {\n WebView,\n type WebViewMessageEvent,\n type WebViewNavigation,\n} 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 // Last main-frame URL reported by the WebView's NATIVE layer \u2014 the fallback\n // when `nativeEvent.url` is empty on a message event (some webview builds omit\n // it). Seeded with the widget url so a message before the first navigation\n // callback still validates against a real Swapped origin. Never sourced from\n // page JS, so it stays trustworthy for the fail-closed origin gate.\n const lastCommittedUrlRef = useRef(url)\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 handleNavigationStateChange = (navState: WebViewNavigation) => {\n if (navState.url) {\n lastCommittedUrlRef.current = navState.url\n }\n }\n\n const handleMessage = (event: WebViewMessageEvent) => {\n // onNavigationStateChange doesn't fire for SPA route changes inside the\n // widget, but those never change the origin \u2014 all the gate reads.\n dispatch(\n event.nativeEvent.data,\n event.nativeEvent.url || lastCommittedUrlRef.current,\n )\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\n style={[loadingOverlay, { backgroundColor: theme.background.modal }]}\n >\n <ActivityIndicator color={theme.content.elements.secondary} />\n </View>\n ),\n [theme.background.modal, theme.content.elements.secondary],\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 onNavigationStateChange={handleNavigationStateChange}\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.background.modal }, 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 { background, content, border, borderRadii } = theme\n return {\n iframeBackground: toRawHex(background.modal),\n widgetBackground: toRawHex(background.modal),\n textColor: toRawHex(content.elements.primary),\n spinnerColor: toRawHex(content.elements.primary),\n modalRadii: px(borderRadii.modal),\n skeletonColor: toRawHex(border.elements.default.color),\n skeletonSecondaryColor: toRawHex(background.secondary),\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 Swapped widget's vocabulary is richer than the Fun Variables export: it\n * has hover / focused / disabled slots the mobile design doesn't define. Since\n * connect-rn's tokens are a strict mirror of Figma (only default / pressed /\n * some disabled states exist), those extra slots are adapted here at the\n * boundary: hover \u2190 pressed, primary/tertiary disabled \u2190 the default fill (the\n * widget dims via opacity), and the widget's neutral \"focused\" strokes map onto\n * the `border/elements/{default,selected}` variables.\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 {\n background,\n content,\n border,\n brand,\n borderRadii,\n sizes,\n spacing,\n textVariants,\n } = 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: content.elements.primary,\n secondaryText: content.elements.secondary,\n tertiaryText: content.elements.secondary,\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: background.modal,\n offBackground: background.secondary,\n hoverState: background.secondary,\n lightStroke: border.elements.default.color,\n mediumStroke: border.elements.default.color,\n heavyStroke: border.elements.default.color,\n modalBorder: border.modal.default,\n modalHeaderDivider: border.elements.default.color,\n modalFooterDivider: border.elements.default.color,\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: brand.primary,\n accentColor: brand.primary,\n accentColorForeground: content.button.primary.default,\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: content.elements.error,\n success: content.elements.success,\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: content.elements.primary,\n spinnerBackground: border.elements.default.color,\n\n // \u2500\u2500 Primary button (hover \u2190 pressed, disabled \u2190 default fill) \u2500\u2500\u2500\u2500\u2500\n // web spreads both `buttonBackground*` (ThemeVars) and `buttonPrimary*`\n // (widget aliases); the widget reads whichever is present.\n buttonBackground: background.button.primary.default,\n buttonBackgroundHover: background.button.primary.pressed,\n buttonBackgroundPressed: background.button.primary.pressed,\n buttonBackgroundDisabled: background.button.primary.default,\n buttonPrimary: background.button.primary.default,\n buttonPrimaryHover: background.button.primary.pressed,\n buttonDisabled: background.button.primary.default,\n buttonTextPrimary: content.button.primary.default,\n buttonTextHover: content.button.primary.default,\n buttonTextDisabled: content.button.primary.default,\n buttonTextSecondary: content.button.secondary.default,\n buttonTextSecondaryDisabled: content.button.secondary.default,\n buttonFocusedOutline: 'none',\n buttonBorderGradient: 'none',\n buttonHoverBorderGradient: 'none',\n buttonDisabledBorderGradient: 'none',\n\n // \u2500\u2500 Tertiary button (hover \u2190 pressed, disabled \u2190 default fill) \u2500\u2500\u2500\u2500\n buttonBackgroundTertiary: background.button.tertiary.default,\n buttonBackgroundHoverTertiary: background.button.tertiary.pressed,\n buttonBackgroundDisabledTertiary: background.button.tertiary.default,\n buttonTextTertiary: content.button.tertiary.default,\n buttonTextDisabledTertiary: content.button.tertiary.default,\n buttonBorderTertiary: 'transparent',\n buttonBorderFocusedTertiary: border.elements.selected.color,\n\n // \u2500\u2500 Icon button / top bar (hover \u2190 pressed) \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: background.button.icon.default,\n buttonIconBackgroundHover: background.button.icon.pressed,\n buttonIconBackgroundPressed: background.button.icon.pressed,\n buttonIconStroke: content.button.icon.default,\n modalTopbarIcon: content.button.icon.default,\n modalTopbarIconBackground: background.button.icon.default,\n modalTopbarIconBackgroundHover: background.button.icon.pressed,\n modalTopbarIconBackgroundPressed: background.button.icon.pressed,\n\n // \u2500\u2500 Input (hover/focused \u2190 border/elements variables) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n inputBackground: background.modal,\n inputBackgroundHover: background.secondary,\n inputBorderBase: border.elements.default.color,\n inputBorderHover: border.elements.selected.color,\n inputLabel: content.elements.primary,\n inputBorder: border.elements.default.color,\n inputBorderFocused: content.elements.secondary,\n inputBorderActive: content.elements.secondary,\n inputPlaceholder: content.elements.secondary,\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: border.elements.selected.color,\n focusedOptionBorder: border.elements.selected.color,\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: background.secondary,\n secondaryButtonBg: background.button.tertiary.default,\n secondaryButtonText: content.button.tertiary.default,\n secondaryButtonHover: background.button.tertiary.pressed,\n secondaryButtonTextHover: content.button.tertiary.default,\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: content.button.icon.default,\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: background.modal,\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 try { window.postMessage = bridged; } catch (e) {}\n // The widget only emits some messages (notably SWAPPED_ORDER_DATA, the sell\n // deposit address) when it believes it is embedded in a parent frame \u2014 on web\n // that's a real <iframe> so window.parent !== window. A top-level WebView has\n // window.parent === window, so present a DISTINCT parent/top (a proxy over\n // window) whose postMessage forwards to native; the get-trap delegates every\n // other property to the real window so the widget's other parent.* access works.\n var frameProxy = window;\n try {\n frameProxy = new Proxy(window, {\n get: function (target, prop) {\n if (prop === 'postMessage') { return bridged; }\n var value = target[prop];\n return typeof value === 'function' ? value.bind(target) : value;\n },\n });\n } catch (e) {\n // Proxy unavailable \u2192 fall back to bridging the real parent.\n try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e2) {}\n }\n // Guard parent/top independently: parent is [Replaceable] so it sticks, but\n // top is [LegacyUnforgeable] (HTML spec) and throws on conforming engines\n // while succeeding on the WebView builds that gate embed detection on it \u2014\n // isolating them means a throw on one never skips the other.\n try { Object.defineProperty(window, 'parent', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}\n try { Object.defineProperty(window, 'top', { configurable: true, get: function () { return frameProxy; } }); } 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 the payload isn't\n * valid JSON with a string `type`, or `url`'s origin isn't a Swapped origin\n * (mirrors web's `isSwappedOrigin(event.origin)` iframe guard).\n *\n * `url` is the page URL to validate against. The caller passes `nativeEvent.url`,\n * falling back to the last committed navigation URL when a webview build omits it\n * (see {@link SwappedWebView}) \u2014 so a missing url here means no trustworthy\n * source, and we fail closed.\n */\nexport function handleWebViewMessage(\n rawData: unknown,\n url?: string,\n): SwappedInboundMessage | null {\n // Fail closed: no verifiable Swapped page URL \u2192 drop.\n if (!url || 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 type SwappedInboundMessage,\n type SwappedSellOrderData,\n isValidOrderData,\n} from '@funkit/connect-core'\nimport { useCallback } from 'react'\n\nimport { logger } from '../logging/logger'\nimport {\n type SwappedScreenBaseProps,\n SwappedScreenShell,\n} from './SwappedScreenShell'\n\nexport interface SwappedWithdrawScreenProps extends SwappedScreenBaseProps {\n /** \"Make another withdrawal\" \u2014 back to the method list. */\n onNewWithdrawal?: () => void\n /** Swapped confirmed the fiat payout side. Payload is opaque. */\n onWithdrawalSuccess?: (data?: unknown) => void\n /** Sell order (deposit address + accepted-token amount). Only validated payloads forward. */\n onOrderData?: (order: SwappedSellOrderData) => void\n}\n\n/**\n * Withdrawal-mode host for the Swapped embed (mirroring web's\n * `WithdrawalSwappedIframeController`): back \u2192 {@link onBack},\n * close \u2192 {@link onClose}, new-withdrawal \u2192 {@link onNewWithdrawal},\n * withdrawal-successful \u2192 {@link onWithdrawalSuccess}, order-data \u2192\n * {@link onOrderData}. Deposit-only messages are ignored \u2014 see\n * `SwappedScreen`.\n */\nexport function SwappedWithdrawScreen({\n url,\n onClose,\n onBack,\n onNewWithdrawal,\n onWithdrawalSuccess,\n onOrderData,\n}: SwappedWithdrawScreenProps) {\n const handleMessage = useCallback(\n (msg: SwappedInboundMessage) => {\n switch (msg.type) {\n case 'SWAPPED_GO_BACK':\n onBack()\n break\n case 'SWAPPED_CLOSE':\n onClose()\n break\n case 'SWAPPED_NEW_WITHDRAWAL':\n logger.info('connect-rn:swapped:new_withdrawal')\n onNewWithdrawal?.()\n break\n case 'SWAPPED_WITHDRAWAL_SUCCESSFUL':\n // No auto-close: the embed shows its own success screen with\n // new-withdrawal/close controls (web parity).\n logger.info('connect-rn:swapped:withdrawal_successful')\n onWithdrawalSuccess?.(msg.data)\n break\n case 'SWAPPED_ORDER_DATA':\n if (!isValidOrderData(msg.data)) {\n // Validation rejection, not an unrecoverable failure (WARN \u2014 the\n // embed keeps its own UI in control).\n logger.warn('connect-rn:swapped:order_data:invalid', {\n data: msg.data ?? {},\n })\n break\n }\n logger.info('connect-rn:swapped:order_data', {\n order_id: msg.data.order_id,\n })\n onOrderData?.(msg.data)\n break\n default:\n // READY / NAVIGATION / LOGOUT / ERROR handled in the shell or\n // tracked elsewhere; deposit-only messages (new-deposit,\n // transaction-successful) belong to SwappedScreen.\n break\n }\n },\n [onBack, onClose, onNewWithdrawal, onWithdrawalSuccess, onOrderData],\n )\n\n return <SwappedScreenShell url={url} onMessage={handleMessage} />\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, getFormOfPaymentDisplayName } 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 /** 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: getFormOfPaymentDisplayName(fop),\n subtitle,\n disabled: !fop.embeddedFlowUrl,\n }\n })\n}\n\n/**\n * Map Swapped payout methods to Withdraw rows. Deliberately NOT {@link toFopRows}:\n * its `getFopsLimit` default invents a \"$10k limit\" when no exchange rate is\n * available, which would misstate a limit on the user's own money (web's\n * `getWithdrawalFopsDisclaimerLimit` returns no limit without rates). Subtitle\n * is timing-only: bank transfers settle in days, everything else is instant.\n */\nexport function toWithdrawFopRows(fops: SwappedFormOfPayment[]): FopRow[] {\n return fops.map((fop) => ({\n id: `${fop.fopType}:${fop.name}`,\n name: getFormOfPaymentDisplayName(fop),\n subtitle:\n fop.fopType === FormOfPaymentType.BANK_TRANSFER\n ? BANK_TRANSFER_TIME\n : 'Instant',\n disabled: !fop.embeddedFlowUrl,\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 { getFiatExchangeRates } from '@funkit/api-base'\nimport { useQuery } from '@tanstack/react-query'\n\nimport { logger } from '../../logging/logger'\n\n/**\n * RN port of web's `useFiatExchangeRates`: the fiat exchange-rate table used to\n * convert the host's USD source balance into Swapped's EUR sell cap. Keyless\n * endpoint, cached for an hour (rates barely move within a session).\n */\nexport function useFiatExchangeRates(enabled = true) {\n const { data, isLoading, error } = useQuery({\n queryKey: ['fiatExchangeRates'],\n queryFn: () => getFiatExchangeRates({ logger }),\n refetchOnMount: false,\n refetchOnReconnect: false,\n refetchOnWindowFocus: false,\n gcTime: 1000 * 60 * 60, // 1 hour\n enabled,\n })\n\n return { data, isLoading, error }\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 useSwappedDefaultCurrencyQuery,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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'\nimport { isMallardApiKey } from '../utils/customers'\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 // Mallard wants the externalUserId as wallet address\n // so we don't want to prefix it with the apiKey\n if (isMallardApiKey(apiKey)) {\n return externalUserId\n }\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 { MALLARD_API_KEY } from '@funkit/api-base'\n\nexport function isMallardApiKey(apiKey: string): boolean {\n return apiKey === MALLARD_API_KEY\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 } from '@funkit/connect-core'\n\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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 {\n RailConfigType,\n type SwappedFormOfPayment,\n getFops,\n} from '@funkit/api-base'\nimport {\n DEFAULT_FIAT_CURRENCY,\n FOPS_STALE_TIME,\n SWAPPED_MIN_SELL_EUR,\n type SwappedWithdrawalLegs,\n findSwappedSourceOverride,\n getExchangeRate,\n resolveSwappedWithdrawalLegs,\n sortFops,\n useSwappedDefaultCurrencyQuery,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\nimport { useTheme } from '@shopify/restyle'\nimport { useStatsigClient } from '@statsig/react-bindings'\nimport { useQuery } from '@tanstack/react-query'\nimport { useMemo } from 'react'\n\nimport type {\n WithdrawalFlowConfig,\n WithdrawalToken,\n} from '../../flow/withdrawalFlowConfig'\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 { useFiatExchangeRates } from './useFiatExchangeRates'\n\n/** Base react-query key for the withdrawal `/fops` query \u2014 shared with the\n * flow's invalidation so the two can't drift. */\nexport const WITHDRAW_FOPS_QUERY_KEY = 'withdrawFops'\n\nexport interface UseWithdrawalFopsParams {\n config: WithdrawalFlowConfig\n enabled?: boolean\n}\n\nexport interface UseWithdrawalFopsResult {\n /**\n * Generic cash payout methods (Card / Bank Transfer / \u2026). Saved FOPs are not\n * supported for withdrawals (web parity) and are never returned.\n */\n fops: SwappedFormOfPayment[]\n isLoading: boolean\n isError: boolean\n /**\n * True only once we KNOW there's nothing to show (gate off, or a settled\n * fetch returned zero) \u2014 never during a load, so the non-retryable\n * \"unavailable\" screen can't flash.\n */\n noPaymentMethodsAvailable: boolean\n /** Source balance can't clear Swapped's \u20AC7 minimum sell (cash impossible). */\n isBelowMinimumBalance: boolean\n refetch: () => void\n /** Whether the Statsig `enableswappedwithdrawal` gate is on for this apiKey. */\n isWithdrawalEnabled: boolean\n /** Resolved source\u2192accepted-token route, shared by the fops fetch and quote. */\n route: SwappedWithdrawalLegs\n}\n\n// \u2500\u2500 Step: resolve the withdrawal route \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n/**\n * Resolve the on-chain route legs (source the user sells \u2192 the token Swapped\n * accepts), applying the Statsig `swappedwithdrawalsourceoverrides` rule.\n * Memoized so the returned object stays referentially stable for the downstream\n * execution `useCallback`.\n */\nfunction useWithdrawalRoute(\n config: WithdrawalFlowConfig,\n): SwappedWithdrawalLegs {\n const sourceOverrides = useDynamicConfig('swappedwithdrawalsourceoverrides')\n return useMemo(\n () =>\n resolveSwappedWithdrawalLegs({\n source: config.sourceToken,\n target: config.swappedAcceptedToken,\n override: findSwappedSourceOverride(sourceOverrides, {\n chainId: config.sourceToken.chainId,\n tokenAddress: config.sourceToken.address,\n }),\n }),\n [config.sourceToken, config.swappedAcceptedToken, sourceOverrides],\n )\n}\n\n// \u2500\u2500 Step: source balance \u2192 EUR sell cap \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\ninterface WithdrawalSellCap {\n /** Host balance in USD (0 when none is configured or it hasn't resolved). */\n usdBalance: number\n /** Floored EUR cap forwarded to Swapped, or undefined when uncapped. */\n eurMax: number | undefined\n /** Balance can't clear Swapped's EUR minimum \u2192 cash methods are impossible. */\n isBelowMinimumBalance: boolean\n /** A cap is still resolving \u2014 hold /fops so its first request isn't uncapped. */\n isAwaitingCap: boolean\n}\n\n/**\n * Resolve the host's USD balance and derive the EUR sell cap (web parity:\n * `WithdrawalMethodSelect`). A callback balance (e.g. an on-chain `balanceOf`)\n * is fetched via query; a plain number is used as-is.\n */\nfunction useWithdrawalSellCap(\n config: WithdrawalFlowConfig,\n walletAddress: string,\n): WithdrawalSellCap {\n const { sourceUsdBalance } = config\n const isBalanceCallback = typeof sourceUsdBalance === 'function'\n const hasBalanceInfo = sourceUsdBalance != null\n\n const balanceQuery = useQuery({\n queryKey: [\n 'withdrawSourceUsdBalance',\n walletAddress,\n config.sourceToken.chainId,\n config.sourceToken.address,\n ] as const,\n queryFn: async () => {\n const value = isBalanceCallback ? await sourceUsdBalance() : 0\n return Number.isFinite(value) && value > 0 ? value : 0\n },\n enabled: isBalanceCallback && !!walletAddress && walletAddress !== '0x',\n staleTime: 30_000,\n refetchOnWindowFocus: false,\n })\n const isLoadingBalance = isBalanceCallback && balanceQuery.isLoading\n // Sanitize both paths \u2014 the callback result is already clamped in its queryFn,\n // but a host could also pass a negative / NaN plain number.\n const rawUsdBalance = isBalanceCallback\n ? (balanceQuery.data ?? 0)\n : (sourceUsdBalance ?? 0)\n const usdBalance =\n Number.isFinite(rawUsdBalance) && rawUsdBalance > 0 ? rawUsdBalance : 0\n\n // markup 0 so the cap reflects the true balance (not an inflated +5%); floor\n // it so the sell never exceeds what the user holds and the fops query key\n // stays stable against sub-unit balance jitter (web parity).\n //\n // Enabled on `hasBalanceInfo` (not `usdBalance > 0`) so the keyless rates\n // table fetches in parallel with the balance callback instead of waiting for\n // it \u2014 `isAwaitingCap` still holds /fops until both resolve.\n const { data: exchangeRates, isLoading: isLoadingRates } =\n useFiatExchangeRates(hasBalanceInfo)\n const eurRate = getExchangeRate('EUR', exchangeRates, 0)\n const eurMax =\n eurRate && usdBalance > 0 ? Math.floor(usdBalance * eurRate) : undefined\n\n const cashMinUsd = eurRate ? SWAPPED_MIN_SELL_EUR / eurRate : undefined\n const isBelowMinimumBalance =\n hasBalanceInfo &&\n !isLoadingBalance &&\n cashMinUsd != null &&\n usdBalance < cashMinUsd\n\n const isAwaitingCap =\n hasBalanceInfo && (isLoadingBalance || (usdBalance > 0 && isLoadingRates))\n\n return { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap }\n}\n\n// \u2500\u2500 Step: the /fops request \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\ninterface FetchWithdrawalFopsArgs {\n apiKey: string\n userId: string\n walletAddress: string\n countryCode: string\n swappedCurrencyCode: string\n fopPriority: Parameters<typeof sortFops>[1]\n themeConfig: ReturnType<typeof buildSwappedThemeQueryParamsRN>\n route: SwappedWithdrawalLegs\n eurMax: number | undefined\n usdBalance: number\n /** The user's raw source token \u2014 for the route-decision log only. */\n sourceToken: WithdrawalToken\n}\n\n/**\n * Fetch + sort the Swapped `CRYPTO_TO_FIAT` payout methods for the accepted\n * token. The rail's `sourceToken` is the resolved ACCEPTED token (not the\n * user's raw source) \u2014 mirroring web, where the override/config target feeds\n * the `/fops` rail. `recipientAddress`/`destinationToken` are schema-required\n * but ignored for off-ramp; the wallet address fills the former.\n */\nasync function fetchWithdrawalFops({\n apiKey,\n userId,\n walletAddress,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route,\n eurMax,\n usdBalance,\n sourceToken,\n}: FetchWithdrawalFopsArgs): Promise<SwappedFormOfPayment[]> {\n const acceptedToken = {\n chainId: route.targetChainId,\n address: route.targetTokenAddress,\n }\n\n // Decision point: which accepted-token rail we request the methods for, and\n // why (Statsig source override vs configured/source token). Logged at fetch\n // time so sessions that list methods but never place an order still record\n // how the route was chosen (web parity: `withdraw-fops`).\n logger.info('connect-rn:withdrawFops:source_override', {\n overrideApplied: route.overrideApplied,\n sourceChainId: sourceToken.chainId,\n sourceTokenAddress: sourceToken.address,\n acceptedChainId: route.targetChainId,\n acceptedTokenAddress: route.targetTokenAddress,\n acceptedTokenSymbol: route.targetTokenSymbol,\n })\n\n // Decision point: whether the balance-derived EUR cap is forwarded as the\n // sell limit or suppressed (at/below the minimum \u2014 a contradictory range).\n const capForwarded = eurMax != null && eurMax > SWAPPED_MIN_SELL_EUR\n logger.info('connect-rn:withdrawFops:sellLimits', {\n defaultMinAmount: SWAPPED_MIN_SELL_EUR,\n usdBalance,\n eurMax,\n capForwarded,\n })\n\n const response = await getFops({\n apiKey,\n logger,\n params: {\n recipientAddress: walletAddress,\n userId,\n destinationToken: acceptedToken,\n fiatCurrencyCode: swappedCurrencyCode,\n countryCode,\n railConfigs: [\n {\n type: RailConfigType.CRYPTO_TO_FIAT,\n userId,\n countryCode,\n fiatCurrencyCode: swappedCurrencyCode,\n sourceToken: acceptedToken,\n thirdPartyPaymentConfigs: { swapped: { themeConfig } },\n checkoutLimitsCriteria: {\n defaultMinAmount: SWAPPED_MIN_SELL_EUR,\n // Balance-derived cap; only meaningful above the minimum.\n ...(capForwarded ? { defaultMaxAmount: eurMax } : {}),\n },\n },\n ],\n },\n })\n\n const fops = sortFops(response.genericFormsOfPayments, fopPriority)\n if (fops.length === 0) {\n logger.info('connect-rn:withdrawFops:empty', {\n countryCode,\n targetChainId: route.targetChainId,\n targetTokenAddress: route.targetTokenAddress,\n })\n }\n return fops\n}\n\n// \u2500\u2500 Hook \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n/**\n * RN port of web's `useWithdrawFops`. Orchestrates the steps: resolve the\n * accepted-token legs, the region country/currency, the balance-derived sell\n * cap, then run the gated `/fops` query.\n */\nexport function useWithdrawalFops({\n config,\n enabled = true,\n}: UseWithdrawalFopsParams): UseWithdrawalFopsResult {\n const { apiKey, userId } = useFunkitIdentity()\n // Statsig readiness: while it's loading, the gate reads its `false` fallback,\n // which is indistinguishable from a genuinely-off gate \u2014 treat init as\n // loading, not \"unavailable\".\n const { isLoading: isStatsigLoading } = useStatsigClient()\n const isWithdrawalEnabled = !!useDynamicConfig('enableswappedwithdrawal')\n const fopPriority = useDynamicConfig('foppriority')\n const walletAddress = config.withdrawalWallet.address()\n\n const route = useWithdrawalRoute(config)\n\n // Country from the user's IP; no default (web parity). How an unresolved or\n // empty country is handled lives downstream: the fetch holds on it (isEnabled)\n // and a settled-but-empty lookup surfaces as an error (isError).\n const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo()\n const countryCode = userIpInfo?.alpha2\n\n // Region-default fiat currency (web parity); falls back to USD. Gating /fops\n // on its loading state avoids an initial USD fetch that refetches once the\n // 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 { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap } =\n useWithdrawalSellCap(config, walletAddress)\n\n const isEnabled =\n enabled &&\n isWithdrawalEnabled &&\n !!apiKey &&\n !!userId &&\n !!walletAddress &&\n walletAddress !== '0x' &&\n !!countryCode &&\n !isSwappedCurrencyCodeLoading &&\n !isAwaitingCap\n\n const query = useQuery({\n queryKey: [\n WITHDRAW_FOPS_QUERY_KEY,\n userId,\n walletAddress,\n apiKey,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route.targetChainId,\n route.targetTokenAddress,\n eurMax,\n ] as const,\n // `countryCode` is guaranteed by `isEnabled` (query stays disabled until it\n // resolves); the guard just narrows the type \u2014 the empty fallback is unreachable.\n queryFn: () =>\n countryCode\n ? fetchWithdrawalFops({\n apiKey,\n userId,\n walletAddress,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route,\n eurMax,\n usdBalance,\n sourceToken: config.sourceToken,\n })\n : Promise.resolve([]),\n enabled: isEnabled,\n staleTime: FOPS_STALE_TIME,\n refetchOnWindowFocus: false,\n })\n\n // Loading spans every window where the answer isn't knowable yet: Statsig\n // init, the geo lookup, the region-currency lookup, the balance/rate cap\n // resolution, and the enabled fops fetch.\n const isLoading =\n isStatsigLoading ||\n isLoadingGeoCheck ||\n isSwappedCurrencyCodeLoading ||\n isAwaitingCap ||\n (isEnabled && query.isLoading)\n\n // Known-empty only once we actually know: gate confirmed off (Statsig\n // settled) or a settled fetch that returned nothing. Never during a load.\n const noPaymentMethodsAvailable =\n !isLoading &&\n (!isWithdrawalEnabled ||\n (query.isSuccess && (query.data?.length ?? 0) === 0))\n\n return {\n fops: query.data ?? [],\n isLoading,\n noPaymentMethodsAvailable,\n isBelowMinimumBalance,\n // Tie the query error to isEnabled (\"gate off \u21D2 no error\"), plus web's\n // no-country case: geo settled without a country is unrecoverable here.\n isError:\n (isEnabled && query.isError) || (!isLoadingGeoCheck && !countryCode),\n // Respect the enabled gate \u2014 refetch() would otherwise force a fetch even\n // when disabled (e.g. no resolved country).\n refetch: () => {\n if (isEnabled) void query.refetch()\n },\n isWithdrawalEnabled,\n route,\n }\n}\n", "import {\n type SwappedSellOrderData,\n type SwappedWithdrawalLegs,\n ensureRelayClientInitialized,\n isUserRejectedError,\n processFiatWithdrawalOrder,\n toFiatWithdrawalOrder,\n} from '@funkit/connect-core'\nimport { useCallback, useRef } from 'react'\n\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from '../flow/withdrawalFlowConfig'\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { getPublicClientFor } from './publicClient'\n\n// Module-scoped so a submitted order stays deduped across sheet close/reopen \u2014\n// the hook (and its refs) unmount on close, but the embed can re-emit\n// SWAPPED_ORDER_DATA for the same order_id after a reopen. Provider order ids\n// are globally unique, so a process-wide set is safe.\nconst submittedOrderIds = new Set<string>()\n\n/**\n * @internal Test-only: clear the process-wide submitted-order dedupe set so\n * suites that reuse order ids stay isolated. Not part of the public API.\n */\nexport function __resetSubmittedWithdrawalOrders(): void {\n submittedOrderIds.clear()\n}\n\nexport interface UseWithdrawalExecutionParams {\n config: WithdrawalFlowConfig\n /** The route resolved by `useWithdrawalFops` \u2014 one resolution for fetch + quote. */\n route: SwappedWithdrawalLegs\n callbacks: WithdrawalFlowCallbacks\n /** Unrecoverable failure \u2014 the flow shows its error state. */\n onError: () => void\n}\n\n/**\n * Thin React wrapper over connect-core's `processFiatWithdrawalOrder`: owns\n * the control-flow guards for the unreliable embed message stream and maps\n * outcomes onto host callbacks. The guards are intentionally refs, not state \u2014\n * both are read synchronously inside the async `executeOrder` (a re-entrancy\n * flag set before the first await, and a dedupe set) and must not re-render.\n */\nexport function useWithdrawalExecution({\n config,\n route,\n callbacks,\n onError,\n}: UseWithdrawalExecutionParams): {\n executeOrder: (data: SwappedSellOrderData) => Promise<void>\n} {\n const { apiKey, userId } = useFunkitIdentity()\n\n const isProcessingRef = useRef(false)\n\n const executeOrder = useCallback(\n async (data: SwappedSellOrderData) => {\n const order = toFiatWithdrawalOrder(data)\n if (isProcessingRef.current) {\n logger.warn('connect-rn:withdrawal:already_processing', {\n order_id: order.orderId,\n })\n return\n }\n if (submittedOrderIds.has(order.orderId)) {\n logger.warn('connect-rn:withdrawal:duplicate', {\n order_id: order.orderId,\n })\n return\n }\n isProcessingRef.current = true\n\n // Routing decision point: the requested target (config) vs the enforced\n // target (after the Statsig source override) alongside what the provider\n // reported it accepts, for off-ramp reconciliation (web parity).\n logger.info('connect-rn:withdrawal:route_decision', {\n order_id: order.orderId,\n overrideApplied: route.overrideApplied,\n requestedTargetChainId: config.swappedAcceptedToken?.chainId,\n requestedTargetTokenAddress: config.swappedAcceptedToken?.address,\n enforcedTargetChainId: route.targetChainId,\n enforcedTargetTokenAddress: route.targetTokenAddress,\n enforcedTargetTokenSymbol: route.targetTokenSymbol,\n providerCrypto: order.providerCrypto,\n providerNetwork: order.providerNetwork,\n })\n\n let txHash: string\n try {\n ensureRelayClientInitialized(logger, 'funkit-connect-rn')\n ;({ txHash } = await processFiatWithdrawalOrder({\n order,\n wallet: config.withdrawalWallet,\n legs: route,\n apiKey,\n userId,\n logger,\n // Read the target token's decimals on-chain (via publicClient) rather\n // than trusting host-config `decimals` \u2014 a stale/wrong value would\n // mis-scale the amount transferred to Swapped's deposit address.\n publicClient: getPublicClientFor(Number(route.targetChainId)),\n }))\n } catch (error) {\n if (isUserRejectedError(error)) {\n // The user declined the signature \u2014 the embed stays interactive.\n logger.warn('connect-rn:withdrawal:user_rejected', {\n order_id: order.orderId,\n })\n return\n }\n // Unrecoverable: funds did not move (or the record failed) and the\n // user sees the error state.\n logger.error('connect-rn:withdrawal:execution_failed', error as Error, {\n order_id: order.orderId,\n })\n callbacks.onWithdrawalError?.({\n message: error instanceof Error ? error.message : String(error),\n })\n onError()\n return\n } finally {\n isProcessingRef.current = false\n }\n\n // Funds moved \u2014 mark submitted and correlate the provider order id to the\n // on-chain hash. The host callback runs in its own guard: a throw here is\n // NOT an execution failure (money already moved), so it must not fall into\n // the error path above and fire `onWithdrawalError` for a success.\n submittedOrderIds.add(order.orderId)\n try {\n callbacks.onWithdrawalSubmitted?.(order.orderId, txHash)\n } catch (error) {\n logger.warn('connect-rn:withdrawal:submitted_callback_threw', {\n order_id: order.orderId,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n },\n [apiKey, userId, config, route, callbacks, onError],\n )\n\n return { executeOrder }\n}\n", "import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from '@funkit/chains'\nimport { type PublicClient, createPublicClient, fallback, http } from 'viem'\n\n// One lazy client per chain \u2014 execution only ever needs the target chain's\n// erc20 `decimals()` read, so this stays tiny.\nconst clients = new Map<number, Pick<PublicClient, 'readContract'>>()\n\n/**\n * Read-only client for a funkit-supported chain, built over the chain's\n * fallback RPC list from @funkit/chains (the chain's default RPC may be\n * private \u2014 e.g. the Robinhood chain \u2014 so the curated list matters).\n * `undefined` for unsupported chain ids; the caller surfaces that as a\n * mis-routed target.\n */\nexport function getPublicClientFor(\n chainId: number,\n): Pick<PublicClient, 'readContract'> | undefined {\n const cached = clients.get(chainId)\n if (cached) return cached\n\n const info = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[chainId]\n if (!info) return undefined\n\n const client = createPublicClient({\n chain: info.chainInfo,\n transport: info.fallbackRpcUrls.length\n ? fallback(info.fallbackRpcUrls.map((url) => http(url)))\n : http(),\n })\n clients.set(chainId, client)\n return client\n}\n", "import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base'\nimport { getSupportedAssets } from '@funkit/api-base'\nimport {\n isTransferChainEnabled,\n resolveTokenTransferConfig,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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.background.modal,\n borderTopLeftRadius: theme.borderRadii.modal,\n borderTopRightRadius: theme.borderRadii.modal,\n }\n const extension: ViewStyle = {\n ...bottomExtension,\n backgroundColor: theme.background.modal,\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\n// Hardcoded SDK marker (not UA/OS-parsed, so present on every eval). Lets a\n// config shared with the web SDK be scoped per-SDK via a targeting rule.\nexport const STATSIG_SDK_TYPE = 'react-native' as const\n\n/**\n * Statsig user for the RN SDK: `customIDs.apiKey` drives customer-gated configs;\n * `custom.sdkType` scopes shared configs to this SDK (see {@link STATSIG_SDK_TYPE}).\n */\nexport function buildFunkitStatsigUser(\n userId: string,\n apiKey: string,\n): StatsigUser {\n return {\n userID: userId,\n customIDs: { apiKey },\n custom: { sdkType: STATSIG_SDK_TYPE },\n }\n}\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 const user = useMemo<StatsigUser>(\n () => buildFunkitStatsigUser(userId, 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'\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from '../flow/withdrawalFlowConfig'\n\n/** Lifecycle callbacks for both managed flows (overlapping keys are identical). */\nexport type FunkitCheckoutCallbacks = DepositFlowCallbacks &\n WithdrawalFlowCallbacks\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). `beginWithdrawal(config)` opens the\n * fiat-offramp withdrawal flow (payout methods \u2192 Swapped sell embed).\n * `beginCheckout` will be added here as that flow lands, matching the web\n * surface.\n */\nexport function useFunkitCheckout(callbacks: FunkitCheckoutCallbacks = {}) {\n const { beginDeposit: openDepositFlow, beginWithdrawal: openWithdrawalFlow } =\n useFunkitFlow()\n\n const beginDeposit = useCallback(\n (config: DepositFlowConfig) => openDepositFlow(config, callbacks),\n [openDepositFlow, callbacks],\n )\n\n const beginWithdrawal = useCallback(\n (config: WithdrawalFlowConfig) => openWithdrawalFlow(config, callbacks),\n [openWithdrawalFlow, callbacks],\n )\n\n return { beginDeposit, beginWithdrawal }\n}\n", "import type { DirectExecution } from '@funkit/api-base'\nimport {\n type PurifiedCheckoutHistoryItem,\n processRecentDepositsForNotifications,\n purifyCheckoutHistoryItem,\n useRecentDepositsApiQuery,\n} from '@funkit/connect-core'\nimport { useMemo } from 'react'\n\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\n\ninterface UseFunkitRecentDepositsParams {\n isVisible: boolean\n fetchSize?: number\n cutOffTimeMs?: number\n /**\n * Optional filter to refine which deposits are returned. Pass a stable\n * reference (`useCallback`) \u2014 an unstable one recomputes the merge each render.\n */\n memoizedFilterFunc?: (de: DirectExecution) => boolean\n}\n\n/**\n * Fetch the current user's recent deposits, polling the funkit server. Mirrors\n * `@funkit/connect`'s `useFunkitRecentDeposits`.\n *\n * **Requirements**: must be used inside `<FunkitProvider>` \u2014 it reads the\n * apiKey/userId configured there and the shared refresh interval. The `'0x'`\n * sentinel (no wallet / no externalUserId) disables polling.\n *\n * @returns `{ data }` \u2014 purified deposit rows, or `undefined` while loading.\n *\n * @example\n * ```tsx\n * const { data: recentDeposits } = useFunkitRecentDeposits({\n * isVisible: true,\n * fetchSize: 10,\n * cutOffTimeMs: 24 * 60 * 60 * 1000, // last 24h\n * })\n * ```\n */\nexport function useFunkitRecentDeposits({\n isVisible,\n fetchSize = 5,\n cutOffTimeMs,\n memoizedFilterFunc,\n}: UseFunkitRecentDepositsParams): {\n data: PurifiedCheckoutHistoryItem[] | undefined\n} {\n const { apiKey, userId } = useFunkitIdentity()\n const { listRefresh } = useDynamicConfig(\n 'checkoutnotificationsrefreshinterval',\n )\n const effectiveUserId = userId === '0x' ? '' : userId\n\n const { data: directExecutions } = useRecentDepositsApiQuery({\n isVisible,\n apiKey,\n userId: effectiveUserId,\n refreshIntervalMs: listRefresh,\n fetchSize: fetchSize * 2, // over-fetch to account for merging\n logger,\n })\n\n const mergedDirectExecutions = useMemo(\n () =>\n processRecentDepositsForNotifications(\n memoizedFilterFunc\n ? directExecutions?.filter(memoizedFilterFunc)\n : directExecutions,\n { cutOffTimeMs },\n ),\n [directExecutions, cutOffTimeMs, memoizedFilterFunc],\n )\n\n return useMemo(\n () => ({\n data: mergedDirectExecutions\n ?.map((de) => purifyCheckoutHistoryItem(de))\n .slice(0, fetchSize),\n }),\n [mergedDirectExecutions, fetchSize],\n )\n}\n", "import {\n getCheckoutsByUserId,\n getDirectExecutionsByUserId,\n} from '@funkit/api-base'\nimport {\n type PurifiedCheckoutHistoryItem,\n purifyCheckoutHistoryItem,\n} from '@funkit/connect-core'\nimport { useQuery } from '@tanstack/react-query'\n\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\n\nconst CHECKOUT_HISTORY_HOOK_LIMIT = 100\n\n/**\n * Poll the current user's checkout + deposit history, mirroring\n * `@funkit/connect`'s `useCheckoutsListenerByUserId`. Fetches both checkouts and\n * direct executions, purifies them, and returns a single list sorted\n * newest-first.\n *\n * **Requirements**: must be used inside `<FunkitProvider>`. `userId` is optional\n * and defaults to the identity configured there \u2014 RN's `userId` is a synthetic\n * internal id the host can't easily supply, so the common case is to omit it.\n * The `'0x'` sentinel (no wallet / no externalUserId) disables polling.\n *\n * @returns `{ data, isLoading }` \u2014 purified rows, or `undefined` while loading.\n */\nexport function useCheckoutsListenerByUserId(userId?: string): {\n data?: PurifiedCheckoutHistoryItem[]\n isLoading: boolean\n} {\n const { apiKey, userId: identityUserId } = useFunkitIdentity()\n const { listRefresh } = useDynamicConfig(\n 'checkoutnotificationsrefreshinterval',\n )\n\n const resolvedUserId = userId ?? identityUserId\n const effectiveUserId = resolvedUserId === '0x' ? '' : resolvedUserId\n\n const { data, isLoading } = useQuery({\n enabled: !!effectiveUserId,\n queryKey: ['getPurifiedCheckoutsByUserId', effectiveUserId],\n queryFn: async () => {\n const [checkouts, directExecutions] = await Promise.all([\n getCheckoutsByUserId({\n apiKey,\n logger,\n userId: effectiveUserId,\n limit: CHECKOUT_HISTORY_HOOK_LIMIT,\n }),\n getDirectExecutionsByUserId({\n apiKey,\n logger,\n userId: effectiveUserId,\n limit: CHECKOUT_HISTORY_HOOK_LIMIT,\n }),\n ])\n\n return [...checkouts, ...directExecutions]\n .map(purifyCheckoutHistoryItem)\n .sort((a, b) => b.createdTimeMs - a.createdTimeMs)\n .slice(0, CHECKOUT_HISTORY_HOOK_LIMIT)\n },\n refetchInterval: listRefresh,\n })\n\n return { data, isLoading }\n}\n"],
5
- "mappings": ";AA0JO,SAAS,oBACd,QACA,WACQ;AACR,SAAO,GAAG,MAAM,IAAI,SAAS;AAC/B;AAGO,IAAM,wBAGT;AAAA,EACF,SAAS;AAAA,EACT,QAAQ;AACV;AAEO,IAAM,cAA4B;AAAA,EACvC,YAAY;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,SAAS,EAAE,SAAS,WAAW,SAAS,UAAU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AAE,QAAQ,QAAQ,eAAe,IAAI,kBAAkB;AAC7D,QAAM,EAAE,YAAY,IAAI;AAAA,IACtB;AAAA,EACF;AAEA,QAAM,iBAAiB,UAAU;AACjC,QAAM,kBAAkB,mBAAmB,OAAO,KAAK;AAEvD,QAAM,EAAE,MAAM,UAAU,IAAIC,UAAS;AAAA,IACnC,SAAS,CAAC,CAAC;AAAA,IACX,UAAU,CAAC,gCAAgC,eAAe;AAAA,IAC1D,SAAS,YAAY;AACnB,YAAM,CAAC,WAAW,gBAAgB,IAAI,MAAM,QAAQ,IAAI;AAAA,QACtD,qBAAqB;AAAA,UACnB;AAAA,UACA;AAAA,UACA,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,QACD,4BAA4B;AAAA,UAC1B;AAAA,UACA;AAAA,UACA,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,aAAO,CAAC,GAAG,WAAW,GAAG,gBAAgB,EACtC,IAAIC,0BAAyB,EAC7B,KAAK,CAAC,GAAG,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAChD,MAAM,GAAG,2BAA2B;AAAA,IACzC;AAAA,IACA,iBAAiB;AAAA,EACnB,CAAC;AAED,SAAO,EAAE,MAAM,UAAU;AAC3B;",
6
- "names": ["fallback", "Text", "jsx", "useMemo", "useState", "jsx", "useState", "useMemo", "useEffect", "useMemo", "useRef", "BottomSheetBackdrop", "BottomSheetModal", "BottomSheetView", "useStatsigClient", "createContext", "useCallback", "useContext", "useEffect", "useMemo", "useRef", "useState", "StyleSheet", "View", "useSafeAreaInsets", "useEffect", "useMemo", "useMemo", "useEffect", "useEffect", "useState", "SvgXml", "jsx", "useState", "useEffect", "SvgXml", "SvgXml", "jsx", "jsx", "SvgXml", "jsx", "SvgXml", "jsx", "SvgXml", "jsx", "jsx", "jsxs", "toIconUri", "jsx", "jsxs", "useEffect", "useState", "Animated", "Easing", "Keyframe", "StyleSheet", "jsx", "styles", "StyleSheet", "jsx", "jsxs", "Easing", "Keyframe", "useState", "useEffect", "Animated", "useRef", "useState", "Pressable", "ScrollView", "jsx", "jsxs", "useState", "useRef", "topBar", "ScrollView", "listContent", "row", "iconRing", "Pressable", "Pressable", "StyleSheet", "jsx", "jsxs", "styles", "Pressable", "StyleSheet", "useEffect", "useRef", "useState", "Pressable", "useWindowDimensions", "SvgXml", "jsx", "SvgXml", "jsx", "jsxs", "useState", "useRef", "useEffect", "topBar", "topBarSpacer", "Pressable", "buttonContainer", "useEffect", "useRef", "useState", "Pressable", "useSafeAreaInsets", "useEffect", "useState", "Pressable", "Animated", "Easing", "jsx", "jsxs", "toIconUri", "useState", "useEffect", "AnimatedPressable", "Animated", "Pressable", "Easing", "jsx", "jsxs", "useSafeAreaInsets", "useState", "useRef", "useEffect", "topBar", "Pressable", "content", "addressGroup", "addressText", "jsx", "useCallback", "useCallback", "useTheme", "useCallback", "useEffect", "useMemo", "useRef", "View", "content", "jsx", "useRef", "useMemo", "useTheme", "useEffect", "useCallback", "View", "jsx", "useCallback", "sheet", "jsx", "useCallback", "useCallback", "jsx", "useCallback", "solanaChain", "useTheme", "useQuery", "useMemo", "createContext", "useContext", "jsx", "createContext", "useContext", "useQuery", "useMemo", "useQuery", "useTheme", "useMemo", "useQuery", "solanaChain", "getFops", "DEFAULT_FIAT_CURRENCY", "FOPS_STALE_TIME", "sortFops", "useSwappedDefaultCurrencyQuery", "useTheme", "useQuery", "useMemo", "useMemo", "useQuery", "getFops", "sortFops", "DEFAULT_FIAT_CURRENCY", "useSwappedDefaultCurrencyQuery", "useTheme", "FOPS_STALE_TIME", "useCallback", "useRef", "useRef", "useCallback", "useQuery", "useMemo", "useQuery", "useMemo", "bitcoinChain", "solanaChain", "tronChain", "getDepositAddressForChain", "getMinTransferValueForChain", "solanaChain", "bitcoinChain", "tronChain", "getMinTransferValueForChain", "getDepositAddressForChain", "jsx", "useCallback", "useEffect", "useRef", "View", "Easing", "useEffect", "useState", "jsx", "jsxs", "content", "useRef", "useCallback", "useEffect", "Easing", "View", "Fragment", "jsx", "jsxs", "createContext", "copyToClipboard", "useSafeAreaInsets", "useState", "useCallback", "useMemo", "useRef", "useEffect", "View", "useStatsigClient", "screen", "BottomSheetBackdrop", "row", "BottomSheetModal", "BottomSheetView", "StyleSheet", "useContext", "useMemo", "Platform", "jsx", "useMemo", "jsx", "copyToClipboard", "useRef", "useMemo", "useEffect", "useCallback", "useCallback", "useMemo", "useMemo", "purifyCheckoutHistoryItem", "useQuery", "useQuery", "purifyCheckoutHistoryItem"]
3
+ "sources": ["../src/theme/tokens.ts", "../src/theme/toRestyleTheme.ts", "../src/theme/buildFunkitTheme.ts", "../src/theme/themes.ts", "../src/theme/useColorScheme.ts", "../src/theme/useFunkitTheme.ts", "../src/theme/restyle.ts", "../src/theme/FunkitThemeProvider.tsx", "../src/providers/FunkitProvider.tsx", "../src/flow/FunkitFlowProvider.tsx", "../src/statsig/useDynamicConfig.ts", "../src/geo/useUserIpInfo.ts", "../src/logging/logger.ts", "../src/logging/datadogHttpLogTransport.ts", "../src/geo/useCheckoutBlocked.ts", "../src/geo/isCountryBlocked.ts", "../src/icons/PaymentMethodIcon.tsx", "../src/icons/assetLogos.ts", "../src/icons/FunIcon.tsx", "../src/icons/PaymentBrandIcons.tsx", "../src/providers/FunkitI18nProvider.tsx", "../src/locales/i18n.ts", "../src/locales/translations/en.json", "../src/locales/translations/es.json", "../src/locales/translations/fr.json", "../src/locales/translations/ja.json", "../src/locales/translations/ko.json", "../src/locales/translations/ru.json", "../src/locales/translations/tr.json", "../src/locales/translations/zh.json", "../src/icons/CryptoBitcoinIcon.tsx", "../src/icons/funIconUri.ts", "../src/icons/QrChainCluster.tsx", "../src/icons/FigmaSystemIcons.tsx", "../src/icons/SourceTokenCluster.tsx", "../src/icons/TokenChainIcon.tsx", "../src/screens/SelectMethodScreen.tsx", "../src/icons/StatusIcon.tsx", "../src/screens/AvailableChainsScreen.tsx", "../src/screens/CheckoutBlockedScreen.tsx", "../src/screens/QrCodeScreen.tsx", "../src/hooks/useScreenSize.ts", "../src/icons/CopyAddressIcon.tsx", "../src/screens/TransferCryptoScreen.tsx", "../src/screens/NetworkSelector.tsx", "../src/screens/WithdrawMethodScreen.tsx", "../src/swapped/SwappedScreen.tsx", "../src/swapped/SwappedScreenShell.tsx", "../src/swapped/SwappedWebView.tsx", "../src/swapped/buildSwappedTheme.ts", "../src/swapped/webViewSwappedTransport.ts", "../src/swapped/SwappedWithdrawScreen.tsx", "../src/transfer/availableChains.ts", "../src/transfer/clipboard.ts", "../src/transfer/fops.ts", "../src/transfer/formatDepositAddress.ts", "../src/transfer/hooks/useFiatExchangeRates.ts", "../src/transfer/hooks/useFops.ts", "../src/identity/IdentityContext.tsx", "../src/utils/customers.ts", "../src/transfer/hooks/useTransferInit.ts", "../src/transfer/hooks/useUDAParams.ts", "../src/transfer/hooks/useWithdrawalFops.ts", "../src/withdrawal/useWithdrawalExecution.ts", "../src/withdrawal/publicClient.ts", "../src/transfer/hooks/useSupportedTokens.ts", "../src/transfer/supportedTokens.ts", "../src/transfer/hooks/useTokenTransfer.ts", "../src/transfer/QrCode.tsx", "../src/flow/AddressCopiedToast.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", "../src/history/useRecentDeposits.ts", "../src/history/useCheckoutsListenerByUserId.ts"],
4
+ "sourcesContent": ["// Local design tokens for @funkit/connect-rn, generated from the \"Fun Variables\"\n// Figma export (`Fun Variables/{Light,Dark}.tokens.json`). This file is a STRICT\n// mirror of that export: the token tree reproduces Figma's variable HIERARCHY\n// one-to-one (`background` / `content` / `border` / `font` / `spacing` / `brand`\n// / `button` / `opacity`), values are the resolved concrete values, and nothing\n// is invented \u2014 if a state (hover, focused, \u2026) or token isn't in Fun Variables,\n// it isn't here either.\n//\n// Multi-word Figma leaves are camelCased so they're valid TS identifiers\n// (`element-inner` \u2192 `elementInner`, `loading alpha` \u2192 `loadingAlpha`,\n// `amount input` \u2192 `amountInput`, `top bar` \u2192 `topBar`); the nesting is\n// otherwise identical to the JSON.\n//\n// `buildFunkitTheme` (buildFunkitTheme.ts) FLATTENS this tree into the flat\n// `@shopify/restyle` theme components consume (`bgButtonPrimary`, \u2026). The\n// Figma-path \u2192 flat-key convention is documented in\n// `packages/connect-rn/CLAUDE.md` (\u00A7 \"Figma Fun Variables \u2192 tokens.ts\").\n//\n// connect-rn's theme is intentionally NOT shared with @funkit/connect-core (web\n// keeps its separate `ThemeVars`).\n\nimport type { TextStyle } from 'react-native'\n\n/**\n * A Figma font-style name (`font/\u2026/weight`). The Fun Variables export defines\n * exactly these two cuts \u2014 there is no semibold/bold, so any `fontWeight: '600'`\n * in a component is a smell that should route through the token instead.\n */\nexport type FunkitFontStyleName = 'Regular' | 'Medium'\n\n/** Logical weight a component's `Text` can request; maps onto `font/body/weight/*`. */\nexport type FunkitFontWeight = 'base' | 'medium'\n\n/** `font/*` \u2014 body and header typography. Family is shared by both in Light/Dark. */\nexport interface FunkitFontTokens {\n body: {\n /**\n * `font/body/family`. The Fun Variables value is `Inter`, so the host must\n * register `Inter-Regular` / `Inter-Medium` (see {@link fontFamilyForWeight});\n * if it doesn't, RN falls back to the platform system font.\n */\n family: string\n weight: Record<FunkitFontWeight, FunkitFontStyleName>\n size: { base: number; detail: number }\n // Absolute px (RN's TextStyle.lineHeight).\n leading: { base: number; detail: number }\n }\n header: {\n family: string\n weight: FunkitFontStyleName\n alignment: 'Left' | 'Center' | 'Right'\n // `amount input` / `amount summary` are single-line; Figma defines no leading.\n size: {\n title: number\n subtitle: number\n amountInput: number\n amountSummary: number\n }\n }\n}\n\n/** One button state's fill (`background/button/*` \u2014 only `default` + `pressed`). */\nexport interface ButtonSurface {\n default: string\n pressed: string\n}\n\n/**\n * The full token set for one mode \u2014 a one-to-one mirror of the Fun Variables\n * Figma variable groups.\n */\nexport interface FunkitTokens {\n background: {\n modal: string\n secondary: string\n button: {\n primary: ButtonSurface\n secondary: ButtonSurface\n tertiary: ButtonSurface\n icon: ButtonSurface\n destructive: ButtonSurface & { disabled: string }\n }\n pill: { default: string; pressed: string; disabled: string }\n }\n /** `opacity/disabled` \u2014 a percentage (0\u2013100); divide by 100 for RN `opacity`. */\n opacity: {\n disabled: number\n }\n content: {\n elements: {\n primary: string\n secondary: string\n success: string\n error: string\n hyperlink: string\n warning: string\n }\n // Label/icon color on a button surface. `loadingAlpha` (`loading alpha`) is\n // the same color at reduced alpha, shown while the button is loading.\n button: {\n primary: { default: string; loadingAlpha: string }\n secondary: { default: string; loadingAlpha: string }\n tertiary: { default: string }\n icon: { default: string }\n destructive: { default: string; loadingAlpha: string }\n }\n }\n border: {\n radius: {\n modal: number\n element: number\n elementInner: number\n button: number\n }\n modal: { default: string; weight: number }\n elements: {\n default: { color: string; weight: number }\n selected: { color: string; weight: number }\n }\n button: { primary: string; secondary: string; weight: number }\n }\n font: FunkitFontTokens\n spacing: {\n padding: {\n elements: { horizontal: number }\n modal: { horizontal: number }\n }\n heights: { topBar: number; button: number }\n }\n brand: {\n primary: string\n }\n button: {\n // Icon tiers collapse per the export: xs === sm (16) and md === lg (20).\n // The four tiers are kept so call sites stay semantic.\n icon: {\n size: { xs: number; sm: number; md: number; lg: number }\n }\n size: { xs: number; sm: number; md: number; lg: number }\n }\n}\n\n/**\n * Resolves a font family + Figma style name to the concrete native font-family\n * name the host must register \u2014 e.g. `('Inter', '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 family: string,\n styleName: FunkitFontStyleName,\n): string {\n return `${family}-${styleName}`\n}\n\n/** Figma font-style name \u2192 CSS numeric weight (for the Swapped WebView / RN `fontWeight`). */\nexport const FONT_STYLE_CSS_WEIGHT: Record<\n FunkitFontStyleName,\n TextStyle['fontWeight']\n> = {\n Regular: '400',\n Medium: '500',\n}\n\nexport const lightTokens: FunkitTokens = {\n background: {\n modal: '#FFFFFF',\n secondary: '#F9F9F9',\n button: {\n primary: { default: '#0F0F0F', pressed: '#1B1B1B' },\n secondary: { default: '#F9F9F9', pressed: '#DDDDDD' },\n tertiary: { default: '#FFFFFF', pressed: '#EFEFEF' },\n icon: { default: '#FFFFFF', pressed: '#EFEFEF' },\n destructive: {\n default: '#F34126',\n pressed: '#C2341E',\n disabled: '#F34126',\n },\n },\n pill: { default: '#FFFFFF', pressed: '#EFEFEF', disabled: '#FFFFFF' },\n },\n opacity: {\n disabled: 40,\n },\n content: {\n elements: {\n primary: '#0F0F0F',\n secondary: '#6C6C6C',\n success: '#52A300',\n error: '#F34126',\n hyperlink: '#0F0F0F',\n warning: '#F97316',\n },\n button: {\n primary: { default: '#FFFFFF', loadingAlpha: '#FFFFFF4D' },\n secondary: { default: '#0F0F0F', loadingAlpha: '#0000004D' },\n tertiary: { default: '#0F0F0F' },\n icon: { default: '#6C6C6C' },\n destructive: { default: '#FFFFFF', loadingAlpha: '#FFFFFF80' },\n },\n },\n border: {\n radius: { modal: 24, element: 12, elementInner: 8, button: 999 },\n modal: { default: '#FFFFFF', weight: 1 },\n elements: {\n default: { color: '#EFEFEF', weight: 1 },\n selected: { color: '#0F0F0F', weight: 1 },\n },\n button: { primary: '#0F0F0F', secondary: '#F9F9F9', weight: 0 },\n },\n font: {\n body: {\n family: 'Inter',\n weight: { base: 'Regular', medium: 'Medium' },\n size: { base: 16, detail: 14 },\n leading: { base: 22, detail: 20 },\n },\n header: {\n family: 'Inter',\n weight: 'Medium',\n alignment: 'Center',\n size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 },\n },\n },\n spacing: {\n padding: {\n elements: { horizontal: 12 },\n modal: { horizontal: 16 },\n },\n heights: { topBar: 56, button: 42 },\n },\n brand: {\n primary: '#0F0F0F',\n },\n button: {\n icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },\n size: { xs: 36, sm: 40, md: 48, lg: 56 },\n },\n}\n\nexport const darkTokens: FunkitTokens = {\n background: {\n modal: '#0F0F0F',\n secondary: '#1B1B1B',\n button: {\n primary: { default: '#FFFFFF', pressed: '#F9F9F9' },\n secondary: { default: '#1B1B1B', pressed: '#2D2D2D' },\n tertiary: { default: '#1B1B1B', pressed: '#2D2D2D' },\n icon: { default: '#0F0F0F', pressed: '#1B1B1B' },\n destructive: {\n default: '#DB3B22',\n pressed: '#F34126',\n disabled: '#DB3B22',\n },\n },\n pill: { default: '#0F0F0F', pressed: '#1B1B1B', disabled: '#0F0F0F' },\n },\n opacity: {\n disabled: 40,\n },\n content: {\n elements: {\n primary: '#FFFFFF',\n secondary: '#929292',\n success: '#52A300',\n error: '#F34126',\n hyperlink: '#FFFFFF',\n warning: '#F97316',\n },\n button: {\n primary: { default: '#000000', loadingAlpha: '#0000004D' },\n secondary: { default: '#F9F9F9', loadingAlpha: '#FFFFFF4D' },\n tertiary: { default: '#F9F9F9' },\n icon: { default: '#929292' },\n destructive: { default: '#FFFFFF', loadingAlpha: '#FFFFFF80' },\n },\n },\n border: {\n radius: { modal: 24, element: 12, elementInner: 8, button: 999 },\n modal: { default: '#1B1B1B', weight: 1 },\n elements: {\n default: { color: '#2D2D2D', weight: 1 },\n selected: { color: '#FFFFFF', weight: 1 },\n },\n button: { primary: '#FFFFFF', secondary: '#1B1B1B', weight: 0 },\n },\n font: {\n body: {\n family: 'Inter',\n weight: { base: 'Regular', medium: 'Medium' },\n size: { base: 16, detail: 14 },\n leading: { base: 22, detail: 20 },\n },\n header: {\n family: 'Inter',\n weight: 'Medium',\n alignment: 'Center',\n size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 },\n },\n },\n spacing: {\n padding: {\n elements: { horizontal: 12 },\n modal: { horizontal: 16 },\n },\n heights: { topBar: 56, button: 42 },\n },\n brand: {\n primary: '#0F0F0F',\n },\n button: {\n icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },\n size: { xs: 36, sm: 40, md: 48, lg: 56 },\n },\n}\n", "import { createTheme } from '@shopify/restyle'\n\nimport { buildFunkitTheme } from './buildFunkitTheme'\nimport { type FunkitTokens, darkTokens, lightTokens } from './tokens'\n\n/**\n * Wraps the pure {@link buildFunkitTheme} projection in Restyle's `createTheme`.\n * All the real work \u2014 mirroring the Fun Variables Figma groups onto the theme \u2014\n * lives in `buildFunkitTheme`; this is just the thin Restyle boundary so the\n * projection stays testable without Restyle's react-native imports.\n */\nexport function toRestyleTheme(tokens: FunkitTokens) {\n return createTheme(buildFunkitTheme(tokens))\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 Variables Light/Dark tokens. */\nexport const defaultLightTheme = toRestyleTheme(lightTokens)\nexport const defaultDarkTheme = toRestyleTheme(darkTokens)\n", "import type { TextStyle } from 'react-native'\n\nimport {\n FONT_STYLE_CSS_WEIGHT,\n type FunkitFontStyleName,\n type FunkitTokens,\n fontFamilyForWeight,\n} from './tokens'\n\n// A resolved text cut: the native family (weight baked into the name, see\n// `fontFamilyForWeight`) plus the numeric weight kept for the Swapped WebView\n// (CSS) theme and the system-font fallback.\nfunction cut(family: string, styleName: FunkitFontStyleName) {\n return {\n fontFamily: fontFamilyForWeight(family, styleName),\n fontWeight: FONT_STYLE_CSS_WEIGHT[styleName],\n }\n}\n\n/**\n * Projects the nested Fun Variables {@link FunkitTokens} onto the object\n * `@shopify/restyle`'s `createTheme` consumes \u2014 kept as a pure function (no\n * Restyle import) so tests can build the theme without pulling Restyle's\n * react-native Flow source into the node env.\n *\n * The design deliberately DOESN'T use Restyle's `colors` prop system: `colors`\n * is empty and components read colors straight from the Figma-shaped groups\n * (`theme.background.button.primary.default`, `theme.content.elements.primary`,\n * \u2026) via `useTheme()`, so the theme stays a faithful mirror of Figma. Only the\n * non-color numeric buckets Restyle genuinely needs (`spacing`, `borderRadii`,\n * `borderWidths`, `sizes`, `breakpoints`) are projected onto its reserved keys.\n */\nexport function buildFunkitTheme(tokens: FunkitTokens) {\n const { font } = tokens\n const base = cut(font.body.family, font.body.weight.base)\n const medium = cut(font.body.family, font.body.weight.medium)\n const header = cut(font.header.family, font.header.weight)\n const headerAlign =\n font.header.alignment.toLowerCase() as TextStyle['textAlign']\n\n return {\n // Restyle's BaseTheme requires `colors`; intentionally empty \u2014 see above.\n colors: {},\n\n // \u2500\u2500 Figma variable groups, verbatim \u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 background: tokens.background,\n content: tokens.content,\n border: tokens.border,\n brand: tokens.brand,\n opacity: tokens.opacity,\n font: tokens.font,\n\n // \u2500\u2500 Non-color numeric buckets projected onto Restyle's reserved keys \u2500\n spacing: {\n none: 0,\n elementsHorizontal: tokens.spacing.padding.elements.horizontal,\n modalHorizontal: tokens.spacing.padding.modal.horizontal,\n },\n borderRadii: {\n modal: tokens.border.radius.modal,\n element: tokens.border.radius.element,\n elementInner: tokens.border.radius.elementInner,\n button: tokens.border.radius.button,\n // Structural (no Figma token): fully-circular avatars / icon wells.\n rounded: 999,\n },\n borderWidths: {\n modal: tokens.border.modal.weight,\n elementsDefault: tokens.border.elements.default.weight,\n elementsSelected: tokens.border.elements.selected.weight,\n button: tokens.border.button.weight,\n },\n sizes: {\n topBar: tokens.spacing.heights.topBar,\n buttonHeight: tokens.spacing.heights.button,\n buttonXs: tokens.button.size.xs,\n buttonSm: tokens.button.size.sm,\n buttonMd: tokens.button.size.md,\n buttonLg: tokens.button.size.lg,\n iconXs: tokens.button.icon.size.xs,\n iconSm: tokens.button.icon.size.sm,\n iconMd: tokens.button.icon.size.md,\n iconLg: tokens.button.icon.size.lg,\n },\n breakpoints: {\n phone: 0,\n tablet: 768,\n },\n\n // Text variants carry no `color` (Restyle colors is unused); the `Text`\n // component defaults the color from `content/elements/*` and callers\n // override per-node via `style`.\n textVariants: {\n defaults: {\n ...base,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n body: {\n ...base,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n bodyMedium: {\n ...medium,\n fontSize: font.body.size.base,\n lineHeight: font.body.leading.base,\n },\n detail: {\n ...base,\n fontSize: font.body.size.detail,\n lineHeight: font.body.leading.detail,\n },\n headerTitle: {\n ...header,\n fontSize: font.header.size.title,\n textAlign: headerAlign,\n },\n headerSubtitle: {\n ...header,\n fontSize: font.header.size.subtitle,\n textAlign: headerAlign,\n },\n amountInput: {\n ...medium,\n fontSize: font.header.size.amountInput,\n },\n amountSummary: {\n ...medium,\n fontSize: font.header.size.amountSummary,\n },\n },\n // Per-weight `{ fontFamily, fontWeight }` the `Text` `weight` prop applies on\n // top of any variant (both are required for custom fonts \u2014 see\n // `fontFamilyForWeight`).\n textWeights: {\n base,\n medium,\n },\n }\n}\n", "import { type FunkitTheme, toRestyleTheme } from './toRestyleTheme'\nimport { type FunkitTokens, darkTokens, lightTokens } from './tokens'\n\n/** Recursive partial \u2014 every group/leaf of the nested token tree is optional. */\ntype DeepPartial<T> = T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T\n\n/**\n * A deep-partial override of the nested Fun Variables {@link FunkitTokens}\n * groups. Pass to {@link lightTheme} / {@link darkTheme} to restyle only the\n * leaves a brand changes (`background` / `content` / `border` / `brand` / \u2026);\n * anything omitted keeps the base token's value.\n */\nexport type FunkitTokensOverride = DeepPartial<FunkitTokens>\n\n/** A mergeable plain object \u2014 not null, not an array. */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/**\n * Deep-merge `override` onto a deep *clone* of `base`. The result shares no\n * object references with `base`, so the built-in tokens are never aliased into a\n * theme \u2014 and thus can't be mutated through one. Non-object values (and arrays)\n * replace the base value whole.\n */\nfunction deepMerge<T>(base: T, override?: DeepPartial<T>): T {\n if (!isPlainObject(base)) {\n return override === undefined ? base : (override as T)\n }\n const source: Record<string, unknown> = isPlainObject(override)\n ? override\n : {}\n const cloned: Record<string, unknown> = {}\n for (const key of Object.keys(base)) {\n cloned[key] = deepMerge(base[key], source[key])\n }\n return cloned as T\n}\n\n/**\n * Build a light {@link FunkitTheme}, deep-merging an optional brand override\n * onto the SDK's `lightTokens`. A brand specifies only the leaves it changes \u2014\n * the design defines `default` / `pressed` states \u2014 and everything else keeps\n * the default value. Called with no argument it returns the default light theme.\n *\n * @example\n * const theme = lightTheme({\n * background: { button: { primary: { default: '#1e3b25', pressed: '#264e30' } } },\n * brand: { primary: '#1e3b25' },\n * })\n */\nexport function lightTheme(override?: FunkitTokensOverride): FunkitTheme {\n return toRestyleTheme(deepMerge(lightTokens, override))\n}\n\n/**\n * Build a dark {@link FunkitTheme}, deep-merging an optional brand override onto\n * the SDK's `darkTokens`. See {@link lightTheme}. For a dark-only brand, call\n * this once and reuse the theme for both `light` and `dark`.\n */\nexport function darkTheme(override?: FunkitTokensOverride): FunkitTheme {\n return toRestyleTheme(deepMerge(darkTokens, override))\n}\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, variant, 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 // Text color isn't a Restyle color prop \u2014 the theme has no `colors` bucket;\n // colors live under the Figma groups. Default it here from `content/elements`\n // by variant (detail/subtitle are secondary, the rest primary); an explicit\n // `style` color still wins. `?.` guards mocked themes.\n const elements = theme.content?.elements\n const secondary = variant === 'detail' || variant === 'headerSubtitle'\n const colorStyle = elements\n ? { color: secondary ? elements.secondary : elements.primary }\n : undefined\n return createElement(RestyleText, {\n ref,\n variant,\n style: [colorStyle, weightStyle, style],\n ...rest,\n })\n },\n)\n\n/** {@link FunkitTheme}-typed `useTheme`, for reading raw token values. */\nexport const useTheme = () => useRestyleTheme<FunkitTheme>()\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'\nimport { SafeAreaProvider } from 'react-native-safe-area-context'\n\nimport { FunkitFlowProvider } from '../flow/FunkitFlowProvider'\nimport {\n type FunkitConfig,\n FunkitIdentityProvider,\n resolveFunkitIdentity,\n} from '../identity/IdentityContext'\nimport type { Locale } from '../locales/i18n'\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 { FunkitI18nProvider } from './FunkitI18nProvider'\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 * UI language for the SDK's own copy (defaults to English). Mirrors\n * `@funkit/connect`'s `locale`.\n */\n locale?: Locale\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// Metro's debug-build global; `typeof`-probed so non-RN runtimes (tests, SSR)\n// resolve to false. Declared locally \u2014 this tsconfig loads only node types.\ndeclare const __DEV__: boolean | undefined\nconst IS_DEV_BUILD = typeof __DEV__ !== 'undefined' && !!__DEV__\n\n// Conservative default for the internally-created fallback client. Stock\n// react-query staleTime of 0 marks data stale immediately, so every remount\n// refetches and needlessly hits the API on mobile; a 60s floor stops that.\n// Retry is intentionally left at the react-query default \u2014 lowering it would\n// weaken flaky-network resilience (the case this SDK most needs to survive) and\n// can make the geo-compliance lookup fail closed. Hooks that need fresher or\n// staler data set their own staleTime.\nfunction createFallbackQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60_000,\n },\n },\n })\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, mirroring the web `FunkitProvider` nesting\n * (Statsig flags \u2192 React Query \u2192 identity \u2192 theme \u2192 i18n \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 = IS_DEV_BUILD,\n locale,\n copyToClipboard,\n}: FunkitProviderProps) {\n // Stable default client when the host doesn't supply one.\n const fallbackClient = useRef<QueryClient>(undefined)\n fallbackClient.current ??= createFallbackQueryClient()\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 <SafeAreaProvider>\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 <FunkitI18nProvider locale={locale}>\n <FunkitFlowProvider copyToClipboard={copyToClipboard}>\n {children}\n </FunkitFlowProvider>\n </FunkitI18nProvider>\n </FunkitThemeProvider>\n </FunkitIdentityProvider>\n </QueryClientProvider>\n </FunkitStatsigProvider>\n </SafeAreaProvider>\n )\n}\n", "import {\n BottomSheetBackdrop,\n BottomSheetModal,\n BottomSheetView,\n} from '@gorhom/bottom-sheet'\nimport type { SwappedFormOfPayment } from '@funkit/api-base'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\nimport { useStatsigClient } from '@statsig/react-bindings'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n type ComponentProps,\n type ReactNode,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Share, StyleSheet, View, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useCheckoutBlocked } from '../geo/useCheckoutBlocked'\nimport { PaymentMethodIcon } from '../icons/PaymentMethodIcon'\nimport { logger } from '../logging/logger'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { CryptoBitcoinIcon } from '../icons/CryptoBitcoinIcon'\nimport { QrChainCluster } from '../icons/QrChainCluster'\nimport { SourceTokenCluster } from '../icons/SourceTokenCluster'\nimport { TokenChainIcon } from '../icons/TokenChainIcon'\nimport {\n type PaymentMethodOption,\n type ReceiveTokenOption,\n SelectMethodScreen,\n} from '../screens/SelectMethodScreen'\nimport { AvailableChainsScreen } from '../screens/AvailableChainsScreen'\nimport { CheckoutBlockedScreen } from '../screens/CheckoutBlockedScreen'\nimport { QrCodeScreen } from '../screens/QrCodeScreen'\nimport { TransferCryptoScreen } from '../screens/TransferCryptoScreen'\nimport { WithdrawMethodScreen } from '../screens/WithdrawMethodScreen'\nimport { SwappedScreen } from '../swapped/SwappedScreen'\nimport { SwappedWithdrawScreen } from '../swapped/SwappedWithdrawScreen'\nimport { isEvmChainId } from '@funkit/connect-core'\nimport {\n EVM_NETWORK_ID,\n belongsToNetwork,\n buildAvailableChains,\n buildDepositNetworks,\n} from '../transfer/availableChains'\nimport {\n type ClipboardWriter,\n copyToClipboard as defaultCopyToClipboard,\n} from '../transfer/clipboard'\nimport { toFopRows, toWithdrawFopRows } from '../transfer/fops'\nimport { formatDepositAddress } from '../transfer/formatDepositAddress'\nimport { useFiatExchangeRates } from '../transfer/hooks/useFiatExchangeRates'\nimport { useFops } from '../transfer/hooks/useFops'\nimport {\n WITHDRAW_FOPS_QUERY_KEY,\n useWithdrawalFops,\n} from '../transfer/hooks/useWithdrawalFops'\nimport { useWithdrawalExecution } from '../withdrawal/useWithdrawalExecution'\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, FlowSheetBackground } from './FlowSheet'\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from './withdrawalFlowConfig'\n\ntype FlowScreen = 'addMoney' | 'transfer' | 'swapped' | 'withdrawMethod'\n\n/** Screens presented as a nested sheet on top of the current FlowScreen. */\ntype NestedScreen = 'availableChains' | 'qrCode'\n\n/**\n * The open flow's mode + its config/callbacks, as a discriminated union so\n * deposit and withdrawal state can't cross-contaminate (a `beginDeposit` after\n * a withdrawal fully replaces the slot, and vice versa).\n */\ntype ActiveFlow =\n | {\n mode: 'deposit'\n config: DepositFlowConfig\n callbacks: DepositFlowCallbacks\n }\n | {\n mode: 'withdrawal'\n config: WithdrawalFlowConfig\n callbacks: WithdrawalFlowCallbacks\n }\n\ninterface FlowState {\n isOpen: boolean\n stack: FlowScreen[]\n flow: ActiveFlow | null\n /**\n * Bumped on every `begin*`. 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 flow: null,\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 /** Open the managed withdrawal flow at the payout-method screen. */\n beginWithdrawal: (\n config: WithdrawalFlowConfig,\n callbacks?: WithdrawalFlowCallbacks,\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 /** Replace the whole stack with a single screen (never closes the sheet). */\n reset: (s: FlowScreen) => 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 insets = useSafeAreaInsets()\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 flow: { mode: 'deposit', config, callbacks },\n session: prev.session + 1,\n }))\n },\n [],\n )\n\n const beginWithdrawal = useCallback(\n (config: WithdrawalFlowConfig, callbacks: WithdrawalFlowCallbacks = {}) => {\n callbacks.onOpen?.()\n setState((prev) => ({\n isOpen: true,\n stack: ['withdrawMethod'],\n flow: { mode: 'withdrawal', config, 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.flow?.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 reset = useCallback((screen: FlowScreen) => {\n setState((prev) => (prev.isOpen ? { ...prev, stack: [screen] } : prev))\n }, [])\n\n const back = useCallback(() => {\n setState((prev) => {\n if (!prev.isOpen) return prev\n if (prev.stack.length <= 1) {\n prev.flow?.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, beginWithdrawal, closeFlow }),\n [beginDeposit, beginWithdrawal, closeFlow],\n )\n\n const current = state.stack[state.stack.length - 1]\n // Each flow's home screen is its stack root (Add money / payout methods) \u2014\n // they only ever appear at depth 0.\n const isHomeScreen = state.stack.length <= 1\n const nav = useMemo<FlowNav>(\n () => ({ navigate, back, reset, closeFlow }),\n [navigate, back, reset, 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 // Pushed screens \u2014 especially the Swapped embed mid-payment \u2014 must\n // not be dismissable by a stray drag.\n enableSwipeToDismiss={isHomeScreen}\n content={\n // Mounted only while open so the flow queries run only then.\n state.isOpen && state.flow ? (\n state.flow.mode === 'deposit' ? (\n <FlowContent\n config={state.flow.config}\n current={current}\n nav={nav}\n copyToClipboard={copyToClipboard}\n onCopySuccess={showCopiedToast}\n callbacks={state.flow.callbacks}\n />\n ) : (\n <WithdrawalFlowContent\n config={state.flow.config}\n callbacks={state.flow.callbacks}\n current={current}\n nav={nav}\n />\n )\n ) : null\n }\n >\n {children}\n </FlowSheet>\n {toastMounted ? (\n <View\n style={[\n toastOverlay,\n { paddingTop: insets.top + TOAST_INSET_OFFSET },\n ]}\n pointerEvents=\"none\"\n >\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 { t } = useFunkitTranslation()\n const insets = useSafeAreaInsets()\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 && isEvmChainId(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 // Until the fetch settles there are no chains, so the Crypto row's trailing\n // logo cluster would render empty and pop in after. Only wait when the list\n // is actually being fetched (a host-supplied one is ready immediately).\n const isChainListLoading = !config.tokenChainFilters && fetched.isLoading\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(t, tokenChainFilters),\n [t, 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 // Only cash rows show a converted limit; skip the fetch when Swapped is off.\n const { data: exchangeRates } = useFiatExchangeRates(isSwappedEnabled)\n\n // Statsig readiness gates the Add money skeleton: until it resolves,\n // `isSwappedEnabled` reads its `false` fallback (see the `loading` prop below).\n const { isLoading: isStatsigLoading } = useStatsigClient()\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 t,\n chainFilters: tokenChainFilters,\n networkChainId: selectedChainId,\n minTransferLimits,\n target: {\n targetChain: activeCheckoutConfig?.targetChain,\n targetAsset: activeCheckoutConfig?.targetAsset,\n dynamicRoutingId: activeDynamicRoutingId,\n getMinDepositUSD: config.checkoutConfig?.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 : t('transferCrypto.generating')\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 // \u2500\u2500 Nested sheet \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // A single BottomSheetModal whose content is driven by `nestedScreen`.\n // Swiping it down reveals the parent FlowScreen instead of closing the\n // entire flow. Adding a new overlay screen is one type-union member + one\n // content branch.\n const nestedSheetRef = useRef<BottomSheetModal>(null)\n const [nestedScreen, setNestedScreen] = useState<NestedScreen | null>(null)\n const openNestedScreen = useCallback((screen: NestedScreen) => {\n setNestedScreen(screen)\n }, [])\n useEffect(() => {\n if (nestedScreen) {\n nestedSheetRef.current?.present()\n }\n }, [nestedScreen])\n const closeNestedScreen = useCallback(() => {\n nestedSheetRef.current?.dismiss()\n }, [])\n const renderNestedBackdrop = 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 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: t('selectMethod.crypto'),\n subtitle: t('selectMethod.noLimit'),\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(t, fops, exchangeRates).map((row, i) => ({\n id: row.id,\n title: row.name,\n subtitle: row.subtitle,\n icon: <PaymentMethodIcon fop={fops[i]} />,\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 <SelectMethodScreen\n title={t('selectMethod.title')}\n errorTitle={t('selectMethod.errorTitle')}\n errorMessage={t('selectMethod.errorMessage')}\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), the deposit-address / QR\n // generation (so Transfer/QR open with a ready address, not\n // \"Generating\u2026\"), and Statsig init \u2014 while it's loading,\n // `isSwappedEnabled` reads its `false` fallback (indistinguishable\n // from a genuinely-off gate), so we must hold on `isStatsigLoading`\n // directly rather than let the `isSwappedEnabled` guard flash the\n // crypto-only list. The curated chain list is held on for the same\n // reason: it fills the Crypto row's trailing logo cluster.\n loading={\n isLoadingGeoCheck ||\n isAddressLoading ||\n isStatsigLoading ||\n isChainListLoading ||\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 ? () => openNestedScreen('availableChains')\n : undefined\n }\n onShowQrCode={() => openNestedScreen('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 '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 const bottomSheetScreen = ((): ReactNode => {\n switch (nestedScreen) {\n case 'availableChains':\n return (\n <AvailableChainsScreen\n networkLabel={selectedChain?.label ?? ''}\n chains={availableChains}\n onClose={closeNestedScreen}\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={closeNestedScreen}\n />\n )\n default:\n return null\n }\n })()\n\n if (isGeoblocked) {\n return <CheckoutBlockedScreen />\n }\n\n return (\n <>\n {screen}\n <BottomSheetModal\n ref={nestedSheetRef}\n enableDynamicSizing\n // Same status-bar cap as FlowSheet \u2014 the chain list can grow tall.\n topInset={insets.top}\n handleComponent={undefined}\n backgroundComponent={FlowSheetBackground}\n backdropComponent={renderNestedBackdrop}\n onDismiss={() => setNestedScreen(null)}\n >\n <BottomSheetView>{bottomSheetScreen}</BottomSheetView>\n </BottomSheetModal>\n </>\n )\n}\n\n/**\n * The live withdrawal-flow body (Swapped fiat offramp): payout-method list \u2192\n * the Swapped sell embed \u2192 on a validated order, the on-chain leg\n * ({@link useWithdrawalExecution}) delivers the exact ordered amount to\n * Swapped's deposit address through the host wallet. Sibling of\n * {@link FlowContent}, mounted only while a withdrawal flow is open so its\n * queries run only then.\n */\nfunction WithdrawalFlowContent({\n config,\n callbacks,\n current,\n nav,\n}: {\n config: WithdrawalFlowConfig\n callbacks: WithdrawalFlowCallbacks\n current: FlowScreen | undefined\n nav: FlowNav\n}): ReactNode {\n const { t } = useFunkitTranslation()\n const { isGeoblocked, isLoadingGeoCheck } = useCheckoutBlocked({\n onCheckoutBlocked: callbacks.onCheckoutBlocked,\n })\n const queryClient = useQueryClient()\n\n const {\n fops,\n isLoading,\n noPaymentMethodsAvailable,\n isBelowMinimumBalance,\n isError,\n refetch,\n route,\n } = useWithdrawalFops({ config })\n\n // The payout method the user picked (the whole FOP \u2014 the embed URL drives\n // the Swapped screen; type/name feed the decision-point log).\n const [selectedFop, setSelectedFop] = useState<SwappedFormOfPayment>()\n\n // Unrecoverable execution failure \u2014 replaces the embed with a retryable\n // error state (web parity: the iframe controller's error branch).\n const [hasExecutionError, setHasExecutionError] = useState(false)\n\n // Stable so it doesn't rebuild `executeOrder` (it's in that useCallback's deps).\n const onExecutionError = useCallback(() => setHasExecutionError(true), [])\n const { executeOrder } = useWithdrawalExecution({\n config,\n route,\n callbacks,\n onError: onExecutionError,\n })\n\n // The embed's method list can go stale while it's open (web parity: the\n // controller invalidates on back/new-withdrawal/success).\n const invalidateWithdrawFops = useCallback(() => {\n void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] })\n }, [queryClient])\n\n if (isGeoblocked) {\n return <CheckoutBlockedScreen />\n }\n\n if (hasExecutionError) {\n return (\n <WithdrawMethodScreen\n title={config.title ?? t('withdraw.title')}\n methods={[]}\n hasError\n onRetry={() => {\n setHasExecutionError(false)\n invalidateWithdrawFops()\n // Reset to the method list \u2014 `back()` would close the whole sheet if\n // the user had already popped the embed before execution failed.\n nav.reset('withdrawMethod')\n }}\n onSelectMethod={() => undefined}\n />\n )\n }\n\n switch (current) {\n case 'withdrawMethod': {\n // Id by array index, not `<fopType>:<name>` \u2014 Swapped can return two\n // methods that share both yet carry distinct `embeddedFlowUrl`s, so a\n // key-based lookup could open the wrong payout embed. Rows are positional\n // 1:1 with `fops`, so the index resolves the exact selected FOP.\n const methods: PaymentMethodOption[] = toWithdrawFopRows(t, fops).map(\n (row, i) => ({\n id: String(i),\n title: row.name,\n subtitle: row.subtitle,\n icon: <PaymentMethodIcon fop={fops[i]} />,\n }),\n )\n return (\n <WithdrawMethodScreen\n title={config.title ?? t('withdraw.title')}\n methods={methods}\n loading={isLoadingGeoCheck || isLoading}\n hasError={isError}\n onRetry={refetch}\n // Gate confirmed off, or Swapped returned no methods for this\n // region/token \u2014 never during a transient load (see `noPaymentMethodsAvailable`).\n isEmpty={noPaymentMethodsAvailable}\n // Balance below Swapped's minimum sell \u2014 distinct terminal message.\n isBelowMinimum={isBelowMinimumBalance}\n onSelectMethod={(id) => {\n const fop = fops[Number(id)]\n if (!fop?.embeddedFlowUrl) return\n // Payout-provider decision point.\n logger.info('connect-rn:withdrawal:method_selected', {\n fopType: fop.fopType,\n fopName: fop.name,\n })\n setSelectedFop(fop)\n nav.navigate('swapped')\n }}\n />\n )\n }\n case 'swapped':\n return selectedFop?.embeddedFlowUrl ? (\n <SwappedWithdrawScreen\n url={selectedFop.embeddedFlowUrl}\n onBack={() => {\n invalidateWithdrawFops()\n nav.back()\n }}\n onClose={() => {\n invalidateWithdrawFops()\n nav.closeFlow()\n }}\n onNewWithdrawal={() => {\n invalidateWithdrawFops()\n nav.back()\n }}\n onWithdrawalSuccess={(data) => {\n invalidateWithdrawFops()\n callbacks.onWithdrawalSuccess?.(data)\n }}\n onOrderData={(order) => {\n // The host notification is informational \u2014 a throw from it must not\n // skip the on-chain execution (the critical leg for this order).\n try {\n callbacks.onWithdrawalOrder?.(order)\n } catch (error) {\n logger.warn('connect-rn:withdrawal:order_callback_threw', {\n order_id: order.order_id,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n void executeOrder(order)\n }}\n />\n ) : null\n default:\n return null\n }\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\nconst TOAST_INSET_OFFSET = 20\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.\n// paddingTop is set inline via `useSafeAreaInsets` (insets.top + 20).\nconst toastOverlay: ViewStyle = {\n ...StyleSheet.absoluteFill,\n zIndex: 1,\n alignItems: 'center',\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 {\n type DynamicConfigName,\n type DynamicConfigValue,\n useDynamicConfig as useCoreDynamicConfig,\n} from '@funkit/connect-core'\n\nimport { useUserIpInfo } from '../geo/useUserIpInfo'\n\n// RN counterpart of `@funkit/connect`'s `hooks/statsig/useDynamicConfig`. The\n// core hook takes `countryCode` as a parameter so it stays platform-agnostic;\n// this wrapper threads the user's IP-derived `alpha2` (Moonpay/ipapi) so\n// country-conditional variant configs (e.g. `enableswappeddeposit`) resolve\n// against the real region instead of falling to their default branch.\nexport type { DynamicConfigName, DynamicConfigValue }\n\nexport const useDynamicConfig = <Name extends DynamicConfigName>(\n name: Name,\n options?: {\n bypassCountryCode?: boolean\n },\n): DynamicConfigValue<Name> => {\n const { userIpInfo } = useUserIpInfo()\n return useCoreDynamicConfig(name, {\n bypassCountryCode: options?.bypassCountryCode,\n countryCode: userIpInfo?.alpha2,\n })\n}\n", "import { useUserIpInfo as useCoreUserIpInfo } from '@funkit/connect-core'\n\nimport { logger } from '../logging/logger'\n\n// Re-exported so existing RN importers (isCountryBlocked, the flow hooks, tests)\n// keep their type source unchanged after the fetch logic moved to core.\nexport type {\n FunkitUserIpInfo,\n UseUserIpInfoResult,\n} from '@funkit/connect-core'\n\n// Thin RN wrapper over the shared core `useUserIpInfo` (V1 PR13 moved the\n// Moonpay\u2192ipapi fetch logic there so web and RN don't duplicate it). RN is\n// login-agnostic, so the lookup always runs (`enabled: true`); web's wrapper\n// gates on `isUserLoggedIn` instead.\nexport function useUserIpInfo() {\n // Login-agnostic + session-stable: always run, never go stale.\n return useCoreUserIpInfo({\n logger,\n enabled: true,\n staleTime: Number.POSITIVE_INFINITY,\n })\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 // BigInt-safe: log context may carry bigints (relay-sdk quote/step\n // amounts) that plain JSON.stringify throws on \u2014 and flush() can run\n // synchronously inside a caller's log(). Coerce bigints to strings.\n body: JSON.stringify(batch, (_key, value) =>\n typeof value === 'bigint' ? value.toString() : value,\n ),\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 { useEffect, useMemo } from 'react'\nimport { useEffectEvent } from '@funkit/connect-core'\n\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\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 { 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 type { SwappedFormOfPayment } from '@funkit/api-base'\nimport { getSwappedIcon, isSavedFormOfPaymentType } from '@funkit/connect-core'\n\nimport { useFunkitColorScheme } from '../theme/FunkitThemeProvider'\nimport { FALLBACK_ASSET_LOGO } from './assetLogos'\nimport { FunIcon } from './FunIcon'\nimport {\n JcbIcon,\n MastercardIcon,\n UnionPayIcon,\n VisaIcon,\n} from './PaymentBrandIcons'\n\n// RN can't render the CDN card-brand logos (embedded-raster SVGs), so use local\n// vectors where we have them and fall back to this generic glyph otherwise.\nconst CARD_ICON = 'https://sdk-cdn.fun.xyz/images/swapped/card-payment.svg'\n\n// Local brand vectors, keyed by the normalized cardBrand (spaces\u2192_, lowercased)\n// to match SWAPPED_CARD_BRANDS. Cartes Bancaires is intentionally absent \u2014 its\n// only logo is a raster inside an SVG <pattern> RN can't draw, so it falls back\n// to the generic card glyph.\nconst BRAND_ICONS: Record<string, typeof MastercardIcon> = {\n mastercard: MastercardIcon,\n visa: VisaIcon,\n jcb: JcbIcon,\n unionpay: UnionPayIcon,\n}\n\nconst genericCardIcon = (isDarkMode: boolean) =>\n isDarkMode ? CARD_ICON.replace('.svg', '-light.svg') : CARD_ICON\n\nexport function PaymentMethodIcon({ fop }: { fop: SwappedFormOfPayment }) {\n const isDarkMode = useFunkitColorScheme().colorScheme === 'dark'\n if (isSavedFormOfPaymentType(fop)) {\n const BrandIcon =\n BRAND_ICONS[fop.cardBrand.replace(/ /g, '_').toLowerCase()]\n if (BrandIcon) {\n return <BrandIcon size={32} />\n }\n return (\n <FunIcon\n uri={genericCardIcon(isDarkMode)}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n )\n }\n return (\n <FunIcon\n uri={getSwappedIcon(fop, isDarkMode)}\n fallbackUri={FALLBACK_ASSET_LOGO}\n />\n )\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 { useEffect, useState } from 'react'\nimport { Image, type ViewStyle } from 'react-native'\nimport { SvgXml } from 'react-native-svg'\n\nimport { Box, useTheme } 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 const theme = useTheme()\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 style={[\n clip,\n { backgroundColor: ready ? undefined : theme.background.secondary },\n ]}\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 { SvgXml } from 'react-native-svg'\n\nimport { useTheme } from '../theme/restyle'\n\n/**\n * Payment-method brand glyphs for the \"Add money\" funding-source picker (Figma:\n * Fun Mobile / Add money, node 11202:8263). Each is a byte-for-byte SVG export\n * from that Figma frame \u2014 Mastercard keeps its brand colors; the monochrome\n * marks (Apple, Revolut, Bank, Crypto) swap their fill/stroke to the theme's\n * primary content color so they track light/dark. Host apps may pass their own\n * brand icons instead; these are the package's design-matched defaults used by\n * the stories.\n */\n\ntype BrandIconProps = {\n /** Glyph box size in px (the leading slot centers it). */\n size?: number\n /** Override the monochrome color; defaults to the theme primary. */\n color?: string\n}\n\nfunction useGlyphColor(color?: string) {\n const theme = useTheme()\n return color ?? theme.content.elements.primary\n}\n\n// Mastercard: the two interlocking circles (red / amber + overlap), drawn at the\n// Figma 24\u00D718 aspect. Brand colors are fixed (not themed).\nconst MASTERCARD_SVG =\n '<svg width=\"24\" height=\"18\" viewBox=\"0 0 24 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"8.5\" cy=\"9\" r=\"7.5\" fill=\"#EB001B\"/><circle cx=\"15.5\" cy=\"9\" r=\"7.5\" fill=\"#F79E1B\"/><path d=\"M12 3.3A7.49 7.49 0 0 1 12 14.7 7.49 7.49 0 0 1 12 3.3Z\" fill=\"#FF5F00\"/></svg>'\n\n// Apple logo (Figma node 788:9641), rendered in the theme primary color.\nconst APPLE_SVG =\n '<svg width=\"11.7334\" height=\"14.4\" viewBox=\"0 0 11.7334 14.4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.63605 6.48119e-06C8.66955 6.48119e-06 8.70304 6.48119e-06 8.73843 6.48119e-06C8.82059 1.01552 8.43319 1.77432 7.96236 2.32381C7.50039 2.86951 6.86777 3.39877 5.8446 3.31846C5.77635 2.31749 6.16438 1.61497 6.63457 1.06674C7.07064 0.555823 7.87009 0.101179 8.63605 6.48119e-06Z\" fill=\"currentColor\"/><path d=\"M11.7334 10.57C11.7334 10.5801 11.7334 10.589 11.7334 10.5984C11.4459 11.4698 11.0357 12.2166 10.5352 12.9096C10.0783 13.5388 9.51835 14.3854 8.51856 14.3854C7.65465 14.3854 7.08081 13.8296 6.1954 13.8145C5.25881 13.7993 4.74375 14.2792 3.88741 14.4C3.78946 14.4 3.6915 14.4 3.59544 14.4C2.96662 14.3089 2.45914 13.8107 2.08943 13.3617C0.999267 12.0351 0.156839 10.3215 0.000107765 8.12857C0.000107765 7.91357 0.000107765 7.69922 0.000107765 7.48422C0.0664656 5.91479 0.828633 4.63875 1.8417 4.02033C2.37635 3.69152 3.11134 3.4114 3.92976 3.5366C4.28051 3.59098 4.63884 3.71112 4.95293 3.83C5.25059 3.94445 5.62283 4.14743 5.97548 4.13668C6.21436 4.12972 6.45199 4.00516 6.69277 3.91726C7.39806 3.66243 8.08945 3.3703 9.00076 3.50751C10.096 3.67318 10.8733 4.16008 11.3536 4.91128C10.4271 5.50124 9.69468 6.3903 9.81981 7.90852C9.93104 9.28762 10.7324 10.0945 11.7334 10.57Z\" fill=\"currentColor\"/></svg>'\n\n// Revolut \"R\" wordmark (Figma node 823426821), theme-colored.\nconst REVOLUT_SVG =\n '<svg width=\"15.9174\" height=\"20\" viewBox=\"0 0 15.9174 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.7156 4.90723H0V19.9531H3.7156V4.90723Z\" fill=\"currentColor\"/><path d=\"M15.4128 5.77982C15.4128 2.56881 12.7982 0 9.63303 0H0V3.21101H9.12844C10.5963 3.21101 11.789 4.3578 11.789 5.73395C11.789 6.42202 11.5596 7.11009 11.055 7.61468C10.5505 8.11927 9.90826 8.3945 9.22018 8.3945H5.6422C5.50459 8.3945 5.41284 8.48624 5.41284 8.62385V11.4679C5.41284 11.5138 5.41284 11.5596 5.45872 11.6055L11.5138 20H15.9174L9.90826 11.5596C12.9358 11.422 15.4128 8.85321 15.4128 5.77982Z\" fill=\"currentColor\"/></svg>'\n\n// Bitcoin \"B\" coin (Figma icon/system, node b8d97bb3), theme-colored.\nconst CRYPTO_SVG =\n '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.5 14.25C15.5 14.9404 14.9404 15.5 14.25 15.5H10.5V13H14.25C14.9404 13 15.5 13.5596 15.5 14.25Z\" fill=\"currentColor\"/><path d=\"M13.75 8.5H10.5V11H13.75C14.4404 11 15 10.4404 15 9.75C15 9.05964 14.4404 8.5 13.75 8.5Z\" fill=\"currentColor\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM10 5C10.5523 5 11 5.44772 11 6V6.5H12V6C12 5.44772 12.4477 5 13 5C13.5523 5 14 5.44772 14 6V6.50947C15.6781 6.63713 17 8.03919 17 9.75C17 10.5009 16.7454 11.1922 16.3178 11.7425C17.0398 12.3386 17.5 13.2406 17.5 14.25C17.5 16.0449 16.0449 17.5 14.25 17.5H14V18C14 18.5523 13.5523 19 13 19C12.4477 19 12 18.5523 12 18V17.5H11V18C11 18.5523 10.5523 19 10 19C9.44772 19 9 18.5523 9 18V17.5H8C7.44772 17.5 7 17.0523 7 16.5C7 15.9477 7.44772 15.5 8 15.5H8.5V8.5H8C7.44772 8.5 7 8.05228 7 7.5C7 6.94772 7.44772 6.5 8 6.5H9V6C9 5.44772 9.44772 5 10 5Z\" fill=\"currentColor\"/></svg>'\n\n// Bank \"source-and-destination\" line glyph (Figma node a82cc93d), theme-colored.\nconst BANK_SVG =\n '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 21H21M6 18V9.99998M10 18V9.99998M14 18V9.99998M18 18V9.99998M20 6.99998L12.424 2.26498C12.2702 2.16884 12.1933 2.12077 12.1108 2.10203C12.0379 2.08546 11.9621 2.08546 11.8892 2.10203C11.8067 2.12077 11.7298 2.16884 11.576 2.26498L4 6.99998H20Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\n\n// Card-brand marks below keep their fixed brand colors (like Mastercard) and\n// are byte-for-byte SVG path exports. RN can render these vectors where it\n// cannot draw the CDN logos, which embed a raster inside an SVG <pattern>.\nconst VISA_SVG =\n '<svg width=\"24\" height=\"19\" viewBox=\"0 0 24 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M24 0.00405757L15.7253 19H10.3255L6.25345 3.83691C6.17546 3.09873 5.70545 2.48223 5.05208 2.17398L5.03943 2.16789C3.58936 1.48244 1.90322 0.924752 0.139106 0.573914L0 0.551607L0.122245 0.00202878H8.81426C9.99877 0.00202878 10.9831 0.835522 11.1664 1.92454L11.1685 1.93671L13.3205 12.9303L18.636 0L24 0.00405757Z\" fill=\"#1B33C3\"/></svg>'\n\nconst JCB_SVG =\n '<svg width=\"24\" height=\"19\" viewBox=\"0 0 24 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_5933_159)\"><path d=\"M23.9201 15.1208C23.9201 17.2137 22.2589 18.9179 20.2188 18.9179H0.0800781V3.8791C0.0800781 1.78623 1.7413 0.0820312 3.7814 0.0820312H23.9201V15.1208Z\" fill=\"white\"/><path d=\"M17.3625 11.264H18.8926C18.9363 11.264 19.0383 11.249 19.0821 11.249C19.3735 11.1892 19.6212 10.9201 19.6212 10.5464C19.6212 10.1876 19.3735 9.91855 19.0821 9.84381C19.0383 9.82886 18.9509 9.82886 18.8926 9.82886H17.3625V11.264Z\" fill=\"url(#paint0_linear_5933_159)\"/><path d=\"M18.7177 1.35266C17.2605 1.35266 16.0656 2.56354 16.0656 4.0734V6.89878H19.8106C19.8981 6.89878 20.0001 6.89878 20.0729 6.91373C20.9181 6.95857 21.5447 7.40705 21.5447 8.1844C21.5447 8.79731 21.1221 9.32053 20.3352 9.42517V9.45507C21.195 9.51487 21.8507 10.0082 21.8507 10.7706C21.8507 11.5928 21.1221 12.131 20.1604 12.131H16.051V17.6621H19.9418C21.399 17.6621 22.5939 16.4512 22.5939 14.9414V1.35266H18.7177Z\" fill=\"url(#paint1_linear_5933_159)\"/><path d=\"M19.4318 8.36381C19.4318 8.00504 19.1841 7.76585 18.8926 7.721C18.8635 7.721 18.7906 7.70605 18.7469 7.70605H17.3625V9.02158H18.7469C18.7906 9.02158 18.8781 9.02158 18.8926 9.00663C19.1841 8.96178 19.4318 8.72259 19.4318 8.36381Z\" fill=\"url(#paint2_linear_5933_159)\"/><path d=\"M4.0583 1.35266C2.60109 1.35266 1.40617 2.56354 1.40617 4.0734V10.7855C2.14935 11.1593 2.92168 11.3985 3.694 11.3985C4.61204 11.3985 5.10749 10.8304 5.10749 10.053V6.88383H7.38075V10.0381C7.38075 11.2639 6.63757 12.2655 4.11659 12.2655C2.58652 12.2655 1.3916 11.9217 1.3916 11.9217V17.6472H5.28236C6.73957 17.6472 7.93449 16.4363 7.93449 14.9264V1.35266H4.0583Z\" fill=\"url(#paint3_linear_5933_159)\"/><path d=\"M11.388 1.35266C9.93075 1.35266 8.73584 2.56354 8.73584 4.0734V7.63128C9.40616 7.04827 10.5719 6.67454 12.4517 6.76423C13.4572 6.80908 14.5355 7.09311 14.5355 7.09311V8.24419C13.9964 7.96016 13.3552 7.70603 12.5246 7.64623C11.0965 7.54159 10.2368 8.25914 10.2368 9.51487C10.2368 10.7855 11.0965 11.5031 12.5246 11.3835C13.3552 11.3237 13.9964 11.0546 14.5355 10.7855V11.9366C14.5355 11.9366 13.4718 12.2207 12.4517 12.2655C10.5719 12.3552 9.40616 11.9815 8.73584 11.3985V17.6771H12.6266C14.0838 17.6771 15.2787 16.4662 15.2787 14.9563V1.35266H11.388Z\" fill=\"url(#paint4_linear_5933_159)\"/></g><defs><linearGradient id=\"paint0_linear_5933_159\" x1=\"16.0632\" y1=\"10.5482\" x2=\"22.6115\" y2=\"10.5482\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint1_linear_5933_159\" x1=\"16.063\" y1=\"9.50087\" x2=\"22.6118\" y2=\"9.50087\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint2_linear_5933_159\" x1=\"16.063\" y1=\"8.36194\" x2=\"22.6116\" y2=\"8.36194\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#007940\"/><stop offset=\"0.2285\" stop-color=\"#00873F\"/><stop offset=\"0.7433\" stop-color=\"#40A737\"/><stop offset=\"1\" stop-color=\"#5CB531\"/></linearGradient><linearGradient id=\"paint3_linear_5933_159\" x1=\"1.40309\" y1=\"9.50086\" x2=\"8.05279\" y2=\"9.50086\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#1F286F\"/><stop offset=\"0.4751\" stop-color=\"#004E94\"/><stop offset=\"0.8261\" stop-color=\"#0066B1\"/><stop offset=\"1\" stop-color=\"#006FBC\"/></linearGradient><linearGradient id=\"paint4_linear_5933_159\" x1=\"8.69816\" y1=\"9.50086\" x2=\"15.1566\" y2=\"9.50086\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#6C2C2F\"/><stop offset=\"0.1735\" stop-color=\"#882730\"/><stop offset=\"0.5731\" stop-color=\"#BE1833\"/><stop offset=\"0.8585\" stop-color=\"#DC0436\"/><stop offset=\"1\" stop-color=\"#E60039\"/></linearGradient><clipPath id=\"clip0_5933_159\"><rect width=\"24\" height=\"19\" fill=\"white\"/></clipPath></defs></svg>'\n\nconst UNIONPAY_SVG =\n '<svg width=\"256px\" height=\"160px\" viewBox=\"0 0 256 160\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\"><g><path d=\"M50.041631,0.000667563305 L113.820211,0.000667563305 C122.723127,0.000667563305 128.260438,7.25731345 126.183558,16.1897657 L96.4900715,143.675416 C94.3945365,152.576777 85.480739,159.839641 76.571605,159.839641 L12.7992433,159.839641 C3.908764,159.839641 -1.64098444,152.576777 0.435896208,143.675416 L30.1418186,16.1897657 C32.2186993,7.25731345 41.1278333,0.000667563305 50.041631,0.000667563305\" fill=\"#E21836\"></path><path d=\"M108.513283,0.000667563305 L181.857018,0.000667563305 C190.758378,0.000667563305 186.744527,7.25731345 184.650546,16.1897657 L154.961724,143.675416 C152.878625,152.576777 153.528427,159.839641 144.608411,159.839641 L71.2646775,159.839641 C62.3446615,159.839641 56.8244495,152.576777 58.919985,143.675416 L88.6072525,16.1897657 C90.715224,7.25731345 99.6057035,0.000667563305 108.513283,0.000667563305\" fill=\"#00447C\"></path><path d=\"M178.94783,0.000667563305 L242.726409,0.000667563305 C251.641762,0.000667563305 257.179074,7.25731345 255.085093,16.1897657 L225.396271,143.675416 C223.300736,152.576777 214.380719,159.839641 205.466922,159.839641 L141.717879,159.839641 C132.797863,159.839641 127.265215,152.576777 129.354532,143.675416 L159.048017,16.1897657 C161.124899,7.25731345 170.027814,0.000667563305 178.94783,0.000667563305\" fill=\"#007B84\"></path><path d=\"M66.698338,40.8561434 C60.139686,40.9229891 58.202715,40.8561434 57.5840035,40.7100156 C57.346157,41.8401744 52.920349,62.256098 52.9079125,62.273198 C51.9549725,66.403641 51.261643,69.347961 48.9064975,71.2491775 C47.5695833,72.3544635 46.0088137,72.8876745 44.1993159,72.8876745 C41.2907503,72.8876745 39.5962892,71.4434965 39.3118063,68.704377 L39.2573971,67.7638735 C39.2573971,67.7638735 40.1434913,62.231225 40.1434913,62.200134 C40.1434913,62.200134 44.7884909,43.5952629 45.6201759,41.1359627 C45.6637033,40.9960531 45.6761397,40.9229891 45.6870215,40.8561434 C36.6457507,40.9354255 35.0430082,40.8561434 34.9326351,40.7100156 C34.8720075,40.9105527 34.6481522,42.0640298 34.6481522,42.0640298 L29.9052159,63.0333735 L29.4979234,64.8117805 L28.7097659,70.6289115 C28.7097659,72.3544635 29.0486581,73.762887 29.7233334,74.9536735 C31.8841598,78.729679 38.0479561,79.2955355 41.5348148,79.2955355 C46.0274683,79.2955355 50.241857,78.341041 53.089795,76.598389 C58.0332685,73.677387 59.3266555,69.1116695 60.4801325,65.0542905 L61.014898,62.972746 C61.014898,62.972746 65.7998075,43.6496723 66.6128375,41.1359627 C66.643929,40.9960531 66.656365,40.9229891 66.698338,40.8561434 Z M82.9786885,56.444252 C81.825211,56.444252 79.7172395,56.724071 77.823796,57.6521385 C77.1366845,58.0050215 76.486882,58.412314 75.8013245,58.818052 L76.420036,56.5841615 L76.081144,56.20796 C72.0657375,57.0209905 71.167207,57.129809 67.4580475,57.6521385 L67.147137,57.8588935 C66.7165265,61.4296985 66.3341065,64.1144085 64.7375825,71.133208 C64.129753,73.7199815 63.498605,76.331628 62.8659025,78.912183 L63.036903,79.2401935 C66.8377815,79.0396565 67.9912585,79.0396565 71.29468,79.0940655 L71.562063,78.8033645 C71.981792,76.65342 72.036201,76.1497455 72.965823,71.795447 C73.402652,69.7310025 74.313619,65.1948215 74.7628845,63.579643 C75.588351,63.197223 76.402936,62.8210215 77.1802115,62.8210215 C79.0316825,62.8210215 78.8062725,64.4362005 78.734763,65.079785 C78.655481,66.160198 77.9808055,69.68903 77.2890305,72.7188505 L76.8273285,74.674476 C76.5055365,76.1186545 76.152653,77.522414 75.830861,78.954156 L75.9707705,79.2401935 C79.7172395,79.0396565 80.859835,79.0396565 84.0591015,79.0940655 L84.435303,78.8033645 C85.013596,75.4455335 85.183042,74.547003 86.209046,69.6579385 L86.725157,67.411612 C87.727843,63.0153405 88.2315175,60.786114 87.4728965,58.970398 C86.670748,56.93549 84.7462135,56.444252 82.9786885,56.444252 Z M101.165696,61.047123 C99.1743155,61.429543 97.904247,61.684489 96.6419515,61.8492715 C95.3905375,62.049809 94.1702145,62.2316915 92.24568,62.499074 L92.093334,62.637429 L91.9534245,62.7478025 C91.7528875,64.181099 91.6129775,65.420076 91.3471495,66.876691 C91.1217395,68.383051 90.7750745,70.094612 90.2107725,72.5539125 C89.7739435,74.436474 89.5485335,75.092495 89.299805,75.754734 C89.057295,76.4169725 88.7899125,77.060557 88.298674,78.9120275 L88.413711,79.0830285 L88.510093,79.240038 C90.308709,79.1545375 91.4855045,79.09391 92.6949455,79.0830285 C93.902832,79.039501 95.1542455,79.0830285 97.0912165,79.09391 L97.260663,78.955555 L97.4425455,78.803209 C97.7223645,77.133621 97.7643375,76.6843555 97.935338,75.8697705 C98.104784,74.9961125 98.39704,73.786672 99.113688,70.556314 C99.4525805,69.039072 99.8303365,67.5264935 100.181665,65.97816 C100.546985,64.436045 100.929404,62.9172485 101.293169,61.4000065 L101.23876,61.2165695 L101.165696,61.047123 Z M101.208135,54.841043 C99.3986375,53.7730665 96.222689,54.1119585 94.0851805,55.587228 C91.953891,57.0329605 91.711381,59.0849685 93.5146605,60.166936 C95.293067,61.2053765 98.481452,60.896021 100.600305,59.408315 C102.726932,57.9314915 102.99276,55.898138 101.208135,54.841043 Z M112.151399,79.574733 C115.812368,79.574733 119.565055,78.565829 122.389675,75.571763 C124.562938,73.143554 125.559405,69.5307765 125.904516,68.043071 C127.028457,63.112034 126.153244,60.809743 125.054176,59.407538 C123.384588,57.2700295 120.43405,56.5844725 117.373138,56.5844725 C115.532549,56.5844725 111.148714,56.766355 107.724038,59.923649 C105.264737,62.2010665 104.12836,65.291515 103.442803,68.2544895 C102.751028,71.2734285 101.955097,76.70814 106.95298,78.7306115 C108.495095,79.3928505 110.718104,79.574733 112.151399,79.574733 Z M111.865362,68.4798995 C112.709484,64.7458675 113.705951,61.6118915 116.249197,61.6118915 C118.242132,61.6118915 118.386705,63.943719 117.500611,67.6901875 C117.342047,68.5218725 116.614517,71.6138755 115.630486,72.9305805 C114.943374,73.902175 114.130344,74.49135 113.231813,74.49135 C112.96443,74.49135 111.374124,74.49135 111.349251,72.1299865 C111.336815,70.964073 111.574661,69.7732865 111.865362,68.4798995 Z M135.05616,79.094532 L135.342197,78.803831 C135.747935,76.6538865 135.814781,76.148657 136.713312,71.7959135 C137.162577,69.731469 138.092198,65.195288 138.529028,63.580109 C139.356049,63.196135 140.156643,62.8199335 140.958791,62.8199335 C142.797825,62.8199335 142.57397,64.4351125 142.500907,65.0786965 C142.43406,66.1606645 141.759386,69.6879415 141.055173,72.717762 L140.618345,74.673388 C140.284116,76.1191205 139.920351,77.521326 139.598559,78.9546225 L139.738469,79.24066 C143.497374,79.0401225 144.596441,79.0401225 147.814363,79.094532 L148.203001,78.803831 C148.767303,75.4444455 148.919649,74.5459145 149.976744,69.658405 L150.480419,67.410524 C151.487768,63.0142525 151.99766,60.7865805 151.251476,58.9708645 C150.426009,56.9359565 148.489038,56.4447185 146.746386,56.4447185 C145.591354,56.4447185 143.472501,56.722983 141.589939,57.652605 C140.916819,58.005488 140.242143,58.411226 139.579904,58.8185185 L140.156643,56.584628 L139.847287,56.206872 C135.833436,57.021457 134.91625,57.1302755 131.211754,57.652605 L130.927271,57.85936 C130.478006,61.4301645 130.112686,64.1133205 128.516162,71.1336745 C127.908333,73.720448 127.277185,76.332094 126.646037,78.9126495 L126.815483,79.24066 C130.622579,79.0401225 131.758957,79.0401225 135.05616,79.094532 Z M162.673542,79.2398825 C162.909834,78.0864055 164.313594,71.2494885 164.32603,71.2494885 C164.32603,71.2494885 165.52148,66.232951 165.594545,66.0510685 C165.594545,66.0510685 165.970746,65.5287395 166.346947,65.321984 L166.900367,65.321984 C172.122106,65.321984 178.018519,65.321984 182.6402,61.92218 C185.785058,59.590353 187.935002,56.1470215 188.89416,51.9621695 C189.142889,50.9361655 189.326326,49.7158426 189.326326,48.4955199 C189.326326,46.8927774 189.004534,45.3071349 188.074912,44.0681575 C185.718212,40.770954 181.025022,40.7103265 175.60741,40.6854536 C175.59031,40.6854536 172.93669,40.7103265 172.93669,40.7103265 C166.001837,40.7958268 163.220744,40.770954 162.078149,40.6310444 C161.981767,41.1362735 161.799884,42.0348043 161.799884,42.0348043 C161.799884,42.0348043 159.315711,53.547812 159.315711,53.5664665 C159.315711,53.5664665 153.371107,78.0444325 153.091287,79.1979095 C159.146265,79.124846 161.628884,79.124846 162.673542,79.2398825 Z M167.276569,58.7882045 C167.276569,58.7882045 169.917752,47.2985153 169.905316,47.3420427 L169.990815,46.7528678 L170.028125,46.3036024 L171.083665,46.4124209 C171.083665,46.4124209 176.530813,46.8803409 176.658287,46.8927774 C178.808231,47.7244624 179.694325,49.8681887 179.075614,52.666381 C178.511312,55.223618 176.852606,57.373563 174.721316,58.412003 C172.966227,59.291879 170.816282,59.364943 168.601047,59.364943 L167.167751,59.364943 L167.276569,58.7882045 Z M183.721236,68.692718 C183.023242,71.668129 182.221093,77.102841 187.194103,79.039812 C188.779745,79.714487 190.200605,79.915024 191.644784,79.8419605 C193.169799,79.759569 194.582886,78.99473 195.891818,77.8941075 C195.773673,78.346482 195.655527,78.7988565 195.537381,79.2527855 L195.76279,79.5434865 C199.339813,79.392695 200.449763,79.392695 204.325259,79.4222315 L204.676588,79.1548485 C205.242445,75.8281085 205.775656,72.597751 207.246262,66.2334175 C207.962909,63.184942 208.678003,60.1660035 209.413306,57.1299645 L209.29827,56.795736 C205.296854,57.537257 204.227323,57.6958215 200.378253,58.241469 L200.085998,58.479315 C200.047134,58.788671 200.006716,59.08559 199.969406,59.3825095 C199.370904,58.4155785 198.503465,57.590112 197.164996,57.0755555 C195.453434,56.4024345 191.433365,57.269874 187.977597,60.416286 C185.549388,62.662613 184.383475,65.7406245 183.721236,68.692718 Z M192.12514,68.8746005 C192.981698,65.2074135 193.965729,62.104529 196.515194,62.104529 C198.127263,62.104529 198.976048,63.5922345 198.803493,66.1292625 C198.666693,66.761965 198.51901,67.4288675 198.343345,68.182825 C198.0884,69.2725655 197.811689,70.3529785 197.542752,71.4349465 C197.26915,72.174913 196.950468,72.8729065 196.600694,73.3377175 C195.944673,74.267339 194.383904,74.8440775 193.485373,74.8440775 C193.230426,74.8440775 191.65722,74.8440775 191.602811,72.524687 C191.590374,71.3696555 191.828221,70.1804235 192.12514,68.8746005 Z M236.010903,56.766044 L235.701548,56.413161 C231.742105,57.2153095 231.025456,57.3427825 227.387807,57.834021 L227.120423,58.1014035 C227.107988,58.144931 227.097105,58.211777 227.078451,58.2724045 L227.066014,58.211777 C224.357986,64.459519 224.437268,63.111723 222.232914,68.0303235 C222.220477,67.806468 222.220477,67.6665585 222.208042,67.428712 L221.656175,56.766044 L221.30951,56.413161 C217.161968,57.2153095 217.064031,57.3427825 213.233616,57.834021 L212.935143,58.1014035 C212.893169,58.228877 212.893169,58.3687865 212.868297,58.5211325 L212.893169,58.575542 C213.371971,61.022406 213.256934,60.4767585 213.737291,64.338264 C213.961146,66.233262 214.25962,68.139142 214.483475,70.010822 C214.861232,73.143243 215.072651,74.685358 215.534352,79.4656035 C212.947578,83.7344015 212.335085,85.3495805 209.844694,89.0960495 L209.861794,89.1333585 L208.10826,91.906678 C207.907723,92.198934 207.725841,92.399471 207.470894,92.4849715 C207.191075,92.6233265 206.82731,92.648199 206.32208,92.648199 L205.350486,92.648199 L203.906308,97.451763 L208.860663,97.5372635 C211.769228,97.524827 213.597381,96.1645945 214.581412,94.336442 L217.696733,88.9981125 L217.646987,88.9981125 L217.974998,88.621911 C220.070533,84.110603 236.010903,56.766044 236.010903,56.766044 Z M183.72108,119.853625 L181.619326,119.853625 L189.398302,94.1242455 L191.978857,94.1242455 L192.798105,91.4737355 L192.877387,94.421165 C192.781005,96.243099 194.214302,97.858278 197.979425,97.5908955 L202.333723,97.5908955 L203.832311,92.63654 L202.193814,92.63654 C201.251756,92.63654 200.814927,92.3986935 200.869337,91.888801 L200.790054,88.890071 L192.726596,88.890071 L192.726596,88.9056165 C190.119614,88.960026 182.33442,89.1558995 180.758105,89.5756285 C178.850671,90.0668665 176.840635,91.5125995 176.840635,91.5125995 L177.630347,88.85898 L170.087664,88.85898 L168.516013,94.1242455 L160.632883,120.246927 L159.103204,120.246927 L157.603062,125.165528 L172.626247,125.165528 L172.122572,126.805579 L179.525345,126.805579 L180.016584,125.165528 L182.093465,125.165528 L183.72108,119.853625 Z M177.557284,99.352202 C176.349398,99.6864305 174.101516,100.699998 174.101516,100.699998 L176.100669,94.1242455 L182.093465,94.1242455 L180.647732,98.915373 C180.647732,98.915373 178.796261,99.0241915 177.557284,99.352202 Z M177.672321,108.746356 C177.672321,108.746356 175.789759,108.982648 174.550781,109.262467 C173.330458,109.632451 171.042159,110.798364 171.042159,110.798364 L173.106603,103.955229 L179.13049,103.955229 L177.672321,108.746356 Z M174.31449,119.914253 L168.30304,119.914253 L170.045692,114.139095 L176.038487,114.139095 L174.31449,119.914253 Z M188.791404,103.955229 L197.456474,103.955229 L196.211278,107.987735 L187.431173,107.987735 L186.112912,112.396443 L193.795505,112.396443 L187.978375,120.587374 C187.571082,121.188986 187.205762,121.401959 186.800025,121.571405 C186.392732,121.77816 185.857967,122.02067 185.239255,122.02067 L183.107965,122.02067 L181.643577,126.849107 L187.218198,126.849107 C190.115882,126.849107 191.827443,125.530847 193.091294,123.800631 L197.080273,118.341047 L197.936831,123.884578 C198.118713,124.923017 198.864898,125.530847 199.370127,125.767139 C199.928211,126.046958 200.50495,126.527315 201.319535,126.598824 C202.193192,126.636133 202.82434,126.66567 203.244069,126.66567 L205.983189,126.66567 L207.627904,121.262049 L206.547491,121.262049 C205.927224,121.262049 204.859248,121.157894 204.677366,120.963575 C204.495483,120.727283 204.495483,120.363518 204.397546,119.810098 L203.528552,114.254131 L199.970183,114.254131 L201.530954,112.396443 L210.293959,112.396443 L211.641755,107.987735 L203.528552,107.987735 L204.792402,103.955229 L212.880733,103.955229 L214.380875,98.982219 L190.266674,98.982219 L188.791404,103.955229 Z M115.605924,121.037106 L117.628395,114.309008 L125.940582,114.309008 L127.459378,109.304907 L119.139419,109.304907 L120.409488,105.163582 L128.539791,105.163582 L130.046152,100.318045 L109.703292,100.318045 L108.228023,105.163582 L112.849704,105.163582 L111.616945,109.304907 L106.982827,109.304907 L105.446931,114.394508 L110.067057,114.394508 L107.371465,123.295869 C107.0077,124.474219 107.542466,124.923484 107.881358,125.470686 C108.228023,126.003897 108.579352,126.35678 109.369064,126.557317 C110.183649,126.7392 110.741733,126.848018 111.500354,126.848018 L120.87119,126.848018 L122.540778,121.304488 L118.387016,121.875009 C117.584868,121.875009 115.363414,121.778627 115.605924,121.037106 Z M116.55933,88.8286665 L114.452913,92.635763 C114.002093,93.4674475 113.596355,93.983559 113.231036,94.221405 C112.909244,94.4219425 112.271878,94.505888 111.348474,94.505888 L110.249406,94.505888 L108.780355,99.3762975 L112.430442,99.3762975 C114.18553,99.3762975 115.533326,98.7327135 116.176911,98.410921 C116.868686,98.040938 117.050568,98.252357 117.585334,97.736246 L118.818094,96.668269 L130.216064,96.668269 L131.728643,91.5973225 L123.385365,91.5973225 L124.84198,88.8286665 L116.55933,88.8286665 Z M133.386416,121.134887 C133.192097,120.855067 133.332007,120.362275 133.628926,119.336271 L136.744247,109.024932 L147.826644,109.024932 C149.441823,109.001614 150.607736,108.982959 151.366357,108.92855 C152.180942,108.843049 153.067037,108.552348 154.032413,108.030019 C155.028881,107.482817 155.538773,106.906078 155.969384,106.243839 C156.44974,105.583155 157.220798,104.137422 157.883037,101.908196 L161.798952,88.859291 L150.298381,88.926137 C150.298381,88.926137 146.757113,89.448466 145.197898,90.0252045 C143.624692,90.668789 141.37681,92.4658505 141.37681,92.4658505 L142.415251,88.8888275 L135.31095,88.8888275 L125.364931,121.874854 C125.012048,123.155803 124.775756,124.085425 124.721347,124.643509 C124.702692,125.245121 125.479968,125.840514 125.983643,126.289779 C126.579036,126.739045 127.458911,126.665981 128.303033,126.739045 C129.190682,126.805891 130.452978,126.847863 132.195629,126.847863 L137.655214,126.847863 L139.33102,121.189296 L134.443511,121.650998 C133.921182,121.650998 133.543426,121.371178 133.386416,121.134887 Z M138.754282,102.060541 L150.394763,102.060541 L149.654797,104.379932 C149.550642,104.434341 149.301913,104.264895 148.117345,104.404805 L138.037634,104.404805 L138.754282,102.060541 Z M141.086109,94.2815665 L152.824526,94.2815665 L151.980405,97.075095 C151.980405,97.075095 146.447757,97.020686 145.561663,97.1839135 C141.662847,97.858589 139.38543,99.941688 139.38543,99.941688 L141.086109,94.2815665 Z M149.915339,112.146937 C149.818957,112.493602 149.666611,112.705021 149.453638,112.863585 C149.217345,113.015931 148.834926,113.07034 148.264406,113.07034 L146.605699,113.07034 L146.703636,110.245721 L139.804537,110.245721 L139.524718,124.054801 C139.513836,125.051268 139.610218,125.628007 140.339303,126.089709 C141.068387,126.666447 143.314714,126.739511 146.338316,126.739511 L150.661524,126.739511 L152.222294,121.570628 L148.458724,121.777383 L147.207311,121.850447 C147.03631,121.777383 146.873082,121.710537 146.6912,121.528655 C146.532635,121.371645 146.265253,121.468028 146.30878,120.47156 L146.338316,116.931847 L150.285323,116.768619 C152.416613,116.768619 153.32758,116.075288 154.104855,115.414604 C154.846376,114.781902 155.088886,114.054372 155.368706,113.07034 L156.030945,109.936365 L150.607114,109.936365 L149.915339,112.146937 Z\" fill=\"#FEFEFE\"></path></g></svg>'\n\nexport function MastercardIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={MASTERCARD_SVG} width={size} height={size * (18 / 24)} />\n}\n\nexport function VisaIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={VISA_SVG} width={size} height={size * (19 / 24)} />\n}\n\nexport function JcbIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={JCB_SVG} width={size} height={size * (19 / 24)} />\n}\n\nexport function UnionPayIcon({ size = 24 }: { size?: number }) {\n return <SvgXml xml={UNIONPAY_SVG} width={size} height={size * (160 / 256)} />\n}\n\nexport function ApplePayIcon({ size = 20, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n const w = size * (11.7334 / 14.4)\n return (\n <SvgXml\n xml={APPLE_SVG.replace('currentColor', c).replace('currentColor', c)}\n width={w}\n height={size}\n />\n )\n}\n\nexport function RevolutIcon({ size = 20, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n const w = size * (15.9174 / 20)\n return (\n <SvgXml\n xml={REVOLUT_SVG.replace('currentColor', c).replace('currentColor', c)}\n width={w}\n height={size}\n />\n )\n}\n\nexport function CryptoCoinIcon({ size = 24, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n return (\n <SvgXml\n xml={CRYPTO_SVG.replace(/currentColor/g, c)}\n width={size}\n height={size}\n />\n )\n}\n\nexport function BankIcon({ size = 24, color }: BrandIconProps) {\n const c = useGlyphColor(color)\n return (\n <SvgXml\n xml={BANK_SVG.replace(/currentColor/g, c)}\n width={size}\n height={size}\n />\n )\n}\n", "import type { TFunction } from 'i18next'\nimport {\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react'\n\nimport { type Locale, i18n, localeMapping } from '../locales/i18n'\n\ninterface FunkitI18nValue {\n /** Translate against the SDK's private i18next instance. */\n t: TFunction\n locale: Locale\n}\n\n// Bound once so `t` survives destructuring (i18next's `t` is an instance method).\n// Also serves trees mounted without <FunkitProvider> (unit tests, Storybook),\n// so screens can call useFunkitTranslation unconditionally.\nconst DEFAULT_VALUE: FunkitI18nValue = { t: i18n.t.bind(i18n), locale: 'en' }\n\nconst FunkitI18nContext = createContext<FunkitI18nValue>(DEFAULT_VALUE)\n\nexport interface FunkitI18nProviderProps {\n children: ReactNode\n /** UI language. Defaults to English. */\n locale?: Locale\n}\n\n/**\n * Translation layer for `@funkit/connect-rn`. Keeps the SDK's copy on its\n * private i18next instance and exposes `t` via {@link useFunkitTranslation}.\n * Internal \u2014 host apps mount {@link FunkitProvider}, which passes `locale` down.\n */\nexport function FunkitI18nProvider({\n children,\n locale = 'en',\n}: FunkitI18nProviderProps) {\n // `changeLanguage` resolves async, so the applied language is tracked in\n // state via the instance's own event \u2014 subscribers re-render only once the\n // new resources are actually active (a fresh fixed `t` below).\n const [language, setLanguage] = useState(i18n.language)\n useEffect(() => {\n i18n.on('languageChanged', setLanguage)\n return () => i18n.off('languageChanged', setLanguage)\n }, [])\n\n useEffect(() => {\n if (i18n.language !== localeMapping[locale]) {\n void i18n.changeLanguage(localeMapping[locale])\n }\n }, [locale])\n\n const t = useMemo<TFunction>(() => i18n.getFixedT(language), [language])\n const value = useMemo<FunkitI18nValue>(() => ({ t, locale }), [t, locale])\n return (\n <FunkitI18nContext.Provider value={value}>\n {children}\n </FunkitI18nContext.Provider>\n )\n}\n\n/** Read the SDK's translation function (and active locale). */\nexport function useFunkitTranslation(): FunkitI18nValue {\n return useContext(FunkitI18nContext)\n}\n", "import i18next, { type i18n as I18nInstance } from 'i18next'\n\nimport en from './translations/en.json' with { type: 'json' }\nimport es from './translations/es.json' with { type: 'json' }\nimport fr from './translations/fr.json' with { type: 'json' }\nimport ja from './translations/ja.json' with { type: 'json' }\nimport ko from './translations/ko.json' with { type: 'json' }\nimport ru from './translations/ru.json' with { type: 'json' }\nimport tr from './translations/tr.json' with { type: 'json' }\nimport zh from './translations/zh.json' with { type: 'json' }\n\n/** Locales bundled with the RN SDK. */\nexport const localeMapping = {\n en: 'en',\n zh: 'zh',\n ko: 'ko',\n ja: 'ja',\n tr: 'tr',\n es: 'es',\n ru: 'ru',\n fr: 'fr',\n} as const\nexport type Locale = keyof typeof localeMapping\n\n// Private instance, deliberately NOT shared with @funkit/connect's i18n:\n// - importing the SDK must never init/mutate the host app's i18next singleton\n// - react-i18next is skipped entirely (its context/globals would collide with\n// the host's own i18n) \u2014 components bind this instance via useFunkitTranslation\nexport const i18n: I18nInstance = i18next.createInstance()\n\nvoid i18n.init({\n resources: {\n en: { translation: en },\n zh: { translation: zh },\n ko: { translation: ko },\n ja: { translation: ja },\n tr: { translation: tr },\n es: { translation: es },\n ru: { translation: ru },\n fr: { translation: fr },\n },\n lng: 'en',\n fallbackLng: 'en',\n // Resources are bundled, so init synchronously \u2014 `t` is usable on import.\n initImmediate: false,\n interpolation: {\n escapeValue: false, // React already escapes interpolated values\n },\n})\n", "{\n \"availableChains\": {\n \"gotIt\": \"Got it\",\n \"title\": \"Available {{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"Not available\",\n \"regionMessage\": \"This service is not available in your region.\",\n \"viewRegions\": \"View available regions.\"\n },\n \"common\": {\n \"addressCopied\": \"Address copied\",\n \"back\": \"Back\",\n \"close\": \"Close\",\n \"copied\": \"Copied!\",\n \"copy\": \"Copy\",\n \"copyAddress\": \"Copy address\",\n \"done\": \"Done\",\n \"tryAgain\": \"Try again\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"{{limit}} limit \u00B7 1-2 days\",\n \"bankTransferTime\": \"1-2 days\",\n \"instant\": \"Instant\",\n \"limit\": \"{{limit}} limit\"\n },\n \"networks\": {\n \"chainFallback\": \"Chain {{chainId}}\",\n \"evmChains\": \"EVM Chains\",\n \"min\": \"Min ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"QR Code\"\n },\n \"selectMethod\": {\n \"crypto\": \"Crypto\",\n \"depositTo\": \"Deposit to\",\n \"errorMessage\": \"There was a problem loading data.\\nCheck your internet and try again.\",\n \"errorTitle\": \"Something went wrong\",\n \"loadingMethods\": \"Loading payment methods\",\n \"noLimit\": \"No limit\",\n \"payWith\": \"Pay with\",\n \"title\": \"Add money\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"Available chains\",\n \"depositAddressLabel\": \"Your deposit address\",\n \"generating\": \"Generating\u2026\",\n \"share\": \"Share\",\n \"shareAddress\": \"Share address\",\n \"showQrCode\": \"Show QR code\",\n \"title\": \"Transfer Crypto\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"Your balance is below the minimum for a cash withdrawal.\",\n \"belowMinimumTitle\": \"Balance too low\",\n \"title\": \"Withdraw\",\n \"unavailableMessage\": \"Cash withdrawals aren't available in your region right now.\",\n \"unavailableTitle\": \"Withdrawals unavailable\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"Entendido\",\n \"title\": \"{{networkLabel}} disponibles\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"No disponible\",\n \"regionMessage\": \"Este servicio no est\u00E1 disponible en tu regi\u00F3n.\",\n \"viewRegions\": \"Ver regiones disponibles.\"\n },\n \"common\": {\n \"addressCopied\": \"Direcci\u00F3n copiada\",\n \"back\": \"Atr\u00E1s\",\n \"close\": \"Cerrar\",\n \"copied\": \"\u00A1Copiado!\",\n \"copy\": \"Copiar\",\n \"copyAddress\": \"Copiar direcci\u00F3n\",\n \"done\": \"Listo\",\n \"tryAgain\": \"Intentar nuevamente\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"L\u00EDmite de {{limit}} \u00B7 1-2 d\u00EDas\",\n \"bankTransferTime\": \"1-2 d\u00EDas\",\n \"instant\": \"Instant\u00E1neo\",\n \"limit\": \"L\u00EDmite de {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"Cadena {{chainId}}\",\n \"evmChains\": \"Cadenas EVM\",\n \"min\": \"M\u00EDn. ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"C\u00F3digo QR\"\n },\n \"selectMethod\": {\n \"crypto\": \"Cripto\",\n \"depositTo\": \"Depositar en\",\n \"errorMessage\": \"Hubo un problema al cargar los datos.\\nRevisa tu conexi\u00F3n a internet e intenta nuevamente.\",\n \"errorTitle\": \"Algo sali\u00F3 mal\",\n \"loadingMethods\": \"Cargando m\u00E9todos de pago\",\n \"noLimit\": \"Sin l\u00EDmite\",\n \"payWith\": \"Pagar con\",\n \"title\": \"Agregar dinero\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"Cadenas disponibles\",\n \"depositAddressLabel\": \"Tu direcci\u00F3n de dep\u00F3sito\",\n \"generating\": \"Generando\u2026\",\n \"share\": \"Compartir\",\n \"shareAddress\": \"Compartir direcci\u00F3n\",\n \"showQrCode\": \"Mostrar c\u00F3digo QR\",\n \"title\": \"Transferir cripto\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"Tu saldo est\u00E1 por debajo del m\u00EDnimo para un retiro en efectivo.\",\n \"belowMinimumTitle\": \"Saldo insuficiente\",\n \"title\": \"Retirar\",\n \"unavailableMessage\": \"Los retiros en efectivo no est\u00E1n disponibles en tu regi\u00F3n en este momento.\",\n \"unavailableTitle\": \"Retiros no disponibles\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"Compris\",\n \"title\": \"{{networkLabel}} disponibles\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"Non disponible\",\n \"regionMessage\": \"Ce service n'est pas disponible dans votre r\u00E9gion.\",\n \"viewRegions\": \"Voir les r\u00E9gions disponibles.\"\n },\n \"common\": {\n \"addressCopied\": \"Adresse copi\u00E9e\",\n \"back\": \"Retour\",\n \"close\": \"Fermer\",\n \"copied\": \"Copi\u00E9 !\",\n \"copy\": \"Copier\",\n \"copyAddress\": \"Copier l'adresse\",\n \"done\": \"Termin\u00E9\",\n \"tryAgain\": \"R\u00E9essayer\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"Limite de {{limit}} \u00B7 1-2 jours\",\n \"bankTransferTime\": \"1-2 jours\",\n \"instant\": \"Instantan\u00E9\",\n \"limit\": \"Limite de {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"Cha\u00EEne {{chainId}}\",\n \"evmChains\": \"Cha\u00EEnes EVM\",\n \"min\": \"Min ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"Code QR\"\n },\n \"selectMethod\": {\n \"crypto\": \"Crypto\",\n \"depositTo\": \"D\u00E9poser sur\",\n \"errorMessage\": \"Un probl\u00E8me est survenu lors du chargement des donn\u00E9es.\\nV\u00E9rifiez votre connexion internet et r\u00E9essayez.\",\n \"errorTitle\": \"Une erreur est survenue\",\n \"loadingMethods\": \"Chargement des moyens de paiement\",\n \"noLimit\": \"Sans limite\",\n \"payWith\": \"Payer avec\",\n \"title\": \"Ajouter de l'argent\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"Cha\u00EEnes disponibles\",\n \"depositAddressLabel\": \"Votre adresse de d\u00E9p\u00F4t\",\n \"generating\": \"G\u00E9n\u00E9ration\u2026\",\n \"share\": \"Partager\",\n \"shareAddress\": \"Partager l'adresse\",\n \"showQrCode\": \"Afficher le code QR\",\n \"title\": \"Transf\u00E9rer des cryptos\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"Votre solde est inf\u00E9rieur au minimum requis pour un retrait en esp\u00E8ces.\",\n \"belowMinimumTitle\": \"Solde insuffisant\",\n \"title\": \"Retirer\",\n \"unavailableMessage\": \"Les retraits en esp\u00E8ces ne sont pas disponibles dans votre r\u00E9gion pour le moment.\",\n \"unavailableTitle\": \"Retraits indisponibles\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"\u308F\u304B\u308A\u307E\u3057\u305F\",\n \"title\": \"\u5229\u7528\u53EF\u80FD\u306A{{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\",\n \"regionMessage\": \"\u3053\u306E\u30B5\u30FC\u30D3\u30B9\u306F\u304A\u4F4F\u307E\u3044\u306E\u5730\u57DF\u3067\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\u3002\",\n \"viewRegions\": \"\u5229\u7528\u53EF\u80FD\u306A\u5730\u57DF\u3092\u78BA\u8A8D\u3059\u308B\u3002\"\n },\n \"common\": {\n \"addressCopied\": \"\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\",\n \"back\": \"\u623B\u308B\",\n \"close\": \"\u9589\u3058\u308B\",\n \"copied\": \"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\uFF01\",\n \"copy\": \"\u30B3\u30D4\u30FC\",\n \"copyAddress\": \"\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC\",\n \"done\": \"\u5B8C\u4E86\",\n \"tryAgain\": \"\u518D\u8A66\u884C\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"\u9650\u5EA6\u984D {{limit}}\u30FB1\u301C2\u65E5\",\n \"bankTransferTime\": \"1\u301C2\u65E5\",\n \"instant\": \"\u5373\u6642\",\n \"limit\": \"\u9650\u5EA6\u984D {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"\u30C1\u30A7\u30FC\u30F3 {{chainId}}\",\n \"evmChains\": \"EVM\u30C1\u30A7\u30FC\u30F3\",\n \"min\": \"\u6700\u4F4E ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"QR\u30B3\u30FC\u30C9\"\n },\n \"selectMethod\": {\n \"crypto\": \"\u6697\u53F7\u8CC7\u7523\",\n \"depositTo\": \"\u5165\u91D1\u5148\",\n \"errorMessage\": \"\u30C7\u30FC\u30BF\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\\n\u30A4\u30F3\u30BF\u30FC\u30CD\u30C3\u30C8\u63A5\u7D9A\u3092\u78BA\u8A8D\u3057\u3066\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\",\n \"errorTitle\": \"\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\",\n \"loadingMethods\": \"\u652F\u6255\u3044\u65B9\u6CD5\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\",\n \"noLimit\": \"\u5236\u9650\u306A\u3057\",\n \"payWith\": \"\u652F\u6255\u3044\u65B9\u6CD5\",\n \"title\": \"\u5165\u91D1\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"\u5229\u7528\u53EF\u80FD\u306A\u30C1\u30A7\u30FC\u30F3\",\n \"depositAddressLabel\": \"\u3042\u306A\u305F\u306E\u5165\u91D1\u30A2\u30C9\u30EC\u30B9\",\n \"generating\": \"\u751F\u6210\u4E2D\u2026\",\n \"share\": \"\u5171\u6709\",\n \"shareAddress\": \"\u30A2\u30C9\u30EC\u30B9\u3092\u5171\u6709\",\n \"showQrCode\": \"QR\u30B3\u30FC\u30C9\u3092\u8868\u793A\",\n \"title\": \"\u6697\u53F7\u8CC7\u7523\u3092\u9001\u91D1\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"\u6B8B\u9AD8\u304C\u73FE\u91D1\u51FA\u91D1\u306E\u6700\u4F4E\u984D\u3092\u4E0B\u56DE\u3063\u3066\u3044\u307E\u3059\u3002\",\n \"belowMinimumTitle\": \"\u6B8B\u9AD8\u4E0D\u8DB3\",\n \"title\": \"\u51FA\u91D1\",\n \"unavailableMessage\": \"\u73FE\u91D1\u51FA\u91D1\u306F\u73FE\u5728\u304A\u4F4F\u307E\u3044\u306E\u5730\u57DF\u3067\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\u3002\",\n \"unavailableTitle\": \"\u51FA\u91D1\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"\uD655\uC778\",\n \"title\": \"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C {{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"\uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC74C\",\n \"regionMessage\": \"\uC774 \uC11C\uBE44\uC2A4\uB294 \uADC0\uD558\uC758 \uC9C0\uC5ED\uC5D0\uC11C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\",\n \"viewRegions\": \"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uC9C0\uC5ED \uBCF4\uAE30.\"\n },\n \"common\": {\n \"addressCopied\": \"\uC8FC\uC18C\uAC00 \uBCF5\uC0AC\uB428\",\n \"back\": \"\uB4A4\uB85C\",\n \"close\": \"\uB2EB\uAE30\",\n \"copied\": \"\uBCF5\uC0AC\uB428!\",\n \"copy\": \"\uBCF5\uC0AC\",\n \"copyAddress\": \"\uC8FC\uC18C \uBCF5\uC0AC\",\n \"done\": \"\uC644\uB8CC\",\n \"tryAgain\": \"\uB2E4\uC2DC \uC2DC\uB3C4\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"\uD55C\uB3C4 {{limit}} \u00B7 1~2\uC77C\",\n \"bankTransferTime\": \"1~2\uC77C\",\n \"instant\": \"\uC989\uC2DC\",\n \"limit\": \"\uD55C\uB3C4 {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"\uCCB4\uC778 {{chainId}}\",\n \"evmChains\": \"EVM \uCCB4\uC778\",\n \"min\": \"\uCD5C\uC18C ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"QR \uCF54\uB4DC\"\n },\n \"selectMethod\": {\n \"crypto\": \"\uC554\uD638\uD654\uD3D0\",\n \"depositTo\": \"\uC785\uAE08 \uB300\uC0C1\",\n \"errorMessage\": \"\uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC624\uB294 \uC911 \uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\\n\uC778\uD130\uB137 \uC5F0\uACB0\uC744 \uD655\uC778\uD558\uACE0 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.\",\n \"errorTitle\": \"\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4\",\n \"loadingMethods\": \"\uACB0\uC81C \uC218\uB2E8 \uBD88\uB7EC\uC624\uB294 \uC911\",\n \"noLimit\": \"\uC81C\uD55C \uC5C6\uC74C\",\n \"payWith\": \"\uACB0\uC81C \uC218\uB2E8\",\n \"title\": \"\uC790\uAE08 \uCD94\uAC00\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCCB4\uC778\",\n \"depositAddressLabel\": \"\uB0B4 \uC785\uAE08 \uC8FC\uC18C\",\n \"generating\": \"\uC0DD\uC131 \uC911\u2026\",\n \"share\": \"\uACF5\uC720\",\n \"shareAddress\": \"\uC8FC\uC18C \uACF5\uC720\",\n \"showQrCode\": \"QR \uCF54\uB4DC \uD45C\uC2DC\",\n \"title\": \"\uC554\uD638\uD654\uD3D0 \uC804\uC1A1\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"\uC794\uC561\uC774 \uD604\uAE08 \uCD9C\uAE08 \uCD5C\uC18C \uAE08\uC561\uBCF4\uB2E4 \uC801\uC2B5\uB2C8\uB2E4.\",\n \"belowMinimumTitle\": \"\uC794\uC561 \uBD80\uC871\",\n \"title\": \"\uCD9C\uAE08\",\n \"unavailableMessage\": \"\uD604\uC7AC \uADC0\uD558\uC758 \uC9C0\uC5ED\uC5D0\uC11C\uB294 \uD604\uAE08 \uCD9C\uAE08\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\",\n \"unavailableTitle\": \"\uCD9C\uAE08 \uBD88\uAC00\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"\u041F\u043E\u043D\u044F\u0442\u043D\u043E\",\n \"title\": \"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 {{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\",\n \"regionMessage\": \"\u042D\u0442\u043E\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u0432\u0430\u0448\u0435\u043C \u0440\u0435\u0433\u0438\u043E\u043D\u0435.\",\n \"viewRegions\": \"\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0440\u0435\u0433\u0438\u043E\u043D\u044B.\"\n },\n \"common\": {\n \"addressCopied\": \"\u0410\u0434\u0440\u0435\u0441 \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\",\n \"back\": \"\u041D\u0430\u0437\u0430\u0434\",\n \"close\": \"\u0417\u0430\u043A\u0440\u044B\u0442\u044C\",\n \"copied\": \"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E!\",\n \"copy\": \"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C\",\n \"copyAddress\": \"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0430\u0434\u0440\u0435\u0441\",\n \"done\": \"\u0413\u043E\u0442\u043E\u0432\u043E\",\n \"tryAgain\": \"\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"\u041B\u0438\u043C\u0438\u0442 {{limit}} \u00B7 1\u20132 \u0434\u043D\u044F\",\n \"bankTransferTime\": \"1\u20132 \u0434\u043D\u044F\",\n \"instant\": \"\u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E\",\n \"limit\": \"\u041B\u0438\u043C\u0438\u0442 {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"\u0421\u0435\u0442\u044C {{chainId}}\",\n \"evmChains\": \"EVM-\u0441\u0435\u0442\u0438\",\n \"min\": \"\u041C\u0438\u043D. ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"QR-\u043A\u043E\u0434\"\n },\n \"selectMethod\": {\n \"crypto\": \"\u041A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u0430\",\n \"depositTo\": \"\u0417\u0430\u0447\u0438\u0441\u043B\u0438\u0442\u044C \u043D\u0430\",\n \"errorMessage\": \"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435.\\n\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0443 \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.\",\n \"errorTitle\": \"\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A\",\n \"loadingMethods\": \"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u0432 \u043E\u043F\u043B\u0430\u0442\u044B\",\n \"noLimit\": \"\u0411\u0435\u0437 \u043B\u0438\u043C\u0438\u0442\u0430\",\n \"payWith\": \"\u041E\u043F\u043B\u0430\u0442\u0438\u0442\u044C \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E\",\n \"title\": \"\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0441\u0435\u0442\u0438\",\n \"depositAddressLabel\": \"\u0412\u0430\u0448 \u0430\u0434\u0440\u0435\u0441 \u0434\u043B\u044F \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\",\n \"generating\": \"\u0413\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u044F\u2026\",\n \"share\": \"\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F\",\n \"shareAddress\": \"\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F \u0430\u0434\u0440\u0435\u0441\u043E\u043C\",\n \"showQrCode\": \"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C QR-\u043A\u043E\u0434\",\n \"title\": \"\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u044B\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"\u0412\u0430\u0448 \u0431\u0430\u043B\u0430\u043D\u0441 \u043D\u0438\u0436\u0435 \u043C\u0438\u043D\u0438\u043C\u0443\u043C\u0430 \u0434\u043B\u044F \u0432\u044B\u0432\u043E\u0434\u0430 \u043D\u0430\u043B\u0438\u0447\u043D\u044B\u0445.\",\n \"belowMinimumTitle\": \"\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u044B\u0439 \u0431\u0430\u043B\u0430\u043D\u0441\",\n \"title\": \"\u0412\u044B\u0432\u0435\u0441\u0442\u0438\",\n \"unavailableMessage\": \"\u0412\u044B\u0432\u043E\u0434 \u043D\u0430\u043B\u0438\u0447\u043D\u044B\u0445 \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u0432\u0430\u0448\u0435\u043C \u0440\u0435\u0433\u0438\u043E\u043D\u0435.\",\n \"unavailableTitle\": \"\u0412\u044B\u0432\u043E\u0434 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"Anlad\u0131m\",\n \"title\": \"Kullan\u0131labilir {{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"Kullan\u0131lam\u0131yor\",\n \"regionMessage\": \"Bu hizmet b\u00F6lgenizde kullan\u0131lam\u0131yor.\",\n \"viewRegions\": \"Kullan\u0131labilir b\u00F6lgeleri g\u00F6r\u00FCnt\u00FCle.\"\n },\n \"common\": {\n \"addressCopied\": \"Adres kopyaland\u0131\",\n \"back\": \"Geri\",\n \"close\": \"Kapat\",\n \"copied\": \"Kopyaland\u0131!\",\n \"copy\": \"Kopyala\",\n \"copyAddress\": \"Adresi kopyala\",\n \"done\": \"Tamam\",\n \"tryAgain\": \"Tekrar dene\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"{{limit}} limit \u00B7 1-2 g\u00FCn\",\n \"bankTransferTime\": \"1-2 g\u00FCn\",\n \"instant\": \"An\u0131nda\",\n \"limit\": \"{{limit}} limit\"\n },\n \"networks\": {\n \"chainFallback\": \"Zincir {{chainId}}\",\n \"evmChains\": \"EVM Zincirleri\",\n \"min\": \"Min ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"QR Kodu\"\n },\n \"selectMethod\": {\n \"crypto\": \"Kripto\",\n \"depositTo\": \"\u015Euraya yat\u0131r\",\n \"errorMessage\": \"Veriler y\u00FCklenirken bir sorun olu\u015Ftu.\\n\u0130nternet ba\u011Flant\u0131n\u0131z\u0131 kontrol edip tekrar deneyin.\",\n \"errorTitle\": \"Bir \u015Feyler ters gitti\",\n \"loadingMethods\": \"\u00D6deme y\u00F6ntemleri y\u00FCkleniyor\",\n \"noLimit\": \"Limitsiz\",\n \"payWith\": \"\u015Eununla \u00F6de\",\n \"title\": \"Para ekle\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"Kullan\u0131labilir zincirler\",\n \"depositAddressLabel\": \"Yat\u0131rma adresiniz\",\n \"generating\": \"Olu\u015Fturuluyor\u2026\",\n \"share\": \"Payla\u015F\",\n \"shareAddress\": \"Adresi payla\u015F\",\n \"showQrCode\": \"QR kodunu g\u00F6ster\",\n \"title\": \"Kripto Transferi\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"Bakiyeniz nakit \u00E7ekim i\u00E7in gereken minimumun alt\u0131nda.\",\n \"belowMinimumTitle\": \"Bakiye \u00E7ok d\u00FC\u015F\u00FCk\",\n \"title\": \"Para \u00E7ek\",\n \"unavailableMessage\": \"Nakit \u00E7ekimler \u015Fu anda b\u00F6lgenizde kullan\u0131lam\u0131yor.\",\n \"unavailableTitle\": \"\u00C7ekimler kullan\u0131lam\u0131yor\"\n }\n}\n", "{\n \"availableChains\": {\n \"gotIt\": \"\u77E5\u9053\u4E86\",\n \"title\": \"\u53EF\u7528{{networkLabel}}\"\n },\n \"checkoutBlocked\": {\n \"notAvailable\": \"\u4E0D\u53EF\u7528\",\n \"regionMessage\": \"\u8BE5\u670D\u52A1\u5728\u60A8\u6240\u5728\u7684\u5730\u533A\u4E0D\u53EF\u7528\u3002\",\n \"viewRegions\": \"\u67E5\u770B\u53EF\u7528\u5730\u533A\u3002\"\n },\n \"common\": {\n \"addressCopied\": \"\u5730\u5740\u5DF2\u590D\u5236\",\n \"back\": \"\u8FD4\u56DE\",\n \"close\": \"\u5173\u95ED\",\n \"copied\": \"\u5DF2\u590D\u5236\uFF01\",\n \"copy\": \"\u590D\u5236\",\n \"copyAddress\": \"\u590D\u5236\u5730\u5740\",\n \"done\": \"\u5B8C\u6210\",\n \"tryAgain\": \"\u91CD\u8BD5\"\n },\n \"fops\": {\n \"bankTransferSubtitle\": \"\u9650\u989D {{limit}} \u00B7 1-2 \u5929\",\n \"bankTransferTime\": \"1-2 \u5929\",\n \"instant\": \"\u5373\u65F6\",\n \"limit\": \"\u9650\u989D {{limit}}\"\n },\n \"networks\": {\n \"chainFallback\": \"\u94FE {{chainId}}\",\n \"evmChains\": \"EVM \u94FE\",\n \"min\": \"\u6700\u4F4E ${{min}}\"\n },\n \"qrCode\": {\n \"title\": \"\u4E8C\u7EF4\u7801\"\n },\n \"selectMethod\": {\n \"crypto\": \"\u52A0\u5BC6\u8D27\u5E01\",\n \"depositTo\": \"\u5B58\u5165\",\n \"errorMessage\": \"\u52A0\u8F7D\u6570\u636E\u65F6\u51FA\u73B0\u95EE\u9898\u3002\\n\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002\",\n \"errorTitle\": \"\u51FA\u73B0\u95EE\u9898\",\n \"loadingMethods\": \"\u6B63\u5728\u52A0\u8F7D\u652F\u4ED8\u65B9\u5F0F\",\n \"noLimit\": \"\u65E0\u9650\u989D\",\n \"payWith\": \"\u652F\u4ED8\u65B9\u5F0F\",\n \"title\": \"\u6DFB\u52A0\u8D44\u91D1\"\n },\n \"transferCrypto\": {\n \"availableChains\": \"\u53EF\u7528\u94FE\",\n \"depositAddressLabel\": \"\u60A8\u7684\u5165\u91D1\u5730\u5740\",\n \"generating\": \"\u751F\u6210\u4E2D\u2026\",\n \"share\": \"\u5206\u4EAB\",\n \"shareAddress\": \"\u5206\u4EAB\u5730\u5740\",\n \"showQrCode\": \"\u663E\u793A\u4E8C\u7EF4\u7801\",\n \"title\": \"\u8F6C\u5165\u52A0\u5BC6\u8D27\u5E01\"\n },\n \"withdraw\": {\n \"belowMinimumMessage\": \"\u60A8\u7684\u4F59\u989D\u4F4E\u4E8E\u73B0\u91D1\u63D0\u6B3E\u7684\u6700\u4F4E\u9650\u989D\u3002\",\n \"belowMinimumTitle\": \"\u4F59\u989D\u4E0D\u8DB3\",\n \"title\": \"\u63D0\u6B3E\",\n \"unavailableMessage\": \"\u73B0\u91D1\u63D0\u6B3E\u76EE\u524D\u5728\u60A8\u6240\u5728\u7684\u5730\u533A\u4E0D\u53EF\u7528\u3002\",\n \"unavailableTitle\": \"\u63D0\u6B3E\u4E0D\u53EF\u7528\"\n }\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.content.elements.primary}\n />\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// Smaller logos with clear padding inside the quiet-zone card, so the center\n// occludes fewer QR modules (denser read) and the icons don't touch the edge.\n// Figma `icon/chain` card (node 12782:5552): 46px quiet-zone card, 12px radius\n// (border/radius/element). The 2\u00D72 grid is centered inside it, so the icons\n// keep a clean margin from the card edge.\nconst CARD_SIZE = 46\nconst CARD_RADIUS = 12\n// Single logo fills the card with the same ~6px margin the 2\u00D72 grid keeps.\nconst SINGLE_SIZE = 34\nconst GRID_SIZE = 16\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: CARD_RADIUS,\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 { 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.content.elements.primary\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\nconst ALERT_CIRCLE_SVG =\n '<svg width=\"20\" height=\"20\" viewBox=\"0 0 22.21 22.19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.0993 22.1908C9.5667 22.1908 8.1308 21.9008 6.7916 21.3207C5.4524 20.7478 4.2744 19.9529 3.2575 18.9359C2.2405 17.919 1.442 16.741 0.862 15.4018C0.289 14.0626 0.0026 12.6267 0.0026 11.0941C0.0026 9.5616 0.289 8.1257 0.862 6.7865C1.442 5.4402 2.2405 4.2621 3.2575 3.2523C4.2744 2.2354 5.4524 1.4405 6.7916 0.8676C8.1308 0.2875 9.5667 -0.0025 11.0993 -0.0025C12.6318 -0.0025 14.0677 0.2875 15.4069 0.8676C16.7532 1.4405 17.9349 2.2354 18.9518 3.2523C19.9687 4.2621 20.7636 5.4402 21.3366 6.7865C21.9166 8.1257 22.2067 9.5616 22.2067 11.0941C22.2067 12.6267 21.9166 14.0626 21.3366 15.4018C20.7636 16.741 19.9687 17.919 18.9518 18.9359C17.9349 19.9529 16.7532 20.7478 15.4069 21.3207C14.0677 21.9008 12.6318 22.1908 11.0993 22.1908ZM11.11 12.9525C11.7474 12.9525 12.0732 12.6195 12.0875 11.9535L12.2594 6.5609C12.2737 6.2315 12.1699 5.963 11.9479 5.7553C11.7259 5.5404 11.443 5.433 11.0993 5.433C10.7483 5.433 10.4655 5.5404 10.2506 5.7553C10.0358 5.963 9.9355 6.2279 9.9498 6.5502L10.1002 11.9643C10.1217 12.6231 10.4583 12.9525 11.11 12.9525ZM11.11 16.6479C11.4681 16.6479 11.776 16.5333 12.0338 16.3041C12.2916 16.0749 12.4205 15.7813 12.4205 15.4232C12.4205 15.0723 12.2916 14.7787 12.0338 14.5424C11.776 14.3061 11.4681 14.1879 11.11 14.1879C10.7448 14.1879 10.4332 14.3061 10.1754 14.5424C9.9176 14.7787 9.7887 15.0723 9.7887 15.4232C9.7887 15.7813 9.9176 16.0749 10.1754 16.3041C10.4404 16.5333 10.7519 16.6479 11.11 16.6479Z\" fill=\"currentColor\"/></svg>'\n\nexport function FigmaAlertCircleIcon({ size = 22, color }: IconProps) {\n return renderIcon(ALERT_CIRCLE_SVG, size, useIconColor(color))\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\n key={icon}\n style={[\n iconRing(size),\n { backgroundColor: theme.background.secondary },\n ]}\n >\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 alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n overflowCircle(size),\n {\n backgroundColor:\n overflowMode === 'plus'\n ? theme.background.secondary\n : theme.background.pill.pressed,\n },\n ]}\n >\n {overflowMode === 'plus' ? (\n // The geometric \"+\" glyph centers cleanly; the text \"+\" did not.\n <FigmaPlusIcon\n size={size}\n color={theme.content.elements.secondary}\n />\n ) : (\n <Text\n variant=\"bodyMedium\"\n style={[\n overflowText(size),\n { color: theme.content.elements.secondary },\n ]}\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, useTheme } 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 theme = useTheme()\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 borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n badgeRing(badge),\n { backgroundColor: theme.background.modal },\n ]}\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 { StatusIcon } from '../icons/StatusIcon'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { Box, Text, useTheme } 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 SelectMethodScreen}. 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 SelectMethodScreenProps {\n methods: PaymentMethodOption[]\n onSelectMethod: (id: string) => void\n /** Sheet title \u2014 the caller owns the copy (\"Add money\" vs \"Withdraw\"). */\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 /**\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 /** Error-state copy \u2014 the caller owns it (generic fetch failure vs\n withdraw's terminal states). */\n errorTitle: string\n errorMessage: 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\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 SelectMethodScreen(props: SelectMethodScreenProps) {\n const { t } = useFunkitTranslation()\n const {\n methods,\n onSelectMethod,\n title,\n loading = false,\n skeletonCount,\n error = false,\n onRetry,\n errorTitle,\n errorMessage,\n receiveTokens,\n selectedReceiveTokenId,\n onSelectReceiveToken,\n initialDropdownOpen = false,\n } = props\n const theme = useTheme()\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.modal }}\n >\n <Box alignItems=\"center\" style={topBar}>\n <Box\n style={[\n grabber,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n </Box>\n\n {error ? (\n <SelectMethodError\n title={errorTitle}\n message={errorMessage}\n onRetry={onRetry}\n />\n ) : loading ? (\n <SelectMethodLoading\n count={skeletonCount}\n showDropdown={Boolean(showDropdown)}\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\n variant=\"detail\"\n weight=\"medium\"\n style={{ color: theme.content.elements.secondary }}\n >\n {t('selectMethod.depositTo')}\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\n variant=\"detail\"\n weight=\"medium\"\n style={{ color: theme.content.elements.secondary }}\n >\n {t('selectMethod.payWith')}\n </Text>\n </Box>\n <Box\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n methodsCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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={t('common.close')}\n />\n ) : null}\n </Box>\n )\n}\n\nfunction SelectMethodError({\n title,\n message,\n onRetry,\n}: {\n title: string\n message: string\n onRetry?: () => void\n}) {\n const { t } = useFunkitTranslation()\n const theme = useTheme()\n const retryLabel = t('common.tryAgain')\n return (\n <Box alignItems=\"center\" justifyContent=\"center\" style={errorContainer}>\n <StatusIcon />\n <Box alignItems=\"center\" style={errorText}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n <Text\n variant=\"detail\"\n style={[\n errorMessageText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {message}\n </Text>\n </Box>\n {/* No handler \u2192 non-retryable state (e.g. withdrawals unavailable in\n region): show the message alone instead of a dead button. */}\n {onRetry ? (\n <Pressable\n onPress={onRetry}\n accessibilityRole=\"button\"\n accessibilityLabel={retryLabel}\n >\n <Box\n borderRadius=\"button\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n retryButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {retryLabel}\n </Text>\n </Box>\n </Pressable>\n ) : null}\n </Box>\n )\n}\n\nfunction PaymentMethodRow({ method }: { method: PaymentMethodOption }) {\n const theme = useTheme()\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"elementsHorizontal\"\n style={row}\n >\n <Box width={48} height={48} alignItems=\"center\" justifyContent=\"center\">\n {method.icon}\n </Box>\n <Box flex={1} style={details}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {method.title}\n </Text>\n {method.subtitle ? (\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\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 const theme = useTheme()\n return (\n <Box\n style={[\n divider,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n )\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 theme = useTheme()\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 borderWidth={1}\n borderRadius=\"element\"\n style={[\n dropdownTrigger,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Box flexDirection=\"row\" alignItems=\"center\" style={triggerLeft}>\n {selected.icon ?? <ReceiveTokenIconFallback />}\n <Text\n variant=\"bodyMedium\"\n numberOfLines={1}\n style={[triggerLabel, { color: theme.content.elements.primary }]}\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 borderRadius=\"element\"\n style={[dropdownMenu, { backgroundColor: theme.background.modal }]}\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\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\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 const theme = useTheme()\n return (\n <Box\n width={24}\n height={24}\n borderRadius=\"rounded\"\n style={{ backgroundColor: theme.background.pill.pressed }}\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 SelectMethodLoading({\n count,\n showDropdown,\n}: {\n count?: number\n showDropdown: boolean\n}) {\n const { t } = useFunkitTranslation()\n const theme = useTheme()\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\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {t('selectMethod.depositTo')}\n </Text>\n </Box>\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n dropdownTrigger,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Animated.View style={[loadingSelectorLeft, { opacity }]}>\n <Box\n width={20}\n height={20}\n borderRadius=\"rounded\"\n style={{ backgroundColor: theme.background.pill.pressed }}\n />\n <Box\n style={[\n skeletonTitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Animated.View>\n <ChevronDownIcon />\n </Box>\n </Box>\n ) : null}\n\n {showDropdown ? (\n <Box style={payWithSection}>\n <Box style={sectionLabel}>\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {t('selectMethod.payWith')}\n </Text>\n </Box>\n <Box\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n methodsCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Animated.View\n style={{ opacity }}\n accessibilityLabel={t('selectMethod.loadingMethods')}\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={t('selectMethod.loadingMethods')}\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 const theme = useTheme()\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 style={{ backgroundColor: theme.background.pill.pressed }}\n />\n <Box flex={1} style={skeletonDetails}>\n <Box\n style={[\n skeletonTitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n <Box\n style={[\n skeletonSubtitleBar,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\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.\n// Gap between the last row and the screen bottom (Figma / design review).\nconst BOTTOM_GAP = 50\nconst listContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: BOTTOM_GAP,\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: BOTTOM_GAP,\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 (so the sheet doesn't jump height when loading finishes) but\n// no inter-row gap \u2014 the 68px skeleton rows stack flush (their py-10 supplies\n// the breathing room), matching the Figma frame exactly.\nconst skeletonListContent: ViewStyle = {\n paddingHorizontal: 16,\n paddingBottom: BOTTOM_GAP,\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 { StyleSheet } from 'react-native'\n\nimport { Box, useTheme } from '../theme/restyle'\nimport { FigmaAlertCircleIcon } from './FigmaSystemIcons'\n\n// Shared status circle (Figma: Fun Mobile `status-icon`) for the geo-blocked\n// and unavailable/error screens.\nexport function StatusIcon() {\n const theme = useTheme()\n return (\n <Box\n borderRadius=\"rounded\"\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[styles.circle, { backgroundColor: theme.background.secondary }]}\n >\n <FigmaAlertCircleIcon\n size={20}\n color={theme.content.button.icon.default}\n />\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n circle: { width: 48, height: 48 },\n})\n", "import { useRef, useState } from 'react'\nimport {\n type LayoutChangeEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n Pressable,\n ScrollView,\n View,\n type ViewStyle,\n useWindowDimensions,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg'\n\nimport { FALLBACK_ASSET_LOGO } from '../icons/assetLogos'\nimport { FunIcon } from '../icons/FunIcon'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\n// Height of the full-width edge gradient.\nconst SCROLL_FADE_HEIGHT = 42\n// Tolerance (px) for scroll/size comparisons, so sub-pixel fractional offsets\n// don't flip a fade on/off at the very top/bottom.\nconst SCROLL_EPSILON = 1\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 \u2014 reached by tapping the chain-logo\n * cluster on the Transfer screen. An X-close + centered title bar, then a\n * 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 loading?: boolean\n skeletonCount?: number\n onClose?: () => void\n}\n\nexport function AvailableChainsScreen(props: AvailableChainsScreenProps) {\n const { t } = useFunkitTranslation()\n const {\n networkLabel,\n chains,\n loading = false,\n skeletonCount = 8,\n onClose,\n } = props\n const title = t('availableChains.title', { networkLabel })\n const gotItLabel = t('availableChains.gotIt')\n const { height } = useWindowDimensions()\n const theme = useTheme()\n const insets = useSafeAreaInsets()\n\n // Edge fades hint at off-screen rows once the list overflows its viewport:\n // top fade appears after scrolling down, bottom fade while more rows remain.\n const [showTopFade, setShowTopFade] = useState(false)\n const [showBottomFade, setShowBottomFade] = useState(false)\n const metrics = useRef({ scrollY: 0, viewportH: 0, contentH: 0 })\n const recomputeFades = () => {\n const { scrollY, viewportH, contentH } = metrics.current\n const overflows = contentH > viewportH + SCROLL_EPSILON\n setShowTopFade(overflows && scrollY > SCROLL_EPSILON)\n setShowBottomFade(\n overflows && scrollY + viewportH < contentH - SCROLL_EPSILON,\n )\n }\n const onScroll = (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n metrics.current.scrollY = e.nativeEvent.contentOffset.y\n recomputeFades()\n }\n const onViewportLayout = (e: LayoutChangeEvent) => {\n metrics.current.viewportH = e.nativeEvent.layout.height\n recomputeFades()\n }\n const onContentSizeChange = (_w: number, h: number) => {\n metrics.current.contentH = h\n // A shorter replacement list can clamp the native offset without firing\n // onScroll, so re-clamp scrollY to the new max or the bottom fade may hide\n // while the list still overflows.\n metrics.current.scrollY = Math.min(\n metrics.current.scrollY,\n Math.max(0, h - metrics.current.viewportH),\n )\n recomputeFades()\n }\n\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{\n backgroundColor: theme.background.modal,\n // 16px gap above the home indicator (design review), device-aware.\n paddingBottom: insets.bottom + 16,\n }}\n >\n {/* Top bar: spacer \u00B7 title \u00B7 spacer */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Box style={topBarSpacer} />\n <Box flex={1} alignItems=\"center\">\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {title}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n\n <View style={scrollArea}>\n <ScrollView\n style={[list, { maxHeight: height * 0.72 }]}\n showsVerticalScrollIndicator={false}\n contentContainerStyle={listContent}\n onScroll={onScroll}\n onLayout={onViewportLayout}\n onContentSizeChange={onContentSizeChange}\n scrollEventThrottle={16}\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\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {chain.name}\n </Text>\n </Box>\n {chain.minLabel ? (\n <Text\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\n {chain.minLabel}\n </Text>\n ) : null}\n </Box>\n ))}\n </ScrollView>\n {showTopFade ? (\n <ScrollFade edge=\"top\" color={theme.background.modal} />\n ) : null}\n {showBottomFade ? (\n <ScrollFade edge=\"bottom\" color={theme.background.modal} />\n ) : null}\n </View>\n\n <Box style={buttonContainer}>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={gotItLabel}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderRadius=\"button\"\n style={[\n gotItButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {gotItLabel}\n </Text>\n </Box>\n </Pressable>\n </Box>\n </Box>\n )\n}\n\nfunction AvailableChainSkeleton() {\n const theme = useTheme()\n return (\n <Box flexDirection=\"row\" alignItems=\"center\" style={row}>\n <Box\n style={[\n skeletonIcon,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n <Box flex={1}>\n <Box\n style={[\n skeletonName,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Box>\n <Box\n style={[\n skeletonMin,\n { backgroundColor: theme.background.pill.pressed },\n ]}\n />\n </Box>\n )\n}\n\n/**\n * A gradient that fades the list into the modal surface at one edge. Drawn with\n * react-native-svg since RN has no CSS gradient; `pointerEvents=\"none\"` so it\n * never intercepts scroll touches.\n */\nfunction ScrollFade({\n edge,\n color,\n}: {\n edge: 'top' | 'bottom'\n color: string\n}) {\n const id = `chains-fade-${edge}`\n const topOpaque = edge === 'top'\n return (\n <View\n pointerEvents=\"none\"\n style={[fade, edge === 'top' ? { top: 0 } : { bottom: 0 }]}\n >\n <Svg width=\"100%\" height=\"100%\">\n <Defs>\n <LinearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <Stop\n offset=\"0\"\n stopColor={color}\n stopOpacity={topOpaque ? 1 : 0}\n />\n <Stop\n offset=\"1\"\n stopColor={color}\n stopOpacity={topOpaque ? 0 : 1}\n />\n </LinearGradient>\n </Defs>\n <Rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n </Svg>\n </View>\n )\n}\n\nconst scrollArea: ViewStyle = { position: 'relative' }\nconst fade: ViewStyle = {\n position: 'absolute',\n left: 0,\n right: 0,\n height: SCROLL_FADE_HEIGHT,\n}\nconst topBar: ViewStyle = {\n paddingBottom: 12,\n paddingHorizontal: 24,\n gap: 4,\n}\nconst topBarSpacer: ViewStyle = { width: 32, height: 32 }\nconst list: ViewStyle = { width: '100%' }\nconst listContent: ViewStyle = { paddingHorizontal: 20 }\nconst buttonContainer: ViewStyle = { paddingHorizontal: 20, paddingTop: 16 }\nconst gotItButton: ViewStyle = { height: 56, paddingHorizontal: 24 }\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 { Linking, Pressable, StyleSheet } from 'react-native'\n\nimport { StatusIcon } from '../icons/StatusIcon'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\nconst FUN_REGIONAL_RESTRICTIONS_URL =\n 'https://intercom.help/funxyz/en/articles/9827689-regional-restrictions'\n\nexport function CheckoutBlockedScreen() {\n const { t } = useFunkitTranslation()\n const theme = useTheme()\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.modal }}\n >\n <Box alignItems=\"center\" style={styles.topBar}>\n <Box\n style={[\n styles.grabber,\n { backgroundColor: theme.border.elements.default.color },\n ]}\n />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {t('selectMethod.title')}\n </Text>\n </Box>\n\n <Box alignItems=\"center\" justifyContent=\"center\" style={styles.content}>\n <StatusIcon />\n <Box alignItems=\"center\" style={styles.textGroup}>\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {t('checkoutBlocked.notAvailable')}\n </Text>\n <Box alignItems=\"center\">\n <Text\n variant=\"detail\"\n style={[\n styles.descriptionText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {t('checkoutBlocked.regionMessage')}\n </Text>\n <Pressable\n onPress={() => Linking.openURL(FUN_REGIONAL_RESTRICTIONS_URL)}\n >\n <Text\n variant=\"detail\"\n style={[\n styles.linkText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {t('checkoutBlocked.viewRegions')}\n </Text>\n </Pressable>\n </Box>\n </Box>\n </Box>\n </Box>\n )\n}\n\nconst styles = StyleSheet.create({\n topBar: { height: 64, paddingTop: 25, paddingBottom: 12 },\n grabber: {\n position: 'absolute',\n top: 8,\n width: 36,\n height: 5,\n borderRadius: 999,\n },\n content: {\n height: 390,\n gap: 24,\n paddingHorizontal: 16,\n paddingBottom: 34,\n },\n textGroup: { gap: 8 },\n descriptionText: { textAlign: 'center' },\n linkText: { textAlign: 'center', textDecorationLine: 'underline' },\n})\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, type TextStyle, type ViewStyle } from 'react-native'\n\nimport { useScreenSize } from '../hooks/useScreenSize'\nimport { CopyAddressIcon } from '../icons/CopyAddressIcon'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { Box, Text, useTheme } from '../theme/restyle'\n\n/**\n * The deposit QR-code screen (Figma: Fun Mobile / qr-code-modal, node\n * 11636:2663). Presented as a nested bottom sheet: a centered \"QR Code\"\n * title (no close button), the framed QR with the selected network's chain\n * logos overlaid in its center, the full deposit address with a\n * \"Copy address\" button, and a \"Done\" primary button that dismisses the sheet.\n *\n * Vertical padding adapts to screen height via {@link useScreenSize} so the\n * sheet doesn't overflow on compact devices (iPhone SE).\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;\n * this 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 /** 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(props: QrCodeScreenProps) {\n const { t } = useFunkitTranslation()\n const {\n qrCode,\n centerIcon,\n address,\n copiedFeedbackMs = 1800,\n onClose,\n onCopyAddress,\n } = props\n const doneLabel = t('common.done')\n const { isShort } = useScreenSize()\n const theme = useTheme()\n\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={[sheet, { backgroundColor: theme.background.modal }]}\n >\n {/* Top bar: spacer \u00B7 title \u00B7 spacer */}\n <Box flexDirection=\"row\" alignItems=\"center\" style={topBar}>\n <Box style={topBarSpacer} />\n <Box flex={1} alignItems=\"center\">\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {t('qrCode.title')}\n </Text>\n </Box>\n <Box style={topBarSpacer} />\n </Box>\n <Box style={{ paddingVertical: isShort ? 0 : 16 }}>\n <Box\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[content, { paddingVertical: isShort ? 24 : 82 }]}\n >\n <Box\n borderWidth={1.5}\n alignItems=\"center\"\n justifyContent=\"center\"\n style={[\n qrFrame,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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\n variant=\"body\"\n style={[\n addressText,\n { color: theme.content.elements.secondary },\n ]}\n >\n {address}\n </Text>\n {onCopyAddress ? (\n <Pressable\n onPress={handleCopy}\n accessibilityRole=\"button\"\n accessibilityLabel={\n copied ? t('common.addressCopied') : t('common.copyAddress')\n }\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderWidth={1}\n borderRadius=\"element\"\n style={[\n copyButton,\n {\n backgroundColor:\n theme.background.button.secondary.default,\n borderColor: theme.background.button.secondary.default,\n },\n ]}\n >\n <CopyAddressIcon />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.secondary.default }}\n >\n {copied ? t('common.copied') : t('common.copyAddress')}\n </Text>\n </Box>\n </Pressable>\n ) : null}\n </Box>\n ) : null}\n </Box>\n\n <Box style={buttonContainer}>\n <Pressable\n onPress={onClose}\n accessibilityRole=\"button\"\n accessibilityLabel={doneLabel}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderRadius=\"button\"\n style={[\n doneButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\n {doneLabel}\n </Text>\n </Box>\n </Pressable>\n </Box>\n </Box>\n </Box>\n )\n}\n\nconst sheet: ViewStyle = { paddingBottom: 34 }\nconst topBar: ViewStyle = {\n paddingBottom: 12,\n paddingHorizontal: 24,\n gap: 4,\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 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}\nconst buttonContainer: ViewStyle = { paddingHorizontal: 20 }\nconst doneButton: ViewStyle = { height: 56, paddingHorizontal: 24 }\n", "import { useWindowDimensions } from 'react-native'\n\nexport function useScreenSize() {\n const { height } = useWindowDimensions()\n\n // Add additional breakpoints as needed (e.g. isTall).\n const isShort = height < 700\n\n return { isShort }\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.content.button.secondary.default}\n />\n )\n}\n", "import { type ReactNode, useEffect, useRef, useState } from 'react'\nimport { Pressable, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\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 { useFunkitTranslation } from '../providers/FunkitI18nProvider'\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 /** 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(props: TransferCryptoScreenProps) {\n const { t } = useFunkitTranslation()\n const {\n depositAddress,\n networks,\n selectedNetworkId,\n onSelectNetwork,\n supportedTokenIcons,\n minimumDepositLabel,\n copiedFeedbackMs = 1800,\n onBack,\n onShowQrCode,\n onShowChains,\n onCopyAddress,\n onShareAddress,\n } = props\n const theme = useTheme()\n const insets = useSafeAreaInsets()\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 borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={{ backgroundColor: theme.background.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={t('common.back')}\n >\n <Box alignItems=\"center\" justifyContent=\"center\" style={iconButton}>\n <FigmaChevronLeftIcon />\n </Box>\n </Pressable>\n <Box flex={1} alignItems=\"center\">\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\n {t('transferCrypto.title')}\n </Text>\n </Box>\n <Pressable\n onPress={onShowQrCode}\n hitSlop={12}\n accessibilityRole=\"button\"\n accessibilityLabel={t('transferCrypto.showQrCode')}\n >\n <Box alignItems=\"center\" justifyContent=\"center\" style={iconButton}>\n <FigmaQrScanIcon />\n </Box>\n </Pressable>\n </Box>\n\n <Box style={[content, { paddingBottom: insets.bottom + 16 }]}>\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 borderWidth={1}\n borderRadius=\"element\"\n style={[\n addressCard,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <Box alignItems=\"center\" style={addressColumn}>\n <Box alignItems=\"center\" style={addressGroup}>\n <Text\n variant=\"body\"\n style={{ color: theme.content.elements.secondary }}\n >\n {t('transferCrypto.depositAddressLabel')}\n </Text>\n <Text\n variant=\"bodyMedium\"\n style={[\n addressText,\n { color: theme.content.elements.primary },\n ]}\n >\n {depositAddress}\n </Text>\n </Box>\n {showPreview ? (\n <Pressable\n onPress={onShowChains}\n accessibilityRole=\"button\"\n accessibilityLabel={t('transferCrypto.availableChains')}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n style={[\n previewPill,\n { backgroundColor: theme.background.secondary },\n ]}\n >\n <SourceTokenCluster\n icons={supportedTokenIcons}\n size={20}\n gap={4}\n />\n <FigmaChevronRightIcon\n size={16}\n color={theme.content.elements.secondary}\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 ? t('common.copied') : t('common.copy')}\n accessibilityLabel={\n copied ? t('common.addressCopied') : t('common.copyAddress')\n }\n icon={\n <FigmaCopyIcon color={theme.content.button.primary.default} />\n }\n onPress={handleCopy}\n />\n <PillButton\n label={t('transferCrypto.share')}\n accessibilityLabel={t('transferCrypto.shareAddress')}\n icon={\n <FigmaShareIcon color={theme.content.button.primary.default} />\n }\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 const theme = useTheme()\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\n variant=\"detail\"\n style={{ color: theme.content.elements.secondary }}\n >\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 const theme = useTheme()\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 borderRadius=\"button\"\n style={[\n pillButton,\n { backgroundColor: theme.background.button.primary.default },\n ]}\n >\n {icon}\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.button.primary.default }}\n >\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 // paddingBottom is set inline: safe-area inset + 16 so the buttons keep a 16px\n // gap above the home indicator on every device.\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: 6 }\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, useTheme } 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 const theme = useTheme()\n\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n borderWidth={1}\n borderRadius=\"rounded\"\n style={[\n track,\n {\n backgroundColor: theme.background.secondary,\n borderColor: theme.border.elements.default.color,\n },\n ]}\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 borderWidth={1}\n borderRadius=\"rounded\"\n style={[\n selectedPill,\n {\n backgroundColor: theme.background.modal,\n borderColor: theme.border.elements.default.color,\n },\n ]}\n >\n <ChainGlyph iconKeys={network.iconKeys} />\n <Text\n variant=\"bodyMedium\"\n style={{ color: theme.content.elements.primary }}\n >\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 { TFunction } from 'i18next'\n\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport {\n type PaymentMethodOption,\n SelectMethodScreen,\n} from './SelectMethodScreen'\n\nexport interface WithdrawMethodScreenProps {\n /** Cash payout methods (Card / Bank Transfer / \u2026). */\n methods: PaymentMethodOption[]\n onSelectMethod: (id: string) => void\n /** Sheet title \u2014 the flow resolves it from the host config. */\n title: string\n loading?: boolean\n /** The payout-method fetch failed \u2014 shows the retryable error state. */\n hasError?: boolean\n onRetry?: () => void\n /**\n * Withdrawals unavailable (Statsig gate off, or Swapped returned no methods\n * for the user's region) \u2014 shows a terminal, non-retryable message.\n */\n isEmpty?: boolean\n /**\n * The balance can't meet Swapped's minimum sell \u2014 shows a distinct terminal\n * message instead of methods that would all reject.\n */\n isBelowMinimum?: boolean\n}\n\n// Below-minimum wins over empty \u2014 a too-low balance is the more specific reason.\nfunction getTerminalError(\n t: TFunction,\n isBelowMinimum: boolean,\n isEmpty: boolean,\n) {\n if (isBelowMinimum) {\n return {\n title: t('withdraw.belowMinimumTitle'),\n message: t('withdraw.belowMinimumMessage'),\n }\n }\n if (isEmpty) {\n return {\n title: t('withdraw.unavailableTitle'),\n message: t('withdraw.unavailableMessage'),\n }\n }\n return null\n}\n\n/**\n * The withdrawal payout-method picker: the entry screen of `beginWithdrawal`,\n * listing the Swapped `CRYPTO_TO_FIAT` methods. A thin composition over\n * {@link SelectMethodScreen} (no receive-token dropdown \u2192 the bare-list layout),\n * so the list/loading/error visuals stay in lockstep with the deposit flow.\n */\nexport function WithdrawMethodScreen(props: WithdrawMethodScreenProps) {\n const { t } = useFunkitTranslation()\n const {\n methods,\n onSelectMethod,\n title,\n loading = false,\n hasError = false,\n onRetry,\n isEmpty = false,\n isBelowMinimum = false,\n } = props\n // Fetch errors and loading win over terminal states \u2014 a failed fetch says\n // nothing about availability or balance, and retrying may recover it.\n const terminalError = getTerminalError(t, isBelowMinimum, isEmpty)\n if (terminalError && !hasError && !loading) {\n return (\n <SelectMethodScreen\n title={title}\n methods={[]}\n onSelectMethod={onSelectMethod}\n error\n errorTitle={terminalError.title}\n errorMessage={terminalError.message}\n />\n )\n }\n return (\n <SelectMethodScreen\n title={title}\n methods={methods}\n onSelectMethod={onSelectMethod}\n loading={loading}\n error={hasError}\n onRetry={onRetry}\n errorTitle={t('selectMethod.errorTitle')}\n errorMessage={t('selectMethod.errorMessage')}\n />\n )\n}\n", "import type { SwappedInboundMessage } from '@funkit/connect-core'\nimport { useCallback } from 'react'\n\nimport { logger } from '../logging/logger'\nimport {\n type SwappedScreenBaseProps,\n SwappedScreenShell,\n} from './SwappedScreenShell'\n\nexport interface SwappedScreenProps extends SwappedScreenBaseProps {\n /** Fired when the embed reports a successful transaction. */\n onSuccess?: () => void\n}\n\n/**\n * Deposit-mode host for the Swapped embed (mirroring web's\n * `SwappedIframeController`): back / new-deposit \u2192 {@link onBack},\n * close \u2192 {@link onClose}, transaction-successful \u2192 {@link onSuccess}.\n * Withdrawal lifecycle messages are ignored \u2014 see `SwappedWithdrawScreen`.\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 default:\n // READY / NAVIGATION / LOGOUT / ERROR handled in the shell or\n // tracked elsewhere; withdrawal lifecycle messages belong to\n // SwappedWithdrawScreen.\n break\n }\n },\n [onBack, onClose, onSuccess],\n )\n\n return <SwappedScreenShell url={url} onMessage={handleMessage} />\n}\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, useTheme } from '../theme/restyle'\nimport { SwappedWebView } from './SwappedWebView'\n\n/** Props shared by both Swapped embed hosts (deposit and withdrawal). */\nexport interface SwappedScreenBaseProps {\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 method list (embed's own back). */\n onBack: () => void\n}\n\ninterface SwappedScreenShellProps {\n url: string\n onMessage: (msg: SwappedInboundMessage) => void\n}\n\n/**\n * Full-screen host frame for the Swapped embedded payment flow\n * ({@link SwappedWebView}). The embed ships its own top bar, so we render no\n * RN header. Mode-agnostic message handling (error logging) lives here;\n * mode-specific dispatch lives in `SwappedScreen` (deposit) and\n * `SwappedWithdrawScreen` (withdrawal).\n */\nexport function SwappedScreenShell({\n url,\n onMessage,\n}: SwappedScreenShellProps) {\n const theme = useTheme()\n const handleMessage = useCallback(\n (msg: SwappedInboundMessage) => {\n if (msg.type === 'SWAPPED_ERROR') {\n // Recoverable \u2014 the embed surfaces its own error UI (WARN, not ERROR).\n logger.warn('connect-rn:swapped:error', {\n data: msg.data ?? {},\n })\n }\n onMessage(msg)\n },\n [onMessage],\n )\n\n return (\n <Box\n borderTopLeftRadius=\"modal\"\n borderTopRightRadius=\"modal\"\n style={[sheet, { backgroundColor: theme.background.modal }]}\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 {\n WebView,\n type WebViewMessageEvent,\n type WebViewNavigation,\n} 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 // Last main-frame URL reported by the WebView's NATIVE layer \u2014 the fallback\n // when `nativeEvent.url` is empty on a message event (some webview builds omit\n // it). Seeded with the widget url so a message before the first navigation\n // callback still validates against a real Swapped origin. Never sourced from\n // page JS, so it stays trustworthy for the fail-closed origin gate.\n const lastCommittedUrlRef = useRef(url)\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 handleNavigationStateChange = (navState: WebViewNavigation) => {\n if (navState.url) {\n lastCommittedUrlRef.current = navState.url\n }\n }\n\n const handleMessage = (event: WebViewMessageEvent) => {\n // onNavigationStateChange doesn't fire for SPA route changes inside the\n // widget, but those never change the origin \u2014 all the gate reads.\n dispatch(\n event.nativeEvent.data,\n event.nativeEvent.url || lastCommittedUrlRef.current,\n )\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\n style={[loadingOverlay, { backgroundColor: theme.background.modal }]}\n >\n <ActivityIndicator color={theme.content.elements.secondary} />\n </View>\n ),\n [theme.background.modal, theme.content.elements.secondary],\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 onNavigationStateChange={handleNavigationStateChange}\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.background.modal }, 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 { background, content, border, borderRadii } = theme\n return {\n iframeBackground: toRawHex(background.modal),\n widgetBackground: toRawHex(background.modal),\n textColor: toRawHex(content.elements.primary),\n spinnerColor: toRawHex(content.elements.primary),\n modalRadii: px(borderRadii.modal),\n skeletonColor: toRawHex(border.elements.default.color),\n skeletonSecondaryColor: toRawHex(background.secondary),\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 Swapped widget's vocabulary is richer than the Fun Variables export: it\n * has hover / focused / disabled slots the mobile design doesn't define. Since\n * connect-rn's tokens are a strict mirror of Figma (only default / pressed /\n * some disabled states exist), those extra slots are adapted here at the\n * boundary: hover \u2190 pressed, primary/tertiary disabled \u2190 the default fill (the\n * widget dims via opacity), and the widget's neutral \"focused\" strokes map onto\n * the `border/elements/{default,selected}` variables.\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 {\n background,\n content,\n border,\n brand,\n borderRadii,\n sizes,\n spacing,\n textVariants,\n } = 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: content.elements.primary,\n secondaryText: content.elements.secondary,\n tertiaryText: content.elements.secondary,\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: background.modal,\n offBackground: background.secondary,\n hoverState: background.secondary,\n lightStroke: border.elements.default.color,\n mediumStroke: border.elements.default.color,\n heavyStroke: border.elements.default.color,\n modalBorder: border.modal.default,\n modalHeaderDivider: border.elements.default.color,\n modalFooterDivider: border.elements.default.color,\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: brand.primary,\n accentColor: brand.primary,\n accentColorForeground: content.button.primary.default,\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: content.elements.error,\n success: content.elements.success,\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: content.elements.primary,\n spinnerBackground: border.elements.default.color,\n\n // \u2500\u2500 Primary button (hover \u2190 pressed, disabled \u2190 default fill) \u2500\u2500\u2500\u2500\u2500\n // web spreads both `buttonBackground*` (ThemeVars) and `buttonPrimary*`\n // (widget aliases); the widget reads whichever is present.\n buttonBackground: background.button.primary.default,\n buttonBackgroundHover: background.button.primary.pressed,\n buttonBackgroundPressed: background.button.primary.pressed,\n buttonBackgroundDisabled: background.button.primary.default,\n buttonPrimary: background.button.primary.default,\n buttonPrimaryHover: background.button.primary.pressed,\n buttonDisabled: background.button.primary.default,\n buttonTextPrimary: content.button.primary.default,\n buttonTextHover: content.button.primary.default,\n buttonTextDisabled: content.button.primary.default,\n buttonTextSecondary: content.button.secondary.default,\n buttonTextSecondaryDisabled: content.button.secondary.default,\n buttonFocusedOutline: 'none',\n buttonBorderGradient: 'none',\n buttonHoverBorderGradient: 'none',\n buttonDisabledBorderGradient: 'none',\n\n // \u2500\u2500 Tertiary button (hover \u2190 pressed, disabled \u2190 default fill) \u2500\u2500\u2500\u2500\n buttonBackgroundTertiary: background.button.tertiary.default,\n buttonBackgroundHoverTertiary: background.button.tertiary.pressed,\n buttonBackgroundDisabledTertiary: background.button.tertiary.default,\n buttonTextTertiary: content.button.tertiary.default,\n buttonTextDisabledTertiary: content.button.tertiary.default,\n buttonBorderTertiary: 'transparent',\n buttonBorderFocusedTertiary: border.elements.selected.color,\n\n // \u2500\u2500 Icon button / top bar (hover \u2190 pressed) \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: background.button.icon.default,\n buttonIconBackgroundHover: background.button.icon.pressed,\n buttonIconBackgroundPressed: background.button.icon.pressed,\n buttonIconStroke: content.button.icon.default,\n modalTopbarIcon: content.button.icon.default,\n modalTopbarIconBackground: background.button.icon.default,\n modalTopbarIconBackgroundHover: background.button.icon.pressed,\n modalTopbarIconBackgroundPressed: background.button.icon.pressed,\n\n // \u2500\u2500 Input (hover/focused \u2190 border/elements variables) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n inputBackground: background.modal,\n inputBackgroundHover: background.secondary,\n inputBorderBase: border.elements.default.color,\n inputBorderHover: border.elements.selected.color,\n inputLabel: content.elements.primary,\n inputBorder: border.elements.default.color,\n inputBorderFocused: content.elements.secondary,\n inputBorderActive: content.elements.secondary,\n inputPlaceholder: content.elements.secondary,\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: border.elements.selected.color,\n focusedOptionBorder: border.elements.selected.color,\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: background.secondary,\n secondaryButtonBg: background.button.tertiary.default,\n secondaryButtonText: content.button.tertiary.default,\n secondaryButtonHover: background.button.tertiary.pressed,\n secondaryButtonTextHover: content.button.tertiary.default,\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: content.button.icon.default,\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: background.modal,\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 try { window.postMessage = bridged; } catch (e) {}\n // The widget only emits some messages (notably SWAPPED_ORDER_DATA, the sell\n // deposit address) when it believes it is embedded in a parent frame \u2014 on web\n // that's a real <iframe> so window.parent !== window. A top-level WebView has\n // window.parent === window, so present a DISTINCT parent/top (a proxy over\n // window) whose postMessage forwards to native; the get-trap delegates every\n // other property to the real window so the widget's other parent.* access works.\n var frameProxy = window;\n try {\n frameProxy = new Proxy(window, {\n get: function (target, prop) {\n if (prop === 'postMessage') { return bridged; }\n var value = target[prop];\n return typeof value === 'function' ? value.bind(target) : value;\n },\n });\n } catch (e) {\n // Proxy unavailable \u2192 fall back to bridging the real parent.\n try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e2) {}\n }\n // Guard parent/top independently: parent is [Replaceable] so it sticks, but\n // top is [LegacyUnforgeable] (HTML spec) and throws on conforming engines\n // while succeeding on the WebView builds that gate embed detection on it \u2014\n // isolating them means a throw on one never skips the other.\n try { Object.defineProperty(window, 'parent', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}\n try { Object.defineProperty(window, 'top', { configurable: true, get: function () { return frameProxy; } }); } 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 the payload isn't\n * valid JSON with a string `type`, or `url`'s origin isn't a Swapped origin\n * (mirrors web's `isSwappedOrigin(event.origin)` iframe guard).\n *\n * `url` is the page URL to validate against. The caller passes `nativeEvent.url`,\n * falling back to the last committed navigation URL when a webview build omits it\n * (see {@link SwappedWebView}) \u2014 so a missing url here means no trustworthy\n * source, and we fail closed.\n */\nexport function handleWebViewMessage(\n rawData: unknown,\n url?: string,\n): SwappedInboundMessage | null {\n // Fail closed: no verifiable Swapped page URL \u2192 drop.\n if (!url || 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 type SwappedInboundMessage,\n type SwappedSellOrderData,\n isValidOrderData,\n} from '@funkit/connect-core'\nimport { useCallback } from 'react'\n\nimport { logger } from '../logging/logger'\nimport {\n type SwappedScreenBaseProps,\n SwappedScreenShell,\n} from './SwappedScreenShell'\n\nexport interface SwappedWithdrawScreenProps extends SwappedScreenBaseProps {\n /** \"Make another withdrawal\" \u2014 back to the method list. */\n onNewWithdrawal?: () => void\n /** Swapped confirmed the fiat payout side. Payload is opaque. */\n onWithdrawalSuccess?: (data?: unknown) => void\n /** Sell order (deposit address + accepted-token amount). Only validated payloads forward. */\n onOrderData?: (order: SwappedSellOrderData) => void\n}\n\n/**\n * Withdrawal-mode host for the Swapped embed (mirroring web's\n * `WithdrawalSwappedIframeController`): back \u2192 {@link onBack},\n * close \u2192 {@link onClose}, new-withdrawal \u2192 {@link onNewWithdrawal},\n * withdrawal-successful \u2192 {@link onWithdrawalSuccess}, order-data \u2192\n * {@link onOrderData}. Deposit-only messages are ignored \u2014 see\n * `SwappedScreen`.\n */\nexport function SwappedWithdrawScreen({\n url,\n onClose,\n onBack,\n onNewWithdrawal,\n onWithdrawalSuccess,\n onOrderData,\n}: SwappedWithdrawScreenProps) {\n const handleMessage = useCallback(\n (msg: SwappedInboundMessage) => {\n switch (msg.type) {\n case 'SWAPPED_GO_BACK':\n onBack()\n break\n case 'SWAPPED_CLOSE':\n onClose()\n break\n case 'SWAPPED_NEW_WITHDRAWAL':\n logger.info('connect-rn:swapped:new_withdrawal')\n onNewWithdrawal?.()\n break\n case 'SWAPPED_WITHDRAWAL_SUCCESSFUL':\n // No auto-close: the embed shows its own success screen with\n // new-withdrawal/close controls (web parity).\n logger.info('connect-rn:swapped:withdrawal_successful')\n onWithdrawalSuccess?.(msg.data)\n break\n case 'SWAPPED_ORDER_DATA':\n if (!isValidOrderData(msg.data)) {\n // Validation rejection, not an unrecoverable failure (WARN \u2014 the\n // embed keeps its own UI in control).\n logger.warn('connect-rn:swapped:order_data:invalid', {\n data: msg.data ?? {},\n })\n break\n }\n logger.info('connect-rn:swapped:order_data', {\n order_id: msg.data.order_id,\n })\n onOrderData?.(msg.data)\n break\n default:\n // READY / NAVIGATION / LOGOUT / ERROR handled in the shell or\n // tracked elsewhere; deposit-only messages (new-deposit,\n // transaction-successful) belong to SwappedScreen.\n break\n }\n },\n [onBack, onClose, onNewWithdrawal, onWithdrawalSuccess, onOrderData],\n )\n\n return <SwappedScreenShell url={url} onMessage={handleMessage} />\n}\n", "import { chainMetadataById } from '@funkit/chains'\nimport {\n type MinDepositTarget,\n type MinTransferConfig,\n getConfiguredMinDepositUsd,\n getMinTransferValueUsd,\n isEvmChainId,\n} from '@funkit/connect-core'\nimport type { TFunction } from 'i18next'\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\n/** Id of the grouped \"EVM Chains\" network segment. */\nexport const EVM_NETWORK_ID = 'evm'\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 are single-chain.\n if (!isEvmChainId(networkChainId)) {\n return chainId === networkChainId\n }\n // The EVM network is every EVM chain.\n return isEvmChainId(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 t,\n chainFilters,\n networkChainId,\n minTransferLimits,\n target,\n}: {\n t: TFunction\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 = getConfiguredMinDepositUsd(target)\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 = getMinTransferValueUsd(\n chainId,\n minTransferLimits,\n minDepositAddOn,\n )\n return {\n id: String(chainId),\n name: name || meta?.name || t('networks.chainFallback', { chainId }),\n iconUri: meta?.iconUrl ?? FALLBACK_ASSET_LOGO,\n minLabel: t('networks.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 * is its own single-chain segment. Segment glyphs use\n * `@funkit/chains` logo URLs.\n */\nexport function buildDepositNetworks(\n t: TFunction,\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) => isEvmChainId(c.chainId))\n const networks: ChainOption[] = []\n\n if (evmChains.length > 0) {\n networks.push({\n id: EVM_NETWORK_ID,\n label: t('networks.evmChains'),\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 (isEvmChainId(c.chainId)) continue\n const meta = chainMetadataById[c.chainId]\n networks.push({\n id: String(c.chainId),\n label:\n c.label ||\n meta?.name ||\n t('networks.chainFallback', { chainId: 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, getFormOfPaymentDisplayName } from '@funkit/connect-core'\nimport type { TFunction } from 'i18next'\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 /** 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/**\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 * only FOP the Figma gives a timing suffix). The limit is the FOP's max\n * converted to USD via {@link getFopsLimit} (falls back to a default when no\n * exchange rate is available \u2014 RN doesn't fetch rates in V1).\n */\nexport function toFopRows(\n t: TFunction,\n fops: SwappedFormOfPayment[],\n exchangeRates?: ExchangeRates,\n): FopRow[] {\n return fops.map((fop) => {\n const limit = getFopsLimit(fop, exchangeRates)\n // Two full keys instead of concatenating around \"\u00B7\" \u2014 locales own the\n // separator and word order.\n const subtitle =\n fop.fopType === FormOfPaymentType.BANK_TRANSFER\n ? t('fops.bankTransferSubtitle', { limit })\n : t('fops.limit', { limit })\n return {\n id: `${fop.fopType}:${fop.name}`,\n name: getFormOfPaymentDisplayName(fop),\n subtitle,\n disabled: !fop.embeddedFlowUrl,\n }\n })\n}\n\n/**\n * Map Swapped payout methods to Withdraw rows. Deliberately NOT {@link toFopRows}:\n * its `getFopsLimit` default invents a \"$10k limit\" when no exchange rate is\n * available, which would misstate a limit on the user's own money (web's\n * `getWithdrawalFopsDisclaimerLimit` returns no limit without rates). Subtitle\n * is timing-only: bank transfers settle in days, everything else is instant.\n */\nexport function toWithdrawFopRows(\n t: TFunction,\n fops: SwappedFormOfPayment[],\n): FopRow[] {\n return fops.map((fop) => ({\n id: `${fop.fopType}:${fop.name}`,\n name: getFormOfPaymentDisplayName(fop),\n subtitle:\n fop.fopType === FormOfPaymentType.BANK_TRANSFER\n ? t('fops.bankTransferTime')\n : t('fops.instant'),\n disabled: !fop.embeddedFlowUrl,\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 { getFiatExchangeRates } from '@funkit/api-base'\nimport { useQuery } from '@tanstack/react-query'\n\nimport { logger } from '../../logging/logger'\n\n/**\n * RN port of web's `useFiatExchangeRates`: the fiat exchange-rate table used to\n * convert the host's USD source balance into Swapped's EUR sell cap. Keyless\n * endpoint, cached for an hour (rates barely move within a session).\n */\nexport function useFiatExchangeRates(enabled = true) {\n const { data, isLoading, error } = useQuery({\n queryKey: ['fiatExchangeRates'],\n queryFn: () => getFiatExchangeRates({ logger }),\n refetchOnMount: false,\n refetchOnReconnect: false,\n refetchOnWindowFocus: false,\n gcTime: 1000 * 60 * 60, // 1 hour\n enabled,\n })\n\n return { data, isLoading, error }\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 DEFAULT_FIAT_CURRENCY,\n FOPS_STALE_TIME,\n buildSwappedThirdPartyPaymentConfigs,\n getConfiguredMinDepositUsd,\n getDepositAddressForChain,\n getMinTransferValueEur,\n sortFops,\n useSwappedDefaultCurrencyQuery,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\nimport { useTheme } from '@shopify/restyle'\nimport { useQuery } from '@tanstack/react-query'\nimport { useMemo } from 'react'\n\nimport type { DepositCheckoutConfig } from '../../flow/depositFlowConfig'\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 { useFiatExchangeRates } from './useFiatExchangeRates'\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 /**\n * Destination chain/asset \u2014 drives the deposit recipient + FOP query. Its\n * optional `getMinDepositUSD` feeds the fiat (Swapped) buy minimum.\n */\n checkoutConfig: DepositCheckoutConfig | 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 * Theme, buy minimum, and region currency reach web parity (see the inline\n * notes below). V1 still omits web's per-region geoblocking and `validateFops`.\n */\nexport function useFops({\n checkoutConfig,\n dynamicRoutingId,\n enabled = true,\n}: UseFopsParams): UseFopsResult {\n const isSwappedEnabled = !!useDynamicConfig('enableswappeddeposit')\n const input = useFopsQueryInput({\n checkoutConfig,\n dynamicRoutingId,\n enabled: enabled && isSwappedEnabled,\n })\n const query = useDoFetchFops(input)\n\n // The region-currency / rate lookups keep the fetch disabled, and a disabled\n // query's `isLoading` reads false \u2014 indistinguishable from \"settled, no cash\n // methods\". Cover those windows too, or callers paint a cash-less list before\n // /fops has even been requested.\n const isLoading =\n isSwappedEnabled &&\n (input.isDependencyLoading || (input.enabled && query.isLoading))\n\n return {\n savedFops: query.data?.savedFormsOfPayments ?? [],\n genericFops: query.data?.genericFormsOfPayments ?? [],\n isLoading,\n isFetching: input.isTransferInitFetching,\n isError: query.isError,\n refetch: () => void query.refetch(),\n isSwappedEnabled,\n }\n}\n\n/**\n * Resolves the /fops request into a query key \u2014 identity, region (country +\n * fiat currency), Swapped theme, deposit recipient, EUR buy minimum \u2014 plus\n * whether the fetch may run and which upstream lookups are still pending.\n */\nfunction useFopsQueryInput({\n checkoutConfig,\n dynamicRoutingId,\n enabled,\n}: {\n checkoutConfig: DepositCheckoutConfig | undefined\n dynamicRoutingId: string | undefined\n enabled: boolean\n}) {\n const { apiKey, userId, prefillFiatEmail } = useFunkitIdentity()\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\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: fiatCurrencyCode = DEFAULT_FIAT_CURRENCY,\n isLoading: isFiatCurrencyCodeLoading,\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({ checkoutConfig, dynamicRoutingId, enabled })\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 { defaultMinAmount, isLoading: isExchangeRatesLoading } =\n useDefaultMinAmountEur({ checkoutConfig, dynamicRoutingId, enabled })\n\n return {\n // `prefillFiatEmail` is intentionally kept out of the key (web parity):\n // it's read at fetch time, so post-mount changes don't refetch.\n queryKey: [\n 'fops',\n {\n apiKey,\n userId,\n recipientAddress,\n solanaAddress: transferInit?.solanaAddr,\n targetAsset,\n targetChain,\n // fallback to DEFAULT_COUNTRY_CODE, do not use it in useSwappedDefaultCurrencyQuery\n countryCode: userIpInfo?.alpha2 || DEFAULT_COUNTRY_CODE,\n fiatCurrencyCode,\n fopPriority,\n themeConfig,\n defaultMinAmount,\n },\n ] as const,\n prefillFiatEmail,\n enabled:\n enabled &&\n !!apiKey &&\n !!targetAsset &&\n !!targetChain &&\n !!recipientAddress &&\n !!transferInit &&\n !isFiatCurrencyCodeLoading &&\n !isExchangeRatesLoading,\n isDependencyLoading:\n isTransferInitLoading ||\n isFiatCurrencyCodeLoading ||\n isExchangeRatesLoading,\n isTransferInitFetching,\n }\n}\n\n/**\n * Swapped enforces its own minimum inside the widget; we hand it the same floor\n * web sends (shared `getMinTransferValueEur`) \u2014 the chain transfer minimum plus\n * the config's `getMinDepositUSD`, converted to EUR. Callers gate /fops on\n * `isLoading` so the first request already carries the real EUR floor rather\n * than a 1:1 estimate that later churns the query key.\n */\nfunction useDefaultMinAmountEur({\n checkoutConfig,\n dynamicRoutingId,\n enabled,\n}: {\n checkoutConfig: DepositCheckoutConfig | undefined\n dynamicRoutingId: string | undefined\n enabled: boolean\n}) {\n const minTransferLimits = useDynamicConfig('mintokentransfervalue')\n const { data: exchangeRates, isLoading } = useFiatExchangeRates(enabled)\n\n const targetChain = checkoutConfig?.targetChain\n const defaultMinAmount = getMinTransferValueEur(\n targetChain ? Number(targetChain) : undefined,\n minTransferLimits,\n getConfiguredMinDepositUsd({\n targetChain,\n targetAsset: checkoutConfig?.targetAsset,\n dynamicRoutingId,\n getMinDepositUSD: checkoutConfig?.getMinDepositUSD,\n }),\n exchangeRates,\n )\n\n return { defaultMinAmount, isLoading }\n}\n\n/** Runs the /fops fetch off the key built by {@link useFopsQueryInput}. */\nfunction useDoFetchFops({\n queryKey,\n prefillFiatEmail,\n enabled,\n}: ReturnType<typeof useFopsQueryInput>) {\n return useQuery({\n queryKey,\n queryFn: async ({ queryKey: [_, params] }) => {\n const { recipientAddress, targetAsset, targetChain, fopPriority } = params\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 ...(params.solanaAddress\n ? [\n {\n recipientAddress: params.solanaAddress,\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: params.apiKey,\n logger,\n params: {\n recipientAddress,\n userId: params.userId,\n destinationToken,\n fiatCurrencyCode: params.fiatCurrencyCode,\n countryCode: params.countryCode,\n recipientTargets,\n thirdPartyPaymentConfigs: buildSwappedThirdPartyPaymentConfigs({\n prefillFiatEmail,\n themeConfig: params.themeConfig,\n logTag: 'connect-rn:useFops',\n logger,\n }),\n checkoutLimitsCriteria: { defaultMinAmount: params.defaultMinAmount },\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,\n staleTime: FOPS_STALE_TIME,\n refetchOnWindowFocus: false,\n })\n}\n", "import { type ReactNode, createContext, useContext } from 'react'\nimport { isMallardApiKey } from '../utils/customers'\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 /** Email prefilled into the Swapped fiat ramp, when the host supplies one. */\n prefillFiatEmail?: 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 * Email prefilled into the Swapped fiat onramp/offramp so the user doesn't\n * retype it (web parity). Validated at the `/fops` boundary and dropped when\n * invalid \u2014 it never blocks the flow.\n */\n prefillFiatEmail?: 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 // Mallard wants the externalUserId as wallet address\n // so we don't want to prefix it with the apiKey\n if (isMallardApiKey(apiKey)) {\n return externalUserId\n }\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 prefillFiatEmail: config.prefillFiatEmail,\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 { MALLARD_API_KEY } from '@funkit/api-base'\n\nexport function isMallardApiKey(apiKey: string): boolean {\n return apiKey === MALLARD_API_KEY\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 } from '@funkit/connect-core'\n\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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 {\n RailConfigType,\n type SwappedFormOfPayment,\n getFops,\n} from '@funkit/api-base'\nimport {\n DEFAULT_FIAT_CURRENCY,\n FOPS_STALE_TIME,\n type SwappedWithdrawalLegs,\n buildSwappedSellLimits,\n buildSwappedThirdPartyPaymentConfigs,\n findSwappedSourceOverride,\n getExchangeRate,\n getSwappedCashMinUsd,\n getSwappedSellCapEur,\n resolveSwappedWithdrawalLegs,\n sortFops,\n useSwappedDefaultCurrencyQuery,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\nimport { useTheme } from '@shopify/restyle'\nimport { useStatsigClient } from '@statsig/react-bindings'\nimport { useQuery } from '@tanstack/react-query'\nimport { useMemo } from 'react'\n\nimport type {\n WithdrawalFlowConfig,\n WithdrawalToken,\n} from '../../flow/withdrawalFlowConfig'\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 { useFiatExchangeRates } from './useFiatExchangeRates'\n\n/** Base react-query key for the withdrawal `/fops` query \u2014 shared with the\n * flow's invalidation so the two can't drift. */\nexport const WITHDRAW_FOPS_QUERY_KEY = 'withdrawFops'\n\nexport interface UseWithdrawalFopsParams {\n config: WithdrawalFlowConfig\n enabled?: boolean\n}\n\nexport interface UseWithdrawalFopsResult {\n /**\n * Generic cash payout methods (Card / Bank Transfer / \u2026). Saved FOPs are not\n * supported for withdrawals (web parity) and are never returned.\n */\n fops: SwappedFormOfPayment[]\n isLoading: boolean\n isError: boolean\n /**\n * True only once we KNOW there's nothing to show (gate off, or a settled\n * fetch returned zero) \u2014 never during a load, so the non-retryable\n * \"unavailable\" screen can't flash.\n */\n noPaymentMethodsAvailable: boolean\n /** Source balance can't clear Swapped's \u20AC7 minimum sell (cash impossible). */\n isBelowMinimumBalance: boolean\n refetch: () => void\n /** Whether the Statsig `enableswappedwithdrawal` gate is on for this apiKey. */\n isWithdrawalEnabled: boolean\n /** Resolved source\u2192accepted-token route, shared by the fops fetch and quote. */\n route: SwappedWithdrawalLegs\n}\n\n// \u2500\u2500 Step: resolve the withdrawal route \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n/**\n * Resolve the on-chain route legs (source the user sells \u2192 the token Swapped\n * accepts), applying the Statsig `swappedwithdrawalsourceoverrides` rule.\n * Memoized so the returned object stays referentially stable for the downstream\n * execution `useCallback`.\n */\nfunction useWithdrawalRoute(\n config: WithdrawalFlowConfig,\n): SwappedWithdrawalLegs {\n const sourceOverrides = useDynamicConfig('swappedwithdrawalsourceoverrides')\n return useMemo(\n () =>\n resolveSwappedWithdrawalLegs({\n source: config.sourceToken,\n target: config.swappedAcceptedToken,\n override: findSwappedSourceOverride(sourceOverrides, {\n chainId: config.sourceToken.chainId,\n tokenAddress: config.sourceToken.address,\n }),\n }),\n [config.sourceToken, config.swappedAcceptedToken, sourceOverrides],\n )\n}\n\n// \u2500\u2500 Step: source balance \u2192 EUR sell cap \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\ninterface WithdrawalSellCap {\n /** Host balance in USD (0 when none is configured or it hasn't resolved). */\n usdBalance: number\n /** Floored EUR cap forwarded to Swapped, or undefined when uncapped. */\n eurMax: number | undefined\n /** Balance can't clear Swapped's EUR minimum \u2192 cash methods are impossible. */\n isBelowMinimumBalance: boolean\n /** A cap is still resolving \u2014 hold /fops so its first request isn't uncapped. */\n isAwaitingCap: boolean\n}\n\n/**\n * Resolve the host's USD balance and derive the EUR sell cap (web parity:\n * `WithdrawalMethodSelect`). A callback balance (e.g. an on-chain `balanceOf`)\n * is fetched via query; a plain number is used as-is.\n */\nfunction useWithdrawalSellCap(\n config: WithdrawalFlowConfig,\n walletAddress: string,\n): WithdrawalSellCap {\n const { sourceUsdBalance } = config\n const isBalanceCallback = typeof sourceUsdBalance === 'function'\n const hasBalanceInfo = sourceUsdBalance != null\n\n const balanceQuery = useQuery({\n queryKey: [\n 'withdrawSourceUsdBalance',\n walletAddress,\n config.sourceToken.chainId,\n config.sourceToken.address,\n ] as const,\n queryFn: async () => {\n const value = isBalanceCallback ? await sourceUsdBalance() : 0\n return Number.isFinite(value) && value > 0 ? value : 0\n },\n enabled: isBalanceCallback && !!walletAddress && walletAddress !== '0x',\n staleTime: 30_000,\n refetchOnWindowFocus: false,\n })\n const isLoadingBalance = isBalanceCallback && balanceQuery.isLoading\n // Sanitize both paths \u2014 the callback result is already clamped in its queryFn,\n // but a host could also pass a negative / NaN plain number.\n const rawUsdBalance = isBalanceCallback\n ? (balanceQuery.data ?? 0)\n : (sourceUsdBalance ?? 0)\n const usdBalance =\n Number.isFinite(rawUsdBalance) && rawUsdBalance > 0 ? rawUsdBalance : 0\n\n // markup 0 so the cap reflects the true balance (not an inflated +5%); floor\n // it so the sell never exceeds what the user holds and the fops query key\n // stays stable against sub-unit balance jitter (web parity).\n //\n // Enabled on `hasBalanceInfo` (not `usdBalance > 0`) so the keyless rates\n // table fetches in parallel with the balance callback instead of waiting for\n // it \u2014 `isAwaitingCap` still holds /fops until both resolve.\n const { data: exchangeRates, isLoading: isLoadingRates } =\n useFiatExchangeRates(hasBalanceInfo)\n const eurRate = getExchangeRate('EUR', exchangeRates, 0)\n const eurMax = getSwappedSellCapEur(usdBalance, eurRate)\n\n const cashMinUsd = getSwappedCashMinUsd(eurRate)\n const isBelowMinimumBalance =\n hasBalanceInfo &&\n !isLoadingBalance &&\n cashMinUsd != null &&\n usdBalance < cashMinUsd\n\n const isAwaitingCap =\n hasBalanceInfo && (isLoadingBalance || (usdBalance > 0 && isLoadingRates))\n\n return { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap }\n}\n\n// \u2500\u2500 Step: the /fops request \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\ninterface FetchWithdrawalFopsArgs {\n apiKey: string\n userId: string\n walletAddress: string\n countryCode: string\n swappedCurrencyCode: string\n fopPriority: Parameters<typeof sortFops>[1]\n themeConfig: ReturnType<typeof buildSwappedThemeQueryParamsRN>\n route: SwappedWithdrawalLegs\n eurMax: number | undefined\n usdBalance: number\n /** The user's raw source token \u2014 for the route-decision log only. */\n sourceToken: WithdrawalToken\n /** Host-supplied email prefilled into the Swapped payout widget, if any. */\n prefillFiatEmail: string | undefined\n}\n\n/**\n * Fetch + sort the Swapped `CRYPTO_TO_FIAT` payout methods for the accepted\n * token. The rail's `sourceToken` is the resolved ACCEPTED token (not the\n * user's raw source) \u2014 mirroring web, where the override/config target feeds\n * the `/fops` rail. `recipientAddress`/`destinationToken` are schema-required\n * but ignored for off-ramp; the wallet address fills the former.\n */\nasync function fetchWithdrawalFops({\n apiKey,\n userId,\n walletAddress,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route,\n eurMax,\n usdBalance,\n sourceToken,\n prefillFiatEmail,\n}: FetchWithdrawalFopsArgs): Promise<SwappedFormOfPayment[]> {\n const acceptedToken = {\n chainId: route.targetChainId,\n address: route.targetTokenAddress,\n }\n\n // Decision point: which accepted-token rail we request the methods for, and\n // why (Statsig source override vs configured/source token). Logged at fetch\n // time so sessions that list methods but never place an order still record\n // how the route was chosen (web parity: `withdraw-fops`).\n logger.info('connect-rn:withdrawFops:source_override', {\n overrideApplied: route.overrideApplied,\n sourceChainId: sourceToken.chainId,\n sourceTokenAddress: sourceToken.address,\n acceptedChainId: route.targetChainId,\n acceptedTokenAddress: route.targetTokenAddress,\n acceptedTokenSymbol: route.targetTokenSymbol,\n })\n\n // Decision point: whether the balance-derived EUR cap is forwarded as the\n // sell limit or suppressed (at/below the minimum \u2014 a contradictory range).\n const sellLimits = buildSwappedSellLimits(eurMax)\n logger.info('connect-rn:withdrawFops:sellLimits', {\n defaultMinAmount: sellLimits.defaultMinAmount,\n usdBalance,\n eurMax,\n capForwarded: sellLimits.defaultMaxAmount != null,\n })\n\n const response = await getFops({\n apiKey,\n logger,\n params: {\n recipientAddress: walletAddress,\n userId,\n destinationToken: acceptedToken,\n fiatCurrencyCode: swappedCurrencyCode,\n countryCode,\n railConfigs: [\n {\n type: RailConfigType.CRYPTO_TO_FIAT,\n userId,\n countryCode,\n fiatCurrencyCode: swappedCurrencyCode,\n sourceToken: acceptedToken,\n thirdPartyPaymentConfigs: buildSwappedThirdPartyPaymentConfigs({\n prefillFiatEmail,\n themeConfig,\n logTag: 'connect-rn:withdrawFops',\n logger,\n }),\n checkoutLimitsCriteria: sellLimits,\n },\n ],\n },\n })\n\n const fops = sortFops(response.genericFormsOfPayments, fopPriority)\n if (fops.length === 0) {\n logger.info('connect-rn:withdrawFops:empty', {\n countryCode,\n targetChainId: route.targetChainId,\n targetTokenAddress: route.targetTokenAddress,\n })\n }\n return fops\n}\n\n// \u2500\u2500 Hook \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n/**\n * RN port of web's `useWithdrawFops`. Orchestrates the steps: resolve the\n * accepted-token legs, the region country/currency, the balance-derived sell\n * cap, then run the gated `/fops` query.\n */\nexport function useWithdrawalFops({\n config,\n enabled = true,\n}: UseWithdrawalFopsParams): UseWithdrawalFopsResult {\n const { apiKey, userId, prefillFiatEmail } = useFunkitIdentity()\n // Statsig readiness: while it's loading, the gate reads its `false` fallback,\n // which is indistinguishable from a genuinely-off gate \u2014 treat init as\n // loading, not \"unavailable\".\n const { isLoading: isStatsigLoading } = useStatsigClient()\n const isWithdrawalEnabled = !!useDynamicConfig('enableswappedwithdrawal')\n const fopPriority = useDynamicConfig('foppriority')\n const walletAddress = config.withdrawalWallet.address()\n\n const route = useWithdrawalRoute(config)\n\n // Country from the user's IP; no default (web parity). How an unresolved or\n // empty country is handled lives downstream: the fetch holds on it (isEnabled)\n // and a settled-but-empty lookup surfaces as an error (isError).\n const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo()\n const countryCode = userIpInfo?.alpha2\n\n // Region-default fiat currency (web parity); falls back to USD. Gating /fops\n // on its loading state avoids an initial USD fetch that refetches once the\n // 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 { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap } =\n useWithdrawalSellCap(config, walletAddress)\n\n const isEnabled =\n enabled &&\n isWithdrawalEnabled &&\n !!apiKey &&\n !!userId &&\n !!walletAddress &&\n walletAddress !== '0x' &&\n !!countryCode &&\n !isSwappedCurrencyCodeLoading &&\n !isAwaitingCap\n\n const query = useQuery({\n // `prefillFiatEmail` is intentionally NOT in the queryKey (web parity): it's\n // read at fetch time, so post-mount changes don't trigger a refetch.\n queryKey: [\n WITHDRAW_FOPS_QUERY_KEY,\n userId,\n walletAddress,\n apiKey,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route.targetChainId,\n route.targetTokenAddress,\n eurMax,\n ] as const,\n // `countryCode` is guaranteed by `isEnabled` (query stays disabled until it\n // resolves); the guard just narrows the type \u2014 the empty fallback is unreachable.\n queryFn: () =>\n countryCode\n ? fetchWithdrawalFops({\n apiKey,\n userId,\n walletAddress,\n countryCode,\n swappedCurrencyCode,\n fopPriority,\n themeConfig,\n route,\n eurMax,\n usdBalance,\n sourceToken: config.sourceToken,\n prefillFiatEmail,\n })\n : Promise.resolve([]),\n enabled: isEnabled,\n staleTime: FOPS_STALE_TIME,\n refetchOnWindowFocus: false,\n })\n\n // Loading spans every window where the answer isn't knowable yet: Statsig\n // init, the geo lookup, the region-currency lookup, the balance/rate cap\n // resolution, and the enabled fops fetch.\n const isLoading =\n isStatsigLoading ||\n isLoadingGeoCheck ||\n isSwappedCurrencyCodeLoading ||\n isAwaitingCap ||\n (isEnabled && query.isLoading)\n\n // Known-empty only once we actually know: gate confirmed off (Statsig\n // settled) or a settled fetch that returned nothing. Never during a load.\n const noPaymentMethodsAvailable =\n !isLoading &&\n (!isWithdrawalEnabled ||\n (query.isSuccess && (query.data?.length ?? 0) === 0))\n\n return {\n fops: query.data ?? [],\n isLoading,\n noPaymentMethodsAvailable,\n isBelowMinimumBalance,\n // Tie the query error to isEnabled (\"gate off \u21D2 no error\"), plus web's\n // no-country case: geo settled without a country is unrecoverable here.\n isError:\n (isEnabled && query.isError) || (!isLoadingGeoCheck && !countryCode),\n // Respect the enabled gate \u2014 refetch() would otherwise force a fetch even\n // when disabled (e.g. no resolved country).\n refetch: () => {\n if (isEnabled) void query.refetch()\n },\n isWithdrawalEnabled,\n route,\n }\n}\n", "import {\n type SwappedSellOrderData,\n type SwappedWithdrawalLegs,\n ensureRelayClientInitialized,\n isUserRejectedError,\n processFiatWithdrawalOrder,\n toFiatWithdrawalOrder,\n} from '@funkit/connect-core'\nimport { useCallback, useRef } from 'react'\n\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from '../flow/withdrawalFlowConfig'\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { getPublicClientFor } from './publicClient'\n\n// Module-scoped so a submitted order stays deduped across sheet close/reopen \u2014\n// the hook (and its refs) unmount on close, but the embed can re-emit\n// SWAPPED_ORDER_DATA for the same order_id after a reopen. Provider order ids\n// are globally unique, so a process-wide set is safe.\nconst submittedOrderIds = new Set<string>()\n\n/**\n * @internal Test-only: clear the process-wide submitted-order dedupe set so\n * suites that reuse order ids stay isolated. Not part of the public API.\n */\nexport function __resetSubmittedWithdrawalOrders(): void {\n submittedOrderIds.clear()\n}\n\nexport interface UseWithdrawalExecutionParams {\n config: WithdrawalFlowConfig\n /** The route resolved by `useWithdrawalFops` \u2014 one resolution for fetch + quote. */\n route: SwappedWithdrawalLegs\n callbacks: WithdrawalFlowCallbacks\n /** Unrecoverable failure \u2014 the flow shows its error state. */\n onError: () => void\n}\n\n/**\n * Thin React wrapper over connect-core's `processFiatWithdrawalOrder`: owns\n * the control-flow guards for the unreliable embed message stream and maps\n * outcomes onto host callbacks. The guards are intentionally refs, not state \u2014\n * both are read synchronously inside the async `executeOrder` (a re-entrancy\n * flag set before the first await, and a dedupe set) and must not re-render.\n */\nexport function useWithdrawalExecution({\n config,\n route,\n callbacks,\n onError,\n}: UseWithdrawalExecutionParams): {\n executeOrder: (data: SwappedSellOrderData) => Promise<void>\n} {\n const { apiKey, userId } = useFunkitIdentity()\n\n const isProcessingRef = useRef(false)\n\n const executeOrder = useCallback(\n async (data: SwappedSellOrderData) => {\n const order = toFiatWithdrawalOrder(data)\n if (isProcessingRef.current) {\n logger.warn('connect-rn:withdrawal:already_processing', {\n order_id: order.orderId,\n })\n return\n }\n if (submittedOrderIds.has(order.orderId)) {\n logger.warn('connect-rn:withdrawal:duplicate', {\n order_id: order.orderId,\n })\n return\n }\n isProcessingRef.current = true\n\n // Routing decision point: the requested target (config) vs the enforced\n // target (after the Statsig source override) alongside what the provider\n // reported it accepts, for off-ramp reconciliation (web parity).\n logger.info('connect-rn:withdrawal:route_decision', {\n order_id: order.orderId,\n overrideApplied: route.overrideApplied,\n requestedTargetChainId: config.swappedAcceptedToken?.chainId,\n requestedTargetTokenAddress: config.swappedAcceptedToken?.address,\n enforcedTargetChainId: route.targetChainId,\n enforcedTargetTokenAddress: route.targetTokenAddress,\n enforcedTargetTokenSymbol: route.targetTokenSymbol,\n providerCrypto: order.providerCrypto,\n providerNetwork: order.providerNetwork,\n })\n\n let txHash: string\n try {\n ensureRelayClientInitialized(logger, 'funkit-connect-rn')\n ;({ txHash } = await processFiatWithdrawalOrder({\n order,\n wallet: config.withdrawalWallet,\n legs: route,\n apiKey,\n userId,\n logger,\n // Read the target token's decimals on-chain (via publicClient) rather\n // than trusting host-config `decimals` \u2014 a stale/wrong value would\n // mis-scale the amount transferred to Swapped's deposit address.\n publicClient: getPublicClientFor(Number(route.targetChainId)),\n }))\n } catch (error) {\n if (isUserRejectedError(error)) {\n // The user declined the signature \u2014 the embed stays interactive.\n logger.warn('connect-rn:withdrawal:user_rejected', {\n order_id: order.orderId,\n })\n return\n }\n // Unrecoverable: funds did not move (or the record failed) and the\n // user sees the error state.\n logger.error('connect-rn:withdrawal:execution_failed', error as Error, {\n order_id: order.orderId,\n })\n callbacks.onWithdrawalError?.({\n message: error instanceof Error ? error.message : String(error),\n })\n onError()\n return\n } finally {\n isProcessingRef.current = false\n }\n\n // Funds moved \u2014 mark submitted and correlate the provider order id to the\n // on-chain hash. The host callback runs in its own guard: a throw here is\n // NOT an execution failure (money already moved), so it must not fall into\n // the error path above and fire `onWithdrawalError` for a success.\n submittedOrderIds.add(order.orderId)\n try {\n callbacks.onWithdrawalSubmitted?.(order.orderId, txHash)\n } catch (error) {\n logger.warn('connect-rn:withdrawal:submitted_callback_threw', {\n order_id: order.orderId,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n },\n [apiKey, userId, config, route, callbacks, onError],\n )\n\n return { executeOrder }\n}\n", "import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from '@funkit/chains'\nimport { type PublicClient, createPublicClient, fallback, http } from 'viem'\n\n// One lazy client per chain \u2014 execution only ever needs the target chain's\n// erc20 `decimals()` read, so this stays tiny.\nconst clients = new Map<number, Pick<PublicClient, 'readContract'>>()\n\n/**\n * Read-only client for a funkit-supported chain, built over the chain's\n * fallback RPC list from @funkit/chains (the chain's default RPC may be\n * private \u2014 e.g. the Robinhood chain \u2014 so the curated list matters).\n * `undefined` for unsupported chain ids; the caller surfaces that as a\n * mis-routed target.\n */\nexport function getPublicClientFor(\n chainId: number,\n): Pick<PublicClient, 'readContract'> | undefined {\n const cached = clients.get(chainId)\n if (cached) return cached\n\n const info = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[chainId]\n if (!info) return undefined\n\n const client = createPublicClient({\n chain: info.chainInfo,\n transport: info.fallbackRpcUrls.length\n ? fallback(info.fallbackRpcUrls.map((url) => http(url)))\n : http(),\n })\n clients.set(chainId, client)\n return client\n}\n", "import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base'\nimport { getSupportedAssets } from '@funkit/api-base'\nimport {\n isTransferChainEnabled,\n resolveTokenTransferConfig,\n} from '@funkit/connect-core'\nimport { useDynamicConfig } from '../../statsig/useDynamicConfig'\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 getTransferTokenQrCodeUri,\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 /** 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. 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. (The\n * per-chain minimums are computed in `buildAvailableChains`, not here.)\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\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 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 { StyleSheet, type ViewStyle } from 'react-native'\nimport Animated, { Easing, FadeOutUp, Keyframe } from 'react-native-reanimated'\n\nimport { FigmaSuccessCheckIcon } from '../icons/FigmaSystemIcons'\nimport { useFunkitTranslation } from '../providers/FunkitI18nProvider'\nimport { Text, useTheme } from '../theme/restyle'\n\n/**\n * The \"Address copied\" confirmation pill (Figma: Fun Mobile deposit toast). A\n * rounded pill with the label + a green success check. Surface + label track the\n * theme (`background/pill/default`, `content/elements/primary` via the medium\n * body cut) so it themes with light/dark; only the layout + soft shadow are\n * static (h42, px16, radius999, gap6).\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 */\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 const { t } = useFunkitTranslation()\n const label = t('common.addressCopied')\n const theme = useTheme()\n return (\n <Animated.View\n entering={enterAnimation}\n exiting={exitAnimation}\n style={[styles.pill, { backgroundColor: theme.background.pill.default }]}\n accessibilityRole=\"alert\"\n accessibilityLabel={label}\n >\n <Text variant=\"bodyMedium\">{label}</Text>\n <FigmaSuccessCheckIcon size={16} />\n </Animated.View>\n )\n}\n\n// Layout + soft shadow only \u2014 the surface color comes from the theme's\n// `background/pill/default` token, applied inline above.\nconst pill: ViewStyle = {\n height: 42,\n paddingHorizontal: 16,\n borderRadius: 999,\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}\n\nconst styles = StyleSheet.create({ pill })\n", "import type {\n CheckoutTokenTransferConfig,\n DynamicTargetAssetCandidate,\n MinDepositTarget,\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 * Destination chain/asset for a deposit, plus the customer `getMinDepositUSD`\n * closure that feeds the transfer minimums and the fiat (Swapped) buy floor.\n * The web `FunkitCheckoutConfig` satisfies this structurally. Named once here so\n * the flow provider and `useFops` share exactly one shape.\n */\nexport type DepositCheckoutConfig = CheckoutTokenTransferConfig &\n Pick<MinDepositTarget, 'getMinDepositUSD'>\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, and its optional `getMinDepositUSD`\n * feeds the per-chain transfer minimums and the fiat (Swapped) sell floor.\n * The web `FunkitCheckoutConfig` satisfies this structurally.\n */\n checkoutConfig?: DepositCheckoutConfig\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'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\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 enableSwipeToDismiss?: 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 enableSwipeToDismiss = true,\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 const insets = useSafeAreaInsets()\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 // Cap the sheet at the bottom of the status bar: gorhom subtracts this\n // from the container height, so a tall screen tops out flush below it\n // instead of sliding behind it.\n topInset={insets.top}\n // Off on non-home screens: the drag rubber-bands back instead of\n // closing (gorhom keeps the pan gesture, just not the dismissal).\n enablePanDownToClose={enableSwipeToDismiss}\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.background.modal,\n borderTopLeftRadius: theme.borderRadii.modal,\n borderTopRightRadius: theme.borderRadii.modal,\n }\n const extension: ViewStyle = {\n ...bottomExtension,\n backgroundColor: theme.background.modal,\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\n// Hardcoded SDK marker (not UA/OS-parsed, so present on every eval). Lets a\n// config shared with the web SDK be scoped per-SDK via a targeting rule.\nexport const STATSIG_SDK_TYPE = 'react-native' as const\n\n/**\n * Statsig user for the RN SDK: `customIDs.apiKey` drives customer-gated configs;\n * `custom.sdkType` scopes shared configs to this SDK (see {@link STATSIG_SDK_TYPE}).\n */\nexport function buildFunkitStatsigUser(\n userId: string,\n apiKey: string,\n): StatsigUser {\n return {\n userID: userId,\n customIDs: { apiKey },\n custom: { sdkType: STATSIG_SDK_TYPE },\n }\n}\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 const user = useMemo<StatsigUser>(\n () => buildFunkitStatsigUser(userId, 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'\nimport type {\n WithdrawalFlowCallbacks,\n WithdrawalFlowConfig,\n} from '../flow/withdrawalFlowConfig'\n\n/** Lifecycle callbacks for both managed flows (overlapping keys are identical). */\nexport type FunkitCheckoutCallbacks = DepositFlowCallbacks &\n WithdrawalFlowCallbacks\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). `beginWithdrawal(config)` opens the\n * fiat-offramp withdrawal flow (payout methods \u2192 Swapped sell embed).\n * `beginCheckout` will be added here as that flow lands, matching the web\n * surface.\n */\nexport function useFunkitCheckout(callbacks: FunkitCheckoutCallbacks = {}) {\n const { beginDeposit: openDepositFlow, beginWithdrawal: openWithdrawalFlow } =\n useFunkitFlow()\n\n const beginDeposit = useCallback(\n (config: DepositFlowConfig) => openDepositFlow(config, callbacks),\n [openDepositFlow, callbacks],\n )\n\n const beginWithdrawal = useCallback(\n (config: WithdrawalFlowConfig) => openWithdrawalFlow(config, callbacks),\n [openWithdrawalFlow, callbacks],\n )\n\n return { beginDeposit, beginWithdrawal }\n}\n", "import type { DirectExecution } from '@funkit/api-base'\nimport {\n type PurifiedCheckoutHistoryItem,\n processRecentDepositsForNotifications,\n purifyCheckoutHistoryItem,\n useRecentDepositsApiQuery,\n} from '@funkit/connect-core'\nimport { useMemo } from 'react'\n\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\n\ninterface UseFunkitRecentDepositsParams {\n isVisible: boolean\n fetchSize?: number\n cutOffTimeMs?: number\n /**\n * Optional filter to refine which deposits are returned. Pass a stable\n * reference (`useCallback`) \u2014 an unstable one recomputes the merge each render.\n */\n memoizedFilterFunc?: (de: DirectExecution) => boolean\n}\n\ninterface UseFunkitRecentDepositsImplParams extends UseFunkitRecentDepositsParams {\n apiKey: string\n userId: string\n refreshIntervalMs: number\n}\n\n/**\n * Fetch the current user's recent deposits, polling the funkit server. Mirrors\n * `@funkit/connect`'s `useFunkitRecentDeposits`.\n *\n * **Requirements**: must be used inside `<FunkitProvider>` \u2014 it reads the\n * apiKey/userId configured there and the shared refresh interval. The `'0x'`\n * sentinel (no wallet / no externalUserId) disables polling.\n *\n * @returns `{ data }` \u2014 purified deposit rows, or `undefined` while loading.\n *\n * @example\n * ```tsx\n * const { data: recentDeposits } = useFunkitRecentDeposits({\n * isVisible: true,\n * fetchSize: 10,\n * cutOffTimeMs: 24 * 60 * 60 * 1000, // last 24h\n * })\n * ```\n */\nexport function useFunkitRecentDeposits(query: UseFunkitRecentDepositsParams): {\n data: PurifiedCheckoutHistoryItem[] | undefined\n} {\n const { apiKey, userId } = useFunkitIdentity()\n const { listRefresh } = useDynamicConfig(\n 'checkoutnotificationsrefreshinterval',\n )\n\n return useFunkitRecentDepositsImpl({\n ...query,\n apiKey,\n // The '0x' sentinel means no wallet / no externalUserId \u2014 disables polling.\n userId: userId === '0x' ? '' : userId,\n refreshIntervalMs: listRefresh,\n })\n}\n\n/**\n * Explicit-params variant of `useFunkitRecentDeposits`. Mirrors\n * `@funkit/connect`'s `useFunkitRecentDepositsImpl`.\n *\n * **Requirements**: does NOT require `<FunkitProvider>` \u2014 the host passes\n * identity and the refresh interval itself. Use it when polling outside the\n * provider hierarchy, or for a user other than the configured one.\n *\n * @returns `{ data }` \u2014 purified deposit rows, or `undefined` while loading.\n *\n * @example\n * ```tsx\n * const { data: recentDeposits } = useFunkitRecentDepositsImpl({\n * isVisible: true,\n * apiKey: 'your-api-key',\n * userId: 'funkit|external-user-42',\n * refreshIntervalMs: 5000,\n * fetchSize: 10,\n * })\n * ```\n */\nexport function useFunkitRecentDepositsImpl({\n isVisible,\n fetchSize = 5,\n cutOffTimeMs,\n memoizedFilterFunc,\n apiKey,\n userId,\n refreshIntervalMs,\n}: UseFunkitRecentDepositsImplParams): {\n data: PurifiedCheckoutHistoryItem[] | undefined\n} {\n const { data: directExecutions } = useRecentDepositsApiQuery({\n isVisible,\n apiKey,\n userId,\n refreshIntervalMs,\n fetchSize: fetchSize * 2, // over-fetch to account for merging\n logger,\n })\n\n const mergedDirectExecutions = useMemo(\n () =>\n processRecentDepositsForNotifications(\n memoizedFilterFunc\n ? directExecutions?.filter(memoizedFilterFunc)\n : directExecutions,\n { cutOffTimeMs },\n ),\n [directExecutions, cutOffTimeMs, memoizedFilterFunc],\n )\n\n return useMemo(\n () => ({\n data: mergedDirectExecutions\n ?.map((de) => purifyCheckoutHistoryItem(de))\n .slice(0, fetchSize),\n }),\n [mergedDirectExecutions, fetchSize],\n )\n}\n", "import {\n getCheckoutsByUserId,\n getDirectExecutionsByUserId,\n} from '@funkit/api-base'\nimport {\n type PurifiedCheckoutHistoryItem,\n purifyCheckoutHistoryItem,\n} from '@funkit/connect-core'\nimport { useQuery } from '@tanstack/react-query'\n\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\n\nconst CHECKOUT_HISTORY_HOOK_LIMIT = 100\n\n/**\n * Poll the current user's checkout + deposit history, mirroring\n * `@funkit/connect`'s `useCheckoutsListenerByUserId`. Fetches both checkouts and\n * direct executions, purifies them, and returns a single list sorted\n * newest-first.\n *\n * **Requirements**: must be used inside `<FunkitProvider>`. `userId` is optional\n * and defaults to the identity configured there \u2014 RN's `userId` is a synthetic\n * internal id the host can't easily supply, so the common case is to omit it.\n * The `'0x'` sentinel (no wallet / no externalUserId) disables polling.\n *\n * @returns `{ data, isLoading }` \u2014 purified rows, or `undefined` while loading.\n */\nexport function useCheckoutsListenerByUserId(userId?: string): {\n data?: PurifiedCheckoutHistoryItem[]\n isLoading: boolean\n} {\n const { apiKey, userId: identityUserId } = useFunkitIdentity()\n const { listRefresh } = useDynamicConfig(\n 'checkoutnotificationsrefreshinterval',\n )\n\n const resolvedUserId = userId ?? identityUserId\n const effectiveUserId = resolvedUserId === '0x' ? '' : resolvedUserId\n\n const { data, isLoading } = useQuery({\n enabled: !!effectiveUserId,\n queryKey: ['getPurifiedCheckoutsByUserId', effectiveUserId],\n queryFn: async () => {\n const [checkouts, directExecutions] = await Promise.all([\n getCheckoutsByUserId({\n apiKey,\n logger,\n userId: effectiveUserId,\n limit: CHECKOUT_HISTORY_HOOK_LIMIT,\n }),\n getDirectExecutionsByUserId({\n apiKey,\n logger,\n userId: effectiveUserId,\n limit: CHECKOUT_HISTORY_HOOK_LIMIT,\n }),\n ])\n\n return [...checkouts, ...directExecutions]\n .map(purifyCheckoutHistoryItem)\n .sort((a, b) => b.createdTimeMs - a.createdTimeMs)\n .slice(0, CHECKOUT_HISTORY_HOOK_LIMIT)\n },\n refetchInterval: listRefresh,\n })\n\n return { data, isLoading }\n}\n"],
5
+ "mappings": ";AA0JO,SAAS,oBACd,QACA,WACQ;AACR,SAAO,GAAG,MAAM,IAAI,SAAS;AAC/B;AAGO,IAAM,wBAGT;AAAA,EACF,SAAS;AAAA,EACT,QAAQ;AACV;AAEO,IAAM,cAA4B;AAAA,EACvC,YAAY;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,SAAS,EAAE,SAAS,WAAW,SAAS,UAAU;AAAA,MAClD,WAAW,EAAE,SAAS,WAAW,SAAS,UAAU;AAAA,MACpD,UAAU,EAAE,SAAS,WAAW,SAAS,UAAU;AAAA,MACnD,MAAM,EAAE,SAAS,WAAW,SAAS,UAAU;AAAA,MAC/C,aAAa;AAAA,QACX,SAAS;AAAA,QACT,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,MAAM,EAAE,SAAS,WAAW,SAAS,WAAW,UAAU,UAAU;AAAA,EACtE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,CAAC;AAAA,QACD,4BAA4B;AAAA,UAC1B;AAAA,UACA;AAAA,UACA,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,aAAO,CAAC,GAAG,WAAW,GAAG,gBAAgB,EACtC,IAAIC,0BAAyB,EAC7B,KAAK,CAAC,GAAG,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAChD,MAAM,GAAG,2BAA2B;AAAA,IACzC;AAAA,IACA,iBAAiB;AAAA,EACnB,CAAC;AAED,SAAO,EAAE,MAAM,UAAU;AAC3B;",
6
+ "names": ["fallback", "Text", "useMemo", "useState", "useState", "useMemo", "useEffect", "useMemo", "useRef", "BottomSheetBackdrop", "BottomSheetModal", "BottomSheetView", "useStatsigClient", "createContext", "useCallback", "useContext", "useEffect", "useMemo", "useRef", "useState", "StyleSheet", "View", "useSafeAreaInsets", "useEffect", "useMemo", "useMemo", "useEffect", "useEffect", "useState", "jsx", "useState", "useEffect", "SvgXml", "jsx", "jsx", "SvgXml", "jsx", "createContext", "useContext", "useEffect", "useMemo", "useState", "jsx", "createContext", "useState", "useEffect", "useMemo", "useContext", "SvgXml", "jsx", "SvgXml", "jsx", "SvgXml", "jsx", "SvgXml", "jsx", "SvgXml", "jsx", "toIconUri", "jsx", "jsxs", "useEffect", "useState", "jsx", "jsx", "jsxs", "t", "useState", "useEffect", "useRef", "useState", "Pressable", "ScrollView", "jsx", "jsxs", "useState", "useRef", "topBar", "ScrollView", "listContent", "row", "iconRing", "Pressable", "Pressable", "StyleSheet", "jsx", "jsxs", "styles", "Pressable", "StyleSheet", "useEffect", "useRef", "useState", "Pressable", "useWindowDimensions", "SvgXml", "jsx", "SvgXml", "jsx", "jsxs", "useState", "useRef", "useEffect", "topBar", "topBarSpacer", "Pressable", "buttonContainer", "useEffect", "useRef", "useState", "Pressable", "useSafeAreaInsets", "useEffect", "useState", "Pressable", "Animated", "Easing", "jsx", "jsxs", "toIconUri", "useState", "useEffect", "AnimatedPressable", "Animated", "Pressable", "Easing", "jsx", "jsxs", "useSafeAreaInsets", "useState", "useRef", "useEffect", "topBar", "Pressable", "content", "addressGroup", "addressText", "jsx", "useCallback", "useCallback", "useTheme", "useCallback", "useEffect", "useMemo", "useRef", "View", "content", "jsx", "useRef", "useMemo", "useTheme", "useEffect", "useCallback", "View", "jsx", "useCallback", "sheet", "jsx", "useCallback", "useCallback", "jsx", "useCallback", "isEvmChainId", "getConfiguredMinDepositUsd", "useTheme", "useQuery", "useMemo", "createContext", "useContext", "jsx", "createContext", "useContext", "useQuery", "useMemo", "useQuery", "useTheme", "useMemo", "getConfiguredMinDepositUsd", "useQuery", "getFops", "DEFAULT_FIAT_CURRENCY", "FOPS_STALE_TIME", "buildSwappedThirdPartyPaymentConfigs", "sortFops", "useSwappedDefaultCurrencyQuery", "useTheme", "useQuery", "useMemo", "useMemo", "useQuery", "getFops", "buildSwappedThirdPartyPaymentConfigs", "sortFops", "DEFAULT_FIAT_CURRENCY", "useSwappedDefaultCurrencyQuery", "useTheme", "FOPS_STALE_TIME", "useCallback", "useRef", "useRef", "useCallback", "useQuery", "useMemo", "useQuery", "useMemo", "solanaChain", "getDepositAddressForChain", "solanaChain", "getDepositAddressForChain", "jsx", "StyleSheet", "Animated", "Easing", "Keyframe", "jsx", "jsxs", "Keyframe", "Easing", "Animated", "styles", "StyleSheet", "useCallback", "useEffect", "useRef", "View", "Easing", "useSafeAreaInsets", "useEffect", "useState", "jsx", "jsxs", "content", "useRef", "useCallback", "useSafeAreaInsets", "useEffect", "Easing", "View", "Fragment", "jsx", "jsxs", "createContext", "copyToClipboard", "useSafeAreaInsets", "useState", "useCallback", "useMemo", "useRef", "useEffect", "View", "isEvmChainId", "useStatsigClient", "screen", "BottomSheetBackdrop", "row", "BottomSheetModal", "BottomSheetView", "StyleSheet", "useContext", "useMemo", "Platform", "jsx", "useMemo", "jsx", "copyToClipboard", "useRef", "useMemo", "useEffect", "useCallback", "useCallback", "useMemo", "useMemo", "purifyCheckoutHistoryItem", "useQuery", "useQuery", "purifyCheckoutHistoryItem"]
7
7
  }