@funkit/connect 6.0.4 → 6.0.6

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.
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
3
3
  interface DisclaimerTextProps {
4
- showDydxDisclaimer: boolean;
5
4
  checkoutItem: FunkitActiveCheckoutItem | null;
6
5
  continueText: string;
7
6
  isCardPayment?: boolean;
8
7
  finalConvertedAssetName?: string;
9
8
  }
10
- export declare const DisclaimerText: ({ showDydxDisclaimer, continueText, isCardPayment, finalConvertedAssetName, checkoutItem, }: DisclaimerTextProps) => React.JSX.Element;
9
+ export declare const DisclaimerText: ({ continueText, isCardPayment, finalConvertedAssetName, checkoutItem, }: DisclaimerTextProps) => React.JSX.Element;
11
10
  export {};
@@ -9,7 +9,8 @@ export declare enum ConfirmationErrorCode {
9
9
  GENERIC_ERROR = "GENERIC_ERROR",
10
10
  RISK_ERROR = "RISK_ERROR",
11
11
  SIGNATURE_DENIED = "SIGNATURE_DENIED",
12
- SWITCH_CHAIN_ERROR = "SWITCH_CHAIN_ERROR"
12
+ SWITCH_CHAIN_ERROR = "SWITCH_CHAIN_ERROR",
13
+ WALLET_CLIENT_UNDEFINED = "WALLET_CLIENT_UNDEFINED"
13
14
  }
