@rango-dev/widget-embedded 0.1.16-next.19 → 0.1.16-next.20
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/QueueManager.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +2 -2
- package/dist/utils/wallets.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +7 -9
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +7 -9
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +8 -5
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +5 -5
- package/src/QueueManager.tsx +4 -0
- package/src/index.tsx +1 -7
- package/src/pages/WalletsPage.tsx +6 -2
- package/src/utils/wallets.ts +6 -3
|
@@ -8,8 +8,7 @@ import { create } from 'zustand';
|
|
|
8
8
|
import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
|
|
9
9
|
import { persist, subscribeWithSelector } from 'zustand/middleware';
|
|
10
10
|
import { RangoClient, isEvmBlockchain as isEvmBlockchain$1 } from 'rango-sdk';
|
|
11
|
-
import { Network, isEvmAddress, KEPLR_COMPATIBLE_WALLETS, detectInstallLink,
|
|
12
|
-
export { WalletType } from '@rango-dev/wallets-shared';
|
|
11
|
+
import { Network, isEvmAddress, KEPLR_COMPATIBLE_WALLETS, detectInstallLink, WalletTypes, getCosmosExperimentalChainInfo, detectMobileScreens, convertEvmBlockchainMetaToEvmChainInfo } from '@rango-dev/wallets-shared';
|
|
13
12
|
import { readAccountAddress, useWallets, Provider as Provider$1, Events } from '@rango-dev/wallets-core';
|
|
14
13
|
import { shallow } from 'zustand/shallow';
|
|
15
14
|
import { allProviders } from '@rango-dev/provider-all';
|
|
@@ -292,7 +291,7 @@ function getStateWallet(state) {
|
|
|
292
291
|
return WalletState.DISCONNECTED;
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
|
-
const excludedWallets = [
|
|
294
|
+
const excludedWallets = [WalletTypes.LEAP];
|
|
296
295
|
function getlistWallet(getState, getWalletInfo, list) {
|
|
297
296
|
return list.filter(wallet => !excludedWallets.includes(wallet)).map(type => {
|
|
298
297
|
const {
|
|
@@ -475,7 +474,9 @@ const isExperimentalChain = (blockchains, wallet) => {
|
|
|
475
474
|
return cosmosExperimentalChainInfo && !!cosmosExperimentalChainInfo[wallet];
|
|
476
475
|
};
|
|
477
476
|
const getKeplrCompatibleConnectedWallets = selectableWallets => {
|
|
478
|
-
const connectedWalletTypes = new Set(selectableWallets.map(
|
|
477
|
+
const connectedWalletTypes = new Set(selectableWallets.map(wallet => {
|
|
478
|
+
return wallet.walletType;
|
|
479
|
+
}));
|
|
479
480
|
return KEPLR_COMPATIBLE_WALLETS.filter(compatibleWallet => connectedWalletTypes.has(compatibleWallet));
|
|
480
481
|
};
|
|
481
482
|
function getTokensWithBalance(tokens, connectedWallets) {
|
|
@@ -2639,7 +2640,7 @@ function WalletsPage(_ref) {
|
|
|
2639
2640
|
getWalletInfo,
|
|
2640
2641
|
connect
|
|
2641
2642
|
} = useWallets();
|
|
2642
|
-
const wallets = getlistWallet(state, getWalletInfo, supportedWallets || Object.values(
|
|
2643
|
+
const wallets = getlistWallet(state, getWalletInfo, supportedWallets || Object.values(WalletTypes));
|
|
2643
2644
|
const walletsRef = useRef();
|
|
2644
2645
|
let sortedWallets = detectMobileScreens() ? wallets.filter(wallet => wallet.showOnMobile) : wallets;
|
|
2645
2646
|
sortedWallets = sortWalletsBasedOnState(sortedWallets);
|
|
@@ -3249,6 +3250,7 @@ function QueueManager(props) {
|
|
|
3249
3250
|
}
|
|
3250
3251
|
return connect(wallet, network);
|
|
3251
3252
|
};
|
|
3253
|
+
const isMobileWallet = walletType => !!getWalletInfo(walletType).mobileWallet;
|
|
3252
3254
|
// TODO: this code copy & pasted from rango, should be refactored.
|
|
3253
3255
|
const allBlockchains = blockchains.filter(blockchain => blockchain.enabled).reduce((blockchainsObj, blockchain) => (blockchainsObj[blockchain.name] = blockchain, blockchainsObj), {});
|
|
3254
3256
|
const evmBasedChains = blockchains.filter(isEvmBlockchain$1);
|
|
@@ -3285,6 +3287,7 @@ function QueueManager(props) {
|
|
|
3285
3287
|
switchNetwork,
|
|
3286
3288
|
connect,
|
|
3287
3289
|
state,
|
|
3290
|
+
isMobileWallet,
|
|
3288
3291
|
notifier
|
|
3289
3292
|
};
|
|
3290
3293
|
return React.createElement(Provider, {
|