@avail-project/widgets 2.0.0 → 2.0.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/common/hooks/useNexusError.d.ts +1 -1
- package/dist/common/utils/token-pricing.d.ts +1 -1
- package/dist/common/utils/token-pricing.d.ts.map +1 -1
- package/dist/common/utils/token-pricing.js +4 -1
- package/dist/nexus/NexusProvider.d.ts +4 -2
- package/dist/nexus/NexusProvider.d.ts.map +1 -1
- package/dist/nexus/NexusProvider.js +216 -39
- package/dist/nexus-widget/components/deposit-idle-form.d.ts +2 -1
- package/dist/nexus-widget/components/deposit-idle-form.d.ts.map +1 -1
- package/dist/nexus-widget/components/deposit-idle-form.js +26 -10
- package/dist/nexus-widget/components/nexus-widget-progress-screen.d.ts.map +1 -1
- package/dist/nexus-widget/components/nexus-widget-progress-screen.js +21 -5
- package/dist/nexus-widget/components/pay-with-sources.d.ts.map +1 -1
- package/dist/nexus-widget/components/pay-with-sources.js +43 -54
- package/dist/nexus-widget/components/send-idle-form.d.ts +2 -1
- package/dist/nexus-widget/components/send-idle-form.d.ts.map +1 -1
- package/dist/nexus-widget/components/send-idle-form.js +26 -10
- package/dist/nexus-widget/components/swap-asset-selector.d.ts +1 -1
- package/dist/nexus-widget/components/swap-asset-selector.d.ts.map +1 -1
- package/dist/nexus-widget/components/swap-asset-selector.js +198 -140
- package/dist/nexus-widget/components/swap-idle-form.d.ts +2 -1
- package/dist/nexus-widget/components/swap-idle-form.d.ts.map +1 -1
- package/dist/nexus-widget/components/swap-idle-form.js +3 -3
- package/dist/nexus-widget/components/swap-intent-preview.d.ts +5 -1
- package/dist/nexus-widget/components/swap-intent-preview.d.ts.map +1 -1
- package/dist/nexus-widget/components/swap-intent-preview.js +50 -35
- package/dist/nexus-widget/nexus-widget.d.ts.map +1 -1
- package/dist/nexus-widget/nexus-widget.js +1311 -617
- package/dist/nexus-widget/types.d.ts +1 -1
- package/dist/nexus-widget/types.d.ts.map +1 -1
- package/dist/nexus-widget/utils/deposit-source-selection.d.ts.map +1 -1
- package/dist/nexus-widget/utils/deposit-source-selection.js +68 -4
- package/package.json +5 -5
|
@@ -11,6 +11,7 @@ export interface SwapIntentSource {
|
|
|
11
11
|
token: {
|
|
12
12
|
contractAddress: string;
|
|
13
13
|
decimals: number;
|
|
14
|
+
logo?: string;
|
|
14
15
|
symbol: string;
|
|
15
16
|
};
|
|
16
17
|
value?: string;
|
|
@@ -28,12 +29,14 @@ export interface SwapIntentDestination {
|
|
|
28
29
|
token: {
|
|
29
30
|
contractAddress: string;
|
|
30
31
|
decimals: number;
|
|
32
|
+
logo?: string;
|
|
31
33
|
symbol: string;
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
token: {
|
|
35
37
|
contractAddress: string;
|
|
36
38
|
decimals: number;
|
|
39
|
+
logo?: string;
|
|
37
40
|
symbol: string;
|
|
38
41
|
};
|
|
39
42
|
value?: string;
|
|
@@ -65,6 +68,7 @@ export interface SwapIntentPreviewProps {
|
|
|
65
68
|
};
|
|
66
69
|
fromAmount: string;
|
|
67
70
|
fromAmountUsd?: string;
|
|
71
|
+
destinationGasFeeUsd?: string;
|
|
68
72
|
fromToken?: SwapTokenOption;
|
|
69
73
|
fromTokens?: SwapTokenOption[];
|
|
70
74
|
intentData?: SwapIntentData | null;
|
|
@@ -91,5 +95,5 @@ export interface SwapIntentPreviewProps {
|
|
|
91
95
|
toToken?: SwapTokenOption;
|
|
92
96
|
totalFeeUsd?: string;
|
|
93
97
|
}
|
|
94
|
-
export declare function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount, fromAmountUsd, toAmount, toAmountUsd, toAmountTokens, totalFeeUsd, isLoading, isRefreshing, isExecuting, swapType, intentData, mode, opportunity, recipientAddress, activeMode, steps, explorerUrls, onAccept, onTransitionChange, }: SwapIntentPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount, fromAmountUsd, destinationGasFeeUsd, toAmount, toAmountUsd, toAmountTokens, totalFeeUsd, isLoading, isRefreshing, isExecuting, swapType, intentData, mode, opportunity, recipientAddress, activeMode, steps, explorerUrls, onAccept, onTransitionChange, }: SwapIntentPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
95
99
|
//# sourceMappingURL=swap-intent-preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap-intent-preview.d.ts","sourceRoot":"","sources":["../../../.build-src/nexus-widget/components/swap-intent-preview.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAIxE,OAAO,EACL,KAAK,qCAAqC,EAC1C,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"swap-intent-preview.d.ts","sourceRoot":"","sources":["../../../.build-src/nexus-widget/components/swap-intent-preview.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAIxE,OAAO,EACL,KAAK,qCAAqC,EAC1C,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,KAAK,EAAE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AQ,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAikBD,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,kBAAkB,GACnB,EAAE,sBAAsB,2CA6sCxB"}
|
|
@@ -88,6 +88,13 @@ const isNativeTokenAddress = (address) => {
|
|
|
88
88
|
lower === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ||
|
|
89
89
|
lower === "0x0000000000000000000000000000000000000000");
|
|
90
90
|
};
|
|
91
|
+
const getSourceDisplayKey = (chainId, address, symbol) => {
|
|
92
|
+
const chainKey = chainId ?? "";
|
|
93
|
+
const normalizedAddress = address?.toLowerCase();
|
|
94
|
+
return normalizedAddress
|
|
95
|
+
? `${chainKey}-${normalizedAddress}`
|
|
96
|
+
: `${chainKey}-symbol-${(symbol ?? "").toUpperCase()}`;
|
|
97
|
+
};
|
|
91
98
|
const normalizeIntentToken = (token, chainId) => {
|
|
92
99
|
const chainMeta = chainId ? CHAIN_METADATA[chainId] : undefined;
|
|
93
100
|
const shouldUseNative = isNativeTokenAddress(token?.contractAddress) && Boolean(chainMeta);
|
|
@@ -100,7 +107,7 @@ const normalizeIntentToken = (token, chainId) => {
|
|
|
100
107
|
return {
|
|
101
108
|
contractAddress: token?.contractAddress ?? "",
|
|
102
109
|
decimals,
|
|
103
|
-
logo: shouldUseNative ? chainMeta?.logo : undefined,
|
|
110
|
+
logo: token?.logo || (shouldUseNative ? chainMeta?.logo : undefined),
|
|
104
111
|
symbol,
|
|
105
112
|
};
|
|
106
113
|
};
|
|
@@ -334,7 +341,7 @@ function AnimatedDetails({ open, children, background = "#F9F9F8", gap = "9px",
|
|
|
334
341
|
transition: "padding 220ms ease",
|
|
335
342
|
}, children: children }) }) }));
|
|
336
343
|
}
|
|
337
|
-
export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount, fromAmountUsd, toAmount, toAmountUsd, toAmountTokens, totalFeeUsd, isLoading, isRefreshing, isExecuting, swapType, intentData, mode, opportunity, recipientAddress, activeMode, steps, explorerUrls, onAccept, onTransitionChange, }) {
|
|
344
|
+
export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount, fromAmountUsd, destinationGasFeeUsd, toAmount, toAmountUsd, toAmountTokens, totalFeeUsd, isLoading, isRefreshing, isExecuting, swapType, intentData, mode, opportunity, recipientAddress, activeMode, steps, explorerUrls, onAccept, onTransitionChange, }) {
|
|
338
345
|
const [showSourceDetails, setShowSourceDetails] = useState(false);
|
|
339
346
|
const [showFeeDetails, setShowFeeDetails] = useState(false);
|
|
340
347
|
const [showImpactDetails, setShowImpactDetails] = useState(false);
|
|
@@ -482,22 +489,32 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
482
489
|
: undefined);
|
|
483
490
|
const protocolFeeNumber = parseDecimal(bridgeFeeData?.protocol);
|
|
484
491
|
const solverFeeNumber = parseDecimal(bridgeFeeData?.solver);
|
|
485
|
-
const
|
|
492
|
+
const bridgeGasSuppliedNumber = parseDecimal(bridgeFeeData?.gasSupplied);
|
|
493
|
+
const destinationGasValueNumber = parseDecimal(normalizedIntentDest?.gas?.value) ??
|
|
494
|
+
parseDecimal(destinationGasFeeUsd);
|
|
495
|
+
const destinationGasSuppliedNumber = bridgeGasSuppliedNumber ?? destinationGasValueNumber;
|
|
496
|
+
const bridgeTotalWithDestinationGas = bridgeTotalNumber &&
|
|
497
|
+
!bridgeGasSuppliedNumber &&
|
|
498
|
+
destinationGasValueNumber &&
|
|
499
|
+
destinationGasValueNumber.gt(0)
|
|
500
|
+
? bridgeTotalNumber.plus(destinationGasValueNumber)
|
|
501
|
+
: bridgeTotalNumber;
|
|
486
502
|
const swapBufferNumber = parseDecimal(intentData?.feesAndBuffer?.buffer);
|
|
487
503
|
const bridgeComponentsTotalNumber = bridgeFeeData
|
|
488
504
|
? [
|
|
489
505
|
executionGasFeeNumber,
|
|
490
506
|
protocolFeeNumber,
|
|
491
507
|
solverFeeNumber,
|
|
492
|
-
|
|
508
|
+
destinationGasSuppliedNumber,
|
|
493
509
|
].reduce((sum, value) => sum.plus(value ?? new Decimal(0)), new Decimal(0))
|
|
494
510
|
: undefined;
|
|
495
|
-
const explicitFeeNumber =
|
|
511
|
+
const explicitFeeNumber = bridgeTotalWithDestinationGas ??
|
|
496
512
|
(bridgeComponentsTotalNumber && bridgeComponentsTotalNumber.gt(0)
|
|
497
513
|
? bridgeComponentsTotalNumber
|
|
498
514
|
: undefined) ??
|
|
499
515
|
parseDecimal(totalFeeUsd) ??
|
|
500
|
-
parseDecimal(intentData?.fees?.total)
|
|
516
|
+
parseDecimal(intentData?.fees?.total) ??
|
|
517
|
+
destinationGasSuppliedNumber;
|
|
501
518
|
const feeNumber = explicitFeeNumber ?? (hasFiatQuote ? new Decimal(0) : undefined);
|
|
502
519
|
const quotedDestinationUsdNumber = parseDecimal(normalizedIntentDest?.value);
|
|
503
520
|
const exactOutPaidUsdNumber = (() => {
|
|
@@ -556,13 +573,25 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
556
573
|
label: "Solver Fee",
|
|
557
574
|
value: solverFeeNumber ?? new Decimal(0),
|
|
558
575
|
},
|
|
559
|
-
...(
|
|
560
|
-
? [{ label: "Gas Sponsorship", value:
|
|
576
|
+
...(destinationGasSuppliedNumber && destinationGasSuppliedNumber.gt(0)
|
|
577
|
+
? [{ label: "Gas Sponsorship", value: destinationGasSuppliedNumber }]
|
|
561
578
|
: []),
|
|
562
579
|
]
|
|
563
|
-
:
|
|
564
|
-
? [
|
|
565
|
-
|
|
580
|
+
: destinationGasSuppliedNumber && destinationGasSuppliedNumber.gt(0)
|
|
581
|
+
? [
|
|
582
|
+
...(feeNumber && feeNumber.gt(destinationGasSuppliedNumber)
|
|
583
|
+
? [
|
|
584
|
+
{
|
|
585
|
+
label: "Network & protocol",
|
|
586
|
+
value: feeNumber.minus(destinationGasSuppliedNumber),
|
|
587
|
+
},
|
|
588
|
+
]
|
|
589
|
+
: []),
|
|
590
|
+
{ label: "Gas Sponsorship", value: destinationGasSuppliedNumber },
|
|
591
|
+
]
|
|
592
|
+
: feeNumber !== undefined
|
|
593
|
+
? [{ label: "Network & protocol", value: feeNumber }]
|
|
594
|
+
: [];
|
|
566
595
|
const pendingLabel = isLoading ? "Fetching quote" : "Quote unavailable";
|
|
567
596
|
const pendingValue = isLoading ? "..." : "--";
|
|
568
597
|
const sourceUsd = exactOutPaidUsdNumber !== undefined
|
|
@@ -587,26 +616,16 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
587
616
|
const destinationTokenDisplay = hasResolvedQuote
|
|
588
617
|
? `${formatTokenAmount(destinationTokenAmount)} ${destTokenSymbol}`
|
|
589
618
|
: pendingLabel;
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
toToken?.contractAddress ??
|
|
594
|
-
"").toLowerCase(),
|
|
595
|
-
].join("-");
|
|
596
|
-
const hasDestinationSourceRow = Boolean(destinationSourceKey !== "-" &&
|
|
619
|
+
const destinationSourceAddress = normalizedIntentDest?.token.contractAddress || toToken?.contractAddress;
|
|
620
|
+
const destinationSourceKey = getSourceDisplayKey(normalizedIntentDest?.chain.id ?? toToken?.chainId, destinationSourceAddress, destTokenSymbol);
|
|
621
|
+
const hasDestinationSourceRow = Boolean(destinationSourceKey &&
|
|
597
622
|
(normalizedIntentSources.length > 0
|
|
598
623
|
? normalizedIntentSources.some((source) => {
|
|
599
|
-
const sourceKey =
|
|
600
|
-
source.chain.id,
|
|
601
|
-
source.token.contractAddress.toLowerCase(),
|
|
602
|
-
].join("-");
|
|
624
|
+
const sourceKey = getSourceDisplayKey(source.chain.id, source.token.contractAddress, source.token.symbol);
|
|
603
625
|
return sourceKey === destinationSourceKey;
|
|
604
626
|
})
|
|
605
627
|
: fallbackSources.some((source) => {
|
|
606
|
-
const sourceKey =
|
|
607
|
-
source.chainId ?? "",
|
|
608
|
-
source.contractAddress.toLowerCase(),
|
|
609
|
-
].join("-");
|
|
628
|
+
const sourceKey = getSourceDisplayKey(source.chainId ?? "", source.contractAddress, source.symbol);
|
|
610
629
|
return sourceKey === destinationSourceKey;
|
|
611
630
|
})));
|
|
612
631
|
const swapBufferDisplay = swapBufferNumber !== undefined
|
|
@@ -618,10 +637,7 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
618
637
|
(token.contractAddress?.toLowerCase() ===
|
|
619
638
|
source.token.contractAddress?.toLowerCase() ||
|
|
620
639
|
token.symbol === source.token.symbol));
|
|
621
|
-
const sourceKey =
|
|
622
|
-
source.chain.id,
|
|
623
|
-
source.token.contractAddress.toLowerCase(),
|
|
624
|
-
].join("-");
|
|
640
|
+
const sourceKey = getSourceDisplayKey(source.chain.id, source.token.contractAddress, source.token.symbol);
|
|
625
641
|
const isDestinationSource = sourceKey === destinationSourceKey &&
|
|
626
642
|
displayOnlyDestinationSourceAmount !== undefined;
|
|
627
643
|
const sourceAmountNumber = parseDecimal(source.amount);
|
|
@@ -652,10 +668,7 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
652
668
|
: fallbackSources.map((source, index) => {
|
|
653
669
|
const sourceAmount = source.userAmount ||
|
|
654
670
|
(fallbackSources.length === 1 ? fromAmount : "");
|
|
655
|
-
const sourceKey =
|
|
656
|
-
source.chainId ?? "",
|
|
657
|
-
source.contractAddress.toLowerCase(),
|
|
658
|
-
].join("-");
|
|
671
|
+
const sourceKey = getSourceDisplayKey(source.chainId ?? "", source.contractAddress, source.symbol);
|
|
659
672
|
const isDestinationSource = sourceKey === destinationSourceKey &&
|
|
660
673
|
displayOnlyDestinationSourceAmount !== undefined;
|
|
661
674
|
const sourceAmountNumber = parseDecimal(sourceAmount);
|
|
@@ -769,7 +782,9 @@ export function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount,
|
|
|
769
782
|
const count = sourceAssetCount || 1;
|
|
770
783
|
return `${count} asset${count === 1 ? "" : "s"}`;
|
|
771
784
|
})();
|
|
772
|
-
|
|
785
|
+
// The preview panel owns vertical scrolling; nested source scrollbars make
|
|
786
|
+
// confirm screens show multiple scrollbars.
|
|
787
|
+
const shouldScrollSourceDetails = false;
|
|
773
788
|
const progressExplorerUrls = explorerUrls ?? {
|
|
774
789
|
destinationExplorerUrl: null,
|
|
775
790
|
sourceExplorerUrl: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus-widget.d.ts","sourceRoot":"","sources":["../../.build-src/nexus-widget/nexus-widget.tsx"],"names":[],"mappings":"AAmFA,OAAO,EAUL,KAAK,gBAAgB,EAGtB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"nexus-widget.d.ts","sourceRoot":"","sources":["../../.build-src/nexus-widget/nexus-widget.tsx"],"names":[],"mappings":"AAmFA,OAAO,EAUL,KAAK,gBAAgB,EAGtB,MAAM,SAAS,CAAC;AA2yGjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0DlD;AA+nRD,eAAe,WAAW,CAAC"}
|