@funkit/connect-rn 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1988 -860
- package/dist/index.js.map +4 -4
- package/dist/src/flow/AddressCopiedToast.d.ts +4 -3
- package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -1
- package/dist/src/flow/FunkitFlowProvider.d.ts +3 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts +68 -0
- package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -0
- package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -1
- package/dist/src/geo/useUserIpInfo.d.ts +2 -21
- package/dist/src/geo/useUserIpInfo.d.ts.map +1 -1
- package/dist/src/hooks/useScreenSize.d.ts +4 -0
- package/dist/src/hooks/useScreenSize.d.ts.map +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
- package/dist/src/icons/FunIcon.d.ts.map +1 -1
- package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -1
- package/dist/src/icons/StatusIcon.d.ts +2 -0
- package/dist/src/icons/StatusIcon.d.ts.map +1 -0
- package/dist/src/icons/TokenChainIcon.d.ts.map +1 -1
- package/dist/src/identity/IdentityContext.d.ts.map +1 -1
- package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
- package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
- package/dist/src/providers/useFunkitCheckout.d.ts +9 -3
- package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts +2 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -1
- package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -1
- package/dist/src/screens/NetworkSelector.d.ts.map +1 -1
- package/dist/src/screens/QrCodeScreen.d.ts +10 -10
- package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
- package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -1
- package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
- package/dist/src/screens/WithdrawMethodScreen.d.ts +30 -0
- package/dist/src/screens/WithdrawMethodScreen.d.ts.map +1 -0
- package/dist/src/statsig/useDynamicConfig.d.ts +6 -0
- package/dist/src/statsig/useDynamicConfig.d.ts.map +1 -0
- package/dist/src/swapped/SwappedScreen.d.ts +6 -14
- package/dist/src/swapped/SwappedScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedScreenShell.d.ts +24 -0
- package/dist/src/swapped/SwappedScreenShell.d.ts.map +1 -0
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts +20 -0
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts.map +1 -0
- package/dist/src/swapped/buildSwappedTheme.d.ts +7 -4
- package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -1
- package/dist/src/swapped/webViewSwappedTransport.d.ts +8 -7
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -1
- package/dist/src/theme/buildFunkitTheme.d.ts +192 -0
- package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -0
- package/dist/src/theme/restyle.d.ts +2818 -2224
- package/dist/src/theme/restyle.d.ts.map +1 -1
- package/dist/src/theme/themes.d.ts +34 -0
- package/dist/src/theme/themes.d.ts.map +1 -0
- package/dist/src/theme/toRestyleTheme.d.ts +257 -205
- package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
- package/dist/src/theme/tokens.d.ts +162 -139
- package/dist/src/theme/tokens.d.ts.map +1 -1
- package/dist/src/transfer/fops.d.ts +8 -0
- package/dist/src/transfer/fops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts +11 -0
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useUDAParams.d.ts +1 -1
- package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts +39 -0
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -0
- package/dist/src/utils/customers.d.ts +2 -0
- package/dist/src/utils/customers.d.ts.map +1 -0
- package/dist/src/withdrawal/publicClient.d.ts +10 -0
- package/dist/src/withdrawal/publicClient.d.ts.map +1 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts +21 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,102 +1,170 @@
|
|
|
1
1
|
import type { TextStyle } from 'react-native';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* stroke colors. Both modes share the same keys; only the values differ.
|
|
3
|
+
* A Figma font-style name (`font/…/weight`). The Fun Variables export defines
|
|
4
|
+
* exactly these two cuts — there is no semibold/bold, so any `fontWeight: '600'`
|
|
5
|
+
* in a component is a smell that should route through the token instead.
|
|
7
6
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
textWarning: string;
|
|
47
|
-
onBtnPrimary: string;
|
|
48
|
-
onBtnPrimaryLoading: string;
|
|
49
|
-
onBtnSecondary: string;
|
|
50
|
-
onBtnSecondaryLoading: string;
|
|
51
|
-
onBtnTertiary: string;
|
|
52
|
-
onBtnIcon: string;
|
|
53
|
-
onBtnDestructive: string;
|
|
54
|
-
onBtnDestructiveLoading: string;
|
|
55
|
-
borderModal: string;
|
|
56
|
-
borderDefault: string;
|
|
57
|
-
borderFocused: string;
|
|
58
|
-
borderSelected: string;
|
|
59
|
-
borderBtnPrimary: string;
|
|
60
|
-
borderBtnSecondary: string;
|
|
61
|
-
brandPrimary: string;
|
|
7
|
+
export type FunkitFontStyleName = 'Regular' | 'Medium';
|
|
8
|
+
/** Logical weight a component's `Text` can request; maps onto `font/body/weight/*`. */
|
|
9
|
+
export type FunkitFontWeight = 'base' | 'medium';
|
|
10
|
+
/** `font/*` — body and header typography. Family is shared by both in Light/Dark. */
|
|
11
|
+
export interface FunkitFontTokens {
|
|
12
|
+
body: {
|
|
13
|
+
/**
|
|
14
|
+
* `font/body/family`. The Fun Variables value is `Inter`, so the host must
|
|
15
|
+
* register `Inter-Regular` / `Inter-Medium` (see {@link fontFamilyForWeight});
|
|
16
|
+
* if it doesn't, RN falls back to the platform system font.
|
|
17
|
+
*/
|
|
18
|
+
family: string;
|
|
19
|
+
weight: Record<FunkitFontWeight, FunkitFontStyleName>;
|
|
20
|
+
size: {
|
|
21
|
+
base: number;
|
|
22
|
+
detail: number;
|
|
23
|
+
};
|
|
24
|
+
leading: {
|
|
25
|
+
base: number;
|
|
26
|
+
detail: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
header: {
|
|
30
|
+
family: string;
|
|
31
|
+
weight: FunkitFontStyleName;
|
|
32
|
+
alignment: 'Left' | 'Center' | 'Right';
|
|
33
|
+
size: {
|
|
34
|
+
title: number;
|
|
35
|
+
subtitle: number;
|
|
36
|
+
amountInput: number;
|
|
37
|
+
amountSummary: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** One button state's fill (`background/button/*` — only `default` + `pressed`). */
|
|
42
|
+
export interface ButtonSurface {
|
|
43
|
+
default: string;
|
|
44
|
+
pressed: string;
|
|
62
45
|
}
|
|
63
46
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* token set, so any `fontWeight: '600'`/`'700'` in a component is a smell that
|
|
67
|
-
* should route through one of these instead.
|
|
47
|
+
* The full token set for one mode — a one-to-one mirror of the Fun Variables
|
|
48
|
+
* Figma variable groups.
|
|
68
49
|
*/
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
50
|
+
export interface FunkitTokens {
|
|
51
|
+
background: {
|
|
52
|
+
modal: string;
|
|
53
|
+
secondary: string;
|
|
54
|
+
button: {
|
|
55
|
+
primary: ButtonSurface;
|
|
56
|
+
secondary: ButtonSurface;
|
|
57
|
+
tertiary: ButtonSurface;
|
|
58
|
+
icon: ButtonSurface;
|
|
59
|
+
destructive: ButtonSurface & {
|
|
60
|
+
disabled: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
pill: {
|
|
64
|
+
default: string;
|
|
65
|
+
pressed: string;
|
|
66
|
+
disabled: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/** `opacity/disabled` — a percentage (0–100); divide by 100 for RN `opacity`. */
|
|
70
|
+
opacity: {
|
|
71
|
+
disabled: number;
|
|
72
|
+
};
|
|
73
|
+
content: {
|
|
74
|
+
elements: {
|
|
75
|
+
primary: string;
|
|
76
|
+
secondary: string;
|
|
77
|
+
success: string;
|
|
78
|
+
error: string;
|
|
79
|
+
hyperlink: string;
|
|
80
|
+
warning: string;
|
|
81
|
+
};
|
|
82
|
+
button: {
|
|
83
|
+
primary: {
|
|
84
|
+
default: string;
|
|
85
|
+
loadingAlpha: string;
|
|
86
|
+
};
|
|
87
|
+
secondary: {
|
|
88
|
+
default: string;
|
|
89
|
+
loadingAlpha: string;
|
|
90
|
+
};
|
|
91
|
+
tertiary: {
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
icon: {
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
destructive: {
|
|
98
|
+
default: string;
|
|
99
|
+
loadingAlpha: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
border: {
|
|
104
|
+
radius: {
|
|
105
|
+
modal: number;
|
|
106
|
+
element: number;
|
|
107
|
+
elementInner: number;
|
|
108
|
+
button: number;
|
|
109
|
+
};
|
|
110
|
+
modal: {
|
|
111
|
+
default: string;
|
|
112
|
+
weight: number;
|
|
113
|
+
};
|
|
114
|
+
elements: {
|
|
115
|
+
default: {
|
|
116
|
+
color: string;
|
|
117
|
+
weight: number;
|
|
118
|
+
};
|
|
119
|
+
selected: {
|
|
120
|
+
color: string;
|
|
121
|
+
weight: number;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
button: {
|
|
125
|
+
primary: string;
|
|
126
|
+
secondary: string;
|
|
127
|
+
weight: number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
font: FunkitFontTokens;
|
|
131
|
+
spacing: {
|
|
132
|
+
padding: {
|
|
133
|
+
elements: {
|
|
134
|
+
horizontal: number;
|
|
135
|
+
};
|
|
136
|
+
modal: {
|
|
137
|
+
horizontal: number;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
heights: {
|
|
141
|
+
topBar: number;
|
|
142
|
+
button: number;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
brand: {
|
|
146
|
+
primary: string;
|
|
147
|
+
};
|
|
148
|
+
button: {
|
|
149
|
+
icon: {
|
|
150
|
+
size: {
|
|
151
|
+
xs: number;
|
|
152
|
+
sm: number;
|
|
153
|
+
md: number;
|
|
154
|
+
lg: number;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
size: {
|
|
158
|
+
xs: number;
|
|
159
|
+
sm: number;
|
|
160
|
+
md: number;
|
|
161
|
+
lg: number;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
96
164
|
}
|
|
97
165
|
/**
|
|
98
|
-
* Resolves a
|
|
99
|
-
* host must register — e.g. `'
|
|
166
|
+
* Resolves a font family + Figma style name to the concrete native font-family
|
|
167
|
+
* name the host must register — e.g. `('Inter', 'Medium')` → `'Inter-Medium'`.
|
|
100
168
|
*
|
|
101
169
|
* This is connect-rn's whole answer to a React Native / Expo quirk: you cannot
|
|
102
170
|
* reliably select a custom font's weight via `fontWeight`. Android matches custom
|
|
@@ -106,54 +174,9 @@ export interface FunkitFontTokens {
|
|
|
106
174
|
* Weight therefore has to be baked into the family name, and every text style
|
|
107
175
|
* goes through here.
|
|
108
176
|
*/
|
|
109
|
-
export declare function fontFamilyForWeight(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
radii: {
|
|
113
|
-
modal: number;
|
|
114
|
-
element: number;
|
|
115
|
-
elementInner: number;
|
|
116
|
-
button: number;
|
|
117
|
-
rounded: number;
|
|
118
|
-
};
|
|
119
|
-
borderWidths: {
|
|
120
|
-
modal: number;
|
|
121
|
-
elementsDefault: number;
|
|
122
|
-
elementsFocused: number;
|
|
123
|
-
elementsSelected: number;
|
|
124
|
-
button: number;
|
|
125
|
-
};
|
|
126
|
-
spacing: {
|
|
127
|
-
none: number;
|
|
128
|
-
elementsHorizontal: number;
|
|
129
|
-
modalHorizontal: number;
|
|
130
|
-
};
|
|
131
|
-
sizes: {
|
|
132
|
-
topBar: number;
|
|
133
|
-
buttonHeight: number;
|
|
134
|
-
buttonXs: number;
|
|
135
|
-
buttonSm: number;
|
|
136
|
-
buttonMd: number;
|
|
137
|
-
buttonLg: number;
|
|
138
|
-
iconXs: number;
|
|
139
|
-
iconSm: number;
|
|
140
|
-
iconMd: number;
|
|
141
|
-
iconLg: number;
|
|
142
|
-
};
|
|
143
|
-
fonts: FunkitFontTokens;
|
|
144
|
-
fontSizes: {
|
|
145
|
-
bodyBase: number;
|
|
146
|
-
bodyDetail: number;
|
|
147
|
-
headerTitle: number;
|
|
148
|
-
headerSubtitle: number;
|
|
149
|
-
amountInput: number;
|
|
150
|
-
amountSummary: number;
|
|
151
|
-
};
|
|
152
|
-
fontLineHeights?: {
|
|
153
|
-
bodyBase: number;
|
|
154
|
-
bodyDetail: number;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
177
|
+
export declare function fontFamilyForWeight(family: string, styleName: FunkitFontStyleName): string;
|
|
178
|
+
/** Figma font-style name → CSS numeric weight (for the Swapped WebView / RN `fontWeight`). */
|
|
179
|
+
export declare const FONT_STYLE_CSS_WEIGHT: Record<FunkitFontStyleName, TextStyle['fontWeight']>;
|
|
157
180
|
export declare const lightTokens: FunkitTokens;
|
|
158
181
|
export declare const darkTokens: FunkitTokens;
|
|
159
182
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,CAAA;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
|
|
@@ -23,4 +23,12 @@ export interface FopRow {
|
|
|
23
23
|
* V1).
|
|
24
24
|
*/
|
|
25
25
|
export declare function toFopRows(fops: SwappedFormOfPayment[], exchangeRates?: ExchangeRates): FopRow[];
|
|
26
|
+
/**
|
|
27
|
+
* Map Swapped payout methods to Withdraw rows. Deliberately NOT {@link toFopRows}:
|
|
28
|
+
* its `getFopsLimit` default invents a "$10k limit" when no exchange rate is
|
|
29
|
+
* available, which would misstate a limit on the user's own money (web's
|
|
30
|
+
* `getWithdrawalFopsDisclaimerLimit` returns no limit without rates). Subtitle
|
|
31
|
+
* is timing-only: bank transfers settle in days, everything else is instant.
|
|
32
|
+
*/
|
|
33
|
+
export declare function toWithdrawFopRows(fops: SwappedFormOfPayment[]): FopRow[];
|
|
26
34
|
//# sourceMappingURL=fops.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fops.d.ts","sourceRoot":"","sources":["../../../src/transfer/fops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAOD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,oBAAoB,EAAE,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAeV"}
|
|
1
|
+
{"version":3,"file":"fops.d.ts","sourceRoot":"","sources":["../../../src/transfer/fops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAOD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,oBAAoB,EAAE,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAeV;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAWxE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RN port of web's `useFiatExchangeRates`: the fiat exchange-rate table used to
|
|
3
|
+
* convert the host's USD source balance into Swapped's EUR sell cap. Keyless
|
|
4
|
+
* endpoint, cached for an hour (rates barely move within a session).
|
|
5
|
+
*/
|
|
6
|
+
export declare function useFiatExchangeRates(enabled?: boolean): {
|
|
7
|
+
data: import("@funkit/api-base").ExchangeRates | undefined;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useFiatExchangeRates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFiatExchangeRates.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFiatExchangeRates.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,UAAO;;;;EAYlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EACL,KAAK,2BAA2B,
|
|
1
|
+
{"version":3,"file":"useFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EACL,KAAK,2BAA2B,EAMjC,MAAM,sBAAsB,CAAA;AAyB7B,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,EAAE,oBAAoB,EAAE,CAAA;IACjC,iFAAiF;IACjF,WAAW,EAAE,oBAAoB,EAAE,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,cAAc,EACd,gBAAgB,EAChB,OAAc,GACf,EAAE,aAAa,GAAG,aAAa,CAgI/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTokenTransfer.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTokenTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACX,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"useTokenTransfer.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTokenTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACX,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,uBAAuB,EAI7B,MAAM,sBAAsB,CAAA;AAwB7B,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,8CAA8C;IAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,gFAAgF;IAChF,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAoCjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUDAParams.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useUDAParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useUDAParams.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useUDAParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAKrD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQ7E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
import { type SwappedWithdrawalLegs } from '@funkit/connect-core';
|
|
3
|
+
import type { WithdrawalFlowConfig } from '../../flow/withdrawalFlowConfig';
|
|
4
|
+
/** Base react-query key for the withdrawal `/fops` query — shared with the
|
|
5
|
+
* flow's invalidation so the two can't drift. */
|
|
6
|
+
export declare const WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
7
|
+
export interface UseWithdrawalFopsParams {
|
|
8
|
+
config: WithdrawalFlowConfig;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface UseWithdrawalFopsResult {
|
|
12
|
+
/**
|
|
13
|
+
* Generic cash payout methods (Card / Bank Transfer / …). Saved FOPs are not
|
|
14
|
+
* supported for withdrawals (web parity) and are never returned.
|
|
15
|
+
*/
|
|
16
|
+
fops: SwappedFormOfPayment[];
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isError: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* True only once we KNOW there's nothing to show (gate off, or a settled
|
|
21
|
+
* fetch returned zero) — never during a load, so the non-retryable
|
|
22
|
+
* "unavailable" screen can't flash.
|
|
23
|
+
*/
|
|
24
|
+
noPaymentMethodsAvailable: boolean;
|
|
25
|
+
/** Source balance can't clear Swapped's €7 minimum sell (cash impossible). */
|
|
26
|
+
isBelowMinimumBalance: boolean;
|
|
27
|
+
refetch: () => void;
|
|
28
|
+
/** Whether the Statsig `enableswappedwithdrawal` gate is on for this apiKey. */
|
|
29
|
+
isWithdrawalEnabled: boolean;
|
|
30
|
+
/** Resolved source→accepted-token route, shared by the fops fetch and quote. */
|
|
31
|
+
route: SwappedWithdrawalLegs;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* RN port of web's `useWithdrawFops`. Orchestrates the steps: resolve the
|
|
35
|
+
* accepted-token legs, the region country/currency, the balance-derived sell
|
|
36
|
+
* cap, then run the gated `/fops` query.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useWithdrawalFops({ config, enabled, }: UseWithdrawalFopsParams): UseWithdrawalFopsResult;
|
|
39
|
+
//# sourceMappingURL=useWithdrawalFops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWithdrawalFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useWithdrawalFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAIL,KAAK,qBAAqB,EAM3B,MAAM,sBAAsB,CAAA;AAO7B,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iCAAiC,CAAA;AAQxC;iDACiD;AACjD,eAAO,MAAM,uBAAuB,iBAAiB,CAAA;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,IAAI,EAAE,oBAAoB,EAAE,CAAA;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,yBAAyB,EAAE,OAAO,CAAA;IAClC,8EAA8E;IAC9E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,gFAAgF;IAChF,mBAAmB,EAAE,OAAO,CAAA;IAC5B,gFAAgF;IAChF,KAAK,EAAE,qBAAqB,CAAA;CAC7B;AAiND;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,OAAc,GACf,EAAE,uBAAuB,GAAG,uBAAuB,CA0HnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/utils/customers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PublicClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only client for a funkit-supported chain, built over the chain's
|
|
4
|
+
* fallback RPC list from @funkit/chains (the chain's default RPC may be
|
|
5
|
+
* private — e.g. the Robinhood chain — so the curated list matters).
|
|
6
|
+
* `undefined` for unsupported chain ids; the caller surfaces that as a
|
|
7
|
+
* mis-routed target.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPublicClientFor(chainId: number): Pick<PublicClient, 'readContract'> | undefined;
|
|
10
|
+
//# sourceMappingURL=publicClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicClient.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/publicClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,MAAM,CAAA;AAM5E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,SAAS,CAehD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SwappedSellOrderData, type SwappedWithdrawalLegs } from '@funkit/connect-core';
|
|
2
|
+
import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig } from '../flow/withdrawalFlowConfig';
|
|
3
|
+
export interface UseWithdrawalExecutionParams {
|
|
4
|
+
config: WithdrawalFlowConfig;
|
|
5
|
+
/** The route resolved by `useWithdrawalFops` — one resolution for fetch + quote. */
|
|
6
|
+
route: SwappedWithdrawalLegs;
|
|
7
|
+
callbacks: WithdrawalFlowCallbacks;
|
|
8
|
+
/** Unrecoverable failure — the flow shows its error state. */
|
|
9
|
+
onError: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Thin React wrapper over connect-core's `processFiatWithdrawalOrder`: owns
|
|
13
|
+
* the control-flow guards for the unreliable embed message stream and maps
|
|
14
|
+
* outcomes onto host callbacks. The guards are intentionally refs, not state —
|
|
15
|
+
* both are read synchronously inside the async `executeOrder` (a re-entrancy
|
|
16
|
+
* flag set before the first await, and a dedupe set) and must not re-render.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useWithdrawalExecution({ config, route, callbacks, onError, }: UseWithdrawalExecutionParams): {
|
|
19
|
+
executeOrder: (data: SwappedSellOrderData) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useWithdrawalExecution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAK3B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAmBrC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,CAAA;IAC5B,oFAAoF;IACpF,KAAK,EAAE,qBAAqB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,8DAA8D;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,GACR,EAAE,4BAA4B,GAAG;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D,CA4FA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect-rn",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@shopify/restyle": "^2.4.5",
|
|
35
35
|
"@funkit/api-base": "6.0.0",
|
|
36
36
|
"@funkit/chains": "2.1.3",
|
|
37
|
-
"@funkit/connect-core": "2.
|
|
37
|
+
"@funkit/connect-core": "2.1.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@gorhom/bottom-sheet": ">=5",
|