@glacislabs/stablegenie-zerodelta 2.0.0 → 3.0.0

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/mount.cjs CHANGED
@@ -2244,9 +2244,7 @@ var WIDGET_CSS = `
2244
2244
  .sg-soonpanel-title{font-size:14px;font-weight:700;margin-bottom:6px}
2245
2245
  .sg-soonpanel-sub{font-size:12px;color:var(--sg-text-muted);line-height:1.45}
2246
2246
 
2247
- /* compact merchant-receives anchor + click-to-expand "Details" disclosure (merchant-configured;
2248
- the payer never edits it). Reveal mirrors the island's grid-rows morph; reduced-motion covered by
2249
- the .sg-island guard below (it disables transitions on .sg-island *). */
2247
+ /* payout slot \u2014 bank settlement only (the stablecoin destination anchor is never rendered) */
2250
2248
  .sg-merch-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
2251
2249
  .sg-merch-lead{min-width:0}
2252
2250
  /* bank payout destination (settlement="bank") \u2014 sits in the same anchor slot as the stablecoin
@@ -2256,19 +2254,6 @@ var WIDGET_CSS = `
2256
2254
  .sg-bank-text{display:flex;flex-direction:column;min-width:0}
2257
2255
  .sg-bank-name{font-size:16px;font-weight:700;color:var(--sg-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
2258
2256
  .sg-bank-cur{font-size:12px;color:var(--sg-text-muted)}
2259
- .sg-details-toggle{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border:1px solid var(--sg-border);border-radius:var(--sg-radius-cta);background:transparent;color:var(--sg-text-muted);font:inherit;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap;transition:color var(--sg-motion-fast) var(--sg-ease-out-soft),border-color var(--sg-motion-fast) var(--sg-ease-out-soft)}
2260
- .sg-details-toggle:hover{color:var(--sg-accent);border-color:var(--sg-accent)}
2261
- .sg-details-chev{display:inline-flex;font-size:11px;line-height:1;transition:transform var(--sg-motion-fast) var(--sg-ease-out-soft)}
2262
- .sg-details-toggle[data-open="true"] .sg-details-chev{transform:rotate(180deg)}
2263
- .sg-details-reveal{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--sg-motion-base) var(--sg-ease-out-soft)}
2264
- .sg-details-reveal[data-open="true"]{grid-template-rows:1fr}
2265
- .sg-details-reveal-inner{min-height:0;overflow:hidden}
2266
- .sg-details-body{margin-top:12px;padding-top:12px;border-top:1px solid var(--sg-border)}
2267
- .sg-details-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:4px 0;font-size:12px}
2268
- .sg-details-k{flex:0 0 auto;color:var(--sg-text-muted)}
2269
- .sg-details-v{min-width:0;text-align:right;color:var(--sg-text)}
2270
- .sg-details-addr{word-break:break-all;font-size:11px}
2271
- .sg-details-note{margin-top:8px;font-size:11px;color:var(--sg-text-muted);line-height:1.45}
2272
2257
 
2273
2258
  /* express-card compaction for the 5-tab method selector (already overflow-x:auto for narrow cells) */
2274
2259
  .sg-widget[data-sg-express] .sg-tabs{margin:12px 0 8px}
