@funkit/connect-rn 0.0.0-20260710210119

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 (131) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/README.md +220 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +4158 -0
  6. package/dist/index.js.map +7 -0
  7. package/dist/src/flow/AddressCopiedToast.d.ts +18 -0
  8. package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -0
  9. package/dist/src/flow/FlowSheet.d.ts +47 -0
  10. package/dist/src/flow/FlowSheet.d.ts.map +1 -0
  11. package/dist/src/flow/FunkitFlowProvider.d.ts +23 -0
  12. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -0
  13. package/dist/src/flow/depositFlowConfig.d.ts +101 -0
  14. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -0
  15. package/dist/src/flow/useKeyboardHeight.d.ts +21 -0
  16. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -0
  17. package/dist/src/geo/isCountryBlocked.d.ts +3 -0
  18. package/dist/src/geo/isCountryBlocked.d.ts.map +1 -0
  19. package/dist/src/geo/useCheckoutBlocked.d.ts +10 -0
  20. package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -0
  21. package/dist/src/geo/useUserIpInfo.d.ts +22 -0
  22. package/dist/src/geo/useUserIpInfo.d.ts.map +1 -0
  23. package/dist/src/icons/CopyAddressIcon.d.ts +9 -0
  24. package/dist/src/icons/CopyAddressIcon.d.ts.map +1 -0
  25. package/dist/src/icons/CryptoBitcoinIcon.d.ts +9 -0
  26. package/dist/src/icons/CryptoBitcoinIcon.d.ts.map +1 -0
  27. package/dist/src/icons/CryptoTransferQRIcon.d.ts +9 -0
  28. package/dist/src/icons/CryptoTransferQRIcon.d.ts.map +1 -0
  29. package/dist/src/icons/FigmaSystemIcons.d.ts +19 -0
  30. package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -0
  31. package/dist/src/icons/FunIcon.d.ts +18 -0
  32. package/dist/src/icons/FunIcon.d.ts.map +1 -0
  33. package/dist/src/icons/PaymentBrandIcons.d.ts +24 -0
  34. package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -0
  35. package/dist/src/icons/QrChainCluster.d.ts +22 -0
  36. package/dist/src/icons/QrChainCluster.d.ts.map +1 -0
  37. package/dist/src/icons/SourceTokenCluster.d.ts +31 -0
  38. package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -0
  39. package/dist/src/icons/TokenChainIcon.d.ts +19 -0
  40. package/dist/src/icons/TokenChainIcon.d.ts.map +1 -0
  41. package/dist/src/icons/assetLogos.d.ts +12 -0
  42. package/dist/src/icons/assetLogos.d.ts.map +1 -0
  43. package/dist/src/icons/funIconUri.d.ts +16 -0
  44. package/dist/src/icons/funIconUri.d.ts.map +1 -0
  45. package/dist/src/identity/IdentityContext.d.ts +52 -0
  46. package/dist/src/identity/IdentityContext.d.ts.map +1 -0
  47. package/dist/src/logging/consoleLogTransport.d.ts +10 -0
  48. package/dist/src/logging/consoleLogTransport.d.ts.map +1 -0
  49. package/dist/src/logging/datadogHttpLogTransport.d.ts +46 -0
  50. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -0
  51. package/dist/src/logging/logger.d.ts +9 -0
  52. package/dist/src/logging/logger.d.ts.map +1 -0
  53. package/dist/src/providers/FunkitProvider.d.ts +65 -0
  54. package/dist/src/providers/FunkitProvider.d.ts.map +1 -0
  55. package/dist/src/providers/FunkitStatsigProvider.d.ts +13 -0
  56. package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -0
  57. package/dist/src/providers/useFunkitCheckout.d.ts +14 -0
  58. package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -0
  59. package/dist/src/screens/AddMoneyScreen.d.ts +86 -0
  60. package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -0
  61. package/dist/src/screens/AvailableChainsScreen.d.ts +33 -0
  62. package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -0
  63. package/dist/src/screens/CheckoutBlockedScreen.d.ts +2 -0
  64. package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -0
  65. package/dist/src/screens/NetworkSelector.d.ts +31 -0
  66. package/dist/src/screens/NetworkSelector.d.ts.map +1 -0
  67. package/dist/src/screens/QrCodeScreen.d.ts +42 -0
  68. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -0
  69. package/dist/src/screens/TransferCryptoScreen.d.ts +40 -0
  70. package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -0
  71. package/dist/src/statsig/StatsigClientRN.d.ts +6 -0
  72. package/dist/src/statsig/StatsigClientRN.d.ts.map +1 -0
  73. package/dist/src/statsig/StatsigProviderRN.d.ts +7 -0
  74. package/dist/src/statsig/StatsigProviderRN.d.ts.map +1 -0
  75. package/dist/src/statsig/appVisibilityShim.d.ts +2 -0
  76. package/dist/src/statsig/appVisibilityShim.d.ts.map +1 -0
  77. package/dist/src/statsig/preloadedAsyncStorage.d.ts +3 -0
  78. package/dist/src/statsig/preloadedAsyncStorage.d.ts.map +1 -0
  79. package/dist/src/statsig/rnSetup.d.ts +3 -0
  80. package/dist/src/statsig/rnSetup.d.ts.map +1 -0
  81. package/dist/src/statsig/statsigMetadata.d.ts +2 -0
  82. package/dist/src/statsig/statsigMetadata.d.ts.map +1 -0
  83. package/dist/src/statsig/useClientAsyncInitRN.d.ts +7 -0
  84. package/dist/src/statsig/useClientAsyncInitRN.d.ts.map +1 -0
  85. package/dist/src/statsig/useClientBootstrapInitRN.d.ts +4 -0
  86. package/dist/src/statsig/useClientBootstrapInitRN.d.ts.map +1 -0
  87. package/dist/src/swapped/SwappedScreen.d.ts +21 -0
  88. package/dist/src/swapped/SwappedScreen.d.ts.map +1 -0
  89. package/dist/src/swapped/SwappedWebView.d.ts +18 -0
  90. package/dist/src/swapped/SwappedWebView.d.ts.map +1 -0
  91. package/dist/src/swapped/buildSwappedTheme.d.ts +31 -0
  92. package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -0
  93. package/dist/src/swapped/webViewSwappedTransport.d.ts +74 -0
  94. package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -0
  95. package/dist/src/theme/FunkitThemeProvider.d.ts +50 -0
  96. package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -0
  97. package/dist/src/theme/restyle.d.ts +5606 -0
  98. package/dist/src/theme/restyle.d.ts.map +1 -0
  99. package/dist/src/theme/toRestyleTheme.d.ts +490 -0
  100. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -0
  101. package/dist/src/theme/tokens.d.ts +159 -0
  102. package/dist/src/theme/tokens.d.ts.map +1 -0
  103. package/dist/src/theme/useColorScheme.d.ts +25 -0
  104. package/dist/src/theme/useColorScheme.d.ts.map +1 -0
  105. package/dist/src/theme/useFunkitTheme.d.ts +29 -0
  106. package/dist/src/theme/useFunkitTheme.d.ts.map +1 -0
  107. package/dist/src/transfer/QrCode.d.ts +24 -0
  108. package/dist/src/transfer/QrCode.d.ts.map +1 -0
  109. package/dist/src/transfer/availableChains.d.ts +53 -0
  110. package/dist/src/transfer/availableChains.d.ts.map +1 -0
  111. package/dist/src/transfer/clipboard.d.ts +23 -0
  112. package/dist/src/transfer/clipboard.d.ts.map +1 -0
  113. package/dist/src/transfer/fops.d.ts +26 -0
  114. package/dist/src/transfer/fops.d.ts.map +1 -0
  115. package/dist/src/transfer/formatDepositAddress.d.ts +9 -0
  116. package/dist/src/transfer/formatDepositAddress.d.ts.map +1 -0
  117. package/dist/src/transfer/hooks/useFops.d.ts +47 -0
  118. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -0
  119. package/dist/src/transfer/hooks/useSupportedTokens.d.ts +26 -0
  120. package/dist/src/transfer/hooks/useSupportedTokens.d.ts.map +1 -0
  121. package/dist/src/transfer/hooks/useTokenTransfer.d.ts +33 -0
  122. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -0
  123. package/dist/src/transfer/hooks/useTransferInit.d.ts +27 -0
  124. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -0
  125. package/dist/src/transfer/hooks/useUDAParams.d.ts +9 -0
  126. package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -0
  127. package/dist/src/transfer/supportedTokens.d.ts +34 -0
  128. package/dist/src/transfer/supportedTokens.d.ts.map +1 -0
  129. package/dist/src/version.d.ts +2 -0
  130. package/dist/src/version.d.ts.map +1 -0
  131. package/package.json +109 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,350 @@
