@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/index.cjs CHANGED
@@ -2247,9 +2247,7 @@ var WIDGET_CSS = `
2247
2247
  .sg-soonpanel-title{font-size:14px;font-weight:700;margin-bottom:6px}
2248
2248
  .sg-soonpanel-sub{font-size:12px;color:var(--sg-text-muted);line-height:1.45}
2249
2249
 
2250
- /* compact merchant-receives anchor + click-to-expand "Details" disclosure (merchant-configured;
2251
- the payer never edits it). Reveal mirrors the island's grid-rows morph; reduced-motion covered by
2252
- the .sg-island guard below (it disables transitions on .sg-island *). */
2250
+ /* payout slot \u2014 bank settlement only (the stablecoin destination anchor is never rendered) */
2253
2251
  .sg-merch-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
2254
2252
  .sg-merch-lead{min-width:0}
2255
2253
  /* bank payout destination (settlement="bank") \u2014 sits in the same anchor slot as the stablecoin
@@ -2259,19 +2257,6 @@ var WIDGET_CSS = `
2259
2257
  .sg-bank-text{display:flex;flex-direction:column;min-width:0}
2260
2258
  .sg-bank-name{font-size:16px;font-weight:700;color:var(--sg-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
2261
2259
  .sg-bank-cur{font-size:12px;color:var(--sg-text-muted)}
2262
- .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)}
2263
- .sg-details-toggle:hover{color:var(--sg-accent);border-color:var(--sg-accent)}
2264
- .sg-details-chev{display:inline-flex;font-size:11px;line-height:1;transition:transform var(--sg-motion-fast) var(--sg-ease-out-soft)}
2265
- .sg-details-toggle[data-open="true"] .sg-details-chev{transform:rotate(180deg)}
2266
- .sg-details-reveal{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--sg-motion-base) var(--sg-ease-out-soft)}
2267
- .sg-details-reveal[data-open="true"]{grid-template-rows:1fr}
2268
- .sg-details-reveal-inner{min-height:0;overflow:hidden}
2269
- .sg-details-body{margin-top:12px;padding-top:12px;border-top:1px solid var(--sg-border)}
2270
- .sg-details-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:4px 0;font-size:12px}
2271
- .sg-details-k{flex:0 0 auto;color:var(--sg-text-muted)}
2272
- .sg-details-v{min-width:0;text-align:right;color:var(--sg-text)}
2273
- .sg-details-addr{word-break:break-all;font-size:11px}
2274
- .sg-details-note{margin-top:8px;font-size:11px;color:var(--sg-text-muted);line-height:1.45}
2275
2260
 
2276
2261
  /* express-card compaction for the 5-tab method selector (already overflow-x:auto for narrow cells) */
2277
2262
  .sg-widget[data-sg-express] .sg-tabs{margin:12px 0 8px}
