@rango-dev/widget-embedded 0.28.3-next.2 → 0.28.3-next.4
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/dist/containers/Wallets/Wallets.d.ts.map +1 -1
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/hooks/useWalletProviders.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/types/config.d.ts +3 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +1 -0
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +3 -3
- package/src/containers/Wallets/Wallets.tsx +3 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +2 -2
- package/src/hooks/useWalletList.ts +2 -0
- package/src/hooks/useWalletProviders.ts +2 -6
- package/src/types/config.ts +5 -0
- package/src/utils/providers.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.28.3-next.
|
|
3
|
+
"version": "0.28.3-next.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@lingui/core": "4.2.1",
|
|
26
26
|
"@lingui/react": "4.2.1",
|
|
27
27
|
"@rango-dev/logging-core": "^0.3.1-next.1",
|
|
28
|
-
"@rango-dev/provider-all": "^0.33.3-next.
|
|
28
|
+
"@rango-dev/provider-all": "^0.33.3-next.2",
|
|
29
29
|
"@rango-dev/queue-manager-core": "^0.26.0",
|
|
30
30
|
"@rango-dev/queue-manager-rango-preset": "^0.33.3-next.0",
|
|
31
31
|
"@rango-dev/queue-manager-react": "^0.26.0",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|
|
@@ -38,6 +38,9 @@ function Main(props: PropsWithChildren<PropTypes>) {
|
|
|
38
38
|
|
|
39
39
|
const walletOptions: ProvidersOptions = {
|
|
40
40
|
walletConnectProjectId: props.config?.walletConnectProjectId,
|
|
41
|
+
walletConnectListedDesktopWalletLink:
|
|
42
|
+
props.config.__UNSTABLE_OR_INTERNAL__
|
|
43
|
+
?.walletConnectListedDesktopWalletLink,
|
|
41
44
|
};
|
|
42
45
|
const { providers } = useWalletProviders(config.wallets, walletOptions);
|
|
43
46
|
const { connectWallet, disconnectWallet } = useWalletsStore();
|
|
@@ -2,7 +2,7 @@ import type { PropTypes } from './WidgetProvider.types';
|
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import { setSolanaSignerConfig } from '@rango-dev/signer-solana';
|
|
5
|
-
import React, { useEffect } from 'react';
|
|
5
|
+
import React, { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { DEFAULT_BASE_URL, RANGO_PUBLIC_API_KEY } from '../../constants';
|
|
8
8
|
import useFontLoader from '../../hooks/useFontLoader';
|
|
@@ -24,7 +24,7 @@ export function WidgetProvider(props: PropsWithChildren<PropTypes>) {
|
|
|
24
24
|
}
|
|
25
25
|
}, [fontFamily]);
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
useMemo(() => {
|
|
28
28
|
initConfig({
|
|
29
29
|
API_KEY: config?.apiKey || RANGO_PUBLIC_API_KEY,
|
|
30
30
|
BASE_URL: config?.apiUrl || DEFAULT_BASE_URL,
|
|
@@ -45,6 +45,8 @@ export function useWalletList(params: Params) {
|
|
|
45
45
|
const listAvailableWalletTypes =
|
|
46
46
|
configWalletsToWalletName(config?.wallets, {
|
|
47
47
|
walletConnectProjectId: config?.walletConnectProjectId,
|
|
48
|
+
walletConnectListedDesktopWalletLink:
|
|
49
|
+
config.__UNSTABLE_OR_INTERNAL__?.walletConnectListedDesktopWalletLink,
|
|
48
50
|
}) || ALL_SUPPORTED_WALLETS;
|
|
49
51
|
|
|
50
52
|
let wallets = mapWalletTypesToWalletInfo(
|
|
@@ -14,16 +14,12 @@ export function useWalletProviders(
|
|
|
14
14
|
const clearConnectedWallet = useWalletsStore.use.clearConnectedWallet();
|
|
15
15
|
let generateProviders: ProviderInterface[] = matchAndGenerateProviders(
|
|
16
16
|
providers,
|
|
17
|
-
|
|
18
|
-
walletConnectProjectId: options?.walletConnectProjectId,
|
|
19
|
-
}
|
|
17
|
+
options
|
|
20
18
|
);
|
|
21
19
|
|
|
22
20
|
useEffect(() => {
|
|
23
21
|
clearConnectedWallet();
|
|
24
|
-
generateProviders = matchAndGenerateProviders(providers,
|
|
25
|
-
walletConnectProjectId: options?.walletConnectProjectId,
|
|
26
|
-
});
|
|
22
|
+
generateProviders = matchAndGenerateProviders(providers, options);
|
|
27
23
|
}, [providers?.length]);
|
|
28
24
|
|
|
29
25
|
return {
|
package/src/types/config.ts
CHANGED
|
@@ -214,4 +214,9 @@ export type WidgetConfig = {
|
|
|
214
214
|
variant?: WidgetVariant;
|
|
215
215
|
enableCentralizedSwappers?: boolean;
|
|
216
216
|
signers?: SignersConfig;
|
|
217
|
+
|
|
218
|
+
// These are likely to change or remove at anytime. Please use with a caution.
|
|
219
|
+
__UNSTABLE_OR_INTERNAL__?: {
|
|
220
|
+
walletConnectListedDesktopWalletLink?: string;
|
|
221
|
+
};
|
|
217
222
|
};
|
package/src/utils/providers.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { allProviders } from '@rango-dev/provider-all';
|
|
|
5
5
|
|
|
6
6
|
export interface ProvidersOptions {
|
|
7
7
|
walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
|
|
8
|
+
walletConnectListedDesktopWalletLink?: NonNullable<
|
|
9
|
+
WidgetConfig['__UNSTABLE_OR_INTERNAL__']
|
|
10
|
+
>['walletConnectListedDesktopWalletLink'];
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -20,6 +23,8 @@ export function matchAndGenerateProviders(
|
|
|
20
23
|
const all = allProviders({
|
|
21
24
|
walletconnect2: {
|
|
22
25
|
WC_PROJECT_ID: options?.walletConnectProjectId || '',
|
|
26
|
+
DISABLE_MODAL_AND_OPEN_LINK:
|
|
27
|
+
options?.walletConnectListedDesktopWalletLink,
|
|
23
28
|
},
|
|
24
29
|
selectedProviders: providers,
|
|
25
30
|
});
|