@rango-dev/widget-embedded 0.43.1-next.1 → 0.43.1-next.3

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.1",
3
+ "version": "0.43.1-next.3",
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.8.0",
28
- "@rango-dev/provider-all": "^0.46.1-next.1",
28
+ "@rango-dev/provider-all": "^0.46.1-next.3",
29
29
  "@rango-dev/queue-manager-core": "^0.29.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.45.2-next.8",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.45.2-next.10",
31
31
  "@rango-dev/queue-manager-react": "^0.29.0",
32
32
  "@rango-dev/signer-solana": "^0.39.1-next.3",
33
- "@rango-dev/ui": "^0.46.2-next.10",
34
- "@rango-dev/wallets-core": "^0.43.1-next.7",
35
- "@rango-dev/wallets-react": "^0.30.2-next.9",
36
- "@rango-dev/wallets-shared": "^0.44.2-next.8",
33
+ "@rango-dev/ui": "^0.46.2-next.11",
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",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
@@ -341,7 +341,7 @@ export function Quote(props: QuoteProps) {
341
341
  quote={quote}
342
342
  fullExpandedMode
343
343
  time={totalTime}
344
- fee={fee}
344
+ fee={totalFee}
345
345
  feeWarning={feeWarning}
346
346
  timeWarning={timeWarning}
347
347
  showModalFee={showModalFee}
@@ -384,7 +384,7 @@ export function Quote(props: QuoteProps) {
384
384
  <QuoteCostDetails
385
385
  quote={quote}
386
386
  time={totalTime}
387
- fee={fee}
387
+ fee={totalFee}
388
388
  feeWarning={feeWarning}
389
389
  timeWarning={timeWarning}
390
390
  showModalFee={showModalFee}
@@ -1,5 +1,6 @@
1
1
  import type { QuoteError, QuoteWarning, SelectedQuote } from '../../types';
2
2
  import type { Step } from '@rango-dev/ui';
3
+ import type BigNumber from 'bignumber.js';
3
4
  import type { ReactNode } from 'react';
4
5
 
5
6
  export type QuoteProps = {
@@ -45,7 +46,7 @@ export type QuoteTriggerImagesProps = {
45
46
  export type QuoteCostDetailsProps = {
46
47
  quote: SelectedQuote | null;
47
48
  steps: number;
48
- fee: string;
49
+ fee: BigNumber;
49
50
  time: string;
50
51
  feeWarning?: boolean;
51
52
  timeWarning?: boolean;
@@ -71,6 +71,11 @@ export function QuoteCostDetails(props: QuoteCostDetailsProps) {
71
71
  const container = fullExpandedMode ? getExpanded() : getContainer();
72
72
 
73
73
  const feesGroup = getFeesGroup(swaps);
74
+ const roundedFee = numberToString(
75
+ fee,
76
+ GAS_FEE_MIN_DECIMALS,
77
+ GAS_FEE_MAX_DECIMALS
78
+ );
74
79
 
75
80
  return (
76
81
  <>
@@ -83,7 +88,7 @@ export function QuoteCostDetails(props: QuoteCostDetailsProps) {
83
88
  }
84
89
  : undefined
85
90
  }
86
- fee={fee}
91
+ fee={roundedFee}
87
92
  feeWarning={feeWarning}
88
93
  timeWarning={timeWarning}
89
94
  time={time}
@@ -145,7 +150,7 @@ export function QuoteCostDetails(props: QuoteCostDetailsProps) {
145
150
  fee.amount,
146
151
  GAS_FEE_MIN_DECIMALS,
147
152
  GAS_FEE_MAX_DECIMALS
148
- )}{' '}
153
+ )}
149
154
  {fee.asset.symbol} ($
150
155
  {numberToString(
151
156
  usdValue,
@@ -174,7 +179,7 @@ export function QuoteCostDetails(props: QuoteCostDetailsProps) {
174
179
  </Typography>
175
180
  </FeeSection>
176
181
  <Line />
177
- {Object.keys(feesGroup.nonePayable).length && (
182
+ {!!Object.keys(feesGroup.nonePayable).length && (
178
183
  <CustomCollapsible
179
184
  triggerAnchor="bottom"
180
185
  onClickTrigger={() => setOpenCollapse((prev) => !prev)}
@@ -60,6 +60,7 @@ interface DeprecatedTokenBalance {
60
60
  rawAmount: string;
61
61
  decimal: number | null;
62
62
  amount: string;
63
+ isSupported: boolean;
63
64
  logo: string | null;
64
65
  usdPrice: number | null;
65
66
  }
@@ -807,6 +808,7 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
807
808
  rawAmount: balance.amount,
808
809
  decimal: balance.decimals,
809
810
  amount: amount.toString(),
811
+ isSupported: !!token,
810
812
  logo: token?.image || null,
811
813
  usdPrice: token?.usdPrice || null,
812
814
  });
@@ -200,7 +200,7 @@ export type TonConnectConfig = {
200
200
  * exchange.It can also used to limit source swap blockchains/tokens to some limited ones.
201
201
  * @property {TrezorManifest} trezorManifest - Trezor Connect Manifest requires that you,
202
202
  * as a Trezor Connect integrator,share your e-mail and application url.
203
- * @property {TonConnectConfig} tonConnect - Configuration for TON Connect compatible providers like MyTonWallet.
203
+ * @property {TonConnectConfig} tonConnect - Configuration for the TON Connect provider.
204
204
  * @property {BlockchainAndTokenConfig} to - The "to" property is an optional property of type
205
205
  * "BlockchainAndTokenConfig" that specifies the default blockchain and token to which the user wants to
206
206
  * exchange.It can also used to limit destination swap blockchains/tokens to some limited ones.
package/src/utils/swap.ts CHANGED
@@ -305,8 +305,9 @@ export function getTotalFeeInUsd(
305
305
 
306
306
  export function getUsdFee(fee: SwapFee): BigNumber {
307
307
  let totalFeeInUsd = ZERO;
308
+ const price = new BigNumber(fee.price || 0);
308
309
  totalFeeInUsd = totalFeeInUsd.plus(
309
- new BigNumber(fee.amount).multipliedBy(fee.price || 0)
310
+ new BigNumber(fee.amount).multipliedBy(price)
310
311
  );
311
312
 
312
313
  return totalFeeInUsd;