14
15
  interface UseCheckoutConfirmationOptions {
15
16
  onError(error: CheckoutConfirmationError): void;
@@ -78,6 +78,11 @@ export type AmountInputError = {
78
78
  /** Input is empty */
79
79
  type: 'noInput';
80
80
  };
81
- export declare function initializeState({ checkoutConfig, maxUsd, minUsd, paymentMethod, sourceHolding, unitPrice, defaultAmount, fiatCurrency, quickOptions, }: AmountInputInitOptions): AmountInputState;
81
+ /**
82
+ * Calculate initial input amount for account balance deposits.
83
+ * Return half the balance and round up to nearest 10, 100, 1000 etc
84
+ */
85
+ export declare function calcInitialFiatAmount(balance: number): number;
86
+ export declare function initializeState({ checkoutConfig, maxUsd, minUsd, paymentMethod, sourceHolding, unitPrice: realUnitPrice, defaultAmount, fiatCurrency, quickOptions, }: AmountInputInitOptions): AmountInputState;
82
87
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
83
88
  export declare function getDerivedState(state: AmountInputState): AmountInputDerivedState;
@@ -52,7 +52,6 @@ export declare const useActiveTheme: () => {
52
52
  mediumStroke: string;
53
53
  heavyStroke: string;
54
54
  strokeColor: string;
55
- dydxSwitchActiveBackground: string;
56
55
  primaryText: string;
57
56
  secondaryText: string;
58
57
  tertiaryText: string;
@@ -266,7 +265,6 @@ export declare const useActiveTheme: () => {
266
265
  mediumStroke: string;
267
266
  heavyStroke: string;
268
267
  strokeColor: string;
269
- dydxSwitchActiveBackground: string;
270
268
  primaryText: string;
271
269
  secondaryText: string;
272
270
  tertiaryText: string;
@@ -478,7 +476,6 @@ export declare const useActiveTheme: () => {
478
476
  mediumStroke: string;
479
477
  heavyStroke: string;
480
478
  strokeColor: string;
481
- dydxSwitchActiveBackground: string;
482
479
  primaryText: string;
483
480
  secondaryText: string;
484
481
  tertiaryText: string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-VQOGHHW2.js";
4
+ } from "../chunk-WDHT73AM.js";
5
5
  import "../chunk-7HKC2KCK.js";
6
6
  export {
7
7
  darkTheme
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-ZAZGUX6Z.js";
4
+ } from "../chunk-ZDHRMKMT.js";
5
5
  import "../chunk-7HKC2KCK.js";
6
6
  export {
7
7
  lightTheme
@@ -1,11 +1,5 @@
1
1
  import type { FunkitTextCustomizationsConfig } from '../providers/FunkitConfigContext';
2
2
  export declare const getWalletLabel: (textCustomizations: FunkitTextCustomizationsConfig, walletAddress?: string) => string;
3
- /**
4
- * Replicated from @dydxprotocol/v4-client-js https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-js/src/lib/validation.ts#L145C1-L158
5
- * Not importing the sdk in the interest of space.
6
- */
7
- export declare function verifyIsBech32(address: string): Error | undefined;
8
- export declare function isDydxAddress(address: string): boolean;
9
3
  export declare function isAddressSupported(address: string): boolean;
10
4
  /**
11
5
  * Check if the recipient address is compatible with selected chain
@@ -5,6 +5,6 @@ export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number |
5
5
  *
6
6
  * @param {FunkitCheckoutConfig} checkoutConfig
7
7
  * @param mockedChains optional array of additional chains we want to replace with FALLBACK_CHAIN_ID
8
- * @returns targetChain either from the provided config or arbitrum chainId for dydxChain since that's a non evm chain processed with evm tech
8
+ * @returns targetChain either from the provided config or Base chainId for non-evm chains processed with evm tech
9
9
  */
10
10
  export declare const getMockedTargetChainId: ({ targetChain }: FunkitCheckoutConfig, mockedChains?: string[]) => string;
@@ -54,6 +54,7 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
54
54
  bypassInit: boolean;
55
55
  apiKey?: string;
56
56
  nonce?: bigint | undefined;
57
+ logger?: import("@funkit/api-base").Logger | undefined;
57
58
  fee?: {
58
59
  token?: string;
59
60
  amount?: number;
@@ -61,7 +62,6 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
61
62
  recipient: Address;
62
63
  } | undefined;
63
64
  skipDBAction?: boolean | undefined;
64
- logger?: import("@funkit/api-base").Logger | undefined;
65
65
  };
66
66
  export type TokenInfo = {
67
67
  symbol: string;
@@ -102,21 +102,14 @@ export declare const flagConfig: {
102
102
  max_checkout_usd: {
103
103
  type: "string";
104
104
  default_value: string;
105
- overrides: ({
106
- if_any: {
107
- key: "apiKey";
108
- type: "isAnyOf";
109
- values: string[];
110
- }[];
111
- value: string;
112
- } | {
105
+ overrides: {
113
106
  if_any: {
114
107
  key: "userId";
115
108
  type: "isAnyOf";
116
109
  values: string[];
117
110
  }[];
118
111
  value: string;
119
- })[];
112
+ }[];
120
113
  };
121
114
  enable_frog_proxy_server: {
122
115
  type: "boolean";
@@ -185,37 +178,14 @@ export declare const flagConfig: {
185
178
  is_relay_bypass_enabled: {
186
179
  type: "boolean";
187
180
  default_value: false;
188
- overrides: ({
189
- value: true;
190
- if_any: ({
191
- key: "apiKey";
192
- type: "isAnyOf";
193
- values: string[];
194
- } | {
195
- key: "userId";
196
- type: "isAnyOf";
197
- values: string[];
198
- })[];
199
- if_all?: undefined;
200
- } | {
181
+ overrides: {
201
182
  value: true;
202
- if_all: ({
203
- key: "userId";
204
- type: "pctRollout";
205
- pct: number;
206
- values?: undefined;
207
- } | {
208
- key: "apiKey";
209
- type: "isAnyOf";
210
- values: string[];
211
- pct?: undefined;
212
- })[];
213
183
  if_any: {
214
- key: "userId";
184
+ key: "apiKey";
215
185
  type: "isAnyOf";
216
186
  values: string[];
217
187
  }[];
218
- })[];
188
+ }[];
219
189
  };
220
190
  relay_bypass_source_chains_and_assets: {
221
191
  type: "string";
@@ -1,22 +1,13 @@
1
1
  "use client";
2
2
  import {
3
- xdefiWallet
4
- } from "./chunk-BOU4WKRZ.js";
5
- import {
6
- zealWallet
7
- } from "./chunk-RNBEDQHF.js";
8
- import {
9
- zerionWallet
10
- } from "./chunk-Q3H3TRBS.js";
11
- import {
12
- subWallet
13
- } from "./chunk-ZSI5N4VV.js";
3
+ clvWallet
4
+ } from "./chunk-2GJQ4XZQ.js";
14
5
  import {
15
- tahoWallet
16
- } from "./chunk-ZZZRUXZE.js";
6
+ bifrostWallet
7
+ } from "./chunk-UIASLGLV.js";
17
8
  import {
18
- talismanWallet
19
- } from "./chunk-DRO6WYMM.js";
9
+ xdefiWallet
10
+ } from "./chunk-BOU4WKRZ.js";
20
11
  import {
21
12
  tokenPocketWallet
22
13
  } from "./chunk-J3LI3FYZ.js";
@@ -26,75 +17,75 @@ import {
26
17
  import {
27
18
  trustWallet
28
19
  } from "./chunk-RKPCWHXL.js";
20
+ import {
21
+ subWallet
22
+ } from "./chunk-ZSI5N4VV.js";
23
+ import {
24
+ zealWallet
25
+ } from "./chunk-RNBEDQHF.js";
29
26
  import {
30
27
  uniswapWallet
31
28
  } from "./chunk-LH7BMNFZ.js";
29
+ import {
30
+ zerionWallet
31
+ } from "./chunk-Q3H3TRBS.js";
32
32
  import {
33
33
  walletConnectWallet
34
34
  } from "./chunk-NP5QGWNL.js";
35
- import {
36
- phantomWallet
37
- } from "./chunk-362NXNTM.js";
38
35
  import {
39
36
  rabbyWallet
40
37
  } from "./chunk-BBOM42DL.js";
38
+ import {
39
+ ramperWallet
40
+ } from "./chunk-BYXPFMI7.js";
41
41
  import {
42
42
  rainbowWallet
43
43
  } from "./chunk-3CICVJUN.js";
44
44
  import {
45
- roninWallet
46
- } from "./chunk-QLVVUKYB.js";
45
+ safeWallet
46
+ } from "./chunk-BQQQL6UD.js";
47
47
  import {
48
- ramperWallet
49
- } from "./chunk-BYXPFMI7.js";
48
+ tahoWallet
49
+ } from "./chunk-ZZZRUXZE.js";
50
50
  import {
51
51
  safepalWallet
52
52
  } from "./chunk-EC6CHBSZ.js";
53
- import {
54
- safeWallet
55
- } from "./chunk-BQQQL6UD.js";
56
53
  import {
57
54
  safeheronWallet
58
55
  } from "./chunk-RZIO5TFF.js";
59
56
  import {
60
- ledgerWallet
61
- } from "./chunk-BRBKM4PW.js";
62
- import {
63
- metaMaskWallet
64
- } from "./chunk-UYGJO62F.js";
57
+ talismanWallet
58
+ } from "./chunk-DRO6WYMM.js";
65
59
  import {
66
- mewWallet
67
- } from "./chunk-OL5ZO7E4.js";
60
+ okxWallet
61
+ } from "./chunk-AFXHGWBH.js";
68
62
  import {
69
63
  oktoWallet
70
64
  } from "./chunk-ADIXAKUL.js";
71
- import {
72
- okxWallet
73
- } from "./chunk-AFXHGWBH.js";
74
65
  import {
75
66
  omniWallet
76
67
  } from "./chunk-7CUY5G6R.js";
77
68
  import {
78
- oneInchWallet
79
- } from "./chunk-OESTDX6I.js";
69
+ mewWallet
70
+ } from "./chunk-OL5ZO7E4.js";
80
71
  import {
81
72
  oneKeyWallet
82
73
  } from "./chunk-SHBUZ7U7.js";
83
74
  import {
84
- foxWallet
85
- } from "./chunk-CNPKISHN.js";
86
- import {
87
- frameWallet
88
- } from "./chunk-IFON7E6U.js";
75
+ phantomWallet
76
+ } from "./chunk-362NXNTM.js";
89
77
  import {
90
- frontierWallet
91
- } from "./chunk-VWCLFMWJ.js";
78
+ oneInchWallet
79
+ } from "./chunk-OESTDX6I.js";
92
80
  import {
93
- imTokenWallet
94
- } from "./chunk-COZ7MIQS.js";
81
+ roninWallet
82
+ } from "./chunk-QLVVUKYB.js";
95
83
  import {
96
84
  gateWallet
97
85
  } from "./chunk-CJGUM55H.js";
