@glacislabs/stablegenie-zerodelta 4.14.1 → 4.15.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/{chunk-B74WAUBW.js → chunk-3U5Z5CC3.js} +105 -46
- package/dist/{chunk-43VO6XXW.js → chunk-GWQKWJJA.js} +6 -2
- package/dist/core/index.cjs +6 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +110 -47
- package/dist/index.js +2 -2
- package/dist/mount.cjs +110 -47
- package/dist/mount.js +2 -2
- package/dist/standalone.global.js +29 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -579,6 +579,8 @@ var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_fail
|
|
|
579
579
|
var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim"]);
|
|
580
580
|
var TRACKING = Object.freeze({ phase: "tracking", status: "", steps: [] });
|
|
581
581
|
var word = (v) => typeof v === "string" ? v.trim().toLowerCase() : "";
|
|
582
|
+
var STEP_ORDER = { submitted: 0, arrived: 1, filled: 2, delivered: 3 };
|
|
583
|
+
var STATUS_REACHED = { in_progress: 1, outbound_bridging: 2, delivery_failed: 2, delivered: 3 };
|
|
582
584
|
function normalizeDelivery(raw2) {
|
|
583
585
|
const row = raw2 && typeof raw2 === "object" && !Array.isArray(raw2) ? raw2.data ?? raw2 : null;
|
|
584
586
|
if (!row || typeof row !== "object" || Array.isArray(row)) return TRACKING;
|
|
@@ -588,7 +590,9 @@ function normalizeDelivery(raw2) {
|
|
|
588
590
|
const own = word(r.status);
|
|
589
591
|
const status = journey || own;
|
|
590
592
|
const rawSteps = Array.isArray(r.steps) ? r.steps : [];
|
|
591
|
-
const
|
|
593
|
+
const listed = rawSteps.filter((s) => s && typeof s === "object" && typeof s.stepName === "string").sort((a, b) => Number(a.stepNumber ?? 0) - Number(b.stepNumber ?? 0)).slice(0, 8).map((s) => ({ name: String(s.stepName).slice(0, 32), done: s.stepStatus === "completed" }));
|
|
594
|
+
const reached = Math.max(STATUS_REACHED[own] ?? -1, ...listed.filter((s) => s.done).map((s) => STEP_ORDER[s.name] ?? -1));
|
|
595
|
+
const steps = listed.map((s) => (STEP_ORDER[s.name] ?? Infinity) <= reached ? { ...s, done: true } : s);
|
|
592
596
|
if (!status) return TRACKING;
|
|
593
597
|
if (FAILED.has(status)) return { phase: "failed", status, steps };
|
|
594
598
|
if (ATTENTION.has(status)) return { phase: "attention", status, steps };
|
|
@@ -3563,7 +3567,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
3563
3567
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
3564
3568
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
3565
3569
|
var WIDGET_CHANNEL = "widget";
|
|
3566
|
-
var WIDGET_VERSION = "4.
|
|
3570
|
+
var WIDGET_VERSION = "4.15.0" ;
|
|
3567
3571
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
3568
3572
|
function sanitizeVersion(raw2) {
|
|
3569
3573
|
const v = String(raw2).trim();
|
|
@@ -6168,13 +6172,13 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
|
|
|
6168
6172
|
.sg-ws-back:hover{color:var(--sg-text)}
|
|
6169
6173
|
.sg-ws-close{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;background:transparent;color:#a7a9be;cursor:pointer}
|
|
6170
6174
|
.sg-ws-close:hover{color:var(--sg-text)}
|
|
6171
|
-
.sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible
|
|
6175
|
+
.sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
|
|
6172
6176
|
.sg-ws-main{display:flex;flex-direction:column;gap:16px}
|
|
6173
6177
|
.sg-ws-title{margin:0;font-family:var(--sg-font-display);font-size:16px;font-weight:600;line-height:1.2;letter-spacing:.32px;color:var(--sg-t90)}
|
|
6174
6178
|
.sg-ws[data-wide]{gap:16px}
|
|
6175
6179
|
.sg-ws[data-wide] .sg-ws-sum-lead{min-width:0}
|
|
6176
6180
|
.sg-ws[data-wide] .sg-ws-sum-text{overflow:hidden;text-overflow:ellipsis}
|
|
6177
|
-
.sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-
|
|
6181
|
+
.sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-value[data-tone="choose"],.sg-ws-icon-btn,.sg-rcp-tick){color:var(--sg-info)}
|
|
6178
6182
|
.sg-ws[data-wide] .sg-ws-back{font-size:12px;font-weight:400}
|
|
6179
6183
|
.sg-ws[data-wide] .sg-ws-title{font-family:var(--sg-font);font-size:18px;font-weight:500;letter-spacing:0}
|
|
6180
6184
|
.sg-ws-list{display:flex;flex-direction:column;gap:4px}
|
|
@@ -6219,16 +6223,20 @@ button.sg-ws-sum{cursor:pointer}
|
|
|
6219
6223
|
.sg-ws-foot{flex:0 0 auto}
|
|
6220
6224
|
.sg-btn.sg-ws-cta{height:44px;min-height:44px;padding:0 24px}
|
|
6221
6225
|
.sg-btn.sg-ws-cta:disabled{opacity:.2;cursor:not-allowed}
|
|
6222
|
-
.sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border-radius:24px;background:var(--sg-a4);font-size:12px;line-height:1.2;white-space:nowrap}
|
|
6226
|
+
.sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border:0;border-radius:24px;background:var(--sg-a4);color:inherit;font:inherit;font-size:12px;line-height:1.2;text-align:left;white-space:nowrap}
|
|
6227
|
+
button.sg-rcp-row{cursor:pointer}
|
|
6228
|
+
button.sg-rcp-row:hover:not(:disabled){background:color-mix(in srgb,var(--sg-accent) 8%,transparent)}
|
|
6229
|
+
button.sg-rcp-row[data-wide]:hover:not(:disabled){background:var(--sg-a4)}
|
|
6230
|
+
button.sg-rcp-row:disabled{cursor:not-allowed;opacity:.6}
|
|
6231
|
+
button.sg-rcp-row:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
|
|
6223
6232
|
.sg-rcp-row[data-wide]{background:transparent;border:1px solid var(--sg-a12);padding:12px 16px}
|
|
6224
6233
|
.sg-rcp-row[data-tone="error"]{white-space:normal;color:var(--sg-danger);background:color-mix(in srgb,var(--sg-danger) 8%,transparent)}
|
|
6225
6234
|
.sg-rcp-label{color:var(--sg-t60)}
|
|
6226
|
-
.sg-rcp-end{display:inline-flex;align-items:center;gap:
|
|
6227
|
-
.sg-rcp-
|
|
6228
|
-
.sg-rcp-value
|
|
6229
|
-
.sg-rcp-
|
|
6230
|
-
.sg-rcp-
|
|
6231
|
-
.sg-rcp-change:disabled{opacity:.5;cursor:not-allowed}
|
|
6235
|
+
.sg-rcp-end{display:inline-flex;align-items:center;gap:4px;min-width:0}
|
|
6236
|
+
.sg-rcp-end svg{flex:0 0 auto;color:var(--sg-t80)}
|
|
6237
|
+
.sg-rcp-value{color:var(--sg-t90);font-weight:500;overflow:hidden;text-overflow:ellipsis}
|
|
6238
|
+
.sg-rcp-value[data-tone="choose"]{color:var(--sg-accent)}
|
|
6239
|
+
.sg-rcp-value[data-empty]{color:var(--sg-t50);font-weight:400}
|
|
6232
6240
|
.sg-rcp-opt{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;width:100%;padding:18px 16px;border:1px solid var(--sg-a12);border-radius:24px;background:transparent;color:var(--sg-text);font:inherit;text-align:left;cursor:pointer}
|
|
6233
6241
|
.sg-rcp-opt[data-selected]{border-color:transparent;background:var(--sg-a4)}
|
|
6234
6242
|
.sg-rcp-opt:hover:not(:disabled):not([data-selected]){border-color:color-mix(in srgb,var(--sg-accent) 40%,transparent)}
|
|
@@ -6239,10 +6247,17 @@ button.sg-ws-sum{cursor:pointer}
|
|
|
6239
6247
|
.sg-rcp-custom[data-open]{flex-direction:column;align-items:stretch;gap:8px;border-color:transparent;background:var(--sg-a4);cursor:default}
|
|
6240
6248
|
.sg-rcp-custom-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
6241
6249
|
.sg-rcp-custom-head label{cursor:text}
|
|
6242
|
-
.sg-rcp-input{box-sizing:border-box;width:100%;padding:11px
|
|
6250
|
+
.sg-rcp-input{display:block;box-sizing:border-box;width:100%;margin:0;padding:11px 12px;border:1px solid var(--sg-a12);border-radius:12px;background:var(--sg-bg);color:var(--sg-t90);font:inherit;font-size:12px;font-weight:400;line-height:1.2;outline:none;resize:none;overflow:hidden;word-break:break-all;overflow-wrap:anywhere}
|
|
6243
6251
|
.sg-rcp-input::placeholder{color:var(--sg-t50)}
|
|
6244
6252
|
.sg-rcp-input:focus{border-color:var(--sg-accent)}
|
|
6245
|
-
.sg-rcp-input[aria-invalid="true"]{border-color:var(--sg-
|
|
6253
|
+
.sg-rcp-input[aria-invalid="true"]{border-color:color-mix(in srgb,var(--sg-flag) 12%,transparent)}
|
|
6254
|
+
.sg-rcp-input[aria-invalid="true"]:focus{border-color:color-mix(in srgb,var(--sg-flag) 40%,transparent)}
|
|
6255
|
+
.sg-rcp-custom[data-invalid]{background:color-mix(in srgb,var(--sg-flag) 6%,transparent)}
|
|
6256
|
+
.sg-rcp-custom[data-invalid] .sg-rcp-custom-head label{color:var(--sg-t90)}
|
|
6257
|
+
.sg-rcp-custom[data-invalid] .sg-ws-error{font-size:11px;line-height:1.2;color:var(--sg-flag)}
|
|
6258
|
+
.sg-rcp-bad{display:flex;color:var(--sg-flag);opacity:.8;flex:0 0 auto}
|
|
6259
|
+
/* The wide card beside an open sheet draws its disabled CTA like the sheet's own (Figma 3155:50731, 20%). */
|
|
6260
|
+
.sg-duo .sg-cta-wrap .sg-btn:disabled{opacity:.2}
|
|
6246
6261
|
.sg-rcp-hint{margin:0;font-size:12px;font-weight:400;line-height:1.2;color:var(--sg-t60)}
|
|
6247
6262
|
.sg-widget[data-sg-takeover]{display:flex;flex-direction:column}
|
|
6248
6263
|
.sg-widget[data-sg-takeover]>.sg-head,.sg-widget[data-sg-takeover]>.sg-foot{display:none}
|
|
@@ -8537,8 +8552,8 @@ function ShieldTickBold() {
|
|
|
8537
8552
|
}
|
|
8538
8553
|
) });
|
|
8539
8554
|
}
|
|
8540
|
-
function CloseCircleBold() {
|
|
8541
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width:
|
|
8555
|
+
function CloseCircleBold({ size = 14 }) {
|
|
8556
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8542
8557
|
"path",
|
|
8543
8558
|
{
|
|
8544
8559
|
fill: "currentColor",
|
|
@@ -8627,9 +8642,7 @@ function SheetFrame(props) {
|
|
|
8627
8642
|
}
|
|
8628
8643
|
function WalletChip(props) {
|
|
8629
8644
|
const count = props.addresses.length;
|
|
8630
|
-
if (!count)
|
|
8631
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-wallet", onClick: props.onConnect, disabled: props.connecting, children: props.connecting ? "Connecting\u2026" : "Connect wallet" });
|
|
8632
|
-
}
|
|
8645
|
+
if (!count) return null;
|
|
8633
8646
|
const label2 = count === 1 ? chipShort(props.addresses[0]) : `${count} wallets`;
|
|
8634
8647
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", ref: props.btnRef, className: "sg-wallet", "data-connected": "true", onClick: props.onOpen, disabled: props.disabled, "aria-haspopup": "dialog", "aria-label": `Wallets: ${label2}`, children: [
|
|
8635
8648
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-wallet-dot", "aria-hidden": "true" }),
|
|
@@ -8704,19 +8717,44 @@ function RecipientRow({ state, disabled, wide }) {
|
|
|
8704
8717
|
if (state.error) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-rcp-row", "data-wide": wide || void 0, "data-tone": "error", role: "alert", children: state.error });
|
|
8705
8718
|
const address = state.shown;
|
|
8706
8719
|
if (!address && !state.managed) return null;
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
] })
|
|
8717
|
-
|
|
8720
|
+
const value = address ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-value", title: address, children: [
|
|
8721
|
+
FAMILY_LABEL[state.recipientFamily],
|
|
8722
|
+
" \xB7 ",
|
|
8723
|
+
chipShort(address)
|
|
8724
|
+
] }) : state.missing ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-tone": "choose", children: "Choose" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-empty": "true", children: "--" });
|
|
8725
|
+
if (!state.managed) {
|
|
8726
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-row", "data-wide": wide || void 0, children: [
|
|
8727
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
|
|
8728
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-end", children: value })
|
|
8729
|
+
] });
|
|
8730
|
+
}
|
|
8731
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8732
|
+
"button",
|
|
8733
|
+
{
|
|
8734
|
+
ref: state.triggerRef,
|
|
8735
|
+
type: "button",
|
|
8736
|
+
className: "sg-rcp-row",
|
|
8737
|
+
"data-wide": wide || void 0,
|
|
8738
|
+
onClick: state.show,
|
|
8739
|
+
disabled,
|
|
8740
|
+
"aria-haspopup": "dialog",
|
|
8741
|
+
"aria-label": address ? `Recipient: ${FAMILY_LABEL[state.recipientFamily]} ${chipShort(address)}. Change recipient` : "Choose recipient",
|
|
8742
|
+
children: [
|
|
8743
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
|
|
8744
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-end", children: [
|
|
8745
|
+
value,
|
|
8746
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronRight, {})
|
|
8747
|
+
] })
|
|
8748
|
+
]
|
|
8749
|
+
}
|
|
8750
|
+
);
|
|
8718
8751
|
}
|
|
8719
|
-
function RecipientSheet({
|
|
8752
|
+
function RecipientSheet({
|
|
8753
|
+
state,
|
|
8754
|
+
wide,
|
|
8755
|
+
minHeight,
|
|
8756
|
+
onPending
|
|
8757
|
+
}) {
|
|
8720
8758
|
const family = state.recipientFamily;
|
|
8721
8759
|
const label2 = FAMILY_LABEL[family];
|
|
8722
8760
|
const eligible = state.wallets.filter((w) => w.eligible);
|
|
@@ -8726,7 +8764,6 @@ function RecipientSheet({ state, wide, minHeight }) {
|
|
|
8726
8764
|
return current ? { kind: "wallet", address: current.address } : { kind: "custom" };
|
|
8727
8765
|
});
|
|
8728
8766
|
const [draft, setDraft] = react.useState(state.typed);
|
|
8729
|
-
const [editing, setEditing] = react.useState(false);
|
|
8730
8767
|
const id = react.useId();
|
|
8731
8768
|
const inputRef = react.useRef(null);
|
|
8732
8769
|
const noWallet = family === "solana" && !state.familyWallet.address && !state.familyWallet.wallets.length;
|
|
@@ -8738,6 +8775,30 @@ function RecipientSheet({ state, wide, minHeight }) {
|
|
|
8738
8775
|
const chosenWallet = choice.kind === "wallet" ? eligible.find((w) => w.address === choice.address) : void 0;
|
|
8739
8776
|
const ready = choice.kind === "wallet" ? Boolean(chosenWallet) : valid;
|
|
8740
8777
|
const custom = choice.kind === "custom";
|
|
8778
|
+
const appliedWallet = state.typed ? null : state.recipient ?? state.shown ?? null;
|
|
8779
|
+
const pending = choice.kind === "custom" ? !state.typed || draft.trim() !== state.typed : choice.address !== appliedWallet;
|
|
8780
|
+
const pendingRef = react.useRef(onPending);
|
|
8781
|
+
pendingRef.current = onPending;
|
|
8782
|
+
react.useEffect(() => pendingRef.current?.(pending), [pending]);
|
|
8783
|
+
react.useEffect(() => () => pendingRef.current?.(false), []);
|
|
8784
|
+
react.useLayoutEffect(() => {
|
|
8785
|
+
const el = inputRef.current;
|
|
8786
|
+
if (!el) return;
|
|
8787
|
+
const fit = () => {
|
|
8788
|
+
el.style.height = "auto";
|
|
8789
|
+
el.style.height = `${el.scrollHeight + (el.offsetHeight - el.clientHeight)}px`;
|
|
8790
|
+
};
|
|
8791
|
+
fit();
|
|
8792
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
8793
|
+
let width = el.clientWidth;
|
|
8794
|
+
const observer = new ResizeObserver(() => {
|
|
8795
|
+
if (el.clientWidth === width) return;
|
|
8796
|
+
width = el.clientWidth;
|
|
8797
|
+
fit();
|
|
8798
|
+
});
|
|
8799
|
+
observer.observe(el);
|
|
8800
|
+
return () => observer.disconnect();
|
|
8801
|
+
}, [draft, custom, wide]);
|
|
8741
8802
|
react.useEffect(() => {
|
|
8742
8803
|
if (custom) inputRef.current?.focus();
|
|
8743
8804
|
}, [custom]);
|
|
@@ -8794,33 +8855,35 @@ function RecipientSheet({ state, wide, minHeight }) {
|
|
|
8794
8855
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: wallet.name }),
|
|
8795
8856
|
/* @__PURE__ */ jsxRuntime.jsx(AddCircle, {})
|
|
8796
8857
|
] }, wallet.name)) : null,
|
|
8797
|
-
custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", children: [
|
|
8858
|
+
custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", "data-invalid": invalid || void 0, children: [
|
|
8798
8859
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom-head", children: [
|
|
8799
8860
|
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, children: "Add another address" }),
|
|
8800
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
|
|
8861
|
+
invalid ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-bad", children: /* @__PURE__ */ jsxRuntime.jsx(CloseCircleBold, { size: 16 }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
|
|
8801
8862
|
] }),
|
|
8802
8863
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8803
|
-
"
|
|
8864
|
+
"textarea",
|
|
8804
8865
|
{
|
|
8805
8866
|
ref: inputRef,
|
|
8867
|
+
rows: 1,
|
|
8806
8868
|
id,
|
|
8807
8869
|
className: "sg-rcp-input",
|
|
8808
8870
|
placeholder: family === "solana" ? "Solana recipient address" : "0x...Recipient address",
|
|
8809
8871
|
"aria-label": `${label2} recipient address`,
|
|
8810
8872
|
"aria-invalid": invalid || void 0,
|
|
8811
8873
|
"aria-describedby": invalid ? `${id}-error` : void 0,
|
|
8812
|
-
value:
|
|
8813
|
-
|
|
8814
|
-
onBlur: () => setEditing(false),
|
|
8815
|
-
onChange: (event) => setDraft(event.target.value),
|
|
8874
|
+
value: draft,
|
|
8875
|
+
onChange: (event) => setDraft(event.target.value.replace(/\s+/g, "")),
|
|
8816
8876
|
onKeyDown: (event) => {
|
|
8817
|
-
if (event.key === "Enter")
|
|
8877
|
+
if (event.key === "Enter") {
|
|
8878
|
+
event.preventDefault();
|
|
8879
|
+
confirm();
|
|
8880
|
+
}
|
|
8818
8881
|
},
|
|
8819
8882
|
spellCheck: false,
|
|
8820
8883
|
autoComplete: "off"
|
|
8821
8884
|
}
|
|
8822
8885
|
),
|
|
8823
|
-
invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `
|
|
8886
|
+
invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `Enter a valid ${label2} address` }) : null,
|
|
8824
8887
|
noWallet ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-rcp-hint", children: [
|
|
8825
8888
|
"No ",
|
|
8826
8889
|
label2,
|
|
@@ -10971,6 +11034,8 @@ function ExchangeCard(props) {
|
|
|
10971
11034
|
const title = config.title || (mode === "onramp" ? "Buy stablecoins" : mode === "offramp" ? "Cash out" : "Exchange");
|
|
10972
11035
|
const soonLabel = mode === "onramp" ? "On-ramp coming soon" : "Off-ramp coming soon";
|
|
10973
11036
|
const quotePaused = solActive ? false : addressed ? flow.quotePaused : idle2 && preview.status === "ready";
|
|
11037
|
+
const [recipientPending, setRecipientPending] = react.useState(false);
|
|
11038
|
+
const recipientLocked = wide && recipientState.open && recipientPending;
|
|
10974
11039
|
const ctaLabel = rampMode ? soonLabel : submitting ? "Exchanging\u2026" : connected2 && flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall || "Exchange";
|
|
10975
11040
|
const selected = addressed ? flow.selected : null;
|
|
10976
11041
|
const hasQuote = Boolean(quotable && !quoting && !quoteError && receive);
|
|
@@ -11004,8 +11069,6 @@ function ExchangeCard(props) {
|
|
|
11004
11069
|
WalletChip,
|
|
11005
11070
|
{
|
|
11006
11071
|
addresses: sheetWallets.map((w) => w.address),
|
|
11007
|
-
connecting: wallet.connecting,
|
|
11008
|
-
onConnect: wallet.connect,
|
|
11009
11072
|
btnRef: walletChipRef,
|
|
11010
11073
|
disabled: submitting,
|
|
11011
11074
|
onOpen: () => {
|
|
@@ -11074,7 +11137,7 @@ function ExchangeCard(props) {
|
|
|
11074
11137
|
connect: !wallet.account ? { family: "evm", onClick: () => void wallet.connect(), busy: wallet.connecting } : !solanaWallet.address ? { family: "solana", onClick: (name) => void solanaWallet.connect(name), busy: solanaWallet.status === "connecting", choices: solanaWallet.wallets.map((w) => w.name) } : void 0,
|
|
11075
11138
|
error: solanaWallet.error || wallet.error
|
|
11076
11139
|
}
|
|
11077
|
-
) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11140
|
+
) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide, onPending: wide ? setRecipientPending : void 0 }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11078
11141
|
QuoteSheet,
|
|
11079
11142
|
{
|
|
11080
11143
|
onClose: closeSheet,
|
|
@@ -11111,7 +11174,7 @@ function ExchangeCard(props) {
|
|
|
11111
11174
|
{
|
|
11112
11175
|
onClick: solFlow.run,
|
|
11113
11176
|
busy: submitting,
|
|
11114
|
-
disabled: !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
|
|
11177
|
+
disabled: recipientLocked || !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
|
|
11115
11178
|
children: solFlow.status === "preparing" ? "Preparing order\u2026" : solFlow.status === "submitting" ? "Submitting\u2026" : solFlow.insufficient ? "Insufficient balance" : solFlow.solShort ? "Not enough SOL for network fees" : solFlow.status === "failed" ? "Try again" : !solFlow.plan ? "Exchange" : solFlow.needsPreparation ? "Continue in wallet" : "Submit"
|
|
11116
11179
|
}
|
|
11117
11180
|
);
|
|
@@ -11205,7 +11268,7 @@ function ExchangeCard(props) {
|
|
|
11205
11268
|
"Connect ",
|
|
11206
11269
|
recipientState.recipientFamily === "solana" ? "Solana" : "EVM",
|
|
11207
11270
|
" wallet"
|
|
11208
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
|
|
11271
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || recipientLocked || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
|
|
11209
11272
|
wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
|
|
11210
11273
|
] });
|
|
11211
11274
|
const notices = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -11226,7 +11289,7 @@ function ExchangeCard(props) {
|
|
|
11226
11289
|
] }),
|
|
11227
11290
|
amountField,
|
|
11228
11291
|
amountNoteEl,
|
|
11229
|
-
/* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode
|
|
11292
|
+
/* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
|
|
11230
11293
|
] })
|
|
11231
11294
|
] }),
|
|
11232
11295
|
notices,
|
|
@@ -11244,7 +11307,7 @@ function ExchangeCard(props) {
|
|
|
11244
11307
|
payToken
|
|
11245
11308
|
] }),
|
|
11246
11309
|
amountNoteEl,
|
|
11247
|
-
/* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode
|
|
11310
|
+
/* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
|
|
11248
11311
|
] }),
|
|
11249
11312
|
/* @__PURE__ */ jsxRuntime.jsx(FlipButton, { onClick: flip, disabled: !flippable }),
|
|
11250
11313
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane", "data-kind": "receive", children: [
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, connectSolanaWallet, darkTheme, disconnectSolanaWallet, discoverSolanaWallets, lightTheme, mount, onSolanaAccountChange, resolveTheme, solanaWalletSigner, useSolanaWallet, watchSolanaWallets } from './chunk-
|
|
2
|
-
export { EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, assetClassOf, brokenLaneReason, complianceChecks, complianceControlsLine, complianceView, counterpartTokens, createEngine, destinationAvailability, formatJurisdiction, humanizeComplianceReason, symbolKey } from './chunk-
|
|
1
|
+
export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, connectSolanaWallet, darkTheme, disconnectSolanaWallet, discoverSolanaWallets, lightTheme, mount, onSolanaAccountChange, resolveTheme, solanaWalletSigner, useSolanaWallet, watchSolanaWallets } from './chunk-3U5Z5CC3.js';
|
|
2
|
+
export { EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, assetClassOf, brokenLaneReason, complianceChecks, complianceControlsLine, complianceView, counterpartTokens, createEngine, destinationAvailability, formatJurisdiction, humanizeComplianceReason, symbolKey } from './chunk-GWQKWJJA.js';
|