@rango-dev/widget-embedded 0.1.11-next.19 → 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/lib.d.ts.map +1 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +17 -0
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +17 -0
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +17 -0
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/lib.tsx +10 -1
- 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 = () => {
|
|
@@ -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) {
|