@rango-dev/widget-embedded 0.43.1-next.4 → 0.43.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.43.1-next.4",
3
+ "version": "0.43.1-next.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,23 +25,23 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.8.0",
28
- "@rango-dev/provider-all": "^0.46.1-next.3",
28
+ "@rango-dev/provider-all": "^0.46.1-next.4",
29
29
  "@rango-dev/queue-manager-core": "^0.29.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.45.2-next.10",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.45.2-next.11",
31
31
  "@rango-dev/queue-manager-react": "^0.29.0",
32
- "@rango-dev/signer-solana": "^0.39.1-next.3",
33
- "@rango-dev/ui": "^0.46.2-next.12",
34
- "@rango-dev/wallets-core": "^0.43.1-next.10",
35
- "@rango-dev/wallets-react": "^0.30.2-next.11",
36
- "@rango-dev/wallets-shared": "^0.44.2-next.12",
32
+ "@rango-dev/signer-solana": "^0.39.1-next.4",
33
+ "@rango-dev/ui": "^0.46.2-next.13",
34
+ "@rango-dev/wallets-core": "^0.43.1-next.11",
35
+ "@rango-dev/wallets-react": "^0.30.2-next.12",
36
+ "@rango-dev/wallets-shared": "^0.44.2-next.13",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
40
40
  "ethers": "^6.13.2",
41
41
  "immer": "^9.0.19",
42
42
  "mitt": "^3.0.0",
43
- "rango-sdk": "^0.1.67",
44
- "rango-types": "^0.1.84",
43
+ "rango-sdk": "^0.1.68",
44
+ "rango-types": "^0.1.85",
45
45
  "react-i18next": "^12.2.0",
46
46
  "react-router-dom": "^6.8.0",
47
47
  "values.js": "2.1.1",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -19,4 +19,8 @@ export const modalNetworkValues: Record<
19
19
  type: 'success',
20
20
  title: i18n.t('Network Changed'),
21
21
  },
22
+ [PendingSwapNetworkStatus.NetworkChangeFailed]: {
23
+ type: 'warning',
24
+ title: i18n.t('Network Change Failed'),
25
+ },
22
26
  };
@@ -41,14 +41,18 @@ export function getUsdExchangeRate(params: {
41
41
  if (!toTokenUsdPrice || !fromTokenUsdPrice) {
42
42
  return { rawValue: '0', displayValue: '0' };
43
43
  }
44
-
45
44
  const toPrice = new BigNumber(toTokenUsdPrice);
46
45
  const fromPrice = new BigNumber(fromTokenUsdPrice);
47
46
  const rawValue = toPrice.dividedBy(fromPrice);
48
47
  let displayValue: string;
49
48
 
50
49
  if (rawValue.isLessThan(1)) {
51
- displayValue = rawValue.toFixed(SMALL_VALUE_DECIMALS);
50
+ /*
51
+ * Format the number with up to SMALL_VALUE_DECIMALS digits after the decimal point,
52
+ * then remove any trailing zeros.
53
+ * Example: "0.120000" → "0.12", "0.00000000000010" → "0.0000000000001"
54
+ */
55
+ displayValue = rawValue.toFixed(SMALL_VALUE_DECIMALS).replace(/\.?0+$/, '');
52
56
  } else if (rawValue.toFixed(0).length > LARGE_VALUE_MAX_DIGITS) {
53
57
  displayValue = rawValue.toFixed(0).slice(0, LARGE_VALUE_MAX_DIGITS);
54
58
  } else {