@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
|
@@ -1724,7 +1724,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
1724
1724
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
1725
1725
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
1726
1726
|
var WIDGET_CHANNEL = "widget";
|
|
1727
|
-
var WIDGET_VERSION = "4.
|
|
1727
|
+
var WIDGET_VERSION = "4.11.0" ;
|
|
1728
1728
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
1729
1729
|
function sanitizeVersion(raw) {
|
|
1730
1730
|
const v = String(raw).trim();
|
|
@@ -2187,9 +2187,11 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2187
2187
|
perChainBest.push(option);
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
|
-
|
|
2190
|
+
const ranked = [...heldOptions, ...perChainBest, ...leftovers];
|
|
2191
|
+
for (const option of ranked.slice(0, MAX_QUOTE_CANDIDATES)) {
|
|
2191
2192
|
candidates.push(option);
|
|
2192
2193
|
}
|
|
2194
|
+
const unquotedOptions = ranked.slice(MAX_QUOTE_CANDIDATES);
|
|
2193
2195
|
const routeErrors = [];
|
|
2194
2196
|
const routePromises = candidates.map(
|
|
2195
2197
|
(option) => buildRoute({
|
|
@@ -2231,6 +2233,7 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2231
2233
|
expiresAt: new Date(Date.now() + 2 * 60 * 1e3).toISOString(),
|
|
2232
2234
|
apiBase: api.apiBase,
|
|
2233
2235
|
routes: routesBuilt,
|
|
2236
|
+
unquotedOptions,
|
|
2234
2237
|
fundingBalances: walletBalances,
|
|
2235
2238
|
fundingAccount: payer.toLowerCase(),
|
|
2236
2239
|
destination: {
|
|
@@ -2244,6 +2247,21 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2244
2247
|
}
|
|
2245
2248
|
};
|
|
2246
2249
|
}
|
|
2250
|
+
async function quotePayOption(api, request, payer, picked, wallet = {}) {
|
|
2251
|
+
validateDestination(request);
|
|
2252
|
+
assertAddress(payer, "Payer wallet");
|
|
2253
|
+
const [chains, tokens, routes, health] = await Promise.all([api.fetchChains(), api.fetchTokens(), api.fetchRoutes(), api.fetchRouteHealth()]);
|
|
2254
|
+
const catalogue = buildCatalogue({ chains, tokens, routes, product: "stable", supportedChainIds: SUPPORTED_CHAIN_IDS, brokenLanes: suppressedLanes(health) });
|
|
2255
|
+
const destination = { ...request, chainId: Number(request.chainId), asset: symbolKey(request.asset) };
|
|
2256
|
+
const destinationToken = findToken(tokens, destination.chainId, destination.asset);
|
|
2257
|
+
if (!destinationToken) throw new Error(`${destination.asset} is not enabled on ${chainNameOf(destination.chainId, chains)}.`);
|
|
2258
|
+
const allowedFunding = wallet.fundingAssets?.length ? new Set(wallet.fundingAssets.map(symbolKey)) : null;
|
|
2259
|
+
const option = buildPayOptions({ invoiceAsset: destination.asset, invoiceChainId: destination.chainId, tokens, routes, chains, walletChainId: wallet.chainId, catalogue }).find(
|
|
2260
|
+
(o) => !o.direct && Number(o.chainId) === Number(picked.chainId) && o.address.toLowerCase() === String(picked.address).toLowerCase() && (!allowedFunding || allowedFunding.has(o.symbolKey))
|
|
2261
|
+
);
|
|
2262
|
+
if (!option) throw new Error("That funding option is not available for this payment right now.");
|
|
2263
|
+
return buildRoute({ option, destination, destinationToken, chains, tokens, payer, fetchQuote: api.fetchQuote });
|
|
2264
|
+
}
|
|
2247
2265
|
|
|
2248
2266
|
// src/core/swap.ts
|
|
2249
2267
|
function validateSwap(swap = {}) {
|
|
@@ -2820,6 +2838,7 @@ function createEngine(config = {}) {
|
|
|
2820
2838
|
});
|
|
2821
2839
|
},
|
|
2822
2840
|
fetchPaymentPlan: (request, payer, wallet) => fetchPaymentPlan(api, request, payer, wallet, verifier.readBalances),
|
|
2841
|
+
quotePayOption: (request, payer, option, wallet) => quotePayOption(api, request, payer, option, wallet),
|
|
2823
2842
|
quoteSwapPreview: (swap, owner) => quoteSwapPreview(api, swap, owner),
|
|
2824
2843
|
buildSwapPlan: (swap, payer, wallet) => buildSwapPlan(api, swap, payer, wallet),
|
|
2825
2844
|
payerNonceBaseline: verifier.payerNonceBaseline,
|
|
@@ -2838,4 +2857,4 @@ function createEngine(config = {}) {
|
|
|
2838
2857
|
};
|
|
2839
2858
|
}
|
|
2840
2859
|
|
|
2841
|
-
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetClassOf, assetDecimals, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, canAttachApiKey, categoryLabel, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, counterpartTokens, createApiClient, createEngine, createVerifier, decodeSubmitOrderCalldata, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executionChainIds, fetchPaymentPlan, finalOf, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isSourceToken, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseAllowedApiBase, parseUnitsDecimal, planErrorSummary, planMsgValueHex, productAssets, quotePartnerId, quoteSwapPreview, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
|
2860
|
+
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetClassOf, assetDecimals, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, canAttachApiKey, categoryLabel, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, counterpartTokens, createApiClient, createEngine, createVerifier, decodeSubmitOrderCalldata, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executionChainIds, fetchPaymentPlan, finalOf, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isSourceToken, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseAllowedApiBase, parseUnitsDecimal, planErrorSummary, planMsgValueHex, productAssets, quotePartnerId, quotePayOption, quoteSwapPreview, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, complianceView, complianceTagOf, symbolKey, normalizeDecimalText, findToken, laneLimitFor, laneLimitSymbol, tokenTicker, exceedsLaneLimit, assetDecimals, parseUnitsDecimal, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, laneLimitHint, tickerOn, laneLimitError, routeNativeValue, formatNative, nativeSymbol, amountFieldError, SUPPORTED_CHAIN_IDS, formatUnits, complianceChecks, DIRECT_CHECK_IDS, createEngine, checkNativeFee, nativeFeeShortLabel, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, foldTicker, unattributedComplianceReasons, distinctScreenedWallets, formatJurisdiction, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, BUNDLED_RPC } from './chunk-
|
|
1
|
+
import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, complianceView, complianceTagOf, symbolKey, normalizeDecimalText, findToken, laneLimitFor, laneLimitSymbol, tokenTicker, exceedsLaneLimit, assetDecimals, parseUnitsDecimal, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, laneLimitHint, tickerOn, laneLimitError, routeNativeValue, formatNative, nativeSymbol, amountFieldError, SUPPORTED_CHAIN_IDS, formatUnits, complianceChecks, DIRECT_CHECK_IDS, createEngine, checkNativeFee, nativeFeeShortLabel, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, foldTicker, unattributedComplianceReasons, distinctScreenedWallets, formatJurisdiction, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, BUNDLED_RPC } from './chunk-5WTRI2KO.js';
|
|
2
2
|
import { createContext, useState, useRef, useMemo, useEffect, useCallback, useId, createElement, useContext, useSyncExternalStore, useLayoutEffect, useReducer } from 'react';
|
|
3
3
|
import { createRoot } from 'react-dom/client';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -383,6 +383,10 @@ function useFlow(args) {
|
|
|
383
383
|
const routes = plan?.routes ?? [];
|
|
384
384
|
const selected = useMemo(() => routes.find((r) => r.id === selectedId) ?? routes.find((r) => r.recommended) ?? routes[0] ?? null, [routes, selectedId]);
|
|
385
385
|
const reload = useCallback(() => setNonce((n) => n + 1), []);
|
|
386
|
+
const addRoute = useCallback((route) => {
|
|
387
|
+
setPlan((p) => p ? { ...p, routes: [...p.routes.filter((r) => r.id !== route.id), route] } : p);
|
|
388
|
+
setSelectedId(route.id);
|
|
389
|
+
}, []);
|
|
386
390
|
useEffect(() => {
|
|
387
391
|
if (busyRef.current) return;
|
|
388
392
|
setFieldError(null);
|
|
@@ -605,7 +609,8 @@ function useFlow(args) {
|
|
|
605
609
|
quotePaused,
|
|
606
610
|
quoteStale,
|
|
607
611
|
submit,
|
|
608
|
-
reload
|
|
612
|
+
reload,
|
|
613
|
+
addRoute
|
|
609
614
|
};
|
|
610
615
|
}
|
|
611
616
|
function balanceKey(chainId, tokenAddress) {
|
|
@@ -867,6 +872,11 @@ var WIDGET_CSS = `
|
|
|
867
872
|
/* skeleton loading */
|
|
868
873
|
.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}
|
|
869
874
|
|
|
875
|
+
.sg-skel--amt{display:inline-block;width:112px;height:30px;margin:0;vertical-align:middle;border-radius:10px}
|
|
876
|
+
.sg-skel--row{height:48px}
|
|
877
|
+
.sg-pay-loading{display:flex;flex-direction:column}
|
|
878
|
+
.sg-pay-loading-line{display:flex;align-items:center;gap:8px;font-size:13px;line-height:16px;padding:2px 2px 0}
|
|
879
|
+
|
|
870
880
|
/* spinner */
|
|
871
881
|
.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}
|
|
872
882
|
@keyframes sg-spin{to{transform:rotate(360deg)}}
|
|
@@ -2032,9 +2042,9 @@ function TokenSelect(props) {
|
|
|
2032
2042
|
const [chainFilter, setChainFilter] = useState(null);
|
|
2033
2043
|
const [query, setQuery] = useState("");
|
|
2034
2044
|
const chains = useMemo(() => {
|
|
2035
|
-
const
|
|
2036
|
-
return props.chains.filter((c) =>
|
|
2037
|
-
}, [props.chains, props.tokens
|
|
2045
|
+
const listed = new Set(props.tokens.map((t) => Number(t.chainId)));
|
|
2046
|
+
return props.chains.filter((c) => listed.has(Number(c.chainId)));
|
|
2047
|
+
}, [props.chains, props.tokens]);
|
|
2038
2048
|
const activeFilter = chainFilter != null && chains.some((c) => Number(c.chainId) === chainFilter) ? chainFilter : null;
|
|
2039
2049
|
const rows = useMemo(() => {
|
|
2040
2050
|
const q = query.trim().toLowerCase();
|
|
@@ -3951,6 +3961,21 @@ function PayCard(props) {
|
|
|
3951
3961
|
);
|
|
3952
3962
|
const heldIds = useMemo(() => new Set(held.map((a) => a.route.id)), [held]);
|
|
3953
3963
|
const scannedEmpty = !holdings.loading && Object.keys(holdings.balances).length > 0 && held.length === 0;
|
|
3964
|
+
const [failedOptions, setFailedOptions] = useState(/* @__PURE__ */ new Set());
|
|
3965
|
+
const [pricing, setPricing] = useState(null);
|
|
3966
|
+
const [pickError, setPickError] = useState(null);
|
|
3967
|
+
useEffect(() => {
|
|
3968
|
+
setFailedOptions(/* @__PURE__ */ new Set());
|
|
3969
|
+
setPricing(null);
|
|
3970
|
+
setPickError(null);
|
|
3971
|
+
}, [wallet.account, paramsKey]);
|
|
3972
|
+
const unquoted = useMemo(
|
|
3973
|
+
() => (paymentPlan?.unquotedOptions ?? []).filter(
|
|
3974
|
+
(o) => (!fundingSet || fundingSet.has(o.symbolKey)) && (STABLES2.has(o.symbolKey)) && !failedOptions.has(balanceKey(o.chainId, o.address))
|
|
3975
|
+
),
|
|
3976
|
+
[paymentPlan, fundingSet, method, failedOptions]
|
|
3977
|
+
);
|
|
3978
|
+
const listBalances = useMemo(() => ({ ...prefetchedBalances ?? {}, ...holdings.balances }), [prefetchedBalances, holdings.balances]);
|
|
3954
3979
|
const optionStates = useMemo(() => {
|
|
3955
3980
|
const map = {};
|
|
3956
3981
|
for (const a of annotated) {
|
|
@@ -3973,8 +3998,19 @@ function PayCard(props) {
|
|
|
3973
3998
|
map[key] = { disabled: false };
|
|
3974
3999
|
}
|
|
3975
4000
|
}
|
|
4001
|
+
for (const o of unquoted) {
|
|
4002
|
+
const key = balanceKey(o.chainId, o.address);
|
|
4003
|
+
if (map[key]) continue;
|
|
4004
|
+
let zero = false;
|
|
4005
|
+
try {
|
|
4006
|
+
zero = BigInt(listBalances[key]?.raw ?? "x") === 0n;
|
|
4007
|
+
} catch {
|
|
4008
|
+
zero = false;
|
|
4009
|
+
}
|
|
4010
|
+
map[key] = zero ? { disabled: true, reason: "no-balance", hint: "No balance on this chain" } : { disabled: false };
|
|
4011
|
+
}
|
|
3976
4012
|
return map;
|
|
3977
|
-
}, [annotated, holdings.loading]);
|
|
4013
|
+
}, [annotated, holdings.loading, unquoted, listBalances]);
|
|
3978
4014
|
const [catalogue, setCatalogue] = useState(null);
|
|
3979
4015
|
const chains = useMemo(() => {
|
|
3980
4016
|
const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
|
|
@@ -3994,24 +4030,27 @@ function PayCard(props) {
|
|
|
3994
4030
|
const fundingTokens = useMemo(() => {
|
|
3995
4031
|
const seen = /* @__PURE__ */ new Set();
|
|
3996
4032
|
const list = [];
|
|
3997
|
-
|
|
3998
|
-
const key = balanceKey(
|
|
3999
|
-
if (seen.has(key))
|
|
4033
|
+
const push = (chainId, address, fallback) => {
|
|
4034
|
+
const key = balanceKey(chainId, address);
|
|
4035
|
+
if (seen.has(key)) return;
|
|
4000
4036
|
seen.add(key);
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
);
|
|
4037
|
+
list.push(registryTokens.find((t) => Number(t.chainId) === chainId && addrEq2(t.address, address)) ?? fallback);
|
|
4038
|
+
};
|
|
4039
|
+
for (const r of visibleRoutes) {
|
|
4040
|
+
push(r.source.chainId, r.source.tokenAddress, {
|
|
4041
|
+
symbol: r.source.asset,
|
|
4042
|
+
displaySymbol: r.source.ticker,
|
|
4043
|
+
name: r.source.asset,
|
|
4044
|
+
chainId: r.source.chainId,
|
|
4045
|
+
address: r.source.tokenAddress ?? "",
|
|
4046
|
+
decimals: r.source.decimals ?? 18
|
|
4047
|
+
});
|
|
4048
|
+
}
|
|
4049
|
+
for (const o of unquoted) {
|
|
4050
|
+
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 });
|
|
4012
4051
|
}
|
|
4013
4052
|
return list;
|
|
4014
|
-
}, [visibleRoutes, registryTokens]);
|
|
4053
|
+
}, [visibleRoutes, unquoted, registryTokens]);
|
|
4015
4054
|
const fundingChains = useMemo(() => {
|
|
4016
4055
|
const ids = new Set(fundingTokens.map((t) => Number(t.chainId)));
|
|
4017
4056
|
return chains.filter((c) => ids.has(Number(c.chainId)));
|
|
@@ -4055,9 +4094,23 @@ function PayCard(props) {
|
|
|
4055
4094
|
useEffect(() => setHist(null), [wallet.account]);
|
|
4056
4095
|
const lastTxOwned = Boolean(flow.lastTxEntry?.hash && wallet.account && flow.lastTxEntry.account === wallet.account.toLowerCase());
|
|
4057
4096
|
const pickFunding = (pick) => {
|
|
4097
|
+
setPickError(null);
|
|
4058
4098
|
const r = visibleRoutes.find((x) => x.source.chainId === pick.chainId && symbolKey(x.source.asset) === symbolKey(pick.symbol));
|
|
4059
|
-
if (r)
|
|
4099
|
+
if (r) {
|
|
4100
|
+
selectRoute(r.id);
|
|
4101
|
+
closeSelector();
|
|
4102
|
+
return;
|
|
4103
|
+
}
|
|
4104
|
+
const option = unquoted.find((o) => o.chainId === pick.chainId && o.symbolKey === symbolKey(pick.symbol));
|
|
4060
4105
|
closeSelector();
|
|
4106
|
+
if (!option || !wallet.account) return;
|
|
4107
|
+
const key = balanceKey(option.chainId, option.address);
|
|
4108
|
+
setPricing(key);
|
|
4109
|
+
userPicked.current = true;
|
|
4110
|
+
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(() => {
|
|
4111
|
+
setFailedOptions((prev) => /* @__PURE__ */ new Set([...prev, key]));
|
|
4112
|
+
setPickError(`${option.ticker || option.symbol} on ${option.chainName} cannot settle this payment right now. Pick another way to pay.`);
|
|
4113
|
+
}).finally(() => setPricing((cur) => cur === key ? null : cur));
|
|
4061
4114
|
};
|
|
4062
4115
|
const parked = !isLiveMethod(method);
|
|
4063
4116
|
const submitting = flow.status === "submitting";
|
|
@@ -4084,7 +4137,7 @@ function PayCard(props) {
|
|
|
4084
4137
|
setSheet(false);
|
|
4085
4138
|
requestAnimationFrame(() => complianceBtnRef.current?.focus());
|
|
4086
4139
|
};
|
|
4087
|
-
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";
|
|
4140
|
+
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";
|
|
4088
4141
|
const walletSlot = wallet.account ? /* @__PURE__ */ jsxs("div", { className: "sg-head-tools", children: [
|
|
4089
4142
|
/* @__PURE__ */ jsx(HistoryButton, { btnRef: histBtnRef, disabled: submitting, onClick: () => setHist({}) }),
|
|
4090
4143
|
/* @__PURE__ */ jsxs("span", { className: "sg-wallet", "data-connected": "true", children: [
|
|
@@ -4098,14 +4151,14 @@ function PayCard(props) {
|
|
|
4098
4151
|
{ label: "Network fee", value: nativeWei > 0n ? `~${formatNative(nativeWei)} ${nativeSymbol(sel.source.chainId)}` : "Gas only" },
|
|
4099
4152
|
...durationLabel(sel.quote.estimatedDuration) ? [{ label: "Estimated time", value: durationLabel(sel.quote.estimatedDuration) }] : []
|
|
4100
4153
|
] : [];
|
|
4101
|
-
const loadingPlan = flow.status === "loading" || holdings.loading && !sel;
|
|
4154
|
+
const loadingPlan = flow.status === "loading" || holdings.loading && !sel || pricing !== null;
|
|
4102
4155
|
return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, onClose: props.onClose, children: hist && wallet.account ? /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsx(
|
|
4103
4156
|
TokenSelect,
|
|
4104
4157
|
{
|
|
4105
4158
|
title: "Pay with",
|
|
4106
4159
|
chains: fundingChains,
|
|
4107
4160
|
tokens: fundingTokens,
|
|
4108
|
-
balances:
|
|
4161
|
+
balances: listBalances,
|
|
4109
4162
|
optionStates,
|
|
4110
4163
|
onBack: closeSelector,
|
|
4111
4164
|
onPick: pickFunding
|
|
@@ -4136,7 +4189,7 @@ function PayCard(props) {
|
|
|
4136
4189
|
/* @__PURE__ */ jsxs("div", { className: "sg-pane", "data-kind": "pay", children: [
|
|
4137
4190
|
/* @__PURE__ */ jsx("span", { className: "sg-pane-label", children: "You pay" }),
|
|
4138
4191
|
/* @__PURE__ */ jsxs("div", { className: "sg-pane-mid", children: [
|
|
4139
|
-
/* @__PURE__ */ jsx("span", { className: "sg-amt-out", "aria-live": "polite", children: loadingPlan ? /* @__PURE__ */ jsx("span", { className: "sg-amt-
|
|
4192
|
+
/* @__PURE__ */ jsx("span", { className: "sg-amt-out", "aria-live": "polite", children: loadingPlan ? /* @__PURE__ */ jsx("span", { className: "sg-skel sg-skel--amt", "data-testid": "pay-loading-amount", "aria-hidden": "true" }) : sel && selectedVisible ? /* @__PURE__ */ jsx(AmountText, { value: groupDecimal(atLeastCents(sel.source.payAmount)) }) : /* @__PURE__ */ jsx("span", { className: "sg-amt-empty", children: "\u2014" }) }),
|
|
4140
4193
|
/* @__PURE__ */ jsx(
|
|
4141
4194
|
TokenButton,
|
|
4142
4195
|
{
|
|
@@ -4152,10 +4205,20 @@ function PayCard(props) {
|
|
|
4152
4205
|
] }),
|
|
4153
4206
|
/* @__PURE__ */ jsx(PaneFoot, { usd: sel && selectedVisible ? usdOf(sel.source.payAmount, prices[selSymbol]) : null, balance: selBal ? shortBalance(selBal.formatted) : null })
|
|
4154
4207
|
] }),
|
|
4208
|
+
loadingPlan ? /* @__PURE__ */ jsxs("div", { className: "sg-pay-loading", "data-testid": "pay-loading", role: "status", children: [
|
|
4209
|
+
/* @__PURE__ */ jsx("div", { className: "sg-skel sg-skel--row" }),
|
|
4210
|
+
/* @__PURE__ */ jsx("div", { className: "sg-skel sg-skel--row" }),
|
|
4211
|
+
/* @__PURE__ */ jsxs("div", { className: "sg-muted sg-pay-loading-line", children: [
|
|
4212
|
+
/* @__PURE__ */ jsx("span", { className: "sg-spinner", "aria-hidden": "true" }),
|
|
4213
|
+
" ",
|
|
4214
|
+
pricing ? "Pricing this option\u2026" : "Checking your balances and finding the best way to pay\u2026"
|
|
4215
|
+
] })
|
|
4216
|
+
] }) : null,
|
|
4217
|
+
pickError ? /* @__PURE__ */ jsx(StatusPanel, { tone: "error", children: pickError }) : null,
|
|
4155
4218
|
flow.status === "error" && flow.error ? /* @__PURE__ */ jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
|
|
4156
4219
|
scannedEmpty ? /* @__PURE__ */ jsx("div", { className: "sg-note", children: "None of your balances can cover this yet \u2014 pick a different asset to fund with." }) : null,
|
|
4157
4220
|
flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null,
|
|
4158
|
-
sel &&
|
|
4221
|
+
sel && !loadingPlan ? /* @__PURE__ */ jsx(
|
|
4159
4222
|
DetailButton,
|
|
4160
4223
|
{
|
|
4161
4224
|
btnRef: complianceBtnRef,
|
|
@@ -4167,7 +4230,7 @@ function PayCard(props) {
|
|
|
4167
4230
|
onClick: () => setSheet(true)
|
|
4168
4231
|
}
|
|
4169
4232
|
) : null,
|
|
4170
|
-
sel && selectedVisible &&
|
|
4233
|
+
sel && selectedVisible && !loadingPlan ? /* @__PURE__ */ jsx(RateBox, { rowsOnly: true, rate: null, fromSymbol: "", toTicker: "", rows: feeRows }) : null
|
|
4171
4234
|
] }),
|
|
4172
4235
|
submitting ? /* @__PURE__ */ jsx(StepList, { steps: flow.steps }) : null,
|
|
4173
4236
|
/* @__PURE__ */ jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsx(
|
|
@@ -4175,7 +4238,7 @@ function PayCard(props) {
|
|
|
4175
4238
|
{
|
|
4176
4239
|
onClick: parked || !selectedVisible ? void 0 : flow.submit,
|
|
4177
4240
|
busy: submitting,
|
|
4178
|
-
disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall ||
|
|
4241
|
+
disabled: parked || !selectedVisible || flow.insufficient || !!flow.nativeShortfall || loadingPlan,
|
|
4179
4242
|
children: payLabel
|
|
4180
4243
|
}
|
|
4181
4244
|
) })
|
|
@@ -4513,6 +4576,10 @@ function ExchangeCard(props) {
|
|
|
4513
4576
|
}
|
|
4514
4577
|
return states;
|
|
4515
4578
|
}, [catalogue, fromToken]);
|
|
4579
|
+
const toPickerVisible = useMemo(
|
|
4580
|
+
() => destinationStates ? toPickerTokens.filter((t) => !destinationStates[`${Number(t.chainId)}:${String(t.address || "").toLowerCase()}`]?.disabled) : toPickerTokens,
|
|
4581
|
+
[toPickerTokens, destinationStates]
|
|
4582
|
+
);
|
|
4516
4583
|
const normalizedAmount = normalizeDecimalText(amount);
|
|
4517
4584
|
const amountValid = /^\d+(\.\d+)?$/.test(normalizedAmount) && Number(normalizedAmount) > 0 && Number(normalizedAmount) <= 1e9;
|
|
4518
4585
|
const rampMode = mode !== "exchange";
|
|
@@ -4733,7 +4800,7 @@ function ExchangeCard(props) {
|
|
|
4733
4800
|
{
|
|
4734
4801
|
title: isFrom ? "Exchange from" : "Exchange to",
|
|
4735
4802
|
chains,
|
|
4736
|
-
tokens: isFrom ? fromPickerTokens :
|
|
4803
|
+
tokens: isFrom ? fromPickerTokens : toPickerVisible,
|
|
4737
4804
|
balances,
|
|
4738
4805
|
optionStates: isFrom ? void 0 : destinationStates,
|
|
4739
4806
|
loading: !catalogue?.ready,
|
package/dist/core/index.cjs
CHANGED
|
@@ -1726,7 +1726,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
1726
1726
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
1727
1727
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
1728
1728
|
var WIDGET_CHANNEL = "widget";
|
|
1729
|
-
var WIDGET_VERSION = "4.
|
|
1729
|
+
var WIDGET_VERSION = "4.11.0" ;
|
|
1730
1730
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
1731
1731
|
function sanitizeVersion(raw) {
|
|
1732
1732
|
const v = String(raw).trim();
|
|
@@ -2189,9 +2189,11 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2189
2189
|
perChainBest.push(option);
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
|
-
|
|
2192
|
+
const ranked = [...heldOptions, ...perChainBest, ...leftovers];
|
|
2193
|
+
for (const option of ranked.slice(0, MAX_QUOTE_CANDIDATES)) {
|
|
2193
2194
|
candidates.push(option);
|
|
2194
2195
|
}
|
|
2196
|
+
const unquotedOptions = ranked.slice(MAX_QUOTE_CANDIDATES);
|
|
2195
2197
|
const routeErrors = [];
|
|
2196
2198
|
const routePromises = candidates.map(
|
|
2197
2199
|
(option) => buildRoute({
|
|
@@ -2233,6 +2235,7 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2233
2235
|
expiresAt: new Date(Date.now() + 2 * 60 * 1e3).toISOString(),
|
|
2234
2236
|
apiBase: api.apiBase,
|
|
2235
2237
|
routes: routesBuilt,
|
|
2238
|
+
unquotedOptions,
|
|
2236
2239
|
fundingBalances: walletBalances,
|
|
2237
2240
|
fundingAccount: payer.toLowerCase(),
|
|
2238
2241
|
destination: {
|
|
@@ -2246,6 +2249,21 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
2246
2249
|
}
|
|
2247
2250
|
};
|
|
2248
2251
|
}
|
|
2252
|
+
async function quotePayOption(api, request, payer, picked, wallet = {}) {
|
|
2253
|
+
validateDestination(request);
|
|
2254
|
+
assertAddress(payer, "Payer wallet");
|
|
2255
|
+
const [chains, tokens, routes, health] = await Promise.all([api.fetchChains(), api.fetchTokens(), api.fetchRoutes(), api.fetchRouteHealth()]);
|
|
2256
|
+
const catalogue = buildCatalogue({ chains, tokens, routes, product: "stable", supportedChainIds: SUPPORTED_CHAIN_IDS, brokenLanes: suppressedLanes(health) });
|
|
2257
|
+
const destination = { ...request, chainId: Number(request.chainId), asset: symbolKey(request.asset) };
|
|
2258
|
+
const destinationToken = findToken(tokens, destination.chainId, destination.asset);
|
|
2259
|
+
if (!destinationToken) throw new Error(`${destination.asset} is not enabled on ${chainNameOf(destination.chainId, chains)}.`);
|
|
2260
|
+
const allowedFunding = wallet.fundingAssets?.length ? new Set(wallet.fundingAssets.map(symbolKey)) : null;
|
|
2261
|
+
const option = buildPayOptions({ invoiceAsset: destination.asset, invoiceChainId: destination.chainId, tokens, routes, chains, walletChainId: wallet.chainId, catalogue }).find(
|
|
2262
|
+
(o) => !o.direct && Number(o.chainId) === Number(picked.chainId) && o.address.toLowerCase() === String(picked.address).toLowerCase() && (!allowedFunding || allowedFunding.has(o.symbolKey))
|
|
2263
|
+
);
|
|
2264
|
+
if (!option) throw new Error("That funding option is not available for this payment right now.");
|
|
2265
|
+
return buildRoute({ option, destination, destinationToken, chains, tokens, payer, fetchQuote: api.fetchQuote });
|
|
2266
|
+
}
|
|
2249
2267
|
|
|
2250
2268
|
// src/core/swap.ts
|
|
2251
2269
|
function validateSwap(swap = {}) {
|
|
@@ -2822,6 +2840,7 @@ function createEngine(config = {}) {
|
|
|
2822
2840
|
});
|
|
2823
2841
|
},
|
|
2824
2842
|
fetchPaymentPlan: (request, payer, wallet) => fetchPaymentPlan(api, request, payer, wallet, verifier.readBalances),
|
|
2843
|
+
quotePayOption: (request, payer, option, wallet) => quotePayOption(api, request, payer, option, wallet),
|
|
2825
2844
|
quoteSwapPreview: (swap, owner) => quoteSwapPreview(api, swap, owner),
|
|
2826
2845
|
buildSwapPlan: (swap, payer, wallet) => buildSwapPlan(api, swap, payer, wallet),
|
|
2827
2846
|
payerNonceBaseline: verifier.payerNonceBaseline,
|
|
@@ -2975,6 +2994,7 @@ exports.planErrorSummary = planErrorSummary;
|
|
|
2975
2994
|
exports.planMsgValueHex = planMsgValueHex;
|
|
2976
2995
|
exports.productAssets = productAssets;
|
|
2977
2996
|
exports.quotePartnerId = quotePartnerId;
|
|
2997
|
+
exports.quotePayOption = quotePayOption;
|
|
2978
2998
|
exports.quoteSwapPreview = quoteSwapPreview;
|
|
2979
2999
|
exports.recommendedDeadlineSeconds = recommendedDeadlineSeconds;
|
|
2980
3000
|
exports.registryRpc = registryRpc;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Token, Q as Quote, N as NormalizedOrder, s as PayOption, h as RouteResult, b as Chain, R as Route, a as Catalogue, t as RwaVault, F as FetchQuoteFn, u as SolveResult, O as OrderRequest, C as Compliance, v as BalanceTarget, w as BalanceEntry, x as ApiClient, P as Plan, y as SwapInput, z as PlannedTx, D as Verifier, f as ExchangeProduct, i as TxHistoryEntry, S as SanitizedTxEntry, E as EngineConfig } from '../verify-
|
|
2
|
-
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-
|
|
1
|
+
import { T as Token, Q as Quote, N as NormalizedOrder, s as PayOption, h as RouteResult, b as Chain, R as Route, a as Catalogue, t as RwaVault, F as FetchQuoteFn, u as SolveResult, O as OrderRequest, C as Compliance, v as BalanceTarget, w as BalanceEntry, x as ApiClient, P as Plan, y as SwapInput, z as PlannedTx, D as Verifier, f as ExchangeProduct, i as TxHistoryEntry, S as SanitizedTxEntry, E as EngineConfig } from '../verify-D8tr1yY1.cjs';
|
|
2
|
+
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-D8tr1yY1.cjs';
|
|
3
3
|
|
|
4
4
|
/** Default request base for the widget: the same-origin keyless custody proxy (server injects the
|
|
5
5
|
* ZeroDelta key). A host may override to `/api/v1` + an apiKey for the demo-first fallback path. */
|
|
@@ -381,6 +381,17 @@ type BalanceReader = (account: string, targets: BalanceTarget[]) => Promise<Reco
|
|
|
381
381
|
declare function validateDestination(destination: PayRequest): void;
|
|
382
382
|
declare function planErrorSummary(errors: unknown[]): string;
|
|
383
383
|
declare function fetchPaymentPlan(api: ApiClient, request: PayRequest, payer: string, wallet?: PaymentWalletContext, readBalances?: BalanceReader): Promise<Plan>;
|
|
384
|
+
/**
|
|
385
|
+
* Price ONE funding option of a payment, for a payer who picked one the plan left unquoted
|
|
386
|
+
* (`Plan.unquotedOptions`). The same route a plan would have built for it, through the same checks:
|
|
387
|
+
* the destination is validated again, the option must still be one the live catalogue offers for this
|
|
388
|
+
* invoice (an option from an older plan is not trusted blindly), and a direct option is refused —
|
|
389
|
+
* direct settlement is only ever offered after the wallet screen `fetchPaymentPlan` runs.
|
|
390
|
+
*/
|
|
391
|
+
declare function quotePayOption(api: ApiClient, request: PayRequest, payer: string, picked: {
|
|
392
|
+
chainId: number;
|
|
393
|
+
address: string;
|
|
394
|
+
}, wallet?: PaymentWalletContext): Promise<RouteResult>;
|
|
384
395
|
|
|
385
396
|
interface ValidatedSwap {
|
|
386
397
|
fromChainId: number;
|
|
@@ -586,6 +597,11 @@ interface Engine {
|
|
|
586
597
|
*/
|
|
587
598
|
fetchCatalogue: (allowedAssets?: readonly string[], product?: ExchangeProduct) => Promise<Catalogue>;
|
|
588
599
|
fetchPaymentPlan: (request: PayRequest, payer: string, wallet?: PaymentWalletContext) => Promise<Plan>;
|
|
600
|
+
/** Price one funding option a plan left unquoted (`Plan.unquotedOptions`) — see core/plan.ts. */
|
|
601
|
+
quotePayOption: (request: PayRequest, payer: string, option: {
|
|
602
|
+
chainId: number;
|
|
603
|
+
address: string;
|
|
604
|
+
}, wallet?: PaymentWalletContext) => Promise<RouteResult>;
|
|
589
605
|
quoteSwapPreview: (swap: SwapInput, owner?: string) => Promise<SwapPreview>;
|
|
590
606
|
buildSwapPlan: (swap: SwapInput, payer: string, wallet?: {
|
|
591
607
|
chainId?: number;
|
|
@@ -604,4 +620,4 @@ interface Engine {
|
|
|
604
620
|
/** Create an engine bound to a config. Its 60s registry cache is shared with every engine of the same base and key (api.ts › registryCacheFor). */
|
|
605
621
|
declare function createEngine(config?: EngineConfig): Engine;
|
|
606
622
|
|
|
607
|
-
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, NormalizedOrder, OrderRequest, PREVIEW_OWNER, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetDecimals, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, createEngine, decodeSubmitOrderCalldata, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, fetchPaymentPlan, finalOf, findToken, foldTicker, formatNative, formatUnits, isAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseUnitsDecimal, planErrorSummary, planMsgValueHex, quotePartnerId, quoteSwapPreview, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
|
623
|
+
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, NormalizedOrder, OrderRequest, PREVIEW_OWNER, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetDecimals, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, createEngine, decodeSubmitOrderCalldata, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, fetchPaymentPlan, finalOf, findToken, foldTicker, formatNative, formatUnits, isAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseUnitsDecimal, planErrorSummary, planMsgValueHex, quotePartnerId, quotePayOption, quoteSwapPreview, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Token, Q as Quote, N as NormalizedOrder, s as PayOption, h as RouteResult, b as Chain, R as Route, a as Catalogue, t as RwaVault, F as FetchQuoteFn, u as SolveResult, O as OrderRequest, C as Compliance, v as BalanceTarget, w as BalanceEntry, x as ApiClient, P as Plan, y as SwapInput, z as PlannedTx, D as Verifier, f as ExchangeProduct, i as TxHistoryEntry, S as SanitizedTxEntry, E as EngineConfig } from '../verify-
|
|
2
|
-
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-
|
|
1
|
+
import { T as Token, Q as Quote, N as NormalizedOrder, s as PayOption, h as RouteResult, b as Chain, R as Route, a as Catalogue, t as RwaVault, F as FetchQuoteFn, u as SolveResult, O as OrderRequest, C as Compliance, v as BalanceTarget, w as BalanceEntry, x as ApiClient, P as Plan, y as SwapInput, z as PlannedTx, D as Verifier, f as ExchangeProduct, i as TxHistoryEntry, S as SanitizedTxEntry, E as EngineConfig } from '../verify-D8tr1yY1.js';
|
|
2
|
+
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-D8tr1yY1.js';
|
|
3
3
|
|
|
4
4
|
/** Default request base for the widget: the same-origin keyless custody proxy (server injects the
|
|
5
5
|
* ZeroDelta key). A host may override to `/api/v1` + an apiKey for the demo-first fallback path. */
|
|
@@ -381,6 +381,17 @@ type BalanceReader = (account: string, targets: BalanceTarget[]) => Promise<Reco
|
|
|
381
381
|
declare function validateDestination(destination: PayRequest): void;
|
|
382
382
|
declare function planErrorSummary(errors: unknown[]): string;
|
|
383
383
|
declare function fetchPaymentPlan(api: ApiClient, request: PayRequest, payer: string, wallet?: PaymentWalletContext, readBalances?: BalanceReader): Promise<Plan>;
|
|
384
|
+
/**
|
|
385
|
+
* Price ONE funding option of a payment, for a payer who picked one the plan left unquoted
|
|
386
|
+
* (`Plan.unquotedOptions`). The same route a plan would have built for it, through the same checks:
|
|
387
|
+
* the destination is validated again, the option must still be one the live catalogue offers for this
|
|
388
|
+
* invoice (an option from an older plan is not trusted blindly), and a direct option is refused —
|
|
389
|
+
* direct settlement is only ever offered after the wallet screen `fetchPaymentPlan` runs.
|
|
390
|
+
*/
|
|
391
|
+
declare function quotePayOption(api: ApiClient, request: PayRequest, payer: string, picked: {
|
|
392
|
+
chainId: number;
|
|
393
|
+
address: string;
|
|
394
|
+
}, wallet?: PaymentWalletContext): Promise<RouteResult>;
|
|
384
395
|
|
|
385
396
|
interface ValidatedSwap {
|
|
386
397
|
fromChainId: number;
|
|
@@ -586,6 +597,11 @@ interface Engine {
|
|
|
586
597
|
*/
|
|
587
598
|
fetchCatalogue: (allowedAssets?: readonly string[], product?: ExchangeProduct) => Promise<Catalogue>;
|
|
588
599
|
fetchPaymentPlan: (request: PayRequest, payer: string, wallet?: PaymentWalletContext) => Promise<Plan>;
|
|
600
|
+
/** Price one funding option a plan left unquoted (`Plan.unquotedOptions`) — see core/plan.ts. */
|
|
601
|
+
quotePayOption: (request: PayRequest, payer: string, option: {
|
|
602
|
+
chainId: number;
|
|
603
|
+
address: string;
|
|
604
|
+
}, wallet?: PaymentWalletContext) => Promise<RouteResult>;
|
|
589
605
|
quoteSwapPreview: (swap: SwapInput, owner?: string) => Promise<SwapPreview>;
|
|
590
606
|
buildSwapPlan: (swap: SwapInput, payer: string, wallet?: {
|
|
591
607
|
chainId?: number;
|
|
@@ -604,4 +620,4 @@ interface Engine {
|
|
|
604
620
|
/** Create an engine bound to a config. Its 60s registry cache is shared with every engine of the same base and key (api.ts › registryCacheFor). */
|
|
605
621
|
declare function createEngine(config?: EngineConfig): Engine;
|
|
606
622
|
|
|
607
|
-
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, NormalizedOrder, OrderRequest, PREVIEW_OWNER, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetDecimals, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, createEngine, decodeSubmitOrderCalldata, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, fetchPaymentPlan, finalOf, findToken, foldTicker, formatNative, formatUnits, isAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseUnitsDecimal, planErrorSummary, planMsgValueHex, quotePartnerId, quoteSwapPreview, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
|
623
|
+
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, NormalizedOrder, OrderRequest, PREVIEW_OWNER, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetDecimals, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, createEngine, decodeSubmitOrderCalldata, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, fetchPaymentPlan, finalOf, findToken, foldTicker, formatNative, formatUnits, isAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseUnitsDecimal, planErrorSummary, planMsgValueHex, quotePartnerId, quotePayOption, quoteSwapPreview, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork };
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetClassOf, assetDecimals, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, canAttachApiKey, categoryLabel, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, counterpartTokens, createApiClient, createEngine, createVerifier, decodeSubmitOrderCalldata, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executionChainIds, fetchPaymentPlan, finalOf, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isSourceToken, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseAllowedApiBase, parseUnitsDecimal, planErrorSummary, planMsgValueHex, productAssets, quotePartnerId, quoteSwapPreview, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork } from '../chunk-
|
|
1
|
+
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, SCREEN_CACHE_TTL_MS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, assertAddress, assertQuoteMatchesSelection, assetClassOf, assetDecimals, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSwapPlan, bytes32Word, bytesPayload, canAttachApiKey, categoryLabel, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, counterpartTokens, createApiClient, createEngine, createVerifier, decodeSubmitOrderCalldata, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executionChainIds, fetchPaymentPlan, finalOf, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isSourceToken, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, parseAllowedApiBase, parseUnitsDecimal, planErrorSummary, planMsgValueHex, productAssets, quotePartnerId, quotePayOption, quoteSwapPreview, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, withVaultArtwork } from '../chunk-5WTRI2KO.js';
|