@funkit/connect 4.0.3 → 4.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.
- package/CHANGELOG.md +26 -0
- package/dist/{chunk-3F3EYDDR.js → chunk-5BMBHTAR.js} +2 -9
- package/dist/{chunk-OMAXDH7G.js → chunk-REN4AGZZ.js} +0 -2
- package/dist/{chunk-LTOE4GIY.js → chunk-TO3BYKDH.js} +2 -9
- package/dist/components/Box/Box.d.ts +51 -51
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +2 -1
- package/dist/components/HelpAlert/HelpAlert.d.ts +6 -0
- package/dist/config/getDefaultConfig.d.ts +34 -34
- package/dist/consts/customers.d.ts +1 -0
- package/dist/consts/funkit.d.ts +0 -1
- package/dist/css/sprinkles.css.d.ts +53 -83
- package/dist/domains/checkoutFees.d.ts +1 -1
- package/dist/domains/quote.d.ts +2 -6
- package/dist/hooks/useMountEffect.d.ts +8 -0
- package/dist/index.css +1849 -2397
- package/dist/index.js +1967 -1722
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +1 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +6 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -0
- package/dist/providers/FunkitCheckoutContext.d.ts +2 -3
- package/dist/providers/FunkitConfigContext.d.ts +0 -7
- package/dist/providers/FunkitHistoryContext.d.ts +1 -1
- package/dist/providers/FunkitMeshProvider.d.ts +2 -0
- package/dist/providers/FunkitThemeProvider.d.ts +3 -48
- package/dist/providers/GeneralWalletProvider.d.ts +8 -8
- package/dist/providers/ModalContext.d.ts +0 -4
- package/dist/{scroll-G557LOXM.js → scroll-G3S4ZVYZ.js} +1 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/types/utils.d.ts +0 -6
- package/dist/utils/checkout.d.ts +8 -39
- package/dist/utils/checkoutHistory.d.ts +7 -0
- package/dist/utils/flags/config.d.ts +15 -1
- package/dist/utils/mesh.d.ts +3 -2
- package/dist/wallets/groupedWallets.d.ts +0 -1
- package/dist/wallets/latestWalletId.d.ts +0 -2
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +63 -63
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +5 -5
- package/dist/components/FunButton/FunViewTxButton.d.ts +0 -5
- package/dist/components/FunProgressBar/FunHorizontalStepper.d.ts +0 -7
- package/dist/hooks/useChainId.d.ts +0 -1
- package/dist/hooks/useCheckoutChains.d.ts +0 -1
- package/dist/hooks/useCheckoutType.d.ts +0 -5
- package/dist/hooks/useWindowSize.d.ts +0 -4
- package/dist/modals/DevTest/FunDevTestModal.d.ts +0 -6
|
@@ -15,6 +15,7 @@ export type ConfirmationStepNext = {
|
|
|
15
15
|
depositAddress: Address;
|
|
16
16
|
moonpayData?: MoonpayDepositData;
|
|
17
17
|
paymentMethodInfo: PaymentMethodInfo;
|
|
18
|
+
redirectBackToSourceChange?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const ConfirmationStepInfo: ModalStepInfo<FunCheckoutStep.CONFIRMATION>;
|
|
20
21
|
export declare function ConfirmationStep({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.CONFIRMATION>): React.JSX.Element;
|
|
@@ -8,13 +8,19 @@ export type SourceChangeState = CheckoutModalCommonState & {
|
|
|
8
8
|
export type SourceChangeNext = {
|
|
9
9
|
connectNew: false;
|
|
10
10
|
paymentMethodInfo: ConnectablePaymentMethodInfo;
|
|
11
|
+
brokerageFailed: false;
|
|
11
12
|
} | {
|
|
12
13
|
connectNew: true;
|
|
13
14
|
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD>;
|
|
15
|
+
brokerageFailed: false;
|
|
14
16
|
} | {
|
|
15
17
|
connectNew: true;
|
|
16
18
|
paymentMethod: PaymentMethod.CARD;
|
|
17
19
|
paymentMethodInfo: PaymentMethodCardInfo;
|
|
20
|
+
brokerageFailed: false;
|
|
21
|
+
} | {
|
|
22
|
+
brokerageFailed: true;
|
|
23
|
+
paymentMethodInfo: ConnectablePaymentMethodInfo;
|
|
18
24
|
};
|
|
19
25
|
export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
|
|
20
26
|
export declare function SourceChange({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
|
|
@@ -81,6 +81,7 @@ type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
81
81
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenNext;
|
|
82
82
|
}[S] & {
|
|
83
83
|
reverseAnimation?: boolean;
|
|
84
|
+
wipeHistory?: boolean;
|
|
84
85
|
};
|
|
85
86
|
export declare function useCheckoutModalTransition(checkoutItem: FunkitActiveCheckoutItem, onClose: () => void): {
|
|
86
87
|
animation: import("~/hooks/useAnimatedNavigation").AnimationState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig } from '@funkit/api-base';
|
|
1
|
+
import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
3
|
import { type Abi, type Address } from 'viem';
|
|
4
4
|
import type { AssetHoldingsItem } from '~/utils/assets';
|
|
@@ -29,12 +29,11 @@ export interface FunkitCheckoutActionParams {
|
|
|
29
29
|
functionArgs: unknown[];
|
|
30
30
|
value?: bigint;
|
|
31
31
|
}
|
|
32
|
-
export type DydxAddress = `dydx${string}`;
|
|
33
32
|
export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'checkoutItemAmount' | 'externalCheckoutUserId'> {
|
|
34
33
|
/** List of contract action params **/
|
|
35
34
|
generateActionsParams?: (targetAssetAmount: number) => FunkitCheckoutActionParams[];
|
|
36
35
|
/** Custom recipient address of the checkout. If specified, a different checkout flow will be executed. It is not recommended to set this unless the Fun.xyz team advises it. **/
|
|
37
|
-
customRecipient?:
|
|
36
|
+
customRecipient?: FunAddress;
|
|
38
37
|
/** ****************************************
|
|
39
38
|
* Checkout ModalUI-related configurations *
|
|
40
39
|
*******************************************/
|
|
@@ -4,7 +4,6 @@ export interface FunkitTextCustomizationsConfig {
|
|
|
4
4
|
brokerageOrExchange: string;
|
|
5
5
|
debitOrCredit: string;
|
|
6
6
|
accountBalance: string;
|
|
7
|
-
transferCrypto: string;
|
|
8
7
|
selectAccount: string;
|
|
9
8
|
sourceMethodTitle: string;
|
|
10
9
|
transferTokens: string;
|
|
@@ -54,10 +53,6 @@ export type FunkitConfig = {
|
|
|
54
53
|
apiKey: string;
|
|
55
54
|
/** App name **/
|
|
56
55
|
appName: string;
|
|
57
|
-
/** App logo (rendered as 80px x 80px) **/
|
|
58
|
-
appLogoSrc?: string;
|
|
59
|
-
/** App logo background color (defaults to transparent) **/
|
|
60
|
-
appLogoBackgroundColor?: string;
|
|
61
56
|
/** Whether app's background is scrollable when a widget is active **/
|
|
62
57
|
allowBackgroundScroll?: boolean;
|
|
63
58
|
/** Text customizations across all widgets **/
|
|
@@ -68,8 +63,6 @@ export type FunkitConfig = {
|
|
|
68
63
|
loginConfig: Partial<FunkitLoginOptionsConfig>;
|
|
69
64
|
};
|
|
70
65
|
interface FinalFunkitConfigInternal extends FunkitConfig {
|
|
71
|
-
appLogoSrc: string;
|
|
72
|
-
appLogoBackgroundColor: string;
|
|
73
66
|
allowBackgroundScroll: boolean;
|
|
74
67
|
textCustomizations: FunkitTextCustomizationsConfig;
|
|
75
68
|
loginConfig: FunkitLoginOptionsConfig;
|
|
@@ -13,7 +13,7 @@ interface FunkitCheckoutHistoryContextInterface {
|
|
|
13
13
|
isCheckoutHistoryInited: boolean;
|
|
14
14
|
isRefreshingCheckoutHistory: boolean;
|
|
15
15
|
refreshCheckoutHistory(): void;
|
|
16
|
-
startCheckoutHistoryListener(recipientAddr?: Address): NodeJS.Timeout;
|
|
16
|
+
startCheckoutHistoryListener(recipientAddr?: Address, expedited?: boolean): NodeJS.Timeout;
|
|
17
17
|
stopCheckoutHistoryListener(cancelIntervalId?: NodeJS.Timeout): void;
|
|
18
18
|
}
|
|
19
19
|
export declare function FunkitCheckoutHistoryProvider({ children, }: {
|
|
@@ -18,6 +18,8 @@ interface FunkitMeshHook {
|
|
|
18
18
|
onConnected(connection: MeshConnectionInfo | null): void;
|
|
19
19
|
onMeshModalClose(): void;
|
|
20
20
|
}
|
|
21
|
+
export declare function getMeshDeviceIdFromLocalStorage(): string | null;
|
|
22
|
+
export declare function postTokensToProxyServer(apiKey: string, brokerType: string, accessToken: string, refreshToken: string | null, accessTokenExpiresIn: number, refreshTokenExpiresIn?: number): Promise<void>;
|
|
21
23
|
/**
|
|
22
24
|
* all hooks SHOULD be in object method style
|
|
23
25
|
* capturing the latest value in render.
|
|
@@ -38,11 +38,9 @@ export declare const useActiveTheme: () => {
|
|
|
38
38
|
generalBorderDim: string;
|
|
39
39
|
menuItemBackground: string;
|
|
40
40
|
selectedOptionBorder: string;
|
|
41
|
-
|
|
41
|
+
focusedOptionBorder: string;
|
|
42
42
|
standby: string;
|
|
43
43
|
success: string;
|
|
44
|
-
loadingBase: string;
|
|
45
|
-
loadingAccent: string;
|
|
46
44
|
chainIconBorder: string;
|
|
47
45
|
modalBackdrop: string;
|
|
48
46
|
modalBackground: string;
|
|
@@ -50,7 +48,6 @@ export declare const useActiveTheme: () => {
|
|
|
50
48
|
notificationPrimary: string;
|
|
51
49
|
offBackground: string;
|
|
52
50
|
hoverState: string;
|
|
53
|
-
offBackgroundInverse: string;
|
|
54
51
|
lightStroke: string;
|
|
55
52
|
mediumStroke: string;
|
|
56
53
|
strokeColor: string;
|
|
@@ -69,8 +66,6 @@ export declare const useActiveTheme: () => {
|
|
|
69
66
|
buttonDisabled: string;
|
|
70
67
|
buttonWarning: string;
|
|
71
68
|
buttonSuccess: string;
|
|
72
|
-
buttonTextWarning: string;
|
|
73
|
-
buttonTextSuccess: string;
|
|
74
69
|
buttonTextPrimary: string;
|
|
75
70
|
buttonTextDisabled: string;
|
|
76
71
|
transparent: string;
|
|
@@ -100,10 +95,6 @@ export declare const useActiveTheme: () => {
|
|
|
100
95
|
heavy: string;
|
|
101
96
|
};
|
|
102
97
|
fontSize: {
|
|
103
|
-
'8': {
|
|
104
|
-
fontSize: string;
|
|
105
|
-
lineHeight: string;
|
|
106
|
-
};
|
|
107
98
|
'10': {
|
|
108
99
|
fontSize: string;
|
|
109
100
|
lineHeight: string;
|
|
@@ -132,10 +123,6 @@ export declare const useActiveTheme: () => {
|
|
|
132
123
|
fontSize: string;
|
|
133
124
|
lineHeight: string;
|
|
134
125
|
};
|
|
135
|
-
'23': {
|
|
136
|
-
fontSize: string;
|
|
137
|
-
lineHeight: string;
|
|
138
|
-
};
|
|
139
126
|
'40': {
|
|
140
127
|
fontSize: string;
|
|
141
128
|
lineHeight: string;
|
|
@@ -157,8 +144,6 @@ export declare const useActiveTheme: () => {
|
|
|
157
144
|
dialog: string;
|
|
158
145
|
selectedOption: string;
|
|
159
146
|
selectedWallet: string;
|
|
160
|
-
button: string;
|
|
161
|
-
tooltip: string;
|
|
162
147
|
};
|
|
163
148
|
blurs: {
|
|
164
149
|
modalOverlay: string;
|
|
@@ -185,11 +170,9 @@ export declare const useActiveTheme: () => {
|
|
|
185
170
|
generalBorderDim: string;
|
|
186
171
|
menuItemBackground: string;
|
|
187
172
|
selectedOptionBorder: string;
|
|
188
|
-
|
|
173
|
+
focusedOptionBorder: string;
|
|
189
174
|
standby: string;
|
|
190
175
|
success: string;
|
|
191
|
-
loadingBase: string;
|
|
192
|
-
loadingAccent: string;
|
|
193
176
|
chainIconBorder: string;
|
|
194
177
|
modalBackdrop: string;
|
|
195
178
|
modalBackground: string;
|
|
@@ -197,7 +180,6 @@ export declare const useActiveTheme: () => {
|
|
|
197
180
|
notificationPrimary: string;
|
|
198
181
|
offBackground: string;
|
|
199
182
|
hoverState: string;
|
|
200
|
-
offBackgroundInverse: string;
|
|
201
183
|
lightStroke: string;
|
|
202
184
|
mediumStroke: string;
|
|
203
185
|
strokeColor: string;
|
|
@@ -216,8 +198,6 @@ export declare const useActiveTheme: () => {
|
|
|
216
198
|
buttonDisabled: string;
|
|
217
199
|
buttonWarning: string;
|
|
218
200
|
buttonSuccess: string;
|
|
219
|
-
buttonTextWarning: string;
|
|
220
|
-
buttonTextSuccess: string;
|
|
221
201
|
buttonTextPrimary: string;
|
|
222
202
|
buttonTextDisabled: string;
|
|
223
203
|
transparent: string;
|
|
@@ -247,10 +227,6 @@ export declare const useActiveTheme: () => {
|
|
|
247
227
|
heavy: string;
|
|
248
228
|
};
|
|
249
229
|
fontSize: {
|
|
250
|
-
'8': {
|
|
251
|
-
fontSize: string;
|
|
252
|
-
lineHeight: string;
|
|
253
|
-
};
|
|
254
230
|
'10': {
|
|
255
231
|
fontSize: string;
|
|
256
232
|
lineHeight: string;
|
|
@@ -279,10 +255,6 @@ export declare const useActiveTheme: () => {
|
|
|
279
255
|
fontSize: string;
|
|
280
256
|
lineHeight: string;
|
|
281
257
|
};
|
|
282
|
-
'23': {
|
|
283
|
-
fontSize: string;
|
|
284
|
-
lineHeight: string;
|
|
285
|
-
};
|
|
286
258
|
'40': {
|
|
287
259
|
fontSize: string;
|
|
288
260
|
lineHeight: string;
|
|
@@ -304,8 +276,6 @@ export declare const useActiveTheme: () => {
|
|
|
304
276
|
dialog: string;
|
|
305
277
|
selectedOption: string;
|
|
306
278
|
selectedWallet: string;
|
|
307
|
-
button: string;
|
|
308
|
-
tooltip: string;
|
|
309
279
|
};
|
|
310
280
|
blurs: {
|
|
311
281
|
modalOverlay: string;
|
|
@@ -330,11 +300,9 @@ export declare const useActiveTheme: () => {
|
|
|
330
300
|
generalBorderDim: string;
|
|
331
301
|
menuItemBackground: string;
|
|
332
302
|
selectedOptionBorder: string;
|
|
333
|
-
|
|
303
|
+
focusedOptionBorder: string;
|
|
334
304
|
standby: string;
|
|
335
305
|
success: string;
|
|
336
|
-
loadingBase: string;
|
|
337
|
-
loadingAccent: string;
|
|
338
306
|
chainIconBorder: string;
|
|
339
307
|
modalBackdrop: string;
|
|
340
308
|
modalBackground: string;
|
|
@@ -342,7 +310,6 @@ export declare const useActiveTheme: () => {
|
|
|
342
310
|
notificationPrimary: string;
|
|
343
311
|
offBackground: string;
|
|
344
312
|
hoverState: string;
|
|
345
|
-
offBackgroundInverse: string;
|
|
346
313
|
lightStroke: string;
|
|
347
314
|
mediumStroke: string;
|
|
348
315
|
strokeColor: string;
|
|
@@ -361,8 +328,6 @@ export declare const useActiveTheme: () => {
|
|
|
361
328
|
buttonDisabled: string;
|
|
362
329
|
buttonWarning: string;
|
|
363
330
|
buttonSuccess: string;
|
|
364
|
-
buttonTextWarning: string;
|
|
365
|
-
buttonTextSuccess: string;
|
|
366
331
|
buttonTextPrimary: string;
|
|
367
332
|
buttonTextDisabled: string;
|
|
368
333
|
transparent: string;
|
|
@@ -392,10 +357,6 @@ export declare const useActiveTheme: () => {
|
|
|
392
357
|
heavy: string;
|
|
393
358
|
};
|
|
394
359
|
fontSize: {
|
|
395
|
-
'8': {
|
|
396
|
-
fontSize: string;
|
|
397
|
-
lineHeight: string;
|
|
398
|
-
};
|
|
399
360
|
'10': {
|
|
400
361
|
fontSize: string;
|
|
401
362
|
lineHeight: string;
|
|
@@ -424,10 +385,6 @@ export declare const useActiveTheme: () => {
|
|
|
424
385
|
fontSize: string;
|
|
425
386
|
lineHeight: string;
|
|
426
387
|
};
|
|
427
|
-
'23': {
|
|
428
|
-
fontSize: string;
|
|
429
|
-
lineHeight: string;
|
|
430
|
-
};
|
|
431
388
|
'40': {
|
|
432
389
|
fontSize: string;
|
|
433
390
|
lineHeight: string;
|
|
@@ -449,8 +406,6 @@ export declare const useActiveTheme: () => {
|
|
|
449
406
|
dialog: string;
|
|
450
407
|
selectedOption: string;
|
|
451
408
|
selectedWallet: string;
|
|
452
|
-
button: string;
|
|
453
|
-
tooltip: string;
|
|
454
409
|
};
|
|
455
410
|
blurs: {
|
|
456
411
|
modalOverlay: string;
|
|
@@ -96,15 +96,15 @@ export declare const useFunkitDisconnect: () => {
|
|
|
96
96
|
error: null;
|
|
97
97
|
data: undefined;
|
|
98
98
|
status: "idle";
|
|
99
|
+
isPaused: boolean;
|
|
100
|
+
context: unknown;
|
|
99
101
|
isError: false;
|
|
100
102
|
isPending: false;
|
|
101
103
|
isSuccess: false;
|
|
102
104
|
failureCount: number;
|
|
103
105
|
failureReason: import("@wagmi/core").DisconnectErrorType | null;
|
|
104
|
-
isPaused: boolean;
|
|
105
106
|
variables: undefined;
|
|
106
107
|
isIdle: true;
|
|
107
|
-
context: unknown;
|
|
108
108
|
submittedAt: number;
|
|
109
109
|
connectors: readonly import("wagmi").Connector[];
|
|
110
110
|
} | {
|
|
@@ -114,15 +114,15 @@ export declare const useFunkitDisconnect: () => {
|
|
|
114
114
|
error: null;
|
|
115
115
|
data: undefined;
|
|
116
116
|
status: "pending";
|
|
117
|
+
isPaused: boolean;
|
|
118
|
+
context: unknown;
|
|
117
119
|
isError: false;
|
|
118
120
|
isPending: true;
|
|
119
121
|
isSuccess: false;
|
|
120
122
|
failureCount: number;
|
|
121
123
|
failureReason: import("@wagmi/core").DisconnectErrorType | null;
|
|
122
|
-
isPaused: boolean;
|
|
123
124
|
variables: import("wagmi/query").DisconnectVariables;
|
|
124
125
|
isIdle: false;
|
|
125
|
-
context: unknown;
|
|
126
126
|
submittedAt: number;
|
|
127
127
|
connectors: readonly import("wagmi").Connector[];
|
|
128
128
|
} | {
|
|
@@ -132,15 +132,15 @@ export declare const useFunkitDisconnect: () => {
|
|
|
132
132
|
error: import("@wagmi/core").DisconnectErrorType;
|
|
133
133
|
data: undefined;
|
|
134
134
|
status: "error";
|
|
135
|
+
isPaused: boolean;
|
|
136
|
+
context: unknown;
|
|
135
137
|
isError: true;
|
|
136
138
|
isPending: false;
|
|
137
139
|
isSuccess: false;
|
|
138
140
|
failureCount: number;
|
|
139
141
|
failureReason: import("@wagmi/core").DisconnectErrorType | null;
|
|
140
|
-
isPaused: boolean;
|
|
141
142
|
variables: import("wagmi/query").DisconnectVariables;
|
|
142
143
|
isIdle: false;
|
|
143
|
-
context: unknown;
|
|
144
144
|
submittedAt: number;
|
|
145
145
|
connectors: readonly import("wagmi").Connector[];
|
|
146
146
|
} | {
|
|
@@ -150,15 +150,15 @@ export declare const useFunkitDisconnect: () => {
|
|
|
150
150
|
error: null;
|
|
151
151
|
data: void;
|
|
152
152
|
status: "success";
|
|
153
|
+
isPaused: boolean;
|
|
154
|
+
context: unknown;
|
|
153
155
|
isError: false;
|
|
154
156
|
isPending: false;
|
|
155
157
|
isSuccess: true;
|
|
156
158
|
failureCount: number;
|
|
157
159
|
failureReason: import("@wagmi/core").DisconnectErrorType | null;
|
|
158
|
-
isPaused: boolean;
|
|
159
160
|
variables: import("wagmi/query").DisconnectVariables;
|
|
160
161
|
isIdle: false;
|
|
161
|
-
context: unknown;
|
|
162
162
|
submittedAt: number;
|
|
163
163
|
connectors: readonly import("wagmi").Connector[];
|
|
164
164
|
};
|
|
@@ -33,8 +33,4 @@ export declare function useFunCheckoutHistoryModal(): {
|
|
|
33
33
|
funCheckoutHistoryModalOpen: boolean;
|
|
34
34
|
openFunCheckoutHistoryModal: ((depositAddressInitialPageCombined: string) => void) | undefined;
|
|
35
35
|
};
|
|
36
|
-
export declare function useFunDevTestModal(): {
|
|
37
|
-
funDevTestModalOpen: boolean;
|
|
38
|
-
openFunDevTestModal: (() => void) | undefined;
|
|
39
|
-
};
|
|
40
36
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/providers/chainIcons/scroll.svg
|
|
4
|
-
var scroll_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 444 444"><style>.st0{fill:%23ffeeda}.st2{fill:%23101010}</style><path d="M0 0h444v444H0z" class="st0"/><path d="M333.4 262V110.6c-.2-12.7-10.3-22.9-23-22.9h-158c-34.1.5-61.5 28.4-61.5 62.6 0 11.5 3.1 21.4 7.8 30.1 4 7.2 10.3 14 16.5 19.1 1.8 1.4.9.8 6.3 4.1 7.4 4.5 15.9 6.8 15.9 6.8l-.1 90.6c.2 4.3.6 8.4 1.8 12.3 3.5 12.8 12.4 22.6 24.4 27.3 5 2 10.7 3.3 16.8 3.4l126.2.4c25.1 0 45.5-20.4 45.5-45.6.1-15-7.4-28.4-18.6-36.8" class="st0"/><path d="M336.5 299.9C336 316 322.7 329 306.4 329l-86.8-.3c6.9-8 11.1-18.4 11.1-29.8 0-17.8-10.6-30.1-10.6-30.1h86.4c16.6 0 30.1 13.5 30.1 30.1z" style="fill:%23ebc28e"/><path d="M123.5 186.7c-10-9.5-17-21.7-17-36.3v-1.5c.8-24.8 21.2-44.8 46-45.5h158c4.1.2 7.4 3.1 7.4 7.3v133.7c3.6.6 5.4 1.1 8.9 2.4 2.8 1 6.6 3.2 6.6 3.2V110.7c-.2-12.7-10.3-22.9-23-22.9h-158c-34.1.5-61.5 28.4-61.5 62.6 0 19.9 9.1 36.9 23.9 48.8 1 .8 2 1.9 4.6 1.9 4.6 0 7.9-3.7 7.7-7.7 0-3.4-1.5-4.6-3.6-6.7" class="st2"/><path d="M306.4 253.2H182.5c-8.3.1-15 6.8-15 15.1v17.8c.2 8.2 7.2 15.2 15.6 15.2h9.2v-15.2H183v-17.4h5c15.7 0 27.2 14.5 27.2 30.1 0 13.8-12.6 31.4-33.6 30-18.6-1.2-28.7-17.8-28.7-30v-151c0-6.8-5.6-12.4-12.4-12.4h-12.4v15.5h9.2v148c-.5 30.1 21.4 45.2 44.3 45.2l124.9.4c25.1 0 45.5-20.4 45.5-45.6.1-25.2-20.4-45.7-45.6-45.7m30.1 46.7C336 316 322.7 329 306.4 329l-86.8-.3c6.9-8 11.1-18.4 11.1-29.8 0-17.8-10.6-30.1-10.6-30.1h86.4c16.6 0 30.1 13.5 30.1 30.1zM273 153.7h-93.4v-15.5H273c4.2 0 7.7 3.4 7.7 7.7.1 4.3-3.3 7.8-7.7 7.8" class="st2"/><path d="M273 226.4h-93.4V211H273c4.2 0 7.7 3.4 7.7 7.7.1 4.2-3.3 7.7-7.7 7.
|
|
4
|
+
var scroll_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 444 444"><style>.st0{fill:%23ffeeda}.st2{fill:%23101010}</style><path d="M0 0h444v444H0z" class="st0"/><path d="M333.4 262V110.6c-.2-12.7-10.3-22.9-23-22.9h-158c-34.1.5-61.5 28.4-61.5 62.6 0 11.5 3.1 21.4 7.8 30.1 4 7.2 10.3 14 16.5 19.1 1.8 1.4.9.8 6.3 4.1 7.4 4.5 15.9 6.8 15.9 6.8l-.1 90.6c.2 4.3.6 8.4 1.8 12.3 3.5 12.8 12.4 22.6 24.4 27.3 5 2 10.7 3.3 16.8 3.4l126.2.4c25.1 0 45.5-20.4 45.5-45.6.1-15-7.4-28.4-18.6-36.8" class="st0"/><path d="M336.5 299.9C336 316 322.7 329 306.4 329l-86.8-.3c6.9-8 11.1-18.4 11.1-29.8 0-17.8-10.6-30.1-10.6-30.1h86.4c16.6 0 30.1 13.5 30.1 30.1z" style="fill:%23ebc28e"/><path d="M123.5 186.7c-10-9.5-17-21.7-17-36.3v-1.5c.8-24.8 21.2-44.8 46-45.5h158c4.1.2 7.4 3.1 7.4 7.3v133.7c3.6.6 5.4 1.1 8.9 2.4 2.8 1 6.6 3.2 6.6 3.2V110.7c-.2-12.7-10.3-22.9-23-22.9h-158c-34.1.5-61.5 28.4-61.5 62.6 0 19.9 9.1 36.9 23.9 48.8 1 .8 2 1.9 4.6 1.9 4.6 0 7.9-3.7 7.7-7.7 0-3.4-1.5-4.6-3.6-6.7" class="st2"/><path d="M306.4 253.2H182.5c-8.3.1-15 6.8-15 15.1v17.8c.2 8.2 7.2 15.2 15.6 15.2h9.2v-15.2H183v-17.4h5c15.7 0 27.2 14.5 27.2 30.1 0 13.8-12.6 31.4-33.6 30-18.6-1.2-28.7-17.8-28.7-30v-151c0-6.8-5.6-12.4-12.4-12.4h-12.4v15.5h9.2v148c-.5 30.1 21.4 45.2 44.3 45.2l124.9.4c25.1 0 45.5-20.4 45.5-45.6.1-25.2-20.4-45.7-45.6-45.7m30.1 46.7C336 316 322.7 329 306.4 329l-86.8-.3c6.9-8 11.1-18.4 11.1-29.8 0-17.8-10.6-30.1-10.6-30.1h86.4c16.6 0 30.1 13.5 30.1 30.1zM273 153.7h-93.4v-15.5H273c4.2 0 7.7 3.4 7.7 7.7.1 4.3-3.3 7.8-7.7 7.8" class="st2"/><path d="M273 226.4h-93.4V211H273c4.2 0 7.7 3.4 7.7 7.7.1 4.2-3.3 7.7-7.7 7.7m16.5-36.4H179.6v-15.5h109.8c4.2 0 7.7 3.4 7.7 7.7.2 4.3-3.3 7.8-7.6 7.8" class="st2"/></svg>';
|
|
5
5
|
export {
|
|
6
6
|
scroll_default as default
|
|
7
7
|
};
|
package/dist/themes/baseTheme.js
CHANGED
package/dist/themes/darkTheme.js
CHANGED
package/dist/types/utils.d.ts
CHANGED
|
@@ -3,12 +3,6 @@ import type { EIP1193Provider } from 'viem';
|
|
|
3
3
|
export type Evaluate<type> = {
|
|
4
4
|
[key in keyof type]: type[key];
|
|
5
5
|
} & unknown;
|
|
6
|
-
/** Removes `readonly` from all properties of an object. */
|
|
7
|
-
export type Mutable<type extends object> = {
|
|
8
|
-
-readonly [key in keyof type]: type[key];
|
|
9
|
-
};
|
|
10
|
-
/** Strict version of built-in Omit type */
|
|
11
|
-
export type Omit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
12
6
|
export type WalletProviderFlags = 'isApexWallet' | 'isAvalanche' | 'isBackpack' | 'isBifrost' | 'isBitKeep' | 'isBitski' | 'isBlockWallet' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isDawn' | 'isEnkrypt' | 'isExodus' | 'isFrame' | 'isFrontier' | 'isGamestop' | 'isHyperPay' | 'isImToken' | 'isKuCoinWallet' | 'isMathWallet' | 'isMetaMask' | 'isNestWallet' | 'isOkxWallet' | 'isOKExWallet' | 'isOneInchAndroidWallet' | 'isOneInchIOSWallet' | 'isOpera' | 'isPhantom' | 'isPortal' | 'isRabby' | 'isRainbow' | 'isStatus' | 'isTally' | 'isTokenPocket' | 'isTokenary' | 'isTrust' | 'isTrustWallet' | 'isXDEFI' | 'isZerion' | 'isTalisman' | 'isZeal' | 'isCoin98' | 'isMEWwallet' | 'isSafeheron' | 'isSafePal';
|
|
13
7
|
export type WalletProvider = Evaluate<EIP1193Provider & {
|
|
14
8
|
[key in WalletProviderFlags]?: true | undefined;
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type CheckoutHistoryItem
|
|
1
|
+
import { type CheckoutHistoryItem } from '@funkit/api-base';
|
|
2
2
|
import { type Config } from '@wagmi/core';
|
|
3
3
|
import { type Address } from 'viem';
|
|
4
4
|
import type { UseConfigReturnType } from 'wagmi';
|
|
5
5
|
import { PaymentMethod } from '../domains/paymentMethods';
|
|
6
|
-
import type { FunkitActiveCheckoutItem, FunkitCheckoutConfig, FunkitCheckoutQuoteResult, HistoricalCheckoutItem, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
6
|
+
import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig, FunkitCheckoutQuoteResult, HistoricalCheckoutItem, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
7
7
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
8
8
|
export declare const MESH_TIME_ESTIMATE_MS = 300000;
|
|
9
9
|
export declare const DUMMY_TRANSFER_PARAMS: {
|
|
@@ -32,43 +32,7 @@ export declare const hasSufficientBalance: (wagmiConfig: UseConfigReturnType, wa
|
|
|
32
32
|
result: boolean;
|
|
33
33
|
tokenTicker: null;
|
|
34
34
|
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Checks whether user has sufficient targetAsset + targetAssetAmount in their wallet
|
|
37
|
-
*/
|
|
38
|
-
export declare const testAutoExecutionDuringCheckout: (config: FunkitCheckoutConfig, walletAddress: string, wagmiConfig: UseConfigReturnType) => Promise<{
|
|
39
|
-
balance: number;
|
|
40
|
-
result: boolean;
|
|
41
|
-
tokenTicker: string;
|
|
42
|
-
} | {
|
|
43
|
-
balance: number;
|
|
44
|
-
result: boolean;
|
|
45
|
-
tokenTicker: null;
|
|
46
|
-
} | {
|
|
47
|
-
result: boolean;
|
|
48
|
-
tokenTicker: null;
|
|
49
|
-
}>;
|
|
50
35
|
export declare function getTokenAddress(tokenTicker: string, chainId: string): Promise<`0x${string}`>;
|
|
51
|
-
export declare function getFunkitEnvForDirectExecution({ chainId, }: {
|
|
52
|
-
chainId: string;
|
|
53
|
-
}): {
|
|
54
|
-
chain: string;
|
|
55
|
-
gasSponsor: {
|
|
56
|
-
sponsorAddress?: Address;
|
|
57
|
-
token?: string;
|
|
58
|
-
usePermit?: boolean;
|
|
59
|
-
useCheckoutSponsor?: boolean;
|
|
60
|
-
};
|
|
61
|
-
apiKey?: string;
|
|
62
|
-
fee?: {
|
|
63
|
-
token?: string;
|
|
64
|
-
amount?: number;
|
|
65
|
-
gasPercent?: number;
|
|
66
|
-
recipient: Address;
|
|
67
|
-
};
|
|
68
|
-
skipDBAction?: boolean;
|
|
69
|
-
nonce?: bigint;
|
|
70
|
-
bypassInit?: boolean;
|
|
71
|
-
};
|
|
72
36
|
/**
|
|
73
37
|
* Generates an env config for checkout estimation
|
|
74
38
|
* So that batch operation creation will not fail even if FW has insufficient funds to pass the estimation.
|
|
@@ -119,7 +83,6 @@ export declare function categorizeCheckoutHistories(checkoutHistoryList: Checkou
|
|
|
119
83
|
depositAddrMap: CheckoutHistoryDepositAddrMap;
|
|
120
84
|
currentDepositAddrMap: CheckoutHistoryDepositAddrMap;
|
|
121
85
|
};
|
|
122
|
-
export declare function getCheckoutStateStepNumber(state: CheckoutState): 0 | 1 | 3 | 2;
|
|
123
86
|
export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCode: string): string;
|
|
124
87
|
/**
|
|
125
88
|
* https://linear.app/funxyz/issue/ENG-1154/update-dydx-and-polymarkets-time-estimate
|
|
@@ -152,3 +115,9 @@ export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutCon
|
|
|
152
115
|
*/
|
|
153
116
|
export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult): number;
|
|
154
117
|
export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress: Address): Promise<number>;
|
|
118
|
+
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig | ServerCheckoutConfig): FunkitCheckoutActionParams[];
|
|
119
|
+
export declare function isCheckoutCrFlow(checkoutItem: FunkitActiveCheckoutItem): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* @param config can be either be a config from live checkoutItem OR from checkout history's clientMetadata
|
|
122
|
+
*/
|
|
123
|
+
export declare function isCheckoutPostActionRequired(config: FunkitCheckoutConfig | ServerCheckoutConfig): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CheckoutHistoryItem } from '@funkit/api-base';
|
|
1
2
|
export declare enum HistoryContentPages {
|
|
2
3
|
DETAIL = "detail",
|
|
3
4
|
HELP = "help"
|
|
@@ -13,3 +14,9 @@ export declare const deconstructDepositAddressAndInitialPage: (combined: string)
|
|
|
13
14
|
export declare function getLatestReportSubmitTime(): number;
|
|
14
15
|
export declare function setLatestReportSubmitTime(timeMs: number): void;
|
|
15
16
|
export declare function clearLatestWalletId(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get the checkout completion time in seconds
|
|
19
|
+
* @param checkout
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCheckoutCompletionTime(checkout: CheckoutHistoryItem): number;
|
|
@@ -27,7 +27,9 @@ export declare enum FlagKey {
|
|
|
27
27
|
/** Token Transfer additional disclaimer text. */
|
|
28
28
|
TokenTransferAdditionalDisclaimer = "token_transfer_additional_disclaimer",
|
|
29
29
|
/** Maximum usd amount that can be checked out. */
|
|
30
|
-
MaxCheckoutUsd = "max_checkout_usd"
|
|
30
|
+
MaxCheckoutUsd = "max_checkout_usd",
|
|
31
|
+
/** Payment proxy server - whether we're using FROG for proxying payment (mesh) requests */
|
|
32
|
+
EnableFrogProxyServer = "enable_frog_proxy_server"
|
|
31
33
|
}
|
|
32
34
|
export declare const flagConfig: {
|
|
33
35
|
disable_mantle_source_assets: {
|
|
@@ -125,4 +127,16 @@ export declare const flagConfig: {
|
|
|
125
127
|
value: string;
|
|
126
128
|
})[];
|
|
127
129
|
};
|
|
130
|
+
enable_frog_proxy_server: {
|
|
131
|
+
type: "boolean";
|
|
132
|
+
default_value: false;
|
|
133
|
+
overrides: {
|
|
134
|
+
if_any: {
|
|
135
|
+
key: "apiKey";
|
|
136
|
+
type: "isAnyOf";
|
|
137
|
+
values: string[];
|
|
138
|
+
}[];
|
|
139
|
+
value: true;
|
|
140
|
+
}[];
|
|
141
|
+
};
|
|
128
142
|
};
|
package/dist/utils/mesh.d.ts
CHANGED
|
@@ -14,9 +14,10 @@ export declare function getMeshSupportedTokensAndIdByChainIdAndBrokerage({ broke
|
|
|
14
14
|
};
|
|
15
15
|
interface MeshAccountInfo {
|
|
16
16
|
apiKey: string;
|
|
17
|
-
|
|
17
|
+
deviceId: string;
|
|
18
18
|
brokerType: MeshExchangeType;
|
|
19
19
|
integrations: TransferIntegration[];
|
|
20
20
|
targetChain: string;
|
|
21
|
+
authToken: string;
|
|
21
22
|
}
|
|
22
|
-
export declare function fetchMeshAccountHoldingsMap(info: MeshAccountInfo): Promise<AssetHoldingsMap>;
|
|
23
|
+
export declare function fetchMeshAccountHoldingsMap(info: MeshAccountInfo, enableFrogProxyServer?: boolean): Promise<AssetHoldingsMap>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { WalletInstance } from './Wallet';
|
|
2
|
-
export declare const groupedWallets: (recentWallets: WalletInstance[], walletInstances: WalletInstance[]) => WalletInstance[];
|
|
3
2
|
export declare const isRecentWallet: (recentWallets: WalletInstance[], walletId: string) => boolean;
|
|
4
3
|
export declare const isFunkitSdkConnector: (wallet: WalletInstance) => boolean;
|
|
5
4
|
export declare const isEIP6963Connector: (wallet: WalletInstance) => boolean;
|