@glacislabs/stablegenie-zerodelta 4.0.0 → 4.1.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.
@@ -238,6 +238,16 @@ interface Token {
238
238
  isChainedDestination?: boolean;
239
239
  [k: string]: unknown;
240
240
  }
241
+ /** One row of `GET /rwa/vaults`. Only the artwork fields are read — the widget does not render the
242
+ * vault catalogue, it borrows the icons the token registry does not serve. */
243
+ interface RwaVault {
244
+ symbol?: string;
245
+ /** Card-sized artwork, as a root-relative gateway path (`/api/v1/rwa/icons/…`). */
246
+ iconUrl?: string;
247
+ /** The round badge — what a token glyph wants. */
248
+ iconMiniUrl?: string;
249
+ [k: string]: unknown;
250
+ }
241
251
  interface Route {
242
252
  tokenId?: string;
243
253
  tokenName?: string;
@@ -340,6 +350,39 @@ interface PlannedTx {
340
350
  amountRaw?: string;
341
351
  mock?: boolean;
342
352
  }
353
+ /**
354
+ * ONE ORDER of a route, in display terms.
355
+ *
356
+ * A stable transfer or swap is a single order. A CHAINED quote — how every real-world asset is
357
+ * delivered — is **one signature and several orders**: leg 1 moves the payer's stable to the chain
358
+ * the vault executes on, leg 2 buys the share there. The payer signs once and is shown one
359
+ * "from → to", so the middle hop is invisible — and an invisible hop is what makes a CORRECT
360
+ * delivery look like a wrong one (the dapp shipped exactly that confusion). Recording the legs is
361
+ * what lets a transaction history answer "did my money take one hop or two, and through where".
362
+ *
363
+ * Every field is display-safe by construction — symbols, chain ids and formatted amounts, never a
364
+ * token address — so a leg can be persisted to history as-is.
365
+ */
366
+ interface RouteLeg {
367
+ /** 1-based position in the quote's `orderRequests`. */
368
+ index: number;
369
+ /** Symbol bid on this leg, or "" when the registry does not list that deployment. */
370
+ fromAsset: string;
371
+ fromChainId: number;
372
+ fromChainName: string;
373
+ /** Formatted bid amount, or "" when the bid token's decimals are unknown. */
374
+ fromAmount: string;
375
+ /** Symbol asked on this leg, or "" when the registry does not list that deployment. */
376
+ toAsset: string;
377
+ toChainId: number;
378
+ toChainName: string;
379
+ /** Formatted ask amount, or "" when the ask token's decimals are unknown. */
380
+ toAmount: string;
381
+ /** Where the escrow FILLS this leg — frequently neither end of it (an Arbitrum→Plume leg can
382
+ * execute on Ethereum), which is the detail that makes a two-leg order legible. */
383
+ executionChainId: number;
384
+ executionChainName: string;
385
+ }
343
386
  interface RouteResult {
344
387
  id: string;
345
388
  recommended: boolean;
@@ -363,6 +406,9 @@ interface RouteResult {
363
406
  };
364
407
  routeLabel: string;
365
408
  deltaLabel: string;
409
+ /** Every order this route submits, first to last. Length 1 for a direct transfer or a plain swap,
410
+ * >= 2 for a chained (RWA) quote. Never empty. */
411
+ legs: RouteLeg[];
366
412
  transactions: PlannedTx[];
367
413
  quote: {
368
414
  bridge?: string;
@@ -441,6 +487,8 @@ interface TxHistoryEntry {
441
487
  recipient?: string;
442
488
  settlement?: "direct" | "escrow";
443
489
  status?: "confirmed" | "unconfirmed" | "error" | "submitted";
490
+ /** The route's orders, so history can show a chained (two-leg) trade as the two orders it was. */
491
+ legs?: RouteLeg[];
444
492
  }
445
493
  /** A display-safe, sanitized history entry (no keys/calldata/secrets). */
446
494
  interface SanitizedTxEntry {
@@ -461,6 +509,9 @@ interface SanitizedTxEntry {
461
509
  settlement: "direct" | "escrow";
462
510
  status: "confirmed" | "unconfirmed" | "error" | "submitted";
463
511
  at: string;
512
+ /** The orders this transaction submitted, first to last. Absent on entries persisted before legs
513
+ * were recorded (2026-09-09); the UI falls back to the single from → to summary for those. */
514
+ legs?: RouteLeg[];
464
515
  }
465
516
  /** Config injected into the engine by the host application. */
466
517
  interface EngineConfig {
@@ -658,6 +709,8 @@ interface CatalogueInput {
658
709
  supportedChainIds: ReadonlySet<number>;
659
710
  /** Measured refusals; omit or pass an empty map to suppress nothing. */
660
711
  brokenLanes?: ReadonlyMap<string, BrokenLane>;
712
+ /** Vault artwork by symbol key (see `core/rwa-icons.ts`). Carried through untouched. */
713
+ vaultIcons?: ReadonlyMap<string, string>;
661
714
  }
662
715
  interface Catalogue extends CatalogueContext {
663
716
  /** The product this catalogue was built for. */
@@ -681,6 +734,16 @@ interface Catalogue extends CatalogueContext {
681
734
  * is something we failed to learn, not something we learned.
682
735
  */
683
736
  ready: boolean;
737
+ /**
738
+ * Vault-share artwork by symbol key, from `GET /rwa/vaults`.
739
+ *
740
+ * It is on the catalogue and not merely merged into `tokens` because a surface can need the icon
741
+ * of an asset this catalogue does NOT carry: transaction history on the STABLE exchange shows past
742
+ * RWA trades, and the stable catalogue has no vault deployment to hang a `logoUrl` on. Present
743
+ * whatever the product — the vault read runs on every catalogue build — and empty when the gateway
744
+ * published none.
745
+ */
746
+ vaultIcons: ReadonlyMap<string, string>;
684
747
  }
685
748
  /**
686
749
  * Build the selectable catalogue from the live registry.
@@ -790,6 +853,8 @@ interface ApiClient {
790
853
  fetchRoutes: () => Promise<Route[]>;
791
854
  /** Measured lane health. NEVER rejects — see the implementation. */
792
855
  fetchRouteHealth: () => Promise<RouteHealth | null>;
856
+ /** The RWA vault catalogue, read ONLY for its artwork. NEVER rejects — see the implementation. */
857
+ fetchRwaVaults: () => Promise<RwaVault[]>;
793
858
  fetchQuote: (body: Record<string, unknown>, retries?: number) => Promise<Quote>;
794
859
  /**
795
860
  * Standalone KYW screen of ONE address — the direct-settlement gate.
@@ -852,4 +917,4 @@ interface Verifier {
852
917
  }
853
918
  declare function createVerifier(api: ApiClient, fetchImpl: typeof fetch, rpcOverrides?: Record<number, string>): Verifier;
854
919
 
855
- export { type QuoteBlock as $, type Availability as A, type BrokenLane as B, type Compliance as C, BLOCK_LABEL_DEFAULT as D, type EngineConfig as E, type FetchQuoteFn as F, COMPLIANCE_CHECK_ORDER as G, COMPLIANCE_DENY_LABEL as H, type CatalogueContext as I, type CatalogueInput as J, type ComplianceCheckId as K, type ComplianceDecision as L, DIRECT_CHECK_IDS as M, type NormalizedOrder as N, type OrderRequest as O, type Plan as P, type Quote as Q, type Route as R, type SanitizedTxEntry as S, type Token as T, DIRECT_SCOPE_NOTE as U, type VerifyResult as V, type WalletScreen as W, type Destination as X, FLOOR_CATEGORIES as Y, type Hex as Z, type PlannedTxKind as _, type Catalogue as a, type ResolvedConfig as a0, type RouteHealth as a1, type RouteHealthLane as a2, SCREENING_BUCKETS as a3, type ScreenProvider as a4, type ScreeningBucket as a5, type ScreeningOutcome as a6, TUNABLE_CATEGORIES as a7, type TxPlan as a8, apiError as a9, registryRpc as aA, resolveApiBase as aB, resolveConfig as aC, screeningOutcomeOf as aD, sourceKeys as aE, suppressedLanes as aF, tokenKey as aG, txMatchesPlan as aH, unattributedComplianceReasons as aI, blockLabelFor as aa, brokenLaneFor as ab, buildCatalogue as ac, canAttachApiKey as ad, categoryLabel as ae, classifyQuoteError as af, complianceControlsEvaluated as ag, complianceReasonHead as ah, complianceReasonTag as ai, complianceTagOf as aj, createApiClient as ak, createVerifier as al, destinationKeys as am, directComplianceFromScreens as an, distinctScreenedWallets as ao, executableRoutes as ap, executionChainIds as aq, hasReachableDestination as ar, hubDeliverableSymbols as as, isExecutableBridge as at, isKnownUnbridgeable as au, isSourceToken as av, laneKey as aw, laneKeys as ax, parseAllowedApiBase as ay, productAssets as az, type Chain as b, type ComplianceCheck as c, type ComplianceTone as d, type ComplianceView as e, type ExchangeProduct as f, type RouteResult as g, type TxHistoryEntry as h, assetClassOf as i, brokenLaneReason as j, complianceChecks as k, complianceControlsLine as l, complianceView as m, counterpartTokens as n, destinationAvailability as o, humanizeComplianceReason as p, type PayOption as q, type SolveResult as r, type BalanceTarget as s, type BalanceEntry as t, type ApiClient as u, type SwapInput as v, type PlannedTx as w, type Verifier as x, type Address as y, type ApiError as z };
920
+ export { type Hex as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Address as D, type EngineConfig as E, type FetchQuoteFn as F, type ApiError as G, BLOCK_LABEL_DEFAULT as H, COMPLIANCE_CHECK_ORDER as I, COMPLIANCE_DENY_LABEL as J, type CatalogueContext as K, type CatalogueInput as L, type ComplianceCheckId as M, type NormalizedOrder as N, type OrderRequest as O, type Plan as P, type Quote as Q, type Route as R, type SanitizedTxEntry as S, type Token as T, type ComplianceDecision as U, type VerifyResult as V, type WalletScreen as W, DIRECT_CHECK_IDS as X, DIRECT_SCOPE_NOTE as Y, type Destination as Z, FLOOR_CATEGORIES as _, type Catalogue as a, type PlannedTxKind as a0, type QuoteBlock as a1, type ResolvedConfig as a2, type RouteHealth as a3, type RouteHealthLane as a4, SCREENING_BUCKETS as a5, type ScreenProvider as a6, type ScreeningBucket as a7, type ScreeningOutcome as a8, TUNABLE_CATEGORIES as a9, parseAllowedApiBase as aA, productAssets as aB, registryRpc as aC, resolveApiBase as aD, resolveConfig as aE, screeningOutcomeOf as aF, sourceKeys as aG, suppressedLanes as aH, tokenKey as aI, txMatchesPlan as aJ, unattributedComplianceReasons as aK, type TxPlan as aa, apiError as ab, blockLabelFor as ac, brokenLaneFor as ad, buildCatalogue as ae, canAttachApiKey as af, categoryLabel as ag, classifyQuoteError as ah, complianceControlsEvaluated as ai, complianceReasonHead as aj, complianceReasonTag as ak, complianceTagOf as al, createApiClient as am, createVerifier as an, destinationKeys as ao, directComplianceFromScreens as ap, distinctScreenedWallets as aq, executableRoutes as ar, executionChainIds as as, hasReachableDestination as at, hubDeliverableSymbols as au, isExecutableBridge as av, isKnownUnbridgeable as aw, isSourceToken as ax, laneKey as ay, laneKeys as az, type Chain as b, type ComplianceCheck as c, type ComplianceTone as d, type ComplianceView as e, type ExchangeProduct as f, type RouteLeg as g, type RouteResult as h, type TxHistoryEntry as i, assetClassOf as j, brokenLaneReason as k, complianceChecks as l, complianceControlsLine as m, complianceView as n, counterpartTokens as o, destinationAvailability as p, humanizeComplianceReason as q, type PayOption as r, type RwaVault as s, type SolveResult as t, type BalanceTarget as u, type BalanceEntry as v, type ApiClient as w, type SwapInput as x, type PlannedTx as y, type Verifier as z };
@@ -238,6 +238,16 @@ interface Token {
238
238
  isChainedDestination?: boolean;
239
239
  [k: string]: unknown;
240
240
  }
241
+ /** One row of `GET /rwa/vaults`. Only the artwork fields are read — the widget does not render the
242
+ * vault catalogue, it borrows the icons the token registry does not serve. */
243
+ interface RwaVault {
244
+ symbol?: string;
245
+ /** Card-sized artwork, as a root-relative gateway path (`/api/v1/rwa/icons/…`). */
246
+ iconUrl?: string;
247
+ /** The round badge — what a token glyph wants. */
248
+ iconMiniUrl?: string;
249
+ [k: string]: unknown;
250
+ }
241
251
  interface Route {
242
252
  tokenId?: string;
243
253
  tokenName?: string;
@@ -340,6 +350,39 @@ interface PlannedTx {
340
350
  amountRaw?: string;
341
351
  mock?: boolean;
342
352
  }
353
+ /**
354
+ * ONE ORDER of a route, in display terms.
355
+ *
356
+ * A stable transfer or swap is a single order. A CHAINED quote — how every real-world asset is
357
+ * delivered — is **one signature and several orders**: leg 1 moves the payer's stable to the chain
358
+ * the vault executes on, leg 2 buys the share there. The payer signs once and is shown one
359
+ * "from → to", so the middle hop is invisible — and an invisible hop is what makes a CORRECT
360
+ * delivery look like a wrong one (the dapp shipped exactly that confusion). Recording the legs is
361
+ * what lets a transaction history answer "did my money take one hop or two, and through where".
362
+ *
363
+ * Every field is display-safe by construction — symbols, chain ids and formatted amounts, never a
364
+ * token address — so a leg can be persisted to history as-is.
365
+ */
366
+ interface RouteLeg {
367
+ /** 1-based position in the quote's `orderRequests`. */
368
+ index: number;
369
+ /** Symbol bid on this leg, or "" when the registry does not list that deployment. */
370
+ fromAsset: string;
371
+ fromChainId: number;
372
+ fromChainName: string;
373
+ /** Formatted bid amount, or "" when the bid token's decimals are unknown. */
374
+ fromAmount: string;
375
+ /** Symbol asked on this leg, or "" when the registry does not list that deployment. */
376
+ toAsset: string;
377
+ toChainId: number;
378
+ toChainName: string;
379
+ /** Formatted ask amount, or "" when the ask token's decimals are unknown. */
380
+ toAmount: string;
381
+ /** Where the escrow FILLS this leg — frequently neither end of it (an Arbitrum→Plume leg can
382
+ * execute on Ethereum), which is the detail that makes a two-leg order legible. */
383
+ executionChainId: number;
384
+ executionChainName: string;
385
+ }
343
386
  interface RouteResult {
344
387
  id: string;
345
388
  recommended: boolean;
@@ -363,6 +406,9 @@ interface RouteResult {
363
406
  };
364
407
  routeLabel: string;
365
408
  deltaLabel: string;
409
+ /** Every order this route submits, first to last. Length 1 for a direct transfer or a plain swap,
410
+ * >= 2 for a chained (RWA) quote. Never empty. */
411
+ legs: RouteLeg[];
366
412
  transactions: PlannedTx[];
367
413
  quote: {
368
414
  bridge?: string;
@@ -441,6 +487,8 @@ interface TxHistoryEntry {
441
487
  recipient?: string;
442
488
  settlement?: "direct" | "escrow";
443
489
  status?: "confirmed" | "unconfirmed" | "error" | "submitted";
490
+ /** The route's orders, so history can show a chained (two-leg) trade as the two orders it was. */
491
+ legs?: RouteLeg[];
444
492
  }
445
493
  /** A display-safe, sanitized history entry (no keys/calldata/secrets). */
446
494
  interface SanitizedTxEntry {
@@ -461,6 +509,9 @@ interface SanitizedTxEntry {
461
509
  settlement: "direct" | "escrow";
462
510
  status: "confirmed" | "unconfirmed" | "error" | "submitted";
463
511
  at: string;
512
+ /** The orders this transaction submitted, first to last. Absent on entries persisted before legs
513
+ * were recorded (2026-09-09); the UI falls back to the single from → to summary for those. */
514
+ legs?: RouteLeg[];
464
515
  }
465
516
  /** Config injected into the engine by the host application. */
466
517
  interface EngineConfig {
@@ -658,6 +709,8 @@ interface CatalogueInput {
658
709
  supportedChainIds: ReadonlySet<number>;
659
710
  /** Measured refusals; omit or pass an empty map to suppress nothing. */
660
711
  brokenLanes?: ReadonlyMap<string, BrokenLane>;
712
+ /** Vault artwork by symbol key (see `core/rwa-icons.ts`). Carried through untouched. */
713
+ vaultIcons?: ReadonlyMap<string, string>;
661
714
  }
662
715
  interface Catalogue extends CatalogueContext {
663
716
  /** The product this catalogue was built for. */
@@ -681,6 +734,16 @@ interface Catalogue extends CatalogueContext {
681
734
  * is something we failed to learn, not something we learned.
682
735
  */
683
736
  ready: boolean;
737
+ /**
738
+ * Vault-share artwork by symbol key, from `GET /rwa/vaults`.
739
+ *
740
+ * It is on the catalogue and not merely merged into `tokens` because a surface can need the icon
741
+ * of an asset this catalogue does NOT carry: transaction history on the STABLE exchange shows past
742
+ * RWA trades, and the stable catalogue has no vault deployment to hang a `logoUrl` on. Present
743
+ * whatever the product — the vault read runs on every catalogue build — and empty when the gateway
744
+ * published none.
745
+ */
746
+ vaultIcons: ReadonlyMap<string, string>;
684
747
  }
685
748
  /**
686
749
  * Build the selectable catalogue from the live registry.
@@ -790,6 +853,8 @@ interface ApiClient {
790
853
  fetchRoutes: () => Promise<Route[]>;
791
854
  /** Measured lane health. NEVER rejects — see the implementation. */
792
855
  fetchRouteHealth: () => Promise<RouteHealth | null>;
856
+ /** The RWA vault catalogue, read ONLY for its artwork. NEVER rejects — see the implementation. */
857
+ fetchRwaVaults: () => Promise<RwaVault[]>;
793
858
  fetchQuote: (body: Record<string, unknown>, retries?: number) => Promise<Quote>;
794
859
  /**
795
860
  * Standalone KYW screen of ONE address — the direct-settlement gate.
@@ -852,4 +917,4 @@ interface Verifier {
852
917
  }
853
918
  declare function createVerifier(api: ApiClient, fetchImpl: typeof fetch, rpcOverrides?: Record<number, string>): Verifier;
854
919
 
855
- export { type QuoteBlock as $, type Availability as A, type BrokenLane as B, type Compliance as C, BLOCK_LABEL_DEFAULT as D, type EngineConfig as E, type FetchQuoteFn as F, COMPLIANCE_CHECK_ORDER as G, COMPLIANCE_DENY_LABEL as H, type CatalogueContext as I, type CatalogueInput as J, type ComplianceCheckId as K, type ComplianceDecision as L, DIRECT_CHECK_IDS as M, type NormalizedOrder as N, type OrderRequest as O, type Plan as P, type Quote as Q, type Route as R, type SanitizedTxEntry as S, type Token as T, DIRECT_SCOPE_NOTE as U, type VerifyResult as V, type WalletScreen as W, type Destination as X, FLOOR_CATEGORIES as Y, type Hex as Z, type PlannedTxKind as _, type Catalogue as a, type ResolvedConfig as a0, type RouteHealth as a1, type RouteHealthLane as a2, SCREENING_BUCKETS as a3, type ScreenProvider as a4, type ScreeningBucket as a5, type ScreeningOutcome as a6, TUNABLE_CATEGORIES as a7, type TxPlan as a8, apiError as a9, registryRpc as aA, resolveApiBase as aB, resolveConfig as aC, screeningOutcomeOf as aD, sourceKeys as aE, suppressedLanes as aF, tokenKey as aG, txMatchesPlan as aH, unattributedComplianceReasons as aI, blockLabelFor as aa, brokenLaneFor as ab, buildCatalogue as ac, canAttachApiKey as ad, categoryLabel as ae, classifyQuoteError as af, complianceControlsEvaluated as ag, complianceReasonHead as ah, complianceReasonTag as ai, complianceTagOf as aj, createApiClient as ak, createVerifier as al, destinationKeys as am, directComplianceFromScreens as an, distinctScreenedWallets as ao, executableRoutes as ap, executionChainIds as aq, hasReachableDestination as ar, hubDeliverableSymbols as as, isExecutableBridge as at, isKnownUnbridgeable as au, isSourceToken as av, laneKey as aw, laneKeys as ax, parseAllowedApiBase as ay, productAssets as az, type Chain as b, type ComplianceCheck as c, type ComplianceTone as d, type ComplianceView as e, type ExchangeProduct as f, type RouteResult as g, type TxHistoryEntry as h, assetClassOf as i, brokenLaneReason as j, complianceChecks as k, complianceControlsLine as l, complianceView as m, counterpartTokens as n, destinationAvailability as o, humanizeComplianceReason as p, type PayOption as q, type SolveResult as r, type BalanceTarget as s, type BalanceEntry as t, type ApiClient as u, type SwapInput as v, type PlannedTx as w, type Verifier as x, type Address as y, type ApiError as z };
920
+ export { type Hex as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Address as D, type EngineConfig as E, type FetchQuoteFn as F, type ApiError as G, BLOCK_LABEL_DEFAULT as H, COMPLIANCE_CHECK_ORDER as I, COMPLIANCE_DENY_LABEL as J, type CatalogueContext as K, type CatalogueInput as L, type ComplianceCheckId as M, type NormalizedOrder as N, type OrderRequest as O, type Plan as P, type Quote as Q, type Route as R, type SanitizedTxEntry as S, type Token as T, type ComplianceDecision as U, type VerifyResult as V, type WalletScreen as W, DIRECT_CHECK_IDS as X, DIRECT_SCOPE_NOTE as Y, type Destination as Z, FLOOR_CATEGORIES as _, type Catalogue as a, type PlannedTxKind as a0, type QuoteBlock as a1, type ResolvedConfig as a2, type RouteHealth as a3, type RouteHealthLane as a4, SCREENING_BUCKETS as a5, type ScreenProvider as a6, type ScreeningBucket as a7, type ScreeningOutcome as a8, TUNABLE_CATEGORIES as a9, parseAllowedApiBase as aA, productAssets as aB, registryRpc as aC, resolveApiBase as aD, resolveConfig as aE, screeningOutcomeOf as aF, sourceKeys as aG, suppressedLanes as aH, tokenKey as aI, txMatchesPlan as aJ, unattributedComplianceReasons as aK, type TxPlan as aa, apiError as ab, blockLabelFor as ac, brokenLaneFor as ad, buildCatalogue as ae, canAttachApiKey as af, categoryLabel as ag, classifyQuoteError as ah, complianceControlsEvaluated as ai, complianceReasonHead as aj, complianceReasonTag as ak, complianceTagOf as al, createApiClient as am, createVerifier as an, destinationKeys as ao, directComplianceFromScreens as ap, distinctScreenedWallets as aq, executableRoutes as ar, executionChainIds as as, hasReachableDestination as at, hubDeliverableSymbols as au, isExecutableBridge as av, isKnownUnbridgeable as aw, isSourceToken as ax, laneKey as ay, laneKeys as az, type Chain as b, type ComplianceCheck as c, type ComplianceTone as d, type ComplianceView as e, type ExchangeProduct as f, type RouteLeg as g, type RouteResult as h, type TxHistoryEntry as i, assetClassOf as j, brokenLaneReason as k, complianceChecks as l, complianceControlsLine as m, complianceView as n, counterpartTokens as o, destinationAvailability as p, humanizeComplianceReason as q, type PayOption as r, type RwaVault as s, type SolveResult as t, type BalanceTarget as u, type BalanceEntry as v, type ApiClient as w, type SwapInput as x, type PlannedTx as y, type Verifier as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glacislabs/stablegenie-zerodelta",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Lightweight embeddable ZeroDelta payment + swap widget (exact-receive Pay and exact-in Swap). Wallet always owns the final signature.",
5
5
  "type": "module",
6
6
  "license": "MIT",