86
+ import {
87
+ imTokenWallet
88
+ } from "./chunk-COZ7MIQS.js";
98
89
  import {
99
90
  injectedWallet
100
91
  } from "./chunk-XWUJE7MW.js";
@@ -102,50 +93,59 @@ import {
102
93
  kresusWallet
103
94
  } from "./chunk-MJXPRJZT.js";
104
95
  import {
105
- clvWallet
106
- } from "./chunk-2GJQ4XZQ.js";
96
+ ledgerWallet
97
+ } from "./chunk-BRBKM4PW.js";
107
98
  import {
108
- braveWallet
109
- } from "./chunk-BPZ2XJO2.js";
99
+ metaMaskWallet
100
+ } from "./chunk-UYGJO62F.js";
110
101
  import {
111
- coin98Wallet
112
- } from "./chunk-KIDC67XJ.js";
102
+ bybitWallet
103
+ } from "./chunk-LNEC5RNX.js";
113
104
  import {
114
105
  coinbaseWallet
115
106
  } from "./chunk-H4IRCEZN.js";
107
+ import {
108
+ dawnWallet
109
+ } from "./chunk-HWPKCIBE.js";
116
110
  import {
117
111
  coreWallet
118
112
  } from "./chunk-JCHN6A47.js";
119
113
  import {
120
- dawnWallet
121
- } from "./chunk-HWPKCIBE.js";
114
+ desigWallet
115
+ } from "./chunk-OPAZMNA7.js";
116
+ import {
117
+ foxWallet
118
+ } from "./chunk-CNPKISHN.js";
122
119
  import {
123
120
  enkryptWallet
124
121
  } from "./chunk-OLOIXTYS.js";
