@funkit/connect-rn 7.0.0 → 8.1.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 (149) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +76 -56
  3. package/dist/{chunk-P3OLDPDC.js → chunk-4YNYOJJK.js} +217 -192
  4. package/dist/chunk-4YNYOJJK.js.map +7 -0
  5. package/dist/{chunk-HRJNTNCV.js → chunk-75U7A2Q5.js} +29 -11
  6. package/dist/chunk-75U7A2Q5.js.map +7 -0
  7. package/dist/chunk-D64EJ57D.js +161 -0
  8. package/dist/chunk-D64EJ57D.js.map +7 -0
  9. package/dist/clients/lighter.js +4 -2
  10. package/dist/clients/lighter.js.map +1 -1
  11. package/dist/clients/nado.js +6 -4
  12. package/dist/clients/nado.js.map +2 -2
  13. package/dist/clients/solana/index.d.ts +5 -0
  14. package/dist/clients/solana/index.d.ts.map +1 -0
  15. package/dist/clients/solana/solanaWithdrawal.d.ts +20 -0
  16. package/dist/clients/solana/solanaWithdrawal.d.ts.map +1 -0
  17. package/dist/clients/solana/useSolanaWithdrawal.d.ts +13 -0
  18. package/dist/clients/solana/useSolanaWithdrawal.d.ts.map +1 -0
  19. package/dist/clients/solana.d.ts +1 -0
  20. package/dist/clients/solana.js +87 -0
  21. package/dist/clients/solana.js.map +7 -0
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +20258 -18583
  25. package/dist/index.js.map +4 -4
  26. package/dist/src/components/AssetGrid.d.ts.map +1 -1
  27. package/dist/src/components/Grabber.d.ts +3 -1
  28. package/dist/src/components/Grabber.d.ts.map +1 -1
  29. package/dist/src/components/InfoTooltip.d.ts +28 -0
  30. package/dist/src/components/InfoTooltip.d.ts.map +1 -0
  31. package/dist/src/fiat/KycGlassBackdrop.d.ts.map +1 -1
  32. package/dist/src/fiat/SurfaceSlot.d.ts +8 -2
  33. package/dist/src/fiat/SurfaceSlot.d.ts.map +1 -1
  34. package/dist/src/fiat/providers/moonpay.d.ts.map +1 -1
  35. package/dist/src/fiat/quoteRefusal.d.ts +29 -6
  36. package/dist/src/fiat/quoteRefusal.d.ts.map +1 -1
  37. package/dist/src/fiat/useFiatDirectDelivery.d.ts +5 -4
  38. package/dist/src/fiat/useFiatDirectDelivery.d.ts.map +1 -1
  39. package/dist/src/fiat/useIdentityAssertion.d.ts +35 -0
  40. package/dist/src/fiat/useIdentityAssertion.d.ts.map +1 -0
  41. package/dist/src/fiat/useQuoteableCeiling.d.ts +28 -0
  42. package/dist/src/fiat/useQuoteableCeiling.d.ts.map +1 -0
  43. package/dist/src/flow/AddressCopiedToast.d.ts +3 -1
  44. package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -1
  45. package/dist/src/flow/DepositAssetPicker.d.ts +11 -0
  46. package/dist/src/flow/DepositAssetPicker.d.ts.map +1 -0
  47. package/dist/src/flow/DepositFlowContent.d.ts +1 -1
  48. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  49. package/dist/src/flow/DepositReceivedToast.d.ts +2 -2
  50. package/dist/src/flow/DepositReceivedToast.d.ts.map +1 -1
  51. package/dist/src/flow/FeeDetailsSheet.d.ts.map +1 -1
  52. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
  53. package/dist/src/flow/FlowSheet.d.ts +14 -20
  54. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  55. package/dist/src/flow/FunkitFlowProvider.d.ts +9 -4
  56. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  57. package/dist/src/flow/SheetMaterial.d.ts +11 -0
  58. package/dist/src/flow/SheetMaterial.d.ts.map +1 -0
  59. package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
  60. package/dist/src/flow/depositFlowConfig.d.ts +24 -5
  61. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  62. package/dist/src/flow/flowError.d.ts +11 -1
  63. package/dist/src/flow/flowError.d.ts.map +1 -1
  64. package/dist/src/flow/flowStepHeight.d.ts +19 -0
  65. package/dist/src/flow/flowStepHeight.d.ts.map +1 -0
  66. package/dist/src/flow/isLockedDeposit.d.ts +6 -0
  67. package/dist/src/flow/isLockedDeposit.d.ts.map +1 -0
  68. package/dist/src/flow/useCopiedToast.d.ts +1 -1
  69. package/dist/src/flow/useCopiedToast.d.ts.map +1 -1
  70. package/dist/src/flow/validateClientMetadata.d.ts +2 -3
  71. package/dist/src/flow/validateClientMetadata.d.ts.map +1 -1
  72. package/dist/src/hooks/useSheetFade.d.ts +11 -0
  73. package/dist/src/hooks/useSheetFade.d.ts.map +1 -0
  74. package/dist/src/identity/IdentityContext.d.ts +28 -4
  75. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  76. package/dist/src/logging/debugBridge.d.ts +2 -0
  77. package/dist/src/logging/debugBridge.d.ts.map +1 -1
  78. package/dist/src/native/glassEffect.d.ts +18 -0
  79. package/dist/src/native/glassEffect.d.ts.map +1 -0
  80. package/dist/src/providers/FunkitProvider.d.ts +6 -8
  81. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  82. package/dist/src/providers/NativeCapabilitiesContext.d.ts +12 -11
  83. package/dist/src/providers/NativeCapabilitiesContext.d.ts.map +1 -1
  84. package/dist/src/providers/useFunkitCheckout.d.ts +7 -3
  85. package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -1
  86. package/dist/src/screens/DepositAmountScreen.d.ts.map +1 -1
  87. package/dist/src/screens/FeeDetailsScreen.d.ts +2 -5
  88. package/dist/src/screens/FeeDetailsScreen.d.ts.map +1 -1
  89. package/dist/src/screens/LockedTransferCryptoScreen.d.ts +19 -0
  90. package/dist/src/screens/LockedTransferCryptoScreen.d.ts.map +1 -0
  91. package/dist/src/screens/SelectChainScreen.d.ts +1 -0
  92. package/dist/src/screens/SelectChainScreen.d.ts.map +1 -1
  93. package/dist/src/screens/SelectReceiveTokenAndChainScreen.d.ts +0 -8
  94. package/dist/src/screens/SelectReceiveTokenAndChainScreen.d.ts.map +1 -1
  95. package/dist/src/screens/TokenAndChainPickerScreen.d.ts +16 -0
  96. package/dist/src/screens/TokenAndChainPickerScreen.d.ts.map +1 -0
  97. package/dist/src/screens/WithdrawAddressScreen.d.ts.map +1 -1
  98. package/dist/src/screens/WithdrawAmountScreen.d.ts.map +1 -1
  99. package/dist/src/screens/WithdrawCompleteScreen.d.ts.map +1 -1
  100. package/dist/src/swapped/SwappedScreenShell.d.ts.map +1 -1
  101. package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
  102. package/dist/src/swapped/SwappedWithdrawScreen.d.ts +3 -1
  103. package/dist/src/swapped/SwappedWithdrawScreen.d.ts.map +1 -1
  104. package/dist/src/swapped/paymentNavigation.d.ts +21 -0
  105. package/dist/src/swapped/paymentNavigation.d.ts.map +1 -0
  106. package/dist/src/transfer/clipboard.d.ts +2 -0
  107. package/dist/src/transfer/clipboard.d.ts.map +1 -1
  108. package/dist/src/transfer/depositAssets.d.ts +35 -0
  109. package/dist/src/transfer/depositAssets.d.ts.map +1 -0
  110. package/dist/src/transfer/hooks/useCopyDepositAddress.d.ts +7 -6
  111. package/dist/src/transfer/hooks/useCopyDepositAddress.d.ts.map +1 -1
  112. package/dist/src/transfer/hooks/useDepositAssets.d.ts +14 -0
  113. package/dist/src/transfer/hooks/useDepositAssets.d.ts.map +1 -0
  114. package/dist/src/transfer/hooks/useDepositRecipient.d.ts +2 -2
  115. package/dist/src/transfer/hooks/useDepositRecipient.d.ts.map +1 -1
  116. package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts +1 -5
  117. package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts.map +1 -1
  118. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts +10 -0
  119. package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts.map +1 -0
  120. package/dist/src/transfer/hooks/useTokenTransfer.d.ts +3 -2
  121. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  122. package/dist/src/transfer/hooks/useTransferInit.d.ts +2 -3
  123. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -1
  124. package/dist/src/transfer/lockedTokenAmount.d.ts +9 -0
  125. package/dist/src/transfer/lockedTokenAmount.d.ts.map +1 -0
  126. package/dist/src/transfer/supportedTokens.d.ts +5 -0
  127. package/dist/src/transfer/supportedTokens.d.ts.map +1 -1
  128. package/dist/src/utils/assetGrid.d.ts +5 -0
  129. package/dist/src/utils/assetGrid.d.ts.map +1 -1
  130. package/dist/src/utils/motion.d.ts +10 -0
  131. package/dist/src/utils/motion.d.ts.map +1 -1
  132. package/dist/src/utils/tokenAndChainPicker.d.ts +15 -0
  133. package/dist/src/utils/tokenAndChainPicker.d.ts.map +1 -0
  134. package/dist/src/withdrawal/fiatTargetDecimals.d.ts +13 -0
  135. package/dist/src/withdrawal/fiatTargetDecimals.d.ts.map +1 -0
  136. package/dist/src/withdrawal/receiveDestination.d.ts +0 -7
  137. package/dist/src/withdrawal/receiveDestination.d.ts.map +1 -1
  138. package/dist/src/withdrawal/useSourceTokenDecimals.d.ts.map +1 -1
  139. package/dist/src/withdrawal/useSourceTokenUsdPrice.d.ts +15 -2
  140. package/dist/src/withdrawal/useSourceTokenUsdPrice.d.ts.map +1 -1
  141. package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -1
  142. package/expo-module.config.json +6 -0
  143. package/ios/FunkitGlassEffect.podspec +23 -0
  144. package/ios/FunkitGlassEffectModule.swift +126 -0
  145. package/ios/GlassStyle.swift +52 -0
  146. package/ios/GlassView.swift +305 -0
  147. package/package.json +17 -5
  148. package/dist/chunk-HRJNTNCV.js.map +0 -7
  149. package/dist/chunk-P3OLDPDC.js.map +0 -7
