@glacislabs/stablegenie-zerodelta 4.18.0 → 4.18.2

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.
@@ -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, isSolanaChainId, isSellableRwa, formatUnits, amountFieldError, solanaQuoteCompliance, directComplianceFromScreens, SUPPORTED_CHAIN_IDS, complianceChecks, DIRECT_CHECK_IDS, isSolanaAddress, createEngine, isAddress, checkNativeFee, nativeFeeShortLabel, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, TRACKING, mergeHistory, solanaPlanNeedsPreparation, SOLANA_CHAIN_ID, unattributedComplianceReasons, distinctScreenedWallets, formatJurisdiction, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, BUNDLED_RPC, foldTicker } from './chunk-AEAJKHPP.js';
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, isSolanaChainId, isSellableRwa, formatUnits, amountFieldError, solanaQuoteCompliance, directComplianceFromScreens, SUPPORTED_CHAIN_IDS, complianceChecks, DIRECT_CHECK_IDS, isSolanaAddress, createEngine, isAddress, checkNativeFee, nativeFeeShortLabel, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, TRACKING, mergeHistory, solanaPlanNeedsPreparation, SOLANA_CHAIN_ID, unattributedComplianceReasons, distinctScreenedWallets, formatJurisdiction, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, BUNDLED_RPC, foldTicker } from './chunk-OIJN6SHV.js';
2
2
  import { createContext, useState, useRef, useMemo, useEffect, useCallback, useId, useLayoutEffect, createElement, useContext, useSyncExternalStore, useReducer } from 'react';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -19,11 +19,15 @@ function useDelivery(engine, hash) {
19
19
  let alive = true;
20
20
  let timer2;
21
21
  let answered = false;
22
+ let waitsOnOwner = false;
22
23
  let unanswered = 0;
23
24
  const started2 = Date.now();
24
25
  setState({ hash, value: TRACKING });
25
26
  const schedule = () => {
26
- if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) return setState({ hash, value: UNAVAILABLE });
27
+ if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) {
28
+ if (waitsOnOwner) return;
29
+ return setState({ hash, value: UNAVAILABLE });
30
+ }
27
31
  timer2 = setTimeout(tick, deliveryPollDelay(Date.now() - started2));
28
32
  };
29
33
  const tick = async () => {
@@ -36,6 +40,7 @@ function useDelivery(engine, hash) {
36
40
  return schedule();
37
41
  }
38
42
  answered = true;
43
+ waitsOnOwner = next.phase === "attention";
39
44
  setState({ hash, value: next });
40
45
  if (next.phase === "delivered" || next.phase === "failed") return;
41
46
  schedule();
@@ -719,6 +724,40 @@ function useFlow(args) {
719
724
  addRoute
720
725
  };
721
726
  }
727
+ var RETRY_DELAYS_MS = [800, 2400, 6e3];
728
+ function useCatalogue(engine, options = {}) {
729
+ const { allowedAssets, product, solanaSources } = options;
730
+ const enabled = options.enabled !== false;
731
+ const [catalogue, setCatalogue] = useState(null);
732
+ const [failed, setFailed] = useState(false);
733
+ const [round, setRound] = useState(0);
734
+ useEffect(() => {
735
+ if (!enabled) return;
736
+ let alive = true;
737
+ let timer2;
738
+ let attempt = 0;
739
+ setFailed(false);
740
+ const read = () => {
741
+ engine.fetchCatalogue(allowedAssets, product, solanaSources ? { solanaSources: true } : void 0).then((next) => {
742
+ if (!alive) return;
743
+ setCatalogue(next);
744
+ if (next.ready) return;
745
+ if (attempt >= RETRY_DELAYS_MS.length) {
746
+ setFailed(true);
747
+ return;
748
+ }
749
+ timer2 = setTimeout(read, RETRY_DELAYS_MS[attempt++]);
750
+ });
751
+ };
752
+ read();
753
+ return () => {
754
+ alive = false;
755
+ if (timer2) clearTimeout(timer2);
756
+ };
757
+ }, [engine, allowedAssets, product, solanaSources, enabled, round]);
758
+ const retry = useCallback(() => setRound((n) => n + 1), []);
759
+ return { catalogue, loading: enabled && !catalogue?.ready && !failed, failed, retry };
760
+ }
722
761
  function balanceKey(chainId, tokenAddress) {
723
762
  return `${Number(chainId)}:${String(tokenAddress || "").toLowerCase()}`;
724
763
  }
@@ -1068,6 +1107,9 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
1068
1107
  .sg-sel-sub{display:block;font-size:11px;font-weight:600;color:var(--sg-text-muted);margin-top:1px}
