@rango-dev/widget-embedded 0.1.16-next.1 → 0.1.16-next.11
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/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/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +2 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/common.d.ts +0 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +94 -124
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +94 -124
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +95 -125
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +10 -13
- package/src/QueueManager.tsx +0 -1
- package/src/components/AppRoutes.tsx +1 -1
- package/src/components/BottomLogo.tsx +1 -1
- package/src/components/Layout.tsx +22 -18
- package/src/components/RoutesOverview.tsx +2 -2
- package/src/components/TokenInfo.tsx +9 -8
- package/src/components/TokenPreview.tsx +6 -6
- package/src/hooks/useTheme.ts +42 -59
- package/src/index.tsx +144 -14
- package/src/pages/ConfirmSwapPage.tsx +25 -17
- package/src/pages/SettingsPage.tsx +3 -1
- package/src/types/config.ts +8 -1
- package/src/utils/common.ts +0 -21
- package/src/utils/wallets.ts +1 -11
- package/dist/App.d.ts +0 -9
- package/dist/App.d.ts.map +0 -1
- package/dist/lib.d.ts +0 -10
- package/dist/lib.d.ts.map +0 -1
- package/src/App.tsx +0 -123
- package/src/app.css +0 -12
- package/src/lib.tsx +0 -144
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,eAuGjD;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;AAwBxC,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,
|
|
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,eA+F7C"}
|
|
@@ -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;AA4F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,eAwMzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EAAE,WAAW,EACnB,UAAoB,EACpB,YAAgB,EAChB,IAAa,GACd,EAAE,WAAW;;EA6Gb"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
import { WidgetTheme, WidgetConfig, WidgetColors, BlockchainAndTokenConfig } from './types';
|
|
4
|
+
import './i18n';
|
|
5
|
+
export { WidgetConfig, WalletType, WidgetTheme, WidgetColors, BlockchainAndTokenConfig, };
|
|
6
|
+
export declare type WidgetProps = {
|
|
7
|
+
config?: WidgetConfig;
|
|
8
|
+
};
|
|
9
|
+
export declare const Widget: React.FC<WidgetProps>;
|
|
2
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAW,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAUhE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,QAAQ,CAAC;AAMhB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,wBAAwB,GACzB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqGxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":";AAiCA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":";AAiCA,wBAAgB,eAAe,gBAuL9B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface PropTypes {
|
|
3
3
|
supportedSwappers?: string[];
|
|
4
|
+
singleTheme?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function SettingsPage({ supportedSwappers }: PropTypes): JSX.Element;
|
|
6
|
+
export declare function SettingsPage({ supportedSwappers, singleTheme }: PropTypes): JSX.Element;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=SettingsPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":";AAaA,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":";AAaA,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,wBAAgB,YAAY,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,SAAS,eA2EzE"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { WalletType } from '@rango-dev/wallets-shared';
|
|
|
8
8
|
* @property {string} success
|
|
9
9
|
* @property {string} error
|
|
10
10
|
* @property {string} warning
|
|
11
|
+
* @property {string} surface
|
|
12
|
+
* @property {string} neutral
|
|
13
|
+
|
|
11
14
|
*/
|
|
12
15
|
export declare type WidgetColors = {
|
|
13
16
|
background?: string;
|
|
@@ -16,6 +19,8 @@ export declare type WidgetColors = {
|
|
|
16
19
|
success?: string;
|
|
17
20
|
error?: string;
|
|
18
21
|
warning?: string;
|
|
22
|
+
surface?: string;
|
|
23
|
+
neutral?: string;
|
|
19
24
|
};
|
|
20
25
|
/**
|
|
21
26
|
* The `WidgetTheme` defines the properties of a widget theme, including mode, font family, colors, border
|
|
@@ -31,14 +36,19 @@ export declare type WidgetColors = {
|
|
|
31
36
|
* specifies the radius of the corners of a widget.
|
|
32
37
|
* @property {number} width - The `width` property is a number that represents the width of the widget.
|
|
33
38
|
* @property {number} height - The `height` property is a number that specifies the height of the widget.
|
|
39
|
+
* @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
|
|
34
40
|
*/
|
|
35
41
|
export declare type WidgetTheme = {
|
|
36
42
|
mode?: 'auto' | 'light' | 'dark';
|
|
37
43
|
fontFamily?: string;
|
|
38
|
-
colors?:
|
|
44
|
+
colors?: {
|
|
45
|
+
light: WidgetColors;
|
|
46
|
+
dark: WidgetColors;
|
|
47
|
+
};
|
|
39
48
|
borderRadius?: number;
|
|
40
49
|
width?: number;
|
|
41
50
|
height?: number;
|
|
51
|
+
singleTheme?: boolean;
|
|
42
52
|
};
|
|
43
53
|
/**
|
|
44
54
|
* `BlockchainAndTokenConfig`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,oBAAY,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,oBAAY,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,oBAAY,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC"}
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare function removeDuplicateFrom<T>(array: T[]): T[];
|
|
2
2
|
export declare function areEqual(array1: (number | string)[], array2: (number | string)[]): boolean;
|
|
3
|
-
export declare function shadeColor(color: string, percent: number): string;
|
|
4
3
|
export declare function debounce(fn: Function, time: number): (...args: any) => void;
|
|
5
4
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAK5B;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAK5B;AAID,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAGvB,GAAG,UAS9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,OAAO,EACP,WAAW,EACX,UAAU,EAEV,UAAU,EACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,IAAI,eAAe,EAC7B,WAAW,IAAI,YAAY,EAC3B,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAW/D;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/utils/wallets.ts"],"names":[],"mappings":"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"}
|
|
@@ -37,24 +37,6 @@ function removeDuplicateFrom(array) {
|
|
|
37
37
|
function areEqual(array1, array2) {
|
|
38
38
|
return array1.length === array2.length && array1.every((v, i) => v === array2[i]);
|
|
39
39
|
}
|
|
40
|
-
function shadeColor(color, percent) {
|
|
41
|
-
var R = parseInt(color.substring(1, 3), 16);
|
|
42
|
-
var G = parseInt(color.substring(3, 5), 16);
|
|
43
|
-
var B = parseInt(color.substring(5, 7), 16);
|
|
44
|
-
R = R * (100 + percent) / 100;
|
|
45
|
-
G = G * (100 + percent) / 100;
|
|
46
|
-
B = B * (100 + percent) / 100;
|
|
47
|
-
R = R < 255 ? R : 255;
|
|
48
|
-
G = G < 255 ? G : 255;
|
|
49
|
-
B = B < 255 ? B : 255;
|
|
50
|
-
R = Math.round(R);
|
|
51
|
-
G = Math.round(G);
|
|
52
|
-
B = Math.round(B);
|
|
53
|
-
var RR = R.toString(16).length == 1 ? '0' + R.toString(16) : R.toString(16);
|
|
54
|
-
var GG = G.toString(16).length == 1 ? '0' + G.toString(16) : G.toString(16);
|
|
55
|
-
var BB = B.toString(16).length == 1 ? '0' + B.toString(16) : B.toString(16);
|
|
56
|
-
return '#' + RR + GG + BB;
|
|
57
|
-
}
|
|
58
40
|
function debounce(fn, time) {
|
|
59
41
|
let timeoutId;
|
|
60
42
|
return wrapper;
|
|
@@ -318,8 +300,8 @@ function getStateWallet(state) {
|
|
|
318
300
|
return ui.WalletState.DISCONNECTED;
|
|
319
301
|
}
|
|
320
302
|
}
|
|
303
|
+
const excludedWallets = [walletsShared.WalletType.UNKNOWN, walletsShared.WalletType.LEAP];
|
|
321
304
|
function getlistWallet(getState, getWalletInfo, list) {
|
|
322
|
-
const excludedWallets = [walletsShared.WalletType.UNKNOWN, walletsShared.WalletType.TERRA_STATION, walletsShared.WalletType.LEAP];
|
|
323
305
|
return list.filter(wallet => !excludedWallets.includes(wallet)).map(type => {
|
|
324
306
|
const {
|
|
325
307
|
name,
|
|
@@ -1367,10 +1349,10 @@ const Container = /*#__PURE__*/ui.styled('div', {
|
|
|
1367
1349
|
variants: {
|
|
1368
1350
|
type: {
|
|
1369
1351
|
filled: {
|
|
1370
|
-
backgroundColor: '$
|
|
1352
|
+
backgroundColor: '$neutral100'
|
|
1371
1353
|
},
|
|
1372
1354
|
outlined: {
|
|
1373
|
-
border: '1px solid $
|
|
1355
|
+
border: '1px solid $neutral100'
|
|
1374
1356
|
}
|
|
1375
1357
|
}
|
|
1376
1358
|
},
|
|
@@ -1406,14 +1388,14 @@ const Container = /*#__PURE__*/ui.styled('div', {
|
|
|
1406
1388
|
const ImagePlaceholder = /*#__PURE__*/ui.styled('span', {
|
|
1407
1389
|
width: '24px',
|
|
1408
1390
|
height: '24px',
|
|
1409
|
-
backgroundColor: '$
|
|
1391
|
+
backgroundColor: '$neutral100',
|
|
1410
1392
|
borderRadius: '99999px'
|
|
1411
1393
|
});
|
|
1412
1394
|
const OutputContainer = /*#__PURE__*/ui.styled('div', {
|
|
1413
1395
|
windth: '100%',
|
|
1414
1396
|
height: '$48',
|
|
1415
1397
|
borderRadius: '$5',
|
|
1416
|
-
backgroundColor: '$
|
|
1398
|
+
backgroundColor: '$surface',
|
|
1417
1399
|
border: '1px solid transparent',
|
|
1418
1400
|
position: 'relative',
|
|
1419
1401
|
display: 'flex',
|
|
@@ -1447,10 +1429,10 @@ function TokenPreview(props) {
|
|
|
1447
1429
|
className: "head"
|
|
1448
1430
|
}, React__default.createElement(ui.Typography, {
|
|
1449
1431
|
variant: "body2",
|
|
1450
|
-
color: "
|
|
1432
|
+
color: "neutral800"
|
|
1451
1433
|
}, props.label), React__default.createElement("div", null, percentageChange, props.usdValue && React__default.createElement(ui.Typography, {
|
|
1452
1434
|
variant: "caption",
|
|
1453
|
-
color: "
|
|
1435
|
+
color: "neutral600",
|
|
1454
1436
|
className: "usd-value"
|
|
1455
1437
|
}, `$${numberToString(props.usdValue)}`))), React__default.createElement("div", {
|
|
1456
1438
|
className: "form"
|
|
@@ -1493,8 +1475,8 @@ const Container$1 = /*#__PURE__*/ui.styled('div', {
|
|
|
1493
1475
|
justifyContent: 'space-between',
|
|
1494
1476
|
padding: '$8',
|
|
1495
1477
|
borderRadius: '$5',
|
|
1496
|
-
backgroundColor: '$
|
|
1497
|
-
color: '$
|
|
1478
|
+
backgroundColor: '$neutral100',
|
|
1479
|
+
color: '$neutral800',
|
|
1498
1480
|
fontSize: '$12',
|
|
1499
1481
|
'.routes': {
|
|
1500
1482
|
display: 'flex',
|
|
@@ -1846,6 +1828,7 @@ function ConfirmSwapPage() {
|
|
|
1846
1828
|
const inputUsdValue = useBestRouteStore.use.inputUsdValue();
|
|
1847
1829
|
const outputUsdValue = useBestRouteStore.use.outputUsdValue();
|
|
1848
1830
|
const setInputAmount = useBestRouteStore.use.setInputAmount();
|
|
1831
|
+
const [dbErrorMessage, setDbErrorMessage] = React.useState('');
|
|
1849
1832
|
const bestRouteloadingStatus = getBestRouteStatus(fetchingBestRoute, !!fetchingBestRouteError);
|
|
1850
1833
|
const {
|
|
1851
1834
|
manager
|
|
@@ -1880,21 +1863,25 @@ function ConfirmSwapPage() {
|
|
|
1880
1863
|
requiredWallets: getRequiredChains(bestRoute),
|
|
1881
1864
|
selectableWallets: selectableWallets,
|
|
1882
1865
|
onBack: navigateBackFrom.bind(null, navigationRoutes.confirmSwap),
|
|
1883
|
-
onConfirm: () => {
|
|
1884
|
-
confirmSwap?.().then(swap => {
|
|
1866
|
+
onConfirm: async () => {
|
|
1867
|
+
confirmSwap?.().then(async swap => {
|
|
1885
1868
|
if (swap) {
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1869
|
+
try {
|
|
1870
|
+
await manager?.create('swap', {
|
|
1871
|
+
swapDetails: swap
|
|
1872
|
+
}, {
|
|
1873
|
+
id: swap.requestId
|
|
1874
|
+
});
|
|
1875
|
+
setSelectedSwap(swap.requestId);
|
|
1876
|
+
navigate('/' + navigationRoutes.swaps + `/${swap.requestId}`, {
|
|
1877
|
+
replace: true
|
|
1878
|
+
});
|
|
1879
|
+
setTimeout(() => {
|
|
1880
|
+
setInputAmount('');
|
|
1881
|
+
}, 0);
|
|
1882
|
+
} catch (e) {
|
|
1883
|
+
setDbErrorMessage('Error: ' + e?.message);
|
|
1884
|
+
}
|
|
1898
1885
|
}
|
|
1899
1886
|
});
|
|
1900
1887
|
},
|
|
@@ -1941,7 +1928,7 @@ function ConfirmSwapPage() {
|
|
|
1941
1928
|
totalFee: numberToString(totalFeeInUsd, 0, 2)
|
|
1942
1929
|
}),
|
|
1943
1930
|
loading: fetchingConfirmedRoute,
|
|
1944
|
-
errors: ConfirmSwapErrors(errors),
|
|
1931
|
+
errors: dbErrorMessage ? [dbErrorMessage, ...ConfirmSwapErrors(errors)] : ConfirmSwapErrors(errors),
|
|
1945
1932
|
warnings: ConfirmSwapWarnings(warnings),
|
|
1946
1933
|
extraMessages: React__default.createElement(React__default.Fragment, null, loadingMetaStatus === 'failed' && React__default.createElement(ui.LoadingFailedAlert, null), loadingMetaStatus === 'failed' && showHighSlippageWarning && React__default.createElement(ui.Spacer, {
|
|
1947
1934
|
direction: "vertical"
|
|
@@ -2035,10 +2022,11 @@ const Container$2 = /*#__PURE__*/ui.styled('div', {
|
|
|
2035
2022
|
variants: {
|
|
2036
2023
|
type: {
|
|
2037
2024
|
filled: {
|
|
2038
|
-
backgroundColor: '$
|
|
2025
|
+
backgroundColor: '$neutral100'
|
|
2039
2026
|
},
|
|
2040
2027
|
outlined: {
|
|
2041
|
-
border: '1px solid $
|
|
2028
|
+
border: '1px solid $neutral100',
|
|
2029
|
+
backgroundColor: '$surface'
|
|
2042
2030
|
}
|
|
2043
2031
|
}
|
|
2044
2032
|
},
|
|
@@ -2086,14 +2074,14 @@ const Options = /*#__PURE__*/ui.styled('div', {
|
|
|
2086
2074
|
const ImagePlaceholder$1 = /*#__PURE__*/ui.styled('span', {
|
|
2087
2075
|
width: '24px',
|
|
2088
2076
|
height: '24px',
|
|
2089
|
-
backgroundColor: '$
|
|
2077
|
+
backgroundColor: '$neutral100',
|
|
2090
2078
|
borderRadius: '99999px'
|
|
2091
2079
|
});
|
|
2092
2080
|
const OutputContainer$1 = /*#__PURE__*/ui.styled('div', {
|
|
2093
2081
|
windth: '100%',
|
|
2094
2082
|
height: '$48',
|
|
2095
2083
|
borderRadius: '$5',
|
|
2096
|
-
backgroundColor: '$
|
|
2084
|
+
backgroundColor: '$surface',
|
|
2097
2085
|
border: '1px solid transparent',
|
|
2098
2086
|
position: 'relative',
|
|
2099
2087
|
display: 'flex',
|
|
@@ -2139,7 +2127,7 @@ function TokenInfo(props) {
|
|
|
2139
2127
|
className: "head"
|
|
2140
2128
|
}, React__default.createElement(ui.Typography, {
|
|
2141
2129
|
variant: "body2",
|
|
2142
|
-
color: "
|
|
2130
|
+
color: "neutral800"
|
|
2143
2131
|
}, t(type)), props.type === 'From' ? React__default.createElement(Options, null, React__default.createElement("div", {
|
|
2144
2132
|
className: "balance",
|
|
2145
2133
|
onClick: () => {
|
|
@@ -2147,7 +2135,7 @@ function TokenInfo(props) {
|
|
|
2147
2135
|
}
|
|
2148
2136
|
}, React__default.createElement(ui.Typography, {
|
|
2149
2137
|
variant: "body3",
|
|
2150
|
-
color: "
|
|
2138
|
+
color: "neutral600"
|
|
2151
2139
|
}, `${t('Balance')}: ${tokenBalance} ${fromToken?.symbol || ''}`), React__default.createElement(ui.Spacer, {
|
|
2152
2140
|
size: 4
|
|
2153
2141
|
}), React__default.createElement(ui.Button, {
|
|
@@ -2161,7 +2149,7 @@ function TokenInfo(props) {
|
|
|
2161
2149
|
outputUsdValue: props.outputUsdValue
|
|
2162
2150
|
}), React__default.createElement("div", null, React__default.createElement(ui.Typography, {
|
|
2163
2151
|
variant: "caption",
|
|
2164
|
-
color: "
|
|
2152
|
+
color: "neutral600"
|
|
2165
2153
|
}, `$${numberToString(props.outputUsdValue)}`)))), React__default.createElement("div", {
|
|
2166
2154
|
className: "form"
|
|
2167
2155
|
}, React__default.createElement(ui.Button, {
|
|
@@ -2217,7 +2205,7 @@ function TokenInfo(props) {
|
|
|
2217
2205
|
}
|
|
2218
2206
|
}, React__default.createElement(ui.Typography, {
|
|
2219
2207
|
variant: "caption",
|
|
2220
|
-
color: "
|
|
2208
|
+
color: "neutral800"
|
|
2221
2209
|
}, `$${numberToString(inputUsdValue)}`)),
|
|
2222
2210
|
value: props.inputAmount || '',
|
|
2223
2211
|
min: 0,
|
|
@@ -2253,7 +2241,7 @@ function BottomLogo() {
|
|
|
2253
2241
|
} = reactI18next.useTranslation();
|
|
2254
2242
|
return React__default.createElement(Container$3, null, React__default.createElement(ui.Typography, {
|
|
2255
2243
|
variant: "caption",
|
|
2256
|
-
color: "$
|
|
2244
|
+
color: "$neutral600"
|
|
2257
2245
|
}, t('Powered By')), React__default.createElement(StyledAnchor, {
|
|
2258
2246
|
href: "https://rango.exchange",
|
|
2259
2247
|
target: "_blank"
|
|
@@ -2571,7 +2559,8 @@ function SelectTokenPage(props) {
|
|
|
2571
2559
|
|
|
2572
2560
|
function SettingsPage(_ref) {
|
|
2573
2561
|
let {
|
|
2574
|
-
supportedSwappers
|
|
2562
|
+
supportedSwappers,
|
|
2563
|
+
singleTheme
|
|
2575
2564
|
} = _ref;
|
|
2576
2565
|
const slippage = useSettingsStore.use.slippage();
|
|
2577
2566
|
const setSlippage = useSettingsStore.use.setSlippage();
|
|
@@ -2613,6 +2602,7 @@ function SettingsPage(_ref) {
|
|
|
2613
2602
|
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
2614
2603
|
liquiditySources: supportedUniqueSwappersGroups,
|
|
2615
2604
|
selectedLiquiditySources: supportedUniqueSwappersGroups.filter(s => s.selected),
|
|
2605
|
+
singleTheme: singleTheme,
|
|
2616
2606
|
customSlippage: customSlippage || NaN,
|
|
2617
2607
|
onCustomSlippageChange: setCustomSlippage,
|
|
2618
2608
|
minSlippage: MIN_SLIPPGAE,
|
|
@@ -2924,6 +2914,7 @@ function AppRoutes(props) {
|
|
|
2924
2914
|
}, {
|
|
2925
2915
|
path: navigationRoutes.settings,
|
|
2926
2916
|
element: React__default.createElement(SettingsPage, {
|
|
2917
|
+
singleTheme: config?.theme?.singleTheme,
|
|
2927
2918
|
supportedSwappers: config?.liquiditySources
|
|
2928
2919
|
})
|
|
2929
2920
|
}, {
|
|
@@ -2995,20 +2986,24 @@ function Layout(_ref) {
|
|
|
2995
2986
|
t
|
|
2996
2987
|
} = reactI18next.useTranslation();
|
|
2997
2988
|
React.useEffect(() => {
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
2989
|
+
if (loadingMetaStatus === 'success') {
|
|
2990
|
+
const chain = blockchains.find(chain => chain.name === config?.to?.blockchain);
|
|
2991
|
+
const token = tokens.find(t => tokensAreEqual(t, config?.to?.token || null));
|
|
2992
|
+
setToChain(chain || null);
|
|
2993
|
+
setToToken(token || null);
|
|
2994
|
+
}
|
|
2995
|
+
}, [config?.to?.token, config?.to?.blockchain, loadingMetaStatus]);
|
|
3003
2996
|
React.useEffect(() => {
|
|
3004
2997
|
setInputAmount(config?.amount?.toString() || '');
|
|
3005
2998
|
}, [config?.amount]);
|
|
3006
2999
|
React.useEffect(() => {
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3000
|
+
if (loadingMetaStatus === 'success') {
|
|
3001
|
+
const chain = blockchains.find(chain => chain.name === config?.from?.blockchain);
|
|
3002
|
+
const token = tokens.find(t => tokensAreEqual(t, config?.from?.token || null));
|
|
3003
|
+
setFromChain(chain || null);
|
|
3004
|
+
setFromToken(token || null);
|
|
3005
|
+
}
|
|
3006
|
+
}, [config?.from?.token, config?.from?.blockchain, loadingMetaStatus]);
|
|
3012
3007
|
React.useEffect(() => {
|
|
3013
3008
|
setAffiliateRef(config?.affiliateRef || null);
|
|
3014
3009
|
}, [config?.affiliateRef]);
|
|
@@ -3067,89 +3062,66 @@ function useTheme(_ref) {
|
|
|
3067
3062
|
const theme = useSettingsStore.use.theme();
|
|
3068
3063
|
const fetchMeta = useMetaStore.use.fetchMeta();
|
|
3069
3064
|
const setTheme = useSettingsStore.use.setTheme();
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
primary700: shadeColor(primary, -35),
|
|
3093
|
-
primary800: shadeColor(primary, -40),
|
|
3094
|
-
primary900: shadeColor(primary, -45),
|
|
3065
|
+
const light = themeColors?.light;
|
|
3066
|
+
const dark = themeColors?.dark;
|
|
3067
|
+
const neutral = light?.neutral || '#fafafa';
|
|
3068
|
+
const background = light?.background || '#fff';
|
|
3069
|
+
const foreground = light?.foreground || '#000';
|
|
3070
|
+
const darkColors = {
|
|
3071
|
+
...ui.generateRangeColors('primary', 'dark', dark?.primary),
|
|
3072
|
+
...ui.generateRangeColors('error', 'dark', dark?.error),
|
|
3073
|
+
...ui.generateRangeColors('warning', 'dark', dark?.warning),
|
|
3074
|
+
...ui.generateRangeColors('success', 'dark', dark?.success),
|
|
3075
|
+
...ui.generateRangeColors('neutral', 'dark', dark?.neutral),
|
|
3076
|
+
surface: dark?.surface,
|
|
3077
|
+
background: dark?.background,
|
|
3078
|
+
foreground: dark?.foreground
|
|
3079
|
+
};
|
|
3080
|
+
const lightColors = {
|
|
3081
|
+
surface: light?.surface || '#fff',
|
|
3082
|
+
...ui.generateRangeColors('primary', 'light', light?.primary || '#5FA425'),
|
|
3083
|
+
...ui.generateRangeColors('error', 'light', light?.error || '#FF0000'),
|
|
3084
|
+
...ui.generateRangeColors('warning', 'light', light?.warning || '#F5A623'),
|
|
3085
|
+
...ui.generateRangeColors('success', 'light', light?.success || '#0070F3'),
|
|
3086
|
+
...ui.generateRangeColors('neutral', 'light', neutral),
|
|
3095
3087
|
background,
|
|
3096
|
-
foreground
|
|
3097
|
-
error,
|
|
3098
|
-
error100: shadeColor(error, 50),
|
|
3099
|
-
error300: shadeColor(error, -10),
|
|
3100
|
-
error500: shadeColor(error, -20),
|
|
3101
|
-
error700: shadeColor(error, -30),
|
|
3102
|
-
warning,
|
|
3103
|
-
warning100: shadeColor(warning, 50),
|
|
3104
|
-
warning300: shadeColor(warning, -10),
|
|
3105
|
-
warning500: shadeColor(warning, -20),
|
|
3106
|
-
warning700: shadeColor(warning, -30),
|
|
3107
|
-
success,
|
|
3108
|
-
success100: shadeColor(success, 50),
|
|
3109
|
-
success300: shadeColor(success, -10),
|
|
3110
|
-
success500: shadeColor(success, -20),
|
|
3111
|
-
success700: shadeColor(success, -30)
|
|
3088
|
+
foreground
|
|
3112
3089
|
};
|
|
3113
3090
|
const customeLightTheme = ui.createTheme({
|
|
3114
|
-
colors,
|
|
3091
|
+
colors: lightColors,
|
|
3115
3092
|
radii: {
|
|
3116
3093
|
5: `${borderRadius}px`
|
|
3117
3094
|
},
|
|
3118
3095
|
shadows: {
|
|
3119
|
-
s:
|
|
3096
|
+
s: `0px 3px 5px 3px ${light?.neutral || '#f0f2f5'} ,0px 6px 10px 3px ${light?.neutral || '#f0f2f5'}, 0px 1px 18px 3px ${light?.neutral || '#f0f2f5'}`
|
|
3120
3097
|
}
|
|
3121
3098
|
});
|
|
3122
3099
|
const customeDarkTheme = ui.createTheme({
|
|
3123
3100
|
colors: {
|
|
3124
|
-
...
|
|
3125
|
-
|
|
3126
|
-
neutrals300: '#333333',
|
|
3127
|
-
neutrals400: '#444444',
|
|
3128
|
-
neutrals500: '#acacac',
|
|
3129
|
-
neutrals600: '#cccccc',
|
|
3130
|
-
neutrals700: '#dedede',
|
|
3131
|
-
neutrals800: '#f2f2f2',
|
|
3132
|
-
neutrals900: '#FAFAFA',
|
|
3101
|
+
...lightColors,
|
|
3102
|
+
...ui.generateRangeColors('neutral', 'dark', '#111111'),
|
|
3133
3103
|
foreground: background,
|
|
3134
|
-
background: foreground
|
|
3104
|
+
background: foreground,
|
|
3105
|
+
surface: '#000',
|
|
3106
|
+
...JSON.parse(JSON.stringify(darkColors))
|
|
3135
3107
|
},
|
|
3136
3108
|
radii: {
|
|
3137
3109
|
5: `${borderRadius}px`
|
|
3138
3110
|
},
|
|
3139
3111
|
shadows: {
|
|
3140
|
-
s:
|
|
3112
|
+
s: `0px 3px 5px 3px ${dark?.neutral || '#222'}, 0px 6px 10px 3px ${dark?.neutral || '#222'}, 0px 1px 18px 3px ${dark?.neutral || '#222'}`
|
|
3141
3113
|
}
|
|
3142
3114
|
});
|
|
3143
|
-
const [OSTheme, setOSTheme] = React.useState(
|
|
3115
|
+
const [OSTheme, setOSTheme] = React.useState('light');
|
|
3144
3116
|
React.useEffect(() => {
|
|
3145
3117
|
(async () => {
|
|
3146
3118
|
await fetchMeta();
|
|
3147
3119
|
})();
|
|
3148
3120
|
const switchTheme = event => {
|
|
3149
|
-
if (event.matches) setOSTheme(
|
|
3121
|
+
if (event.matches) setOSTheme('dark');else setOSTheme('light');
|
|
3150
3122
|
};
|
|
3151
3123
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
3152
|
-
setOSTheme(
|
|
3124
|
+
setOSTheme('dark');
|
|
3153
3125
|
}
|
|
3154
3126
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', switchTheme);
|
|
3155
3127
|
return () => {
|
|
@@ -3168,7 +3140,7 @@ function useTheme(_ref) {
|
|
|
3168
3140
|
classList.add(`font_${fontFamily.replace(/ /g, '')}`);
|
|
3169
3141
|
}, [fontFamily]);
|
|
3170
3142
|
const getActiveTheme = () => {
|
|
3171
|
-
if (theme === 'auto') return OSTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
|
|
3143
|
+
if (theme === 'auto') return OSTheme === 'dark' ? customeDarkTheme : customeLightTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
|
|
3172
3144
|
};
|
|
3173
3145
|
return {
|
|
3174
3146
|
activeTheme: getActiveTheme()
|
|
@@ -3323,10 +3295,7 @@ function QueueManager(props) {
|
|
|
3323
3295
|
state,
|
|
3324
3296
|
notifier
|
|
3325
3297
|
};
|
|
3326
|
-
return React__default.createElement(queueManagerReact.Provider
|
|
3327
|
-
//@ts-ignore
|
|
3328
|
-
, {
|
|
3329
|
-
//@ts-ignore
|
|
3298
|
+
return React__default.createElement(queueManagerReact.Provider, {
|
|
3330
3299
|
queuesDefs: [swapQueueDef],
|
|
3331
3300
|
context: context,
|
|
3332
3301
|
onPersistedDataLoaded: manager => {
|
|
@@ -3404,6 +3373,7 @@ const Widget = _ref => {
|
|
|
3404
3373
|
providers: providers,
|
|
3405
3374
|
onUpdateState: onUpdateState
|
|
3406
3375
|
}, React__default.createElement("div", {
|
|
3376
|
+
id: "swap-container",
|
|
3407
3377
|
className: activeTheme
|
|
3408
3378
|
}, React__default.createElement(QueueManager, null, React__default.createElement(ui.SwapContainer, {
|
|
3409
3379
|
fixedHeight: currentPage !== navigationRoutes.home
|