@funkit/connect 5.2.0 → 5.2.1

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.
@@ -4,6 +4,10 @@ interface UseQuoteRefreshOptions {
4
4
  * Freeze the latest quote state, e.g. so we do not change the quote mid-confirmation
5
5
  */
6
6
  isOnHold: boolean;
7
+ /**
8
+ * Controls in what interval to refresh the quote data in case of a hard refresh, in case of pre-loading it controls when to set the data, should be more than `BEFORE_COUNTDOWN_ENDS_SEC` by at least 10 seconds to provide the API the time needed to complete the call
9
+ */
10
+ refreshIntervalSeconds: number;
7
11
  }
8
12
  interface UseQuoteRefreshResult {
9
13
  /** Quoting state indicated a bit in advance for UX reasons */
@@ -15,5 +19,5 @@ interface UseQuoteRefreshResult {
15
19
  /** Safe to call asynchronously */
16
20
  refreshQuote(ignorePreloaded?: boolean): Promise<void>;
17
21
  }
18
- export declare function useQuoteRefresh({ isOnHold, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
22
+ export declare function useQuoteRefresh({ isOnHold, refreshIntervalSeconds, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
19
23
  export {};
@@ -1,6 +1,6 @@
1
1
  import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutActionParams, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
2
2
  import React, { type ReactNode } from 'react';
3
- import { type Address } from 'viem';
3
+ import type { Address } from 'viem';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
5
  import { type PaymentMethodInfo } from '../domains/paymentMethods';
6
6
  import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
@@ -78,6 +78,7 @@ export declare const useActiveTheme: () => {
78
78
  buttonBackground: string;
79
79
  buttonBackgroundHover: string;
80
80
  buttonBackgroundDisabled: string;
81
+ buttonBorderHover: string;
81
82
  buttonTextSecondaryDisabled: string;
82
83
  buttonTextSecondary: string;
83
84
  buttonIconBackgroundHover: string;
@@ -172,6 +173,10 @@ export declare const useActiveTheme: () => {
172
173
  youPayYouReceive: string;
173
174
  inputAmountSwitcher: string;
174
175
  qrCode: string;
176
+ skeleton: string;
177
+ tooltip: string;
178
+ dropdown: string;
179
+ dropdownItem: string;
175
180
  };
176
181
  shadows: {
177
182
  connectButton: string;
@@ -249,6 +254,7 @@ export declare const useActiveTheme: () => {
249
254
  buttonBackground: string;
250
255
  buttonBackgroundHover: string;
251
256
  buttonBackgroundDisabled: string;
257
+ buttonBorderHover: string;
252
258
  buttonTextSecondaryDisabled: string;
253
259
  buttonTextSecondary: string;
254
260
  buttonIconBackgroundHover: string;
@@ -343,6 +349,10 @@ export declare const useActiveTheme: () => {
343
349
  youPayYouReceive: string;
344
350
  inputAmountSwitcher: string;
345
351
  qrCode: string;
352
+ skeleton: string;
353
+ tooltip: string;
354
+ dropdown: string;
355
+ dropdownItem: string;
346
356
  };
347
357
  shadows: {
348
358
  connectButton: string;
@@ -418,6 +428,7 @@ export declare const useActiveTheme: () => {
418
428
  buttonBackground: string;
419
429
  buttonBackgroundHover: string;
420
430
  buttonBackgroundDisabled: string;
431
+ buttonBorderHover: string;
421
432
  buttonTextSecondaryDisabled: string;
422
433
  buttonTextSecondary: string;
423
434
  buttonIconBackgroundHover: string;
@@ -512,6 +523,10 @@ export declare const useActiveTheme: () => {
512
523
  youPayYouReceive: string;
513
524
  inputAmountSwitcher: string;
514
525
  qrCode: string;
526
+ skeleton: string;
527
+ tooltip: string;
528
+ dropdown: string;
529
+ dropdownItem: string;
515
530
  };
516
531
  shadows: {
517
532
  connectButton: string;
@@ -2,7 +2,7 @@ import type { AssetBalanceInfo } from '@funkit/api-base';
2
2
  import { Auth, FunWallet } from '@funkit/core';
3
3
  import React, { type ReactNode } from 'react';
4
4
  import type { Address } from 'viem';
5
- import { type Config } from 'wagmi';
5
+ import { type Config, type UseDisconnectReturnType, type UseReconnectReturnType } from 'wagmi';
6
6
  import type { SwitchChainVariables } from 'wagmi/query';
7
7
  import { type FunkitUserInfo } from '../consts/funkit';
8
8
  /** AssetBalanceInfo with known price and totalUsdValue */
@@ -86,82 +86,18 @@ export declare const useFunkitAccount: () => {
86
86
  status: "connecting";
87
87
  };
88
88
  export declare const useFunkitUserInfo: () => FunkitUserInfo;
89
+ export type FunkitDisconnectReturnType = UseDisconnectReturnType & {
90
+ disconnect: () => Promise<void> | void;
91
+ disconnectAsync: () => Promise<void> | void;
92
+ };
89
93
  /**
90
94
  * Replacement for wagmi's `disconnect` from `useDisconnect`
91
95
  */
92
- export declare const useFunkitDisconnect: () => {
93
- disconnect: () => void;
94
- disconnectAsync: () => void;
95
- reset: () => void;
96
- error: null;
97
- data: undefined;
98
- status: "idle";
99
- isPaused: boolean;
100
- context: unknown;
101
- isError: false;
102
- isPending: false;
103
- isSuccess: false;
104
- failureCount: number;
105
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
106
- variables: undefined;
107
- isIdle: true;
108
- submittedAt: number;
109
- connectors: readonly import("wagmi").Connector[];
110
- } | {
111
- disconnect: () => void;
112
- disconnectAsync: () => void;
113
- reset: () => void;
114
- error: null;
115
- data: undefined;
116
- status: "pending";
117
- isPaused: boolean;
118
- context: unknown;
119
- isError: false;
120
- isPending: true;
121
- isSuccess: false;
122
- failureCount: number;
123
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
124
- variables: import("wagmi/query").DisconnectVariables;
125
- isIdle: false;
126
- submittedAt: number;
127
- connectors: readonly import("wagmi").Connector[];
128
- } | {
129
- disconnect: () => void;
130
- disconnectAsync: () => void;
131
- reset: () => void;
132
- error: import("@wagmi/core").DisconnectErrorType;
133
- data: undefined;
134
- status: "error";
135
- isPaused: boolean;
136
- context: unknown;
137
- isError: true;
138
- isPending: false;
139
- isSuccess: false;
140
- failureCount: number;
141
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
142
- variables: import("wagmi/query").DisconnectVariables;
143
- isIdle: false;
144
- submittedAt: number;
145
- connectors: readonly import("wagmi").Connector[];
146
- } | {
147
- disconnect: () => void;
148
- disconnectAsync: () => void;
149
- reset: () => void;
150
- error: null;
151
- data: void;
152
- status: "success";
153
- isPaused: boolean;
154
- context: unknown;
155
- isError: false;
156
- isPending: false;
157
- isSuccess: true;
158
- failureCount: number;
159
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
160
- variables: import("wagmi/query").DisconnectVariables;
161
- isIdle: false;
162
- submittedAt: number;
163
- connectors: readonly import("wagmi").Connector[];
164
- };
96
+ export declare const useFunkitDisconnect: () => FunkitDisconnectReturnType;
97
+ /**
98
+ * Replacement for wagmi's `useReconnect`
99
+ */
100
+ export declare const useFunkitReconnect: () => UseReconnectReturnType;
165
101
  /**
166
102
  * Replacement for wagmi's useSwitchChains
167
103
  */
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-2C7D5NQG.js";
5
+ } from "../chunk-CRPOYQ6X.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-PKXUTXYG.js";
5
- import "../chunk-2C7D5NQG.js";
4
+ } from "../chunk-QMPPK7HO.js";
5
+ import "../chunk-CRPOYQ6X.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-QBCQK5KX.js";
5
- import "../chunk-2C7D5NQG.js";
4
+ } from "../chunk-3LR6KLPU.js";
5
+ import "../chunk-CRPOYQ6X.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -4,7 +4,7 @@ import { type Address } from 'viem';
4
4
  import type { UseConfigReturnType } from 'wagmi';
5
5
  import type { ServerCheckoutConfig } from '~/domains/clientMetadata';
6
6
  import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
7
- import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
7
+ import type { FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
8
8
  export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
9
9
  export declare const MESH_TIME_ESTIMATE_MS = 300000;
10
10
  export declare const DUMMY_TRANSFER_PARAMS: {
@@ -52,7 +52,6 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
52
52
  bypassInit: boolean;
53
53
  apiKey?: string;
54
54
  nonce?: bigint | undefined;
55
- logger?: import("@funkit/api-base").Logger | undefined;
56
55
  fee?: {
57
56
  token?: string;
58
57
  amount?: number;
@@ -60,6 +59,7 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
60
59
  recipient: Address;
61
60
  } | undefined;
62
61
  skipDBAction?: boolean | undefined;
62
+ logger?: import("@funkit/api-base").Logger | undefined;
63
63
  };
64
64
  export type TokenInfo = {
65
65
  symbol: string;
@@ -123,12 +123,5 @@ export declare function isCheckoutPostActionRequired(config: FunkitCheckoutConfi
123
123
  * @returns whether we should show the checkout to the user (ie. supported in current sdk version & not cancelled)
124
124
  */
125
125
  export declare const isCheckoutValid: (checkout: CheckoutHistoryItem) => boolean;
126
- /**
127
- * @returns true if the source and target are the same, a post action is required, is wallet balance, and is for vertex (for now)
128
- */
129
- export declare const isDirectExecutionFlow: ({ checkoutItem, apiKey, }: {
130
- checkoutItem: FunkitActiveCheckoutItem | null;
131
- apiKey: string;
132
- }) => boolean;
133
126
  export declare const isCheckoutHistoryDirectExecution: (checkoutId: string) => boolean;
134
127
  export {};
@@ -58,6 +58,20 @@ export declare const flagConfig: {
58
58
  token_transfer_source_chains_and_assets: {
59
59
  type: "string";
60
60
  default_value: string;
61
+ overrides: {
62
+ if_any: ({
63
+ key: "userId";
64
+ type: "pctRollout";
65
+ pct: number;
66
+ values?: undefined;
67
+ } | {
68
+ key: "userId";
69
+ type: "isAnyOf";
70
+ values: string[];
71
+ pct?: undefined;
72
+ })[];
73
+ value: string;
74
+ }[];
61
75
  };
62
76
  enable_token_transfer_universal_deposit_address: {
63
77
  type: "boolean";
@@ -117,6 +131,14 @@ export declare const flagConfig: {
117
131
  show_info_banner: {
118
132
  type: "string";
119
133
  default_value: string;
134
+ overrides: {
135
+ if_any: {
136
+ key: "apiKey";
137
+ type: "isAnyOf";
138
+ values: string[];
139
+ }[];
140
+ value: string;
141
+ }[];
120
142
  };
121
143
  checkout_notifications_refresh_interval: {
122
144
  type: "string";
@@ -0,0 +1,2 @@
1
+ import type { DynamicTargetAssetCandidate } from '../providers/FunkitCheckoutContext';
2
+ export declare const getTokenIconUrl: (symbol: string, tokens?: DynamicTargetAssetCandidate[]) => string;
@@ -1,25 +1,22 @@
1
1
  "use client";
2
2
  import {
3
- uniswapWallet
4
- } from "./chunk-LH7BMNFZ.js";
3
+ xdefiWallet
4
+ } from "./chunk-NO7XMBB5.js";
5
+ import {
6
+ zealWallet
7
+ } from "./chunk-JROWU5BP.js";
5
8
  import {
6
9
  zerionWallet
7
10
  } from "./chunk-ETTNDQQG.js";
8
11
  import {
9
- walletConnectWallet
10
- } from "./chunk-NP5QGWNL.js";
11
- import {
12
- safepalWallet
13
- } from "./chunk-6LPM6LUQ.js";
14
- import {
15
- talismanWallet
16
- } from "./chunk-ABFSXBE6.js";
12
+ subWallet
13
+ } from "./chunk-4UM4GTKZ.js";
17
14
  import {
18
15
  tahoWallet
19
16
  } from "./chunk-6P2EMPZI.js";
20
17
  import {
21
- tokenaryWallet
22
- } from "./chunk-SLOIIJGP.js";
18
+ talismanWallet
19
+ } from "./chunk-ABFSXBE6.js";
23
20
  import {
24
21
  tokenPocketWallet
25
22
  } from "./chunk-FRGSRLTS.js";
@@ -27,38 +24,44 @@ import {
27
24
  trustWallet
28
25
  } from "./chunk-IPOC2VJX.js";
29
26
  import {
30
- xdefiWallet
31
- } from "./chunk-NO7XMBB5.js";
27
+ tokenaryWallet
28
+ } from "./chunk-SLOIIJGP.js";
32
29
  import {
33
- zealWallet
34
- } from "./chunk-JROWU5BP.js";
30
+ uniswapWallet
31
+ } from "./chunk-LH7BMNFZ.js";
35
32
  import {
36
- safeWallet
37
- } from "./chunk-BQQQL6UD.js";
33
+ walletConnectWallet
34
+ } from "./chunk-NP5QGWNL.js";
38
35
  import {
39
- oneInchWallet
40
- } from "./chunk-OESTDX6I.js";
36
+ phantomWallet
37
+ } from "./chunk-ZSVTX6EK.js";
41
38
  import {
42
- ramperWallet
43
- } from "./chunk-PIUNLQJG.js";
39
+ rabbyWallet
40
+ } from "./chunk-BVX4XGNP.js";
41
+ import {
42
+ rainbowWallet
43
+ } from "./chunk-MOOBCMMB.js";
44
44
  import {
45
45
  roninWallet
46
46
  } from "./chunk-25VW5TZP.js";
47
47
  import {
48
- oneKeyWallet
49
- } from "./chunk-4AD7VI2P.js";
48
+ safeWallet
49
+ } from "./chunk-BQQQL6UD.js";
50
50
  import {
51
- rainbowWallet
52
- } from "./chunk-MOOBCMMB.js";
51
+ ramperWallet
52
+ } from "./chunk-PIUNLQJG.js";
53
53
  import {
54
54
  safeheronWallet
55
55
  } from "./chunk-R6RWZRFF.js";
56
56
  import {
57
- subWallet
58
- } from "./chunk-4UM4GTKZ.js";
57
+ safepalWallet
58
+ } from "./chunk-6LPM6LUQ.js";
59
59
  import {
60
- kresusWallet
61
- } from "./chunk-MJXPRJZT.js";
60
+ ledgerWallet
61
+ } from "./chunk-BRBKM4PW.js";
62
+ import {
63
+ oktoWallet
64
+ } from "./chunk-ADIXAKUL.js";
62
65
  import {
63
66
  metaMaskWallet
64
67
  } from "./chunk-N2NIIUW6.js";
@@ -66,53 +69,53 @@ import {
66
69
  okxWallet
67
70
  } from "./chunk-3U3BMEH5.js";
68
71
  import {
69
- oktoWallet
70
- } from "./chunk-ADIXAKUL.js";
72
+ mewWallet
73
+ } from "./chunk-V57WLZEE.js";
71
74
  import {
72
75
  omniWallet
73
76
  } from "./chunk-7CUY5G6R.js";
74
77
  import {
75
- phantomWallet
76
- } from "./chunk-ZSVTX6EK.js";
77
- import {
78
- mewWallet
79
- } from "./chunk-V57WLZEE.js";
80
- import {
81
- rabbyWallet
82
- } from "./chunk-BVX4XGNP.js";
78
+ oneInchWallet
79
+ } from "./chunk-OESTDX6I.js";
83
80
  import {
84
- coinbaseWallet
85
- } from "./chunk-H4IRCEZN.js";
81
+ oneKeyWallet
82
+ } from "./chunk-4AD7VI2P.js";
86
83
  import {
87
84
  frontierWallet
88
85
  } from "./chunk-HKV7EMYZ.js";
