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