@rango-dev/widget-embedded 0.32.2-next.1 → 0.32.2-next.10

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.32.2-next.1",
3
+ "version": "0.32.2-next.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,19 +25,19 @@
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.36.1-next.5",
28
+ "@rango-dev/provider-all": "^0.36.1-next.9",
29
29
  "@rango-dev/queue-manager-core": "^0.27.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.36.1-next.1",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.36.1-next.2",
31
31
  "@rango-dev/queue-manager-react": "^0.27.0",
32
32
  "@rango-dev/signer-solana": "^0.31.1-next.1",
33
- "@rango-dev/ui": "^0.38.1-next.0",
33
+ "@rango-dev/ui": "^0.38.1-next.4",
34
34
  "@rango-dev/wallets-core": "^0.37.1-next.1",
35
- "@rango-dev/wallets-react": "^0.22.1-next.1",
36
- "@rango-dev/wallets-shared": "^0.36.1-next.1",
35
+ "@rango-dev/wallets-react": "^0.22.1-next.2",
36
+ "@rango-dev/wallets-shared": "^0.36.1-next.2",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
40
- "ethers": "^5.7.2",
40
+ "ethers": "^6.13.2",
41
41
  "immer": "^9.0.19",
42
42
  "mitt": "^3.0.0",
43
43
  "rango-sdk": "^0.1.49",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -109,17 +109,15 @@ function Layout(props: PropsWithChildren<PropTypes>) {
109
109
  ref={containerRef}>
110
110
  <Header
111
111
  prefix={
112
- <>
113
- {showBackButton && (
114
- <BackButton
115
- onClick={() => {
116
- navigateBack();
117
- // As an example, used in routes page to add a custom logic when navigating back to the home page.
118
- header.onBack && header.onBack();
119
- }}
120
- />
121
- )}
122
- </>
112
+ showBackButton ? (
113
+ <BackButton
114
+ onClick={() => {
115
+ navigateBack();
116
+ // As an example, used in routes page to add a custom logic when navigating back to the home page.
117
+ header.onBack && header.onBack();
118
+ }}
119
+ />
120
+ ) : null
123
121
  }
124
122
  title={header.title}
125
123
  suffix={
@@ -1 +1,2 @@
1
1
  export { StatefulConnectModal } from './StatefulConnectModal';
2
+ export { isOnNamespace, isOnDerivationPath } from './helpers';
@@ -97,9 +97,12 @@ export function DerivationPath(props: PropTypes) {
97
97
  <MessageBox
98
98
  type="info"
99
99
  title={i18n.t('Select Derivation Path')}
100
- description={i18n.t(
101
- `In order to connect to ${type}, you must first select a Derivation Path`
102
- )}
100
+ description={i18n.t({
101
+ id: 'In order to connect to {type}, you must first select a Derivation Path',
102
+ values: {
103
+ type,
104
+ },
105
+ })}
103
106
  icon={
104
107
  <LogoContainer>
105
108
  <WalletImageContainer>
@@ -51,9 +51,12 @@ export function useFetchCustomToken(): UseFetchCustomToken {
51
51
  case 'not-found':
52
52
  return {
53
53
  title: i18n.t('Token Not Found'),
54
- message: i18n.t(
55
- `Sorry, no token was found on ${blockchain} blockchain with the provided address. please make sure you have entered the right token address.`
56
- ),
54
+ message: i18n.t({
55
+ id: 'Sorry, no token was found on {blockchain} blockchain with the provided address. please make sure you have entered the right token address.',
56
+ values: {
57
+ blockchain,
58
+ },
59
+ }),
57
60
  };
58
61
  }
59
62
  }
@@ -34,11 +34,14 @@ export function reducer(state: State, action: Actions): State {
34
34
  case 'reset':
35
35
  return initState;
36
36
  case 'resetDerivation':
37
- return {
38
- ...state,
39
- derivationPath: null,
40
- status: 'namespace',
41
- };
37
+ if (state.namespace) {
38
+ return {
39
+ ...state,
40
+ derivationPath: null,
41
+ status: 'namespace',
42
+ };
43
+ }
44
+ return initState;
42
45
  default:
43
46
  throw new Error(`Action hasn't been defined.`);
44
47
  }
package/src/index.ts CHANGED
@@ -57,6 +57,11 @@ import { useWallets, Events as WalletEvents } from '@rango-dev/wallets-react';
57
57
  import { Networks, WalletTypes } from '@rango-dev/wallets-shared';
58
58
  import { PendingSwapNetworkStatus } from 'rango-types';
59
59
 
60
+ import {
61
+ isOnDerivationPath,
62
+ isOnNamespace,
63
+ } from './components/StatefulConnectModal';
64
+ import { DerivationPath, Namespaces } from './components/WalletStatefulConnect';
60
65
  import { WIDGET_UI_ID as UI_ID } from './constants';
61
66
  import { SUPPORTED_FONTS } from './constants/fonts';
62
67
  import { WidgetWallets } from './containers/Wallets';
@@ -76,6 +81,13 @@ import {
76
81
  } from './types';
77
82
  import { customizedThemeTokens } from './utils/ui';
78
83
 
84
+ export const StatefulConnect = {
85
+ DerivationPath,
86
+ Namespaces,
87
+ isOnDerivationPath,
88
+ isOnNamespace,
89
+ };
90
+
79
91
  export type {
80
92
  WidgetConfig,
81
93
  WalletType,