@@ -0,0 +1,305 @@
1
+ // Forked from expo-glass-effect 57.0.3 (MIT). Copyright 2022-present 650 Industries.
2
+ // Adds container-concentric corners; otherwise unchanged.
3
+
4
+ import ExpoModulesCore
5
+ import React
6
+
7
+ public final class GlassView: ExpoView {
8
+ private var glassEffect: Any?
9
+ private var glassEffectView = UIVisualEffectView()
10
+ // Glass effect does not work sometimes if view has not been laid out yet
11
+ // https://github.com/expo/expo/issues/41024#issuecomment-3867466289
12
+ private var isMounted = false
13
+
14
+ private var glassStyle: GlassStyle?
15
+ private var glassTintColor: UIColor?
16
+ private var glassIsInteractive: Bool?
17
+ private var glassColorScheme: GlassColorScheme?
18
+
19
+ private var radius: CGFloat?
20
+ private var bottomLeftRadius: CGFloat?
21
+ private var bottomRightRadius: CGFloat?
22
+ private var topLeftRadius: CGFloat?
23
+ private var topRightRadius: CGFloat?
24
+
25
+ private var bottomStartRadius: CGFloat?
26
+ private var bottomEndRadius: CGFloat?
27
+ private var topStartRadius: CGFloat?
28
+ private var topEndRadius: CGFloat?
29
+
30
+ private var concentricCorners = false
31
+ private var concentricMinimumRadius: CGFloat?
32
+
33
+ public required init(appContext: AppContext? = nil) {
34
+ super.init(appContext: appContext)
35
+
36
+ glassEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
37
+
38
+ addSubview(glassEffectView)
39
+ }
40
+
41
+ // UIGlassEffect initialiser is crashing for iOS 26 beta versions for some reason, so we need to check if it's available at runtime
42
+ // https://github.com/expo/expo/issues/40911
43
+ private func isGlassEffectAvailable() -> Bool {
44
+ #if compiler(>=6.2)
45
+ if #available(iOS 26.0, tvOS 26.0, macOS 26.0, *) {
46
+ guard let glassEffectClass = NSClassFromString("UIGlassEffect") as? NSObject.Type else {
47
+ return false
48
+ }
49
+ let respondsToSelector = glassEffectClass.responds(to: Selector(("effectWithStyle:")))
50
+ return respondsToSelector
51
+ }
52
+ #endif
53
+ return false
54
+ }
55
+
56
+ override public func layoutSubviews() {
57
+ super.layoutSubviews()
58
+ if !isMounted {
59
+ isMounted = true
60
+ // Clear the stale effect before re-applying so UIKit fully tears down
61
+ // the old UIGlassEffect, otherwise re-assigning does not render GlassView correctly.
62
+ // https://github.com/expo/expo/issues/43732
63
+ glassEffectView.effect = UIVisualEffect()
64
+ updateEffect()
65
+ }
66
+ }
67
+
68
+ func updateBorderRadius() {
69
+ guard isGlassEffectAvailable() else {
70
+ return
71
+ }
72
+ if #available(iOS 26.0, tvOS 26.0, macOS 26.0, *) {
73
+ #if compiler(>=6.2) // Xcode 26
74
+ if concentricCorners {
75
+ // Corners follow the enclosing container (the screen, for a full-bleed
76
+ // view) so the radius is never guessed per device. Fixed radii below
77
+ // are ignored while this is on.
78
+ glassEffectView.cornerConfiguration = .uniformCorners(
79
+ radius: .containerConcentric(minimum: concentricMinimumRadius)
80
+ )
81
+ return
82
+ }
83
+ let isRTL = RCTI18nUtil.sharedInstance()?.isRTL() ?? false
84
+
85
+ let finalTopLeft: CGFloat
86
+ let finalTopRight: CGFloat
87
+ let finalBottomLeft: CGFloat
88
+ let finalBottomRight: CGFloat
89
+
90
+ if isRTL {
91
+ finalTopLeft = topLeftRadius ?? topEndRadius ?? radius ?? 0
92
+ finalTopRight = topRightRadius ?? topStartRadius ?? radius ?? 0
93
+ finalBottomLeft = bottomLeftRadius ?? bottomEndRadius ?? radius ?? 0
94
+ finalBottomRight = bottomRightRadius ?? bottomStartRadius ?? radius ?? 0
95
+ } else {
96
+ finalTopLeft = topLeftRadius ?? topStartRadius ?? radius ?? 0
97
+ finalTopRight = topRightRadius ?? topEndRadius ?? radius ?? 0
98
+ finalBottomLeft = bottomLeftRadius ?? bottomStartRadius ?? radius ?? 0
99
+ finalBottomRight = bottomRightRadius ?? bottomEndRadius ?? radius ?? 0
100
+ }
101
+
102
+ let topLeft = UICornerRadius(floatLiteral: finalTopLeft)
103
+ let topRight = UICornerRadius(floatLiteral: finalTopRight)
104
+ let bottomLeft = UICornerRadius(floatLiteral: finalBottomLeft)
105
+ let bottomRight = UICornerRadius(floatLiteral: finalBottomRight)
106
+
107
+ glassEffectView.cornerConfiguration = .corners(
108
+ topLeftRadius: topLeft,
109
+ topRightRadius: topRight,
110
+ bottomLeftRadius: bottomLeft,
111
+ bottomRightRadius: bottomRight
112
+ )
113
+ #endif
114
+ }
115
+ }
116
+
117
+ func setGlassStyle(_ config: GlassEffectStyleConfig) {
118
+ applyGlassStyle(config.style, animate: config.animate, animationDuration: config.animationDuration)
119
+ }
120
+
121
+ func setGlassStyle(_ style: GlassStyle) {
122
+ applyGlassStyle(style)
123
+ }
124
+
125
+ private func applyGlassStyle(_ newStyle: GlassStyle, animate: Bool = false, animationDuration: Double? = nil) {
126
+ if glassStyle != newStyle {
127
+ glassStyle = newStyle
128
+ guard isGlassEffectAvailable() else {
129
+ return
130
+ }
131
+ if #available(iOS 26.0, tvOS 26.0, macOS 26.0, *) {
132
+ #if compiler(>=6.2) // Xcode 26
133
+ let applyEffect = {
134
+ if let uiStyle = newStyle.toUIGlassEffectStyle() {
135
+ self.glassEffect = UIGlassEffect(style: uiStyle)
136
+ self.updateEffect()
137
+ } else {
138
+ // setting `nil` does not work as expected, so we need to set a visual effect with no effect
139
+ self.glassEffectView.effect = UIVisualEffect()
140
+ self.glassEffect = self.glassEffectView.effect
141
+ }
142
+ }
143
+
144
+ if animate {
145
+ if let duration = animationDuration {
146
+ UIView.animate(withDuration: duration, animations: applyEffect)
147
+ } else {
148
+ UIView.animate(animations: applyEffect)
149
+ }
150
+ } else {
151
+ applyEffect()
152
+ }
153
+ #endif
154
+ }
155
+ }
156
+ }
157
+
158
+ func setBorderRadius(_ _radius: CGFloat?) {
159
+ if _radius != radius {
160
+ radius = _radius
161
+ updateBorderRadius()
162
+ }
163
+ }
164
+
165
+ func setConcentricCorners(_ concentric: Bool) {
166
+ if concentric != concentricCorners {
167
+ concentricCorners = concentric
168
+ updateBorderRadius()
169
+ }
170
+ }
171
+
172
+ func setConcentricMinimumRadius(_ minimum: CGFloat?) {
173
+ if minimum != concentricMinimumRadius {
174
+ concentricMinimumRadius = minimum
175
+ updateBorderRadius()
176
+ }
177
+ }
178
+
179
+ func setBorderCurve(_: String?) {
180
+ glassEffectView.layer.cornerCurve = self.layer.cornerCurve
181
+ }
182
+
183
+ func setBorderBottomLeftRadius(_ radius: CGFloat?) {
184
+ if radius != bottomLeftRadius {
185
+ bottomLeftRadius = radius
186
+ updateBorderRadius()
187
+ }
188
+ }
189
+
190
+ func setBorderBottomRightRadius(_ radius: CGFloat?) {
191
+ if radius != bottomRightRadius {
192
+ bottomRightRadius = radius
193
+ updateBorderRadius()
194
+ }
195
+ }
196
+
197
+ func setBorderTopLeftRadius(_ radius: CGFloat?) {
198
+ if radius != topLeftRadius {
199
+ topLeftRadius = radius
200
+ updateBorderRadius()
201
+ }
202
+ }
203
+
204
+ func setBorderTopRightRadius(_ radius: CGFloat?) {
205
+ if radius != topRightRadius {
206
+ topRightRadius = radius
207
+ updateBorderRadius()
208
+ }
209
+ }
210
+
211
+ func setBorderBottomStartRadius(_ radius: CGFloat?) {
212
+ if radius != bottomStartRadius {
213
+ bottomStartRadius = radius
214
+ updateBorderRadius()
215
+ }
216
+ }
217
+
218
+ func setBorderBottomEndRadius(_ radius: CGFloat?) {
219
+ if radius != bottomEndRadius {
220
+ bottomEndRadius = radius
221
+ updateBorderRadius()
222
+ }
223
+ }
224
+
225
+ func setBorderTopStartRadius(_ radius: CGFloat?) {
226
+ if radius != topStartRadius {
227
+ topStartRadius = radius
228
+ updateBorderRadius()
229
+ }
230
+ }
231
+
232
+ func setBorderTopEndRadius(_ radius: CGFloat?) {
233
+ if radius != topEndRadius {
234
+ topEndRadius = radius
235
+ updateBorderRadius()
236
+ }
237
+ }
238
+
239
+ func setTintColor(_ color: UIColor?) {
240
+ if color != glassTintColor {
241
+ glassTintColor = color
242
+ updateEffect()
243
+ }
244
+ }
245
+
246
+ func setInteractive(_ interactive: Bool) {
247
+ if interactive != glassIsInteractive {
248
+ glassIsInteractive = interactive
249
+ // Changing isInteractive requires cleaning of previous GlassEffect
250
+ glassEffectView.effect = UIVisualEffect()
251
+ updateEffect()
252
+ }
253
+ }
254
+
255
+ func setColorScheme(_ colorScheme: GlassColorScheme) {
256
+ if glassColorScheme != colorScheme {
257
+ glassColorScheme = colorScheme
258
+ updateEffect()
259
+ }
260
+ }
261
+
262
+ public override func didMoveToWindow() {
263
+ super.didMoveToWindow()
264
+ if self.window == nil {
265
+ isMounted = false
266
+ } else {
267
+ // https://github.com/expo/expo/issues/43732
268
+ // UIGlassEffect must be created during layoutSubviews; layoutSubviews may
269
+ // not fire on re-entry if the geometry hasn't changed, so request a pass.
270
+ setNeedsLayout()
271
+ }
272
+ }
273
+
274
+ private func updateEffect() {
275
+ if !isMounted {
276
+ return
277
+ }
278
+ guard isGlassEffectAvailable() else {
279
+ return
280
+ }
281
+ if #available(iOS 26.0, tvOS 26.0, macOS 26.0, *) {
282
+ #if compiler(>=6.2) // Xcode 26
283
+ if let effect = glassEffect as? UIGlassEffect {
284
+ effect.tintColor = glassTintColor
285
+ effect.isInteractive = glassIsInteractive ?? false
286
+ if let colorScheme = glassColorScheme {
287
+ glassEffectView.overrideUserInterfaceStyle = colorScheme.toUIUserInterfaceStyle()
288
+ }
289
+ // we need to set the effect again or it has no effect!
290
+ glassEffectView.effect = effect
291
+ updateBorderRadius()
292
+ setBorderCurve(nil)
293
+ }
294
+ #endif
295
+ }
296
+ }
297
+
298
+ public override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
299
+ glassEffectView.contentView.insertSubview(childComponentView, at: index)
300
+ }
301
+
302
+ public override func unmountChildComponentView(_ childComponentView: UIView, index: Int) {
303
+ childComponentView.removeFromSuperview()
304
+ }
305
+ }
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@funkit/connect-rn",
3
- "version": "7.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "React Native bindings for @funkit/connect. Re-exports the headless @funkit/connect-core logic; the RN platform halves (Restyle theme, WebView Swapped transport, Transfer/Swapped screens, logging) land in later releases.",
5
5
  "files": [
6
6
  "dist",
7
+ "ios",
8
+ "expo-module.config.json",
7
9
  "CHANGELOG.md"
8
10
  ],
