@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.1.16-next.19",
3
+ "version": "0.1.16-next.20",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -24,13 +24,13 @@
24
24
  "trailingComma": "es5"
25
25
  },
26
26
  "dependencies": {
27
- "@rango-dev/provider-all": "^0.1.21",
27
+ "@rango-dev/provider-all": "^0.1.14-next.15",
28
28
  "@rango-dev/queue-manager-core": "^0.1.13-next.16",
29
- "@rango-dev/queue-manager-rango-preset": "^0.1.13-next.16",
29
+ "@rango-dev/queue-manager-rango-preset": "^0.1.13-next.17",
30
30
  "@rango-dev/queue-manager-react": "^0.1.12-next.13",
31
31
  "@rango-dev/ui": "^0.1.14-next.12",
32
- "@rango-dev/wallets-core": "^0.1.14-next.15",
33
- "@rango-dev/wallets-shared": "^0.1.13",
32
+ "@rango-dev/wallets-core": "^0.1.14-next.16",
33
+ "@rango-dev/wallets-shared": "^0.1.13-next.18",
34
34
  "bignumber.js": "^9.1.1",
35
35
  "copy-to-clipboard": "^3.3.3",
36
36
  "dayjs": "^1.11.7",
@@ -52,6 +52,9 @@ function QueueManager(props: PropsWithChildren<{}>) {
52
52
  return connect(wallet, network);
53
53
  };
54
54
 
55
+ const isMobileWallet = (walletType: WalletType): boolean =>
56
+ !!getWalletInfo(walletType).mobileWallet;
57
+
55
58
  // TODO: this code copy & pasted from rango, should be refactored.
56
59
  const allBlockchains = blockchains
57
60
  .filter((blockchain) => blockchain.enabled)
@@ -106,6 +109,7 @@ function QueueManager(props: PropsWithChildren<{}>) {
106
109
  switchNetwork,
107
110
  connect,
108
111
  state,
112
+ isMobileWallet,
109
113
  notifier,
110
114
  };
111
115
 
package/src/index.tsx CHANGED
@@ -28,13 +28,7 @@ import { useUiStore } from './store/ui';
28
28
  import { navigationRoutes } from './constants/navigationRoutes';
29
29
  import { initConfig } from './utils/configs';
30
30
 
31
- export {
32
- WidgetConfig,
33
- WalletType,
34
- WidgetTheme,
35
- WidgetColors,
36
- BlockchainAndTokenConfig,
37
- };
31
+ export { WidgetConfig, WidgetTheme, WidgetColors, BlockchainAndTokenConfig };
38
32
 
39
33
  export type WidgetProps = {
40
34
  config?: WidgetConfig;
@@ -8,7 +8,11 @@ import {
8
8
  } from '@rango-dev/ui';
9
9
  import React, { useEffect, useRef, useState } from 'react';
10
10
  import { getlistWallet, sortWalletsBasedOnState } from '../utils/wallets';
11
- import { WalletType, detectMobileScreens } from '@rango-dev/wallets-shared';
11
+ import {
12
+ WalletType,
13
+ WalletTypes,
14
+ detectMobileScreens,
15
+ } from '@rango-dev/wallets-shared';
12
16
  import { useWallets } from '@rango-dev/wallets-core';
13
17
 
14
18
  import { useUiStore } from '../store/ui';
@@ -50,7 +54,7 @@ export function WalletsPage({ supportedWallets, multiWallets }: PropTypes) {
50
54
  const wallets = getlistWallet(
51
55
  state,
52
56
  getWalletInfo,
53
- supportedWallets || Object.values(WalletType)
57
+ supportedWallets || Object.values(WalletTypes)
54
58
  );
55
59
  const walletsRef = useRef<WalletInfo[]>();
56
60
 
@@ -7,6 +7,7 @@ import {
7
7
  WalletType,
8
8
  detectInstallLink,
9
9
  WalletInfo,
10
+ WalletTypes,
10
11
  } from '@rango-dev/wallets-shared';
11
12
 
12
13
  import {
@@ -42,7 +43,7 @@ export function getStateWallet(state: WalletState): WalletStatus {
42
43
  }
43
44
  }
44
45
 
45
- export const excludedWallets = [WalletType.UNKNOWN, WalletType.LEAP];
46
+ export const excludedWallets = [WalletTypes.LEAP];
46
47
 
47
48
  export function getlistWallet(
48
49
  getState: (type: WalletType) => WalletState,
@@ -50,7 +51,7 @@ export function getlistWallet(
50
51
  list: WalletType[]
51
52
  ): ModalWalletInfo[] {
52
53
  return list
53
- .filter((wallet) => !excludedWallets.includes(wallet))
54
+ .filter((wallet) => !excludedWallets.includes(wallet as WalletTypes))
54
55
  .map((type) => {
55
56
  const {
56
57
  name,
@@ -377,7 +378,9 @@ export const getKeplrCompatibleConnectedWallets = (
377
378
  selectableWallets: SelectableWallet[]
378
379
  ): WalletType[] => {
379
380
  const connectedWalletTypes = new Set(
380
- selectableWallets.map((a: any) => a.walletType.toString())
381
+ selectableWallets.map((wallet) => {
382
+ return wallet.walletType;
383
+ })
381
384
  );
382
385
 
383
386
  return KEPLR_COMPATIBLE_WALLETS.filter((compatibleWallet) =>