@rash2x/bridge-widget 0.1.7 → 0.1.9
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/evaa-bridge.cjs +47 -59
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +47 -59
- package/dist/evaa-bridge.mjs.map +1 -1
- package/package.json +1 -1
package/dist/evaa-bridge.mjs
CHANGED
|
@@ -1661,7 +1661,7 @@ const VirtualizedTokenList = ({
|
|
|
1661
1661
|
getTokenUsdValue,
|
|
1662
1662
|
onPick
|
|
1663
1663
|
}) => {
|
|
1664
|
-
const
|
|
1664
|
+
const Row = ({ index, style }) => {
|
|
1665
1665
|
const node = nodes[index];
|
|
1666
1666
|
if (node.kind === "header") {
|
|
1667
1667
|
const gap = index === 0 ? 0 : HEADER_TOP_GAP;
|
|
@@ -1708,7 +1708,7 @@ const VirtualizedTokenList = ({
|
|
|
1708
1708
|
itemSize: getItemSize,
|
|
1709
1709
|
overscanCount: 8,
|
|
1710
1710
|
style: { willChange: "transform", paddingBottom: "40px" },
|
|
1711
|
-
children:
|
|
1711
|
+
children: Row
|
|
1712
1712
|
}
|
|
1713
1713
|
);
|
|
1714
1714
|
};
|
|
@@ -1995,7 +1995,7 @@ function Card({ className, ...props }) {
|
|
|
1995
1995
|
{
|
|
1996
1996
|
"data-slot": "card",
|
|
1997
1997
|
className: cn(
|
|
1998
|
-
"bg-card text-card-foreground flex flex-col gap-
|
|
1998
|
+
"bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-4 shadow-sm",
|
|
1999
1999
|
className
|
|
2000
2000
|
),
|
|
2001
2001
|
...props
|
|
@@ -2008,7 +2008,7 @@ function CardHeader({ className, ...props }) {
|
|
|
2008
2008
|
{
|
|
2009
2009
|
"data-slot": "card-header",
|
|
2010
2010
|
className: cn(
|
|
2011
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-
|
|
2011
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4",
|
|
2012
2012
|
className
|
|
2013
2013
|
),
|
|
2014
2014
|
...props
|
|
@@ -2043,7 +2043,7 @@ function CardContent({ className, ...props }) {
|
|
|
2043
2043
|
"div",
|
|
2044
2044
|
{
|
|
2045
2045
|
"data-slot": "card-content",
|
|
2046
|
-
className: cn("px-
|
|
2046
|
+
className: cn("px-4", className),
|
|
2047
2047
|
...props
|
|
2048
2048
|
}
|
|
2049
2049
|
);
|
|
@@ -2053,7 +2053,7 @@ function CardFooter({ className, ...props }) {
|
|
|
2053
2053
|
"div",
|
|
2054
2054
|
{
|
|
2055
2055
|
"data-slot": "card-footer",
|
|
2056
|
-
className: cn("flex items-center px-
|
|
2056
|
+
className: cn("flex items-center px-4 [.border-t]:pt-4", className),
|
|
2057
2057
|
...props
|
|
2058
2058
|
}
|
|
2059
2059
|
);
|
|
@@ -2918,10 +2918,8 @@ const SwapSection = ({
|
|
|
2918
2918
|
"div",
|
|
2919
2919
|
{
|
|
2920
2920
|
className: cn(
|
|
2921
|
-
"p-4 flex flex-col gap-4 transition-colors bg-
|
|
2922
|
-
|
|
2923
|
-
"bg-input-focus": isSource && isFocused
|
|
2924
|
-
},
|
|
2921
|
+
"p-4 flex flex-col gap-4 transition-colors bg-muted",
|
|
2922
|
+
isSource && isFocused ? "bg-accent" : "",
|
|
2925
2923
|
className
|
|
2926
2924
|
),
|
|
2927
2925
|
children: [
|
|
@@ -3085,7 +3083,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3085
3083
|
} catch {
|
|
3086
3084
|
}
|
|
3087
3085
|
};
|
|
3088
|
-
return /* @__PURE__ */ jsxs("div", { className: "p-4 flex flex-col rounded-b-
|
|
3086
|
+
return /* @__PURE__ */ jsxs("div", { className: "p-4 flex flex-col rounded-b-xl gap-2 bg-muted", children: [
|
|
3089
3087
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3090
3088
|
/* @__PURE__ */ jsx("p", { className: "text-sm leading-4.5 font-medium text-muted-foreground", children: t2("bridge.sendToAnotherAddress") }),
|
|
3091
3089
|
/* @__PURE__ */ jsx(
|
|
@@ -3207,15 +3205,6 @@ function AccordionContent({
|
|
|
3207
3205
|
}
|
|
3208
3206
|
);
|
|
3209
3207
|
}
|
|
3210
|
-
function getRouteDisplayName(route) {
|
|
3211
|
-
if (!route) return "Stargate Bridge";
|
|
3212
|
-
const routeLower = route.toLowerCase();
|
|
3213
|
-
if (routeLower.includes("taxi")) return "Stargate V2 Fast";
|
|
3214
|
-
if (routeLower.includes("bus")) return "Stargate V2 Economy";
|
|
3215
|
-
if (routeLower.includes("oft")) return "OFT Bridge";
|
|
3216
|
-
if (routeLower.includes("v2")) return "Stargate V2";
|
|
3217
|
-
return route.split(/[\/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3218
|
-
}
|
|
3219
3208
|
function getQuoteAmounts(quote, srcToken, dstToken) {
|
|
3220
3209
|
if (!quote || !srcToken || !dstToken) {
|
|
3221
3210
|
return {
|
|
@@ -3308,12 +3297,21 @@ function getQuoteDetails(quote, srcToken, dstToken, tokens, chains, slippageBps)
|
|
|
3308
3297
|
fees
|
|
3309
3298
|
};
|
|
3310
3299
|
}
|
|
3311
|
-
|
|
3300
|
+
function getRouteDisplayName(route) {
|
|
3301
|
+
if (!route) return "Stargate Bridge";
|
|
3302
|
+
const routeLower = route.toLowerCase();
|
|
3303
|
+
if (routeLower.includes("taxi")) return "Stargate V2 Fast";
|
|
3304
|
+
if (routeLower.includes("bus")) return "Stargate V2 Economy";
|
|
3305
|
+
if (routeLower.includes("oft")) return "OFT Bridge";
|
|
3306
|
+
if (routeLower.includes("v2")) return "Stargate V2";
|
|
3307
|
+
return route.split(/[/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3308
|
+
}
|
|
3309
|
+
const Details = () => {
|
|
3312
3310
|
const { t: t2 } = useTranslation();
|
|
3313
3311
|
const { selectedAssetSymbol, assetMatrix, tokens } = useTokensStore();
|
|
3314
3312
|
const { toChain, fromChain, chains } = useChainsStore();
|
|
3315
3313
|
const { quote, status } = useBridgeQuoteStore();
|
|
3316
|
-
const { slippageBps, routePriority
|
|
3314
|
+
const { slippageBps, routePriority } = useSettingsStore();
|
|
3317
3315
|
const dstToken = resolveTokenOnChainFromMatrix$2(
|
|
3318
3316
|
assetMatrix,
|
|
3319
3317
|
selectedAssetSymbol,
|
|
@@ -3353,9 +3351,8 @@ const ReceiveRow = () => {
|
|
|
3353
3351
|
})();
|
|
3354
3352
|
const currentSlippageText = formatPercentage(slippageBps);
|
|
3355
3353
|
const routeText = quote?.route ? getRouteDisplayName(quote.route) : t2(`settings.routePresets.${routePriority}`);
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
/* @__PURE__ */ jsx(AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-16 data-[state=open]:pb-3", children: /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
|
|
3354
|
+
return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-xl", children: [
|
|
3355
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-xl data-[state=open]:pb-3", children: /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
|
|
3359
3356
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-normal text-priority leading-3.5", children: t2("bridge.youWillReceive", { defaultValue: "You will receive" }) }),
|
|
3360
3357
|
/* @__PURE__ */ jsxs("div", { className: "bg-transparent hover:bg-transparent shadow-none h-4 p-0 px-0 py-0 flex items-center gap-1.5", children: [
|
|
3361
3358
|
/* @__PURE__ */ jsx(TokenSymbol, { symbol, className: "w-4 h-4", alt: "token" }),
|
|
@@ -3366,65 +3363,56 @@ const ReceiveRow = () => {
|
|
|
3366
3363
|
] })
|
|
3367
3364
|
] })
|
|
3368
3365
|
] }) }),
|
|
3369
|
-
/* @__PURE__ */ jsxs(AccordionContent, { className: "
|
|
3366
|
+
/* @__PURE__ */ jsxs(AccordionContent, { className: "px-5 flex flex-col gap-3", children: [
|
|
3370
3367
|
/* @__PURE__ */ jsx(
|
|
3371
|
-
|
|
3368
|
+
DetailsRow,
|
|
3372
3369
|
{
|
|
3373
3370
|
label: t2("transaction.route"),
|
|
3374
|
-
|
|
3371
|
+
value: /* @__PURE__ */ jsxs("strong", { className: "flex items-center gap-1.5", children: [
|
|
3375
3372
|
/* @__PURE__ */ jsx(StargateIcon, { className: "size-4" }),
|
|
3376
|
-
/* @__PURE__ */ jsx("p", { className: "
|
|
3377
|
-
hasGasOnDestination && /* @__PURE__ */ jsx("span", { className: "text-xs bg-settings-active text-settings-active-foreground px-1.5 py-0.5 rounded", children: t2(`settings.gasPresets.${gasPreset}`) })
|
|
3373
|
+
/* @__PURE__ */ jsx("p", { className: "", children: routeText })
|
|
3378
3374
|
] })
|
|
3379
3375
|
}
|
|
3380
3376
|
),
|
|
3381
3377
|
/* @__PURE__ */ jsx(
|
|
3382
|
-
|
|
3378
|
+
DetailsRow,
|
|
3383
3379
|
{
|
|
3384
3380
|
label: t2("transaction.estTime"),
|
|
3385
3381
|
value: etaText,
|
|
3386
3382
|
isLoading
|
|
3387
3383
|
}
|
|
3388
3384
|
),
|
|
3389
|
-
/* @__PURE__ */ jsx(Row, { label: t2("transaction.slippage"), value: currentSlippageText }),
|
|
3390
3385
|
/* @__PURE__ */ jsx(
|
|
3391
|
-
|
|
3386
|
+
DetailsRow,
|
|
3387
|
+
{
|
|
3388
|
+
label: t2("transaction.slippage"),
|
|
3389
|
+
value: currentSlippageText
|
|
3390
|
+
}
|
|
3391
|
+
),
|
|
3392
|
+
/* @__PURE__ */ jsx(
|
|
3393
|
+
DetailsRow,
|
|
3392
3394
|
{
|
|
3393
3395
|
label: t2("transaction.totalFee"),
|
|
3394
|
-
value:
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3396
|
+
value: /* @__PURE__ */ jsxs("strong", { className: "inline-flex items-center gap-1", children: [
|
|
3397
|
+
/* @__PURE__ */ jsx("span", { children: totalFeeDisplay }),
|
|
3398
|
+
/* @__PURE__ */ jsx(TokenSymbol, { symbol, className: "w-4 h-4", alt: "token" })
|
|
3399
|
+
] }),
|
|
3400
|
+
isLoading
|
|
3398
3401
|
}
|
|
3399
3402
|
)
|
|
3400
3403
|
] })
|
|
3401
3404
|
] }) });
|
|
3402
3405
|
};
|
|
3403
|
-
const
|
|
3406
|
+
const DetailsRow = ({
|
|
3404
3407
|
label,
|
|
3405
3408
|
value,
|
|
3406
|
-
|
|
3407
|
-
className,
|
|
3408
|
-
isLoading = false,
|
|
3409
|
-
token
|
|
3409
|
+
isLoading = false
|
|
3410
3410
|
}) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
|
|
3411
3411
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
3412
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-priority font-normal
|
|
3412
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-priority font-normal", children: label }),
|
|
3413
3413
|
/* @__PURE__ */ jsx(Tip, { text: label, children: /* @__PURE__ */ jsx(TipIcon, { className: "size-4 text-receive-icon" }) })
|
|
3414
3414
|
] }),
|
|
3415
|
-
|
|
3416
|
-
/* @__PURE__ */ jsx(
|
|
3417
|
-
"p",
|
|
3418
|
-
{
|
|
3419
|
-
className: cn(
|
|
3420
|
-
"text-foreground text-sm font-display leading-[100%]",
|
|
3421
|
-
className
|
|
3422
|
-
),
|
|
3423
|
-
children: value ?? "—"
|
|
3424
|
-
}
|
|
3425
|
-
),
|
|
3426
|
-
token
|
|
3427
|
-
] }))
|
|
3415
|
+
isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
3428
3416
|
] });
|
|
3429
3417
|
const useTransactionStore = create$1((set, get) => ({
|
|
3430
3418
|
current: void 0,
|
|
@@ -4060,7 +4048,7 @@ const SubmitButton = () => {
|
|
|
4060
4048
|
}
|
|
4061
4049
|
};
|
|
4062
4050
|
const disabled = isBusy || amountNum <= 0 || status === "loading" || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer;
|
|
4063
|
-
return /* @__PURE__ */ jsx(Button, { onClick: handleClick, disabled, className: "w-full", children: label });
|
|
4051
|
+
return /* @__PURE__ */ jsx(Button, { onClick: handleClick, disabled, className: "w-full mt-4", children: label });
|
|
4064
4052
|
};
|
|
4065
4053
|
function short(addr) {
|
|
4066
4054
|
return addr.slice(0, 4) + "…" + addr.slice(-4);
|
|
@@ -8083,7 +8071,7 @@ const EvaaBridgeContent = ({
|
|
|
8083
8071
|
/* @__PURE__ */ jsx(
|
|
8084
8072
|
SwapSection,
|
|
8085
8073
|
{
|
|
8086
|
-
className: "rounded-t-
|
|
8074
|
+
className: "rounded-t-xl",
|
|
8087
8075
|
label: t2("bridge.sourceNetwork"),
|
|
8088
8076
|
balance: fromBalance,
|
|
8089
8077
|
chain: fromChain,
|
|
@@ -8118,7 +8106,7 @@ const EvaaBridgeContent = ({
|
|
|
8118
8106
|
),
|
|
8119
8107
|
/* @__PURE__ */ jsx(SubmitButton, {})
|
|
8120
8108
|
] }),
|
|
8121
|
-
/* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(
|
|
8109
|
+
/* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(Details, {}) })
|
|
8122
8110
|
]
|
|
8123
8111
|
}
|
|
8124
8112
|
),
|