9
11
  "type": "module",
@@ -42,18 +44,22 @@
42
44
  "colord": "2.10.0",
43
45
  "libphonenumber-js": "1.13.6",
44
46
  "react-i18next": "12.3.1",
45
- "@funkit/api-base": "8.4.0",
46
- "@funkit/chains": "2.4.0",
47
- "@funkit/connect-core": "8.2.0"
47
+ "@funkit/api-base": "8.5.1",
48
+ "@funkit/connect-core": "8.4.0",
49
+ "@funkit/chains": "2.4.1",
50
+ "@funkit/utils": "5.0.1"
48
51
  },
49
52
  "peerDependencies": {
50
53
  "@gorhom/bottom-sheet": ">=5",
51
54
  "@react-native-async-storage/async-storage": ">=1.23.1",
52
55
  "@react-native-clipboard/clipboard": ">=1.13.0",
53
56
  "@react-native-community/datetimepicker": ">=8",
57
+ "@solana/web3.js": ">=1.98.0",
54
58
  "@statsig/react-bindings": ">=3.25",
55
59
  "@stripe/stripe-react-native": ">=0.76.0 <1",
56
60
  "@tanstack/react-query": ">=5.0.0",
61
+ "expo": ">=52",
62
+ "expo-blur": ">=14",
57
63
  "i18next": ">=23",
58
64
  "react": ">=18",
59
65
  "react-native": ">=0.74",
@@ -76,6 +82,8 @@
76
82
  "@tanstack/react-query": "5.76.1",
77
83
  "@types/react": "^19.2.2",
78
84
  "@types/react-dom": "^19.0.0",
85
+ "expo": "~57.0.21",
86
+ "expo-blur": "~57.0.2",
79
87
  "i18next": "25.6.2",
80
88
  "react": "^19.0.0",
81
89
  "react-dom": "^19.0.0",
@@ -93,7 +101,8 @@
93
101
  "tsc-alias": "1.8.16",
94
102
  "viem": ">=2.22.14",
95
103
  "vite": "^6.4.2",
96
- "vitest": "^4.1.6"
104
+ "vitest": "^4.1.6",
105
+ "@funkit/fun-relay": "3.1.1"
97
106
  },
