@rango-dev/widget-embedded 0.1.12 → 0.1.13-next.4
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/App.d.ts.map +1 -1
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/TokenInfo.d.ts.map +1 -1
- package/dist/components/TokenPreview.d.ts.map +1 -1
- package/dist/components/warnings/BalanceErrors.d.ts.map +1 -1
- package/dist/globalStyles.d.ts +0 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +1 -0
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +1 -0
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/utils/numbers.d.ts +1 -2
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +91 -106
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +91 -106
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +91 -106
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +7 -7
- package/src/App.tsx +1 -2
- package/src/QueueManager.tsx +28 -3
- package/src/components/BottomLogo.tsx +1 -1
- package/src/components/Layout.tsx +3 -1
- package/src/components/RoutesOverview.tsx +2 -2
- package/src/components/TokenInfo.tsx +1 -0
- package/src/components/TokenPreview.tsx +1 -0
- package/src/components/warnings/BalanceErrors.tsx +2 -0
- package/src/globalStyles.ts +0 -19
- package/src/index.tsx +1 -1
- package/src/lib.tsx +2 -3
- package/src/pages/ConfirmSwapPage.tsx +3 -3
- package/src/pages/HistoryPage.tsx +2 -2
- package/src/pages/Home.tsx +1 -1
- package/src/pages/SwapDetailsPage.tsx +3 -4
- package/src/store/bestRoute.ts +18 -16
- package/src/store/wallets.ts +38 -28
- package/src/utils/numbers.ts +2 -5
- package/dist/hooks/useCopyToClipboard.d.ts +0 -2
- package/dist/hooks/useCopyToClipboard.d.ts.map +0 -1
- package/src/hooks/useCopyToClipboard.ts +0 -23
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["src/App.tsx"],"names":[],"mappings":";AAIA,OAAO,WAAW,CAAC;AAenB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,CAAC;AAOhB,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["src/App.tsx"],"names":[],"mappings":";AAIA,OAAO,WAAW,CAAC;AAenB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,CAAC;AAOhB,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,eA2F1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueManager.d.ts","sourceRoot":"","sources":["src/QueueManager.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"QueueManager.d.ts","sourceRoot":"","sources":["src/QueueManager.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAoB1D,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,eAyGjD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAwBxC,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,eA2F7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenInfo.d.ts","sourceRoot":"","sources":["../src/components/TokenInfo.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,SAAS,MAAM,cAAc,CAAC;AAMrC,aAAK,SAAS,GAAG,CACb;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;CAClC,CACJ,GAAG;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenInfo.d.ts","sourceRoot":"","sources":["../src/components/TokenInfo.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,SAAS,MAAM,cAAc,CAAC;AAMrC,aAAK,SAAS,GAAG,CACb;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;CAClC,CACJ,GAAG;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;AA2F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,eAwMzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenPreview.d.ts","sourceRoot":"","sources":["../src/components/TokenPreview.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenPreview.d.ts","sourceRoot":"","sources":["../src/components/TokenPreview.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,SAAS,MAAM,cAAc,CAAC;AA+ErC,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,eAkF5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BalanceErrors.d.ts","sourceRoot":"","sources":["../../src/components/warnings/BalanceErrors.tsx"],"names":[],"mappings":";AAGA,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"BalanceErrors.d.ts","sourceRoot":"","sources":["../../src/components/warnings/BalanceErrors.tsx"],"names":[],"mappings":";AAGA,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAwBD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,eAiBpD"}
|
package/dist/globalStyles.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalStyles.d.ts","sourceRoot":"","sources":["src/globalStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"globalStyles.d.ts","sourceRoot":"","sources":["src/globalStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,eAAgB,MAAM,QASvC,CAAC"}
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAW,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAUhE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE5F,OAAO,QAAQ,CAAC;AAOhB,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAG,wBAAwB,EAAC,CAAA;AAEvF,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAW,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAUhE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE5F,OAAO,QAAQ,CAAC;AAOhB,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAG,wBAAwB,EAAC,CAAA;AAEvF,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsGxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":";AA+BA,wBAAgB,eAAe,gBA8H9B"}
|
|
@@ -16,6 +16,7 @@ export interface RouteState {
|
|
|
16
16
|
error: string;
|
|
17
17
|
sourceTokens: Token[];
|
|
18
18
|
destinationTokens: Token[];
|
|
19
|
+
resetRoute: () => void;
|
|
19
20
|
setFromChain: (chain: BlockchainMeta | null, setDefaultToken?: boolean) => void;
|
|
20
21
|
setToChain: (chian: BlockchainMeta | null, setDefaultToken?: boolean) => void;
|
|
21
22
|
setFromToken: (token: Token | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../src/store/bestRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAA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AAC;IAC5C,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5D,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,iBAAiB,KAqM7B,CAAC;AAuHF,eAAO,MAAQ,cAAc,YAG5B,CAAC"}
|
package/dist/store/wallets.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ interface WalletsStore {
|
|
|
35
35
|
initSelectedWallets: () => void;
|
|
36
36
|
setSelectedWallet: (wallet: SelectableWallet) => void;
|
|
37
37
|
clearConnectedWallet: () => void;
|
|
38
|
+
getOneOfWalletsDetails: (account: Account) => void;
|
|
38
39
|
}
|
|
39
40
|
export declare const useWalletsStore: any;
|
|
40
41
|
export declare const fetchingBalanceSelector: (state: WalletsStore) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/store/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAML,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC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.ts
CHANGED
|
@@ -2,14 +2,13 @@ import { BigNumber } from 'bignumber.js';
|
|
|
2
2
|
import { BestRouteResponse } from 'rango-sdk';
|
|
3
3
|
export declare const percentToString: (p: number, fractions?: number) => string;
|
|
4
4
|
export declare const secondsToString: (s: number) => string;
|
|
5
|
-
export declare const numberToString: (number: BigNumber | string | null, minDecimals?: number | null, maxDecimals?: number | null) => string;
|
|
5
|
+
export declare const numberToString: (number: BigNumber | string | null | undefined, minDecimals?: number | null, maxDecimals?: number | null) => string;
|
|
6
6
|
export declare const convertBigNumberToHex: (value: BigNumber, decimals: number) => string;
|
|
7
7
|
export declare const uint8ArrayToHex: (buffer: Uint8Array) => string;
|
|
8
8
|
export declare function dollarToConciseString(num: number | undefined): string;
|
|
9
9
|
export declare function removeExtraDecimals(num: string, maxDecimals: number): string;
|
|
10
10
|
export declare const totalArrivalTime: (data: BestRouteResponse | null) => number;
|
|
11
11
|
export declare const rawFees: (data: BestRouteResponse) => string;
|
|
12
|
-
export declare const decimalNumber: (number: string | undefined, toFixed: number) => string;
|
|
13
12
|
export declare const containsText: (text: string, searchText: string) => boolean;
|
|
14
13
|
export declare const isPositiveNumber: (text?: string | undefined) => boolean;
|
|
15
14
|
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/utils/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAC7B,CAAC;AAC/B,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/utils/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAC7B,CAAC;AAC/B,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,gBAChC,MAAM,GAAG,IAAI,gBACb,MAAM,GAAG,IAAI,KACzB,MA6DF,CAAC;AAEF,eAAO,MAAM,qBAAqB,UACzB,SAAS,YACN,MAAM,KACf,MAEF,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,MAIpD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQrE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAW5E;AAED,eAAO,MAAM,gBAAgB,SAAU,iBAAiB,GAAG,IAAI,WACc,CAAC;AAE9E,eAAO,MAAM,OAAO,SAAU,iBAAiB,KAAG,MAOnC,CAAC;AAEhB,eAAO,MAAM,YAAY,SAAU,MAAM,cAAc,MAAM,YACF,CAAC;AAE5D,eAAO,MAAM,gBAAgB,wCACG,CAAC"}
|
|
@@ -26,7 +26,6 @@ var i18n = require('i18next');
|
|
|
26
26
|
var i18n__default = _interopDefault(i18n);
|
|
27
27
|
var queueManagerReact = require('@rango-dev/queue-manager-react');
|
|
28
28
|
var dayjs = _interopDefault(require('dayjs'));
|
|
29
|
-
var copy = _interopDefault(require('copy-to-clipboard'));
|
|
30
29
|
var Backend = _interopDefault(require('i18next-http-backend'));
|
|
31
30
|
var LanguageDetector = _interopDefault(require('i18next-browser-languagedetector'));
|
|
32
31
|
|
|
@@ -99,7 +98,7 @@ const numberToString = function (number, minDecimals, maxDecimals) {
|
|
|
99
98
|
if (maxDecimals === void 0) {
|
|
100
99
|
maxDecimals = null;
|
|
101
100
|
}
|
|
102
|
-
if (number === null) return '';
|
|
101
|
+
if (number === null || number === undefined) return '';
|
|
103
102
|
if (number === '') return '';
|
|
104
103
|
const n = new BigNumber.BigNumber(number);
|
|
105
104
|
const roundingMode = 1;
|
|
@@ -120,12 +119,6 @@ const numberToString = function (number, minDecimals, maxDecimals) {
|
|
|
120
119
|
return n.toFormat(Math.min(maxI, Math.min(maxDecimals || 100, Math.max(minDecimals || 0, 8))), roundingMode);
|
|
121
120
|
};
|
|
122
121
|
const totalArrivalTime = data => data?.result?.swaps?.reduce((a, b) => a + b.estimatedTimeInSeconds, 0) || 0;
|
|
123
|
-
const decimalNumber = function (number, toFixed) {
|
|
124
|
-
if (number === void 0) {
|
|
125
|
-
number = '0';
|
|
126
|
-
}
|
|
127
|
-
return parseFloat(number).toFixed(toFixed);
|
|
128
|
-
};
|
|
129
122
|
const isPositiveNumber = text => !!text && parseFloat(text) > 0;
|
|
130
123
|
|
|
131
124
|
function searchParamsToToken(tokens, searchParams, chain) {
|
|
@@ -846,12 +839,12 @@ function shouldRetrySwap(pendingSwap) {
|
|
|
846
839
|
return pendingSwap.status === 'failed' && !!pendingSwap.finishTime && new Date().getTime() - parseInt(pendingSwap.finishTime) < 4 * 3600 * 1000;
|
|
847
840
|
}
|
|
848
841
|
|
|
849
|
-
const useWalletsStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.create()( /*#__PURE__*/middleware.subscribeWithSelector(set => ({
|
|
842
|
+
const useWalletsStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.create()( /*#__PURE__*/middleware.subscribeWithSelector((set, get) => ({
|
|
850
843
|
accounts: [],
|
|
851
844
|
balances: [],
|
|
852
845
|
selectedWallets: [],
|
|
853
846
|
connectWallet: accounts => {
|
|
854
|
-
const
|
|
847
|
+
const getOneOfWalletsDetails = get().getOneOfWalletsDetails;
|
|
855
848
|
set(state => ({
|
|
856
849
|
accounts: state.accounts.concat(accounts),
|
|
857
850
|
balances: state.balances.concat(accounts.map(account => ({
|
|
@@ -864,28 +857,7 @@ const useWalletsStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.creat
|
|
|
864
857
|
explorerUrl: null
|
|
865
858
|
})))
|
|
866
859
|
}));
|
|
867
|
-
accounts.forEach(async account =>
|
|
868
|
-
try {
|
|
869
|
-
const response = await httpService().getWalletsDetails([{
|
|
870
|
-
address: account.address,
|
|
871
|
-
blockchain: account.chain
|
|
872
|
-
}]);
|
|
873
|
-
const retrivedBalance = response.wallets[0];
|
|
874
|
-
if (retrivedBalance) {
|
|
875
|
-
set(state => ({
|
|
876
|
-
balances: state.balances.map(balance => {
|
|
877
|
-
return isAccountAndBalanceMatched(account, balance) ? makeBalanceFor(account, retrivedBalance, tokens) : balance;
|
|
878
|
-
})
|
|
879
|
-
}));
|
|
880
|
-
} else throw new Error('Wallet not found');
|
|
881
|
-
} catch (error) {
|
|
882
|
-
set(state => ({
|
|
883
|
-
balances: state.balances.map(balance => {
|
|
884
|
-
return isAccountAndBalanceMatched(account, balance) ? resetBalanceState(balance) : balance;
|
|
885
|
-
})
|
|
886
|
-
}));
|
|
887
|
-
}
|
|
888
|
-
});
|
|
860
|
+
accounts.forEach(async account => getOneOfWalletsDetails(account));
|
|
889
861
|
},
|
|
890
862
|
disconnectWallet: walletType => {
|
|
891
863
|
set(state => ({
|
|
@@ -924,7 +896,38 @@ const useWalletsStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.creat
|
|
|
924
896
|
accounts: [],
|
|
925
897
|
balances: [],
|
|
926
898
|
selectedWallets: []
|
|
927
|
-
}))
|
|
899
|
+
})),
|
|
900
|
+
getOneOfWalletsDetails: async account => {
|
|
901
|
+
const tokens = useMetaStore.getState().meta.tokens;
|
|
902
|
+
set(state => ({
|
|
903
|
+
balances: state.balances.map(balance => {
|
|
904
|
+
return balance.address === account.address && balance.chain === account.chain ? {
|
|
905
|
+
...balance,
|
|
906
|
+
loading: true
|
|
907
|
+
} : balance;
|
|
908
|
+
})
|
|
909
|
+
}));
|
|
910
|
+
try {
|
|
911
|
+
const response = await httpService().getWalletsDetails([{
|
|
912
|
+
address: account.address,
|
|
913
|
+
blockchain: account.chain
|
|
914
|
+
}]);
|
|
915
|
+
const retrivedBalance = response.wallets[0];
|
|
916
|
+
if (retrivedBalance) {
|
|
917
|
+
set(state => ({
|
|
918
|
+
balances: state.balances.map(balance => {
|
|
919
|
+
return isAccountAndBalanceMatched(account, balance) ? makeBalanceFor(account, retrivedBalance, tokens) : balance;
|
|
920
|
+
})
|
|
921
|
+
}));
|
|
922
|
+
} else throw new Error('Wallet not found');
|
|
923
|
+
} catch (error) {
|
|
924
|
+
set(state => ({
|
|
925
|
+
balances: state.balances.map(balance => {
|
|
926
|
+
return isAccountAndBalanceMatched(account, balance) ? resetBalanceState(balance) : balance;
|
|
927
|
+
})
|
|
928
|
+
}));
|
|
929
|
+
}
|
|
930
|
+
}
|
|
928
931
|
}))));
|
|
929
932
|
useWalletsStore.subscribe(state => state.balances, balances => {
|
|
930
933
|
useBestRouteStore.setState(_ref => {
|
|
@@ -975,6 +978,13 @@ const useBestRouteStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.cre
|
|
|
975
978
|
})
|
|
976
979
|
};
|
|
977
980
|
}),
|
|
981
|
+
resetRoute: () => set(() => ({
|
|
982
|
+
loading: true,
|
|
983
|
+
error: '',
|
|
984
|
+
bestRoute: null,
|
|
985
|
+
outputAmount: null,
|
|
986
|
+
outputUsdValue: new BigNumber__default(0)
|
|
987
|
+
})),
|
|
978
988
|
setFromChain: (chain, setDefaultToken) => {
|
|
979
989
|
set(state => {
|
|
980
990
|
if (state.fromChain?.name === chain?.name) return {};
|
|
@@ -1024,7 +1034,8 @@ const useBestRouteStore = /*#__PURE__*/createSelectors( /*#__PURE__*/zustand.cre
|
|
|
1024
1034
|
...(!amount && {
|
|
1025
1035
|
outputAmount: new BigNumber__default(0),
|
|
1026
1036
|
outputUsdValue: new BigNumber__default(0),
|
|
1027
|
-
bestRoute: null
|
|
1037
|
+
bestRoute: null,
|
|
1038
|
+
error: ''
|
|
1028
1039
|
}),
|
|
1029
1040
|
...(!!state.fromToken && {
|
|
1030
1041
|
inputUsdValue: getUsdValue(state.fromToken, amount)
|
|
@@ -1089,7 +1100,8 @@ const bestRoute = (bestRouteStore, settingsStore) => {
|
|
|
1089
1100
|
const {
|
|
1090
1101
|
fromToken,
|
|
1091
1102
|
toToken,
|
|
1092
|
-
inputAmount
|
|
1103
|
+
inputAmount,
|
|
1104
|
+
resetRoute
|
|
1093
1105
|
} = bestRouteStore.getState();
|
|
1094
1106
|
const {
|
|
1095
1107
|
slippage,
|
|
@@ -1102,12 +1114,9 @@ const bestRoute = (bestRouteStore, settingsStore) => {
|
|
|
1102
1114
|
abortController = new AbortController();
|
|
1103
1115
|
const userSlippage = !!customSlippage ? customSlippage : slippage;
|
|
1104
1116
|
const requestBody = createBestRouteRequestBody(fromToken, toToken, inputAmount, [], [], disabledLiquiditySources, userSlippage, affiliateRef);
|
|
1105
|
-
if (!bestRouteStore.getState().loading)
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
outputAmount: null,
|
|
1109
|
-
outputUsdValue: new BigNumber__default(0)
|
|
1110
|
-
});
|
|
1117
|
+
if (!bestRouteStore.getState().loading) {
|
|
1118
|
+
resetRoute();
|
|
1119
|
+
}
|
|
1111
1120
|
httpService().getBestRoute(requestBody, {
|
|
1112
1121
|
signal: abortController.signal
|
|
1113
1122
|
}).then(res => {
|
|
@@ -1133,7 +1142,8 @@ const bestRoute = (bestRouteStore, settingsStore) => {
|
|
|
1133
1142
|
fromToken,
|
|
1134
1143
|
toToken,
|
|
1135
1144
|
inputAmount,
|
|
1136
|
-
inputUsdValue
|
|
1145
|
+
inputUsdValue,
|
|
1146
|
+
resetRoute
|
|
1137
1147
|
} = useBestRouteStore.getState();
|
|
1138
1148
|
if (!isPositiveNumber(inputAmount) || inputUsdValue.eq(0)) return bestRouteStore.setState({
|
|
1139
1149
|
loading: false
|
|
@@ -1144,12 +1154,7 @@ const bestRoute = (bestRouteStore, settingsStore) => {
|
|
|
1144
1154
|
outputAmount: new BigNumber__default(inputAmount),
|
|
1145
1155
|
outputUsdValue: inputUsdValue
|
|
1146
1156
|
});
|
|
1147
|
-
if (!bestRouteStore.getState().loading)
|
|
1148
|
-
loading: true,
|
|
1149
|
-
bestRoute: null,
|
|
1150
|
-
outputAmount: null,
|
|
1151
|
-
outputUsdValue: new BigNumber__default(0)
|
|
1152
|
-
});
|
|
1157
|
+
if (!bestRouteStore.getState().loading) resetRoute();
|
|
1153
1158
|
debouncedFetchBestRoute();
|
|
1154
1159
|
};
|
|
1155
1160
|
useBestRouteStore.subscribe(state => ({
|
|
@@ -1360,7 +1365,8 @@ function PercentageChange(props) {
|
|
|
1360
1365
|
const Box = /*#__PURE__*/ui.styled('div', {
|
|
1361
1366
|
display: 'flex',
|
|
1362
1367
|
flexDirection: 'column',
|
|
1363
|
-
width: '100%'
|
|
1368
|
+
width: '100%',
|
|
1369
|
+
overflow: 'hidden'
|
|
1364
1370
|
});
|
|
1365
1371
|
const Container = /*#__PURE__*/ui.styled('div', {
|
|
1366
1372
|
boxSizing: 'border-box',
|
|
@@ -1586,7 +1592,8 @@ function BottomLogo() {
|
|
|
1586
1592
|
t
|
|
1587
1593
|
} = reactI18next.useTranslation();
|
|
1588
1594
|
return React__default.createElement(Container$1, null, React__default.createElement(ui.Typography, {
|
|
1589
|
-
variant: "caption"
|
|
1595
|
+
variant: "caption",
|
|
1596
|
+
color: '$neutrals600'
|
|
1590
1597
|
}, t('Powered By')), React__default.createElement(StyledAnchor, {
|
|
1591
1598
|
href: "https://rango.exchange",
|
|
1592
1599
|
target: "_blank"
|
|
@@ -1754,7 +1761,7 @@ function Home() {
|
|
|
1754
1761
|
return React__default.createElement(Container$2, null, React__default.createElement(ui.Header, {
|
|
1755
1762
|
title: "SWAP",
|
|
1756
1763
|
suffix: React__default.createElement(HeaderButtons, {
|
|
1757
|
-
onClickRefresh: !!bestRoute ? fetchBestRoute : undefined
|
|
1764
|
+
onClickRefresh: !!bestRoute || bestRouteError ? fetchBestRoute : undefined
|
|
1758
1765
|
})
|
|
1759
1766
|
}), React__default.createElement(FromContainer, null, React__default.createElement(TokenInfo, {
|
|
1760
1767
|
type: "From",
|
|
@@ -1871,7 +1878,8 @@ function useNavigateBack() {
|
|
|
1871
1878
|
const Box$1 = /*#__PURE__*/ui.styled('div', {
|
|
1872
1879
|
display: 'flex',
|
|
1873
1880
|
flexDirection: 'column',
|
|
1874
|
-
width: '100%'
|
|
1881
|
+
width: '100%',
|
|
1882
|
+
overflow: 'hidden'
|
|
1875
1883
|
});
|
|
1876
1884
|
const Container$3 = /*#__PURE__*/ui.styled('div', {
|
|
1877
1885
|
boxSizing: 'border-box',
|
|
@@ -2025,7 +2033,9 @@ function RoutesOverview(props) {
|
|
|
2025
2033
|
className: "routes"
|
|
2026
2034
|
}, swaps?.map((swap, idx) => {
|
|
2027
2035
|
const isLast = idx + 1 == swaps.length;
|
|
2028
|
-
return React__default.createElement(React__default.Fragment,
|
|
2036
|
+
return React__default.createElement(React__default.Fragment, {
|
|
2037
|
+
key: idx
|
|
2038
|
+
}, React__default.createElement("div", {
|
|
2029
2039
|
className: "route"
|
|
2030
2040
|
}, swap.from.symbol), React__default.createElement(ui.ChevronRightIcon, {
|
|
2031
2041
|
size: 12
|
|
@@ -2215,6 +2225,8 @@ function MinRequiredSlippage(_ref) {
|
|
|
2215
2225
|
}
|
|
2216
2226
|
|
|
2217
2227
|
const List = /*#__PURE__*/ui.styled('ul', {
|
|
2228
|
+
padding: 0,
|
|
2229
|
+
margin: 0,
|
|
2218
2230
|
variants: {
|
|
2219
2231
|
showListStyle: {
|
|
2220
2232
|
true: {
|
|
@@ -2358,8 +2370,8 @@ function ConfirmSwapPage() {
|
|
|
2358
2370
|
const confirmDisabled = fetchingBestRoute || !requiredWallets(bestRoute).every(chain => selectedWallets.map(wallet => wallet.chain).includes(chain));
|
|
2359
2371
|
const firstStep = bestRoute?.result?.swaps[0];
|
|
2360
2372
|
const lastStep = bestRoute?.result?.swaps[bestRoute?.result?.swaps.length - 1];
|
|
2361
|
-
const fromAmount =
|
|
2362
|
-
const toAmount =
|
|
2373
|
+
const fromAmount = numberToString(firstStep?.fromAmount, 4, 6);
|
|
2374
|
+
const toAmount = numberToString(lastStep?.toAmount, 4, 6);
|
|
2363
2375
|
React.useEffect(() => {
|
|
2364
2376
|
initSelectedWallets();
|
|
2365
2377
|
}, []);
|
|
@@ -2489,7 +2501,8 @@ function HistoryPage() {
|
|
|
2489
2501
|
navigateBackFrom
|
|
2490
2502
|
} = useNavigateBack();
|
|
2491
2503
|
const {
|
|
2492
|
-
manager
|
|
2504
|
+
manager,
|
|
2505
|
+
state
|
|
2493
2506
|
} = queueManagerReact.useManager();
|
|
2494
2507
|
const pendingSwaps = getPendingSwaps(manager).map(_ref => {
|
|
2495
2508
|
let {
|
|
@@ -2497,7 +2510,7 @@ function HistoryPage() {
|
|
|
2497
2510
|
} = _ref;
|
|
2498
2511
|
return swap;
|
|
2499
2512
|
});
|
|
2500
|
-
const loading = !
|
|
2513
|
+
const loading = !state.loadedFromPersistor;
|
|
2501
2514
|
return React__default.createElement(ui.History, {
|
|
2502
2515
|
list: pendingSwaps,
|
|
2503
2516
|
groupBy: groupSwapsByDate,
|
|
@@ -2752,24 +2765,6 @@ function WalletsPage(_ref) {
|
|
|
2752
2765
|
}))))));
|
|
2753
2766
|
}
|
|
2754
2767
|
|
|
2755
|
-
function useCopyToClipboard(resetInterval) {
|
|
2756
|
-
const [isCopied, setCopied] = React__default.useState(false);
|
|
2757
|
-
const handleCopy = React__default.useCallback(text => {
|
|
2758
|
-
copy(text.toString());
|
|
2759
|
-
setCopied(true);
|
|
2760
|
-
}, []);
|
|
2761
|
-
React__default.useEffect(() => {
|
|
2762
|
-
let timeout;
|
|
2763
|
-
if (isCopied && resetInterval) {
|
|
2764
|
-
timeout = setTimeout(() => setCopied(false), resetInterval);
|
|
2765
|
-
}
|
|
2766
|
-
return () => {
|
|
2767
|
-
clearTimeout(timeout);
|
|
2768
|
-
};
|
|
2769
|
-
}, [isCopied, resetInterval]);
|
|
2770
|
-
return [isCopied, handleCopy];
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
2768
|
function timeSince(timeMillis) {
|
|
2774
2769
|
const seconds = Math.floor((new Date().getTime() - timeMillis) / 1000);
|
|
2775
2770
|
let intervalType;
|
|
@@ -2848,9 +2843,10 @@ function SwapDetailsPage() {
|
|
|
2848
2843
|
const {
|
|
2849
2844
|
navigateBackFrom
|
|
2850
2845
|
} = useNavigateBack();
|
|
2851
|
-
const [isCopied, handleCopy] = useCopyToClipboard(2000);
|
|
2846
|
+
const [isCopied, handleCopy] = ui.useCopyToClipboard(2000);
|
|
2852
2847
|
const {
|
|
2853
|
-
manager
|
|
2848
|
+
manager,
|
|
2849
|
+
state
|
|
2854
2850
|
} = queueManagerReact.useManager();
|
|
2855
2851
|
const pendingSwaps = getPendingSwaps(manager);
|
|
2856
2852
|
const selectedSwap = pendingSwaps.find(_ref => {
|
|
@@ -2864,7 +2860,7 @@ function SwapDetailsPage() {
|
|
|
2864
2860
|
if (swap) queueManagerRangoPreset.cancelSwap(swap);
|
|
2865
2861
|
};
|
|
2866
2862
|
const swap = selectedSwap?.swap;
|
|
2867
|
-
const loading = !
|
|
2863
|
+
const loading = !state.loadedFromPersistor;
|
|
2868
2864
|
if (!swap) return React__default.createElement(SwapDetailsPlaceholder, {
|
|
2869
2865
|
requestId: selectedSwapRequestId || '',
|
|
2870
2866
|
loading: loading,
|
|
@@ -3013,7 +3009,9 @@ const Header = /*#__PURE__*/ui.styled('div', {
|
|
|
3013
3009
|
const WalletImageContainer = /*#__PURE__*/ui.styled('div', {
|
|
3014
3010
|
marginLeft: -15,
|
|
3015
3011
|
marginRight: '$6',
|
|
3016
|
-
|
|
3012
|
+
'& img': {
|
|
3013
|
+
borderRadius: '50%'
|
|
3014
|
+
}
|
|
3017
3015
|
});
|
|
3018
3016
|
function Layout(_ref) {
|
|
3019
3017
|
let {
|
|
@@ -3090,28 +3088,6 @@ function Layout(_ref) {
|
|
|
3090
3088
|
}));
|
|
3091
3089
|
}
|
|
3092
3090
|
|
|
3093
|
-
const globalStyles = /*#__PURE__*/ui.globalCss({
|
|
3094
|
-
'*': {
|
|
3095
|
-
boxSizing: 'border-box',
|
|
3096
|
-
margin: 0,
|
|
3097
|
-
padding: 0,
|
|
3098
|
-
listStyleType: 'none',
|
|
3099
|
-
'&::-webkit-scrollbar': {
|
|
3100
|
-
width: '$8',
|
|
3101
|
-
height: '$8'
|
|
3102
|
-
},
|
|
3103
|
-
'&::-webkit-scrollbar-thumb': {
|
|
3104
|
-
backgroundColor: '$neutrals400',
|
|
3105
|
-
borderRadius: '$10'
|
|
3106
|
-
},
|
|
3107
|
-
'&::-webkit-scrollbar-thumb:hover': {
|
|
3108
|
-
backgroundColor: '$neutrals500'
|
|
3109
|
-
},
|
|
3110
|
-
'&::-webkit-scrollbar-track': {
|
|
3111
|
-
backgroundColor: '$neutrals300'
|
|
3112
|
-
}
|
|
3113
|
-
}
|
|
3114
|
-
});
|
|
3115
3091
|
const globalFont = fontFamily => ui.globalCss({
|
|
3116
3092
|
'@import': ["url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')", "url('https://fonts.cdnfonts.com/css/times-new-roman')"],
|
|
3117
3093
|
body: {
|
|
@@ -3342,6 +3318,8 @@ function QueueManager(props) {
|
|
|
3342
3318
|
API_KEY: getConfig('API_KEY')
|
|
3343
3319
|
});
|
|
3344
3320
|
}, []);
|
|
3321
|
+
const getOneOfWalletsDetails = useWalletsStore.use.getOneOfWalletsDetails();
|
|
3322
|
+
const accounts = useWalletsStore.use.accounts();
|
|
3345
3323
|
const {
|
|
3346
3324
|
blockchains
|
|
3347
3325
|
} = useMetaStore.use.meta();
|
|
@@ -3368,6 +3346,17 @@ function QueueManager(props) {
|
|
|
3368
3346
|
return walletAndSupportedChainsNames(supportedChains);
|
|
3369
3347
|
};
|
|
3370
3348
|
const allProviders = providers();
|
|
3349
|
+
const notifier = data => {
|
|
3350
|
+
const lastStep = data.swap?.steps[data.swap.steps.length - 1];
|
|
3351
|
+
const outputAmount = data.step?.outputAmount || '';
|
|
3352
|
+
const step = data.step || lastStep;
|
|
3353
|
+
if (data.eventType === 'task_completed' || data.eventType === 'step_completed_with_output' && lastStep?.id !== data.step?.id || !!outputAmount) {
|
|
3354
|
+
const fromAccount = accounts.find(account => account.chain === step?.fromBlockchain);
|
|
3355
|
+
const toAccount = step?.fromBlockchain !== step?.toBlockchain && accounts.find(account => account.chain === step?.toBlockchain);
|
|
3356
|
+
fromAccount && getOneOfWalletsDetails(fromAccount);
|
|
3357
|
+
toAccount && getOneOfWalletsDetails(toAccount);
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3371
3360
|
const context = {
|
|
3372
3361
|
meta: {
|
|
3373
3362
|
blockchains: allBlockchains,
|
|
@@ -3383,9 +3372,7 @@ function QueueManager(props) {
|
|
|
3383
3372
|
switchNetwork,
|
|
3384
3373
|
connect,
|
|
3385
3374
|
state,
|
|
3386
|
-
notifier
|
|
3387
|
-
console.log('[notifier]', message);
|
|
3388
|
-
}
|
|
3375
|
+
notifier
|
|
3389
3376
|
};
|
|
3390
3377
|
return React__default.createElement(queueManagerReact.Provider
|
|
3391
3378
|
//@ts-ignore
|
|
@@ -3404,7 +3391,6 @@ const Widget = _ref => {
|
|
|
3404
3391
|
let {
|
|
3405
3392
|
config
|
|
3406
3393
|
} = _ref;
|
|
3407
|
-
globalStyles();
|
|
3408
3394
|
globalFont(config?.theme?.fontFamily || 'Roboto');
|
|
3409
3395
|
const {
|
|
3410
3396
|
activeTheme
|
|
@@ -3469,7 +3455,6 @@ const Widget = _ref => {
|
|
|
3469
3455
|
providers: providers,
|
|
3470
3456
|
onUpdateState: onUpdateState
|
|
3471
3457
|
}, React__default.createElement("div", {
|
|
3472
|
-
id: "pageContainer",
|
|
3473
3458
|
className: activeTheme
|
|
3474
3459
|
}, React__default.createElement(QueueManager, null, React__default.createElement(ui.SwapContainer, {
|
|
3475
3460
|
fixedHeight: currentPage !== navigationRoutes.home
|