@funkit/connect 4.0.2 → 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.
Files changed (83) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/{chunk-3F3EYDDR.js → chunk-5BMBHTAR.js} +2 -9
  3. package/dist/{chunk-OMAXDH7G.js → chunk-REN4AGZZ.js} +0 -2
  4. package/dist/{chunk-LTOE4GIY.js → chunk-TO3BYKDH.js} +2 -9
  5. package/dist/components/Box/Box.d.ts +52 -52
  6. package/dist/components/FunButton/FunButton.css.d.ts +1 -0
  7. package/dist/components/FunCountdown/FunCountdown.d.ts +2 -1
  8. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  9. package/dist/components/FunPayments/FunPaymentMethods.d.ts +2 -1
  10. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +0 -5
  11. package/dist/components/FunTransactionSummary/PaymentFeesSummary.css.d.ts +2 -0
  12. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -4
  13. package/dist/components/HelpAlert/HelpAlert.d.ts +6 -0
  14. package/dist/config/getDefaultConfig.d.ts +34 -34
  15. package/dist/consts/customers.d.ts +2 -0
  16. package/dist/consts/funkit.d.ts +0 -1
  17. package/dist/css/sprinkles.css.d.ts +54 -84
  18. package/dist/domains/checkoutFees.d.ts +1 -1
  19. package/dist/domains/paymentMethods.d.ts +7 -9
  20. package/dist/domains/quote.d.ts +2 -6
  21. package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +25 -0
  22. package/dist/hooks/useMesh.d.ts +2 -2
  23. package/dist/hooks/useMountEffect.d.ts +8 -0
  24. package/dist/index.css +1917 -2399
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +8770 -8396
  27. package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +7 -2
  28. package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +1 -0
  29. package/dist/modals/CheckoutModal/ConfirmationStep/DisclaimerText.d.ts +7 -0
  30. package/dist/modals/CheckoutModal/{InputAmount → ConfirmationStep}/useCheckoutQuote.d.ts +3 -4
  31. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +6 -0
  32. package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -0
  33. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +5 -1
  34. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.css.d.ts +1 -0
  35. package/dist/modals/ProfileDetails/FunProfileViews/Home/Home.css.d.ts +1 -0
  36. package/dist/providers/FunkitCheckoutContext.d.ts +3 -11
  37. package/dist/providers/FunkitConfigContext.d.ts +0 -7
  38. package/dist/providers/FunkitHistoryContext.d.ts +1 -1
  39. package/dist/providers/FunkitMeshProvider.d.ts +11 -15
  40. package/dist/providers/FunkitThemeProvider.d.ts +3 -48
  41. package/dist/providers/GeneralWalletProvider.d.ts +8 -8
  42. package/dist/providers/ModalContext.d.ts +0 -4
  43. package/dist/providers/UserPresenceContext.d.ts +9 -0
  44. package/dist/scroll-G3S4ZVYZ.js +7 -0
  45. package/dist/themes/baseTheme.js +1 -1
  46. package/dist/themes/darkTheme.js +2 -2
  47. package/dist/themes/lightTheme.js +2 -2
  48. package/dist/types/utils.d.ts +0 -6
  49. package/dist/utils/checkout.d.ts +13 -40
  50. package/dist/utils/checkoutHistory.d.ts +7 -0
  51. package/dist/utils/flags/config.d.ts +23 -1
  52. package/dist/utils/mesh.d.ts +3 -2
  53. package/dist/wallets/groupedWallets.d.ts +0 -1
  54. package/dist/wallets/latestWalletId.d.ts +0 -2
  55. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  56. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  57. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  58. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  59. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  60. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  61. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  62. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  63. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  64. package/dist/wallets/walletConnectors/index.js +65 -65
  65. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  66. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  67. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  68. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  69. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  70. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  71. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  72. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  73. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  74. package/package.json +6 -6
  75. package/dist/components/FunButton/FunViewTxButton.d.ts +0 -5
  76. package/dist/components/FunNotification/FunCheckoutNotification.d.ts +0 -7
  77. package/dist/components/FunProgressBar/FunHorizontalStepper.d.ts +0 -7
  78. package/dist/hooks/useChainId.d.ts +0 -1
  79. package/dist/hooks/useCheckoutChains.d.ts +0 -1
  80. package/dist/hooks/useCheckoutType.d.ts +0 -5
  81. package/dist/hooks/useWindowSize.d.ts +0 -4
  82. package/dist/modals/CheckoutModal/useCheckoutQuote.d.ts +0 -7
  83. package/dist/modals/DevTest/FunDevTestModal.d.ts +0 -6
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
- export declare function CheckoutPrimaryInfo({ showTokenAmount, }: {
2
+ import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
3
+ interface CheckoutPrimaryInfoProps {
3
4
  showTokenAmount?: boolean;
4
- }): React.JSX.Element | null;
5
+ checkoutItem: FunkitActiveCheckoutItem;
6
+ isLoading?: boolean;
7
+ }
8
+ export declare function CheckoutPrimaryInfo({ showTokenAmount, checkoutItem, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
9
+ export {};
@@ -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;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface DisclaimerTextProps {
3
+ showDydxDisclaimer: boolean;
4
+ continueText: string;
5
+ }
6
+ export declare const DisclaimerText: ({ showDydxDisclaimer, continueText, }: DisclaimerTextProps) => React.JSX.Element;
7
+ export {};
@@ -1,17 +1,16 @@
1
1
  import { type CheckoutQuoteError } from '../../../providers/FunkitCheckoutContext';
2
2
  interface TriggerNewQuoteOptions {
3
3
  maxRetries: number;
4
- targetAssetAmount: number;
5
4
  }
6
5
  interface UseCheckoutQuoteOptions {
7
- onFailure(error: CheckoutQuoteError): void;
8
- onSuccess(): void;
6
+ onFailure: (error: CheckoutQuoteError) => void;
7
+ onSuccess?: () => void;
9
8
  }
10
9
  interface UseCheckoutQuoteResult {
11
10
  error: string | null;
12
11
  isQuoting: boolean;
13
12
  step: string | null;
14
- triggerNewQuote(options: TriggerNewQuoteOptions): void;
13
+ triggerNewQuote: (options: TriggerNewQuoteOptions) => void;
15
14
  }
16
15
  export declare function useCheckoutQuote({ onFailure, onSuccess, }: UseCheckoutQuoteOptions): UseCheckoutQuoteResult;
17
16
  export {};
@@ -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;
@@ -2,9 +2,13 @@ import type { Operation } from '@funkit/core';
2
2
  import { type PaymentMethodInfo } from '../../domains/paymentMethods';
3
3
  import { type CheckoutQuoteResult, type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
4
4
  import { LoginType } from '../../providers/GeneralWalletProvider';
5
+ export interface SourceAssetConfirmed {
6
+ isQuoteSuccess: boolean;
7
+ maxTargetAssetAmount: number | undefined;
8
+ }
5
9
  export declare function preparePaymentMethodInfo(selectedPaymentMethodInfo: PaymentMethodInfo | null, meshNetworkInfo: {
6
10
  meshNetworkId: string | undefined;
7
- } | null): Promise<import("../../domains/paymentMethods").PaymentMethodCardInfo | import("../../domains/paymentMethods").PaymentMethodBrokerageInfo | import("../../domains/paymentMethods").PaymentMethodAccountInfo>;
11
+ } | null): PaymentMethodInfo;
8
12
  export declare function fetchSponsorInitialTransferGasLimit(checkoutItem: FunkitActiveCheckoutItem, loginType: LoginType, generateCheckoutTransferOpItems: (toAddress: string, tokenAmount: number | string) => Promise<{
9
13
  transferOp: Operation | null;
10
14
  }>): Promise<number>;
@@ -1,2 +1,3 @@
1
1
  export declare const ContentExpanded: string;
2
2
  export declare const ContentCollapsed: string;
3
+ export declare const expandableTriggerBaseStyles: string;
@@ -1,3 +1,4 @@
1
1
  export declare const animateTitleInClass: string;
2
2
  export declare const animateTitleOutClass: string;
3
3
  export declare const animateVirtuosoInClass: string;
4
+ export declare const tabLabelStyles: string;
@@ -1,5 +1,4 @@
1
- import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig } from '@funkit/api-base';
2
- import { type Operation } from '@funkit/core';
1
+ import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
3
2
  import React, { type ReactNode } from 'react';
