@funkit/connect 12.15.1 → 12.15.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 12.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 932bead: Starting a deposit no longer reopens a previously closed withdrawal.
8
+ - Updated dependencies [cdb4501]
9
+ - Updated dependencies [96f7890]
10
+ - Updated dependencies [032b1a3]
11
+ - Updated dependencies [8189df3]
12
+ - @funkit/connect-core@9.2.0
13
+ - @funkit/api-base@9.0.1
14
+
3
15
  ## 12.15.1
4
16
 
5
17
  ### Patch Changes
@@ -9,10 +9,10 @@ import "../../chunk-6EU6CXNH.js";
9
9
  import {
10
10
  useFunkitConfig
11
11
  } from "../../chunk-6IH7AWFA.js";
12
+ import "../../chunk-4DBUYTEE.js";
12
13
  import {
13
14
  useFunkitTranslation
14
15
  } from "../../chunk-OB5GKTP2.js";
15
- import "../../chunk-4DBUYTEE.js";
16
16
  import "../../chunk-2W2P3OS6.js";
17
17
  import "../../chunk-7JYLS7IF.js";
18
18
  import {
@@ -0,0 +1,15 @@
1
+ import type { FunkitActiveCheckoutItem } from '../providers/FunkitCheckoutContext';
2
+ /**
3
+ * Whether `beginCheckout` should reopen the soft-hidden checkout instead of
4
+ * starting the requested one.
5
+ * - The active item must be the soft-hidden checkout itself. A missing item
6
+ * (cleared on logout) or a different id (a later withdrawal took the active
7
+ * slot) leaves nothing coherent to resume.
8
+ * - `beginCheckout` always asks for a deposit. Resuming a withdrawal item drops
9
+ * the deposit config and runs the old withdrawal's recipient and target.
10
+ */
11
+ export declare function shouldResumeSoftHiddenCheckout({ prefersResume, hiddenCheckoutId, activeCheckoutItem, }: {
12
+ prefersResume: boolean;
13
+ hiddenCheckoutId: string;
14
+ activeCheckoutItem: FunkitActiveCheckoutItem | null;
15
+ }): boolean;
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ function setFunkitConnectVersion({ version }) {
113
113
  localStorage.setItem(storageKey, version);
114
114
  }
115
115
  function getCurrentSdkVersion() {
116
- return "12.15.1";
116
+ return "12.15.2";
117
117
  }
118
118
  function useFingerprint() {
119
119
  const fingerprint = useCallback(() => {
@@ -7667,6 +7667,7 @@ import {
7667
7667
  useClientAsyncInit
7668
7668
  } from "@statsig/react-bindings";
7669
7669
  import React15, { useEffect as useEffect6 } from "react";
7670
+ import { STATSIG_NETWORK_TIMEOUT_MS } from "@funkit/connect-core";
7670
7671
  var STATSIG_API = "https://data-api.fun.xyz/v1";
7671
7672
  var STATSIG_CLIENT_KEY = "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
7672
7673
  function getStatsigOptions(isDevelopment) {
@@ -7675,7 +7676,7 @@ function getStatsigOptions(isDevelopment) {
7675
7676
  api: STATSIG_API,
7676
7677
  // default timeout is 10s which is too large imo
7677
7678
  // 5s should be plenty granted on average statsig responds in <200ms
7678
- networkTimeoutMs: 5e3
7679
+ networkTimeoutMs: STATSIG_NETWORK_TIMEOUT_MS
7679
7680
  // uncomment to test offline mode
7680
7681
  // preventAllNetworkTraffic: true,
7681
7682
  },
@@ -10039,6 +10040,18 @@ function getPolymarketPerpsTargetAssetOverride(qrcodeActionType) {
10039
10040
  return qrcodeActionType === POLYMARKET_PERPS_DEPOSIT_ACTION_TYPE ? POLYMARKET_PUSD_ADDRESS : void 0;
10040
10041
  }
10041
10042
 
10043
+ // src/domains/checkoutConflict.ts
10044
+ function shouldResumeSoftHiddenCheckout({
10045
+ prefersResume,
10046
+ hiddenCheckoutId,
10047
+ activeCheckoutItem
10048
+ }) {
10049
+ if (!prefersResume || !activeCheckoutItem) {
10050
+ return false;
10051
+ }
10052
+ return activeCheckoutItem.id === hiddenCheckoutId && !activeCheckoutItem.isWithdrawal;
10053
+ }
10054
+
10042
10055
  // src/domains/clientMetadata.ts
10043
10056
  function stripFunctionsForBackend(config) {
10044
10057
  return {
@@ -12018,10 +12031,22 @@ function useFunkitCheckout(props) {
12018
12031
  );
12019
12032
  const [pendingCheckoutConfig, setPendingCheckoutConfig] = useState11();
12020
12033
  const onCheckoutConflict = ({
12034
+ hiddenCheckoutId,
12021
12035
  resume,
12022
12036
  replace
12023
12037
  }) => {
12024
- if (isLighterxyzCustomer(apiKey)) {
12038
+ const shouldResume = shouldResumeSoftHiddenCheckout({
12039
+ prefersResume: isLighterxyzCustomer(apiKey),
12040
+ hiddenCheckoutId,
12041
+ activeCheckoutItem: checkoutItem
12042
+ });
12043
+ logger.info("checkoutConflictResolved", {
12044
+ hiddenCheckoutId,
12045
+ activeCheckoutId: checkoutItem?.id,
12046
+ isWithdrawal: !!checkoutItem?.isWithdrawal,
12047
+ shouldResume
12048
+ });
12049
+ if (shouldResume) {
12025
12050
  resume();
12026
12051
  return false;
12027
12052
  }
@@ -17,15 +17,15 @@ import {
17
17
  import {
18
18
  talismanWallet
19
19
  } from "./chunk-IAYYWCVB.js";
20
- import {
21
- tokenaryWallet
22
- } from "./chunk-TPM5PUJD.js";
23
20
  import {
24
21
  tokenPocketWallet
25
22
  } from "./chunk-NXWG6FG2.js";
26
23
  import {
27
24
  trustWallet
28
25
  } from "./chunk-SR5CZR3L.js";
26
+ import {
27
+ tokenaryWallet
28
+ } from "./chunk-TPM5PUJD.js";
29
29
  import {
30
30
  uniswapWallet
31
31
  } from "./chunk-UNDWHCDH.js";
@@ -33,8 +33,8 @@ import {
33
33
  walletConnectWallet
34
34
  } from "./chunk-DUX4XCDV.js";
35
35
  import {
36
- oneKeyWallet
37
- } from "./chunk-KN32ITJ7.js";
36
+ phantomWallet
37
+ } from "./chunk-Q27YVDDH.js";
38
38
  import {
39
39
  rabbyWallet
40
40
  } from "./chunk-RQ2GXOJL.js";
@@ -47,12 +47,12 @@ import {
47
47
  import {
48
48
  roninWallet
49
49
  } from "./chunk-IA5432IR.js";
50
- import {
51
- safeWallet
52
- } from "./chunk-IR3PJMVM.js";
53
50
  import {
54
51
  safeheronWallet
55
52
  } from "./chunk-UN3ONVNC.js";
53
+ import {
54
+ safeWallet
55
+ } from "./chunk-IR3PJMVM.js";
56
56
  import {
57
57
  safepalWallet
58
58
  } from "./chunk-BBB2J3US.js";
@@ -71,18 +71,15 @@ import {
71
71
  import {
72
72
  okxWallet
73
73
  } from "./chunk-CU5J53XR.js";
74
- import {
75
- omniWallet
76
- } from "./chunk-2TAUCVX7.js";
77
74
  import {
78
75
  oneInchWallet
79
76
  } from "./chunk-GFS2AVAH.js";
80
77
  import {
81
- phantomWallet
82
- } from "./chunk-Q27YVDDH.js";
78
+ oneKeyWallet
79
+ } from "./chunk-KN32ITJ7.js";
83
80
  import {
84
- desigWallet
85
- } from "./chunk-DFHP75HV.js";
81
+ omniWallet
82
+ } from "./chunk-2TAUCVX7.js";
86
83
  import {
87
84
  foxWallet
88
85
  } from "./chunk-U52QO5HF.js";
@@ -90,20 +87,26 @@ import {
90
87
  frameWallet
91
88
  } from "./chunk-B572YIAQ.js";
92
89
  import {
93
- frontierWallet
94
- } from "./chunk-IWOMSW64.js";
90
+ enkryptWallet
91
+ } from "./chunk-Z6LDN2AN.js";
95
92
  import {
96
93
  gateWallet
97
94
  } from "./chunk-YRMBR6NA.js";
95
+ import {
96
+ frontierWallet
97
+ } from "./chunk-IWOMSW64.js";
98
98
  import {
99
99
  imTokenWallet
100
100
  } from "./chunk-YY2JA23M.js";
101
+ import {
102
+ kresusWallet
103
+ } from "./chunk-V77ATGZT.js";
101
104
  import {
102
105
  injectedWallet
103
106
  } from "./chunk-M75V7OL3.js";
104
107
  import {
105
- kresusWallet
106
- } from "./chunk-V77ATGZT.js";
108
+ bybitWallet
109
+ } from "./chunk-BBDNB5TQ.js";
107
110
  import {
108
111
  clvWallet
109
112
  } from "./chunk-4FHNLTR3.js";
@@ -114,8 +117,8 @@ import {
114
117
  coinbaseWallet
115
118
  } from "./chunk-SM2A3OSG.js";
116
119
  import {
117
- bybitWallet
118
- } from "./chunk-BBDNB5TQ.js";
120
+ coreWallet
121
+ } from "./chunk-TRZDAXCQ.js";
119
122
  import {
120
123
  customWallet
121
124
  } from "./chunk-VKM5M5UK.js";
@@ -123,33 +126,30 @@ import {
123
126
  dawnWallet
124
127
  } from "./chunk-LV6YV3DE.js";
125
128
  import {
126
- coreWallet
127
- } from "./chunk-TRZDAXCQ.js";
128
- import {
129
- enkryptWallet
130
- } from "./chunk-Z6LDN2AN.js";
129
+ desigWallet
130
+ } from "./chunk-DFHP75HV.js";
131
131
  import {
132
132
  bifrostWallet
133
133
  } from "./chunk-ALGPGI6V.js";
134
- import {
135
- argentWallet
136
- } from "./chunk-XSDTNMQY.js";
137
134
  import {
138
135
  bitskiWallet
139
136
  } from "./chunk-NPITCCJE.js";
140
137
  import {
141
- bitgetWallet
142
- } from "./chunk-HOCKAU5H.js";
143
- import {
144
- bitverseWallet
145
- } from "./chunk-5AEWIKRA.js";
138
+ argentWallet
139
+ } from "./chunk-XSDTNMQY.js";
146
140
  import {
147
141
  bloomWallet
148
142
  } from "./chunk-PNHDOC77.js";
149
- import "./chunk-AALSJCUR.js";
143
+ import {
144
+ bitverseWallet
145
+ } from "./chunk-5AEWIKRA.js";
150
146
  import {
151
147
  braveWallet
152
148
  } from "./chunk-U2XXV45G.js";
149
+ import {
150
+ bitgetWallet
151
+ } from "./chunk-HOCKAU5H.js";
152
+ import "./chunk-AALSJCUR.js";
153
153
  import "./chunk-EYWGX5LT.js";
154
154
  import "./chunk-B454LLKJ.js";
155
155
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "12.15.1",
3
+ "version": "12.15.2",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -119,11 +119,11 @@
119
119
  "ua-parser-js": "^1.0.37",
120
120
  "use-debounce": "^10.0.5",
121
121
  "uuid": "^11.1.1",
122
- "@funkit/api-base": "9.0.0",
123
- "@funkit/fun-relay": "3.1.3",
124
- "@funkit/connect-core": "9.1.0",
122
+ "@funkit/api-base": "9.0.1",
123
+ "@funkit/chains": "2.5.0",
124
+ "@funkit/connect-core": "9.2.0",
125
125
  "@funkit/utils": "5.0.2",
126
- "@funkit/chains": "2.5.0"
126
+ "@funkit/fun-relay": "3.1.3"
127
127
  },
128
128
  "repository": {
129
129
  "type": "git",