@@ -2301,7 +2286,7 @@ var WIDGET_CSS = `
2301
2286
  broken) and shows the static accent dot instead; the label + live region carry the state. */
2302
2287
  @media (prefers-reduced-motion:reduce){
2303
2288
  .sg-island,.sg-island *{transition:none!important;animation:none!important}
2304
- .sg-island-reveal,.sg-details-reveal{transition:none!important}
2289
+ .sg-island-reveal{transition:none!important}
2305
2290
  .sg-island .sg-spinner{display:none!important}
2306
2291
  .sg-island .sg-rm-dot{display:inline-block}
2307
2292
  }
@@ -2549,14 +2534,22 @@ function StepList(props) {
2549
2534
  }
2550
2535
  var SHOW_ROADMAP_METHODS = true;
2551
2536
  var METHODS = [
2552
- { id: "recommended", label: "Recommended", live: true },
2553
2537
  { id: "stablecoin", label: "Stablecoin", live: true },
2554
- { id: "anyasset", label: "Any asset", live: true },
2555
2538
  { id: "card", label: "Card", live: false },
2556
- { id: "bank", label: "Bank", live: false }
2539
+ { id: "bank", label: "Bank account", live: false }
2557
2540
  ];
2558
2541
  function isLiveMethod(m) {
2559
- return m === "recommended" || m === "stablecoin" || m === "anyasset";
2542
+ return m === "stablecoin";
2543
+ }
2544
+ function balanceRank(raw, decimals) {
2545
+ if (raw == null) return 0n;
2546
+ try {
2547
+ const d = Number.isFinite(Number(decimals)) ? Math.max(0, Math.trunc(Number(decimals))) : 18;
2548
+ const v = BigInt(raw);
2549
+ return d <= 18 ? v * 10n ** BigInt(18 - d) : v / 10n ** BigInt(d - 18);
2550
+ } catch {
2551
+ return 0n;
2552
+ }
2560
2553
  }
2561
2554
  function MethodTabs(props) {
2562
2555
  const showRoadmap = props.showRoadmap ?? SHOW_ROADMAP_METHODS;
@@ -3031,55 +3024,6 @@ function forgetIdentity(account) {
3031
3024
  var addrEq = (a, b) => String(a || "").toLowerCase() === String(b || "").toLowerCase();
3032
3025
  var chainName = (id) => id != null ? CHAIN_LABELS[id] || `Chain ${id}` : "";
3033
3026
  var STABLES = /* @__PURE__ */ new Set(["USDC", "USDT", "USDE"]);
3034
- function MerchantReceives(props) {
3035
- const [open, setOpen] = react.useState(false);
3036
- const bodyId = react.useId();
3037
- const hasDetails = Boolean(props.recipient);
3038
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel sg-merch", children: [
3039
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-merch-head", children: [
3040
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-merch-lead", children: [
3041
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "Merchant receives exactly" }),
3042
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3043
- props.amount,
3044
- " ",
3045
- props.asset
3046
- ] })
3047
- ] }),
3048
- hasDetails ? /* @__PURE__ */ jsxRuntime.jsxs(
3049
- "button",
3050
- {
3051
- type: "button",
3052
- className: "sg-details-toggle",
3053
- "data-open": open,
3054
- "aria-expanded": open,
3055
- "aria-controls": bodyId,
3056
- onClick: () => setOpen((o) => !o),
3057
- children: [
3058
- "Details",
3059
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-chev", "aria-hidden": "true", children: "\u2304" })
3060
- ]
3061
- }
3062
- ) : null
3063
- ] }),
3064
- 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: [
3065
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-row", children: [
3066
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-k", children: "Network" }),
3067
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-v", children: chainName(props.chainId) })
3068
- ] }),
3069
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-row", children: [
3070
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-k", children: "Recipient" }),
3071
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-details-v sg-mono sg-details-addr", children: props.recipient })
3072
- ] }),
3073
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-details-note", children: [
3074
- "Settled like a card \u2014 the merchant always receives exactly ",
3075
- props.amount,
3076
- " ",
3077
- props.asset,
3078
- ". You pay a little more to cover the network cost."
3079
- ] })
3080
- ] }) }) }) : null
3081
- ] });
3082
- }
3083
3027
  function BankGlyph() {
3084
3028
  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" }) });
3085
3029
  }
@@ -3282,7 +3226,7 @@ function PaymentIsland(props) {
3282
3226
  onSuccess: config.onSuccess,
3283
3227
  onError: config.onError
3284
3228
  });
3285
- const [method, setMethod] = react.useState("recommended");
3229
+ const [method, setMethod] = react.useState("stablecoin");
3286
3230
  const parked = isPay && !isLiveMethod(method);
3287
3231
  const fundingSet = react.useMemo(
3288
3232
  () => props.fundingAssets?.length ? new Set(props.fundingAssets.map((a) => a.toUpperCase())) : null,
@@ -3308,7 +3252,13 @@ function PaymentIsland(props) {
3308
3252
  }),
3309
3253
  [visibleRoutes, holdings.balances]
3310
3254
  );
3311
- const held = react.useMemo(() => annotated.filter((a) => a.affordable === true), [annotated]);
3255
+ const held = react.useMemo(
3256
+ () => annotated.filter((a) => a.affordable === true).sort((a, b) => {
3257
+ const d = balanceRank(b.balance?.raw, b.route.source.decimals) - balanceRank(a.balance?.raw, a.route.source.decimals);
3258
+ return d > 0n ? 1 : d < 0n ? -1 : 0;
3259
+ }),
3260
+ [annotated]
3261
+ );
3312
3262
  const heldIds = react.useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
3313
3263
  const optionStates = react.useMemo(() => {
3314
3264
  const map = {};
@@ -3497,9 +3447,7 @@ function PaymentIsland(props) {
3497
3447
  const lastTxOwned = Boolean(flow.lastTxEntry?.hash && wallet.account && flow.lastTxEntry.account === wallet.account.toLowerCase());
3498
3448
  const mismatch = flow.status === "error" && flow.verdict?.status === "mismatch";
3499
3449
  const destAsset = isPay ? props.toAsset : exToAsset;
3500
- const destChainId = isPay ? props.toChainId : exToChainId;
3501
- const anchorLabel = isPay ? "Merchant receives exactly" : "You receive (estimated)";
3502
- const anchorAmount = isPay ? props.amount : sel?.receive.amount ?? (flow.status === "loading" ? "\u2026" : "\u2014");
3450
+ const anchorAmount = sel?.receive.amount ?? (flow.status === "loading" ? "\u2026" : "\u2014");
3503
3451
  const successAmount = isPay ? props.amount : sel?.receive.amount;
3504
3452
  const money = props.moneyDisplay ?? (isPay ? props.amount ? `${props.amount} ${props.toAsset}` : "" : exAmount ? `${exAmount} ${exFromAsset ?? ""}`.trim() : "");
3505
3453
  const verb = isPay ? { present: "Pay", gerund: "Paying", past: "Paid" } : kind === "swap" ? { present: "Swap", gerund: "Swapping", past: "Swapped" } : { present: "Exchange", gerund: "Exchanging", past: "Exchanged" };
@@ -3621,7 +3569,7 @@ function PaymentIsland(props) {
3621
3569
  } else if (!wallet.account) {
3622
3570
  body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3623
3571
  /* @__PURE__ */ jsxRuntime.jsx(IdentityLine, { account: null, email: identity?.email }),
3624
- 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: [
3572
+ isPay ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3625
3573
  exchangeControls,
3626
3574
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3627
3575
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You receive (estimated)" }),
@@ -3692,10 +3640,10 @@ function PaymentIsland(props) {
3692
3640
  const walletError = flow.status === "error" && flow.steps.length > 0;
3693
3641
  body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3694
3642
  /* @__PURE__ */ jsxRuntime.jsx(IdentityLine, { account: wallet.account, email: identity?.email }),
3695
- 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: [
3643
+ isPay ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3696
3644
  exchangeControls,
3697
3645
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3698
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: anchorLabel }),
3646
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You receive (estimated)" }),
3699
3647
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3700
3648
  anchorAmount,
3701
3649
  " ",
@@ -3802,7 +3750,7 @@ function StableGeniePay(props) {
3802
3750
  onSuccess: config.onSuccess,
3803
3751
  onError: config.onError
3804
3752
  });
3805
- const [method, setMethod] = react.useState("recommended");
3753
+ const [method, setMethod] = react.useState("stablecoin");
3806
3754
  const fundingSet = react.useMemo(
3807
3755
  () => props.fundingAssets?.length ? new Set(props.fundingAssets.map((a) => a.toUpperCase())) : null,
3808
3756
  [props.fundingAssets]
@@ -3827,7 +3775,13 @@ function StableGeniePay(props) {
3827
3775
  }),
3828
3776
  [visibleRoutes, holdings.balances]
3829
3777
  );
3830
- const held = react.useMemo(() => annotated.filter((a) => a.affordable === true), [annotated]);
3778
+ const held = react.useMemo(
3779
+ () => annotated.filter((a) => a.affordable === true).sort((a, b) => {
3780
+ const d = balanceRank(b.balance?.raw, b.route.source.decimals) - balanceRank(a.balance?.raw, a.route.source.decimals);
3781
+ return d > 0n ? 1 : d < 0n ? -1 : 0;
3782
+ }),
3783
+ [annotated]
3784
+ );
3831
3785
  const heldIds = react.useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
3832
3786
  const scannedEmpty = !holdings.loading && Object.keys(holdings.balances).length > 0 && held.length === 0;
3833
3787
  const optionStates = react.useMemo(() => {
@@ -3930,7 +3884,6 @@ function StableGeniePay(props) {
3930
3884
  if (r) selectRoute(r.id);
3931
3885
  closeSelector();
3932
3886
  };
3933
- const chainName2 = CHAIN_LABELS[props.toChainId] || `Chain ${props.toChainId}`;
3934
3887
  const parked = !isLiveMethod(method);
3935
3888
  const submitting = flow.status === "submitting";
3936
3889
  const sel = flow.selected;
@@ -3938,7 +3891,10 @@ function StableGeniePay(props) {
3938
3891
  const selPick = sel && selectedVisible ? { chainId: sel.source.chainId, symbol: sel.source.asset } : null;
3939
3892
  const selToken = sel ? registryTokens.find((t) => Number(t.chainId) === sel.source.chainId && addrEq2(t.address, sel.source.tokenAddress)) ?? null : null;
3940
3893
  const selBal = sel ? holdings.balances[balanceKey(sel.source.chainId, sel.source.tokenAddress)] : void 0;
3941
- 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";
3894
+ 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` : (
3895
+ // Deliberately does NOT restate the destination amount — that is merchant config, not a payer fact.
3896
+ `Routed through ZeroDelta \xB7 the extra covers the network cost`
3897
+ ) : "Pay with USDC, USDT, or USDE from your wallet.";
3942
3898
  const comingSoon = method === "card" ? "Card payments are coming soon. Today StableGenie pays from your connected wallet." : "Bank transfers are coming soon.";
