@rango-dev/widget-embedded 0.36.1-next.4 → 0.36.1-next.6

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.
Files changed (26) hide show
  1. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts +2 -1
  2. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts.map +1 -1
  3. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts +1 -1
  4. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts.map +1 -1
  5. package/dist/hooks/useFetchCustomToken.d.ts.map +1 -1
  6. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts +2 -1
  7. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts.map +1 -1
  8. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts +1 -1
  9. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts.map +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/index.js.map +3 -3
  12. package/dist/types/wallets.d.ts +2 -1
  13. package/dist/types/wallets.d.ts.map +1 -1
  14. package/dist/utils/hub.d.ts +1 -1
  15. package/dist/utils/hub.d.ts.map +1 -1
  16. package/dist/widget-embedded.build.json +1 -1
  17. package/package.json +7 -7
  18. package/src/components/StatefulConnectModal/StatefulConnectModal.tsx +1 -1
  19. package/src/components/WalletStatefulConnect/DerivationPath.helpers.ts +2 -1
  20. package/src/components/WalletStatefulConnect/Namespaces.tsx +1 -1
  21. package/src/components/WalletStatefulConnect/Namespaces.types.tsx +1 -1
  22. package/src/hooks/useFetchCustomToken.ts +5 -0
  23. package/src/hooks/useStatefulConnect/useStatefulConnect.ts +2 -5
  24. package/src/hooks/useStatefulConnect/useStatefulConnect.types.ts +1 -1
  25. package/src/types/wallets.ts +2 -1
  26. package/src/utils/hub.ts +8 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.36.1-next.4",
3
+ "version": "0.36.1-next.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,15 +25,15 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.6.0",
28
- "@rango-dev/provider-all": "^0.40.1-next.1",
28
+ "@rango-dev/provider-all": "^0.40.1-next.2",
29
29
  "@rango-dev/queue-manager-core": "^0.27.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.40.1-next.1",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.40.1-next.2",
31
31
  "@rango-dev/queue-manager-react": "^0.27.0",
32
32
  "@rango-dev/signer-solana": "^0.35.0",
33
- "@rango-dev/ui": "^0.42.1-next.3",
34
- "@rango-dev/wallets-core": "^0.40.1-next.1",
35
- "@rango-dev/wallets-react": "^0.26.1-next.1",
36
- "@rango-dev/wallets-shared": "^0.40.1-next.1",
33
+ "@rango-dev/ui": "^0.42.1-next.4",
34
+ "@rango-dev/wallets-core": "^0.40.1-next.2",
35
+ "@rango-dev/wallets-react": "^0.26.1-next.2",
36
+ "@rango-dev/wallets-shared": "^0.40.1-next.2",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
@@ -1,6 +1,6 @@
1
1
  import type { Result } from '../../hooks/useStatefulConnect';
2
2
  import type { WalletInfoWithExtra } from '../../types';
3
- import type { Namespace } from '@rango-dev/wallets-shared';
3
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
4
4
 
5
5
  import { Divider } from '@rango-dev/ui';
6
6
  import React, { useEffect, useRef, useState } from 'react';
@@ -1,4 +1,5 @@
1
- import type { DerivationPath, Namespace } from '@rango-dev/wallets-shared';
1
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
2
+ import type { DerivationPath } from '@rango-dev/wallets-shared';
2
3
 
3
4
  import { namespaces } from '@rango-dev/wallets-shared';
4
5
 
@@ -1,5 +1,5 @@
1
1
  import type { PropTypes } from './Namespaces.types';
2
- import type { Namespace } from '@rango-dev/wallets-shared';
2
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
3
3
 
4
4
  import { i18n } from '@lingui/core';
5
5
  import {
@@ -1,5 +1,5 @@
1
1
  import type { NeedsNamespacesState } from '../../hooks/useStatefulConnect';
2
- import type { Namespace } from '@rango-dev/wallets-shared';
2
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
3
3
 
4
4
  export interface PropTypes {
5
5
  onConfirm: (namespaces: Namespace[]) => void;
@@ -103,6 +103,11 @@ export function useFetchCustomToken(): UseFetchCustomToken {
103
103
 
104
104
  return token;
105
105
  } catch (error: any) {
106
+ if (error?.code === 'ERR_BAD_REQUEST') {
107
+ const errorMessage = produceErrorMessage('not-found', blockchain);
108
+ setError(errorMessage);
109
+ return undefined;
110
+ }
106
111
  setError(undefined);
107
112
  throw new Error(error.message);
108
113
  } finally {
@@ -1,11 +1,8 @@
1
1
  import type { HandleConnectOptions, Result } from './useStatefulConnect.types';
2
2
  import type { WalletInfoWithExtra } from '../../types';
3
3
  import type { ExtendedModalWalletInfo } from '../../utils/wallets';
4
- import type {
5
- Namespace,
6
- NamespaceData,
7
- WalletType,
8
- } from '@rango-dev/wallets-shared';
4
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
5
+ import type { NamespaceData, WalletType } from '@rango-dev/wallets-shared';
9
6
 
10
7
  import { WalletState } from '@rango-dev/ui';
11
8
  import { useWallets } from '@rango-dev/wallets-react';
@@ -1,4 +1,4 @@
1
- import type { Namespace } from '@rango-dev/wallets-shared';
1
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
2
2
 
3
3
  export interface HandleConnectOptions {
4
4
  // To have a switch between connect and disconnect when user is clicking on a button, this option can be helpful.
@@ -1,5 +1,6 @@
1
1
  import type { WalletInfo } from '@rango-dev/ui';
2
- import type { Namespace, WalletType } from '@rango-dev/wallets-shared';
2
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
3
+ import type { WalletType } from '@rango-dev/wallets-shared';
3
4
 
4
5
  export interface Wallet {
5
6
  chain: string;
package/src/utils/hub.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { CommonNamespaceKeys } from '@rango-dev/wallets-core';
2
-
3
- import { Namespace } from '@rango-dev/wallets-shared';
2
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
4
3
 
5
4
  export function convertCommonNamespacesKeysToLegacyNamespace(
6
5
  namespaces: CommonNamespaceKeys[]
@@ -8,15 +7,15 @@ export function convertCommonNamespacesKeysToLegacyNamespace(
8
7
  return namespaces.map((namespace) => {
9
8
  switch (namespace) {
10
9
  case 'evm':
11
- return Namespace.Evm;
10
+ return 'EVM';
12
11
  case 'solana':
13
- return Namespace.Solana;
12
+ return 'Solana';
14
13
  case 'cosmos':
15
- return Namespace.Cosmos;
14
+ return 'Cosmos';
15
+ default:
16
+ throw new Error(
17
+ 'Can not convert this common namespace key to a proper legacy key.'
18
+ );
16
19
  }
17
-
18
- throw new Error(
19
- 'Can not convert this common namespace key to a proper legacy key.'
20
- );
21
20
  });
22
21
  }