@lifi/widget 2.8.0 → 2.8.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.
- package/cjs/components/SendToWallet/SendToWalletButton.js +0 -2
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/providers/WidgetProvider/WidgetProvider.js +2 -1
- package/components/SendToWallet/SendToWalletButton.js +1 -3
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +2 -2
- package/providers/WidgetProvider/WidgetProvider.js +2 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -14,12 +14,10 @@ const SendToWalletButton = () => {
|
|
|
14
14
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
15
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
16
16
|
const emitter = (0, hooks_1.useWidgetEvents)();
|
|
17
|
-
const { account } = (0, providers_1.useWallet)();
|
|
18
17
|
const { disabledUI, hiddenUI, requiredUI } = (0, providers_1.useWidgetConfig)();
|
|
19
18
|
const { showSendToWallet, toggleSendToWallet } = (0, stores_1.useSendToWalletStore)();
|
|
20
19
|
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
21
20
|
if (!showDestinationWallet ||
|
|
22
|
-
!account.isActive ||
|
|
23
21
|
hiddenUI?.includes(types_1.HiddenUI.ToAddress) ||
|
|
24
22
|
requiredUI?.includes(types_1.RequiredUI.ToAddress)) {
|
|
25
23
|
return null;
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.8.
|
|
2
|
+
export declare const version = "2.8.1";
|
package/cjs/config/version.js
CHANGED
|
@@ -13,7 +13,7 @@ const initialContext = {
|
|
|
13
13
|
const WidgetContext = (0, react_1.createContext)(initialContext);
|
|
14
14
|
const useWidgetConfig = () => (0, react_1.useContext)(WidgetContext);
|
|
15
15
|
exports.useWidgetConfig = useWidgetConfig;
|
|
16
|
-
const WidgetProvider = ({ children, config: { fromChain, fromToken, toChain, toToken, fromAmount, integrator, ...config } = {}, }) => {
|
|
16
|
+
const WidgetProvider = ({ children, config: { fromChain, fromToken, toChain, toToken, fromAmount, toAddress, integrator, ...config } = {}, }) => {
|
|
17
17
|
const elementId = (0, react_1.useId)();
|
|
18
18
|
if (!integrator) {
|
|
19
19
|
throw Error('Required property "integrator" is missing.');
|
|
@@ -52,6 +52,7 @@ const WidgetProvider = ({ children, config: { fromChain, fromToken, toChain, toT
|
|
|
52
52
|
!isNaN(parseFloat(searchParams.fromAmount))
|
|
53
53
|
? (0, utils_1.formatInputAmount)(searchParams.fromAmount)
|
|
54
54
|
: fromAmount,
|
|
55
|
+
toAddress: searchParams.toAddress || toAddress,
|
|
55
56
|
elementId,
|
|
56
57
|
integrator,
|
|
57
58
|
};
|
|
@@ -4,19 +4,17 @@ import { Button, Tooltip } from '@mui/material';
|
|
|
4
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useWidgetEvents } from '../../hooks';
|
|
7
|
-
import { FormKey,
|
|
7
|
+
import { FormKey, useWidgetConfig } from '../../providers';
|
|
8
8
|
import { useSendToWalletStore, useSettings } from '../../stores';
|
|
9
9
|
import { DisabledUI, HiddenUI, RequiredUI, WidgetEvent } from '../../types';
|
|
10
10
|
export const SendToWalletButton = () => {
|
|
11
11
|
const { t } = useTranslation();
|
|
12
12
|
const { setValue } = useFormContext();
|
|
13
13
|
const emitter = useWidgetEvents();
|
|
14
|
-
const { account } = useWallet();
|
|
15
14
|
const { disabledUI, hiddenUI, requiredUI } = useWidgetConfig();
|
|
16
15
|
const { showSendToWallet, toggleSendToWallet } = useSendToWalletStore();
|
|
17
16
|
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
|
|
18
17
|
if (!showDestinationWallet ||
|
|
19
|
-
!account.isActive ||
|
|
20
18
|
hiddenUI?.includes(HiddenUI.ToAddress) ||
|
|
21
19
|
requiredUI?.includes(RequiredUI.ToAddress)) {
|
|
22
20
|
return null;
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.8.
|
|
2
|
+
export declare const version = "2.8.1";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '2.8.
|
|
2
|
+
export const version = '2.8.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@ethersproject/experimental": "^5.7.0",
|
|
45
45
|
"@ethersproject/providers": "^5.7.2",
|
|
46
46
|
"@lifi/sdk": "^2.4.3",
|
|
47
|
-
"@lifi/wallet-management": "^2.4.
|
|
47
|
+
"@lifi/wallet-management": "^2.4.2",
|
|
48
48
|
"@mui/icons-material": "^5.14.14",
|
|
49
49
|
"@mui/lab": "^5.0.0-alpha.149",
|
|
50
50
|
"@mui/material": "^5.14.14",
|
|
@@ -9,7 +9,7 @@ const initialContext = {
|
|
|
9
9
|
};
|
|
10
10
|
const WidgetContext = createContext(initialContext);
|
|
11
11
|
export const useWidgetConfig = () => useContext(WidgetContext);
|
|
12
|
-
export const WidgetProvider = ({ children, config: { fromChain, fromToken, toChain, toToken, fromAmount, integrator, ...config } = {}, }) => {
|
|
12
|
+
export const WidgetProvider = ({ children, config: { fromChain, fromToken, toChain, toToken, fromAmount, toAddress, integrator, ...config } = {}, }) => {
|
|
13
13
|
const elementId = useId();
|
|
14
14
|
if (!integrator) {
|
|
15
15
|
throw Error('Required property "integrator" is missing.');
|
|
@@ -48,6 +48,7 @@ export const WidgetProvider = ({ children, config: { fromChain, fromToken, toCha
|
|
|
48
48
|
!isNaN(parseFloat(searchParams.fromAmount))
|
|
49
49
|
? formatInputAmount(searchParams.fromAmount)
|
|
50
50
|
: fromAmount,
|
|
51
|
+
toAddress: searchParams.toAddress || toAddress,
|
|
51
52
|
elementId,
|
|
52
53
|
integrator,
|
|
53
54
|
};
|