3943
3899
  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";
3944
3900
  const walletSlot = wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-head-tools", children: [
@@ -3949,82 +3905,66 @@ function StableGeniePay(props) {
3949
3905
  ] })
3950
3906
  ] }) : void 0;
3951
3907
  if (props.variant === "pill") return /* @__PURE__ */ jsxRuntime.jsx(PaymentIsland, { kind: "pay", ...props });
3952
- 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: [
3953
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", children: [
3954
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "Merchant receives exactly" }),
3955
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3908
+ 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: [
3909
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }),
3910
+ wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
3911
+ ] }) : flow.status === "success" || flow.status === "pending" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3912
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success", children: [
3913
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-success-check", "data-pending": flow.verdict?.status !== "confirmed", children: /* @__PURE__ */ jsxRuntime.jsx(CheckGlyph3, {}) }),
3914
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-amt sg-mono", children: [
3956
3915
  props.amount,
3957
3916
  " ",
3958
3917
  props.toAsset
3959
3918
  ] }),
3960
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
3961
- "on ",
3962
- chainName2,
3919
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-sub", children: [
3920
+ flow.verdict?.status === "confirmed" ? "Confirmed on-chain" : "Submitted \u2014 awaiting confirmation",
3963
3921
  " \xB7 ",
3964
3922
  shortAddress(props.recipient)
