@rango-dev/widget-embedded 0.14.1-next.2 → 0.14.1-next.21
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/Widget.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +8 -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 +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +60 -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 +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +16 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +12 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +4 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +12 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +12 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +16 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +16 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +16 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +16 -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 +24 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +16 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +40 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +16 -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/fonts.d.ts +2 -0
- package/dist/constants/fonts.d.ts.map +1 -0
- package/dist/{constants.d.ts → constants/index.d.ts} +1 -1
- package/dist/constants/index.d.ts.map +1 -0
- 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 +2 -2
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.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/bestRoute.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 +11 -13
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +11 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/common.d.ts +0 -4
- package/dist/utils/common.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/meta.d.ts +3 -1
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +8 -1
- package/dist/utils/routing.d.ts.map +1 -1
- 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 +6 -6
- package/src/Widget.tsx +15 -3
- 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 +2 -2
- package/src/constants/configs.ts +1 -0
- package/src/constants/errors.ts +44 -41
- package/src/constants/fonts.ts +1 -0
- 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 +44 -26
- package/src/index.ts +33 -26
- 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/bestRoute.ts +12 -38
- package/src/store/settings.ts +46 -4
- package/src/types/config.ts +10 -12
- package/src/utils/colors.ts +109 -0
- package/src/utils/common.ts +0 -49
- package/src/utils/configs.ts +3 -0
- package/src/utils/hash.ts +27 -0
- package/src/utils/meta.ts +11 -1
- package/src/utils/routing.ts +58 -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/constants.d.ts.map +0 -1
- package/dist/hooks/usePrepareBlockchainList.d.ts.map +0 -1
- package/src/hooks/usePrepareBlockchainList.ts +0 -125
- /package/src/{constants.ts → constants/index.ts} +0 -0
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../../src/store/bestRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../../src/store/bestRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,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AK,IAAI;uCAChC,cAAc,GAAG,IAAI,KAAK,IAAI;oCAEjC,KAAK,GAAG,IAAI,KAAK,IAAI;kCACvB,KAAK,GAAG,IAAI,KAAK,IAAI;uCAChB,MAAM,KAAK,IAAI;;oCAElB,iBAAiB,GAAG,IAAI,KAAK,IAAI;mCAClC,WAAW,KAAK,IAAI;qCAClB,IAAI;8CACK,OAAO,KAAK,IAAI;4CAClB,MAAM,EAAE,KAAK,IAAI;;8CAEf,MAAM,KAAK,IAAI;uCACtB,IAAI;;CA4L9B,CAAC"}
|
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":"","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AC,gBAAgB,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,mBAAmB,EAAE,CACnB,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,KAC/C,IAAI,CAAC;IACV,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAfH,MAAM,KAAK,IAAI;kDACH,MAAM,GAAG,IAAI,KAAK,IAAI;2CAC7B,IAAI;4CACH,MAAM,KAAK,IAAI;gCAC3B,SAAS,KAAK,IAAI;sCACZ,QAAQ,KAAK,IAAI;wDACC,OAAO,KAAK,IAAI;8CAC1B,MAAM,GAAG,IAAI,KAAK,IAAI;sDACd,MAAM,GAAG,IAAI,KAAK,IAAI;;;qBAGzD,IAAI;mDAC4B,MAAM,KAAK,IAAI;;CAsHrD,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -7,22 +7,17 @@ import type { Asset } from 'rango-sdk';
|
|
|
7
7
|
* @property {string} background
|
|
8
8
|
* @property {string} foreground
|
|
9
9
|
* @property {string} primary
|
|
10
|
-
* @property {string}
|
|
11
|
-
* @property {string} error
|
|
12
|
-
* @property {string} warning
|
|
13
|
-
* @property {string} surface
|
|
14
|
-
* @property {string} neutral
|
|
10
|
+
* @property {string} secondary
|
|
15
11
|
*
|
|
16
12
|
*/
|
|
13
|
+
export type WidgetColorsKeys = keyof WidgetColors;
|
|
17
14
|
export type WidgetColors = {
|
|
18
15
|
background?: string;
|
|
19
16
|
foreground?: string;
|
|
20
|
-
primary?: string;
|
|
21
|
-
success?: string;
|
|
22
|
-
error?: string;
|
|
23
|
-
warning?: string;
|
|
24
|
-
surface?: string;
|
|
25
17
|
neutral?: string;
|
|
18
|
+
primary?: string;
|
|
19
|
+
secondary?: string;
|
|
20
|
+
info?: string;
|
|
26
21
|
};
|
|
27
22
|
/**
|
|
28
23
|
* The `WidgetTheme` defines the properties of a widget theme, including mode, font family, colors, border
|
|
@@ -30,7 +25,7 @@ export type WidgetColors = {
|
|
|
30
25
|
* @property {'auto' | 'light' | 'dark'} mode - The mode property is used to specify the default theme for
|
|
31
26
|
* the widget.
|
|
32
27
|
* @property {string} fontFamily - The font family to be used in the widget.
|
|
33
|
-
* @property {
|
|
28
|
+
* @property {{ light?: WidgetColors; dark?: WidgetColors }} colors - The `colors` property is a sub-property of the `WidgetTheme` object that
|
|
34
29
|
* defines the color scheme for the widget. It is of type `Colors`, which is likely another object that
|
|
35
30
|
* contains specific color values for various parts of the widget (e.g. background color, text color,
|
|
36
31
|
* border color
|
|
@@ -46,8 +41,8 @@ export type WidgetTheme = {
|
|
|
46
41
|
mode?: 'auto' | 'light' | 'dark';
|
|
47
42
|
fontFamily?: string;
|
|
48
43
|
colors?: {
|
|
49
|
-
light
|
|
50
|
-
dark
|
|
44
|
+
light?: WidgetColors;
|
|
45
|
+
dark?: WidgetColors;
|
|
51
46
|
};
|
|
52
47
|
borderRadius?: number;
|
|
53
48
|
secondaryBorderRadius?: number;
|
|
@@ -126,6 +121,8 @@ export type BlockchainAndTokenConfig = {
|
|
|
126
121
|
* If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
|
|
127
122
|
* @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
|
|
128
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.
|
|
129
126
|
*/
|
|
130
127
|
export type WidgetConfig = {
|
|
131
128
|
apiKey: string;
|
|
@@ -142,5 +139,6 @@ export type WidgetConfig = {
|
|
|
142
139
|
theme?: WidgetTheme;
|
|
143
140
|
externalWallets?: boolean;
|
|
144
141
|
pinnedTokens?: Asset[];
|
|
142
|
+
includeNewLiquiditySources?: boolean;
|
|
145
143
|
};
|
|
146
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
|
|
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;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC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,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WidgetColors } from '../types';
|
|
2
|
+
export declare const colorShade: (col: string, amt: number) => string;
|
|
3
|
+
export declare const generateRangeColors: (name: string, color: string) => {
|
|
4
|
+
[x: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const generateColors: (mainColors: {
|
|
7
|
+
[x: string]: string;
|
|
8
|
+
}, reverseNeutralRange: boolean, colors?: WidgetColors) => {
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +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;;wBAEJ,OAAO,WACnB,YAAY;;CAyCtB,CAAC"}
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -2,9 +2,5 @@ export declare function removeDuplicateFrom<T>(array: T[]): T[];
|
|
|
2
2
|
export declare function areEqual(array1: (number | string)[], array2: (number | string)[]): boolean;
|
|
3
3
|
export declare function debounce(fn: Function, time: number): (...args: any) => void;
|
|
4
4
|
export declare function containsText(text: string, searchText: string): boolean;
|
|
5
|
-
export declare const colorShade: (col: string, amt: number) => string;
|
|
6
|
-
export declare const generateRangeColors: (name: string, color: string) => {
|
|
7
|
-
[x: string]: string;
|
|
8
|
-
};
|
|
9
5
|
export declare const getContainer: () => HTMLElement;
|
|
10
6
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"
|
|
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;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAGvB,GAAG,UAS9B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED,eAAO,MAAM,YAAY,mBAC2B,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/meta.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { BlockchainMeta } from 'rango-sdk';
|
|
1
|
+
import type { Asset, BlockchainMeta, Token } from 'rango-sdk';
|
|
2
2
|
export declare function getBlockchainDisplayNameFor(blockchainName: string, blockchains: BlockchainMeta[]): string | undefined;
|
|
3
3
|
export declare function getBlockchainShortNameFor(blockchainName: string, blockchains: BlockchainMeta[]): string | undefined;
|
|
4
|
+
export declare function findToken(t: Asset, tokens: Token[]): Token | null;
|
|
5
|
+
export declare function findBlockchain(name: string, blockchains: BlockchainMeta[]): BlockchainMeta | null;
|
|
4
6
|
//# sourceMappingURL=meta.d.ts.map
|
package/dist/utils/meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utils/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utils/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAI9D,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,cAAc,EAAE,GAC5B,MAAM,GAAG,SAAS,CAGpB;AACD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,cAAc,EAAE,GAC5B,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAElD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,yBAEzE"}
|
package/dist/utils/routing.d.ts
CHANGED
|
@@ -15,7 +15,14 @@ export declare function getRequiredBalanceOfWallet(selectedWallet: Wallet, fee:
|
|
|
15
15
|
export declare function isRouteParametersChanged(params: BestRouteEqualityParams): boolean | undefined;
|
|
16
16
|
export declare function getFormattedBestRoute(bestRoute: BestRouteResponse | null): BestRouteResponse | null;
|
|
17
17
|
export declare function getFormattedPendingSwap(pendingSwap: PendingSwap): PendingSwap;
|
|
18
|
-
export declare const getBestRouteStatus: (loading: boolean, error: boolean) => "
|
|
18
|
+
export declare const getBestRouteStatus: (loading: boolean, error: boolean) => "loading" | "success" | "failed";
|
|
19
19
|
export declare function getPriceImpactLevel(priceImpact: number): PriceImpactWarningLevel;
|
|
20
20
|
export declare function findCommonTokens<T extends Asset[], R extends Asset[]>(listA: T, listB: R): R;
|
|
21
|
+
export declare function createRetryRoute(pendingSwap: PendingSwap, blockchains: BlockchainMeta[], tokens: Token[]): {
|
|
22
|
+
fromBlockchain: BlockchainMeta | null;
|
|
23
|
+
fromToken: Token | null;
|
|
24
|
+
toBlockchain: BlockchainMeta | null;
|
|
25
|
+
toToken: Token | null;
|
|
26
|
+
inputAmount: string;
|
|
27
|
+
};
|
|
21
28
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/utils/routing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACN,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/utils/routing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACN,MAAM,W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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,GAAG,YAAY,CA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AAK,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.14.1-next.
|
|
3
|
+
"version": "0.14.1-next.21",
|
|
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.17.
|
|
22
|
+
"@rango-dev/provider-all": "^0.17.1-next.4",
|
|
23
23
|
"@rango-dev/queue-manager-core": "^0.17.0",
|
|
24
|
-
"@rango-dev/queue-manager-rango-preset": "^0.17.
|
|
24
|
+
"@rango-dev/queue-manager-rango-preset": "^0.17.1-next.3",
|
|
25
25
|
"@rango-dev/queue-manager-react": "^0.17.0",
|
|
26
|
-
"@rango-dev/ui": "^0.17.1-next.
|
|
27
|
-
"@rango-dev/wallets-react": "^0.3.
|
|
28
|
-
"@rango-dev/wallets-shared": "^0.17.
|
|
26
|
+
"@rango-dev/ui": "^0.17.1-next.13",
|
|
27
|
+
"@rango-dev/wallets-react": "^0.3.1-next.2",
|
|
28
|
+
"@rango-dev/wallets-shared": "^0.17.1-next.1",
|
|
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';
|
|
@@ -29,7 +31,7 @@ const MainContainer = styled('div', {
|
|
|
29
31
|
listStyleType: 'none',
|
|
30
32
|
},
|
|
31
33
|
'& *:focus-visible': {
|
|
32
|
-
|
|
34
|
+
outlineColor: '$info500',
|
|
33
35
|
transition: 'none',
|
|
34
36
|
},
|
|
35
37
|
});
|
|
@@ -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>
|