@rango-dev/widget-embedded 0.4.0 → 0.5.1-next.0

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.4.0",
3
+ "version": "0.5.1-next.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,13 +17,13 @@
17
17
  "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
18
18
  },
19
19
  "dependencies": {
20
- "@rango-dev/provider-all": "^0.4.0",
21
- "@rango-dev/queue-manager-core": "^0.4.0",
22
- "@rango-dev/queue-manager-rango-preset": "^0.3.0",
23
- "@rango-dev/queue-manager-react": "^0.4.0",
24
- "@rango-dev/ui": "^0.3.0",
25
- "@rango-dev/wallets-core": "^0.4.0",
26
- "@rango-dev/wallets-shared": "^0.3.0",
20
+ "@rango-dev/provider-all": "^0.5.1-next.0",
21
+ "@rango-dev/queue-manager-core": "^0.5.1-next.0",
22
+ "@rango-dev/queue-manager-rango-preset": "^0.5.1-next.0",
23
+ "@rango-dev/queue-manager-react": "^0.5.1-next.0",
24
+ "@rango-dev/ui": "^0.5.1-next.0",
25
+ "@rango-dev/wallets-core": "^0.5.1-next.0",
26
+ "@rango-dev/wallets-shared": "^0.5.0",
27
27
  "bignumber.js": "^9.1.1",
28
28
  "copy-to-clipboard": "^3.3.3",
29
29
  "dayjs": "^1.11.7",
@@ -32,9 +32,8 @@
32
32
  "i18next-http-backend": "^2.1.1",
33
33
  "immer": "^9.0.19",
34
34
  "mitt": "^3.0.0",
35
- "parcel": "^2.8.0",
36
35
  "rango-sdk": "^0.1.30",
37
- "rango-types": "^0.1.38",
36
+ "rango-types": "^0.1.39",
38
37
  "react-i18next": "^12.2.0",
39
38
  "react-router-dom": "^6.8.0",
40
39
  "values.js": "2.1.1",
@@ -15,8 +15,8 @@ import {
15
15
  import { useMetaStore } from './store/meta';
16
16
  import { useWalletsStore } from './store/wallets';
17
17
  import { walletAndSupportedChainsNames } from './utils/wallets';
18
- import { isEvmBlockchain } from 'rango-sdk';
19
18
  import { getConfig } from './utils/configs';
19
+ import { isEvmBlockchain } from 'rango-types';
20
20
 
21
21
  function QueueManager(props: PropsWithChildren) {
22
22
  const {
package/src/Widget.tsx CHANGED
@@ -109,8 +109,7 @@ export const Widget: React.FC<WidgetProps> = ({ config }) => {
109
109
  <Provider
110
110
  allBlockChains={blockchains}
111
111
  providers={providers}
112
- onUpdateState={onUpdateState}
113
- >
112
+ onUpdateState={onUpdateState}>
114
113
  <div id="swap-container" className={activeTheme}>
115
114
  <QueueManager>
116
115
  <SwapContainer fixedHeight={currentPage !== navigationRoutes.home}>
@@ -119,8 +118,7 @@ export const Widget: React.FC<WidgetProps> = ({ config }) => {
119
118
  disconnectedWallet={disconnectedWallet}
120
119
  clearDisconnectedWallet={() => {
121
120
  setDisconnectedWallet(undefined);
122
- }}
123
- >
121
+ }}>
124
122
  <Layout config={config} />
125
123
  </AppRouter>
126
124
  </SwapContainer>
@@ -2,10 +2,10 @@ import React, { Fragment, PropsWithChildren } from 'react';
2
2
  import { MemoryRouter, useInRouterContext } from 'react-router';
3
3
  import { useQueueManager } from '@rango-dev/queue-manager-rango-preset';
4
4
  import { WalletType } from '@rango-dev/wallets-shared';
5
- import { isEvmBlockchain } from 'rango-types';
6
5
  import { UpdateUrl } from './UpdateUrl';
7
6
  import { useMetaStore } from '../store/meta';
8
7
  import { useWallets } from '@rango-dev/wallets-core';
8
+ import { isEvmBlockchain } from 'rango-types';
9
9
 
10
10
  export function AppRouter({
11
11
  children,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { styled } from '@rango-dev/ui/';
2
+ import { styled } from '@rango-dev/ui';
3
3
  import { Typography } from '@rango-dev/ui';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
@@ -172,7 +172,7 @@ export function getSelectableWallets(
172
172
  destinationChain?: string
173
173
  ): SelectableWallet[] {
174
174
  const selectableWallets = connectedWallets.map(
175
- (connectedWallet: ConnectedWallet) => {
175
+ (connectedWallet: ConnectedWallet) => {
176
176
  return {
177
177
  address: connectedWallet.address,
178
178
  walletType: connectedWallet.walletType,
@@ -325,13 +325,13 @@ export const calculateWalletUsdValue = (connectedWallet: ConnectedWallet[]) => {
325
325
  };
326
326
 
327
327
  function numberWithThousandSeperator(number: string | number): string {
328
- var parts = number.toString().split('.');
328
+ const parts = number.toString().split('.');
329
329
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
330
330
  return parts.join('.');
331
331
  }
332
332
 
333
333
  export const sortTokens = (tokens: TokenWithBalance[]): TokenWithBalance[] => {
334
- let walletConnected = !!tokens.some((token) => token.balance);
334
+ const walletConnected = !!tokens.some((token) => token.balance);
335
335
  if (!walletConnected) {
336
336
  return tokens
337
337
  .filter((token) => !token.address)