@funkit/connect 6.10.0 → 6.11.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.
@@ -1,3 +1,4 @@
1
+ import { type ExchangeRates } from '@funkit/api-base';
1
2
  import React from 'react';
2
3
  import { type FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
3
4
  import type { AssetHoldingsItem } from '~/utils/assets';
@@ -8,6 +9,8 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
8
9
  checkoutConfig: FunkitCheckoutConfig;
9
10
  /** unit price of target asset */
10
11
  unitPrice: number;
12
+ /** currency exchange rates */
13
+ currencyExchangeRates: ExchangeRates | undefined;
11
14
  /** default fiat currency to be used*/
12
15
  defaultFiatCurrency?: string;
13
16
  textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
@@ -15,5 +18,5 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
15
18
  export declare function openMeldPopup(linkGetter: () => Promise<{
16
19
  widgetUrl: string;
17
20
  }>): Promise<void>;
18
- export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, sourceHolding, unitPrice, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
21
+ export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, sourceHolding, unitPrice, currencyExchangeRates, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
19
22
  export {};
@@ -19,6 +19,10 @@ export interface AmountInputInitOptions {
19
19
  locale: Intl.LocalesArgument;
20
20
  /** Quick options, in fiat (not %) */
21
21
  quickOptions?: number[];
22
+ /** Exchange rate of the `fiatCurrency` to USD */
23
+ fiatCurrencyExchangeRate: number | undefined;
24
+ /** Whether meld is enabled */
25
+ meldEnabled: boolean;
22
26
  }
23
27
  export interface AmountInputState {
24
28
  /** Current amount, in target asset. Undefined if input is empty */
@@ -39,6 +43,10 @@ export interface AmountInputState {
39
43
  usdMaxAmount: number | null;
40
44
  /** Minimum amount, in USD (defaults to 0) */
41
45
  usdMinAmount: number | null;
46
+ /** Exchange rate of the `fiatCurrency` to USD */
47
+ fiatCurrencyExchangeRate: number | undefined;
48
+ /** Whether meld is enabled */
49
+ meldEnabled: boolean;
42
50
  }
43
51
  /** Derived state includes additional fields that are pure functions of base state */
44
52
  export interface AmountInputDerivedState extends AmountInputState {
@@ -90,6 +98,6 @@ export type AmountInputError = {
90
98
  * Return half the balance and round up to nearest 10, 100, 1000 etc
91
99
  */
92
100
  export declare function calcInitialFiatAmount(balance: number): number;
93
- export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethod, quickOptions, sourceHolding, unitPrice: realUnitPrice, }: AmountInputInitOptions): AmountInputState;
101
+ export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethod, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, }: AmountInputInitOptions): AmountInputState;
94
102
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
95
103
  export declare function getDerivedState(state: AmountInputState): AmountInputDerivedState;
@@ -276,7 +276,19 @@ export declare const flagConfig: {
276
276
  };
277
277
  readonly enable_bitcoin: {
278
278
  readonly type: "boolean";
279
- readonly default_value: true;
279
+ readonly default_value: false;
280
+ readonly overrides: [{
281
+ readonly if_any: [{
282
+ readonly key: "userId";
283
+ readonly type: "pctRollout";
284
+ readonly pct: 10;
285
+ }, {
286
+ readonly key: "userId";
287
+ readonly type: "isAnyOf";
288
+ readonly values: ["0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8", "0x2e0Fa1cE3F0F6a85542c1E4F941116c0E885292E", "0x28b8848C6c3aaBF4669997563dc07888eb3B0960", "0x9C64fD7d9826E6d552dD8bc53e5C96F7C3F38528", "0xfe5AD22465dc20340bfFb641F4AbbcAA7a1BB2Ed", "0x9CB7F86F360459cC96C74a0F81aF2C4cC7a54bd2", "0x21b94a3E67c4a72d3D15f478A696c5175f036092", "0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6", "0x8a5505F1b274d8fC23986AF60Dd3Ca3857095BB8", "0x0B6E49e9D1528F59BaBF3C5337A4c96E987f81aa", "0x84Bc1AC5621d2B44C5D3e3E79b45C2885406026D", "0x0D0377aa9CCA769931821842aB0E1A75e7DD6dD6", "0x7B0195921183f7E04f0D331c1DAF7C1bB208CC4E", "0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486", "0x3c937d73f7FE55b386c309C65087d9F5bdd1a780"];
289
+ }];
290
+ readonly value: true;
291
+ }];
280
292
  };
281
293
  };
282
294
  export type FlagConfig = typeof flagConfig;
@@ -283,7 +283,19 @@ export declare function fetchConfigFromServer<F extends FlagConfig>(): Promise<{
283
283
  };