@@ -2298,7 +2283,7 @@ var WIDGET_CSS = `
2298
2283
  broken) and shows the static accent dot instead; the label + live region carry the state. */
2299
2284
  @media (prefers-reduced-motion:reduce){
2300
2285
  .sg-island,.sg-island *{transition:none!important;animation:none!important}
2301
- .sg-island-reveal,.sg-details-reveal{transition:none!important}
2286
+ .sg-island-reveal{transition:none!important}
2302
2287
  .sg-island .sg-spinner{display:none!important}
2303
2288
  .sg-island .sg-rm-dot{display:inline-block}
2304
2289
  }
@@ -2546,14 +2531,22 @@ function StepList(props) {
2546
2531
  }
2547
2532
  var SHOW_ROADMAP_METHODS = true;
2548
2533
  var METHODS = [
2549
- { id: "recommended", label: "Recommended", live: true },
2550
2534
  { id: "stablecoin", label: "Stablecoin", live: true },
2551
- { id: "anyasset", label: "Any asset", live: true },
2552
2535
  { id: "card", label: "Card", live: false },
2553
- { id: "bank", label: "Bank", live: false }
2536
+ { id: "bank", label: "Bank account", live: false }
2554
2537
  ];
2555
2538
  function isLiveMethod(m) {
2556
- return m === "recommended" || m === "stablecoin" || m === "anyasset";
2539
+ return m === "stablecoin";
2540
+ }
2541
+ function balanceRank(raw, decimals) {
2542
+ if (raw == null) return 0n;
2543
+ try {
2544
+ const d = Number.isFinite(Number(decimals)) ? Math.max(0, Math.trunc(Number(decimals))) : 18;
2545
+ const v = BigInt(raw);
2546
+ return d <= 18 ? v * 10n ** BigInt(18 - d) : v / 10n ** BigInt(d - 18);
2547
+ } catch {
2548
+ return 0n;
2549
+ }
2557
2550
  }
2558
2551
  function MethodTabs(props) {
2559
2552
  const showRoadmap = props.showRoadmap ?? SHOW_ROADMAP_METHODS;
@@ -3028,55 +3021,6 @@ function forgetIdentity(account) {
3028
3021
  var addrEq = (a, b) => String(a || "").toLowerCase() === String(b || "").toLowerCase();
3029
3022
  var chainName = (id) => id != null ? CHAIN_LABELS[id] || `Chain ${id}` : "";
3030
3023
  var STABLES = /* @__PURE__ */ new Set(["USDC", "USDT", "USDE"]);
3031
- function MerchantReceives(props) {
3032
- const [open, setOpen] = react.useState(false);
3033
- const bodyId = react.useId();
3034
- const hasDetails = Boolean(props.recipient);
3035
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel sg-merch", children: [
3036
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-merch-head", children: [
3037
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-merch-lead", children: [
3038
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "Merchant receives exactly" }),
3039
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3040
- props.amount,
3041
- " ",
3042
- props.asset
3043
- ] })
3044
- ] }),
3045
- hasDetails ? /* @__PURE__ */ jsxRuntime.jsxs(
3046
- "button",
3047
- {
3048
- type: "button",
3049
- className: "sg-details-toggle",
3050
- "data-open": open,
3051
- "aria-expanded": open,
3052
- "aria-controls": bodyId,
3053
- onClick: () => setOpen((o) => !o),
3054
- children: [
3055
- "Details",
3056
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-chev", "aria-hidden": "true", children: "\u2304" })
3057
- ]
3058
- }
3059
- ) : null
3060
- ] }),
3061
- hasDetails ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-details-reveal", "data-open": open, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-details-reveal-inner", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-body", id: bodyId, children: [
3062
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-row", children: [
3063
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-k", children: "Network" }),
3064
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-v", children: chainName(props.chainId) })
3065
- ] }),
3066
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-row", children: [
3067
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-k", children: "Recipient" }),
3068
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-v sg-mono sg-details-addr", children: props.recipient })
3069
- ] }),
3070
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-note", children: [
3071
- "Settled like a card \u2014 the merchant always receives exactly ",
3072
- props.amount,
3073
- " ",
3074
- props.asset,
3075
- ". You pay a little more to cover the network cost."
3076
- ] })
3077
- ] }) }) }) : null
3078
- ] });
3079
- }
3080
3024
  function BankGlyph() {
3081
3025
  return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 10h18M5 10v8M10 10v8M14 10v8M19 10v8M3 19h18M12 3 3 8h18Z" }) });
3082
3026
  }
@@ -3279,7 +3223,7 @@ function PaymentIsland(props) {
3279
3223
  onSuccess: config.onSuccess,
3280
3224
  onError: config.onError
3281
3225
  });
3282
- const [method, setMethod] = react.useState("recommended");
3226
+ const [method, setMethod] = react.useState("stablecoin");
3283
3227
  const parked = isPay && !isLiveMethod(method);
3284
3228
  const fundingSet = react.useMemo(
3285
3229
  () => props.fundingAssets?.length ? new Set(props.fundingAssets.map((a) => a.toUpperCase())) : null,
@@ -3305,7 +3249,13 @@ function PaymentIsland(props) {
3305
3249
  }),
3306
3250
  [visibleRoutes, holdings.balances]
3307
3251
  );
3308
- const held = react.useMemo(() => annotated.filter((a) => a.affordable === true), [annotated]);
3252
+ const held = react.useMemo(
3253
+ () => annotated.filter((a) => a.affordable === true).sort((a, b) => {
3254
+ const d = balanceRank(b.balance?.raw, b.route.source.decimals) - balanceRank(a.balance?.raw, a.route.source.decimals);
3255
+ return d > 0n ? 1 : d < 0n ? -1 : 0;
3256
+ }),
3257
+ [annotated]
3258
+ );
3309
3259
  const heldIds = react.useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
3310
3260
  const optionStates = react.useMemo(() => {
3311
3261
  const map = {};
@@ -3494,9 +3444,7 @@ function PaymentIsland(props) {
3494
3444
  const lastTxOwned = Boolean(flow.lastTxEntry?.hash && wallet.account && flow.lastTxEntry.account === wallet.account.toLowerCase());
3495
3445
  const mismatch = flow.status === "error" && flow.verdict?.status === "mismatch";
3496
3446
  const destAsset = isPay ? props.toAsset : exToAsset;
3497
- const destChainId = isPay ? props.toChainId : exToChainId;
3498
- const anchorLabel = isPay ? "Merchant receives exactly" : "You receive (estimated)";
3499
- const anchorAmount = isPay ? props.amount : sel?.receive.amount ?? (flow.status === "loading" ? "\u2026" : "\u2014");
3447
+ const anchorAmount = sel?.receive.amount ?? (flow.status === "loading" ? "\u2026" : "\u2014");
3500
3448
  const successAmount = isPay ? props.amount : sel?.receive.amount;
3501
3449
  const money = props.moneyDisplay ?? (isPay ? props.amount ? `${props.amount} ${props.toAsset}` : "" : exAmount ? `${exAmount} ${exFromAsset ?? ""}`.trim() : "");
3502
3450
  const verb = isPay ? { present: "Pay", gerund: "Paying", past: "Paid" } : kind === "swap" ? { present: "Swap", gerund: "Swapping", past: "Swapped" } : { present: "Exchange", gerund: "Exchanging", past: "Exchanged" };
@@ -3618,7 +3566,7 @@ function PaymentIsland(props) {
3618
3566
  } else if (!wallet.account) {
3619
3567
  body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3620
3568
  /* @__PURE__ */ jsxRuntime.jsx(IdentityLine, { account: null, email: identity?.email }),
3621
- isPay ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(MerchantReceives, { amount: props.amount, asset: destAsset, chainId: destChainId, recipient: props.recipient }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3569
+ isPay ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3622
3570
  exchangeControls,
3623
3571
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3624
3572
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You receive (estimated)" }),
@@ -3689,10 +3637,10 @@ function PaymentIsland(props) {
3689
3637
  const walletError = flow.status === "error" && flow.steps.length > 0;
3690
3638
  body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3691
3639
  /* @__PURE__ */ jsxRuntime.jsx(IdentityLine, { account: wallet.account, email: identity?.email }),
3692
- isPay ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(MerchantReceives, { amount: props.amount, asset: destAsset, chainId: destChainId, recipient: props.recipient }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3640
+ isPay ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3693
3641
  exchangeControls,
3694
3642
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3695
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: anchorLabel }),
3643
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You receive (estimated)" }),
3696
3644
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3697
3645
  anchorAmount,
3698
3646
  " ",
@@ -3799,7 +3747,7 @@ function StableGeniePay(props) {
3799
3747
  onSuccess: config.onSuccess,
3800
3748
  onError: config.onError
3801
3749
  });
3802
- const [method, setMethod] = react.useState("recommended");
3750
+ const [method, setMethod] = react.useState("stablecoin");
3803
3751
  const fundingSet = react.useMemo(
3804
3752
  () => props.fundingAssets?.length ? new Set(props.fundingAssets.map((a) => a.toUpperCase())) : null,
3805
3753
  [props.fundingAssets]
@@ -3824,7 +3772,13 @@ function StableGeniePay(props) {
3824
3772
  }),
3825
3773
  [visibleRoutes, holdings.balances]
3826
3774
  );
3827
- const held = react.useMemo(() => annotated.filter((a) => a.affordable === true), [annotated]);
3775
+ const held = react.useMemo(
3776
+ () => annotated.filter((a) => a.affordable === true).sort((a, b) => {
3777
+ const d = balanceRank(b.balance?.raw, b.route.source.decimals) - balanceRank(a.balance?.raw, a.route.source.decimals);
3778
+ return d > 0n ? 1 : d < 0n ? -1 : 0;
3779
+ }),
3780
+ [annotated]
3781
+ );
3828
3782
  const heldIds = react.useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
3829
3783
  const scannedEmpty = !holdings.loading && Object.keys(holdings.balances).length > 0 && held.length === 0;
3830
3784
  const optionStates = react.useMemo(() => {
@@ -3927,7 +3881,6 @@ function StableGeniePay(props) {
3927
3881
  if (r) selectRoute(r.id);
3928
3882
  closeSelector();
3929
3883
  };
3930
- const chainName2 = CHAIN_LABELS[props.toChainId] || `Chain ${props.toChainId}`;
3931
3884
  const parked = !isLiveMethod(method);
3932
3885
  const submitting = flow.status === "submitting";
3933
3886
  const sel = flow.selected;
@@ -3935,7 +3888,10 @@ function StableGeniePay(props) {
3935
3888
  const selPick = sel && selectedVisible ? { chainId: sel.source.chainId, symbol: sel.source.asset } : null;
3936
3889
  const selToken = sel ? registryTokens.find((t) => Number(t.chainId) === sel.source.chainId && addrEq2(t.address, sel.source.tokenAddress)) ?? null : null;
3937
3890
  const selBal = sel ? holdings.balances[balanceKey(sel.source.chainId, sel.source.tokenAddress)] : void 0;
3938
- const why = parked ? "" : sel && selectedVisible ? sel.state === "DIRECT" ? `Direct ${sel.source.asset} transfer on ${CHAIN_LABELS[sel.source.chainId] || sel.source.chainName} \xB7 lowest cost` : `Routed through ZeroDelta \u2014 the merchant still receives exactly ${props.amount} ${props.toAsset}` : method === "stablecoin" ? "Pay with USDC, USDT, or USDE from your wallet." : method === "anyasset" ? "Pay with any supported asset \u2014 we route it to exactly what the merchant needs." : "Best route \xB7 picked for you";
3891
+ const why = parked ? "" : sel && selectedVisible ? sel.state === "DIRECT" ? `Direct ${sel.source.asset} transfer on ${CHAIN_LABELS[sel.source.chainId] || sel.source.chainName} \xB7 lowest cost` : (
3892
+ // Deliberately does NOT restate the destination amount — that is merchant config, not a payer fact.
3893
+ `Routed through ZeroDelta \xB7 the extra covers the network cost`
3894
+ ) : "Pay with USDC, USDT, or USDE from your wallet.";
3939
3895
  const comingSoon = method === "card" ? "Card payments are coming soon. Today StableGenie pays from your connected wallet." : "Bank transfers are coming soon.";
3940
3896
  const payLabel = parked ? method === "card" ? "Card \u2014 coming soon" : "Bank \u2014 coming soon" : submitting ? "Paying\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall ? flow.nativeShortfall : sel && selectedVisible ? `Pay ${sel.source.payAmount} ${sel.source.asset}` : "Pay";
3941
3897
  const walletSlot = wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-head-tools", children: [
@@ -3946,82 +3902,66 @@ function StableGeniePay(props) {
3946
3902
  ] })
3947
3903
  ] }) : void 0;
3948
3904
  if (props.variant === "pill") return /* @__PURE__ */ jsxRuntime.jsx(PaymentIsland, { kind: "pay", ...props });
3949
- return /* @__PURE__ */ jsxRuntime.jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(TokenSelect, { title: "Pay with", chains: fundingChains, tokens: fundingTokens, balances: holdings.balances, optionStates, onBack: closeSelector, onPick: pickFunding }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3950
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", children: [
3951
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "Merchant receives exactly" }),
3952
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3905
+ return /* @__PURE__ */ jsxRuntime.jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(TokenSelect, { title: "Pay with", chains: fundingChains, tokens: fundingTokens, balances: holdings.balances, optionStates, onBack: closeSelector, onPick: pickFunding }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cta-wrap", children: [
3906
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }),
3907
+ wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
3908
+ ] }) : flow.status === "success" || flow.status === "pending" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3909
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success", children: [
3910
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-success-check", "data-pending": flow.verdict?.status !== "confirmed", children: /* @__PURE__ */ jsxRuntime.jsx(CheckGlyph3, {}) }),
3911
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-amt sg-mono", children: [
3953
3912
  props.amount,
3954
3913
  " ",
3955
3914
  props.toAsset
3956
3915
  ] }),
3957
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
3958
- "on ",
3959
- chainName2,
3916
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-sub", children: [
3917
+ flow.verdict?.status === "confirmed" ? "Confirmed on-chain" : "Submitted \u2014 awaiting confirmation",
3960
3918
  " \xB7 ",
3961
3919
  shortAddress(props.recipient)
3962
3920
  ] })
3963
3921
  ] }),
3964
- !wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cta-wrap", children: [
3965
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }),
3966
- wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
3967
- ] }) : flow.status === "success" || flow.status === "pending" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3968
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success", children: [
3969
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-success-check", "data-pending": flow.verdict?.status !== "confirmed", children: /* @__PURE__ */ jsxRuntime.jsx(CheckGlyph3, {}) }),
3970
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-amt sg-mono", children: [
3971
- props.amount,
3922
+ lastTxOwned ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", onClick: () => setHist({ entry: flow.lastTxEntry }), children: "View transaction" }) }) : null
3923
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3924
+ /* @__PURE__ */ jsxRuntime.jsx(MethodTabs, { value: method, onChange: setMethod }),
3925
+ parked ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: comingSoon }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3926
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(
3927
+ TokenTile,
3928
+ {
3929
+ label: "Pay with",
3930
+ pick: selPick,
3931
+ token: selToken,
3932
+ disabled: submitting || !visibleRoutes.length,
3933
+ btnRef: payTileRef,
3934
+ onClick: () => setView("select")
3935
+ }
3936
+ ) }),
3937
+ flow.status === "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-route", style: { marginTop: 12 }, children: [
3938
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel" }),
3939
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-muted", style: { fontSize: 13 }, children: [
3940
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-spinner" }),
3941
+ " Finding the best way to pay\u2026"
3942
+ ] })
3943
+ ] }) : null,
3944
+ flow.status === "error" && flow.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
3945
+ sel && selectedVisible && flow.status !== "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3946
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You pay" }),
3947
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3948
+ sel.source.payAmount,
3972
3949
  " ",
3973
- props.toAsset
3950
+ sel.source.asset
3974
3951
  ] }),
3975
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-sub", children: [
3976
- flow.verdict?.status === "confirmed" ? "Confirmed on-chain" : "Submitted \u2014 awaiting confirmation",
3977
- " \xB7 ",
3978
- shortAddress(props.recipient)
3952
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
3953
+ "on ",
3954
+ CHAIN_LABELS[sel.source.chainId] || sel.source.chainName,
3955
+ selBal ? ` \xB7 balance ${selBal.formatted}` : ""
3979
3956
  ] })
3980
- ] }),
3981
- lastTxOwned ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", onClick: () => setHist({ entry: flow.lastTxEntry }), children: "View transaction" }) }) : null
3982
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3983
- /* @__PURE__ */ jsxRuntime.jsx(MethodTabs, { value: method, onChange: setMethod }),
3984
- parked ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: comingSoon }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3985
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(
3986
- TokenTile,
3987
- {
3988
- label: "Pay with",
3989
- pick: selPick,
3990
- token: selToken,
3991
- disabled: submitting || !visibleRoutes.length,
3992
- btnRef: payTileRef,
3993
- onClick: () => setView("select")
3994
- }
3995
- ) }),
3996
- flow.status === "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-route", style: { marginTop: 12 }, children: [
3997
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel" }),
3998
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-muted", style: { fontSize: 13 }, children: [
3999
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-spinner" }),
4000
- " Finding the best way to pay\u2026"
4001
- ] })
4002
- ] }) : null,
4003
- flow.status === "error" && flow.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
4004
- sel && selectedVisible && flow.status !== "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
4005
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You pay" }),
4006
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
4007
- sel.source.payAmount,
4008
- " ",
4009
- sel.source.asset
4010
- ] }),
4011
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
4012
- "on ",
4013
- CHAIN_LABELS[sel.source.chainId] || sel.source.chainName,
4014
- selBal ? ` \xB7 balance ${selBal.formatted}` : ""
4015
- ] })
4016
- ] }) : null,
4017
- why ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-why", style: { marginTop: 10 }, children: why }) : null,
4018
- scannedEmpty ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-note", children: "None of your balances can cover this yet \u2014 pick a different asset to fund with." }) : null,
4019
- flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null
4020
- ] }),
4021
- submitting ? /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps: flow.steps }) : null,
4022
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: parked || !selectedVisible ? void 0 : flow.submit, busy: submitting, disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading", children: payLabel }) })
4023
- ] })
4024
- ] }) });
3957
+ ] }) : null,
3958
+ why ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-why", style: { marginTop: 10 }, children: why }) : null,
3959
+ scannedEmpty ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-note", children: "None of your balances can cover this yet \u2014 pick a different asset to fund with." }) : null,
3960
+ flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null
3961
+ ] }),
3962
+ submitting ? /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps: flow.steps }) : null,
3963
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: parked || !selectedVisible ? void 0 : flow.submit, busy: submitting, disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading", children: payLabel }) })
3964
+ ] }) }) });
4025
3965
  }
4026
3966
  var chainOptions = SUPPORTED_CHAINS.map((c) => ({ value: c, label: CHAIN_LABELS[c] || `Chain ${c}` }));
4027
3967
  var assetOptions = SUPPORTED_ASSETS2.map((a) => ({ value: a, label: a }));
package/dist/mount.js CHANGED
@@ -1,2 +1,2 @@
1
- export { mount } from './chunk-DSQ7MRF7.js';
1
+ export { mount } from './chunk-6FPSGLRR.js';
2
2
  import './chunk-VL5MWEY2.js';