@rango-dev/widget-embedded 0.14.1-next.9 → 0.16.0
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/CHANGELOG.md +4 -0
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +2 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +15 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +3 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +4 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +3 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +3 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +4 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +4 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +4 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +6 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +4 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +10 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
- package/dist/constants/configs.d.ts +2 -0
- package/dist/constants/configs.d.ts.map +1 -0
- package/dist/constants/errors.d.ts +1 -1
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/languages.d.ts +11 -0
- package/dist/constants/languages.d.ts.map +1 -0
- package/dist/constants/messages.d.ts +1 -1
- package/dist/constants/messages.d.ts.map +1 -1
- package/dist/hooks/useLanguage.d.ts +11 -0
- package/dist/hooks/useLanguage.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/index.d.ts +2 -0
- package/dist/hooks/usePrepareBlockchainList/index.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +2 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts.map +1 -0
- package/dist/hooks/{usePrepareBlockchainList.d.ts → usePrepareBlockchainList/usePrepareBlockchainList.d.ts} +1 -9
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +10 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +3 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.d.ts +2 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +11 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -0
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/store/settings.d.ts +15 -6
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/types/config.d.ts +7 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +13 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/wallets.d.ts +0 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Widget.tsx +14 -2
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +21 -6
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +5 -11
- package/src/components/ConfirmWalletsModal/WalletList.tsx +35 -24
- package/src/components/Layout/Layout.styles.ts +7 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +1 -1
- package/src/components/NoRoutes/NoRoutes.helper.ts +4 -4
- package/src/components/NoRoutes/NoRoutes.tsx +2 -2
- package/src/components/NotificationContent/NotificationContent.tsx +1 -1
- package/src/components/NotificationContent/NotificationNotFound.tsx +1 -1
- package/src/components/RouteErrors/RouteErrors.tsx +2 -2
- package/src/components/RouteErrors/RouteErrorsModal.tsx +6 -6
- package/src/components/RouteErrors/RouteErrorsModalItem.tsx +1 -1
- package/src/components/Slippage/SlippageTooltipContent.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -6
- package/src/components/SwapDetails/SwapDetails.tsx +6 -10
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +1 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +2 -2
- package/src/components/TokenList/TokenList.styles.ts +1 -1
- package/src/components/TokenList/TokenList.tsx +1 -1
- package/src/constants/configs.ts +1 -0
- package/src/constants/errors.ts +44 -41
- package/src/constants/languages.ts +19 -0
- package/src/constants/messages.ts +7 -5
- package/src/hooks/useConfirmSwap.ts +1 -1
- package/src/hooks/useLanguage.ts +27 -0
- package/src/hooks/usePrepareBlockchainList/index.ts +1 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +108 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +3101 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +273 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +38 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +12 -0
- package/src/hooks/useSyncStoresWithConfig.ts +49 -1
- package/src/hooks/useTheme.ts +34 -56
- package/src/pages/ConfirmSwapPage.tsx +9 -18
- package/src/pages/Home.tsx +6 -7
- package/src/pages/LanguagePage.tsx +16 -39
- package/src/pages/SettingsPage.tsx +1 -1
- package/src/store/settings.ts +46 -4
- package/src/types/config.ts +6 -2
- package/src/utils/colors.ts +16 -0
- package/src/utils/configs.ts +3 -0
- package/src/utils/hash.ts +27 -0
- package/src/utils/settings.ts +1 -1
- package/src/utils/swap.ts +15 -20
- package/src/utils/time.ts +2 -4
- package/src/utils/ui.ts +72 -0
- package/src/utils/wallets.ts +4 -25
- package/dist/hooks/usePrepareBlockchainList.d.ts.map +0 -1
- package/src/hooks/usePrepareBlockchainList.ts +0 -125
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAoB7C,OAAO,KAA8B,MAAM,OAAO,CAAC;AA6EnD,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAoB7C,OAAO,KAA8B,MAAM,OAAO,CAAC;AA6EnD,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,qBAoa/C"}
|
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":"AAcA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA+E3D,wBAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA+E3D,wBAAgB,IAAI,sBA0YnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguagePage.d.ts","sourceRoot":"","sources":["../../src/pages/LanguagePage.tsx"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"LanguagePage.d.ts","sourceRoot":"","sources":["../../src/pages/LanguagePage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,wBAAgB,YAAY,sBA2C3B"}
|
package/dist/store/settings.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { type Language } from '@rango-dev/ui';
|
|
2
|
+
export type ThemeMode = 'auto' | 'dark' | 'light';
|
|
2
3
|
export interface SettingsState {
|
|
4
|
+
/** Keeping a history of blockchains that user has selected (in Swap process) */
|
|
5
|
+
preferredBlockchains: string[];
|
|
3
6
|
slippage: number;
|
|
4
7
|
customSlippage: number | null;
|
|
5
8
|
infiniteApprove: boolean;
|
|
6
9
|
disabledLiquiditySources: string[];
|
|
7
|
-
theme:
|
|
10
|
+
theme: ThemeMode;
|
|
11
|
+
language: Language;
|
|
8
12
|
affiliateRef: string | null;
|
|
9
13
|
affiliatePercent: number | null;
|
|
10
14
|
affiliateWallets: {
|
|
@@ -14,13 +18,15 @@ export interface SettingsState {
|
|
|
14
18
|
setCustomSlippage: (customSlippage: number | null) => void;
|
|
15
19
|
toggleInfiniteApprove: () => void;
|
|
16
20
|
toggleLiquiditySource: (name: string) => void;
|
|
17
|
-
setTheme: (theme:
|
|
21
|
+
setTheme: (theme: ThemeMode) => void;
|
|
22
|
+
setLanguage: (language: Language) => void;
|
|
18
23
|
toggleAllLiquiditySources: (shouldReset?: boolean) => void;
|
|
19
24
|
setAffiliateRef: (affiliateRef: string | null) => void;
|
|
20
25
|
setAffiliatePercent: (affiliatePercent: number | null) => void;
|
|
21
26
|
setAffiliateWallets: (affiliateWallets: {
|
|
22
27
|
[key: string]: string;
|
|
23
28
|
} | null) => void;
|
|
29
|
+
addPreferredBlockchain: (blockchain: string) => void;
|
|
24
30
|
}
|
|
25
31
|
export declare const useSettingsStore: {
|
|
26
32
|
(): SettingsState;
|
|
@@ -45,11 +51,13 @@ export declare const useSettingsStore: {
|
|
|
45
51
|
};
|
|
46
52
|
} & {
|
|
47
53
|
use: {
|
|
54
|
+
preferredBlockchains: () => string[];
|
|
48
55
|
slippage: () => number;
|
|
49
56
|
customSlippage: () => number | null;
|
|
50
57
|
infiniteApprove: () => boolean;
|
|
51
58
|
disabledLiquiditySources: () => string[];
|
|
52
|
-
theme: () =>
|
|
59
|
+
theme: () => ThemeMode;
|
|
60
|
+
language: () => "en" | "es" | "ja" | "fr";
|
|
53
61
|
affiliateRef: () => string | null;
|
|
54
62
|
affiliatePercent: () => number | null;
|
|
55
63
|
affiliateWallets: () => {
|
|
@@ -59,14 +67,15 @@ export declare const useSettingsStore: {
|
|
|
59
67
|
setCustomSlippage: () => (customSlippage: number | null) => void;
|
|
60
68
|
toggleInfiniteApprove: () => () => void;
|
|
61
69
|
toggleLiquiditySource: () => (name: string) => void;
|
|
62
|
-
setTheme: () => (theme:
|
|
70
|
+
setTheme: () => (theme: ThemeMode) => void;
|
|
71
|
+
setLanguage: () => (language: Language) => void;
|
|
63
72
|
toggleAllLiquiditySources: () => (shouldReset?: boolean) => void;
|
|
64
73
|
setAffiliateRef: () => (affiliateRef: string | null) => void;
|
|
65
74
|
setAffiliatePercent: () => (affiliatePercent: number | null) => void;
|
|
66
75
|
setAffiliateWallets: () => (affiliateWallets: {
|
|
67
76
|
[key: string]: string;
|
|
68
77
|
} | null) => void;
|
|
78
|
+
addPreferredBlockchain: () => (blockchain: string) => void;
|
|
69
79
|
};
|
|
70
80
|
};
|
|
71
|
-
export {};
|
|
72
81
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/store/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/store/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAY9C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,I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
|
|
17
17
|
neutral?: string;
|
|
18
18
|
primary?: string;
|
|
19
19
|
secondary?: string;
|
|
20
|
+
info?: string;
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
23
|
* The `WidgetTheme` defines the properties of a widget theme, including mode, font family, colors, border
|
|
@@ -24,7 +25,7 @@ export type WidgetColors = {
|
|
|
24
25
|
* @property {'auto' | 'light' | 'dark'} mode - The mode property is used to specify the default theme for
|
|
25
26
|
* the widget.
|
|
26
27
|
* @property {string} fontFamily - The font family to be used in the widget.
|
|
27
|
-
* @property {
|
|
28
|
+
* @property {{ light?: WidgetColors; dark?: WidgetColors }} colors - The `colors` property is a sub-property of the `WidgetTheme` object that
|
|
28
29
|
* defines the color scheme for the widget. It is of type `Colors`, which is likely another object that
|
|
29
30
|
* contains specific color values for various parts of the widget (e.g. background color, text color,
|
|
30
31
|
* border color
|
|
@@ -40,8 +41,8 @@ export type WidgetTheme = {
|
|
|
40
41
|
mode?: 'auto' | 'light' | 'dark';
|
|
41
42
|
fontFamily?: string;
|
|
42
43
|
colors?: {
|
|
43
|
-
light
|
|
44
|
-
dark
|
|
44
|
+
light?: WidgetColors;
|
|
45
|
+
dark?: WidgetColors;
|
|
45
46
|
};
|
|
46
47
|
borderRadius?: number;
|
|
47
48
|
secondaryBorderRadius?: number;
|
|
@@ -120,6 +121,8 @@ export type BlockchainAndTokenConfig = {
|
|
|
120
121
|
* If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
|
|
121
122
|
* @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
|
|
122
123
|
* you could use to pin tokens of your choice to the top of the token list.
|
|
124
|
+
* @property {boolean} includeNewLiquiditySources - The `includeNewLiquiditySources` property is a boolean value that when you
|
|
125
|
+
* set it to true, whenever a new liquidity source is added, it will be added to your list as well.
|
|
123
126
|
*/
|
|
124
127
|
export type WidgetConfig = {
|
|
125
128
|
apiKey: string;
|
|
@@ -136,5 +139,6 @@ export type WidgetConfig = {
|
|
|
136
139
|
theme?: WidgetTheme;
|
|
137
140
|
externalWallets?: boolean;
|
|
138
141
|
pinnedTokens?: Asset[];
|
|
142
|
+
includeNewLiquiditySources?: boolean;
|
|
139
143
|
};
|
|
140
144
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,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,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,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AS,CAAC,EAAE,cAAc,CAAC;IAC3B,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,CAAC,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IACvB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC"}
|
package/dist/utils/colors.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const generateRangeColors: (name: string, color: string) => {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const generateColors: (mainColors: {
|
|
7
7
|
[x: string]: string;
|
|
8
|
-
}, colors?: WidgetColors) => {
|
|
8
|
+
}, reverseNeutralRange: boolean, colors?: WidgetColors) => {
|
|
9
9
|
[x: string]: string;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,UAAU,QAAS,MAAM,OAAO,MAAM,WAyBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,MAAM;;CAkC9D,CAAC;AACF,eAAO,MAAM,cAAc;;
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,UAAU,QAAS,MAAM,OAAO,MAAM,WAyBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,MAAM;;CAkC9D,CAAC;AACF,eAAO,MAAM,cAAc;;wBAEJ,OAAO,WACnB,YAAY;;CAyCtB,CAAC"}
|
package/dist/utils/configs.d.ts
CHANGED
|
@@ -9,4 +9,6 @@ export declare function setConfig(name: keyof Configs, value: any): any;
|
|
|
9
9
|
export declare function initConfig(nextConfigs: Configs): Configs;
|
|
10
10
|
export declare const DEFAULT_PRIMARY_RADIUS = 20;
|
|
11
11
|
export declare const DEFAULT_SECONDARY_RADIUS = 25;
|
|
12
|
+
export declare const DEFAULT_FONT_FAMILY = "Roboto";
|
|
13
|
+
export declare const THEME_CLASS_NAME_PREFIX = "theme-widget";
|
|
12
14
|
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,uBAAuB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,MAAM,UAAW,MAAM,WAC0B,CAAC"}
|
package/dist/utils/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AAInB,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,iBAWjC;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,SAAS,GAAG,IAAI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|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAWzE,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqDrD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAUnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WidgetTheme } from '../types';
|
|
2
|
+
import type { createTheme } from '@rango-dev/ui';
|
|
3
|
+
interface CustomizedThemeValues {
|
|
4
|
+
id: string;
|
|
5
|
+
tokens: Parameters<typeof createTheme>[0];
|
|
6
|
+
}
|
|
7
|
+
interface CustomizedTheme {
|
|
8
|
+
light: undefined | CustomizedThemeValues;
|
|
9
|
+
dark: undefined | CustomizedThemeValues;
|
|
10
|
+
}
|
|
11
|
+
export declare function customizedThemeTokens(colors: WidgetTheme['colors']): CustomizedTheme;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAYjD,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,GAAG,qBAAqB,CAAC;IACzC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC5B,eAAe,CA6CjB"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare function mapWalletTypesToWalletInfo(getState: (type: WalletType)
|
|
|
10
10
|
export declare function walletAndSupportedChainsNames(supportedBlockchains: BlockchainMeta[]): Network[] | null;
|
|
11
11
|
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null): Wallet[];
|
|
12
12
|
export declare function getRequiredChains(route: BestRouteResponse | null): string[];
|
|
13
|
-
export declare function getSelectableWallets(connectedWallets: ConnectedWallet[], getWalletInfo: (type: WalletType) => WalletInfo, destinationChain?: string): Wallet[];
|
|
14
13
|
export declare function getBalanceFromWallet(connectedWallets: ConnectedWallet[], chain: string, symbol: string, address: string | null): TokenBalance | null;
|
|
15
14
|
export declare function isAccountAndWalletMatched(account: Wallet, connectedWallet: ConnectedWallet): boolean;
|
|
16
15
|
export declare function makeBalanceFor(retrievedBalance: WalletDetail, tokens: Token[]): TokenBalance[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAiB5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,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eAAe,CAC7B,KAAK,EAAE,cAAc,GAAG,IAAI,EAC5B,MAAM,EAAE,KAAK,EAAE,EACf,gBAAgB,EAAE,eAAe,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,GACnC,gBAAgB,EAAE,CAWpB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,EAC/D,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,WAOhE;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAcnB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAEf,QAAQ,SAAI,EAEZ,cAAc,SAAI,GACjB,MAAM,CAOR;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,gBAAgB,EAChB,UAAU,GACX,EAAE;IACD,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,GAAG,SAAS,CAMrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lingui/core": "4.2.1",
|
|
21
21
|
"@lingui/react": "4.2.1",
|
|
22
|
-
"@rango-dev/provider-all": "^0.
|
|
23
|
-
"@rango-dev/queue-manager-core": "^0.
|
|
24
|
-
"@rango-dev/queue-manager-rango-preset": "^0.
|
|
25
|
-
"@rango-dev/queue-manager-react": "^0.
|
|
26
|
-
"@rango-dev/ui": "^0.
|
|
27
|
-
"@rango-dev/wallets-react": "^0.
|
|
28
|
-
"@rango-dev/wallets-shared": "^0.
|
|
22
|
+
"@rango-dev/provider-all": "^0.21.0",
|
|
23
|
+
"@rango-dev/queue-manager-core": "^0.21.0",
|
|
24
|
+
"@rango-dev/queue-manager-rango-preset": "^0.21.0",
|
|
25
|
+
"@rango-dev/queue-manager-react": "^0.21.0",
|
|
26
|
+
"@rango-dev/ui": "^0.21.0",
|
|
27
|
+
"@rango-dev/wallets-react": "^0.7.0",
|
|
28
|
+
"@rango-dev/wallets-shared": "^0.20.0",
|
|
29
29
|
"bignumber.js": "^9.1.1",
|
|
30
30
|
"copy-to-clipboard": "^3.3.3",
|
|
31
31
|
"dayjs": "^1.11.7",
|
package/src/Widget.tsx
CHANGED
|
@@ -9,9 +9,11 @@ import { AppRouter } from './components/AppRouter';
|
|
|
9
9
|
import { AppRoutes } from './components/AppRoutes';
|
|
10
10
|
import { WidgetEvents } from './components/WidgetEvents';
|
|
11
11
|
import { globalFont } from './globalStyles';
|
|
12
|
+
import { useLanguage } from './hooks/useLanguage';
|
|
12
13
|
import { useTheme } from './hooks/useTheme';
|
|
13
14
|
import QueueManager from './QueueManager';
|
|
14
15
|
import { useAppStore } from './store/app';
|
|
16
|
+
import { useMetaStore } from './store/meta';
|
|
15
17
|
import { useNotificationStore } from './store/notification';
|
|
16
18
|
import { useSettingsStore } from './store/settings';
|
|
17
19
|
import { initConfig } from './utils/configs';
|
|
@@ -43,10 +45,13 @@ export function Main(props: PropsWithChildren<WidgetProps>) {
|
|
|
43
45
|
globalFont();
|
|
44
46
|
|
|
45
47
|
const { activeTheme } = useTheme(config?.theme || {});
|
|
48
|
+
const { activeLanguage, changeLanguage } = useLanguage();
|
|
49
|
+
|
|
46
50
|
const [lastConnectedWalletWithNetwork, setLastConnectedWalletWithNetwork] =
|
|
47
51
|
useState<string>('');
|
|
48
52
|
const [disconnectedWallet, setDisconnectedWallet] = useState<WalletType>();
|
|
49
53
|
const widgetContext = useContext(WidgetContext);
|
|
54
|
+
const fetchMeta = useMetaStore.use.fetchMeta();
|
|
50
55
|
|
|
51
56
|
useMemo(() => {
|
|
52
57
|
if (config?.apiKey) {
|
|
@@ -57,14 +62,21 @@ export function Main(props: PropsWithChildren<WidgetProps>) {
|
|
|
57
62
|
}, [config]);
|
|
58
63
|
|
|
59
64
|
useEffect(() => {
|
|
65
|
+
void fetchMeta();
|
|
60
66
|
void useSettingsStore.persist.rehydrate();
|
|
61
67
|
void useNotificationStore.persist.rehydrate();
|
|
62
68
|
widgetContext.onConnectWallet(setLastConnectedWalletWithNetwork);
|
|
63
69
|
}, []);
|
|
64
70
|
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (config?.language) {
|
|
73
|
+
changeLanguage(config.language);
|
|
74
|
+
}
|
|
75
|
+
}, [config?.language]);
|
|
76
|
+
|
|
65
77
|
return (
|
|
66
|
-
<I18nManager language={
|
|
67
|
-
<MainContainer id="swap-container" className={activeTheme}>
|
|
78
|
+
<I18nManager language={activeLanguage}>
|
|
79
|
+
<MainContainer id="swap-container" className={activeTheme()}>
|
|
68
80
|
<QueueManager>
|
|
69
81
|
<WidgetEvents />
|
|
70
82
|
<AppRouter
|
|
@@ -11,28 +11,31 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
+
import { BLOCKCHAIN_LIST_SIZE } from '../../constants/configs';
|
|
14
15
|
import { usePrepareBlockchainList } from '../../hooks/usePrepareBlockchainList';
|
|
15
16
|
import { useBestRouteStore } from '../../store/bestRoute';
|
|
16
17
|
import { useMetaStore } from '../../store/meta';
|
|
17
18
|
|
|
18
19
|
import { Container } from './BlockchainsSection.styles';
|
|
19
20
|
|
|
20
|
-
const LIST_SIZE = 10;
|
|
21
|
-
const MAX_ITEMS = LIST_SIZE + 1;
|
|
22
21
|
const NUMBER_OF_LOADING = 12;
|
|
23
22
|
|
|
24
23
|
export function BlockchainsSection(props: PropTypes) {
|
|
25
24
|
const { blockchains, type, blockchain, onChange, onMoreClick } = props;
|
|
26
25
|
const blockchainsList = usePrepareBlockchainList(blockchains, {
|
|
27
|
-
limit:
|
|
26
|
+
limit: BLOCKCHAIN_LIST_SIZE,
|
|
28
27
|
selected: blockchain?.name,
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
32
31
|
const resetToBlockchain = useBestRouteStore.use.resetToBlockchain();
|
|
33
32
|
const resetFromBlockchain = useBestRouteStore.use.resetFromBlockchain();
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
const hasMoreItemsInList = blockchainsList.more.length > 0;
|
|
34
|
+
/**
|
|
35
|
+
* When only one item is left on list, we will not show the `More` button and will show the item itself instead.
|
|
36
|
+
*/
|
|
37
|
+
const onlyOneItemInList = blockchainsList.more.length === 1;
|
|
38
|
+
const showMoreButton = !onlyOneItemInList && hasMoreItemsInList;
|
|
36
39
|
|
|
37
40
|
return (
|
|
38
41
|
<div>
|
|
@@ -70,8 +73,20 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
70
73
|
</BlockchainsChip>
|
|
71
74
|
))}
|
|
72
75
|
|
|
76
|
+
{onlyOneItemInList ? (
|
|
77
|
+
<BlockchainsChip
|
|
78
|
+
key={blockchainsList.more[0].name}
|
|
79
|
+
selected={
|
|
80
|
+
!!blockchain &&
|
|
81
|
+
blockchain.name === blockchainsList.more[0].name
|
|
82
|
+
}
|
|
83
|
+
onClick={() => onChange(blockchainsList.more[0])}>
|
|
84
|
+
<Image src={blockchainsList.more[0].logo} size={30} />
|
|
85
|
+
</BlockchainsChip>
|
|
86
|
+
) : null}
|
|
87
|
+
|
|
73
88
|
{showMoreButton ? (
|
|
74
|
-
<BlockchainsChip onClick={onMoreClick}>
|
|
89
|
+
<BlockchainsChip onClick={onMoreClick} key="more-blockchains">
|
|
75
90
|
<Typography variant="body" size="xsmall" color="secondary500">
|
|
76
91
|
{i18n._('More +{count}', {
|
|
77
92
|
count: blockchainsList.more.length,
|
|
@@ -290,8 +290,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
290
290
|
</NavigateBack>
|
|
291
291
|
<Typography variant="headline" size="small">
|
|
292
292
|
{i18n.t({
|
|
293
|
-
id: '
|
|
294
|
-
message: 'Your {blockchainName} wallets',
|
|
293
|
+
id: 'Your {blockchainName} wallets',
|
|
295
294
|
values: { blockchainName: showMoreWalletFor },
|
|
296
295
|
})}
|
|
297
296
|
</Typography>
|
|
@@ -364,19 +363,16 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
364
363
|
<Title>
|
|
365
364
|
<Typography variant="title" size="xmedium">
|
|
366
365
|
{i18n.t({
|
|
367
|
-
id: '
|
|
368
|
-
message: 'Your {blockchainName} wallets',
|
|
366
|
+
id: 'Your {blockchainName} wallets',
|
|
369
367
|
values: { blockchainName: blockchain?.displayName },
|
|
370
368
|
})}
|
|
371
369
|
</Typography>
|
|
372
370
|
<Typography
|
|
373
371
|
variant="label"
|
|
374
|
-
color="$
|
|
372
|
+
color="$neutral700"
|
|
375
373
|
size="medium">
|
|
376
374
|
{i18n.t({
|
|
377
|
-
id: '
|
|
378
|
-
message:
|
|
379
|
-
'You need to connect a {blockchainName} wallet.',
|
|
375
|
+
id: 'You need to connect a {blockchainName} wallet.',
|
|
380
376
|
values: { blockchainName: blockchain?.displayName },
|
|
381
377
|
})}
|
|
382
378
|
</Typography>
|
|
@@ -473,10 +469,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
473
469
|
variant="alarm"
|
|
474
470
|
type="error"
|
|
475
471
|
title={i18n.t({
|
|
476
|
-
id: 'addressMatch',
|
|
477
472
|
values: { destination },
|
|
478
|
-
|
|
479
|
-
"Address {destination} doesn't match the blockchain address pattern.",
|
|
473
|
+
id: "Address {destination} doesn't match the blockchain address pattern.",
|
|
480
474
|
})}
|
|
481
475
|
/>
|
|
482
476
|
</div>
|
|
@@ -52,8 +52,8 @@ export function WalletList(props: PropTypes) {
|
|
|
52
52
|
const [showExperimentalChainModal, setShowExperimentalChainModal] =
|
|
53
53
|
useState(false);
|
|
54
54
|
const [addingExperimentalChainStatus, setAddingExperimentalChainStatus] =
|
|
55
|
-
useState<'in-progress' | 'completed' | null>(null);
|
|
56
|
-
const {
|
|
55
|
+
useState<'in-progress' | 'completed' | 'rejected' | null>(null);
|
|
56
|
+
const { suggestAndConnect } = useWallets();
|
|
57
57
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
58
58
|
const { list, error, handleClick } = useWalletList({
|
|
59
59
|
config,
|
|
@@ -79,8 +79,12 @@ export function WalletList(props: PropTypes) {
|
|
|
79
79
|
const addExperimentalChain = async (wallet: Wallet) => {
|
|
80
80
|
setShowExperimentalChainModal(false);
|
|
81
81
|
setAddingExperimentalChainStatus('in-progress');
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
try {
|
|
83
|
+
await suggestAndConnect(wallet.walletType, wallet.chain);
|
|
84
|
+
setAddingExperimentalChainStatus('completed');
|
|
85
|
+
} catch (e) {
|
|
86
|
+
setAddingExperimentalChainStatus('rejected');
|
|
87
|
+
}
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
useEffect(() => {
|
|
@@ -106,7 +110,10 @@ export function WalletList(props: PropTypes) {
|
|
|
106
110
|
|
|
107
111
|
useEffect(() => {
|
|
108
112
|
let timeout: ReturnType<typeof setTimeout> | null = null;
|
|
109
|
-
if (
|
|
113
|
+
if (
|
|
114
|
+
addingExperimentalChainStatus === 'completed' ||
|
|
115
|
+
addingExperimentalChainStatus === 'rejected'
|
|
116
|
+
) {
|
|
110
117
|
timeout = setTimeout(
|
|
111
118
|
() => setAddingExperimentalChainStatus(null),
|
|
112
119
|
TIME_TO_CLOSE_MODAL
|
|
@@ -145,8 +152,7 @@ export function WalletList(props: PropTypes) {
|
|
|
145
152
|
|
|
146
153
|
const connectedWalletDescription = couldAddExperimentalChain
|
|
147
154
|
? i18n.t({
|
|
148
|
-
id: '
|
|
149
|
-
message: 'Add {chain} chain',
|
|
155
|
+
id: 'Add {chain} chain',
|
|
150
156
|
values: { chain },
|
|
151
157
|
})
|
|
152
158
|
: conciseAddress;
|
|
@@ -195,15 +201,12 @@ export function WalletList(props: PropTypes) {
|
|
|
195
201
|
}}>
|
|
196
202
|
<MessageBox
|
|
197
203
|
title={i18n.t({
|
|
198
|
-
id: '
|
|
199
|
-
message: 'Add {blockchainDisplayName} Chain',
|
|
204
|
+
id: 'Add {blockchainDisplayName} Chain',
|
|
200
205
|
values: { blockchainDisplayName },
|
|
201
206
|
})}
|
|
202
207
|
type="warning"
|
|
203
208
|
description={i18n.t({
|
|
204
|
-
id: '
|
|
205
|
-
message:
|
|
206
|
-
'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
209
|
+
id: 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
207
210
|
values: { blockchainDisplayName },
|
|
208
211
|
})}>
|
|
209
212
|
<Divider size={18} />
|
|
@@ -227,18 +230,15 @@ export function WalletList(props: PropTypes) {
|
|
|
227
230
|
open={!!addingExperimentalChainStatus}
|
|
228
231
|
onClose={setAddingExperimentalChainStatus.bind(null, null)}
|
|
229
232
|
container={modalContainer}>
|
|
230
|
-
{addingExperimentalChainStatus === 'in-progress'
|
|
233
|
+
{addingExperimentalChainStatus === 'in-progress' && (
|
|
231
234
|
<MessageBox
|
|
232
235
|
type="loading"
|
|
233
236
|
title={i18n.t({
|
|
234
|
-
id: '
|
|
235
|
-
message: 'Add {blockchainDisplayName} Chain',
|
|
237
|
+
id: 'Add {blockchainDisplayName} Chain',
|
|
236
238
|
values: { blockchainDisplayName },
|
|
237
239
|
})}
|
|
238
240
|
description={i18n.t({
|
|
239
|
-
id: '
|
|
240
|
-
message:
|
|
241
|
-
'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
241
|
+
id: 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
242
242
|
values: { blockchainDisplayName },
|
|
243
243
|
})}
|
|
244
244
|
icon={
|
|
@@ -250,22 +250,33 @@ export function WalletList(props: PropTypes) {
|
|
|
250
250
|
</LogoContainer>
|
|
251
251
|
}
|
|
252
252
|
/>
|
|
253
|
-
)
|
|
253
|
+
)}
|
|
254
|
+
|
|
255
|
+
{addingExperimentalChainStatus === 'completed' && (
|
|
254
256
|
<MessageBox
|
|
255
257
|
type="success"
|
|
256
258
|
title={i18n.t({
|
|
257
|
-
id: '
|
|
258
|
-
message: '{blockchainDisplayName} Chain Added',
|
|
259
|
+
id: '{blockchainDisplayName} Chain Added',
|
|
259
260
|
values: { blockchainDisplayName },
|
|
260
261
|
})}
|
|
261
262
|
description={i18n.t({
|
|
262
|
-
id: '
|
|
263
|
-
message:
|
|
264
|
-
'{blockchainDisplayName} is added to your wallet, you can use it to swap.',
|
|
263
|
+
id: '{blockchainDisplayName} is added to your wallet, you can use it to swap.',
|
|
265
264
|
values: { blockchainDisplayName },
|
|
266
265
|
})}
|
|
267
266
|
/>
|
|
268
267
|
)}
|
|
268
|
+
|
|
269
|
+
{addingExperimentalChainStatus === 'rejected' && (
|
|
270
|
+
<MessageBox
|
|
271
|
+
type="error"
|
|
272
|
+
title={i18n.t('Request Rejected')}
|
|
273
|
+
description={i18n.t({
|
|
274
|
+
id: "You've rejected adding {blockchainDisplayName} chain to your wallet.",
|
|
275
|
+
values: { blockchainDisplayName },
|
|
276
|
+
})}
|
|
277
|
+
/>
|
|
278
|
+
)}
|
|
279
|
+
|
|
269
280
|
<Divider direction="vertical" size={32} />
|
|
270
281
|
</Modal>
|
|
271
282
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { darkTheme, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
position: 'relative',
|
|
@@ -10,7 +10,11 @@ export const Container = styled('div', {
|
|
|
10
10
|
width: '95vw',
|
|
11
11
|
maxWidth: '390px',
|
|
12
12
|
maxHeight: '700px',
|
|
13
|
-
|
|
13
|
+
$$color: '$colors$neutral100',
|
|
14
|
+
[`.${darkTheme} &`]: {
|
|
15
|
+
$$color: '$colors$neutral300',
|
|
16
|
+
},
|
|
17
|
+
backgroundColor: '$$color',
|
|
14
18
|
variants: {
|
|
15
19
|
fixedHeight: {
|
|
16
20
|
true: {
|
|
@@ -22,6 +26,7 @@ export const Container = styled('div', {
|
|
|
22
26
|
},
|
|
23
27
|
},
|
|
24
28
|
});
|
|
29
|
+
|
|
25
30
|
export const Content = styled('div', {
|
|
26
31
|
borderTopLeftRadius: '20px',
|
|
27
32
|
borderTopRightRadius: '20px',
|
|
@@ -15,7 +15,7 @@ export function makeInfo(
|
|
|
15
15
|
return {
|
|
16
16
|
alert: {
|
|
17
17
|
type: 'warning',
|
|
18
|
-
text: errorMessages.genericServerError,
|
|
18
|
+
text: errorMessages().genericServerError,
|
|
19
19
|
action: {
|
|
20
20
|
onClick: refetchBestRoute,
|
|
21
21
|
title: i18n.t('Retry'),
|
|
@@ -36,17 +36,17 @@ export function makeInfo(
|
|
|
36
36
|
return {
|
|
37
37
|
alert: {
|
|
38
38
|
type: 'warning',
|
|
39
|
-
text: errorMessages.liquiditySourcesError.title,
|
|
39
|
+
text: errorMessages().liquiditySourcesError.title,
|
|
40
40
|
action: {
|
|
41
41
|
onClick: () => toggleAllLiquiditySources(true),
|
|
42
42
|
title: i18n.t('Reset'),
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
-
description: errorMessages.liquiditySourcesError.description,
|
|
45
|
+
description: errorMessages().liquiditySourcesError.description,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
return {
|
|
49
49
|
alert: null,
|
|
50
|
-
description: errorMessages.noRoutesError.description,
|
|
50
|
+
description: errorMessages().noRoutesError.description,
|
|
51
51
|
};
|
|
52
52
|
}
|