@rango-dev/widget-embedded 0.1.16-next.0 → 0.1.16-next.10
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/Home.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +2 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +6 -15
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +7 -0
- package/dist/types/wallets.d.ts.map +1 -0
- package/dist/utils/common.d.ts +0 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +2 -3
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +8 -9
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +11 -12
- package/dist/utils/wallets.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +161 -197
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +161 -197
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +162 -198
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +10 -13
- package/src/QueueManager.tsx +4 -6
- package/src/components/AppRoutes.tsx +1 -1
- package/src/components/BottomLogo.tsx +1 -1
- package/src/components/Layout.tsx +27 -23
- package/src/components/RoutesOverview.tsx +2 -2
- package/src/components/TokenInfo.tsx +14 -13
- package/src/components/TokenPreview.tsx +6 -6
- package/src/hooks/useConfirmSwap.ts +2 -2
- package/src/hooks/useTheme.ts +42 -59
- package/src/index.tsx +144 -14
- package/src/pages/ConfirmSwapPage.tsx +27 -19
- package/src/pages/Home.tsx +5 -3
- package/src/pages/SettingsPage.tsx +3 -1
- package/src/store/bestRoute.ts +7 -7
- package/src/store/wallets.ts +32 -46
- package/src/types/config.ts +8 -1
- package/src/types/index.ts +1 -0
- package/src/types/wallets.ts +7 -0
- package/src/utils/common.ts +0 -21
- package/src/utils/routing.ts +2 -3
- package/src/utils/swap.ts +12 -11
- package/src/utils/wallets.ts +60 -63
- 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"}
|
package/dist/pages/Home.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../src/pages/Home.tsx"],"names":[],"mappings":";AAmEA,wBAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../src/pages/Home.tsx"],"names":[],"mappings":";AAmEA,wBAAgB,IAAI,gBA+JnB"}
|
|
@@ -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/store/wallets.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { SelectableWallet } from '@rango-dev/ui';
|
|
2
2
|
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
-
import {
|
|
4
|
-
export interface Account {
|
|
5
|
-
chain: string;
|
|
6
|
-
address: string;
|
|
7
|
-
walletType: WalletType;
|
|
8
|
-
}
|
|
3
|
+
import { Wallet } from '../types';
|
|
9
4
|
export declare type TokenBalance = {
|
|
10
5
|
chain: string;
|
|
11
6
|
symbol: string;
|
|
@@ -17,25 +12,21 @@ export declare type TokenBalance = {
|
|
|
17
12
|
logo: string | null;
|
|
18
13
|
usdPrice: number | null;
|
|
19
14
|
};
|
|
20
|
-
export interface
|
|
15
|
+
export interface ConnectedWallet extends Wallet {
|
|
21
16
|
balances: TokenBalance[] | null;
|
|
22
|
-
address: string;
|
|
23
|
-
chain: string;
|
|
24
17
|
loading: boolean;
|
|
25
|
-
walletType: WalletType;
|
|
26
18
|
error: boolean;
|
|
27
19
|
explorerUrl: string | null;
|
|
28
20
|
}
|
|
29
21
|
interface WalletsStore {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
connectWallet: (accounts: Account[]) => void;
|
|
22
|
+
connectedWallets: ConnectedWallet[];
|
|
23
|
+
selectedWallets: Wallet[];
|
|
24
|
+
connectWallet: (accounts: Wallet[]) => void;
|
|
34
25
|
disconnectWallet: (walletType: WalletType) => void;
|
|
35
26
|
initSelectedWallets: () => void;
|
|
36
27
|
setSelectedWallet: (wallet: SelectableWallet) => void;
|
|
37
28
|
clearConnectedWallet: () => void;
|
|
38
|
-
getOneOfWalletsDetails: (account:
|
|
29
|
+
getOneOfWalletsDetails: (account: Wallet) => void;
|
|
39
30
|
}
|
|
40
31
|
export declare const useWalletsStore: any;
|
|
41
32
|
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;
|
|
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;AAgBvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,UAAU,YAAY;IACpB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACnD,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,iBAAiB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,eAAe,KAiH3B,CAAC;AAyBF,eAAO,MAAM,uBAAuB,UAAW,YAAY,YACA,CAAC"}
|
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,CA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,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/types/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB"}
|
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"}
|
package/dist/utils/routing.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/types/swaps';
|
|
2
2
|
import BigNumber from 'bignumber.js';
|
|
3
3
|
import { BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
4
|
-
import {
|
|
5
|
-
import { BestRouteEqualityParams } from '../types';
|
|
4
|
+
import { BestRouteEqualityParams, Wallet } from '../types';
|
|
6
5
|
import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
7
6
|
export declare function searchParamsToToken(tokens: Token[], searchParams: string | null, chain: BlockchainMeta | null): Token | null;
|
|
8
7
|
export declare function getBestRouteToTokenUsdPrice(bestRoute: BestRouteResponse | null): number | null | undefined;
|
|
@@ -11,7 +10,7 @@ export declare function isRouteSwappersUpdated(route1: BestRouteResponse, route2
|
|
|
11
10
|
export declare function isRouteInternalCoinsUpdated(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
12
11
|
export declare function isRouteChanged(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
13
12
|
export declare function outToRatioHasWarning(fromUsdValue: BigNumber | null, outToInRatio: BigNumber | 0): boolean;
|
|
14
|
-
export declare function getRequiredBalanceOfWallet(selectedWallet:
|
|
13
|
+
export declare function getRequiredBalanceOfWallet(selectedWallet: Wallet, fee: SimulationValidationStatus[] | null): SimulationAssetAndAmount[] | null;
|
|
15
14
|
export declare function isRouteParametersChanged(params: BestRouteEqualityParams): boolean | undefined;
|
|
16
15
|
export declare function getFormatedBestRoute(bestRoute: BestRouteResponse | null): BestRouteResponse | null;
|
|
17
16
|
export declare function getFormatedPendingSwap(pendingSwap: PendingSwap): PendingSwap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/utils/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/utils/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,KAAK,EAAE,EACf,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,KAAK,EAAE,cAAc,GAAG,IAAI,GAC3B,KAAK,GAAG,IAAI,CAkBd;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAClC,MAAM,GAAG,IAAI,GAAG,SAAS,CAG3B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAK1B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAO1B;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAO1B;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAMT;AAED,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,SAAS,GAAG,IAAI,EAC9B,YAAY,EAAE,SAAS,GAAG,CAAC,WAQ5B;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,0BAA0B,EAAE,GAAG,IAAI,GACvC,wBAAwB,EAAE,GAAG,IAAI,CAUnC;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,uBAAuB,uBA4BvE;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAClC,iBAAiB,GAAG,IAAI,CAe1B;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAiB5E;AAGD,eAAO,MAAM,kBAAkB,YAAa,OAAO,SAAS,OAAO,qCAIlE,CAAC"}
|
package/dist/utils/swap.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { BestRouteRequest, BestRouteResponse, RecommendedSlippage, SwapResult, Token } from 'rango-sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { ConnectedWallet } from '../store/wallets';
|
|
4
4
|
import { WalletType } from '@rango-dev/wallets-shared';
|
|
5
|
-
import { SelectedWallet } from './wallets';
|
|
6
5
|
import { LoadingStatus } from '../store/meta';
|
|
7
|
-
import { ConvertedToken, SwapButtonState } from '../types';
|
|
6
|
+
import { ConvertedToken, SwapButtonState, Wallet } from '../types';
|
|
8
7
|
import { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
9
8
|
import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
10
9
|
export declare function getOutputRatio(inputUsdValue: BigNumber, outputUsdValue: BigNumber): BigNumber | 0;
|
|
@@ -15,7 +14,7 @@ export declare function LimitErrorMessage(bestRoute: BestRouteResponse | null):
|
|
|
15
14
|
fromAmountRangeError: string;
|
|
16
15
|
recommendation: string;
|
|
17
16
|
};
|
|
18
|
-
export declare function getSwapButtonState(loadingMetaStatus: LoadingStatus,
|
|
17
|
+
export declare function getSwapButtonState(loadingMetaStatus: LoadingStatus, connectedWallets: ConnectedWallet[], loading: boolean, bestRoute: BestRouteResponse | null, hasLimitError: boolean, highValueLoss: boolean, priceImpactCanNotBeComputed: boolean, needsToWarnEthOnPath: boolean, inputAmount: string): SwapButtonState;
|
|
19
18
|
export declare function canComputePriceImpact(bestRoute: BestRouteResponse | null, inputAmount: string, inputUsdValue: BigNumber, outputUsdValue: BigNumber): boolean;
|
|
20
19
|
export declare function requiredWallets(route: BestRouteResponse | null): string[];
|
|
21
20
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
@@ -25,10 +24,10 @@ export declare function hasHighFee(totalFeeInUsd: BigNumber | null): boolean;
|
|
|
25
24
|
export declare function hasSlippageError(slippages: (RecommendedSlippage | null)[] | undefined): boolean;
|
|
26
25
|
export declare function getMinRequiredSlippage(route: BestRouteResponse): string | null;
|
|
27
26
|
export declare function hasProperSlippage(userSlippage: string, minRequiredSlippage: string | null): boolean;
|
|
28
|
-
export declare function hasEnoughBalance(route: BestRouteResponse, selectedWallets:
|
|
29
|
-
export declare function hasEnoughBalanceAndProperSlippage(route: BestRouteResponse, selectedWallets:
|
|
30
|
-
export declare function createBestRouteRequestBody(fromToken: Token, toToken: Token, inputAmount: string, wallets:
|
|
31
|
-
export declare function getWalletsForNewSwap(selectedWallets:
|
|
27
|
+
export declare function hasEnoughBalance(route: BestRouteResponse, selectedWallets: Wallet[]): boolean;
|
|
28
|
+
export declare function hasEnoughBalanceAndProperSlippage(route: BestRouteResponse, selectedWallets: Wallet[], userSlippage: string, minRequiredSlippage: string | null): boolean;
|
|
29
|
+
export declare function createBestRouteRequestBody(fromToken: Token, toToken: Token, inputAmount: string, wallets: ConnectedWallet[], selectedWallets: Wallet[], disabledLiquiditySources: string[], slippage: number, affiliateRef: string | null, initialRoute?: BestRouteResponse): BestRouteRequest;
|
|
30
|
+
export declare function getWalletsForNewSwap(selectedWallets: Wallet[]): {
|
|
32
31
|
[p: string]: {
|
|
33
32
|
address: string;
|
|
34
33
|
walletType: WalletType;
|
|
@@ -37,7 +36,7 @@ export declare function getWalletsForNewSwap(selectedWallets: SelectedWallet[]):
|
|
|
37
36
|
export declare function getRouteOutputAmount(route: BestRouteResponse | null): string | null;
|
|
38
37
|
export declare function getPercentageChange(oldValue: string | number | null, newValue: string | number | null): BigNumber | null;
|
|
39
38
|
export declare function isOutputAmountChangedALot(oldRoute: BestRouteResponse, newRoute: BestRouteResponse): boolean;
|
|
40
|
-
export declare function getBalanceWarnings(route: BestRouteResponse, selectedWallets:
|
|
39
|
+
export declare function getBalanceWarnings(route: BestRouteResponse, selectedWallets: Wallet[]): string[];
|
|
41
40
|
export declare function calcOutputUsdValue(outputAmount?: string, tokenPrice?: number | null): BigNumber;
|
|
42
41
|
export declare function isNetworkStatusInWarningState(pendingSwapStep: PendingSwapStep | null): boolean;
|
|
43
42
|
export declare function getSwapMessages(pendingSwap: PendingSwap, currentStep: PendingSwapStep | null): {
|
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":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,gBAAgB,EACh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B;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,WAMvD"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { Network, WalletState, WalletType, WalletInfo } from '@rango-dev/wallets-shared';
|
|
2
2
|
import { WalletInfo as ModalWalletInfo, WalletState as WalletStatus, SelectableWallet } from '@rango-dev/ui';
|
|
3
3
|
import { BestRouteResponse, BlockchainMeta, Token, WalletDetail } from 'rango-sdk';
|
|
4
|
-
import {
|
|
4
|
+
import { ConnectedWallet, TokenBalance } from '../store/wallets';
|
|
5
5
|
import { TokenWithBalance } from '../pages/SelectTokenPage';
|
|
6
|
+
import { Wallet } from '../types';
|
|
6
7
|
export declare function getStateWallet(state: WalletState): WalletStatus;
|
|
7
8
|
export declare const excludedWallets: WalletType[];
|
|
8
9
|
export declare function getlistWallet(getState: (type: WalletType) => WalletState, getWalletInfo: (type: WalletType) => WalletInfo, list: WalletType[]): ModalWalletInfo[];
|
|
9
10
|
export declare function walletAndSupportedChainsNames(supportedChains: BlockchainMeta[]): Network[] | null;
|
|
10
|
-
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null):
|
|
11
|
+
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null): Wallet[];
|
|
11
12
|
export declare function getRequiredChains(route: BestRouteResponse | null): string[];
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare
|
|
18
|
-
export declare function resetBalanceState(balance: Balance): Balance;
|
|
19
|
-
export declare const calculateWalletUsdValue: (balance: Balance[]) => string;
|
|
13
|
+
export declare function getSelectableWallets(connectedWallets: ConnectedWallet[], selectedWallets: Wallet[], getWalletInfo: (type: WalletType) => WalletInfo): SelectableWallet[];
|
|
14
|
+
export declare function getBalanceFromWallet(connectedWallets: ConnectedWallet[], chain: string, symbol: string, address: string | null): TokenBalance | null;
|
|
15
|
+
export declare function isAccountAndWalletMatched(account: Wallet, connectedWallet: ConnectedWallet): boolean;
|
|
16
|
+
export declare function makeBalanceFor(wallet: Wallet, retrivedBalance: WalletDetail, tokens: Token[]): ConnectedWallet;
|
|
17
|
+
export declare function resetConnectedWalletState(connectedWallet: ConnectedWallet): ConnectedWallet;
|
|
18
|
+
export declare const calculateWalletUsdValue: (connectedWallet: ConnectedWallet[]) => string;
|
|
20
19
|
export declare const sortTokens: (tokens: TokenWithBalance[]) => TokenWithBalance[];
|
|
21
20
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
22
21
|
export declare const isExperimentalChain: (blockchains: BlockchainMeta[], wallet: string) => boolean;
|
|
23
22
|
export declare const getKeplrCompatibleConnectedWallets: (selectableWallets: SelectableWallet[]) => WalletType[];
|
|
24
|
-
export declare function getTokensWithBalance(tokens: TokenWithBalance[],
|
|
25
|
-
export declare function getSortedTokens(chain: BlockchainMeta | null, tokens: Token[],
|
|
23
|
+
export declare function getTokensWithBalance(tokens: TokenWithBalance[], connectedWallets: ConnectedWallet[]): TokenWithBalance[];
|
|
24
|
+
export declare function getSortedTokens(chain: BlockchainMeta | null, tokens: Token[], connectedWallets: ConnectedWallet[], otherChainTokens: TokenWithBalance[]): TokenWithBalance[];
|
|
26
25
|
export declare function tokensAreEqual(tokenA: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null, tokenB: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null): boolean;
|
|
27
26
|
export declare function getDefaultToken(sortedTokens: TokenWithBalance[], otherToken: TokenWithBalance | null): TokenWithBalance;
|
|
28
27
|
export declare function sortWalletsBasedOnState(wallets: ModalWalletInfo[]): ModalWalletInfo[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,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