1
+ # @funkit/connect-rn
2
+
3
+ ## 0.0.0-20260710210119
4
+
5
+ ### Major Changes
6
+
7
+ - 640371e: Add an `exports` map (root entry only) and replace `export * from '@funkit/connect-core'` with the curated managed API plus the core types that appear in this package's public signatures (`CheckoutTokenTransferConfig`, `DynamicTargetAssetCandidate`).
8
+
9
+ Breaking: deep `dist/**` imports no longer resolve, and the RN entry no longer re-exports the whole `@funkit/connect-core`. Import core symbols from `@funkit/connect-core` directly.
10
+
11
+ ### Patch Changes
12
+
13
+ - b8a3f1e: Ship the full `dist` tree and `CHANGELOG.md` in the published tarball. `@funkit/connect-core` previously listed only `dist/index.js` in `files`, so any future code-split chunk (`dist/chunk-*.js`, emitted once a dynamic `import()` is added under `splitting: true`) would have been silently excluded from the package. Both packages now publish their changelog too.
14
+ - Updated dependencies [b2abbb5]
15
+ - Updated dependencies [b8a3f1e]
16
+ - @funkit/connect-core@0.0.0-20260710210119
17
+
18
+ ## 1.0.11
19
+
20
+ ### Patch Changes
21
+
22
+ - d58690c: Remove dead vendored code: `StatsigProviderRN`, `useClientBootstrapInitRN`, and `ConsoleLogTransport`. These were unreferenced internally and never exported from the public barrel (Statsig RN bindings and logging transports are intentionally internal). The active Statsig path uses `useClientAsyncInitRN` + `StatsigClientRN`, and logging ships via `datadogHttpLogTransport`.
23
+ - d442c9b: Set a 60s staleTime on the internally-created fallback QueryClient to avoid refetching on every remount
24
+ - Updated dependencies [8ae9a55]
25
+ - @funkit/connect-core@1.7.1
26
+
27
+ ## 1.0.10
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [6ae84b0]
32
+ - Updated dependencies [a074ecf]
33
+ - @funkit/connect-core@1.7.0
34
+
35
+ ## 1.0.9
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [7636095]
40
+ - @funkit/connect-core@1.6.2
41
+
42
+ ## 1.0.8
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [cac2d42]
47
+ - Updated dependencies [4b8c04b]
48
+ - Updated dependencies [79c92ec]
49
+ - Updated dependencies [16cc96f]
50
+ - Updated dependencies [4c446f9]
51
+ - Updated dependencies [d27111c]
52
+ - @funkit/connect-core@1.6.1
53
+ - @funkit/chains@2.1.3
54
+ - @funkit/api-base@6.0.0
55
+
56
+ ## 1.0.7
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [ec71a28]
61
+ - Updated dependencies [2d5650d]
62
+ - @funkit/chains@2.1.2
63
+ - @funkit/connect-core@1.6.0
64
+
65
+ ## 1.0.6
66
+
67
+ ### Patch Changes
68
+
69
+ - 99812aa: feat(withdrawal): resolve token addresses from config, drop the per-symbol API lookup
70
+
71
+ The withdrawal screen no longer resolves token addresses with a `getAssetErc20ByChainAndSymbol` round-trip; the addresses already live in config.
72
+
73
+ - `@funkit/connect-core`: `resolveTokenTransferConfig` adds `addressBySymbolByChainId` (`chainId → symbol/alias → original-case address`), preserving casing (checksummed EVM, base58 Solana/Tron).
74
+ - `@funkit/connect`: `WithdrawalContent` reads the destination address from that map and the Lighter Secure source address from a hardcoded map in `LighterWithdrawal.tsx`, pricing both via `useAssetAddressPrice`. Removes all `useAssetSymbolPrice` usage from the withdrawal flow (hooks left for a follow-up cleanup).
75
+ - `@funkit/connect-rn`: test-only fixture update.
76
+
77
+ - Updated dependencies [a395c4c]
78
+ - Updated dependencies [c3d2458]
79
+ - Updated dependencies [ce05191]
80
+ - Updated dependencies [b8a7aaa]
81
+ - Updated dependencies [202c15b]
82
+ - Updated dependencies [99812aa]
83
+ - @funkit/api-base@5.2.0
84
+ - @funkit/connect-core@1.5.0
85
+
86
+ ## 1.0.5
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [394a46c]
91
+ - @funkit/api-base@5.1.0
92
+ - @funkit/connect-core@1.4.1
93
+
94
+ ## 1.0.4
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [86d2a31]
99
+ - Updated dependencies [b8c578e]
100
+ - @funkit/connect-core@1.4.0
101
+
102
+ ## 1.0.3
103
+
104
+ ### Patch Changes
105
+
106
+ - ae17d2a: fix(connect-rn): move "Address copied" toast 80px from top of screen
107
+ - bb08629: docs: rewrite the `@funkit/connect-rn` README as a developer guide (architecture, peer dependencies, Expo Go compatibility, local build/test workflow) and repoint the in-code doc comments (`connect-rn`/`connect-core` `index.ts`, `LogTransport`) from the retired `docs/connect-rn-architecture.md` design doc to it. Client/integration usage of the SDK is maintained in Notion. Comment/doc only — no API or behavior changes.
108
+ - Updated dependencies [fc74160]
109
+ - Updated dependencies [bb08629]
110
+ - Updated dependencies [639d776]
111
+ - Updated dependencies [23ec218]
112
+ - Updated dependencies [09452ce]
113
+ - Updated dependencies [cd57fba]
114
+ - @funkit/api-base@5.0.0
115
+ - @funkit/connect-core@1.3.0
116
+
117
+ ## 1.0.2
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [f64e821]
122
+ - @funkit/connect-core@1.2.0
123
+
124
+ ## 1.0.1
125
+
126
+ ### Patch Changes
127
+
128
+ - e98d6c6: fix(connect-rn): uniform 6px spacing between deposit address card elements
129
+ - Updated dependencies [5d5d4f5]
130
+ - @funkit/connect-core@1.1.1
131
+
132
+ ## 1.0.0
133
+
134
+ ### Major Changes
135
+
136
+ - 304fbdd: Derive Add money payment methods + crypto source icons internally; rename `DepositFlowConfig.selectedChainId` to `sourceChain` (string).
137
+
138
+ ### Minor Changes
139
+
140
+ - cb5d3c4: Render the managed deposit flow in a `@gorhom/bottom-sheet`, sized to its content. `@gorhom/bottom-sheet`, `react-native-gesture-handler`, and `react-native-reanimated` are now **required** peer deps, and the app root must be wrapped in `<GestureHandlerRootView>`.
141
+ - 80f3acd: Add geoblocked checkout screen to the deposit flow
142
+ - 219a880: Add the `ChooseChainScreen` (Figma: Fun Mobile / Transfer Crypto chain list) — shown when the user taps "Change" on the Transfer screen. A themed bottom-sheet surface with back + centered title + a list of chains (EVM Chains, Solana, Tron, Bitcoin, …). Data-driven via `chains: ChainOption[]` + `onSelectChain`; chain icons are host-supplied (`icon`), keeping the package `react-native-svg`-free. Exported as public API. Navigation (Change → this screen → back with the chosen chain) is wired by the host via the existing `onChangeNetwork` / `onSelectChain` callbacks.
143
+ - ea84a30: Default the connect-rn theme to the **system** UI font (SF on iOS, Roboto on Android) instead of Inter, so the package renders correctly with no font assets registered by the host. connect-rn is now fully font-agnostic — it ships no typeface and no font preset; hosts that want a custom font (e.g. Inter) define their own `fonts` tokens and register the matching files.
144
+
145
+ BREAKING: the `FUNKIT_REQUIRED_FONTS` export is removed — connect-rn no longer requires any host-registered fonts by default. Migration: to keep rendering in Inter, define your own font tokens in the host app and build your theme with them:
146
+
147
+ ```ts
148
+ import {
149
+ type FunkitFontTokens,
150
+ fontFamilyForWeight,
151
+ lightTokens,
152
+ toRestyleTheme,
153
+ } from "@funkit/connect-rn";
154
+
155
+ const interFonts: FunkitFontTokens = {
156
+ family: "Inter",
157
+ weights: {
158
+ base: { familySuffix: "Regular", cssWeight: "400" },
159
+ medium: { familySuffix: "Medium", cssWeight: "500" },
160
+ },
161
+ };
162
+
163
+ const theme = toRestyleTheme({ ...lightTokens, fonts: interFonts });
164
+ // register assets under fontFamilyForWeight(interFonts, 'base'|'medium')
165
+ // ('Inter-Regular' / 'Inter-Medium') — the replacement for FUNKIT_REQUIRED_FONTS
166
+ ```
167
+
168
+ - 827fece: Add fluid animations across the deposit flow (bottom-sheet resize, deposit-to dropdown, and network selector) plus an animated address-copied toast exposed as the new `AddressCopiedToast` component.
169
+ - 8ea4b32: Wire the transfer screens into a managed flow behind a web-SDK-style API. `useFunkitCheckout()` now returns `beginDeposit(config)` (mirroring `@funkit/connect`'s `useFunkitCheckout`/`beginCheckout`): it opens the SDK's own bottom-sheet modal and runs the flow — Add money → Transfer/UDA → Choose chain / Supported tokens / QR — so host apps render no screens themselves. The five screens, the Statsig RN bindings, logging, identity context, and transfer hooks are all internal now; the public surface is `FunkitProvider` + `useFunkitCheckout` (+ the `DepositFlowConfig` item shapes). For this release the host supplies the flow's data via `DepositFlowConfig`; sourcing it internally (api-base / chains / Statsig / `useTransferInit`) and CDN icons are follow-ups (see TODOs).
170
+ - 2e663b9: Render Inter correctly by selecting weights through per-cut font families (`FUNKIT_REQUIRED_FONTS` is now `{ base: 'Inter-Regular', medium: 'Inter-Medium' }` — register each name) and align body text line heights with Figma.
171
+ - 219a880: Add the `QrCodeScreen` (Figma: Fun Mobile / qr-code-modal) — the full-screen deposit QR view reached from the Transfer screen's QR button. A themed surface with a close action, the framed QR code, a "Scan to deposit … / use it only for supported chains" caption (with an optional tappable link), and a share button. The scannable QR is host-supplied via the `qrCode` slot (e.g. `react-native-qrcode-svg`), so the package stays `react-native-svg`-free. Exported as public API.
172
+ - 649a519: Add the `SupportedTokensScreen` (Figma: Fun Mobile / Supported tokens) — shown from the Transfer screen's chain-name / info affordance. Back + title, a search field, horizontally-scrolling chain filter chips (All / Ethereum / BSC / …), and the token list (icon + symbol + chain). Controlled/presentational: the search value, selected chip, and the (host-filtered) `tokens` list come from props; token icons are host-supplied, keeping the package `react-native-svg`-free. The search input's colors follow the active theme via Restyle's `useTheme`. Exported as public API.
173
+ - 827fece: Refine the deposit flow screens and add an optional `overflowMode` to `SourceTokenCluster` and `initialDropdownOpen` to `AddMoneyScreen`.
174
+ - dd362c9: Redesign the deposit-flow screens (Add money, Transfer Crypto, QR code) and add an "Available chains" screen — the selected network's chains with per-chain minimum-deposit amounts (from `mintokentransfervalue`, mirroring web). Wire copy/share (clipboard via `expo-clipboard`, falling back to `@react-native-clipboard/clipboard`) and add an on-device Storybook harness. Pin react to 19.2.3 to match the RN 0.85 renderer.
175
+
176
+ The Transfer-screen network switcher is now derived internally from the curated chain list (`tokentransferconfig`) instead of being host-configured: the `depositChains` field was removed from `DepositFlowConfig`. Every EVM chain collapses into one "EVM Chains" segment and each non-EVM chain (Solana / Tron / Bitcoin) is its own segment; `selectedChainId` still picks the initially-selected network.
177
+
178
+ ### Patch Changes
179
+
180
+ - 15d1159: Fix a gray rectangular border around the deposit-address card on Android. The card had an `elevation` shadow but no opaque background, so Android couldn't clip the shadow to the card's rounded corners. Giving it a `bgModal` background clips the elevation shadow correctly.
181
+ - 57e49a8: Align the modal close buttons across the Transfer, QR, and Available chains screens (24px inset, 56px touch target).
182
+ - f288caf: Paint the deposit-flow bottom sheet's surface (matching each screen's `bgModal` + rounded top) and extend it below the content so dragging the sheet above its content height reveals more surface instead of the backdrop — the elastic over-drag no longer exposes the sheet's bottom edge.
183
+ - 827fece: Center each chain logo within its circular ring in `SourceTokenCluster` and `AvailableChainsScreen` so the icon border no longer offsets the logo by 1px.
184
+ - be6e6cf: Add a `copyToClipboard` override on FunkitProvider so hosts can supply their own clipboard (e.g. expo-clipboard in Expo Go); the default still lazily loads @react-native-clipboard/clipboard
185
+ - a9f9769: Hold the Add money loading state until the geo-eligibility check and the deposit-address/QR generation both resolve, so the deposit UI no longer flashes before a blocked user is routed away or before the address is ready.
186
+ - f4a74f1: Fix off-center chain logos with a visible gray ring in the Transfer Crypto network selector. The logos were wrapped in a bordered box the same size as the icon, whose 1px inset shrank and offset the logo and exposed the border as a ring. `FunIcon` already clips each logo to a centered circle, so the wrapping rings are removed and the logos render full-bleed, matching Figma.
187
+ - ea4b6af: Match the source-token overflow chips to Figma: a centered "+" icon on the Add money row and a circular "+N" count chip on Transfer (previously a mis-centered text "+" in an oval).
188
+ - 9fc8470: Show the full deposit address with a Copy button below the QR on the QR-code screen
189
+ - 4a0aff8: Add a white quiet-zone backing behind the QR chain-logo cluster so the QR no longer bleeds through
190
+ - 827fece: Render the deposit QR with a fixed dark color so it stays scannable (dark-on-light) in dark mode.
191
+ - beb3c84: Add the shared `useSwappedDefaultCurrencyQuery` hook to `@funkit/connect-core` and use it in `@funkit/connect-rn` to resolve the Swapped deposit flow's default fiat currency from the user's region instead of hardcoding USD.
192
+ - 40b8f2d: Show the minimum deposit on the Transfer screen for single-chain networks (Solana / Tron / Bitcoin) instead of a non-navigable chain-logo chevron.
193
+ - af9e919: Open the keyboard automatically in the Swapped deposit flow and slide the bottom sheet above it instead of shrinking.
194
+ - d5f375e: Fix copy-address toast blocking all sheet button taps for ~2s — replace the native `<Modal>` (which captures all touches even when transparent) with an absolutely-positioned `View` rendered above the gorhom sheet via sibling z-ordering.
195
+ - 7eefd13: Show a back arrow (not a close X) on the Transfer Crypto screen's leading button, since it returns to the Add money screen.
196
+ - 3fb075a: feat(connect-rn): update styles for transfer crypto, add money and qr code screens to match figma designs
197
+ - 55c21d3: fix(connect-rn): expand swapped theme variables to fix continue button text color
198
+ - Updated dependencies [827fece]
199
+ - Updated dependencies [beb3c84]
200
+ - Updated dependencies [79f4b01]
201
+ - Updated dependencies [79f4b01]
202
+ - Updated dependencies [79f4b01]
203
+ - Updated dependencies [c90915d]
204
+ - Updated dependencies [389a29d]
205
+ - Updated dependencies [32d1cc6]
206
+ - @funkit/connect-core@1.1.0
207
+ - @funkit/chains@2.1.1
208
+
209
+ ## 0.2.0-next.0
210
+
211
+ ### Minor Changes
212
+
213
+ - 67ce912: Show real, fetched payment methods on the Add money screen, replacing the
214
+ hardcoded list. When Swapped is enabled (`enableswappeddeposit`), the screen
215
+ renders a single flat list (no Crypto/Cash tabs — mobile has no such design):
216
+ the user's saved forms of payment on top, then the **Crypto** (Transfer Crypto)
217
+ row, then the generic Swapped FOPs (Card / Apple Pay / Revolut Pay / Bank
218
+ Transfer), matching the Figma order. FOP rows come from `useFops` via the pure
219
+ `toFopRows` (CDN icon + `"<limit> limit"` subtitle, with `" · 1-2 days"` for
220
+ bank transfers). When Swapped is off, the screen keeps the host's configured
221
+ methods.
222
+
223
+ Selecting a FOP is a no-op stub pending the Swapped WebView (handed off there
224
+ once it lands). Connect Exchange (Bluvo) and virtual-bank/SEPA are out of this
225
+ V1.
226
+
227
+ - b0526d6: Add the `AddMoneyScreen` funding-source picker (Figma: Fun Mobile / Add money) — the payment-method selection step that precedes the Transfer/UDA screen. A themed bottom-sheet surface (grabber + centered title + scrollable list of methods) built from the connect-rn Restyle primitives, so it tracks the active light/dark scheme. Data-driven via `methods: PaymentMethodOption[]` + `onSelectMethod`; brand icons are host-supplied (`icon` / `trailing`), keeping the package asset- and `react-native-svg`-free. Exported as part of the public API (screens are the consumer surface).
228
+ - fa32433: Reflect the selected chain on the Transfer screen. Picking a different chain on the choose-chain screen now updates the network **label**, the network **icon**, and the generated **deposit address + QR** on the Transfer screen — previously they stayed fixed on the initial (EVM) chain. The flow tracks the selected `ChainOption` and derives the label/icon from it (falling back to the config defaults), and the selected chain's `chainId` drives which generated address + QR type is shown. The `with-expo` demo now sets `chainId` on every chain (EVM/Solana/Tron/Bitcoin) so switching actually changes the address.
229
+ - 169af7e: Add the `ChooseChainScreen` (Figma: Fun Mobile / Transfer Crypto chain list) — shown when the user taps "Change" on the Transfer screen. A themed bottom-sheet surface with back + centered title + a list of chains (EVM Chains, Solana, Tron, Bitcoin, …). Data-driven via `chains: ChainOption[]` + `onSelectChain`; chain icons are host-supplied (`icon`), keeping the package `react-native-svg`-free. Exported as public API. Navigation (Change → this screen → back with the chosen chain) is wired by the host via the existing `onChangeNetwork` / `onSelectChain` callbacks.
230
+ - 95fe691: Make the Transfer screen's copy and share buttons actually work. The buttons showed a "Copied!" confirmation but never wrote to the clipboard, because the managed flow didn't pass `onCopyAddress`/`onShareAddress`. The flow now copies the **full** deposit address (the screen only shows it truncated) via `@react-native-clipboard/clipboard` and shares it via React Native's built-in `Share`. Adds `@react-native-clipboard/clipboard >=1.13.0` as a peer dependency.
231
+
232
+ The clipboard peer is loaded **lazily and guarded**: a host that hasn't linked the native module (an un-rebuilt dev client, Expo Go, or a consumer that didn't install the peer) degrades to a no-op + warning instead of crashing at startup with the `'RNCClipboard' could not be found` TurboModule invariant.
233
+
234
+ - c21ded0: Fix Datadog logging never reaching the transport. The `FunLogger` queues every record until `logger.configure(...)` is called, and connect-rn never called it — so nothing was ever shipped to Datadog. `FunkitProvider` now configures the logger with the `config.apiKey` + debug flag (mirroring the web SDK) and sets user context, so queued logs flush and records emit to the Datadog HTTP transport in production. The SDK version is inlined at build time (`src/version.ts`) and sent as the log `sdkVersion`.
235
+
236
+ Also changes the default Datadog `service` tag from `connect-rn-sdk` to `connect-rn`.
237
+
238
+ - 57d7a5c: Generate the deposit address and QR code inside the managed deposit flow. Given a `checkoutConfig` (target chain + asset) on the flow config and identity on `<FunkitProvider>`, the flow now resolves the Universal Deposit Address and EIP-681 QR URI via the transfer hooks and renders the QR with `react-native-qrcode-svg` — no longer host-supplied.
239
+
240
+ - `<FunkitProvider>` gains `config` (`{ apiKey, externalUserId? }`, mirroring the identity-relevant subset of the web SDK's `funkitConfig`), `walletAddress` (the connected address — web reads this from wagmi; RN has no wallet provider so the host passes it), and an optional `queryClient` (defaults to an internal one). It now mounts `QueryClientProvider` + the identity context internally, so transfer queries run under a single provider. `userId` is resolved web-style (`apiKey|externalUserId`, else the wallet address).
241
+ - `DepositFlowConfig`: adds `checkoutConfig`, `selectedChainId`, and `dynamicRoutingId`; `depositAddress` and `qrCode` become optional host overrides/fallbacks (shown while generation loads or when no identity is configured). The displayed address is truncated by the flow.
242
+ - `ChainOption` gains `chainId` — picking a chain on the choose-chain screen now updates the active chain so the generated address + QR match the selected network.
243
+ - Adds `react-native-qrcode-svg >=6.3.0` as a peer dependency (renders via the `react-native-svg` peer already added for CDN icons).
244
+
245
+ - 399eede: Wire the transfer screens into a managed flow behind a web-SDK-style API. `useFunkitCheckout()` now returns `beginDeposit(config)` (mirroring `@funkit/connect`'s `useFunkitCheckout`/`beginCheckout`): it opens the SDK's own bottom-sheet modal and runs the flow — Add money → Transfer/UDA → Choose chain / Supported tokens / QR — so host apps render no screens themselves. The five screens, the Statsig RN bindings, logging, identity context, and transfer hooks are all internal now; the public surface is `FunkitProvider` + `useFunkitCheckout` (+ the `DepositFlowConfig` item shapes). For this release the host supplies the flow's data via `DepositFlowConfig`; sourcing it internally (api-base / chains / Statsig / `useTransferInit`) and CDN icons are follow-ups (see TODOs).
246
+ - 0cdbc22: Add `useFops` + `toFopRows` for fetching Swapped forms of payment (Card / Apple
247
+ Pay / Google Pay / Bank Transfer) — a thin RN port of web's `useFops` (`getFops`).
248
+ Identity comes from `useFunkitIdentity`; the deposit recipient is derived from
249
+ `useTransferInit` + the core `getDepositAddressForChain`. `toFopRows` is the pure
250
+ mapping to display rows (label + CDN icon + `"<limit> limit • <time>"` subtitle,
251
+ coming-soon FOPs disabled).
252
+
253
+ Adaptations vs. web: **no geo-fencing** — the country code and `useFunkitUserIp`
254
+ gating are dropped (`countryCode` is optional on `GetFopsParams`), so FOPs are
255
+ fetched regardless of region. The Swapped theme query params, EUR min-amount,
256
+ saved-currency lookup, and exchange-rate-based limits are deferred (limits fall
257
+ back to the default). These are internal — wired into the Add money cash tab in a
258
+ follow-up.
259
+
260
+ - b86fed9: Resolve the user's real country for the Swapped cash methods. Adds `useUserIpInfo`
261
+ — a React Native port of web's hook that resolves the user's country (ISO
262
+ alpha-2) + region from their IP via Moonpay's IP endpoint (primary) with an
263
+ ipapi.co fallback (plain `fetch`, no native modules). `useFops` now sends this
264
+ real country to `/fops` instead of the hardcoded default, so Swapped lists the
265
+ correct region's payment methods; the default is kept only as a fallback while
266
+ the lookup is in flight or if it fails. Geo-lookup failures log at WARN (the
267
+ flow degrades gracefully).
268
+
269
+ Per-region geoblocking (comparing the country against the `blockedcountries`
270
+ Statsig config and disabling methods for blocked regions, like web's
271
+ `isUserGeoblocked`) is the remaining follow-up.
272
+
273
+ - b40be1c: Fix chain logos that were missing or mis-positioned (e.g. Tron invisible, Solana/Bitcoin squashed into a corner). `FunIcon` previously injected a fixed `viewBox="0 0 28 28"` onto every CDN SVG, which clobbered the viewBox that some logos already ship (Solana 16×16, Tron `138.8 49.5 522 500.2`) — pushing their artwork off-screen or into a corner. `FunIcon` now fetches each SVG and **synthesizes a viewBox only when one is missing** (derived from its width/height), never overriding an existing one, then renders via `SvgXml`. Results are cached per URL.
274
+ - 108b301: Add the React Native identity context and thin token-transfer hooks. `FunkitIdentity` (`{ apiKey, userId, walletAddress, loginType }`) is supplied by the host via `FunkitIdentityProvider`/`useFunkitIdentity` (RN has no wagmi). `useTransferInit` composes the core `getCheckoutTokenTransferParams` helper with `@funkit/api-base`'s `initializeCheckoutTokenTransferAddress` in a `useQuery`; `useUDAParams` resolves UDA config from the `uda_params` dynamic config; `useTokenTransfer` derives the deposit address, QR URI, and min-transfer value (default slippage). All web/customer branches (Lighter main account, Polymarket target override, geo/post-action gating, per-customer slippage matrix, i18n, fiat) are intentionally dropped. Adds `@tanstack/react-query` (`>=5`) as a peer dependency. These are internal (not part of the public API), to be wired through `FunkitProvider` once the Transfer screen lands.
275
+ - c49f5ba: Add React Native logging transports for the core `FunLogger`. `DatadogHttpLogTransport` ships records to Datadog over raw `fetch` (NOT the Datadog SDK — `@datadog/mobile-react-native` requires native modules), batching and flushing fire-and-forget on a timer, swallowing network errors, and authenticating with the public client token. `ConsoleLogTransport` is a dependency-free dev sink. A `FunLogger` singleton wired with the HTTP transport mirrors `@funkit/connect`'s web `logger`. No new native dependencies — only `fetch`. These are internal (not part of the public API), to be wired through `FunkitProvider` once identity/config lands.
276
+ - 2eb5610: Add the `QrCodeScreen` (Figma: Fun Mobile / qr-code-modal) — the full-screen deposit QR view reached from the Transfer screen's QR button. A themed surface with a close action, the framed QR code, a "Scan to deposit … / use it only for supported chains" caption (with an optional tappable link), and a share button. The scannable QR is host-supplied via the `qrCode` slot (e.g. `react-native-qrcode-svg`), so the package stays `react-native-svg`-free. Exported as public API.
277
+ - ea13570: Scaffold the `@funkit/connect-rn` package — React Native bindings that currently re-export `@funkit/connect-core`. RN platform halves land in later releases.
278
+ - 57d891c: Wire Statsig into `FunkitProvider` for React Native. Vendored the RN bindings from `@statsig/react-native-bindings` (+ `react-native-core`) with `react-native-device-info` removed — the only native module required is `@react-native-async-storage/async-storage` (new required peer dependency; AsyncStorage-backed persistence, device-info fields left `undefined`). `FunkitProvider` now mounts an internal `FunkitStatsigProvider` (same Fun client key + custom proxy as `@funkit/connect`, client created via the RN bindings) and accepts a `debug` prop (dev environment tier + verbose logging). The Statsig bindings stay internal (not part of the public API, mirroring `@funkit/connect`); all Statsig symbols resolve from the single `@statsig/react-bindings` peer so there's one client-core copy.
279
+ - 6ebf77e: Render the real, **curated** supported-deposit-tokens list (was placeholder, and an earlier attempt wrongly used the raw allow-list — meme coins and all). `useSupportedTokens` now resolves the list the same way the web SDK does: the Statsig `tokentransferconfig` (curated chains + asset addresses), filtered by `disabletokentransferchainsandassets`, merged with `@funkit/api-base`'s `getSupportedAssets` metadata via the shared `resolveTokenTransferConfig` (connect-core). The managed flow feeds this into the supported-tokens screen; `DepositFlowConfig.supportedTokens` / `tokenChainFilters` remain optional host overrides. `SupportedToken` gains `chainId` + `address` (for filtering/selection). Search, chain-filter, and selection interactivity follow separately.
280
+ - 024551c: Wire up the supported-tokens screen interactivity. Search (by symbol or chain name) and the chain-filter chips now filter the list (`filterSupportedTokens`), and selecting a token re-targets the transfer to that token's chain — the UDA deposit address is per-chain, so the Transfer screen's network label/icon and the generated address/QR update to the selected token's chain (reusing the choose-chain selection). The screen's search/filter/select were previously presentational.
281
+ - f6d33e6: Add the `SupportedTokensScreen` (Figma: Fun Mobile / Supported tokens) — shown from the Transfer screen's chain-name / info affordance. Back + title, a search field, horizontally-scrolling chain filter chips (All / Ethereum / BSC / …), and the token list (icon + symbol + chain). Controlled/presentational: the search value, selected chip, and the (host-filtered) `tokens` list come from props; token icons are host-supplied, keeping the package `react-native-svg`-free. The search input's colors follow the active theme via Restyle's `useTheme`. Exported as public API.
282
+ - 9f85d13: Render chain and token logos from Fun's icon CDN inside the managed deposit flow. Adds `FunIcon` (picks `react-native-svg`'s `SvgUri` for `.svg` chain logos vs `Image` for `.png` token logos — RN's built-in `Image` can't render SVG) and `ChainClusterIcon` (a single logo, or a 2×2 cluster for multi-chain groups). The flow now derives the network icon, crypto payment-method icon, choose-chain icons, and supported-token icons from config when the host doesn't supply its own: `DepositFlowConfig.networkIconChains?` and `ChainOption.iconKeys?` (CDN chain keys, e.g. `['ethereum', 'polygon']`); token icons are resolved from each token's symbol. Adds `react-native-svg >=15.0.0` as a peer dependency.
283
+ - 1b90155: Open the Swapped embedded payment flow in a WebView when a cash method is
284
+ selected on Add money. Picking a Card / Apple Pay / Revolut Pay / Bank Transfer
285
+ row now navigates to a `SwappedScreen` that loads the FOP's `embeddedFlowUrl`.
286
+
287
+ - `createWebViewSwappedTransport` + `SWAPPED_WEBVIEW_INJECTED_JS` +
288
+ `handleWebViewMessage` implement the shared `SwappedTransport` contract over a
289
+ `WebView` (the React Native counterpart of web's iframe transport): the
290
+ injected bridge redirects the embed's `postMessage` to the native channel, and
291
+ inbound messages are JSON-parsed and **origin-validated** (`isSwappedOrigin`)
292
+ before reaching handlers.
293
+ - `SwappedScreen` maps the embed's messages to flow navigation (mirroring web's
294
+ `SwappedIframeController`): back / new-deposit → back, close → close flow,
295
+ transaction-successful → success; errors log at WARN.
296
+
297
+ Adds `react-native-webview` (`>=13`) as a peer dependency. Sending theme/method
298
+ to the embed on `SWAPPED_READY` (web's `useSwappedSession`) and a host success
299
+ callback are follow-ups.
300
+
301
+ - 7eef6e3: Add the connect-rn Shopify Restyle theme: local light/dark design tokens (from the Fun Mobile Figma variables), a `toRestyleTheme` adapter, and a `FunkitProvider` that accepts `themes` + an optional `colorScheme` prop (falls back to the system Appearance when unset). Exposes `useFunkitColorScheme()` with a manual `toggleColorScheme()` (a no-op while a `colorScheme` prop is set), plus `useColorScheme` and typed `Box` / `Text` primitives. The theme is owned entirely by connect-rn (not shared with connect-core).
302
+ - 6b87806: Add the `TransferCryptoScreen` (Figma: Fun Mobile / Transfer Crypto) — the Universal-Deposit-Address screen reached after picking Crypto on `AddMoneyScreen`. A themed bottom-sheet surface with a top bar (back / title / QR), a network selector row (chain cluster + label + Change), and the deposit-address card with copy/share circular buttons. Built from the connect-rn Restyle primitives so it tracks the active light/dark scheme. UI only — data (`depositAddress`, `networkLabel`) and actions (`onBack`, `onShowQrCode`, `onChangeNetwork`, `onCopyAddress`, `onShareAddress`) are host-supplied; the chain-cluster icon is a host slot (`networkIcon`) and back/QR/copy/share use built-in svg-free glyphs, so the package needs no `react-native-svg`. Exported as public API.
303
+
304
+ ### Patch Changes
305
+
306
+ - 4428292: Gate non-EVM deposit chains on a minted address, shared between web and RN.
307
+ Adds `isTransferChainEnabled(chainId, transferInit, isWithdrawal?)` to
308
+ `@funkit/connect-core` — EVM chains are always enabled; Solana/Bitcoin/Tron are
309
+ enabled only once the deposit-init response carries their address; withdrawals
310
+ enable every chain. `@funkit/connect`'s `useEnabledTokenTransferChainTokens` now
311
+ delegates to this helper instead of its inline solana/bitcoin/tron checks
312
+ (behavior-preserving — the web suite passes unchanged).
313
+
314
+ `@funkit/connect-rn`'s supported-tokens list previously showed every curated
315
+ chain regardless of whether its deposit address existed. `useTokenTransfer` now
316
+ surfaces `transferInit`, and `useSupportedTokens({ transferInit })` filters both
317
+ the token rows and the chain-filter chips through the shared helper — so RN
318
+ hides Solana/Bitcoin/Tron until their address is minted, matching web.
319
+
320
+ - 7926a68: Fix customer-gated Statsig configs always resolving to their default in React
321
+ Native. `FunkitStatsigProvider` initialized the client with an empty user `{}`,
322
+ so configs gated on the customer (e.g. `enableswappeddeposit`) never matched and
323
+ fell back to `false` for every apiKey. The provider now builds the Statsig user
324
+ with `{ userID, customIDs: { apiKey } }` from the resolved identity — mirroring
325
+ web's `useTrack.updateUserAsync` — so customer-scoped configs evaluate correctly
326
+ (this is what lets the Swapped cash methods appear for keys that have them on).
327
+ - abc0c49: Make the transfer screen's network selector open the Supported tokens screen. The chain-cluster + label + a new ⓘ info affordance is now its own tap target (`onShowSupportedTokens`), separate from "Change" (`onChangeNetwork`) — matching the Figma. The managed flow wires it to navigate to the supported-tokens screen (previously only reachable from the QR screen's "supported chains" link).
328
+ - 72b959f: Fix supported-tokens icons not matching the web SDK. The deposit-token list now
329
+ resolves each icon exactly like web's token-transfer screen
330
+ (`getTokenIconUrl` → `getLocalTokenIconUrl` in
331
+ `packages/connect/src/components/Dropdown/TokenDropdown.tsx`): **purely by
332
+ symbol** — `ASSET_LOGO_SRCS[symbol]` (a map duplicated from `@funkit/fun-relay`,
333
+ which has no RN-safe subpath export), falling back to
334
+ `https://sdk-cdn.fun.xyz/images/<symbol>.svg`.
335
+
336
+ Previously the row used the `/assets/supported` API metadata `logo` first (the
337
+ wallet-holdings resolver, `asset.logo || getAssetLogoSrc`), so tokens whose API
338
+ `logo` is a third-party URL rendered a different icon than web — e.g. TRUMP
339
+ showed an Arweave URL in RN but `trump.png` on web. The API `logo` is no longer
340
+ consulted on this screen, and the dead `logo` plumbing (`SupportedToken.logo`)
341
+ is removed.
342
+
343
+ `FunIcon` also gains a `fallbackUri` prop; the token row passes the dollar-circle
344
+ (`FALLBACK_ASSET_LOGO`) so a dead CDN URL degrades to the same icon web shows
345
+ via `AsyncImage`'s `fallbackSrc`, instead of a blank placeholder.
346
+
347
+ - 611deff: `TransferCryptoScreen`: add an in-screen "copied" confirmation. Pressing copy now shows a transient confirmation (the label flips to "Copied!" and the icon to a check) for `copiedFeedbackMs` (default 1800ms) while still invoking `onCopyAddress` for the host's clipboard write.
348
+ - Updated dependencies [4428292]
349
+ - Updated dependencies [383c4b7]
350
+ - @funkit/connect-core@0.4.0-next.0
package/README.md ADDED
@@ -0,0 +1,220 @@
1
+ # @funkit/connect-rn
2
+
3
+ React Native bindings for Funkit Connect. **This README is for working _on_ the
4
+ package.** For integrating the SDK into an app (install, peer dependencies,
5
+ `FunkitProvider` API, `DepositFlowConfig`), see the client integration guide —
6
+ maintained in Notion. To run the SDK on a simulator/device, use the
7
+ [`with-expo`](../../apps/with-expo) playground.
8
+
9
+ ## Architecture
10
+
11
+ `@funkit/connect-rn` is the React Native half of a three-package split. The
12
+ headless business logic lives once in
13
+ [`@funkit/connect-core`](../connect-core) and is shared by web and RN, so the two
14
+ platforms can't drift:
15
+
16
+ | Package | Role |
17
+ | --- | --- |
18
+ | `@funkit/connect-core` | Headless, platform-agnostic — domains, utils, query/Statsig hooks, theme factories, `FunLogger`. **No DOM, vanilla-extract, or wagmi** under `src/**`. |
19
+ | `@funkit/connect` | Web presentation halves (`.tsx`, vanilla-extract, Dialog/portals, iframe transport, wagmi identity). |
20
+ | `@funkit/connect-rn` | **This package** — the RN presentation halves over core. |
21
+
22
+ The platform halves this package supplies (mirroring connect's web halves):
23
+
24
+ - a local Shopify Restyle theme + `useFunkitTheme()` / `useColorScheme()`
25
+ - `FunLogger` wired to a React Native log transport
26
+ - `WebViewSwappedTransport` + the Swapped screen
27
+ - the managed Add money → Transfer / UDA → QR flow
28
+
29
+ Core stays platform-agnostic by depending on **contracts** that each platform
30
+ implements: `IdentityProvider` (web wraps wagmi; RN takes host props),
31
+ `SwappedTransport` (web `<iframe>`; RN `WebView`), and `LogTransport` (web
32
+ Datadog browser-logs; RN console). The customer `theme` is a plain `ThemeVars`
33
+ object from core that RN maps to a Restyle theme via `toRestyleTheme(tokens)`.
34
+
35
+ **Public surface.** `index.ts` re-exports core plus an **explicit, named** set of
36
+ RN symbols (no barrels): the provider, the `useFunkitCheckout` entry hook, theme
37
+ tokens/adapter/primitives, and config types. The screens, Statsig RN bindings,
38
+ log transports, identity context, and transfer hooks are **internal** (mirroring
39
+ `@funkit/connect`, which exports none of them). When adding a public export, wire
40
+ it explicitly in `index.ts`.
41
+
42
+ ## Peer dependencies
43
+
44
+ These are declared as **peer dependencies** (not bundled), so the host app links a
45
+ single copy and controls the native-module versions. Editing `peerDependencies`
46
+ in `package.json` is a public-API change — bump it deliberately and add a
47
+ changeset (a *peer* bump is a **major** change for consumers).
48
+
49
+ The authoritative list lives in `package.json` (`peerDependencies` /
50
+ `peerDependenciesMeta`) — it's intentionally **not** duplicated here so it can't
51
+ drift. Adding a peer dependency is a consumer-facing decision: every integrator
52
+ must install it. Before adding one:
53
+
54
+ - **Pick it carefully.** Prefer a widely-used, well-maintained library — ideally
55
+ one (nearly) every customer already depends on — over a niche package that adds
56
+ install burden for everyone. A peer dep is a tax on all consumers.
57
+ - **Update the client docs.** A new peer dep changes the install/setup steps
58
+ integrators follow, so the client integration guide (Notion) must be updated in
59
+ the same change.
60
+ - **Native modules need extra care.** A native peer (iOS/Android native code, vs
61
+ JS-only) can't be linked by the host without a rebuild, carries version
62
+ compatibility constraints against the RN core, and may be absent in some
63
+ runtimes. Treat it as a heavier commitment than a JS-only dep.
64
+ - **Prefer Expo-Go-bundled native modules.** When a native peer is needed, prefer
65
+ one already bundled in Expo Go (see [Expo Go compatibility](#expo-go-compatibility))
66
+ so the SDK keeps working in the playground without a custom dev build. This is a
67
+ preference, not a hard requirement — if a non-bundled native module is genuinely
68
+ needed, make it optional + lazy + guarded with a host override (the way
69
+ clipboard is).
70
+ - **Don't depend on the Expo SDK.** "Bundled in Expo Go" is a convenience for our
71
+ playground, not an assumption about consumers — many integrate via **bare React
72
+ Native**, not Expo. Prefer a framework-agnostic RN library over one that needs the
73
+ Expo SDK (the `expo` package) installed to work, so it runs either way. An
74
+ `expo-*` name isn't itself a red flag — those modules are *published by* Expo but
75
+ run fine in bare RN; the concern is a library that genuinely requires the Expo
76
+ runtime, like `@expo/ui`. For example, `@gorhom/bottom-sheet` is preferred over
77
+ `@expo/ui`'s bottom sheet.
78
+
79
+ ## Expo Go compatibility
80
+
81
+ connect-rn is **designed to run in Expo Go** (no custom dev build needed) — this
82
+ is what lets the [`with-expo`](../../apps/with-expo) playground preview the flow
83
+ in Expo Go. **Keep new code Expo-Go-safe.**
84
+
85
+ Every native peer the SDK relies on is either bundled in Expo Go for the target
86
+ SDK (`react-native-reanimated`, `react-native-gesture-handler`,
87
+ `react-native-webview`, `react-native-svg`, `react-native-safe-area-context`,
88
+ AsyncStorage) or JS-only (`@gorhom/bottom-sheet`, `react-native-qrcode-svg`).
89
+ Two deliberate choices keep it that way:
90
+
91
+ - **Clipboard is optional, lazy, and guarded.** `@react-native-clipboard/clipboard`
92
+ is a bare-RN native module *not* in Expo Go. `src/transfer/clipboard.ts` only
93
+ `import()`s it **when a copy actually happens** (never at startup) inside a
94
+ try/catch — so in Expo Go, where `getEnforcing('RNCClipboard')` would throw, a
95
+ copy degrades to a no-op + warning rather than crashing. A host injects its own
96
+ writer via `FunkitProvider`'s `copyToClipboard` (e.g. `expo-clipboard`), and
97
+ that override runs instead, so the throwing path never executes.
98
+ - **No `react-native-device-info`.** `src/statsig/statsigMetadata.ts` vendors the
99
+ Statsig metadata adapter with the `react-native-device-info` dependency removed
100
+ (it's a native module that needs a dev build). The app-version / device-model
101
+ fields are left `undefined`; `systemName` and `locale` are read from RN's
102
+ built-in `Platform` / `NativeModules` (no extra native dep). Geo/IP resolution
103
+ uses plain `fetch`.
104
+
105
+ **Contributor rule:** don't add a hard top-level import of a bare-RN native
106
+ module that Expo Go doesn't bundle. If you genuinely need one, make it optional +
107
+ lazily imported + guarded with a host-injectable override, the way clipboard is.
108
+
109
+ ## Local development
110
+
111
+ > No root shortcut exists for this package — use the `pnpm --filter` form (or
112
+ > `cd packages/connect-rn` and drop the filter).
113
+
114
+ ```bash
115
+ pnpm --filter @funkit/connect-rn build # esbuild bundle + typecheck
116
+ pnpm --filter @funkit/connect-rn build:watch # rebuild on change
117
+ pnpm --filter @funkit/connect-rn dev # build:watch + type-gen watch in parallel
118
+ pnpm --filter @funkit/connect-rn typecheck # tsc --noEmit
119
+ pnpm --filter @funkit/connect-rn lint # oxlint (lint:fix to auto-fix)
120
+ pnpm --filter @funkit/connect-rn storybook # web Storybook on http://localhost:7007
121
+ ```
122
+
123
+ Typical inner loop when changing the SDK and watching it in the app: run
124
+ `pnpm --filter @funkit/connect-rn dev` in one terminal and
125
+ `pnpm --filter with-expo start` in another. Metro watches the whole monorepo, so
126
+ SDK edits hot-reload in the playground.
127
+
128
+ ## Testing
129
+
130
+ Tests run with **Vitest** in the **`node`** environment (no DOM — native modules
131
+ are stubbed). Components mount with `react-test-renderer` + `act()`, not React
132
+ Testing Library.
133
+
134
+ ```bash
135
+ pnpm --filter @funkit/connect-rn test # run once
136
+ pnpm --filter @funkit/connect-rn test -- --watch # watch mode
137
+ pnpm --filter @funkit/connect-rn test -- test/providers/FunkitProvider.test.tsx # one file
138
+ ```
139
+
140
+ - Config: `vitest.config.ts`. Setup: `test/setup.ts` (stubs global `fetch`,
141
+ enables `IS_REACT_ACT_ENVIRONMENT`).
142
+ - Native-module stubs live in `test/*.stub.ts(x)` (`react-native`,
143
+ `react-native-svg`, `react-native-reanimated`, `@gorhom/bottom-sheet`,
144
+ clipboard, webview, qrcode). **Pulling in a new native module? Add a stub** or
145
+ the import fails under node.
146
+ - **Mock at the `@funkit/api-base` edge** — never mock internal hooks
147
+ (`useTransferInit`, etc.). Snapshot tests may mock internal hooks to freeze
148
+ inputs. See the repo [TESTING.md](../../TESTING.md).
149
+
150
+ ## Fonts
151
+
152
+ connect-rn's theme renders text in the **system UI font** by default (SF on iOS,
153
+ Roboto on Android) at two weights: `400` (regular) and `500` (medium). There is
154
+ no semibold/bold in the token set. The default needs **no font assets** — it
155
+ works out of the box.
156
+
157
+ connect-rn is **font-agnostic**: it ships no typeface and no font preset. To
158
+ render in a custom font (the Fun Mobile design uses **Inter**), supply your own
159
+ `fonts` tokens and register the matching font files (see "Rendering in a custom
160
+ font" below).
161
+
162
+ **connect-rn does not — and cannot — load fonts itself.** A JS-only React
163
+ Native library has no way to register a font with the native font manager: fonts
164
+ are either bundled and linked natively (iOS `UIAppFonts` / Android `assets/fonts`)
165
+ or loaded at runtime through a native module such as
166
+ [`expo-font`](https://docs.expo.dev/versions/latest/sdk/font/). Both live in the
167
+ **host app**, not in this package.
168
+
169
+ ### Rendering in a custom font
170
+
171
+ To render in a custom font instead of the system default, set `fonts` on your
172
+ tokens and register the matching font files.
173
+
174
+ You can't select a custom font's weight via `fontWeight` in React Native/Expo:
175
+ Android matches custom fonts by exact family-name string, and a font loaded at
176
+ runtime registers one native typeface per name — so `fontWeight: '500'` on a
177
+ custom `Inter` family is silently ignored. connect-rn therefore expresses weight
178
+ through the **family name** (set `family` + a per-weight `familySuffix`), and the
179
+ host registers **each cut under its own name** — e.g. `Inter-Regular` and
180
+ `Inter-Medium`. Use `fontFamilyForWeight(...)` to resolve those names so you don't
181
+ hardcode them.
182
+
183
+ Define the font tokens in your host app, load the files **before rendering
184
+ `<FunkitProvider>`** (if a name is missing, that text falls back to the system
185
+ font), and build your theme with them. Example with Expo (`expo-font` +
186
+ `@expo-google-fonts/inter`):
187
+
188
+ ```tsx
189
+ import { useFonts, Inter_400Regular, Inter_500Medium } from '@expo-google-fonts/inter'
190
+ import {
191
+ type FunkitFontTokens,
192
+ fontFamilyForWeight,
193
+ lightTokens,
194
+ toRestyleTheme,
195
+ } from '@funkit/connect-rn'
196
+
197
+ // Host-owned: weight lives in the family name (RN/Expo can't pick a cut via
198
+ // fontWeight). cssWeight is kept for the Swapped WebView (CSS) theme.
199
+ const interFonts: FunkitFontTokens = {
200
+ family: 'Inter',
201
+ weights: {
202
+ base: { familySuffix: 'Regular', cssWeight: '400' },
203
+ medium: { familySuffix: 'Medium', cssWeight: '500' },
204
+ },
205
+ }
206
+
207
+ const themes = {
208
+ light: toRestyleTheme({ ...lightTokens, fonts: interFonts }),
209
+ // …dark likewise
210
+ }
211
+
212
+ export default function App() {
213
+ const [fontsLoaded] = useFonts({
214
+ [fontFamilyForWeight(interFonts, 'base')]: Inter_400Regular, // 'Inter-Regular'
215
+ [fontFamilyForWeight(interFonts, 'medium')]: Inter_500Medium, // 'Inter-Medium'
216
+ })
217
+ if (!fontsLoaded) return null // or a splash screen
218
+ return <FunkitProvider themes={themes} {...}>{/* … */}</FunkitProvider>
219
+ }
220
+ ```
@@ -0,0 +1,24 @@
1
+ export type { CheckoutTokenTransferConfig } from '@funkit/connect-core';
2
+ export { darkTokens, fontFamilyForWeight, lightTokens, } from './src/theme/tokens';
3
+ export type { FunkitColorTokens, FunkitFontTokens, FunkitFontWeight, FunkitTokens, } from './src/theme/tokens';
4
+ export { defaultDarkTheme, defaultLightTheme, toRestyleTheme, } from './src/theme/toRestyleTheme';
5
+ export type { FunkitTheme } from './src/theme/toRestyleTheme';
6
+ export { normalizeColorScheme, resolveColorScheme, useColorScheme, } from './src/theme/useColorScheme';
7
+ export type { ColorScheme, SystemColorScheme } from './src/theme/useColorScheme';
8
+ export { useFunkitTheme } from './src/theme/useFunkitTheme';
9
+ export type { FunkitThemeSet } from './src/theme/useFunkitTheme';
10
+ export { Box, Text } from './src/theme/restyle';
11
+ export type { TextProps } from './src/theme/restyle';
12
+ export { AddressCopiedToast } from './src/flow/AddressCopiedToast';
13
+ export type { AddressCopiedToastProps } from './src/flow/AddressCopiedToast';
14
+ export { FunkitThemeProvider, useFunkitColorScheme, } from './src/theme/FunkitThemeProvider';
15
+ export type { FunkitThemeProviderProps } from './src/theme/FunkitThemeProvider';
16
+ export { FunkitProvider } from './src/providers/FunkitProvider';
17
+ export type { FunkitProviderProps } from './src/providers/FunkitProvider';
18
+ export type { FunkitConfig } from './src/identity/IdentityContext';
19
+ export { useFunkitCheckout } from './src/providers/useFunkitCheckout';
20
+ export type { DepositFlowCallbacks, DepositFlowConfig, DynamicTargetAssetCandidate, } from './src/flow/depositFlowConfig';
21
+ export type { PaymentMethodOption, ReceiveTokenOption, } from './src/screens/AddMoneyScreen';
22
+ export type { ChainOption } from './src/flow/depositFlowConfig';
23
+ export type { SupportedToken, TokenChainFilter, } from './src/transfer/supportedTokens';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAgBA,YAAY,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAKvE,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAG7D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGhE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAKpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAG5E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAIzE,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAA;AAGrC,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,YAAY,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,gCAAgC,CAAA"}