89
86
  import {
90
- imTokenWallet
91
- } from "./chunk-COZ7MIQS.js";
87
+ foxWallet
88
+ } from "./chunk-XYBEMO3C.js";
89
+ import {
90
+ frameWallet
91
+ } from "./chunk-ZMYVTWDF.js";
92
92
  import {
93
93
  gateWallet
94
94
  } from "./chunk-3NC26XLM.js";
95
+ import {
96
+ imTokenWallet
97
+ } from "./chunk-COZ7MIQS.js";
95
98
  import {
96
99
  injectedWallet
97
100
  } from "./chunk-VCVVV2K7.js";
101
+ import {
102
+ kresusWallet
103
+ } from "./chunk-MJXPRJZT.js";
104
+ import {
105
+ clvWallet
106
+ } from "./chunk-LEXSM5KI.js";
98
107
  import {
99
108
  bybitWallet
100
109
  } from "./chunk-W5O4YSZN.js";
101
- import {
102
- ledgerWallet
103
- } from "./chunk-BRBKM4PW.js";
104
110
  import {
105
111
  coin98Wallet
106
112
  } from "./chunk-KFFJPS5R.js";
107
- import {
108
- clvWallet
109
- } from "./chunk-LEXSM5KI.js";
110
113
  import {
111
114
  coreWallet
112
115
  } from "./chunk-JXP2QPW7.js";