3965
3923
  ] })
3966
3924
  ] }),
3967
- !wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cta-wrap", children: [
3968
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }),
3969
- wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
3970
- ] }) : flow.status === "success" || flow.status === "pending" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3971
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success", children: [
3972
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-success-check", "data-pending": flow.verdict?.status !== "confirmed", children: /* @__PURE__ */ jsxRuntime.jsx(CheckGlyph3, {}) }),
3973
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-amt sg-mono", children: [
3974
- props.amount,
3925
+ 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
3926
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3927
+ /* @__PURE__ */ jsxRuntime.jsx(MethodTabs, { value: method, onChange: setMethod }),
3928
+ parked ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: comingSoon }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3929
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(
3930
+ TokenTile,
3931
+ {
3932
+ label: "Pay with",
3933
+ pick: selPick,
3934
+ token: selToken,
3935
+ disabled: submitting || !visibleRoutes.length,
3936
+ btnRef: payTileRef,
3937
+ onClick: () => setView("select")
3938
+ }
3939
+ ) }),
3940
+ flow.status === "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-route", style: { marginTop: 12 }, children: [
3941
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel" }),
3942
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-muted", style: { fontSize: 13 }, children: [
3943
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-spinner" }),
3944
+ " Finding the best way to pay\u2026"
3945
+ ] })
3946
+ ] }) : null,
3947
+ flow.status === "error" && flow.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
3948
+ sel && selectedVisible && flow.status !== "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
3949
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You pay" }),
3950
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
3951
+ sel.source.payAmount,
3975
3952
  " ",