284
284
  readonly enable_bitcoin: {
285
285
  readonly type: "boolean";
286
- readonly default_value: true;
286
+ readonly default_value: false;
287
+ readonly overrides: [{
288
+ readonly if_any: [{
289
+ readonly key: "userId";
290
+ readonly type: "pctRollout";
291
+ readonly pct: 10;
292
+ }, {
293
+ readonly key: "userId";
294
+ readonly type: "isAnyOf";
295
+ readonly values: ["0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8", "0x2e0Fa1cE3F0F6a85542c1E4F941116c0E885292E", "0x28b8848C6c3aaBF4669997563dc07888eb3B0960", "0x9C64fD7d9826E6d552dD8bc53e5C96F7C3F38528", "0xfe5AD22465dc20340bfFb641F4AbbcAA7a1BB2Ed", "0x9CB7F86F360459cC96C74a0F81aF2C4cC7a54bd2", "0x21b94a3E67c4a72d3D15f478A696c5175f036092", "0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6", "0x8a5505F1b274d8fC23986AF60Dd3Ca3857095BB8", "0x0B6E49e9D1528F59BaBF3C5337A4c96E987f81aa", "0x84Bc1AC5621d2B44C5D3e3E79b45C2885406026D", "0x0D0377aa9CCA769931821842aB0E1A75e7DD6dD6", "0x7B0195921183f7E04f0D331c1DAF7C1bB208CC4E", "0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486", "0x3c937d73f7FE55b386c309C65087d9F5bdd1a780"];
296
+ }];
297
+ readonly value: true;
298
+ }];
287
299
  };
288
300
  }>;
289
301
  export declare function deriveAllFlags<T extends AbstractFlags>(config: T, userContext: UserContext): {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Get the exchange rate for a given currency or return undefined if not found or any of the arguments are undefined
3
+ */
4
+ export declare const getExchangeRate: (currency: string | undefined, currencyExchangeRates: Record<string, number> | undefined, bipsMarkup?: number) => number | undefined;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
- xdefiWallet
4
- } from "./chunk-BOU4WKRZ.js";
3
+ walletConnectWallet
4
+ } from "./chunk-NP5QGWNL.js";
5
5
  import {
6
6
  zerionWallet
7
7
  } from "./chunk-Q3H3TRBS.js";
@@ -9,20 +9,20 @@ import {
9
9
  zealWallet
10
10
  } from "./chunk-RNBEDQHF.js";
11
11
  import {
12
- safepalWallet
13
- } from "./chunk-EC6CHBSZ.js";
14
- import {
15
- talismanWallet
16
- } from "./chunk-DRO6WYMM.js";
12
+ tahoWallet
13
+ } from "./chunk-ZZZRUXZE.js";
17
14
  import {
18
15
  subWallet
19
16
  } from "./chunk-ZSI5N4VV.js";
20
17
  import {
21
- tokenPocketWallet
22
- } from "./chunk-J3LI3FYZ.js";
18
+ talismanWallet
19
+ } from "./chunk-DRO6WYMM.js";
23
20
  import {
24
21
  trustWallet
25
22
  } from "./chunk-RKPCWHXL.js";
23
+ import {
24
+ tokenPocketWallet
25
+ } from "./chunk-J3LI3FYZ.js";
26
26
  import {
27
27
  uniswapWallet
28
28
  } from "./chunk-LH7BMNFZ.js";
@@ -30,35 +30,32 @@ import {
30
30
  tokenaryWallet
31
31
  } from "./chunk-D6AOOO5F.js";
32
32
  import {
33
- walletConnectWallet
34
- } from "./chunk-NP5QGWNL.js";
33
+ xdefiWallet
34
+ } from "./chunk-BOU4WKRZ.js";
35
35
  import {
36
- phantomWallet
37
- } from "./chunk-362NXNTM.js";
36
+ oneKeyWallet
37
+ } from "./chunk-SHBUZ7U7.js";
38
38
  import {
39
- rabbyWallet
40
- } from "./chunk-BBOM42DL.js";
39
+ ramperWallet
40
+ } from "./chunk-BYXPFMI7.js";
41
41
  import {
42
42
  rainbowWallet
43
43
  } from "./chunk-3CICVJUN.js";
44
44
  import {
45
- ramperWallet
46
- } from "./chunk-BYXPFMI7.js";
45
+ rabbyWallet
46
+ } from "./chunk-BBOM42DL.js";
47
47
  import {
48
48
  roninWallet
49
49
  } from "./chunk-QLVVUKYB.js";
50
- import {
51
- safeWallet
52
- } from "./chunk-BQQQL6UD.js";
53
50
  import {
54
51
  safeheronWallet
55
52
  } from "./chunk-RZIO5TFF.js";