98
107
  "repository": {
99
108
  "type": "git",
@@ -108,6 +117,9 @@
108
117
  "@react-native-community/datetimepicker": {
109
118
  "optional": true
110
119
  },
120
+ "@solana/web3.js": {
121
+ "optional": true
122
+ },
111
123
  "@stripe/stripe-react-native": {
112
124
  "optional": true
113
125
  },
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/statsig/useDynamicConfig.ts", "../src/geo/useUserIpInfo.ts", "../src/withdrawal/useSourceTokenUsdPrice.ts", "../src/hooks/useIsStablecoin.ts"],
4
- "sourcesContent": ["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 { useFunkitIdentity } from '../identity/IdentityContext'\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. `apiKey` lets the core hook reach the\n// first-party geo endpoint; the chain it picks is Statsig-driven.\nexport function useUserIpInfo() {\n const { apiKey } = useFunkitIdentity()\n\n // Login-agnostic + session-stable: always run, never go stale. The fiat\n // rail prices a US buyer by state, so a stateless answer is worth a second\n // provider here; web reads only the country and leaves this off.\n return useCoreUserIpInfo({\n logger,\n apiKey,\n enabled: true,\n staleTime: Number.POSITIVE_INFINITY,\n requireState: true,\n })\n}\n", "import { getAssetPriceInfoWithFallback } from '@funkit/connect-core'\nimport { useQuery } from '@tanstack/react-query'\n\nimport type { WithdrawalToken } from '../flow/withdrawalFlowConfig'\nimport { useIsStablecoin } from '../hooks/useIsStablecoin'\nimport { useFunkitIdentity } from '../identity/IdentityContext'\nimport { logger } from '../logging/logger'\n\nconst SOURCE_TOKEN_PRICE_QUERY_KEY = 'sourceTokenUsdPrice'\n\n/** Long enough that typing doesn't refetch, short enough to stay honest. */\nconst PRICE_STALE_TIME_MS = 60_000\n\n/** What a dollar stablecoin is worth, without asking anyone. */\nconst STABLECOIN_USD_PRICE = 1\n\n/**\n * Spot USD price of the source token, for the USD floor and ceiling the host\n * configures (`getMinWithdrawalUSD` / `getMaxWithdrawalUSD`).\n *\n * A dollar stablecoin is priced from its symbol and never fetched, as web's\n * `useAssetAddressPrice` does \u2014 it is the common withdrawal source, and the\n * amount screen was waiting on a round trip to be told a dollar is a dollar.\n *\n * `0` means \"unknown\", which is what the core validator reads as \"no price\" \u2014\n * so a failed or in-flight lookup leaves the USD limits inert rather than\n * judging an amount against a made-up rate. Per-token limits and the balance\n * check are unaffected either way.\n *\n * Not every source has a price: Lighter's L2 assets are addressed by index, not\n * by an ERC-20 funkit's price API knows, so that lookup 404s and core's Relay\n * fallback is what prices them.\n */\nexport function useSourceTokenUsdPrice(sourceToken: WithdrawalToken): number {\n const { apiKey } = useFunkitIdentity()\n const isStablecoin = useIsStablecoin()\n const isStable = isStablecoin(sourceToken.symbol)\n\n const { data } = useQuery({\n queryKey: [\n SOURCE_TOKEN_PRICE_QUERY_KEY,\n apiKey,\n sourceToken.chainId,\n sourceToken.address,\n ],\n queryFn: async () => {\n const info = await getAssetPriceInfoWithFallback({\n chainId: sourceToken.chainId,\n assetTokenAddress: sourceToken.address,\n apiKey,\n logger,\n })\n const unitPrice = info.unitPrice\n if (!Number.isFinite(unitPrice) || unitPrice <= 0) {\n // Reported here, not on read: a cached bad price would otherwise warn\n // on every render. A non-positive price would silently scale every USD\n // limit to nothing.\n logger.warn('connect-rn:withdrawal:unusable_source_price', {\n chainId: sourceToken.chainId,\n address: sourceToken.address,\n unitPrice,\n })\n return 0\n }\n return unitPrice\n },\n enabled: !!apiKey && !isStable,\n staleTime: PRICE_STALE_TIME_MS,\n retry: false,\n })\n\n return isStable ? STABLECOIN_USD_PRICE : (data ?? 0)\n}\n", "import { useCallback } from 'react'\nimport { useDynamicConfig } from '../statsig/useDynamicConfig'\n\nexport type IsStablecoinFn = (symbol: string) => boolean\n\nexport function useIsStablecoin(): IsStablecoinFn {\n const stablecoinSymbols = useDynamicConfig('stablecoinsymbols')\n return useCallback(\n (symbol: string) =>\n stablecoinSymbols.some((stable) =>\n symbol.toLowerCase().includes(stable.toLowerCase()),\n ),\n [stablecoinSymbols],\n )\n}\n"],
5
- "mappings": ";;;;;;AAAA;AAAA,EAGE,oBAAoB;AAAA,OACf;;;ACJP,SAAS,iBAAiB,yBAAyB;AAiB5C,SAAS,gBAAgB;AAC9B,QAAM,EAAE,OAAO,IAAI,kBAAkB;AAKrC,SAAO,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW,OAAO;AAAA,IAClB,cAAc;AAAA,EAChB,CAAC;AACH;;;ADfO,IAAM,mBAAmB,CAC9B,MACA,YAG6B;AAC7B,QAAM,EAAE,WAAW,IAAI,cAAc;AACrC,SAAO,qBAAqB,MAAM;AAAA,IAChC,mBAAmB,SAAS;AAAA,IAC5B,aAAa,YAAY;AAAA,EAC3B,CAAC;AACH;;;AE1BA,SAAS,qCAAqC;AAC9C,SAAS,gBAAgB;;;ACDzB,SAAS,mBAAmB;AAKrB,SAAS,kBAAkC;AAChD,QAAM,oBAAoB,iBAAiB,mBAAmB;AAC9D,SAAO;AAAA,IACL,CAAC,WACC,kBAAkB;AAAA,MAAK,CAAC,WACtB,OAAO,YAAY,EAAE,SAAS,OAAO,YAAY,CAAC;AAAA,IACpD;AAAA,IACF,CAAC,iBAAiB;AAAA,EACpB;AACF;;;ADNA,IAAM,+BAA+B;AAGrC,IAAM,sBAAsB;AAG5B,IAAM,uBAAuB;AAmBtB,SAAS,uBAAuB,aAAsC;AAC3E,QAAM,EAAE,OAAO,IAAI,kBAAkB;AACrC,QAAM,eAAe,gBAAgB;AACrC,QAAM,WAAW,aAAa,YAAY,MAAM;AAEhD,QAAM,EAAE,KAAK,IAAI,SAAS;AAAA,IACxB,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,IACA,SAAS,YAAY;AACnB,YAAM,OAAO,MAAM,8BAA8B;AAAA,QAC/C,SAAS,YAAY;AAAA,QACrB,mBAAmB,YAAY;AAAA,QAC/B;AAAA,QACA;AAAA,MACF,CAAC;AACD,YAAM,YAAY,KAAK;AACvB,UAAI,CAAC,OAAO,SAAS,SAAS,KAAK,aAAa,GAAG;AAIjD,eAAO,KAAK,+CAA+C;AAAA,UACzD,SAAS,YAAY;AAAA,UACrB,SAAS,YAAY;AAAA,UACrB;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAAA,IACA,SAAS,CAAC,CAAC,UAAU,CAAC;AAAA,IACtB,WAAW;AAAA,IACX,OAAO;AAAA,EACT,CAAC;AAED,SAAO,WAAW,uBAAwB,QAAQ;AACpD;",
6
- "names": []
7
- }