@glacislabs/stablegenie-zerodelta 4.10.0 → 4.11.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-BOEY6DG5.js → chunk-5WTRI2KO.js} +22 -3
- package/dist/{chunk-AWTQU6CW.js → chunk-TNAW2SWI.js} +97 -30
- package/dist/core/index.cjs +22 -2
- package/dist/core/index.d.cts +19 -3
- package/dist/core/index.d.ts +19 -3
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +117 -31
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{mount-Bw7W3Bfk.d.ts → mount-hxb3zioQ.d.ts} +1 -1
- package/dist/{mount-wJ7WrkOC.d.cts → mount-xruGixNZ.d.cts} +1 -1
- package/dist/mount.cjs +117 -31
- package/dist/mount.d.cts +2 -2
- package/dist/mount.d.ts +2 -2
- package/dist/mount.js +2 -2
- package/dist/standalone.global.js +14 -9
- package/dist/{verify-QEs-XHri.d.cts → verify-D8tr1yY1.d.cts} +6 -0
- package/dist/{verify-QEs-XHri.d.ts → verify-D8tr1yY1.d.ts} +6 -0
- package/package.json +1 -1
package/dist/mount.cjs
CHANGED
|
@@ -1717,7 +1717,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
1717
1717
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
1718
1718
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
1719
1719
|
var WIDGET_CHANNEL = "widget";
|
|
1720
|
-
var WIDGET_VERSION = "4.
|
|
1720
|
+
var WIDGET_VERSION = "4.11.0" ;
|
|
1721
1721
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
1722
1722
|
function sanitizeVersion(raw) {
|
|
1723
1723
|
const v = String(raw).trim();
|
|
@@ -2180,9 +2180,11 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2180
2180
|
perChainBest.push(option);
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
|
-
|
|
2183
|
+
const ranked = [...heldOptions, ...perChainBest, ...leftovers];
|
|
2184
|
+
for (const option of ranked.slice(0, MAX_QUOTE_CANDIDATES)) {
|
|
2184
2185
|
candidates.push(option);
|
|
2185
2186
|
}
|
|
2187
|
+
const unquotedOptions = ranked.slice(MAX_QUOTE_CANDIDATES);
|
|
2186
2188
|
const routeErrors = [];
|
|
2187
2189
|
const routePromises = candidates.map(
|
|
2188
2190
|
(option) => buildRoute({
|
|
@@ -2224,6 +2226,7 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2224
2226
|
expiresAt: new Date(Date.now() + 2 * 60 * 1e3).toISOString(),
|
|
2225
2227
|
apiBase: api.apiBase,
|
|
2226
2228
|
routes: routesBuilt,
|
|
2229
|
+
unquotedOptions,
|
|
2227
2230
|
fundingBalances: walletBalances,
|
|
2228
2231
|
fundingAccount: payer.toLowerCase(),
|
|
2229
2232
|
destination: {
|
|
@@ -2237,6 +2240,21 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2237
2240
|
}
|
|
2238
2241
|
};
|
|
2239
2242
|
}
|
|
2243
|
+
async function quotePayOption(api, request, payer, picked, wallet = {}) {
|
|
2244
|
+
validateDestination(request);
|
|
2245
|
+
assertAddress(payer, "Payer wallet");
|
|
2246
|
+
const [chains, tokens, routes, health] = await Promise.all([api.fetchChains(), api.fetchTokens(), api.fetchRoutes(), api.fetchRouteHealth()]);
|
|
2247
|
+
const catalogue = buildCatalogue({ chains, tokens, routes, product: "stable", supportedChainIds: SUPPORTED_CHAIN_IDS, brokenLanes: suppressedLanes(health) });
|
|
2248
|
+
const destination = { ...request, chainId: Number(request.chainId), asset: symbolKey(request.asset) };
|
|
2249
|
+
const destinationToken = findToken(tokens, destination.chainId, destination.asset);
|
|
2250
|
+
if (!destinationToken) throw new Error(`${destination.asset} is not enabled on ${chainNameOf(destination.chainId, chains)}.`);
|
|
2251
|
+
const allowedFunding = wallet.fundingAssets?.length ? new Set(wallet.fundingAssets.map(symbolKey)) : null;
|
|
2252
|
+
const option = buildPayOptions({ invoiceAsset: destination.asset, invoiceChainId: destination.chainId, tokens, routes, chains, walletChainId: wallet.chainId, catalogue }).find(
|
|
2253
|
+
(o) => !o.direct && Number(o.chainId) === Number(picked.chainId) && o.address.toLowerCase() === String(picked.address).toLowerCase() && (!allowedFunding || allowedFunding.has(o.symbolKey))
|
|
2254
|
+
);
|
|
2255
|
+
if (!option) throw new Error("That funding option is not available for this payment right now.");
|
|
2256
|
+
return buildRoute({ option, destination, destinationToken, chains, tokens, payer, fetchQuote: api.fetchQuote });
|
|
2257
|
+
}
|
|
2240
2258
|
|
|
2241
2259
|
// src/core/swap.ts
|
|
2242
2260
|
function validateSwap(swap = {}) {
|
|
@@ -2758,6 +2776,7 @@ function createEngine(config = {}) {
|
|
|
2758
2776
|
});
|
|
2759
2777
|
},
|
|
2760
2778
|
fetchPaymentPlan: (request, payer, wallet) => fetchPaymentPlan(api, request, payer, wallet, verifier.readBalances),
|
|
2779
|
+
quotePayOption: (request, payer, option, wallet) => quotePayOption(api, request, payer, option, wallet),
|
|
2761
2780
|
quoteSwapPreview: (swap, owner) => quoteSwapPreview(api, swap, owner),
|
|
2762
2781
|
buildSwapPlan: (swap, payer, wallet) => buildSwapPlan(api, swap, payer, wallet),
|
|
2763
2782
|
payerNonceBaseline: verifier.payerNonceBaseline,
|
|
@@ -3149,6 +3168,10 @@ function useFlow(args) {
|
|
|
3149
3168
|
const routes = plan?.routes ?? [];
|
|
3150
3169
|
const selected = react.useMemo(() => routes.find((r) => r.id === selectedId) ?? routes.find((r) => r.recommended) ?? routes[0] ?? null, [routes, selectedId]);
|
|
3151
3170
|
const reload = react.useCallback(() => setNonce((n) => n + 1), []);
|
|
3171
|
+
const addRoute = react.useCallback((route) => {
|
|
3172
|
+
setPlan((p) => p ? { ...p, routes: [...p.routes.filter((r) => r.id !== route.id), route] } : p);
|
|
3173
|
+
setSelectedId(route.id);
|
|
3174
|
+
}, []);
|
|
3152
3175
|
react.useEffect(() => {
|
|
3153
3176
|
if (busyRef.current) return;
|
|
3154
3177
|
setFieldError(null);
|
|
@@ -3371,7 +3394,8 @@ function useFlow(args) {
|
|
|
3371
3394
|
quotePaused,
|
|
3372
3395
|
quoteStale,
|
|
3373
3396
|
submit,
|
|
3374
|
-
reload
|
|
3397
|
+
reload,
|
|
3398
|
+
addRoute
|
|
3375
3399
|
};
|
|
3376
3400
|
}
|
|
3377
3401
|
function balanceKey(chainId, tokenAddress) {
|
|
@@ -3633,6 +3657,11 @@ var WIDGET_CSS = `
|
|
|
3633
3657
|
/* skeleton loading */
|
|
3634
3658
|
.sg-skel{height:64px;border-radius:var(--sg-radius-control);background:linear-gradient(90deg,var(--sg-surface) 25%,color-mix(in srgb,var(--sg-border) 50%,var(--sg-surface)) 37%,var(--sg-surface) 63%);background-size:400% 100%;animation:sg-shimmer 1.2s ease-in-out infinite;margin-bottom:8px}
|
|
3635
3659
|
|
|
3660
|
+
.sg-skel--amt{display:inline-block;width:112px;height:30px;margin:0;vertical-align:middle;border-radius:10px}
|
|
3661
|
+
.sg-skel--row{height:48px}
|
|
3662
|
+
.sg-pay-loading{display:flex;flex-direction:column}
|
|
3663
|
+
.sg-pay-loading-line{display:flex;align-items:center;gap:8px;font-size:13px;line-height:16px;padding:2px 2px 0}
|
|
3664
|
+
|
|
3636
3665
|
/* spinner */
|
|
3637
3666
|
.sg-spinner{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:sg-spin 0.7s linear infinite;vertical-align:-2px}
|
|
3638
3667
|
@keyframes sg-spin{to{transform:rotate(360deg)}}
|
|
@@ -4798,9 +4827,9 @@ function TokenSelect(props) {
|
|
|
4798
4827
|
const [chainFilter, setChainFilter] = react.useState(null);
|
|
4799
4828
|
const [query, setQuery] = react.useState("");
|
|
4800
4829
|
const chains = react.useMemo(() => {
|
|
4801
|
-
const
|
|
4802
|
-
return props.chains.filter((c) =>
|
|
4803
|
-
}, [props.chains, props.tokens
|
|
4830
|
+
const listed = new Set(props.tokens.map((t) => Number(t.chainId)));
|
|
4831
|
+
return props.chains.filter((c) => listed.has(Number(c.chainId)));
|
|
4832
|
+
}, [props.chains, props.tokens]);
|
|
4804
4833
|
const activeFilter = chainFilter != null && chains.some((c) => Number(c.chainId) === chainFilter) ? chainFilter : null;
|
|
4805
4834
|
const rows = react.useMemo(() => {
|
|
4806
4835
|
const q = query.trim().toLowerCase();
|
|
@@ -6717,6 +6746,21 @@ function PayCard(props) {
|
|
|
6717
6746
|
);
|
|
6718
6747
|
const heldIds = react.useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
|
|
6719
6748
|
const scannedEmpty = !holdings.loading && Object.keys(holdings.balances).length > 0 && held.length === 0;
|
|
6749
|
+
const [failedOptions, setFailedOptions] = react.useState(/* @__PURE__ */ new Set());
|
|
6750
|
+
const [pricing, setPricing] = react.useState(null);
|
|
6751
|
+
const [pickError, setPickError] = react.useState(null);
|
|
6752
|
+
react.useEffect(() => {
|
|
6753
|
+
setFailedOptions(/* @__PURE__ */ new Set());
|
|
6754
|
+
setPricing(null);
|
|
6755
|
+
setPickError(null);
|
|
6756
|
+
}, [wallet.account, paramsKey]);
|
|
6757
|
+
const unquoted = react.useMemo(
|
|
6758
|
+
() => (paymentPlan?.unquotedOptions ?? []).filter(
|
|
6759
|
+
(o) => (!fundingSet || fundingSet.has(o.symbolKey)) && (STABLES2.has(o.symbolKey)) && !failedOptions.has(balanceKey(o.chainId, o.address))
|
|
6760
|
+
),
|
|
6761
|
+
[paymentPlan, fundingSet, method, failedOptions]
|
|
6762
|
+
);
|
|
6763
|
+
const listBalances = react.useMemo(() => ({ ...prefetchedBalances ?? {}, ...holdings.balances }), [prefetchedBalances, holdings.balances]);
|
|
6720
6764
|
const optionStates = react.useMemo(() => {
|
|
6721
6765
|
const map = {};
|
|
6722
6766
|
for (const a of annotated) {
|
|
@@ -6739,8 +6783,19 @@ function PayCard(props) {
|
|
|
6739
6783
|
map[key] = { disabled: false };
|
|
6740
6784
|
}
|
|
6741
6785
|
}
|
|
6786
|
+
for (const o of unquoted) {
|
|
6787
|
+
const key = balanceKey(o.chainId, o.address);
|
|
6788
|
+
if (map[key]) continue;
|
|
6789
|
+
let zero = false;
|
|
6790
|
+
try {
|
|
6791
|
+
zero = BigInt(listBalances[key]?.raw ?? "x") === 0n;
|
|
6792
|
+
} catch {
|
|
6793
|
+
zero = false;
|
|
6794
|
+
}
|
|
6795
|
+
map[key] = zero ? { disabled: true, reason: "no-balance", hint: "No balance on this chain" } : { disabled: false };
|
|
6796
|
+
}
|
|
6742
6797
|
return map;
|
|
6743
|
-
}, [annotated, holdings.loading]);
|
|
6798
|
+
}, [annotated, holdings.loading, unquoted, listBalances]);
|
|
6744
6799
|
const [catalogue, setCatalogue] = react.useState(null);
|
|
6745
6800
|
const chains = react.useMemo(() => {
|
|
6746
6801
|
const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
|
|
@@ -6760,24 +6815,27 @@ function PayCard(props) {
|
|
|
6760
6815
|
const fundingTokens = react.useMemo(() => {
|
|
6761
6816
|
const seen = /* @__PURE__ */ new Set();
|
|
6762
6817
|
const list = [];
|
|
6763
|
-
|
|
6764
|
-
const key = balanceKey(
|
|
6765
|
-
if (seen.has(key))
|
|
6818
|
+
const push = (chainId, address, fallback) => {
|
|
6819
|
+
const key = balanceKey(chainId, address);
|
|
6820
|
+
if (seen.has(key)) return;
|
|
6766
6821
|
seen.add(key);
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
);
|
|
6822
|
+
list.push(registryTokens.find((t) => Number(t.chainId) === chainId && addrEq2(t.address, address)) ?? fallback);
|
|
6823
|
+
};
|
|
6824
|
+
for (const r of visibleRoutes) {
|
|
6825
|
+
push(r.source.chainId, r.source.tokenAddress, {
|
|
6826
|
+
symbol: r.source.asset,
|
|
6827
|
+
displaySymbol: r.source.ticker,
|
|
6828
|
+
name: r.source.asset,
|
|
6829
|
+
chainId: r.source.chainId,
|
|
6830
|
+
address: r.source.tokenAddress ?? "",
|
|
6831
|
+
decimals: r.source.decimals ?? 18
|
|
6832
|
+
});
|
|
6833
|
+
}
|
|
6834
|
+
for (const o of unquoted) {
|
|
6835
|
+
push(o.chainId, o.address, { symbol: o.symbol, displaySymbol: o.ticker, name: o.name, chainId: o.chainId, address: o.address, decimals: o.decimals, logoUrl: o.logoUrl });
|
|
6778
6836
|
}
|
|
6779
6837
|
return list;
|
|
6780
|
-
}, [visibleRoutes, registryTokens]);
|
|
6838
|
+
}, [visibleRoutes, unquoted, registryTokens]);
|
|
6781
6839
|
const fundingChains = react.useMemo(() => {
|
|
6782
6840
|
const ids = new Set(fundingTokens.map((t) => Number(t.chainId)));
|
|
6783
6841
|
return chains.filter((c) => ids.has(Number(c.chainId)));
|
|
@@ -6821,9 +6879,23 @@ function PayCard(props) {
|
|
|
6821
6879
|
react.useEffect(() => setHist(null), [wallet.account]);
|
|
6822
6880
|
const lastTxOwned = Boolean(flow.lastTxEntry?.hash && wallet.account && flow.lastTxEntry.account === wallet.account.toLowerCase());
|
|
6823
6881
|
const pickFunding = (pick) => {
|
|
6882
|
+
setPickError(null);
|
|
6824
6883
|
const r = visibleRoutes.find((x) => x.source.chainId === pick.chainId && symbolKey(x.source.asset) === symbolKey(pick.symbol));
|
|
6825
|
-
if (r)
|
|
6884
|
+
if (r) {
|
|
6885
|
+
selectRoute(r.id);
|
|
6886
|
+
closeSelector();
|
|
6887
|
+
return;
|
|
6888
|
+
}
|
|
6889
|
+
const option = unquoted.find((o) => o.chainId === pick.chainId && o.symbolKey === symbolKey(pick.symbol));
|
|
6826
6890
|
closeSelector();
|
|
6891
|
+
if (!option || !wallet.account) return;
|
|
6892
|
+
const key = balanceKey(option.chainId, option.address);
|
|
6893
|
+
setPricing(key);
|
|
6894
|
+
userPicked.current = true;
|
|
6895
|
+
engine.quotePayOption({ address: props.recipient, chainId: props.toChainId, asset: props.toAsset, amount: props.amount }, wallet.account, { chainId: option.chainId, address: option.address }, { chainId: wallet.chainId ?? void 0, fundingAssets: planFundingAssets }).then((route) => flow.addRoute(route)).catch(() => {
|
|
6896
|
+
setFailedOptions((prev) => /* @__PURE__ */ new Set([...prev, key]));
|
|
6897
|
+
setPickError(`${option.ticker || option.symbol} on ${option.chainName} cannot settle this payment right now. Pick another way to pay.`);
|
|
6898
|
+
}).finally(() => setPricing((cur) => cur === key ? null : cur));
|
|
6827
6899
|
};
|
|
6828
6900
|
const parked = !isLiveMethod(method);
|
|
6829
6901
|
const submitting = flow.status === "submitting";
|
|
@@ -6850,7 +6922,7 @@ function PayCard(props) {
|
|
|
6850
6922
|
setSheet(false);
|
|
6851
6923
|
requestAnimationFrame(() => complianceBtnRef.current?.focus());
|
|
6852
6924
|
};
|
|
6853
|
-
const payLabel = parked ? "Coming soon" : submitting ? "Paying\u2026" : flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall ? flow.nativeShortfall : sel && selectedVisible ? `Pay ${groupDecimal(atLeastCents(sel.source.payAmount))} ${sel.source.ticker || sel.source.asset}` : "Pay";
|
|
6925
|
+
const payLabel = parked ? "Coming soon" : wallet.account && (flow.status === "loading" || pricing !== null) ? "Finding the best way to pay\u2026" : submitting ? "Paying\u2026" : flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall ? flow.nativeShortfall : sel && selectedVisible ? `Pay ${groupDecimal(atLeastCents(sel.source.payAmount))} ${sel.source.ticker || sel.source.asset}` : "Pay";
|
|
6854
6926
|
const walletSlot = wallet.account ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-head-tools", children: [
|
|
6855
6927
|
/* @__PURE__ */ jsxRuntime.jsx(HistoryButton, { btnRef: histBtnRef, disabled: submitting, onClick: () => setHist({}) }),
|
|
6856
6928
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-wallet", "data-connected": "true", children: [
|
|
@@ -6864,14 +6936,14 @@ function PayCard(props) {
|
|
|
6864
6936
|
{ label: "Network fee", value: nativeWei > 0n ? `~${formatNative(nativeWei)} ${nativeSymbol(sel.source.chainId)}` : "Gas only" },
|
|
6865
6937
|
...durationLabel(sel.quote.estimatedDuration) ? [{ label: "Estimated time", value: durationLabel(sel.quote.estimatedDuration) }] : []
|
|
6866
6938
|
] : [];
|
|
6867
|
-
const loadingPlan = flow.status === "loading" || holdings.loading && !sel;
|
|
6939
|
+
const loadingPlan = flow.status === "loading" || holdings.loading && !sel || pricing !== null;
|
|
6868
6940
|
return /* @__PURE__ */ jsxRuntime.jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, onClose: props.onClose, children: hist && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6869
6941
|
TokenSelect,
|
|
6870
6942
|
{
|
|
6871
6943
|
title: "Pay with",
|
|
6872
6944
|
chains: fundingChains,
|
|
6873
6945
|
tokens: fundingTokens,
|
|
6874
|
-
balances:
|
|
6946
|
+
balances: listBalances,
|
|
6875
6947
|
optionStates,
|
|
6876
6948
|
onBack: closeSelector,
|
|
6877
6949
|
onPick: pickFunding
|
|
@@ -6902,7 +6974,7 @@ function PayCard(props) {
|
|
|
6902
6974
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane", "data-kind": "pay", children: [
|
|
6903
6975
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-pane-label", children: "You pay" }),
|
|
6904
6976
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane-mid", children: [
|
|
6905
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-amt-out", "aria-live": "polite", children: loadingPlan ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-amt-
|
|
6977
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-amt-out", "aria-live": "polite", children: loadingPlan ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-skel sg-skel--amt", "data-testid": "pay-loading-amount", "aria-hidden": "true" }) : sel && selectedVisible ? /* @__PURE__ */ jsxRuntime.jsx(AmountText, { value: groupDecimal(atLeastCents(sel.source.payAmount)) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-amt-empty", children: "\u2014" }) }),
|
|
6906
6978
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6907
6979
|
TokenButton,
|
|
6908
6980
|
{
|
|
@@ -6918,10 +6990,20 @@ function PayCard(props) {
|
|
|
6918
6990
|
] }),
|
|
6919
6991
|
/* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: sel && selectedVisible ? usdOf(sel.source.payAmount, prices[selSymbol]) : null, balance: selBal ? shortBalance(selBal.formatted) : null })
|
|
6920
6992
|
] }),
|
|
6993
|
+
loadingPlan ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pay-loading", "data-testid": "pay-loading", role: "status", children: [
|
|
6994
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel sg-skel--row" }),
|
|
6995
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-skel sg-skel--row" }),
|
|
6996
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-muted sg-pay-loading-line", children: [
|
|
6997
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-spinner", "aria-hidden": "true" }),
|
|
6998
|
+
" ",
|
|
6999
|
+
pricing ? "Pricing this option\u2026" : "Checking your balances and finding the best way to pay\u2026"
|
|
7000
|
+
] })
|
|
7001
|
+
] }) : null,
|
|
7002
|
+
pickError ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: pickError }) : null,
|
|
6921
7003
|
flow.status === "error" && flow.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
|
|
6922
7004
|
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,
|
|
6923
7005
|
flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null,
|
|
6924
|
-
sel &&
|
|
7006
|
+
sel && !loadingPlan ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6925
7007
|
DetailButton,
|
|
6926
7008
|
{
|
|
6927
7009
|
btnRef: complianceBtnRef,
|
|
@@ -6933,7 +7015,7 @@ function PayCard(props) {
|
|
|
6933
7015
|
onClick: () => setSheet(true)
|
|
6934
7016
|
}
|
|
6935
7017
|
) : null,
|
|
6936
|
-
sel && selectedVisible &&
|
|
7018
|
+
sel && selectedVisible && !loadingPlan ? /* @__PURE__ */ jsxRuntime.jsx(RateBox, { rowsOnly: true, rate: null, fromSymbol: "", toTicker: "", rows: feeRows }) : null
|
|
6937
7019
|
] }),
|
|
6938
7020
|
submitting ? /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps: flow.steps }) : null,
|
|
6939
7021
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6941,7 +7023,7 @@ function PayCard(props) {
|
|
|
6941
7023
|
{
|
|
6942
7024
|
onClick: parked || !selectedVisible ? void 0 : flow.submit,
|
|
6943
7025
|
busy: submitting,
|
|
6944
|
-
disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall ||
|
|
7026
|
+
disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall || loadingPlan,
|
|
6945
7027
|
children: payLabel
|
|
6946
7028
|
}
|
|
6947
7029
|
) })
|
|
@@ -7279,6 +7361,10 @@ function ExchangeCard(props) {
|
|
|
7279
7361
|
}
|
|
7280
7362
|
return states;
|
|
7281
7363
|
}, [catalogue, fromToken]);
|
|
7364
|
+
const toPickerVisible = react.useMemo(
|
|
7365
|
+
() => destinationStates ? toPickerTokens.filter((t) => !destinationStates[`${Number(t.chainId)}:${String(t.address || "").toLowerCase()}`]?.disabled) : toPickerTokens,
|
|
7366
|
+
[toPickerTokens, destinationStates]
|
|
7367
|
+
);
|
|
7282
7368
|
const normalizedAmount = normalizeDecimalText(amount);
|
|
7283
7369
|
const amountValid = /^\d+(\.\d+)?$/.test(normalizedAmount) && Number(normalizedAmount) > 0 && Number(normalizedAmount) <= 1e9;
|
|
7284
7370
|
const rampMode = mode !== "exchange";
|
|
@@ -7499,7 +7585,7 @@ function ExchangeCard(props) {
|
|
|
7499
7585
|
{
|
|
7500
7586
|
title: isFrom ? "Exchange from" : "Exchange to",
|
|
7501
7587
|
chains,
|
|
7502
|
-
tokens: isFrom ? fromPickerTokens :
|
|
7588
|
+
tokens: isFrom ? fromPickerTokens : toPickerVisible,
|
|
7503
7589
|
balances,
|
|
7504
7590
|
optionStates: isFrom ? void 0 : destinationStates,
|
|
7505
7591
|
loading: !catalogue?.ready,
|
package/dist/mount.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as MountConfig, t as mount } from './mount-
|
|
1
|
+
export { M as MountConfig, t as mount } from './mount-xruGixNZ.cjs';
|
|
2
2
|
import 'react';
|
|
3
|
-
import './verify-
|
|
3
|
+
import './verify-D8tr1yY1.cjs';
|
package/dist/mount.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as MountConfig, t as mount } from './mount-
|
|
1
|
+
export { M as MountConfig, t as mount } from './mount-hxb3zioQ.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import './verify-
|
|
3
|
+
import './verify-D8tr1yY1.js';
|
package/dist/mount.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { mount } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { mount } from './chunk-TNAW2SWI.js';
|
|
2
|
+
import './chunk-5WTRI2KO.js';
|