@velora-dex/widget 0.3.6 → 0.3.7-dev.2
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/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +179 -129
- package/dist/core/index.js.map +1 -1
- package/dist/core/state/apiConfigAtom.d.ts +14 -0
- package/dist/core/state/apiConfigAtom.d.ts.map +1 -0
- package/dist/core/state/apiConfigAtom.js +20 -0
- package/dist/core/state/apiConfigAtom.js.map +1 -0
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/hooks/otc/mutations/useFillOrder.js +3 -14
- package/dist/hooks/otc/mutations/useFillOrder.js.map +1 -1
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js +0 -12
- package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js.map +1 -1
- package/dist/hooks/useSDK.d.ts.map +1 -1
- package/dist/hooks/useSDK.js +32 -19
- package/dist/hooks/useSDK.js.map +1 -1
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +18 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/web3/privy/config.js +1 -1
- package/dist/lib/web3/wagmi/config.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WidgetProps } from './types';
|
|
2
|
-
export declare const Widget: ({ config, provider, events, input }: WidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Widget: ({ config, apiConfig, provider, events, input, }: WidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiV3C,eAAO,MAAM,MAAM,GAAI,iDAMpB,WAAW,4CAcb,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -69,6 +69,7 @@ import { isBridgePrice } from '../hooks/swap/prices/delta/queries/useDeltaPriceQ
|
|
|
69
69
|
import { BridgeSelectorExpandable } from '../components/widget/BridgeSelectorExpandable/BridgeSelectorExpandable.js';
|
|
70
70
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
71
71
|
import { useInitialValue } from './screen/hooks/useInitialValue.js';
|
|
72
|
+
import { apiConfigAtom } from './state/apiConfigAtom.js';
|
|
72
73
|
|
|
73
74
|
runSubscriptions();
|
|
74
75
|
const SwapScreen = () => {
|
|
@@ -277,9 +278,10 @@ const App = () => {
|
|
|
277
278
|
return t2;
|
|
278
279
|
};
|
|
279
280
|
const WidgetBase = (t0) => {
|
|
280
|
-
const $ = distExports.c(
|
|
281
|
+
const $ = distExports.c(83);
|
|
281
282
|
const {
|
|
282
283
|
config: _config,
|
|
284
|
+
apiConfig,
|
|
283
285
|
provider,
|
|
284
286
|
events,
|
|
285
287
|
input: formInputProps
|
|
@@ -287,6 +289,7 @@ const WidgetBase = (t0) => {
|
|
|
287
289
|
const queryClient = useQueryClient();
|
|
288
290
|
const setWidgetConfig = useSetAtom(setWidgetConfigAtom);
|
|
289
291
|
const setSubConfig = useSetAtom(setSubConfigAtom);
|
|
292
|
+
const setApiConfig = useSetAtom(apiConfigAtom);
|
|
290
293
|
let t1;
|
|
291
294
|
if ($[0] !== _config) {
|
|
292
295
|
t1 = _config || {};
|
|
@@ -361,75 +364,92 @@ const WidgetBase = (t0) => {
|
|
|
361
364
|
} else {
|
|
362
365
|
t3 = $[18];
|
|
363
366
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
$[
|
|
369
|
-
$[20] = t5;
|
|
367
|
+
let t4;
|
|
368
|
+
if ($[19] !== apiConfig) {
|
|
369
|
+
t4 = apiConfig || {};
|
|
370
|
+
$[19] = apiConfig;
|
|
371
|
+
$[20] = t4;
|
|
370
372
|
} else {
|
|
371
|
-
|
|
373
|
+
t4 = $[20];
|
|
372
374
|
}
|
|
373
|
-
let
|
|
374
|
-
if ($[21] !==
|
|
375
|
-
|
|
376
|
-
$[21] =
|
|
377
|
-
$[22] =
|
|
375
|
+
let t5;
|
|
376
|
+
if ($[21] !== t4) {
|
|
377
|
+
t5 = [apiConfigAtom, t4];
|
|
378
|
+
$[21] = t4;
|
|
379
|
+
$[22] = t5;
|
|
378
380
|
} else {
|
|
379
|
-
|
|
381
|
+
t5 = $[22];
|
|
380
382
|
}
|
|
383
|
+
const t6 = provider || null;
|
|
381
384
|
let t7;
|
|
382
385
|
if ($[23] !== t6) {
|
|
383
|
-
t7 = [
|
|
386
|
+
t7 = [externalProviderAtom, t6];
|
|
384
387
|
$[23] = t6;
|
|
385
388
|
$[24] = t7;
|
|
386
389
|
} else {
|
|
387
390
|
t7 = $[24];
|
|
388
391
|
}
|
|
389
392
|
let t8;
|
|
390
|
-
if ($[25] !==
|
|
391
|
-
t8 =
|
|
392
|
-
$[25] =
|
|
393
|
+
if ($[25] !== events) {
|
|
394
|
+
t8 = events || {};
|
|
395
|
+
$[25] = events;
|
|
393
396
|
$[26] = t8;
|
|
394
397
|
} else {
|
|
395
398
|
t8 = $[26];
|
|
396
399
|
}
|
|
397
400
|
let t9;
|
|
398
401
|
if ($[27] !== t8) {
|
|
399
|
-
t9 = [
|
|
402
|
+
t9 = [widgetEventsAtom, t8];
|
|
400
403
|
$[27] = t8;
|
|
401
404
|
$[28] = t9;
|
|
402
405
|
} else {
|
|
403
406
|
t9 = $[28];
|
|
404
407
|
}
|
|
405
408
|
let t10;
|
|
406
|
-
if ($[29] !==
|
|
407
|
-
t10 =
|
|
408
|
-
$[29] =
|
|
409
|
+
if ($[29] !== formInputProps) {
|
|
410
|
+
t10 = formInputProps || {};
|
|
411
|
+
$[29] = formInputProps;
|
|
409
412
|
$[30] = t10;
|
|
410
413
|
} else {
|
|
411
414
|
t10 = $[30];
|
|
412
415
|
}
|
|
413
416
|
let t11;
|
|
414
|
-
if ($[31] !== t10
|
|
415
|
-
t11 = [
|
|
417
|
+
if ($[31] !== t10) {
|
|
418
|
+
t11 = [formInputPropsAtom, t10];
|
|
416
419
|
$[31] = t10;
|
|
417
|
-
$[32] =
|
|
418
|
-
$[33] = t3;
|
|
419
|
-
$[34] = t5;
|
|
420
|
-
$[35] = t7;
|
|
421
|
-
$[36] = t9;
|
|
422
|
-
$[37] = t11;
|
|
420
|
+
$[32] = t11;
|
|
423
421
|
} else {
|
|
424
|
-
t11 = $[
|
|
422
|
+
t11 = $[32];
|
|
425
423
|
}
|
|
426
|
-
useHydrateAtoms(t11);
|
|
427
|
-
useWidgetEventsSetter(events);
|
|
428
|
-
useSetFormInputFromProps(formInputProps);
|
|
429
424
|
let t12;
|
|
425
|
+
if ($[33] !== queryClient) {
|
|
426
|
+
t12 = [queryClientAtom, queryClient];
|
|
427
|
+
$[33] = queryClient;
|
|
428
|
+
$[34] = t12;
|
|
429
|
+
} else {
|
|
430
|
+
t12 = $[34];
|
|
431
|
+
}
|
|
430
432
|
let t13;
|
|
431
|
-
if ($[
|
|
432
|
-
|
|
433
|
+
if ($[35] !== t11 || $[36] !== t12 || $[37] !== t2 || $[38] !== t3 || $[39] !== t5 || $[40] !== t7 || $[41] !== t9) {
|
|
434
|
+
t13 = [t2, t3, t5, t7, t9, t11, t12];
|
|
435
|
+
$[35] = t11;
|
|
436
|
+
$[36] = t12;
|
|
437
|
+
$[37] = t2;
|
|
438
|
+
$[38] = t3;
|
|
439
|
+
$[39] = t5;
|
|
440
|
+
$[40] = t7;
|
|
441
|
+
$[41] = t9;
|
|
442
|
+
$[42] = t13;
|
|
443
|
+
} else {
|
|
444
|
+
t13 = $[42];
|
|
445
|
+
}
|
|
446
|
+
useHydrateAtoms(t13);
|
|
447
|
+
useWidgetEventsSetter(events);
|
|
448
|
+
useSetFormInputFromProps(formInputProps);
|
|
449
|
+
let t14;
|
|
450
|
+
let t15;
|
|
451
|
+
if ($[43] !== config.debug || $[44] !== config.enableCrossChain || $[45] !== config.enableDelta || $[46] !== config.ignoreBadUsdPrice || $[47] !== config.partner || $[48] !== config.privyAppId || $[49] !== config.privyClientId || $[50] !== config.theme || $[51] !== config.widgetMode || $[52] !== setWidgetConfig) {
|
|
452
|
+
t14 = () => {
|
|
433
453
|
setWidgetConfig({
|
|
434
454
|
theme: config.theme,
|
|
435
455
|
enableDelta: config.enableDelta,
|
|
@@ -442,28 +462,28 @@ const WidgetBase = (t0) => {
|
|
|
442
462
|
ignoreBadUsdPrice: config.ignoreBadUsdPrice
|
|
443
463
|
});
|
|
444
464
|
};
|
|
445
|
-
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
} else {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
useLayoutEffect(
|
|
463
|
-
let
|
|
464
|
-
let
|
|
465
|
-
if ($[
|
|
466
|
-
|
|
465
|
+
t15 = [config.theme, config.enableDelta, config.enableCrossChain, config.partner, config.privyAppId, config.privyClientId, config.debug, config.widgetMode, config.ignoreBadUsdPrice, setWidgetConfig];
|
|
466
|
+
$[43] = config.debug;
|
|
467
|
+
$[44] = config.enableCrossChain;
|
|
468
|
+
$[45] = config.enableDelta;
|
|
469
|
+
$[46] = config.ignoreBadUsdPrice;
|
|
470
|
+
$[47] = config.partner;
|
|
471
|
+
$[48] = config.privyAppId;
|
|
472
|
+
$[49] = config.privyClientId;
|
|
473
|
+
$[50] = config.theme;
|
|
474
|
+
$[51] = config.widgetMode;
|
|
475
|
+
$[52] = setWidgetConfig;
|
|
476
|
+
$[53] = t14;
|
|
477
|
+
$[54] = t15;
|
|
478
|
+
} else {
|
|
479
|
+
t14 = $[53];
|
|
480
|
+
t15 = $[54];
|
|
481
|
+
}
|
|
482
|
+
useLayoutEffect(t14, t15);
|
|
483
|
+
let t16;
|
|
484
|
+
let t17;
|
|
485
|
+
if ($[55] !== destChains || $[56] !== devURLs || $[57] !== excludeUI || $[58] !== setSubConfig || $[59] !== srcChains || $[60] !== tokenLists || $[61] !== tradeModes) {
|
|
486
|
+
t16 = () => {
|
|
467
487
|
setSubConfig({
|
|
468
488
|
srcChains,
|
|
469
489
|
destChains,
|
|
@@ -473,97 +493,127 @@ const WidgetBase = (t0) => {
|
|
|
473
493
|
devURLs
|
|
474
494
|
});
|
|
475
495
|
};
|
|
476
|
-
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
} else {
|
|
487
|
-
|
|
488
|
-
|
|
496
|
+
t17 = [srcChains, destChains, tokenLists, setSubConfig, tradeModes, excludeUI, devURLs];
|
|
497
|
+
$[55] = destChains;
|
|
498
|
+
$[56] = devURLs;
|
|
499
|
+
$[57] = excludeUI;
|
|
500
|
+
$[58] = setSubConfig;
|
|
501
|
+
$[59] = srcChains;
|
|
502
|
+
$[60] = tokenLists;
|
|
503
|
+
$[61] = tradeModes;
|
|
504
|
+
$[62] = t16;
|
|
505
|
+
$[63] = t17;
|
|
506
|
+
} else {
|
|
507
|
+
t16 = $[62];
|
|
508
|
+
t17 = $[63];
|
|
489
509
|
}
|
|
490
|
-
useLayoutEffect(
|
|
510
|
+
useLayoutEffect(t16, t17);
|
|
511
|
+
let t18;
|
|
512
|
+
if ($[64] !== apiConfig?.apiKey || $[65] !== apiConfig?.headers || $[66] !== setApiConfig) {
|
|
513
|
+
t18 = () => {
|
|
514
|
+
setApiConfig({
|
|
515
|
+
apiKey: apiConfig?.apiKey,
|
|
516
|
+
headers: apiConfig?.headers
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
$[64] = apiConfig?.apiKey;
|
|
520
|
+
$[65] = apiConfig?.headers;
|
|
521
|
+
$[66] = setApiConfig;
|
|
522
|
+
$[67] = t18;
|
|
523
|
+
} else {
|
|
524
|
+
t18 = $[67];
|
|
525
|
+
}
|
|
526
|
+
const t19 = apiConfig?.apiKey;
|
|
527
|
+
const t20 = apiConfig?.headers;
|
|
528
|
+
let t21;
|
|
529
|
+
if ($[68] !== setApiConfig || $[69] !== t19 || $[70] !== t20) {
|
|
530
|
+
t21 = [t19, t20, setApiConfig];
|
|
531
|
+
$[68] = setApiConfig;
|
|
532
|
+
$[69] = t19;
|
|
533
|
+
$[70] = t20;
|
|
534
|
+
$[71] = t21;
|
|
535
|
+
} else {
|
|
536
|
+
t21 = $[71];
|
|
537
|
+
}
|
|
538
|
+
useLayoutEffect(t18, t21);
|
|
491
539
|
const setExternalProvider = useSetAtom(externalProviderAtom);
|
|
492
|
-
let
|
|
493
|
-
let
|
|
494
|
-
if ($[
|
|
495
|
-
|
|
540
|
+
let t22;
|
|
541
|
+
let t23;
|
|
542
|
+
if ($[72] !== provider || $[73] !== setExternalProvider) {
|
|
543
|
+
t22 = () => {
|
|
496
544
|
setExternalProvider(provider || null);
|
|
497
545
|
};
|
|
498
|
-
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
546
|
+
t23 = [provider, setExternalProvider];
|
|
547
|
+
$[72] = provider;
|
|
548
|
+
$[73] = setExternalProvider;
|
|
549
|
+
$[74] = t22;
|
|
550
|
+
$[75] = t23;
|
|
503
551
|
} else {
|
|
504
|
-
|
|
505
|
-
|
|
552
|
+
t22 = $[74];
|
|
553
|
+
t23 = $[75];
|
|
506
554
|
}
|
|
507
|
-
useLayoutEffect(
|
|
555
|
+
useLayoutEffect(t22, t23);
|
|
508
556
|
const isDappMode = config?.widgetMode === "dapp";
|
|
509
557
|
const reconnectOnMountInit = useInitialValue(!isDappMode);
|
|
510
|
-
let
|
|
511
|
-
let
|
|
512
|
-
let
|
|
513
|
-
let
|
|
514
|
-
let
|
|
515
|
-
if ($[
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
$[
|
|
522
|
-
$[
|
|
523
|
-
$[
|
|
524
|
-
$[
|
|
525
|
-
$[
|
|
526
|
-
} else {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
let
|
|
534
|
-
if ($[
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
558
|
+
let t24;
|
|
559
|
+
let t25;
|
|
560
|
+
let t26;
|
|
561
|
+
let t27;
|
|
562
|
+
let t28;
|
|
563
|
+
if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
|
|
564
|
+
t24 = /* @__PURE__ */ jsx(AutoconnectExternalProvider, {});
|
|
565
|
+
t25 = /* @__PURE__ */ jsx(PrivyIframeDependency, {});
|
|
566
|
+
t26 = /* @__PURE__ */ jsx(Updaters, {});
|
|
567
|
+
t27 = /* @__PURE__ */ jsx(App, {});
|
|
568
|
+
t28 = false;
|
|
569
|
+
$[76] = t24;
|
|
570
|
+
$[77] = t25;
|
|
571
|
+
$[78] = t26;
|
|
572
|
+
$[79] = t27;
|
|
573
|
+
$[80] = t28;
|
|
574
|
+
} else {
|
|
575
|
+
t24 = $[76];
|
|
576
|
+
t25 = $[77];
|
|
577
|
+
t26 = $[78];
|
|
578
|
+
t27 = $[79];
|
|
579
|
+
t28 = $[80];
|
|
580
|
+
}
|
|
581
|
+
let t29;
|
|
582
|
+
if ($[81] !== reconnectOnMountInit) {
|
|
583
|
+
t29 = /* @__PURE__ */ jsxs(Web3Providers, { reconnectOnMount: reconnectOnMountInit, children: [
|
|
584
|
+
t24,
|
|
585
|
+
t25,
|
|
586
|
+
t26,
|
|
587
|
+
t27,
|
|
588
|
+
t28
|
|
541
589
|
] });
|
|
542
|
-
$[
|
|
543
|
-
$[
|
|
590
|
+
$[81] = reconnectOnMountInit;
|
|
591
|
+
$[82] = t29;
|
|
544
592
|
} else {
|
|
545
|
-
|
|
593
|
+
t29 = $[82];
|
|
546
594
|
}
|
|
547
|
-
return
|
|
595
|
+
return t29;
|
|
548
596
|
};
|
|
549
597
|
const Widget = (t0) => {
|
|
550
|
-
const $ = distExports.c(
|
|
598
|
+
const $ = distExports.c(6);
|
|
551
599
|
const {
|
|
552
600
|
config,
|
|
601
|
+
apiConfig,
|
|
553
602
|
provider,
|
|
554
603
|
events,
|
|
555
604
|
input
|
|
556
605
|
} = t0;
|
|
557
606
|
let t1;
|
|
558
|
-
if ($[0] !==
|
|
559
|
-
t1 = /* @__PURE__ */ jsx(JotaiProvider, { children: /* @__PURE__ */ jsx(QueryClientProvider, { children: /* @__PURE__ */ jsx(WidgetBase, { config, provider, events, input }) }) });
|
|
560
|
-
$[0] =
|
|
561
|
-
$[1] =
|
|
562
|
-
$[2] =
|
|
563
|
-
$[3] =
|
|
564
|
-
$[4] =
|
|
565
|
-
|
|
566
|
-
|
|
607
|
+
if ($[0] !== apiConfig || $[1] !== config || $[2] !== events || $[3] !== input || $[4] !== provider) {
|
|
608
|
+
t1 = /* @__PURE__ */ jsx(JotaiProvider, { children: /* @__PURE__ */ jsx(QueryClientProvider, { children: /* @__PURE__ */ jsx(WidgetBase, { config, apiConfig, provider, events, input }) }) });
|
|
609
|
+
$[0] = apiConfig;
|
|
610
|
+
$[1] = config;
|
|
611
|
+
$[2] = events;
|
|
612
|
+
$[3] = input;
|
|
613
|
+
$[4] = provider;
|
|
614
|
+
$[5] = t1;
|
|
615
|
+
} else {
|
|
616
|
+
t1 = $[5];
|
|
567
617
|
}
|
|
568
618
|
return t1;
|
|
569
619
|
};
|