@rango-dev/widget-embedded 0.27.4-next.3 → 0.27.4-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/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts +6 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts +163 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts +10 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/index.d.ts +2 -0
- package/dist/components/WalletNamespacesModal/index.d.ts.map +1 -0
- package/dist/hooks/useWalletList.d.ts +4 -4
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +6 -1
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +3 -3
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/components/ConfirmWalletsModal/WalletList.tsx +68 -23
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +40 -4
- package/src/components/WalletNamespacesModal/WalletNamespacesModal.styles.ts +7 -0
- package/src/components/WalletNamespacesModal/WalletNamespacesModal.tsx +142 -0
- package/src/components/WalletNamespacesModal/WalletNamespacesModal.types.tsx +10 -0
- package/src/components/WalletNamespacesModal/index.ts +1 -0
- package/src/hooks/useWalletList.ts +11 -3
- package/src/pages/WalletsPage.tsx +38 -2
- package/src/types/wallets.ts +7 -1
- package/src/utils/wallets.ts +8 -3
package/src/utils/wallets.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
TokenHash,
|
|
6
6
|
TokensBalance,
|
|
7
7
|
Wallet,
|
|
8
|
+
WalletInfoWithNamespaces,
|
|
8
9
|
} from '../types';
|
|
9
10
|
import type { WalletInfo as ModalWalletInfo } from '@rango-dev/ui';
|
|
10
11
|
import type {
|
|
@@ -58,7 +59,7 @@ export function mapWalletTypesToWalletInfo(
|
|
|
58
59
|
getWalletInfo: (type: WalletType) => WalletInfo,
|
|
59
60
|
list: WalletType[],
|
|
60
61
|
chain?: string
|
|
61
|
-
):
|
|
62
|
+
): WalletInfoWithNamespaces[] {
|
|
62
63
|
return list
|
|
63
64
|
.filter((wallet) => !EXCLUDED_WALLETS.includes(wallet as WalletTypes))
|
|
64
65
|
.filter((wallet) => {
|
|
@@ -82,6 +83,8 @@ export function mapWalletTypesToWalletInfo(
|
|
|
82
83
|
img: image,
|
|
83
84
|
installLink,
|
|
84
85
|
showOnMobile,
|
|
86
|
+
namespaces,
|
|
87
|
+
singleNamespace,
|
|
85
88
|
} = getWalletInfo(type);
|
|
86
89
|
const state = mapStatusToWalletState(getState(type));
|
|
87
90
|
return {
|
|
@@ -91,6 +94,8 @@ export function mapWalletTypesToWalletInfo(
|
|
|
91
94
|
state,
|
|
92
95
|
type,
|
|
93
96
|
showOnMobile,
|
|
97
|
+
namespaces,
|
|
98
|
+
singleNamespace,
|
|
94
99
|
};
|
|
95
100
|
});
|
|
96
101
|
}
|
|
@@ -433,8 +438,8 @@ export function areTokensEqual(
|
|
|
433
438
|
}
|
|
434
439
|
|
|
435
440
|
export function sortWalletsBasedOnConnectionState(
|
|
436
|
-
wallets:
|
|
437
|
-
):
|
|
441
|
+
wallets: WalletInfoWithNamespaces[]
|
|
442
|
+
): WalletInfoWithNamespaces[] {
|
|
438
443
|
return wallets.sort(
|
|
439
444
|
(a, b) =>
|
|
440
445
|
Number(b.state === WalletStatus.CONNECTED) -
|