@rango-dev/widget-embedded 0.1.11-next.17 → 0.1.11-next.20
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/components/SwapDetailsPlaceholder.d.ts +1 -0
- package/dist/components/SwapDetailsPlaceholder.d.ts.map +1 -1
- package/dist/components/TokenInfo.d.ts.map +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +0 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +30 -8
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +30 -8
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +30 -8
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/app.css +0 -9
- package/src/components/SwapDetailsPlaceholder.tsx +8 -1
- package/src/components/TokenInfo.tsx +1 -0
- package/src/lib.tsx +10 -1
- package/src/pages/HistoryPage.tsx +4 -1
- package/src/pages/Home.tsx +3 -2
- package/src/pages/SwapDetailsPage.tsx +2 -9
- package/src/pages/WalletsPage.tsx +2 -2
- package/src/utils/configs.ts +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapDetailsPlaceholder.d.ts","sourceRoot":"","sources":["../src/components/SwapDetailsPlaceholder.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SwapDetailsPlaceholder.d.ts","sourceRoot":"","sources":["../src/components/SwapDetailsPlaceholder.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,eAAe,KAM1B,CAAC;AAEH,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,eAmBtD"}
|
|
@@ -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;AA0F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,
|
|
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;AA0F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,eAwMzC"}
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAgB5D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,QAAQ,CAAC;AAMhB,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkHzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../src/pages/HistoryPage.tsx"],"names":[],"mappings":";AAUA,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../src/pages/HistoryPage.tsx"],"names":[],"mappings":";AAUA,wBAAgB,WAAW,gBAqB1B"}
|
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,gBA6JnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":";AAgCA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":";AAgCA,wBAAgB,eAAe,gBA8H9B"}
|
|
@@ -4,7 +4,6 @@ interface PropTypes {
|
|
|
4
4
|
supportedWallets?: WalletType[];
|
|
5
5
|
multiWallets: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const LoaderContainer: any;
|
|
8
7
|
export declare function WalletsPage({ supportedWallets, multiWallets }: PropTypes): JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=WalletsPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/WalletsPage.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAuB,MAAM,2BAA2B,CAAC;AAW5E,UAAU,SAAS;IACjB,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/WalletsPage.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAuB,MAAM,2BAA2B,CAAC;AAW5E,UAAU,SAAS;IACjB,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;CACvB;AAsBD,wBAAgB,WAAW,CAAC,EAAE,gBAAgB,EAAE,YAAY,EAAE,EAAE,SAAS,eA2FxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/utils/configs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/utils/configs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C"}
|
|
@@ -231,6 +231,16 @@ let configs = {
|
|
|
231
231
|
function getConfig(name) {
|
|
232
232
|
return configs[name];
|
|
233
233
|
}
|
|
234
|
+
function initConfig(nextConfigs) {
|
|
235
|
+
let clonedConfigs;
|
|
236
|
+
if (typeof structuredClone === 'function') {
|
|
237
|
+
clonedConfigs = structuredClone(nextConfigs);
|
|
238
|
+
} else {
|
|
239
|
+
clonedConfigs = JSON.parse(JSON.stringify(nextConfigs));
|
|
240
|
+
}
|
|
241
|
+
configs = clonedConfigs;
|
|
242
|
+
return configs;
|
|
243
|
+
}
|
|
234
244
|
|
|
235
245
|
let rango = undefined;
|
|
236
246
|
const httpService = () => {
|
|
@@ -1544,6 +1554,7 @@ function TokenInfo(props) {
|
|
|
1544
1554
|
color: "neutrals800"
|
|
1545
1555
|
}, `$${numberToString(inputUsdValue)}`)),
|
|
1546
1556
|
value: props.inputAmount || '',
|
|
1557
|
+
min: 0,
|
|
1547
1558
|
onChange: props.type === 'From' ? event => {
|
|
1548
1559
|
props.onAmountChange(event.target.value);
|
|
1549
1560
|
} : undefined
|
|
@@ -1781,7 +1792,7 @@ function Home() {
|
|
|
1781
1792
|
title: `${swap?.swapperId} Limit`
|
|
1782
1793
|
}, React__default.createElement(React__default.Fragment, null, React__default.createElement(ui.Typography, {
|
|
1783
1794
|
variant: "body3"
|
|
1784
|
-
}, fromAmountRangeError,
|
|
1795
|
+
}, `${fromAmountRangeError}, Yours: ${numberToString(swap?.fromAmount || null)} ${swap?.from.symbol}`), React__default.createElement(ui.Typography, {
|
|
1785
1796
|
variant: "body3"
|
|
1786
1797
|
}, recommendation)))), React__default.createElement(Footer, null, React__default.createElement(ui.Button, {
|
|
1787
1798
|
type: "primary",
|
|
@@ -2486,9 +2497,11 @@ function HistoryPage() {
|
|
|
2486
2497
|
} = _ref;
|
|
2487
2498
|
return swap;
|
|
2488
2499
|
});
|
|
2500
|
+
const loading = !manager?.isLoaded();
|
|
2489
2501
|
return React__default.createElement(ui.History, {
|
|
2490
2502
|
list: pendingSwaps,
|
|
2491
2503
|
groupBy: groupSwapsByDate,
|
|
2504
|
+
loading: loading,
|
|
2492
2505
|
onSwapClick: requestId => {
|
|
2493
2506
|
setSelectedSwap(requestId);
|
|
2494
2507
|
navigate(navigationRoutes.swaps + `/${requestId}`, {
|
|
@@ -2799,6 +2812,13 @@ function getSwapDate(pendingSwap) {
|
|
|
2799
2812
|
const PlaceholderContainer = /*#__PURE__*/ui.styled('div', {
|
|
2800
2813
|
height: '450px'
|
|
2801
2814
|
});
|
|
2815
|
+
const LoaderContainer$1 = /*#__PURE__*/ui.styled('div', {
|
|
2816
|
+
display: 'flex',
|
|
2817
|
+
justifyContent: 'center',
|
|
2818
|
+
width: '100%',
|
|
2819
|
+
paddingTop: '33%',
|
|
2820
|
+
flex: 1
|
|
2821
|
+
});
|
|
2802
2822
|
function SwapDetailsPlaceholder(props) {
|
|
2803
2823
|
const {
|
|
2804
2824
|
requestId,
|
|
@@ -2809,7 +2829,7 @@ function SwapDetailsPlaceholder(props) {
|
|
|
2809
2829
|
title: "Swap Details",
|
|
2810
2830
|
textField: false,
|
|
2811
2831
|
onBack: onBack
|
|
2812
|
-
}, React__default.createElement(PlaceholderContainer, null, loading ? React__default.createElement(LoaderContainer, null, React__default.createElement(ui.Spinner, {
|
|
2832
|
+
}, React__default.createElement(PlaceholderContainer, null, loading ? React__default.createElement(LoaderContainer$1, null, React__default.createElement(ui.Spinner, {
|
|
2813
2833
|
size: 24
|
|
2814
2834
|
})) : React__default.createElement(ui.Alert, {
|
|
2815
2835
|
type: "secondary",
|
|
@@ -2832,12 +2852,6 @@ function SwapDetailsPage() {
|
|
|
2832
2852
|
const {
|
|
2833
2853
|
manager
|
|
2834
2854
|
} = queueManagerReact.useManager();
|
|
2835
|
-
const [loading, setLoading] = React.useState(true);
|
|
2836
|
-
React.useEffect(() => {
|
|
2837
|
-
setTimeout(() => {
|
|
2838
|
-
setLoading(false);
|
|
2839
|
-
}, 5000);
|
|
2840
|
-
}, []);
|
|
2841
2855
|
const pendingSwaps = getPendingSwaps(manager);
|
|
2842
2856
|
const selectedSwap = pendingSwaps.find(_ref => {
|
|
2843
2857
|
let {
|
|
@@ -2850,6 +2864,7 @@ function SwapDetailsPage() {
|
|
|
2850
2864
|
if (swap) queueManagerRangoPreset.cancelSwap(swap);
|
|
2851
2865
|
};
|
|
2852
2866
|
const swap = selectedSwap?.swap;
|
|
2867
|
+
const loading = !manager?.isLoaded();
|
|
2853
2868
|
if (!swap) return React__default.createElement(SwapDetailsPlaceholder, {
|
|
2854
2869
|
requestId: selectedSwapRequestId || '',
|
|
2855
2870
|
loading: loading,
|
|
@@ -3405,6 +3420,13 @@ const SwapBox = _ref => {
|
|
|
3405
3420
|
const [disconnectedWallet, setDisconnectedWallet] = React.useState();
|
|
3406
3421
|
const currentPage = useUiStore.use.currentPage();
|
|
3407
3422
|
const evmBasedChainNames = blockchains.filter(rangoSdk.isEvmBlockchain).map(chain => chain.name);
|
|
3423
|
+
React.useMemo(() => {
|
|
3424
|
+
if (config?.apiKey) {
|
|
3425
|
+
initConfig({
|
|
3426
|
+
API_KEY: config?.apiKey
|
|
3427
|
+
});
|
|
3428
|
+
}
|
|
3429
|
+
}, [config]);
|
|
3408
3430
|
const onUpdateState = (type, event, value, state, supportedChains) => {
|
|
3409
3431
|
if (event === walletsCore.Events.ACCOUNTS) {
|
|
3410
3432
|
if (value) {
|