@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
|
@@ -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 = () => {
|
|
@@ -1781,9 +1791,9 @@ function Home() {
|
|
|
1781
1791
|
type: "error",
|
|
1782
1792
|
title: `${swap?.swapperId} Limit`
|
|
1783
1793
|
}, React__default.createElement(React__default.Fragment, null, React__default.createElement(ui.Typography, {
|
|
1784
|
-
variant: "
|
|
1794
|
+
variant: "body2"
|
|
1785
1795
|
}, `${fromAmountRangeError}, Yours: ${numberToString(swap?.fromAmount || null)} ${swap?.from.symbol}`), React__default.createElement(ui.Typography, {
|
|
1786
|
-
variant: "
|
|
1796
|
+
variant: "body2"
|
|
1787
1797
|
}, recommendation)))), React__default.createElement(Footer, null, React__default.createElement(ui.Button, {
|
|
1788
1798
|
type: "primary",
|
|
1789
1799
|
align: "grow",
|
|
@@ -2243,8 +2253,8 @@ function BalanceErrors(_ref) {
|
|
|
2243
2253
|
}, messages.map(warning => React__default.createElement(ListItem, {
|
|
2244
2254
|
showListStyle: showListStyle
|
|
2245
2255
|
}, React__default.createElement(Message, {
|
|
2246
|
-
variant: "
|
|
2247
|
-
},
|
|
2256
|
+
variant: "body2"
|
|
2257
|
+
}, warning)))));
|
|
2248
2258
|
}
|
|
2249
2259
|
|
|
2250
2260
|
function ConfirmSwapErrors(errors) {
|
|
@@ -3410,6 +3420,13 @@ const SwapBox = _ref => {
|
|
|
3410
3420
|
const [disconnectedWallet, setDisconnectedWallet] = React.useState();
|
|
3411
3421
|
const currentPage = useUiStore.use.currentPage();
|
|
3412
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]);
|
|
3413
3430
|
const onUpdateState = (type, event, value, state, supportedChains) => {
|
|
3414
3431
|
if (event === walletsCore.Events.ACCOUNTS) {
|
|
3415
3432
|
if (value) {
|