56
53
  import {
57
- tahoWallet
58
- } from "./chunk-ZZZRUXZE.js";
54
+ safeWallet
55
+ } from "./chunk-BQQQL6UD.js";
59
56
  import {
60
- mewWallet
61
- } from "./chunk-OL5ZO7E4.js";
57
+ safepalWallet
58
+ } from "./chunk-EC6CHBSZ.js";
62
59
  import {
63
60
  ledgerWallet
64
61
  } from "./chunk-BRBKM4PW.js";
@@ -66,8 +63,8 @@ import {
66
63
  metaMaskWallet
67
64
  } from "./chunk-UYGJO62F.js";
68
65
  import {
69
- oktoWallet
70
- } from "./chunk-ADIXAKUL.js";
66
+ mewWallet
67
+ } from "./chunk-OL5ZO7E4.js";
71
68
  import {
72
69
  okxWallet
73
70
  } from "./chunk-AFXHGWBH.js";
@@ -75,38 +72,41 @@ import {
75
72
  omniWallet
76
73
  } from "./chunk-7CUY5G6R.js";
77
74
  import {
78
- oneKeyWallet
79
- } from "./chunk-SHBUZ7U7.js";
75
+ oktoWallet
76
+ } from "./chunk-ADIXAKUL.js";
80
77
  import {
81
78
  oneInchWallet
82
79
  } from "./chunk-OESTDX6I.js";
83
80
  import {
84
- foxWallet
85
- } from "./chunk-CNPKISHN.js";
81
+ phantomWallet
82
+ } from "./chunk-362NXNTM.js";
86
83
  import {
87
- frameWallet
88
- } from "./chunk-IFON7E6U.js";
84
+ enkryptWallet
85
+ } from "./chunk-OLOIXTYS.js";
89
86
  import {
90
87
  frontierWallet
91
88
  } from "./chunk-VWCLFMWJ.js";
89
+ import {
90
+ frameWallet
91
+ } from "./chunk-IFON7E6U.js";
92
92
  import {
93
93
  gateWallet
94
94
  } from "./chunk-CJGUM55H.js";
95
95
  import {
96
- injectedWallet
97
- } from "./chunk-XWUJE7MW.js";
96
+ kresusWallet
97
+ } from "./chunk-MJXPRJZT.js";
98
98
  import {
99
99
  imTokenWallet
100
100
  } from "./chunk-COZ7MIQS.js";
101
101
  import {
102
- kresusWallet
103
- } from "./chunk-MJXPRJZT.js";
102
+ injectedWallet
103
+ } from "./chunk-XWUJE7MW.js";
104
104
  import {
105
105
  braveWallet
106
106
  } from "./chunk-BPZ2XJO2.js";
107
107
  import {
108
- bybitWallet
109
- } from "./chunk-LNEC5RNX.js";
108
+ clvWallet
109
+ } from "./chunk-2GJQ4XZQ.js";
110
110
  import {
111
111
  coin98Wallet
112
112
  } from "./chunk-KIDC67XJ.js";
@@ -116,24 +116,24 @@ import {
116
116
  import {
117
117
  coreWallet
118
118
  } from "./chunk-JCHN6A47.js";
119
+ import {
120
+ desigWallet
121
+ } from "./chunk-OPAZMNA7.js";
119
122
  import {
120
123
  dawnWallet
121
124
  } from "./chunk-HWPKCIBE.js";
122
125
  import {
123
- desigWallet
124
- } from "./chunk-OPAZMNA7.js";
126
+ foxWallet
127
+ } from "./chunk-CNPKISHN.js";
125
128
  import {
126
- enkryptWallet
127
- } from "./chunk-OLOIXTYS.js";
129
+ argentWallet
130
+ } from "./chunk-WSQ2YJO2.js";
128
131
  import {
129
132
  bifrostWallet
130
133
  } from "./chunk-UIASLGLV.js";
131
134
  import {
132
135
  bitgetWallet
133
136
  } from "./chunk-5W7VDOCL.js";
134
- import {
135
- argentWallet
136
- } from "./chunk-WSQ2YJO2.js";
137
137
  import {
138
138
  bitskiWallet
139
139
  } from "./chunk-HS3C7OQV.js";
@@ -144,8 +144,8 @@ import {
144
144
  bloomWallet
145
145
  } from "./chunk-S27IADFU.js";
146
146
  import {
147
- clvWallet
148
- } from "./chunk-2GJQ4XZQ.js";
147
+ bybitWallet
148
+ } from "./chunk-LNEC5RNX.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.10.0",
3
+ "version": "6.11.0",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",