@glacislabs/stablegenie-zerodelta 4.12.0 → 4.13.1
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-A7ADZJXA.js → chunk-6WFIFKZ4.js} +1427 -227
- package/dist/{chunk-MA2VYFG3.js → chunk-M55J3P64.js} +961 -97
- package/dist/core/index.cjs +2086 -239
- package/dist/core/index.d.cts +449 -40
- package/dist/core/index.d.ts +449 -40
- package/dist/core/index.js +1 -1
- package/dist/ed25519-FZW4JEOV.js +526 -0
- package/dist/ed25519-GAMEXARB.js +11 -0
- package/dist/index.cjs +3085 -450
- package/dist/index.d.cts +96 -4
- package/dist/index.d.ts +96 -4
- package/dist/index.js +2 -2
- package/dist/{mount-hxb3zioQ.d.ts → mount-B6soKC-9.d.ts} +1 -1
- package/dist/{mount-xruGixNZ.d.cts → mount-CEy4Nqky.d.cts} +1 -1
- package/dist/mount.cjs +3076 -448
- 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 +13 -9
- package/dist/{verify-D8tr1yY1.d.cts → verify-Y9jZ83T5.d.cts} +81 -68
- package/dist/{verify-D8tr1yY1.d.ts → verify-Y9jZ83T5.d.ts} +81 -68
- package/package.json +4 -3
|
@@ -281,12 +281,18 @@ interface OrderRequest {
|
|
|
281
281
|
askToken?: string;
|
|
282
282
|
askTokenAmount?: string | number;
|
|
283
283
|
destinationReceiver?: string;
|
|
284
|
+
destinationReceiverOwner?: string;
|
|
285
|
+
destinationReceiverBase58?: string;
|
|
286
|
+
askTokenBase58?: string;
|
|
284
287
|
destinationChainId?: string | number;
|
|
285
288
|
/** Chain the escrow executes the order on. Mandatory on-chain; the gateway always issues it. */
|
|
286
289
|
executionChainId?: string | number;
|
|
287
290
|
deadline?: string | number;
|
|
288
291
|
}
|
|
289
292
|
interface NormalizedOrder {
|
|
293
|
+
destinationReceiverOwner?: string;
|
|
294
|
+
destinationReceiverBase58?: string;
|
|
295
|
+
askTokenBase58?: string;
|
|
290
296
|
owner: string;
|
|
291
297
|
bidToken: string;
|
|
292
298
|
bidTokenAmount: string;
|
|
@@ -305,6 +311,7 @@ interface Quote {
|
|
|
305
311
|
fromAmount?: string;
|
|
306
312
|
toAmount?: string;
|
|
307
313
|
finalAmount?: string;
|
|
314
|
+
isDirect?: boolean;
|
|
308
315
|
bridge?: string;
|
|
309
316
|
feeBps?: number;
|
|
310
317
|
estimatedDuration?: number;
|
|
@@ -456,6 +463,9 @@ interface RouteResult {
|
|
|
456
463
|
/** The quote's special-rate marker, when it carried one: the `partnerId` word the
|
|
457
464
|
* `submitOrder` calldata was encoded with. Absent = the zero word. */
|
|
458
465
|
partnerId?: string;
|
|
466
|
+
/** Verified delivery bytes and intended wallet, for the pre-sign calldata check. */
|
|
467
|
+
destinationReceiver?: string;
|
|
468
|
+
destinationReceiverOwner?: string;
|
|
459
469
|
iterations: number;
|
|
460
470
|
/**
|
|
461
471
|
* The gateway's compliance decision for THIS route's wallet pair.
|
|
@@ -559,6 +569,9 @@ interface SanitizedTxEntry {
|
|
|
559
569
|
recipient: string;
|
|
560
570
|
settlement: "direct" | "escrow";
|
|
561
571
|
status: "confirmed" | "unconfirmed" | "error" | "submitted";
|
|
572
|
+
/** Where the ORDER is, from the gateway's tracker, when the history was read from it. `status` is
|
|
573
|
+
* only the source transaction; this is whether the destination received the funds. Never stored. */
|
|
574
|
+
delivery?: "in-progress" | "attention" | "delivered" | "failed";
|
|
562
575
|
at: string;
|
|
563
576
|
/** The orders this transaction submitted, first to last. Absent on entries persisted before legs
|
|
564
577
|
* were recorded (2026-09-09); the UI falls back to the single from → to summary for those. */
|
|
@@ -589,6 +602,73 @@ interface EngineConfig {
|
|
|
589
602
|
}
|
|
590
603
|
type FetchQuoteFn = (body: Record<string, unknown>, retries?: number) => Promise<Quote>;
|
|
591
604
|
|
|
605
|
+
/**
|
|
606
|
+
* The shapes the gateway would refuse anyway, checked here so a bad value costs
|
|
607
|
+
* no request.
|
|
608
|
+
*
|
|
609
|
+
* ⚠️ A submit transaction has TWO shapes, and accepting only the EVM one would
|
|
610
|
+
* drop the whole Solana family silently: an EVM 32-byte hash in 0x-hex, or a
|
|
611
|
+
* Solana transaction SIGNATURE in base58 (64 bytes ⇒ 86-88 chars). The length
|
|
612
|
+
* floor keeps a signature distinguishable from an ADDRESS (32-44 chars), which
|
|
613
|
+
* shares the alphabet.
|
|
614
|
+
*
|
|
615
|
+
* ⚠️ The WALLET is always the EVM owner, on every family. A Solana-source order
|
|
616
|
+
* is PAID by a Solana wallet but OWNED by an EVM account — that is the cancel
|
|
617
|
+
* and refund path, and it is what the chain records. Reporting the signer would
|
|
618
|
+
* name a wallet the chain never held for that order.
|
|
619
|
+
*/
|
|
620
|
+
/**
|
|
621
|
+
* How far this widget followed the transaction it is reporting.
|
|
622
|
+
*
|
|
623
|
+
* `submitted` — the wallet handed back a hash. Reported immediately, so
|
|
624
|
+
* attribution survives a payer closing the tab during the wait.
|
|
625
|
+
* `confirmed` — the widget's own receipt check agreed it landed. This is the
|
|
626
|
+
* one fact only the surface can supply: whether the payer was still here when
|
|
627
|
+
* the payment completed, which for an embedded widget is exactly the
|
|
628
|
+
* conversion question its integrator is asking.
|
|
629
|
+
*
|
|
630
|
+
* ⚠️ It is NOT a claim about the chain. The gateway reads the order's real
|
|
631
|
+
* status from its own indexed data either way.
|
|
632
|
+
*/
|
|
633
|
+
type SubmissionStage = "submitted" | "confirmed";
|
|
634
|
+
|
|
635
|
+
interface ResolvedConfig {
|
|
636
|
+
apiBase: string;
|
|
637
|
+
getApiKey: () => Promise<string>;
|
|
638
|
+
fetchImpl: typeof fetch;
|
|
639
|
+
rpcOverrides: Record<number, string>;
|
|
640
|
+
onTransaction?: EngineConfig["onTransaction"];
|
|
641
|
+
/**
|
|
642
|
+
* Who may share this engine's registry reads (chains, tokens, routes, route-health, vaults) — see
|
|
643
|
+
* `registryCacheFor` in api.ts. Set only when every input to those reads is known up front: the
|
|
644
|
+
* page's own `fetch` and a static key. A host that injects `fetchImpl` or `getApiKey` keeps a
|
|
645
|
+
* private cache, as every engine had before.
|
|
646
|
+
*/
|
|
647
|
+
registryScope?: {
|
|
648
|
+
fetch: object;
|
|
649
|
+
key: string;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
declare function parseAllowedApiBase(value: unknown): string | null;
|
|
653
|
+
/** Resolve the request base. A relative base (e.g. `/api/widget/v1`) is same-origin and allowed as
|
|
654
|
+
* is; an absolute base must pass parseAllowedApiBase; anything invalid falls back to the default. */
|
|
655
|
+
declare function resolveApiBase(value?: string): string;
|
|
656
|
+
/**
|
|
657
|
+
* Only attach the viewer key to a same-origin (relative) base, or to an origin the INTEGRATOR has
|
|
658
|
+
* explicitly declared trusted via `EngineConfig.trustedApiOrigin`.
|
|
659
|
+
*
|
|
660
|
+
* There is deliberately no hardcoded default origin. The API is normally reached through a
|
|
661
|
+
* server-side proxy that injects the key (`/api/widget/v1`), and that proxy origin differs per
|
|
662
|
+
* integrator deployment — so there is no single correct value to bake in. Shipping a fixed hostname
|
|
663
|
+
* here would make one unrelated origin the sole permitted key destination for everyone, and silently
|
|
664
|
+
* disable the key for every integrator not using it.
|
|
665
|
+
*
|
|
666
|
+
* Default is therefore same-origin only: fail closed, and let a host opt in to an absolute origin
|
|
667
|
+
* it controls.
|
|
668
|
+
*/
|
|
669
|
+
declare function canAttachApiKey(apiBase: string, trustedOrigin?: string): boolean;
|
|
670
|
+
declare function resolveConfig(config?: EngineConfig): ResolvedConfig;
|
|
671
|
+
|
|
592
672
|
/**
|
|
593
673
|
* Which product a catalogue is being built for.
|
|
594
674
|
*
|
|
@@ -977,73 +1057,6 @@ declare function laneLimitError(limit: LaneLimit, symbol: string): string;
|
|
|
977
1057
|
* gateway message: that text is untrusted and can carry infrastructure detail. */
|
|
978
1058
|
declare function brokenLaneReason(lane: BrokenLane | undefined): string;
|
|
979
1059
|
|
|
980
|
-
/**
|
|
981
|
-
* The shapes the gateway would refuse anyway, checked here so a bad value costs
|
|
982
|
-
* no request.
|
|
983
|
-
*
|
|
984
|
-
* ⚠️ A submit transaction has TWO shapes, and accepting only the EVM one would
|
|
985
|
-
* drop the whole Solana family silently: an EVM 32-byte hash in 0x-hex, or a
|
|
986
|
-
* Solana transaction SIGNATURE in base58 (64 bytes ⇒ 86-88 chars). The length
|
|
987
|
-
* floor keeps a signature distinguishable from an ADDRESS (32-44 chars), which
|
|
988
|
-
* shares the alphabet.
|
|
989
|
-
*
|
|
990
|
-
* ⚠️ The WALLET is always the EVM owner, on every family. A Solana-source order
|
|
991
|
-
* is PAID by a Solana wallet but OWNED by an EVM account — that is the cancel
|
|
992
|
-
* and refund path, and it is what the chain records. Reporting the signer would
|
|
993
|
-
* name a wallet the chain never held for that order.
|
|
994
|
-
*/
|
|
995
|
-
/**
|
|
996
|
-
* How far this widget followed the transaction it is reporting.
|
|
997
|
-
*
|
|
998
|
-
* `submitted` — the wallet handed back a hash. Reported immediately, so
|
|
999
|
-
* attribution survives a payer closing the tab during the wait.
|
|
1000
|
-
* `confirmed` — the widget's own receipt check agreed it landed. This is the
|
|
1001
|
-
* one fact only the surface can supply: whether the payer was still here when
|
|
1002
|
-
* the payment completed, which for an embedded widget is exactly the
|
|
1003
|
-
* conversion question its integrator is asking.
|
|
1004
|
-
*
|
|
1005
|
-
* ⚠️ It is NOT a claim about the chain. The gateway reads the order's real
|
|
1006
|
-
* status from its own indexed data either way.
|
|
1007
|
-
*/
|
|
1008
|
-
type SubmissionStage = "submitted" | "confirmed";
|
|
1009
|
-
|
|
1010
|
-
interface ResolvedConfig {
|
|
1011
|
-
apiBase: string;
|
|
1012
|
-
getApiKey: () => Promise<string>;
|
|
1013
|
-
fetchImpl: typeof fetch;
|
|
1014
|
-
rpcOverrides: Record<number, string>;
|
|
1015
|
-
onTransaction?: EngineConfig["onTransaction"];
|
|
1016
|
-
/**
|
|
1017
|
-
* Who may share this engine's registry reads (chains, tokens, routes, route-health, vaults) — see
|
|
1018
|
-
* `registryCacheFor` in api.ts. Set only when every input to those reads is known up front: the
|
|
1019
|
-
* page's own `fetch` and a static key. A host that injects `fetchImpl` or `getApiKey` keeps a
|
|
1020
|
-
* private cache, as every engine had before.
|
|
1021
|
-
*/
|
|
1022
|
-
registryScope?: {
|
|
1023
|
-
fetch: object;
|
|
1024
|
-
key: string;
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
declare function parseAllowedApiBase(value: unknown): string | null;
|
|
1028
|
-
/** Resolve the request base. A relative base (e.g. `/api/widget/v1`) is same-origin and allowed as
|
|
1029
|
-
* is; an absolute base must pass parseAllowedApiBase; anything invalid falls back to the default. */
|
|
1030
|
-
declare function resolveApiBase(value?: string): string;
|
|
1031
|
-
/**
|
|
1032
|
-
* Only attach the viewer key to a same-origin (relative) base, or to an origin the INTEGRATOR has
|
|
1033
|
-
* explicitly declared trusted via `EngineConfig.trustedApiOrigin`.
|
|
1034
|
-
*
|
|
1035
|
-
* There is deliberately no hardcoded default origin. The API is normally reached through a
|
|
1036
|
-
* server-side proxy that injects the key (`/api/widget/v1`), and that proxy origin differs per
|
|
1037
|
-
* integrator deployment — so there is no single correct value to bake in. Shipping a fixed hostname
|
|
1038
|
-
* here would make one unrelated origin the sole permitted key destination for everyone, and silently
|
|
1039
|
-
* disable the key for every integrator not using it.
|
|
1040
|
-
*
|
|
1041
|
-
* Default is therefore same-origin only: fail closed, and let a host opt in to an absolute origin
|
|
1042
|
-
* it controls.
|
|
1043
|
-
*/
|
|
1044
|
-
declare function canAttachApiKey(apiBase: string, trustedOrigin?: string): boolean;
|
|
1045
|
-
declare function resolveConfig(config?: EngineConfig): ResolvedConfig;
|
|
1046
|
-
|
|
1047
1060
|
interface ApiError extends Error {
|
|
1048
1061
|
code?: string;
|
|
1049
1062
|
status?: number;
|
|
@@ -1172,4 +1185,4 @@ interface Verifier {
|
|
|
1172
1185
|
}
|
|
1173
1186
|
declare function createVerifier(api: ApiClient, fetchImpl: typeof fetch, rpcOverrides?: Record<number, string>): Verifier;
|
|
1174
1187
|
|
|
1175
|
-
export { type Destination as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Verifier as D, type EngineConfig as E, type FetchQuoteFn as F, type Address as G, type ApiError as H, BLOCK_LABEL_DEFAULT as I, COMPLIANCE_CHECK_ORDER as J, COMPLIANCE_DENY_LABEL as K, type LaneLimit as L, type CatalogueContext 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 CatalogueInput as U, type VerifyResult as V, type WalletScreen as W, type ComplianceCheckId as X, type ComplianceDecision as Y, DIRECT_CHECK_IDS as Z, DIRECT_SCOPE_NOTE as _, type Catalogue as a, FLOOR_CATEGORIES as a0, type Hex as a1, type LaneAvailabilityState as a2, type PlannedTxKind as a3, type QuoteBlock as a4, type ResolvedConfig as a5, type RouteHealth as a6, type RouteHealthAvailability as a7, type RouteHealthLane as a8, SCREENING_BUCKETS as a9, hubDeliverableSymbols as aA, isExecutableBridge as aB, isKnownUnbridgeable as aC, isSourceToken as aD, laneAvailabilityState as aE, laneKey as aF, laneKeys as aG, laneLimitAmount as aH, laneLimitError as aI, laneLimitFor as aJ, laneLimitHint as aK, laneLimitSymbol as aL, limitedLanes as aM, parseAllowedApiBase as aN, productAssets as aO, registryRpc as aP, resolveApiBase as aQ, resolveConfig as aR, screeningOutcomeOf as aS, sourceKeys as aT, suppressedLanes as aU, tokenKey as aV, txMatchesPlan as aW, unattributedComplianceReasons as aX, type ScreenProvider as aa, type ScreeningBucket as ab, type ScreeningOutcome as ac, TUNABLE_CATEGORIES as ad, type TxPlan as ae, amountFieldError as af, apiError as ag, blockLabelFor as ah, brokenLaneFor as ai, buildCatalogue as aj, canAttachApiKey as ak, categoryLabel as al, classifyQuoteError as am, complianceControlsEvaluated as an, complianceReasonHead as ao, complianceReasonTag as ap, complianceTagOf as aq, createApiClient as ar, createVerifier as as, destinationKeys as at, directComplianceFromScreens as au, distinctScreenedWallets as av, exceedsLaneLimit as aw, executableRoutes as ax, executionChainIds as ay, hasReachableDestination 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, formatJurisdiction as q, humanizeComplianceReason as r, type
|
|
1188
|
+
export { type Destination as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Verifier as D, type EngineConfig as E, type FetchQuoteFn as F, type Address as G, type ApiError as H, BLOCK_LABEL_DEFAULT as I, COMPLIANCE_CHECK_ORDER as J, COMPLIANCE_DENY_LABEL as K, type LaneLimit as L, type CatalogueContext 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 CatalogueInput as U, type VerifyResult as V, type WalletScreen as W, type ComplianceCheckId as X, type ComplianceDecision as Y, DIRECT_CHECK_IDS as Z, DIRECT_SCOPE_NOTE as _, type Catalogue as a, FLOOR_CATEGORIES as a0, type Hex as a1, type LaneAvailabilityState as a2, type PlannedTxKind as a3, type QuoteBlock as a4, type ResolvedConfig as a5, type RouteHealth as a6, type RouteHealthAvailability as a7, type RouteHealthLane as a8, SCREENING_BUCKETS as a9, hubDeliverableSymbols as aA, isExecutableBridge as aB, isKnownUnbridgeable as aC, isSourceToken as aD, laneAvailabilityState as aE, laneKey as aF, laneKeys as aG, laneLimitAmount as aH, laneLimitError as aI, laneLimitFor as aJ, laneLimitHint as aK, laneLimitSymbol as aL, limitedLanes as aM, parseAllowedApiBase as aN, productAssets as aO, registryRpc as aP, resolveApiBase as aQ, resolveConfig as aR, screeningOutcomeOf as aS, sourceKeys as aT, suppressedLanes as aU, tokenKey as aV, txMatchesPlan as aW, unattributedComplianceReasons as aX, type ScreenProvider as aa, type ScreeningBucket as ab, type ScreeningOutcome as ac, TUNABLE_CATEGORIES as ad, type TxPlan as ae, amountFieldError as af, apiError as ag, blockLabelFor as ah, brokenLaneFor as ai, buildCatalogue as aj, canAttachApiKey as ak, categoryLabel as al, classifyQuoteError as am, complianceControlsEvaluated as an, complianceReasonHead as ao, complianceReasonTag as ap, complianceTagOf as aq, createApiClient as ar, createVerifier as as, destinationKeys as at, directComplianceFromScreens as au, distinctScreenedWallets as av, exceedsLaneLimit as aw, executableRoutes as ax, executionChainIds as ay, hasReachableDestination 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, formatJurisdiction as q, humanizeComplianceReason as r, type ApiClient as s, type SwapInput as t, type PayOption as u, type RwaVault as v, type SolveResult as w, type BalanceTarget as x, type BalanceEntry as y, type PlannedTx as z };
|
|
@@ -281,12 +281,18 @@ interface OrderRequest {
|
|
|
281
281
|
askToken?: string;
|
|
282
282
|
askTokenAmount?: string | number;
|
|
283
283
|
destinationReceiver?: string;
|
|
284
|
+
destinationReceiverOwner?: string;
|
|
285
|
+
destinationReceiverBase58?: string;
|
|
286
|
+
askTokenBase58?: string;
|
|
284
287
|
destinationChainId?: string | number;
|
|
285
288
|
/** Chain the escrow executes the order on. Mandatory on-chain; the gateway always issues it. */
|
|
286
289
|
executionChainId?: string | number;
|
|
287
290
|
deadline?: string | number;
|
|
288
291
|
}
|
|
289
292
|
interface NormalizedOrder {
|
|
293
|
+
destinationReceiverOwner?: string;
|
|
294
|
+
destinationReceiverBase58?: string;
|
|
295
|
+
askTokenBase58?: string;
|
|
290
296
|
owner: string;
|
|
291
297
|
bidToken: string;
|
|
292
298
|
bidTokenAmount: string;
|
|
@@ -305,6 +311,7 @@ interface Quote {
|
|
|
305
311
|
fromAmount?: string;
|
|
306
312
|
toAmount?: string;
|
|
307
313
|
finalAmount?: string;
|
|
314
|
+
isDirect?: boolean;
|
|
308
315
|
bridge?: string;
|
|
309
316
|
feeBps?: number;
|
|
310
317
|
estimatedDuration?: number;
|
|
@@ -456,6 +463,9 @@ interface RouteResult {
|
|
|
456
463
|
/** The quote's special-rate marker, when it carried one: the `partnerId` word the
|
|
457
464
|
* `submitOrder` calldata was encoded with. Absent = the zero word. */
|
|
458
465
|
partnerId?: string;
|
|
466
|
+
/** Verified delivery bytes and intended wallet, for the pre-sign calldata check. */
|
|
467
|
+
destinationReceiver?: string;
|
|
468
|
+
destinationReceiverOwner?: string;
|
|
459
469
|
iterations: number;
|
|
460
470
|
/**
|
|
461
471
|
* The gateway's compliance decision for THIS route's wallet pair.
|
|
@@ -559,6 +569,9 @@ interface SanitizedTxEntry {
|
|
|
559
569
|
recipient: string;
|
|
560
570
|
settlement: "direct" | "escrow";
|
|
561
571
|
status: "confirmed" | "unconfirmed" | "error" | "submitted";
|
|
572
|
+
/** Where the ORDER is, from the gateway's tracker, when the history was read from it. `status` is
|
|
573
|
+
* only the source transaction; this is whether the destination received the funds. Never stored. */
|
|
574
|
+
delivery?: "in-progress" | "attention" | "delivered" | "failed";
|
|
562
575
|
at: string;
|
|
563
576
|
/** The orders this transaction submitted, first to last. Absent on entries persisted before legs
|
|
564
577
|
* were recorded (2026-09-09); the UI falls back to the single from → to summary for those. */
|
|
@@ -589,6 +602,73 @@ interface EngineConfig {
|
|
|
589
602
|
}
|
|
590
603
|
type FetchQuoteFn = (body: Record<string, unknown>, retries?: number) => Promise<Quote>;
|
|
591
604
|
|
|
605
|
+
/**
|
|
606
|
+
* The shapes the gateway would refuse anyway, checked here so a bad value costs
|
|
607
|
+
* no request.
|
|
608
|
+
*
|
|
609
|
+
* ⚠️ A submit transaction has TWO shapes, and accepting only the EVM one would
|
|
610
|
+
* drop the whole Solana family silently: an EVM 32-byte hash in 0x-hex, or a
|
|
611
|
+
* Solana transaction SIGNATURE in base58 (64 bytes ⇒ 86-88 chars). The length
|
|
612
|
+
* floor keeps a signature distinguishable from an ADDRESS (32-44 chars), which
|
|
613
|
+
* shares the alphabet.
|
|
614
|
+
*
|
|
615
|
+
* ⚠️ The WALLET is always the EVM owner, on every family. A Solana-source order
|
|
616
|
+
* is PAID by a Solana wallet but OWNED by an EVM account — that is the cancel
|
|
617
|
+
* and refund path, and it is what the chain records. Reporting the signer would
|
|
618
|
+
* name a wallet the chain never held for that order.
|
|
619
|
+
*/
|
|
620
|
+
/**
|
|
621
|
+
* How far this widget followed the transaction it is reporting.
|
|
622
|
+
*
|
|
623
|
+
* `submitted` — the wallet handed back a hash. Reported immediately, so
|
|
624
|
+
* attribution survives a payer closing the tab during the wait.
|
|
625
|
+
* `confirmed` — the widget's own receipt check agreed it landed. This is the
|
|
626
|
+
* one fact only the surface can supply: whether the payer was still here when
|
|
627
|
+
* the payment completed, which for an embedded widget is exactly the
|
|
628
|
+
* conversion question its integrator is asking.
|
|
629
|
+
*
|
|
630
|
+
* ⚠️ It is NOT a claim about the chain. The gateway reads the order's real
|
|
631
|
+
* status from its own indexed data either way.
|
|
632
|
+
*/
|
|
633
|
+
type SubmissionStage = "submitted" | "confirmed";
|
|
634
|
+
|
|
635
|
+
interface ResolvedConfig {
|
|
636
|
+
apiBase: string;
|
|
637
|
+
getApiKey: () => Promise<string>;
|
|
638
|
+
fetchImpl: typeof fetch;
|
|
639
|
+
rpcOverrides: Record<number, string>;
|
|
640
|
+
onTransaction?: EngineConfig["onTransaction"];
|
|
641
|
+
/**
|
|
642
|
+
* Who may share this engine's registry reads (chains, tokens, routes, route-health, vaults) — see
|
|
643
|
+
* `registryCacheFor` in api.ts. Set only when every input to those reads is known up front: the
|
|
644
|
+
* page's own `fetch` and a static key. A host that injects `fetchImpl` or `getApiKey` keeps a
|
|
645
|
+
* private cache, as every engine had before.
|
|
646
|
+
*/
|
|
647
|
+
registryScope?: {
|
|
648
|
+
fetch: object;
|
|
649
|
+
key: string;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
declare function parseAllowedApiBase(value: unknown): string | null;
|
|
653
|
+
/** Resolve the request base. A relative base (e.g. `/api/widget/v1`) is same-origin and allowed as
|
|
654
|
+
* is; an absolute base must pass parseAllowedApiBase; anything invalid falls back to the default. */
|
|
655
|
+
declare function resolveApiBase(value?: string): string;
|
|
656
|
+
/**
|
|
657
|
+
* Only attach the viewer key to a same-origin (relative) base, or to an origin the INTEGRATOR has
|
|
658
|
+
* explicitly declared trusted via `EngineConfig.trustedApiOrigin`.
|
|
659
|
+
*
|
|
660
|
+
* There is deliberately no hardcoded default origin. The API is normally reached through a
|
|
661
|
+
* server-side proxy that injects the key (`/api/widget/v1`), and that proxy origin differs per
|
|
662
|
+
* integrator deployment — so there is no single correct value to bake in. Shipping a fixed hostname
|
|
663
|
+
* here would make one unrelated origin the sole permitted key destination for everyone, and silently
|
|
664
|
+
* disable the key for every integrator not using it.
|
|
665
|
+
*
|
|
666
|
+
* Default is therefore same-origin only: fail closed, and let a host opt in to an absolute origin
|
|
667
|
+
* it controls.
|
|
668
|
+
*/
|
|
669
|
+
declare function canAttachApiKey(apiBase: string, trustedOrigin?: string): boolean;
|
|
670
|
+
declare function resolveConfig(config?: EngineConfig): ResolvedConfig;
|
|
671
|
+
|
|
592
672
|
/**
|
|
593
673
|
* Which product a catalogue is being built for.
|
|
594
674
|
*
|
|
@@ -977,73 +1057,6 @@ declare function laneLimitError(limit: LaneLimit, symbol: string): string;
|
|
|
977
1057
|
* gateway message: that text is untrusted and can carry infrastructure detail. */
|
|
978
1058
|
declare function brokenLaneReason(lane: BrokenLane | undefined): string;
|
|
979
1059
|
|
|
980
|
-
/**
|
|
981
|
-
* The shapes the gateway would refuse anyway, checked here so a bad value costs
|
|
982
|
-
* no request.
|
|
983
|
-
*
|
|
984
|
-
* ⚠️ A submit transaction has TWO shapes, and accepting only the EVM one would
|
|
985
|
-
* drop the whole Solana family silently: an EVM 32-byte hash in 0x-hex, or a
|
|
986
|
-
* Solana transaction SIGNATURE in base58 (64 bytes ⇒ 86-88 chars). The length
|
|
987
|
-
* floor keeps a signature distinguishable from an ADDRESS (32-44 chars), which
|
|
988
|
-
* shares the alphabet.
|
|
989
|
-
*
|
|
990
|
-
* ⚠️ The WALLET is always the EVM owner, on every family. A Solana-source order
|
|
991
|
-
* is PAID by a Solana wallet but OWNED by an EVM account — that is the cancel
|
|
992
|
-
* and refund path, and it is what the chain records. Reporting the signer would
|
|
993
|
-
* name a wallet the chain never held for that order.
|
|
994
|
-
*/
|
|
995
|
-
/**
|
|
996
|
-
* How far this widget followed the transaction it is reporting.
|
|
997
|
-
*
|
|
998
|
-
* `submitted` — the wallet handed back a hash. Reported immediately, so
|
|
999
|
-
* attribution survives a payer closing the tab during the wait.
|
|
1000
|
-
* `confirmed` — the widget's own receipt check agreed it landed. This is the
|
|
1001
|
-
* one fact only the surface can supply: whether the payer was still here when
|
|
1002
|
-
* the payment completed, which for an embedded widget is exactly the
|
|
1003
|
-
* conversion question its integrator is asking.
|
|
1004
|
-
*
|
|
1005
|
-
* ⚠️ It is NOT a claim about the chain. The gateway reads the order's real
|
|
1006
|
-
* status from its own indexed data either way.
|
|
1007
|
-
*/
|
|
1008
|
-
type SubmissionStage = "submitted" | "confirmed";
|
|
1009
|
-
|
|
1010
|
-
interface ResolvedConfig {
|
|
1011
|
-
apiBase: string;
|
|
1012
|
-
getApiKey: () => Promise<string>;
|
|
1013
|
-
fetchImpl: typeof fetch;
|
|
1014
|
-
rpcOverrides: Record<number, string>;
|
|
1015
|
-
onTransaction?: EngineConfig["onTransaction"];
|
|
1016
|
-
/**
|
|
1017
|
-
* Who may share this engine's registry reads (chains, tokens, routes, route-health, vaults) — see
|
|
1018
|
-
* `registryCacheFor` in api.ts. Set only when every input to those reads is known up front: the
|
|
1019
|
-
* page's own `fetch` and a static key. A host that injects `fetchImpl` or `getApiKey` keeps a
|
|
1020
|
-
* private cache, as every engine had before.
|
|
1021
|
-
*/
|
|
1022
|
-
registryScope?: {
|
|
1023
|
-
fetch: object;
|
|
1024
|
-
key: string;
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
declare function parseAllowedApiBase(value: unknown): string | null;
|
|
1028
|
-
/** Resolve the request base. A relative base (e.g. `/api/widget/v1`) is same-origin and allowed as
|
|
1029
|
-
* is; an absolute base must pass parseAllowedApiBase; anything invalid falls back to the default. */
|
|
1030
|
-
declare function resolveApiBase(value?: string): string;
|
|
1031
|
-
/**
|
|
1032
|
-
* Only attach the viewer key to a same-origin (relative) base, or to an origin the INTEGRATOR has
|
|
1033
|
-
* explicitly declared trusted via `EngineConfig.trustedApiOrigin`.
|
|
1034
|
-
*
|
|
1035
|
-
* There is deliberately no hardcoded default origin. The API is normally reached through a
|
|
1036
|
-
* server-side proxy that injects the key (`/api/widget/v1`), and that proxy origin differs per
|
|
1037
|
-
* integrator deployment — so there is no single correct value to bake in. Shipping a fixed hostname
|
|
1038
|
-
* here would make one unrelated origin the sole permitted key destination for everyone, and silently
|
|
1039
|
-
* disable the key for every integrator not using it.
|
|
1040
|
-
*
|
|
1041
|
-
* Default is therefore same-origin only: fail closed, and let a host opt in to an absolute origin
|
|
1042
|
-
* it controls.
|
|
1043
|
-
*/
|
|
1044
|
-
declare function canAttachApiKey(apiBase: string, trustedOrigin?: string): boolean;
|
|
1045
|
-
declare function resolveConfig(config?: EngineConfig): ResolvedConfig;
|
|
1046
|
-
|
|
1047
1060
|
interface ApiError extends Error {
|
|
1048
1061
|
code?: string;
|
|
1049
1062
|
status?: number;
|
|
@@ -1172,4 +1185,4 @@ interface Verifier {
|
|
|
1172
1185
|
}
|
|
1173
1186
|
declare function createVerifier(api: ApiClient, fetchImpl: typeof fetch, rpcOverrides?: Record<number, string>): Verifier;
|
|
1174
1187
|
|
|
1175
|
-
export { type Destination as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Verifier as D, type EngineConfig as E, type FetchQuoteFn as F, type Address as G, type ApiError as H, BLOCK_LABEL_DEFAULT as I, COMPLIANCE_CHECK_ORDER as J, COMPLIANCE_DENY_LABEL as K, type LaneLimit as L, type CatalogueContext 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 CatalogueInput as U, type VerifyResult as V, type WalletScreen as W, type ComplianceCheckId as X, type ComplianceDecision as Y, DIRECT_CHECK_IDS as Z, DIRECT_SCOPE_NOTE as _, type Catalogue as a, FLOOR_CATEGORIES as a0, type Hex as a1, type LaneAvailabilityState as a2, type PlannedTxKind as a3, type QuoteBlock as a4, type ResolvedConfig as a5, type RouteHealth as a6, type RouteHealthAvailability as a7, type RouteHealthLane as a8, SCREENING_BUCKETS as a9, hubDeliverableSymbols as aA, isExecutableBridge as aB, isKnownUnbridgeable as aC, isSourceToken as aD, laneAvailabilityState as aE, laneKey as aF, laneKeys as aG, laneLimitAmount as aH, laneLimitError as aI, laneLimitFor as aJ, laneLimitHint as aK, laneLimitSymbol as aL, limitedLanes as aM, parseAllowedApiBase as aN, productAssets as aO, registryRpc as aP, resolveApiBase as aQ, resolveConfig as aR, screeningOutcomeOf as aS, sourceKeys as aT, suppressedLanes as aU, tokenKey as aV, txMatchesPlan as aW, unattributedComplianceReasons as aX, type ScreenProvider as aa, type ScreeningBucket as ab, type ScreeningOutcome as ac, TUNABLE_CATEGORIES as ad, type TxPlan as ae, amountFieldError as af, apiError as ag, blockLabelFor as ah, brokenLaneFor as ai, buildCatalogue as aj, canAttachApiKey as ak, categoryLabel as al, classifyQuoteError as am, complianceControlsEvaluated as an, complianceReasonHead as ao, complianceReasonTag as ap, complianceTagOf as aq, createApiClient as ar, createVerifier as as, destinationKeys as at, directComplianceFromScreens as au, distinctScreenedWallets as av, exceedsLaneLimit as aw, executableRoutes as ax, executionChainIds as ay, hasReachableDestination 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, formatJurisdiction as q, humanizeComplianceReason as r, type
|
|
1188
|
+
export { type Destination as $, type Availability as A, type BrokenLane as B, type Compliance as C, type Verifier as D, type EngineConfig as E, type FetchQuoteFn as F, type Address as G, type ApiError as H, BLOCK_LABEL_DEFAULT as I, COMPLIANCE_CHECK_ORDER as J, COMPLIANCE_DENY_LABEL as K, type LaneLimit as L, type CatalogueContext 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 CatalogueInput as U, type VerifyResult as V, type WalletScreen as W, type ComplianceCheckId as X, type ComplianceDecision as Y, DIRECT_CHECK_IDS as Z, DIRECT_SCOPE_NOTE as _, type Catalogue as a, FLOOR_CATEGORIES as a0, type Hex as a1, type LaneAvailabilityState as a2, type PlannedTxKind as a3, type QuoteBlock as a4, type ResolvedConfig as a5, type RouteHealth as a6, type RouteHealthAvailability as a7, type RouteHealthLane as a8, SCREENING_BUCKETS as a9, hubDeliverableSymbols as aA, isExecutableBridge as aB, isKnownUnbridgeable as aC, isSourceToken as aD, laneAvailabilityState as aE, laneKey as aF, laneKeys as aG, laneLimitAmount as aH, laneLimitError as aI, laneLimitFor as aJ, laneLimitHint as aK, laneLimitSymbol as aL, limitedLanes as aM, parseAllowedApiBase as aN, productAssets as aO, registryRpc as aP, resolveApiBase as aQ, resolveConfig as aR, screeningOutcomeOf as aS, sourceKeys as aT, suppressedLanes as aU, tokenKey as aV, txMatchesPlan as aW, unattributedComplianceReasons as aX, type ScreenProvider as aa, type ScreeningBucket as ab, type ScreeningOutcome as ac, TUNABLE_CATEGORIES as ad, type TxPlan as ae, amountFieldError as af, apiError as ag, blockLabelFor as ah, brokenLaneFor as ai, buildCatalogue as aj, canAttachApiKey as ak, categoryLabel as al, classifyQuoteError as am, complianceControlsEvaluated as an, complianceReasonHead as ao, complianceReasonTag as ap, complianceTagOf as aq, createApiClient as ar, createVerifier as as, destinationKeys as at, directComplianceFromScreens as au, distinctScreenedWallets as av, exceedsLaneLimit as aw, executableRoutes as ax, executionChainIds as ay, hasReachableDestination 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, formatJurisdiction as q, humanizeComplianceReason as r, type ApiClient as s, type SwapInput as t, type PayOption as u, type RwaVault as v, type SolveResult as w, type BalanceTarget as x, type BalanceEntry as y, type PlannedTx as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glacislabs/stablegenie-zerodelta",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/glacislabs/stablegenie-zerodelta#readme",
|
|
55
55
|
"publishConfig": {
|
|
56
|
-
"registry": "https://registry.npmjs.org",
|
|
56
|
+
"registry": "https://registry.npmjs.org/",
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"typescript": "~5.8.2",
|
|
104
104
|
"viem": "^2.56.3",
|
|
105
105
|
"vite": "^6.4.3",
|
|
106
|
-
"vitest": "^3.2.4"
|
|
106
|
+
"vitest": "^3.2.4",
|
|
107
|
+
"@noble/ed25519": "3.0.0"
|
|
107
108
|
},
|
|
108
109
|
"engines": {
|
|
109
110
|
"node": ">=20"
|