4
3
  import { type Abi, type Address } from 'viem';
5
4
  import type { AssetHoldingsItem } from '~/utils/assets';
@@ -30,12 +29,11 @@ export interface FunkitCheckoutActionParams {
30
29
  functionArgs: unknown[];
31
30
  value?: bigint;
32
31
  }
33
- export type DydxAddress = `dydx${string}`;
34
32
  export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'checkoutItemAmount' | 'externalCheckoutUserId'> {
35
33
  /** List of contract action params **/
36
34
  generateActionsParams?: (targetAssetAmount: number) => FunkitCheckoutActionParams[];
37
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. **/
38
- customRecipient?: Address | DydxAddress;
36
+ customRecipient?: FunAddress;
39
37
  /** ****************************************
40
38
  * Checkout ModalUI-related configurations *
41
39
  *******************************************/
@@ -55,11 +53,6 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
55
53
  /** User identification within customer's app for logging and customer dashboard purposes (future). **/
56
54
  externalCheckoutUserId?: string;
57
55
  }
58
- export interface CheckoutClientMetadata extends Omit<ApiCheckoutClientMetadata, 'initSettings'> {
59
- initSettings: {
60
- config: FunkitCheckoutConfig;
61
- };
62
- }
63
56
  interface FunkitCheckoutValidationResult {
64
57
  isValid: boolean;
65
58
  message: string;
@@ -95,7 +88,7 @@ interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
95
88
  /**
96
89
  * Checkout Item for frontend use
97
90
  */
98
- export interface FunkitActiveCheckoutItem extends Omit<CheckoutClientMetadata, 'selectedPaymentMethodInfo' | 'initSettings'> {
91
+ export interface FunkitActiveCheckoutItem extends Omit<ApiCheckoutClientMetadata, 'selectedPaymentMethodInfo' | 'initSettings'> {
99
92
  /** Whether the checkout quote is being fetched **/
100
93
  isQuoting: boolean;
101
94
  /** Latest checkout estimated fees and time **/
@@ -132,7 +125,6 @@ interface FunkitCheckoutContextInterface {
132
125
  getCheckoutQuote(sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean): Promise<CheckoutQuoteResult & {
133
126
  shellCheckoutItemWithNextQuote: FunkitActiveCheckoutItem;
134
127
  }>;
135
- generateSignedBatchOperation(actionsParams: FunkitCheckoutActionParams[], assetChainId: string, bypassWalletInit: boolean, stepMessageSetter: (m: string) => void): Promise<null | Operation>;
136
128
  setCheckoutQuote(quote: FunkitActiveCheckoutItem): void;
137
129
  setCompletedTimestamp(timestampMs: number): void;
138
130
  }
@@ -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, }: {
@@ -1,29 +1,25 @@
1
- import { type LinkPayload } from '@meshconnect/web-link-sdk';
2
1
  import React, { type ReactNode } from 'react';
3
- import type { MeshExchangeType } from '~/consts/mesh';
2
+ import { type MeshExchangeType } from '~/consts/mesh';
3
+ export interface MeshConnectionInfo {
4
+ accessToken: string;
5
+ accountId: string;
6
+ brokerType: MeshExchangeType;
7
+ }
4
8
  export declare function FunkitMeshProvider({ children }: {
5
9
  children: ReactNode;
6
10
  }): React.JSX.Element;
7
11
  export declare function useFunkitMesh(): {
12
+ getActiveConnection: (brokerType: MeshExchangeType) => MeshConnectionInfo | null;
13
+ getFirstActiveConnection: () => MeshConnectionInfo | null;
8
14
  unlinkBrokerage: (brokerType: MeshExchangeType) => void;
9
- getActiveConnection: (brokerType: MeshExchangeType) => (LinkPayload & {
10
- connectionExpiresAtMs: number;
11
- }) | null | undefined;
12
- getFirstActiveConnection: () => {
13
- accessToken?: import("@meshconnect/web-link-sdk").AccessTokenPayload;
14
- delayedAuth?: import("@meshconnect/web-link-sdk").DelayedAuthPayload;
15
- connectionExpiresAtMs?: number | undefined;
16
- brokerType: MeshExchangeType;
17
- } | null;
18
15
  };
19
16
  interface FunkitMeshHook {
20
17
  onBeforeConnect(): void;
21
- onConnected(data: {
22
- brokerData: LinkPayload;
23
- brokerType: MeshExchangeType;
24
- } | null): void;
18
+ onConnected(connection: MeshConnectionInfo | null): void;
25
19
  onMeshModalClose(): void;
26
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>;
27
23
  /**
28
24
  * all hooks SHOULD be in object method style
29
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
- paymentOptionBorderDisabled: string;
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
- paymentOptionBorderDisabled: string;
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
- paymentOptionBorderDisabled: string;
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 {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type PropsWithChildren } from 'react';
3
+ interface UserPresence {
4
+ isAway: boolean;
5
+ }
6
+ export declare const UserPresenceContext: React.Context<UserPresence>;
7
+ export declare const UserPresenceProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
8
+ export declare const useUserPresence: () => UserPresence;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
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.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
+ export {
6
+ scroll_default as default
7
+ };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-OMAXDH7G.js";
5
+ } from "../chunk-REN4AGZZ.js";
6
6
  export {
7
7
  baseTheme,
8
8
  systemFontStack
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-LTOE4GIY.js";
5
- import "../chunk-OMAXDH7G.js";
4
+ } from "../chunk-TO3BYKDH.js";
5
+ import "../chunk-REN4AGZZ.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-3F3EYDDR.js";
5
- import "../chunk-OMAXDH7G.js";
4
+ } from "../chunk-5BMBHTAR.js";
5
+ import "../chunk-REN4AGZZ.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -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;
@@ -1,9 +1,9 @@
1
- import { type CheckoutHistoryItem, CheckoutState } from '@funkit/api-base';
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,9 +83,12 @@ 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
- export declare function hackTimeEstimationForImportantCustomer(originalTimeEstimation: number, paymentMethod: PaymentMethod, apiKey: string): any;
87
+ /**
88
+ * https://linear.app/funxyz/issue/ENG-1154/update-dydx-and-polymarkets-time-estimate
89
+ * @returns time estimation in seconds
90
+ */
91
+ export declare function hackTimeEstimationForImportantCustomer(originalTimeEstimationMs: number | undefined, paymentMethod: PaymentMethod, apiKey: string): number;
125
92
  export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem | HistoricalCheckoutItem, apiKey: string): {
126
93
  estimatedEndTimeMs: number;
127
94
  estimatedEndTimeFromNowMs: number;
@@ -148,3 +115,9 @@ export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutCon
148
115
  */
149
116
  export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult): number;
150
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;