@rango-dev/widget-embedded 0.17.1-next.29 → 0.17.1-next.30
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/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +3 -3
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/store/quote.d.ts +1 -1
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/types/swap.d.ts +1 -1
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -1
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +1 -1
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.tsx +10 -26
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +1 -1
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
- package/src/index.ts +5 -3
- package/src/pages/HistoryPage.tsx +1 -2
- package/src/store/quote.ts +1 -1
- package/src/types/swap.ts +1 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/providers.ts +8 -5
- package/src/utils/queue.ts +2 -2
- package/src/utils/quote.ts +1 -1
- package/src/utils/swap.ts +2 -5
- package/src/utils/time.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../../src/pages/HistoryPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../../src/pages/HistoryPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0CxC,wBAAgB,WAAW,sBAoE1B"}
|
package/dist/store/quote.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Wallet } from '../types';
|
|
2
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset/dist/shared';
|
|
3
2
|
import type { BestRouteResponse, BlockchainMeta, MetaResponse, Token } from 'rango-sdk';
|
|
3
|
+
import type { PendingSwap } from 'rango-types';
|
|
4
4
|
import BigNumber from 'bignumber.js';
|
|
5
5
|
export declare const getUsdValue: (token: Token | null, amount: string) => BigNumber | null;
|
|
6
6
|
export type Meta = Pick<MetaResponse, 'blockchains' | 'tokens'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../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AiB,GAAG,IAAI,KAAK,IAAI;mCAC9B,WAAW,QAAQ,IAAI,KAAK,IAAI;qCAC9B,IAAI;8CACK,OAAO,KAAK,IAAI;4CAClB,MAAM,EAAE,KAAK,IAAI;;8CAEf,MAAM,KAAK,IAAI;uCACtB,IAAI;gDACK,OAAO,KAAK,IAAI;;CA0LnD,CAAC"}
|
package/dist/types/swap.d.ts
CHANGED
package/dist/types/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/types/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/types/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,iBAAiB,EACjB,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GAAG,IAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
2
|
+
import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
3
|
export interface ProvidersOptions {
|
|
4
4
|
walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,EAClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB,EAAE,CAoCrB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,EAAE,CAMV"}
|
package/dist/utils/queue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
-
import { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
1
|
+
import type { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
+
import type { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
3
3
|
export declare const getPendingSwaps: (manager: Manager | undefined) => PendingSwapWithQueueID[];
|
|
4
4
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,uCAAuC,CAAC;AAE/C,eAAO,MAAM,eAAe,YAAa,OAAO,GAAG,SAAS,6BAiB3D,CAAC"}
|
package/dist/utils/quote.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { QuoteError, QuoteWarning, Wallet } from '../types';
|
|
2
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { PriceImpactWarningLevel } from '@rango-dev/ui';
|
|
4
3
|
import type { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/widget/ui/src/types/swaps';
|
|
5
4
|
import type { Asset, BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap } from 'rango-types';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
7
7
|
export declare function searchParamsToToken(tokens: Token[], searchParams: string | null, chain: BlockchainMeta | null): Token | null;
|
|
8
8
|
export declare function getQuoteToTokenUsdPrice(quote: BestRouteResponse | null): number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV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E,WAAW,EACxB,WAAW,EAAE,cAAc,EAAE,EAC7B,MAAM,EAAE,KAAK,EAAE,GACd;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CA4CA;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IACN,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,YAAY,GAAG,IAAI,CAiDrB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,UAAU,GAAG,IAAI,CA+BnB;AAED,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EACxC,cAAc,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GACxC,MAAM,GAAG,IAAI,CAcf"}
|
package/dist/utils/swap.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FetchStatus } from '../store/slices/data';
|
|
2
2
|
import type { ConvertedToken, QuoteError, QuoteWarning, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
|
|
3
|
-
import type { PendingSwap, PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
4
3
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
5
4
|
import type { BestRouteRequest, BestRouteResponse, BlockchainMeta, RecommendedSlippage, SwapResult, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap, PendingSwapStep } from 'rango-types';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
7
7
|
export declare function getOutputRatio(inputUsdValue: BigNumber | null, outputUsdValue: BigNumber | null): number;
|
|
8
8
|
export declare function hasHighValueLoss(inputUsdValue: BigNumber | null, priceImpact: number): boolean;
|
package/dist/utils/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,UAejC;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,WAAW,EAAE,MAAM,GAClB,OAAO,CAQT;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAgBtE;AACD,wBAAgB,oBAAoB,CAAC,KAAK,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ap } from '
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
2
|
export declare function timeSince(millisecond: number): string;
|
|
3
3
|
export declare function getSwapDate(pendingSwap: PendingSwap): string;
|
|
4
4
|
//# sourceMappingURL=time.d.ts.map
|
package/dist/utils/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqDrD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAUnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.17.1-next.
|
|
3
|
+
"version": "0.17.1-next.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@lingui/core": "4.2.1",
|
|
23
23
|
"@lingui/react": "4.2.1",
|
|
24
|
-
"@rango-dev/provider-all": "^0.22.1-next.
|
|
24
|
+
"@rango-dev/provider-all": "^0.22.1-next.9",
|
|
25
25
|
"@rango-dev/queue-manager-core": "^0.22.1-next.3",
|
|
26
|
-
"@rango-dev/queue-manager-rango-preset": "^0.22.1-next.
|
|
26
|
+
"@rango-dev/queue-manager-rango-preset": "^0.22.1-next.12",
|
|
27
27
|
"@rango-dev/queue-manager-react": "^0.22.1-next.3",
|
|
28
|
-
"@rango-dev/ui": "^0.22.1-next.
|
|
29
|
-
"@rango-dev/wallets-react": "^0.8.1-next.
|
|
30
|
-
"@rango-dev/wallets-shared": "^0.21.1-next.
|
|
28
|
+
"@rango-dev/ui": "^0.22.1-next.17",
|
|
29
|
+
"@rango-dev/wallets-react": "^0.8.1-next.6",
|
|
30
|
+
"@rango-dev/wallets-shared": "^0.21.1-next.6",
|
|
31
31
|
"bignumber.js": "^9.1.1",
|
|
32
32
|
"copy-to-clipboard": "^3.3.3",
|
|
33
33
|
"dayjs": "^1.11.7",
|
|
34
34
|
"immer": "^9.0.19",
|
|
35
35
|
"mitt": "^3.0.0",
|
|
36
|
-
"rango-sdk": "^0.1.
|
|
37
|
-
"rango-types": "^0.1.
|
|
36
|
+
"rango-sdk": "^0.1.44",
|
|
37
|
+
"rango-types": "^0.1.57",
|
|
38
38
|
"react-i18next": "^12.2.0",
|
|
39
39
|
"react-router-dom": "^6.8.0",
|
|
40
40
|
"values.js": "2.1.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GetStep } from '../SwapDetailsAlerts';
|
|
2
|
-
import type { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { Step, StepDetailsProps } from '@rango-dev/ui';
|
|
3
|
+
import type { PendingSwapStep } from 'rango-types';
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
getCurrentBlockchainOfOrNull,
|
|
7
7
|
getCurrentStep,
|
|
8
8
|
getRelatedWalletOrNull,
|
|
9
|
-
PendingSwapNetworkStatus,
|
|
10
9
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
useCopyToClipboard,
|
|
20
19
|
} from '@rango-dev/ui';
|
|
21
20
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
21
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
22
22
|
import React, { useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { useNavigate } from 'react-router-dom';
|
|
24
24
|
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
shouldRetrySwap,
|
|
48
48
|
} from '../../utils/swap';
|
|
49
49
|
import { getSwapDate } from '../../utils/time';
|
|
50
|
-
import { getConciseAddress
|
|
50
|
+
import { getConciseAddress } from '../../utils/wallets';
|
|
51
51
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
52
52
|
import { Layout } from '../Layout';
|
|
53
53
|
import { QuoteSummary } from '../Quote';
|
|
@@ -163,35 +163,19 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
163
163
|
)?.diagnosisUrl;
|
|
164
164
|
|
|
165
165
|
const outputUsdValue = numberToString(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
) *
|
|
174
|
-
(getUsdPrice(
|
|
175
|
-
lastStep.toBlockchain,
|
|
176
|
-
lastStep.toSymbol,
|
|
177
|
-
lastStep.toSymbolAddress,
|
|
178
|
-
tokens
|
|
179
|
-
) || 0)
|
|
180
|
-
),
|
|
166
|
+
parseFloat(
|
|
167
|
+
numberToString(
|
|
168
|
+
outputAmount,
|
|
169
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
170
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
171
|
+
)
|
|
172
|
+
) * (lastStep.toUsdPrice || 0),
|
|
181
173
|
USD_VALUE_MIN_DECIMALS,
|
|
182
174
|
USD_VALUE_MAX_DECIMALS
|
|
183
175
|
);
|
|
184
176
|
|
|
185
177
|
const inputUsdValue = numberToString(
|
|
186
|
-
|
|
187
|
-
parseFloat(swap.inputAmount) *
|
|
188
|
-
(getUsdPrice(
|
|
189
|
-
firstStep.fromBlockchain,
|
|
190
|
-
firstStep.fromSymbol,
|
|
191
|
-
firstStep.fromSymbolAddress,
|
|
192
|
-
tokens
|
|
193
|
-
) || 0)
|
|
194
|
-
),
|
|
178
|
+
parseFloat(swap.inputAmount) * (firstStep.fromUsdPrice || 0),
|
|
195
179
|
USD_VALUE_MIN_DECIMALS,
|
|
196
180
|
USD_VALUE_MAX_DECIMALS
|
|
197
181
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WaningAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
4
|
import { Alert, Button } from '@rango-dev/ui';
|
|
5
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
export function WarningAlert(props: WaningAlertsProps) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalNetworkValueTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
|
|
6
6
|
export const modalNetworkValues: Record<
|
|
7
7
|
Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
4
3
|
import { Modal } from '@rango-dev/ui';
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
2
1
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
+
import type { PendingSwapNetworkStatus } from 'rango-types';
|
|
3
3
|
|
|
4
4
|
export type ModalState =
|
|
5
5
|
| Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>
|
package/src/index.ts
CHANGED
|
@@ -9,8 +9,6 @@ import type {
|
|
|
9
9
|
} from './types';
|
|
10
10
|
import type {
|
|
11
11
|
EventSeverity,
|
|
12
|
-
PendingSwap,
|
|
13
|
-
PendingSwapStep,
|
|
14
12
|
PendingSwapWithQueueID,
|
|
15
13
|
Route,
|
|
16
14
|
RouteEvent,
|
|
@@ -38,10 +36,14 @@ import type {
|
|
|
38
36
|
WalletState,
|
|
39
37
|
WalletType,
|
|
40
38
|
} from '@rango-dev/wallets-shared';
|
|
39
|
+
import type {
|
|
40
|
+
PendingSwap,
|
|
41
|
+
PendingSwapNetworkStatus,
|
|
42
|
+
PendingSwapStep,
|
|
43
|
+
} from 'rango-types';
|
|
41
44
|
|
|
42
45
|
import {
|
|
43
46
|
MainEvents,
|
|
44
|
-
PendingSwapNetworkStatus,
|
|
45
47
|
RouteEventType,
|
|
46
48
|
StepEventType,
|
|
47
49
|
StepExecutionBlockedEventStatus,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { PendingSwap } from '
|
|
2
|
-
import type { PendingSwapStep } from 'rango-types';
|
|
1
|
+
import type { PendingSwap, PendingSwapStep } from 'rango-types';
|
|
3
2
|
|
|
4
3
|
import { i18n } from '@lingui/core';
|
|
5
4
|
import { useManager } from '@rango-dev/queue-manager-react';
|
package/src/store/quote.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Wallet } from '../types';
|
|
2
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset/dist/shared';
|
|
3
2
|
import type {
|
|
4
3
|
BestRouteResponse,
|
|
5
4
|
BlockchainMeta,
|
|
6
5
|
MetaResponse,
|
|
7
6
|
Token,
|
|
8
7
|
} from 'rango-sdk';
|
|
8
|
+
import type { PendingSwap } from 'rango-types';
|
|
9
9
|
|
|
10
10
|
import BigNumber from 'bignumber.js';
|
|
11
11
|
import { create } from 'zustand';
|
package/src/types/swap.ts
CHANGED
package/src/utils/date.ts
CHANGED
package/src/utils/providers.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
2
|
+
import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
|
+
|
|
1
4
|
import { allProviders } from '@rango-dev/provider-all';
|
|
2
|
-
import { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
|
-
import { WidgetConfig } from '../types';
|
|
4
5
|
|
|
5
6
|
export interface ProvidersOptions {
|
|
6
7
|
walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
|
|
@@ -26,9 +27,11 @@ export function matchAndGenerateProviders(
|
|
|
26
27
|
const selectedProviders: ProviderInterface[] = [];
|
|
27
28
|
|
|
28
29
|
providers.forEach((requestedProvider) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/*
|
|
31
|
+
* There are two types of provider we get, the first one is only passing the wallet name
|
|
32
|
+
* then we will match the wallet name with our providers (@rango-dev/provider-*).
|
|
33
|
+
* The second way is passing a custom provider which implemented ProviderInterface.
|
|
34
|
+
*/
|
|
32
35
|
if (typeof requestedProvider === 'string') {
|
|
33
36
|
const result: ProviderInterface | undefined = all.find((provider) => {
|
|
34
37
|
return provider.config.type === requestedProvider;
|
package/src/utils/queue.ts
CHANGED
package/src/utils/quote.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
2
|
import type { QuoteError, QuoteWarning, Wallet } from '../types';
|
|
3
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
4
3
|
import type { PriceImpactWarningLevel } from '@rango-dev/ui';
|
|
5
4
|
import type {
|
|
6
5
|
SimulationAssetAndAmount,
|
|
@@ -12,6 +11,7 @@ import type {
|
|
|
12
11
|
BlockchainMeta,
|
|
13
12
|
Token,
|
|
14
13
|
} from 'rango-sdk';
|
|
14
|
+
import type { PendingSwap } from 'rango-types';
|
|
15
15
|
|
|
16
16
|
import { getLastSuccessfulStep } from '@rango-dev/queue-manager-rango-preset';
|
|
17
17
|
import BigNumber from 'bignumber.js';
|
package/src/utils/swap.ts
CHANGED
|
@@ -8,10 +8,6 @@ import type {
|
|
|
8
8
|
SwapButtonState,
|
|
9
9
|
Wallet,
|
|
10
10
|
} from '../types';
|
|
11
|
-
import type {
|
|
12
|
-
PendingSwap,
|
|
13
|
-
PendingSwapStep,
|
|
14
|
-
} from '@rango-dev/queue-manager-rango-preset';
|
|
15
11
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
16
12
|
import type {
|
|
17
13
|
BestRouteRequest,
|
|
@@ -21,10 +17,11 @@ import type {
|
|
|
21
17
|
SwapResult,
|
|
22
18
|
Token,
|
|
23
19
|
} from 'rango-sdk';
|
|
20
|
+
import type { PendingSwap, PendingSwapStep } from 'rango-types';
|
|
24
21
|
|
|
25
22
|
import { i18n } from '@lingui/core';
|
|
26
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
27
23
|
import BigNumber from 'bignumber.js';
|
|
24
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
28
25
|
|
|
29
26
|
import { isValidAddress } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
|
|
30
27
|
import { errorMessages } from '../constants/errors';
|
package/src/utils/time.ts
CHANGED