113
116
  import {
114
- dawnWallet
115
- } from "./chunk-LN7OD5EC.js";
117
+ coinbaseWallet
118
+ } from "./chunk-H4IRCEZN.js";
116
119
  import {
117
120
  desigWallet
118
121
  } from "./chunk-CTU6JCOK.js";
@@ -120,33 +123,30 @@ import {
120
123
  enkryptWallet
121
124
  } from "./chunk-SJTXS4ZW.js";
122
125
  import {
123
- foxWallet
124
- } from "./chunk-XYBEMO3C.js";
125
- import {
126
- frameWallet
127
- } from "./chunk-ZMYVTWDF.js";
128
- import {
129
- bitgetWallet
130
- } from "./chunk-7GSNBOD3.js";
126
+ dawnWallet
127
+ } from "./chunk-LN7OD5EC.js";
131
128
  import {
132
129
  argentWallet
133
130
  } from "./chunk-WSQ2YJO2.js";
134
131
  import {
135
132
  bifrostWallet
136
133
  } from "./chunk-545L7Y4M.js";
134
+ import {
135
+ bitgetWallet
136
+ } from "./chunk-7GSNBOD3.js";
137
137
  import {
138
138
  bitskiWallet
139
139
  } from "./chunk-P74YPRF6.js";