1069
1108
  .sg-toklist{display:flex;flex-direction:column;gap:2px;max-height:320px;overflow-y:auto;margin:0 -6px;padding:0 6px;scrollbar-width:thin}
1070
1109
  .sg-sel-empty{padding:26px 10px;text-align:center;font-size:13px;color:var(--sg-text-muted)}
1110
+ /* retry beside the "did not load" message: a link, not a CTA \u2014 the primary action is still picking. */
1111
+ .sg-sel-retry{background:none;border:0;padding:0;font:inherit;font-weight:700;color:var(--sg-accent);cursor:pointer;text-decoration:underline}
1112
+ .sg-sel-retry:hover{opacity:.8}
1071
1113
 
1072
1114
  /* Token picker, token first then network \u2014 the ZeroDelta dapp's TokenSelectModal (Figma 708:27430,
1073
1115
  2517:52576), drawn in the widget's own theme: the dapp's brand tint is the accent, its green the
@@ -2713,7 +2755,13 @@ function TokenSelect(props) {
2713
2755
  ] })
2714
2756
  ] }) : null,
2715
2757
  listed.length > 0 || visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "sg-pk-cap", children: side === "from" ? "Your tokens \xB7 All networks" : "Popular tokens \xB7 All networks" }) : null,
2716
- /* @__PURE__ */ jsx("div", { className: "sg-pk-list", ref: listRef, role: "group", "aria-label": props.title, children: visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "sg-pk-empty", children: props.loading ? "Loading the token list\u2026" : "No tokens found." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2758
+ /* @__PURE__ */ jsx("div", { className: "sg-pk-list", ref: listRef, role: "group", "aria-label": props.title, children: visible.length === 0 ? props.loading ? /* @__PURE__ */ jsx("p", { className: "sg-pk-empty", children: "Loading the token list\u2026" }) : props.failed ? /* @__PURE__ */ jsxs("p", { className: "sg-pk-empty", role: "alert", children: [
2759
+ "The token list did not load.",
2760
+ props.onRetry ? /* @__PURE__ */ jsxs(Fragment, { children: [
2761
+ " ",
2762
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sg-sel-retry", onClick: props.onRetry, children: "Retry" })
2763
+ ] }) : null
2764
+ ] }) : /* @__PURE__ */ jsx("p", { className: "sg-pk-empty", children: "No tokens found." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2717
2765
  listed.map((g) => renderRow(g, false)),
2718
2766
  other.length > 0 ? /* @__PURE__ */ jsx("p", { className: "sg-pk-cap sg-pk-cap--section", "data-testid": "other-tokens-cap", children: "Other supported tokens" }) : null,
2719
2767
  other.map((g) => renderRow(g, true))
@@ -3258,6 +3306,7 @@ function useWalletHistory(engine, wallets) {
3258
3306
  if (!engine || !key) return;
3259
3307
  let alive = true;
3260
3308
  let timer2;
3309
+ let started2 = Date.now();
3261
3310
  const read = async () => {
3262
3311
  if (timer2) clearTimeout(timer2);
3263
3312
  timer2 = void 0;
@@ -3267,10 +3316,14 @@ function useWalletHistory(engine, wallets) {
3267
3316
  if (next) setEntries(next);
3268
3317
  if (!travelling(next)) return;
3269
3318
  }
3319
+ if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) return;
3270
3320
  timer2 = setTimeout(read, WALLET_HISTORY_REFRESH_MS);
3271
3321
  };
3272
3322
  void read();
3273
- const onRecorded = () => void read();
3323
+ const onRecorded = () => {
3324
+ started2 = Date.now();
3325
+ void read();
3326
+ };
3274
3327
  if (typeof window !== "undefined") window.addEventListener(TX_HISTORY_EVENT, onRecorded);
3275
3328
  return () => {
3276
3329
  alive = false;
@@ -4688,17 +4741,20 @@ function PaymentIsland(props) {
4688
4741
  const exToAsset = exTo?.symbol;
4689
4742
  const normEx = normalizeDecimalText(exAmount);
4690
4743
  const exAmountValid = /^\d+(\.\d+)?$/.test(normEx) && Number(normEx) > 0 && Number(normEx) <= 1e9;
4691
- const [catalogue, setCatalogue] = useState(null);
4692
- useEffect(() => {
4693
- if (bankSettlement || !isPay && rampMode) return;
4694
- let alive = true;
4695
- engine.fetchCatalogue(isPay ? void 0 : exAllowed, isPay ? "stable" : exProduct).then((next) => {
4696
- if (alive) setCatalogue(next);
4697
- });
4698
- return () => {
4699
- alive = false;
4700
- };
4701
- }, [engine, isPay, rampMode, bankSettlement, exAllowed, exProduct]);
4744
+ const {
4745
+ catalogue,
4746
+ loading: catalogueLoading,
4747
+ failed: catalogueFailed,
4748
+ retry: retryCatalogue
4749
+ } = useCatalogue(engine, {
4750
+ // Pay's funding picker draws from the FULL asset universe — the merchant's `fundingAssets` prop
4751
+ // is what narrows it, not this call — while the exchange pickers honour the host's `assets`.
4752
+ // Pay always builds the STABLE catalogue — its funding picker is bounded by the merchant's
4753
+ // `fundingAssets`, not by this call, and an RWA can never settle an invoice.
4754
+ allowedAssets: isPay ? void 0 : exAllowed,
4755
+ product: isPay ? "stable" : exProduct,
4756
+ enabled: !(bankSettlement || !isPay && rampMode)
4757
+ });
4702
4758
  const chains = useMemo(() => {
4703
4759
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
4704
4760
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
@@ -5149,7 +5205,9 @@ function PaymentIsland(props) {
5149
5205
  tokens: isFrom ? exFromPicker : exToPicker,
5150
5206
  balances: exBalances,
5151
5207
  optionStates: isFrom ? void 0 : exDestinationStates,
5152
- loading: !catalogue?.ready,
5208
+ loading: catalogueLoading,
5209
+ failed: catalogueFailed,
5210
+ onRetry: retryCatalogue,
5153
5211
  onBack: () => closeSelector(openerRef),
5154
5212
  onPick: (pick) => {
5155
5213
  (isFrom ? setExFrom : setExTo)({ chainId: pick.chainId, symbol: symbolKey(pick.symbol) });
@@ -5554,22 +5612,12 @@ function PayCard(props) {
5554
5612
  }
5555
5613
  return map;
5556
5614
  }, [annotated, holdings.loading, unquoted, listBalances]);
5557
- const [catalogue, setCatalogue] = useState(null);
5615
+ const { catalogue } = useCatalogue(engine, { enabled: props.variant !== "pill" });
5558
5616
  const chains = useMemo(() => {
5559
5617
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
5560
5618
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
5561
5619
  }, [catalogue]);
5562
5620
  const registryTokens = useMemo(() => catalogue?.tokens ?? [], [catalogue]);
5563
- useEffect(() => {
5564
- if (props.variant === "pill") return;
5565
- let alive = true;
5566
- engine.fetchCatalogue().then((next) => {
5567
- if (alive) setCatalogue(next);
5568
- });
5569
- return () => {
5570
- alive = false;
5571
- };
5572
- }, [engine, props.variant]);
5573
5621
  const fundingTokens = useMemo(() => {
5574
5622
  const seen = /* @__PURE__ */ new Set();
5575
5623
  const list = [];
@@ -5811,17 +5859,8 @@ function StableGenieSwap(props) {
5811
5859
  const recipientState = useRecipient(toChainId, props.recipient);
5812
5860
  const recipient = recipientState.recipient;
5813
5861
  const needsRecipient = recipientState.missing || !!recipientState.error;
5814
- const [catalogue, setCatalogue] = useState(null);
5815
- useEffect(() => {
5816
- if (props.variant === "pill") return;
5817
- let alive = true;
5818
- engine.fetchCatalogue().then((next) => {
5819
- if (alive && next.ready) setCatalogue(next);
5820
- });
5821
- return () => {
5822
- alive = false;
5823
- };
5824
- }, [engine, props.variant]);
5862
+ const { catalogue: liveCatalogue } = useCatalogue(engine, { enabled: props.variant !== "pill" });
5863
+ const catalogue = liveCatalogue?.ready ? liveCatalogue : null;
5825
5864
  const assetOptions = useMemo(() => {
5826
5865
  if (!catalogue) return bundledAssetOptions;
5827
5866
  const symbols = [...new Set(catalogue.tokens.map((t) => t.symbol.toUpperCase()))];
@@ -6283,17 +6322,12 @@ function ExchangeCard(props) {
6283
6322
  const isPill = props.variant === "pill";
6284
6323
  const product = props.product ?? "stable";
6285
6324
  const allowed = useMemo(() => props.assets?.length ? props.assets.map((a) => symbolKey(a)) : void 0, [props.assets]);
6286
- const [catalogue, setCatalogue] = useState(null);
6287
- useEffect(() => {
6288
- if (isPill) return;
6289
- let alive = true;
6290
- engine.fetchCatalogue(allowed, product, { solanaSources: true }).then((next) => {
6291
- if (alive) setCatalogue(next);
6292
- });
6293
- return () => {
6294
- alive = false;
6295
- };
6296
- }, [engine, allowed, product, isPill]);
6325
+ const { catalogue, loading: catalogueLoading, failed: catalogueFailed, retry: retryCatalogue } = useCatalogue(engine, {
6326
+ allowedAssets: allowed,
6327
+ product,
6328
+ solanaSources: true,
6329
+ enabled: !isPill
6330
+ });
6297
6331
  const chains = useMemo(() => {
6298
6332
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
6299
6333
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
@@ -6744,7 +6778,9 @@ function ExchangeCard(props) {
6744
6778
  tokens: isFrom ? fromPickerTokens : toPickerVisible,
6745
6779
  balances,
6746
6780
  optionStates: isFrom ? void 0 : destinationStates,
6747
- loading: !catalogue?.ready,
6781
+ loading: catalogueLoading,
6782
+ failed: catalogueFailed,
6783
+ onRetry: retryCatalogue,
6748
6784
  walletMissing: (t) => isSolanaChainId(t.chainId) && !solanaWallet.address,
6749
6785
  onBack: () => closeSelector(isFrom),
6750
6786
  onPick: (pick) => {
@@ -1755,8 +1755,8 @@ async function simulateSolanaCost(rpc, plan) {
1755
1755
  }
1756
1756
 
1757
1757
  // src/core/delivery.ts
1758
- var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "expired", "failed"]);
1759
- var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim"]);
1758
+ var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "failed"]);
1759
+ var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim", "expired"]);
1760
1760
  var TRACKING = Object.freeze({ phase: "tracking", status: "", steps: [] });
1761
1761
  var word = (v) => typeof v === "string" ? v.trim().toLowerCase() : "";
1762
1762
  var STEP_ORDER = { submitted: 0, arrived: 1, filled: 2, delivered: 3 };
@@ -2982,7 +2982,7 @@ var CHANNEL_HEADER = "x-zd-channel";
2982
2982
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
2983
2983
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
2984
2984
  var WIDGET_CHANNEL = "widget";
2985
- var WIDGET_VERSION = "4.18.0" ;
2985
+ var WIDGET_VERSION = "4.18.2" ;
2986
2986
  var MAX_CHANNEL_VERSION_LEN = 32;
2987
2987
  function sanitizeVersion(raw2) {
2988
2988
  const v = String(raw2).trim();
@@ -2327,8 +2327,8 @@ async function simulateSolanaCost(rpc, plan) {
2327
2327
  }
2328
2328
 
2329
2329
  // src/core/delivery.ts
2330
- var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "expired", "failed"]);
2331
- var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim"]);
2330
+ var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "failed"]);
2331
+ var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim", "expired"]);
2332
2332
  var TRACKING = Object.freeze({ phase: "tracking", status: "", steps: [] });
2333
2333
  var word = (v) => typeof v === "string" ? v.trim().toLowerCase() : "";
2334
2334
  var STEP_ORDER = { submitted: 0, arrived: 1, filled: 2, delivered: 3 };
@@ -3554,7 +3554,7 @@ var CHANNEL_HEADER = "x-zd-channel";
3554
3554
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
3555
3555
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
3556
3556
  var WIDGET_CHANNEL = "widget";
3557
- var WIDGET_VERSION = "4.18.0" ;
3557
+ var WIDGET_VERSION = "4.18.2" ;
3558
3558
  var MAX_CHANNEL_VERSION_LEN = 32;
3559
3559
  function sanitizeVersion(raw2) {
3560
3560
  const v = String(raw2).trim();
@@ -1 +1 @@
1
- export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BUNDLED_SOLANA_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, 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, SOLANA_CHAIN_ID, SOLANA_DESTINATION_ASSETS, SOL_SHORTFALL_MESSAGE, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_DISCRIMINATOR, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SolanaSendError, TOKEN_2022_PROGRAM, TOKEN_PROGRAM, TRACKING, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, WALLET_HISTORY_LIMIT, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assetClassOf, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, bytes32Word, bytesEqual, bytesPayload, canAttachApiKey, categoryLabel, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan as checkPlan, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, cosignSolanaEvent, counterpartTokens, createApiClient, createEngine, createSolanaRpc, createVerifier, decodeSolanaSubmitOrder, decodeSolanaSubmitOrder as decodeSubmitOrder, decodeSubmitOrderCalldata, deriveSolanaEvent, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executeSolanaPlan, executeSolanaPlanStaged, executionChainIds, expectedSolanaDelivery, fetchDelivery, fetchPaymentPlan, fetchWalletHistory, finalOf, findProgramAddress, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hexBytes, hexToSolanaKey, historyEntryFromOrder, historyKey, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isChainAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSellableRwa, isSolanaAddress, isSolanaChainId, isSourceToken, isSubmitOrder, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, mergeHistory, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeDelivery, normalizeOrderRequest, normalizeOrderRequests, overwriteBlockhash, parseAddressLookupTable, parseAllowedApiBase, parseSolanaTransaction, parseUnitsDecimal, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, previewSolanaSource, productAssets, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, serializeSolanaTransaction, sha256, simulateSolanaCost, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaLamportShortfall, solanaPlanNeedsPreparation, solanaQuoteCompliance, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, verifySolanaSubmit as verifySubmit, verifySolanaTransaction as verifyTransaction, withVaultArtwork } from '../chunk-AEAJKHPP.js';
1
+ export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BUNDLED_SOLANA_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, 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, SOLANA_CHAIN_ID, SOLANA_DESTINATION_ASSETS, SOL_SHORTFALL_MESSAGE, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_DISCRIMINATOR, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SolanaSendError, TOKEN_2022_PROGRAM, TOKEN_PROGRAM, TRACKING, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, WALLET_HISTORY_LIMIT, ZERO_ADDRESS, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assetClassOf, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, blockLabelFor, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, bytes32Word, bytesEqual, bytesPayload, canAttachApiKey, categoryLabel, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan as checkPlan, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, classifyQuoteError, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, cosignSolanaEvent, counterpartTokens, createApiClient, createEngine, createSolanaRpc, createVerifier, decodeSolanaSubmitOrder, decodeSolanaSubmitOrder as decodeSubmitOrder, decodeSubmitOrderCalldata, deriveSolanaEvent, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, exceedsLaneLimit, executableRoutes, executeSolanaPlan, executeSolanaPlanStaged, executionChainIds, expectedSolanaDelivery, fetchDelivery, fetchPaymentPlan, fetchWalletHistory, finalOf, findProgramAddress, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, hasReachableDestination, hexBytes, hexToSolanaKey, historyEntryFromOrder, historyKey, hubDeliverableSymbols, humanizeComplianceReason, isAddress, isChainAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSellableRwa, isSolanaAddress, isSolanaChainId, isSourceToken, isSubmitOrder, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, mergeHistory, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeDelivery, normalizeOrderRequest, normalizeOrderRequests, overwriteBlockhash, parseAddressLookupTable, parseAllowedApiBase, parseSolanaTransaction, parseUnitsDecimal, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, previewSolanaSource, productAssets, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, screeningOutcomeOf, serializeSolanaTransaction, sha256, simulateSolanaCost, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaLamportShortfall, solanaPlanNeedsPreparation, solanaQuoteCompliance, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, verifySolanaSubmit as verifySubmit, verifySolanaTransaction as verifyTransaction, withVaultArtwork } from '../chunk-OIJN6SHV.js';
package/dist/index.cjs CHANGED
@@ -575,8 +575,8 @@ var init_ed255192 = __esm({
575
575
  });
576
576
 
577
577
  // src/core/delivery.ts
578
- var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "expired", "failed"]);
579
- var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim"]);
578
+ var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "failed"]);
579
+ var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim", "expired"]);
580
580
  var TRACKING = Object.freeze({ phase: "tracking", status: "", steps: [] });
581
581
  var word = (v) => typeof v === "string" ? v.trim().toLowerCase() : "";
582
582
  var STEP_ORDER = { submitted: 0, arrived: 1, filled: 2, delivered: 3 };
@@ -633,11 +633,15 @@ function useDelivery(engine, hash2) {
633
633
  let alive = true;
634
634
  let timer2;
635
635
  let answered = false;
636
+ let waitsOnOwner = false;
636
637
  let unanswered = 0;
637
638
  const started2 = Date.now();
638
639
  setState({ hash: hash2, value: TRACKING });
639
640
  const schedule = () => {
640
- if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) return setState({ hash: hash2, value: UNAVAILABLE });
641
+ if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) {
642
+ if (waitsOnOwner) return;
643
+ return setState({ hash: hash2, value: UNAVAILABLE });
644
+ }
641
645
  timer2 = setTimeout(tick, deliveryPollDelay(Date.now() - started2));
642
646
  };
643
647
  const tick = async () => {
@@ -650,6 +654,7 @@ function useDelivery(engine, hash2) {
650
654
  return schedule();
651
655
  }
652
656
  answered = true;
657
+ waitsOnOwner = next.phase === "attention";
653
658
  setState({ hash: hash2, value: next });
654
659
  if (next.phase === "delivered" || next.phase === "failed") return;
655
660
  schedule();
@@ -3646,7 +3651,7 @@ var CHANNEL_HEADER = "x-zd-channel";
3646
3651
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
3647
3652
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
3648
3653
  var WIDGET_CHANNEL = "widget";
3649
- var WIDGET_VERSION = "4.18.0" ;
3654
+ var WIDGET_VERSION = "4.18.2" ;
3650
3655
  var MAX_CHANNEL_VERSION_LEN = 32;
3651
3656
  function sanitizeVersion(raw2) {
3652
3657
  const v = String(raw2).trim();
@@ -5376,6 +5381,40 @@ function useFlow(args) {
5376
5381
  addRoute
5377
5382
  };
5378
5383
  }
5384
+ var RETRY_DELAYS_MS = [800, 2400, 6e3];
5385
+ function useCatalogue(engine, options = {}) {
5386
+ const { allowedAssets, product, solanaSources } = options;
5387
+ const enabled = options.enabled !== false;
5388
+ const [catalogue, setCatalogue] = react.useState(null);
5389
+ const [failed, setFailed] = react.useState(false);
5390
+ const [round, setRound] = react.useState(0);
5391
+ react.useEffect(() => {
5392
+ if (!enabled) return;
5393
+ let alive = true;
5394
+ let timer2;
5395
+ let attempt = 0;
5396
+ setFailed(false);
5397
+ const read = () => {
5398
+ engine.fetchCatalogue(allowedAssets, product, solanaSources ? { solanaSources: true } : void 0).then((next) => {
5399
+ if (!alive) return;
5400
+ setCatalogue(next);
5401
+ if (next.ready) return;
5402
+ if (attempt >= RETRY_DELAYS_MS.length) {
5403
+ setFailed(true);
5404
+ return;
5405
+ }
5406
+ timer2 = setTimeout(read, RETRY_DELAYS_MS[attempt++]);
5407
+ });
5408
+ };
5409
+ read();
5410
+ return () => {
5411
+ alive = false;
5412
+ if (timer2) clearTimeout(timer2);
5413
+ };
5414
+ }, [engine, allowedAssets, product, solanaSources, enabled, round]);
5415
+ const retry = react.useCallback(() => setRound((n) => n + 1), []);
5416
+ return { catalogue, loading: enabled && !catalogue?.ready && !failed, failed, retry };
5417
+ }
5379
5418
  function balanceKey(chainId, tokenAddress) {
5380
5419
  return `${Number(chainId)}:${String(tokenAddress || "").toLowerCase()}`;
5381
5420
  }
@@ -5725,6 +5764,9 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
5725
5764
  .sg-sel-sub{display:block;font-size:11px;font-weight:600;color:var(--sg-text-muted);margin-top:1px}
5726
5765
  .sg-toklist{display:flex;flex-direction:column;gap:2px;max-height:320px;overflow-y:auto;margin:0 -6px;padding:0 6px;scrollbar-width:thin}
5727
5766
  .sg-sel-empty{padding:26px 10px;text-align:center;font-size:13px;color:var(--sg-text-muted)}
5767
+ /* retry beside the "did not load" message: a link, not a CTA \u2014 the primary action is still picking. */
5768
+ .sg-sel-retry{background:none;border:0;padding:0;font:inherit;font-weight:700;color:var(--sg-accent);cursor:pointer;text-decoration:underline}
5769
+ .sg-sel-retry:hover{opacity:.8}
5728
5770
 
5729
5771
  /* Token picker, token first then network \u2014 the ZeroDelta dapp's TokenSelectModal (Figma 708:27430,
5730
5772
  2517:52576), drawn in the widget's own theme: the dapp's brand tint is the accent, its green the
@@ -7370,7 +7412,13 @@ function TokenSelect(props) {
7370
7412
  ] })
7371
7413
  ] }) : null,
7372
7414
  listed.length > 0 || visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-pk-cap", children: side === "from" ? "Your tokens \xB7 All networks" : "Popular tokens \xB7 All networks" }) : null,
7373
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-pk-list", ref: listRef, role: "group", "aria-label": props.title, children: visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-pk-empty", children: props.loading ? "Loading the token list\u2026" : "No tokens found." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7415
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-pk-list", ref: listRef, role: "group", "aria-label": props.title, children: visible.length === 0 ? props.loading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-pk-empty", children: "Loading the token list\u2026" }) : props.failed ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-pk-empty", role: "alert", children: [
7416
+ "The token list did not load.",
7417
+ props.onRetry ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7418
+ " ",
7419
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-sel-retry", onClick: props.onRetry, children: "Retry" })
7420
+ ] }) : null
7421
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-pk-empty", children: "No tokens found." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7374
7422
  listed.map((g) => renderRow(g, false)),
7375
7423
  other.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-pk-cap sg-pk-cap--section", "data-testid": "other-tokens-cap", children: "Other supported tokens" }) : null,
7376
7424
  other.map((g) => renderRow(g, true))
@@ -7915,6 +7963,7 @@ function useWalletHistory(engine, wallets) {
7915
7963
  if (!engine || !key) return;
7916
7964
  let alive = true;
7917
7965
  let timer2;
7966
+ let started2 = Date.now();
7918
7967
  const read = async () => {
7919
7968
  if (timer2) clearTimeout(timer2);
7920
7969
  timer2 = void 0;
@@ -7924,10 +7973,14 @@ function useWalletHistory(engine, wallets) {
7924
7973
  if (next) setEntries(next);
7925
7974
  if (!travelling(next)) return;
7926
7975
  }
7976
+ if (Date.now() - started2 > DELIVERY_GIVE_UP_MS) return;
7927
7977
  timer2 = setTimeout(read, WALLET_HISTORY_REFRESH_MS);
7928
7978
  };
7929
7979
  void read();
7930
- const onRecorded = () => void read();
7980
+ const onRecorded = () => {
7981
+ started2 = Date.now();
7982
+ void read();
7983
+ };
7931
7984
  if (typeof window !== "undefined") window.addEventListener(TX_HISTORY_EVENT, onRecorded);
7932
7985
  return () => {
7933
7986
  alive = false;
@@ -9345,17 +9398,20 @@ function PaymentIsland(props) {
9345
9398
  const exToAsset = exTo?.symbol;
9346
9399
  const normEx = normalizeDecimalText(exAmount);
9347
9400
  const exAmountValid = /^\d+(\.\d+)?$/.test(normEx) && Number(normEx) > 0 && Number(normEx) <= 1e9;
9348
- const [catalogue, setCatalogue] = react.useState(null);
9349
- react.useEffect(() => {
9350
- if (bankSettlement || !isPay && rampMode) return;
9351
- let alive = true;
9352
- engine.fetchCatalogue(isPay ? void 0 : exAllowed, isPay ? "stable" : exProduct).then((next) => {
9353
- if (alive) setCatalogue(next);
9354
- });
9355
- return () => {
9356
- alive = false;
9357
- };
9358
- }, [engine, isPay, rampMode, bankSettlement, exAllowed, exProduct]);
9401
+ const {
9402
+ catalogue,
9403
+ loading: catalogueLoading,
9404
+ failed: catalogueFailed,
9405
+ retry: retryCatalogue
9406
+ } = useCatalogue(engine, {
9407
+ // Pay's funding picker draws from the FULL asset universe — the merchant's `fundingAssets` prop
9408
+ // is what narrows it, not this call — while the exchange pickers honour the host's `assets`.
9409
+ // Pay always builds the STABLE catalogue — its funding picker is bounded by the merchant's
9410
+ // `fundingAssets`, not by this call, and an RWA can never settle an invoice.
9411
+ allowedAssets: isPay ? void 0 : exAllowed,
9412
+ product: isPay ? "stable" : exProduct,
9413
+ enabled: !(bankSettlement || !isPay && rampMode)
9414
+ });
9359
9415
  const chains = react.useMemo(() => {
9360
9416
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
9361
9417
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
@@ -9806,7 +9862,9 @@ function PaymentIsland(props) {
9806
9862
  tokens: isFrom ? exFromPicker : exToPicker,
9807
9863
  balances: exBalances,
9808
9864
  optionStates: isFrom ? void 0 : exDestinationStates,
9809
- loading: !catalogue?.ready,
9865
+ loading: catalogueLoading,
9866
+ failed: catalogueFailed,
9867
+ onRetry: retryCatalogue,
9810
9868
  onBack: () => closeSelector(openerRef),
9811
9869
  onPick: (pick) => {
9812
9870
  (isFrom ? setExFrom : setExTo)({ chainId: pick.chainId, symbol: symbolKey(pick.symbol) });
@@ -10211,22 +10269,12 @@ function PayCard(props) {
10211
10269
  }
10212
10270
  return map;
10213
10271
  }, [annotated, holdings.loading, unquoted, listBalances]);
10214
- const [catalogue, setCatalogue] = react.useState(null);
10272
+ const { catalogue } = useCatalogue(engine, { enabled: props.variant !== "pill" });
10215
10273
  const chains = react.useMemo(() => {
10216
10274
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
10217
10275
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
10218
10276
  }, [catalogue]);
10219
10277
  const registryTokens = react.useMemo(() => catalogue?.tokens ?? [], [catalogue]);
10220
- react.useEffect(() => {
10221
- if (props.variant === "pill") return;
10222
- let alive = true;
10223
- engine.fetchCatalogue().then((next) => {
10224
- if (alive) setCatalogue(next);
10225
- });
10226
- return () => {
10227
- alive = false;
10228
- };
10229
- }, [engine, props.variant]);
10230
10278
  const fundingTokens = react.useMemo(() => {
10231
10279
  const seen = /* @__PURE__ */ new Set();
10232
10280
  const list = [];
@@ -10468,17 +10516,8 @@ function StableGenieSwap(props) {
10468
10516
  const recipientState = useRecipient(toChainId, props.recipient);
10469
10517
  const recipient2 = recipientState.recipient;
10470
10518
  const needsRecipient = recipientState.missing || !!recipientState.error;
10471
- const [catalogue, setCatalogue] = react.useState(null);
10472
- react.useEffect(() => {
10473
- if (props.variant === "pill") return;
10474
- let alive = true;
10475
- engine.fetchCatalogue().then((next) => {
10476
- if (alive && next.ready) setCatalogue(next);
10477
- });
10478
- return () => {
10479
- alive = false;
10480
- };
10481
- }, [engine, props.variant]);
10519
+ const { catalogue: liveCatalogue } = useCatalogue(engine, { enabled: props.variant !== "pill" });
10520
+ const catalogue = liveCatalogue?.ready ? liveCatalogue : null;
10482
10521
  const assetOptions = react.useMemo(() => {
10483
10522
  if (!catalogue) return bundledAssetOptions;
10484
10523
  const symbols = [...new Set(catalogue.tokens.map((t) => t.symbol.toUpperCase()))];
@@ -10940,17 +10979,12 @@ function ExchangeCard(props) {
10940
10979
  const isPill = props.variant === "pill";
10941
10980
  const product = props.product ?? "stable";
10942
10981
  const allowed = react.useMemo(() => props.assets?.length ? props.assets.map((a) => symbolKey(a)) : void 0, [props.assets]);
10943
- const [catalogue, setCatalogue] = react.useState(null);
10944
- react.useEffect(() => {
10945
- if (isPill) return;
10946
- let alive = true;
10947
- engine.fetchCatalogue(allowed, product, { solanaSources: true }).then((next) => {
10948
- if (alive) setCatalogue(next);
10949
- });
10950
- return () => {
10951
- alive = false;
10952
- };
10953
- }, [engine, allowed, product, isPill]);
10982
+ const { catalogue, loading: catalogueLoading, failed: catalogueFailed, retry: retryCatalogue } = useCatalogue(engine, {
10983
+ allowedAssets: allowed,
10984
+ product,
10985
+ solanaSources: true,
10986
+ enabled: !isPill
10987
+ });
10954
10988
  const chains = react.useMemo(() => {
10955
10989
  const order = new Map(SUPPORTED_CHAINS.map((id, i) => [id, i]));
10956
10990
  return [...catalogue?.chains ?? []].sort((a, b) => (order.get(Number(a.chainId)) ?? 99) - (order.get(Number(b.chainId)) ?? 99) || Number(a.chainId) - Number(b.chainId));
@@ -11401,7 +11435,9 @@ function ExchangeCard(props) {
11401
11435
  tokens: isFrom ? fromPickerTokens : toPickerVisible,
11402
11436
  balances,
11403
11437
  optionStates: isFrom ? void 0 : destinationStates,
11404
- loading: !catalogue?.ready,
11438
+ loading: catalogueLoading,
11439
+ failed: catalogueFailed,
11440
+ onRetry: retryCatalogue,
11405
11441
  walletMissing: (t) => isSolanaChainId(t.chainId) && !solanaWallet.address,
11406
11442
  onBack: () => closeSelector(isFrom),
11407
11443
  onPick: (pick) => {
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-CWAEDN4I.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-AEAJKHPP.js';
1
+ export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, connectSolanaWallet, darkTheme, disconnectSolanaWallet, discoverSolanaWallets, lightTheme, mount, onSolanaAccountChange, resolveTheme, solanaWalletSigner, useSolanaWallet, watchSolanaWallets } from './chunk-LMK5C6VA.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-OIJN6SHV.js';