@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.
Files changed (38) hide show
  1. package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.d.ts.map +1 -1
  2. package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.js +85 -70
  3. package/dist/components/widget/TradeOverview/DeltaOrderTradeOverview.js.map +1 -1
  4. package/dist/components/widget/TradeOverview/TradeComplete/utils.d.ts.map +1 -1
  5. package/dist/components/widget/TradeOverview/TradeComplete/utils.js +11 -2
  6. package/dist/components/widget/TradeOverview/TradeComplete/utils.js.map +1 -1
  7. package/dist/components/widget/TradeOverview/utils/useSwapAmountsWithSlippage.d.ts +1 -1
  8. package/dist/components/widget/TradeOverview/utils/useSwapAmountsWithSlippage.d.ts.map +1 -1
  9. package/dist/components/widget/TradeOverview/utils/useSwapAmountsWithSlippage.js.map +1 -1
  10. package/dist/core/index.d.ts +1 -1
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/core/index.js +129 -179
  13. package/dist/core/index.js.map +1 -1
  14. package/dist/core/types.d.ts +0 -2
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/hooks/otc/mutations/useFillOrder.js +14 -3
  17. package/dist/hooks/otc/mutations/useFillOrder.js.map +1 -1
  18. package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js +12 -0
  19. package/dist/hooks/otc/tradeFlow/useFillOtcOrderFlow.js.map +1 -1
  20. package/dist/hooks/swap/prices/usePricesParams.js +5 -0
  21. package/dist/hooks/swap/prices/usePricesParams.js.map +1 -1
  22. package/dist/hooks/swap/tradeFlow/useDeltaFlow.js +2 -2
  23. package/dist/hooks/swap/tradeFlow/useDeltaFlow.js.map +1 -1
  24. package/dist/hooks/useSDK.d.ts.map +1 -1
  25. package/dist/hooks/useSDK.js +19 -32
  26. package/dist/hooks/useSDK.js.map +1 -1
  27. package/dist/lib/utils/index.d.ts +0 -2
  28. package/dist/lib/utils/index.d.ts.map +1 -1
  29. package/dist/lib/utils/index.js +1 -18
  30. package/dist/lib/utils/index.js.map +1 -1
  31. package/dist/lib/web3/privy/config.js +1 -1
  32. package/dist/lib/web3/wagmi/config.js +1 -1
  33. package/dist/styles.css +1 -1
  34. package/package.json +2 -2
  35. package/dist/core/state/apiConfigAtom.d.ts +0 -14
  36. package/dist/core/state/apiConfigAtom.d.ts.map +0 -1
  37. package/dist/core/state/apiConfigAtom.js +0 -20
  38. package/dist/core/state/apiConfigAtom.js.map +0 -1
@@ -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(83);
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
- let t4;
368
- if ($[19] !== apiConfig) {
369
- t4 = apiConfig || {};
370
- $[19] = apiConfig;
371
- $[20] = t4;
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
- t4 = $[20];
371
+ t5 = $[20];
374
372
  }
375
- let t5;
376
- if ($[21] !== t4) {
377
- t5 = [apiConfigAtom, t4];
378
- $[21] = t4;
379
- $[22] = t5;
373
+ let t6;
374
+ if ($[21] !== events) {
375
+ t6 = events || {};
376
+ $[21] = events;
377
+ $[22] = t6;
380
378
  } else {
381
- t5 = $[22];
379
+ t6 = $[22];
382
380
  }
383
- const t6 = provider || null;
384
381
  let t7;
385
382
  if ($[23] !== t6) {
386
- t7 = [externalProviderAtom, t6];
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] !== events) {
394
- t8 = events || {};
395
- $[25] = events;
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 = [widgetEventsAtom, t8];
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] !== formInputProps) {
410
- t10 = formInputProps || {};
411
- $[29] = formInputProps;
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 = [formInputPropsAtom, t10];
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] = t11;
421
- } else {
422
- t11 = $[32];
423
- }
424
- let t12;
425
- if ($[33] !== queryClient) {
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
- t12 = $[34];
424
+ t11 = $[37];
431
425
  }
432
- let t13;
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 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 = () => {
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
- 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 = () => {
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
- 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];
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(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);
490
+ useLayoutEffect(t14, t15);
539
491
  const setExternalProvider = useSetAtom(externalProviderAtom);
540
- let t22;
541
- let t23;
542
- if ($[72] !== provider || $[73] !== setExternalProvider) {
543
- t22 = () => {
492
+ let t16;
493
+ let t17;
494
+ if ($[59] !== provider || $[60] !== setExternalProvider) {
495
+ t16 = () => {
544
496
  setExternalProvider(provider || null);
545
497
  };
546
- t23 = [provider, setExternalProvider];
547
- $[72] = provider;
548
- $[73] = setExternalProvider;
549
- $[74] = t22;
550
- $[75] = t23;
498
+ t17 = [provider, setExternalProvider];
499
+ $[59] = provider;
500
+ $[60] = setExternalProvider;
501
+ $[61] = t16;
502
+ $[62] = t17;
551
503
  } else {
552
- t22 = $[74];
553
- t23 = $[75];
504
+ t16 = $[61];
505
+ t17 = $[62];
554
506
  }
555
- useLayoutEffect(t22, t23);
507
+ useLayoutEffect(t16, t17);
556
508
  const isDappMode = config?.widgetMode === "dapp";
557
509
  const reconnectOnMountInit = useInitialValue(!isDappMode);
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
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
- $[81] = reconnectOnMountInit;
591
- $[82] = t29;
542
+ $[68] = reconnectOnMountInit;
543
+ $[69] = t23;
592
544
  } else {
593
- t29 = $[82];
545
+ t23 = $[69];
594
546
  }
595
- return t29;
547
+ return t23;
596
548
  };
597
549
  const Widget = (t0) => {
598
- const $ = distExports.c(6);
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] !== 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];
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
  };