@rango-dev/widget-embedded 0.1.11-next.19 → 0.1.11-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/lib.d.ts.map +1 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +21 -4
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +21 -4
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +21 -4
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/warnings/BalanceErrors.tsx +1 -1
- package/src/lib.tsx +10 -1
- package/src/pages/Home.tsx +2 -2
- package/src/utils/configs.ts +7 -1
|
@@ -222,6 +222,16 @@ let configs = {
|
|
|
222
222
|
function getConfig(name) {
|
|
223
223
|
return configs[name];
|
|
224
224
|
}
|
|
225
|
+
function initConfig(nextConfigs) {
|
|
226
|
+
let clonedConfigs;
|
|
227
|
+
if (typeof structuredClone === 'function') {
|
|
228
|
+
clonedConfigs = structuredClone(nextConfigs);
|
|
229
|
+
} else {
|
|
230
|
+
clonedConfigs = JSON.parse(JSON.stringify(nextConfigs));
|
|
231
|
+
}
|
|
232
|
+
configs = clonedConfigs;
|
|
233
|
+
return configs;
|
|
234
|
+
}
|
|
225
235
|
|
|
226
236
|
let rango = undefined;
|
|
227
237
|
const httpService = () => {
|
|
@@ -1772,9 +1782,9 @@ function Home() {
|
|
|
1772
1782
|
type: "error",
|
|
1773
1783
|
title: `${swap?.swapperId} Limit`
|
|
1774
1784
|
}, React.createElement(React.Fragment, null, React.createElement(Typography, {
|
|
1775
|
-
variant: "
|
|
1785
|
+
variant: "body2"
|
|
1776
1786
|
}, `${fromAmountRangeError}, Yours: ${numberToString(swap?.fromAmount || null)} ${swap?.from.symbol}`), React.createElement(Typography, {
|
|
1777
|
-
variant: "
|
|
1787
|
+
variant: "body2"
|
|
1778
1788
|
}, recommendation)))), React.createElement(Footer, null, React.createElement(Button, {
|
|
1779
1789
|
type: "primary",
|
|
1780
1790
|
align: "grow",
|
|
@@ -2234,8 +2244,8 @@ function BalanceErrors(_ref) {
|
|
|
2234
2244
|
}, messages.map(warning => React.createElement(ListItem, {
|
|
2235
2245
|
showListStyle: showListStyle
|
|
2236
2246
|
}, React.createElement(Message, {
|
|
2237
|
-
variant: "
|
|
2238
|
-
},
|
|
2247
|
+
variant: "body2"
|
|
2248
|
+
}, warning)))));
|
|
2239
2249
|
}
|
|
2240
2250
|
|
|
2241
2251
|
function ConfirmSwapErrors(errors) {
|
|
@@ -3401,6 +3411,13 @@ const SwapBox = _ref => {
|
|
|
3401
3411
|
const [disconnectedWallet, setDisconnectedWallet] = useState();
|
|
3402
3412
|
const currentPage = useUiStore.use.currentPage();
|
|
3403
3413
|
const evmBasedChainNames = blockchains.filter(isEvmBlockchain$1).map(chain => chain.name);
|
|
3414
|
+
useMemo(() => {
|
|
3415
|
+
if (config?.apiKey) {
|
|
3416
|
+
initConfig({
|
|
3417
|
+
API_KEY: config?.apiKey
|
|
3418
|
+
});
|
|
3419
|
+
}
|
|
3420
|
+
}, [config]);
|
|
3404
3421
|
const onUpdateState = (type, event, value, state, supportedChains) => {
|
|
3405
3422
|
if (event === Events.ACCOUNTS) {
|
|
3406
3423
|
if (value) {
|