3976
- props.toAsset
3953
+ sel.source.asset
3977
3954
  ] }),
3978
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-success-sub", children: [
3979
- flow.verdict?.status === "confirmed" ? "Confirmed on-chain" : "Submitted \u2014 awaiting confirmation",
3980
- " \xB7 ",
3981
- shortAddress(props.recipient)
3955
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
3956
+ "on ",
3957
+ CHAIN_LABELS[sel.source.chainId] || sel.source.chainName,
3958
+ selBal ? ` \xB7 balance ${selBal.formatted}` : ""
3982
3959
  ] })
3983
- ] }),
3984
- 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
3985
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3986
- /* @__PURE__ */ jsxRuntime.jsx(MethodTabs, { value: method, onChange: setMethod }),
3987
- parked ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: comingSoon }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3988
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(
3989
- TokenTile,
3990
- {
3991
- label: "Pay with",
3992
- pick: selPick,
3993
- token: selToken,
3994
- disabled: submitting || !visibleRoutes.length,
3995
- btnRef: payTileRef,
3996
- onClick: () => setView("select")
3997
- }
3998
- ) }),
3999
- flow.status === "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-route", style: { marginTop: 12 }, children: [
4000
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel" }),
4001
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-muted", style: { fontSize: 13 }, children: [
4002
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-spinner" }),
4003
- " Finding the best way to pay\u2026"
4004
- ] })
4005
- ] }) : null,
4006
- flow.status === "error" && flow.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
4007
- sel && selectedVisible && flow.status !== "loading" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-panel", style: { marginTop: 12 }, children: [
4008
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-label", children: "You pay" }),
4009
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor sg-mono", children: [
4010
- sel.source.payAmount,
4011
- " ",
4012
- sel.source.asset
4013
- ] }),
4014
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-anchor-sub", children: [
4015
- "on ",
4016
- CHAIN_LABELS[sel.source.chainId] || sel.source.chainName,
4017
- selBal ? ` \xB7 balance ${selBal.formatted}` : ""
4018
- ] })
4019
- ] }) : null,
4020
- why ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-why", style: { marginTop: 10 }, children: why }) : null,
4021
- 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,
4022
- flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null
4023
- ] }),
4024
- submitting ? /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps: flow.steps }) : null,
4025
- /* @__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 }) })
4026
- ] })
4027
- ] }) });
3960
+ ] }) : null,
3961
+ why ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-why", style: { marginTop: 10 }, children: why }) : null,
3962
+ 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,
3963
+ flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null
3964
+ ] }),
3965
+ submitting ? /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps: flow.steps }) : null,
3966
+ /* @__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 }) })
3967
+ ] }) }) });
4028
3968
  }
4029
3969
  var chainOptions = SUPPORTED_CHAINS.map((c) => ({ value: c, label: CHAIN_LABELS[c] || `Chain ${c}` }));
4030
3970
  var assetOptions = SUPPORTED_ASSETS2.map((a) => ({ value: a, label: a }));
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieSwap, darkTheme, lightTheme, mount, resolveTheme } from './chunk-DSQ7MRF7.js';
1
+ export { PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieSwap, darkTheme, lightTheme, mount, resolveTheme } from './chunk-6FPSGLRR.js';
2
2
  export { createEngine } from './chunk-VL5MWEY2.js';