125
122
  import {
126
- desigWallet
127
- } from "./chunk-OPAZMNA7.js";
123
+ frameWallet
124
+ } from "./chunk-IFON7E6U.js";
125
+ import {
126
+ frontierWallet
127
+ } from "./chunk-VWCLFMWJ.js";
128
+ import {
129
+ bitverseWallet
130
+ } from "./chunk-3HZRRP4Y.js";
128
131
  import {
129
132
  argentWallet
130
133
  } from "./chunk-WSQ2YJO2.js";
131
- import {
132
- bifrostWallet
133
- } from "./chunk-UIASLGLV.js";
134
134
  import {
135
135
  bitskiWallet
136
136
  } from "./chunk-HS3C7OQV.js";
137
137
  import {
138
- bitgetWallet
139
- } from "./chunk-5W7VDOCL.js";
140
- import {
141
- bitverseWallet
142
- } from "./chunk-3HZRRP4Y.js";
138
+ braveWallet
139
+ } from "./chunk-BPZ2XJO2.js";
143
140
  import {
144
141
  bloomWallet
145
142
  } from "./chunk-S27IADFU.js";
146
143
  import {
147
- bybitWallet
148
- } from "./chunk-LNEC5RNX.js";
144
+ bitgetWallet
145
+ } from "./chunk-5W7VDOCL.js";
146
+ import {
147
+ coin98Wallet
148
+ } from "./chunk-KIDC67XJ.js";
149
149
  import "./chunk-DNSG5Q7V.js";
150
150
  import "./chunk-23WIEY36.js";
151
151
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "6.0.4",
3
+ "version": "6.0.6",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -89,12 +89,12 @@
89
89
  "ua-parser-js": "^1.0.37",
90
90
  "use-debounce": "^10.0.5",
91
91
  "uuid": "^9.0.1",
92
- "@funkit/api-base": "1.9.13",
93
- "@funkit/core": "2.3.37",
94
- "@funkit/chains": "0.3.7",
95
- "@funkit/fun-relay": "1.0.1",
92
+ "@funkit/chains": "0.3.8",
96
93
  "@funkit/utils": "1.1.8",
97
- "@funkit/wagmi-tools": "3.0.59"
94
+ "@funkit/wagmi-tools": "3.0.60",
95
+ "@funkit/api-base": "1.9.14",
96
+ "@funkit/fun-relay": "1.0.1",
97
+ "@funkit/core": "2.3.38"
98
98
  },
99
99
  "repository": {
100
100
  "type": "git",