140
140
  import {
141
- bloomWallet
142
- } from "./chunk-S27IADFU.js";
141
+ bitverseWallet
142
+ } from "./chunk-3HZRRP4Y.js";
143
143
  import {
144
144
  braveWallet
145
145
  } from "./chunk-PB254NQ4.js";
146
146
  import "./chunk-WRA2DVJ7.js";
147
147
  import {
148
- bitverseWallet
149
- } from "./chunk-3HZRRP4Y.js";
148
+ bloomWallet
149
+ } from "./chunk-S27IADFU.js";
150
150
  import "./chunk-23WIEY36.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -66,7 +66,7 @@
66
66
  "@vitejs/plugin-react": "^4.3.1",
67
67
  "autoprefixer": "^10.4.16",
68
68
  "jsdom": "^25.0.1",
69
- "postcss": "^8.4.32",
69
+ "postcss": "^8.4.33",
70
70
  "react": "^18.3.0",
71
71
  "storybook": "^8.6.7",
72
72
  "tsx": "^4.19.2",
@@ -78,11 +78,12 @@
78
78
  "@moonpay/moonpay-react": "^1.6.1",
79
79
  "@number-flow/react": "^0.5.5",
80
80
  "@privy-io/js-sdk-core": "^0.21.0",
81
+ "@reservoir0x/relay-sdk": "^2.0.1",
81
82
  "@types/uuid": "^9.0.8",
82
83
  "@vanilla-extract/css": "1.15.3",
83
84
  "@vanilla-extract/dynamic": "2.1.0",
84
85
  "@vanilla-extract/sprinkles": "1.6.1",
85
- "@wagmi/core": "^2.13.0",
86
+ "@wagmi/core": "2.17.2",
86
87
  "bech32": "^2.0.0",
87
88
  "clsx": "2.1.1",
88
89
  "motion": "^12.0.11",
@@ -91,11 +92,11 @@
91
92
  "react-virtuoso": "4.10.1",
92
93
  "ua-parser-js": "^1.0.37",
93
94
  "uuid": "^9.0.1",
94
- "@funkit/api-base": "1.7.1",
95
- "@funkit/core": "2.3.15",
95
+ "@funkit/api-base": "1.7.2",
96
96
  "@funkit/chains": "0.2.1",
97
97
  "@funkit/utils": "1.0.11",
98
- "@funkit/wagmi-tools": "3.0.37"
98
+ "@funkit/core": "2.3.16",
99
+ "@funkit/wagmi-tools": "3.0.38"
99
100
  },
100
101
  "repository": {
101
102
  "type": "git",