@usesigil/kit 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-errors.d.ts.map +1 -1
- package/dist/agent-errors.js +2 -2
- package/dist/agent-errors.js.map +1 -1
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +22 -0
- package/dist/create-vault.js.map +1 -1
- package/dist/dashboard/discover.d.ts.map +1 -1
- package/dist/dashboard/discover.js +10 -1
- package/dist/dashboard/discover.js.map +1 -1
- package/dist/dashboard/errors.d.ts +34 -0
- package/dist/dashboard/errors.d.ts.map +1 -1
- package/dist/dashboard/errors.js +71 -0
- package/dist/dashboard/errors.js.map +1 -1
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +11 -4
- package/dist/dashboard/mutations.js.map +1 -1
- package/dist/dashboard/reads.d.ts +40 -2
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +66 -29
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/dashboard/types.d.ts +11 -1
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/network-errors.d.ts +107 -0
- package/dist/network-errors.d.ts.map +1 -0
- package/dist/network-errors.js +357 -0
- package/dist/network-errors.js.map +1 -0
- package/dist/owner-transaction.d.ts.map +1 -1
- package/dist/owner-transaction.js +6 -4
- package/dist/owner-transaction.js.map +1 -1
- package/dist/presets.d.ts +19 -11
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +10 -13
- package/dist/presets.js.map +1 -1
- package/dist/priority-fees.d.ts.map +1 -1
- package/dist/priority-fees.js +13 -2
- package/dist/priority-fees.js.map +1 -1
- package/dist/rpc-helpers.d.ts +23 -0
- package/dist/rpc-helpers.d.ts.map +1 -1
- package/dist/rpc-helpers.js +45 -0
- package/dist/rpc-helpers.js.map +1 -1
- package/dist/seal.d.ts +8 -0
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +30 -8
- package/dist/seal.js.map +1 -1
- package/dist/state-resolver.d.ts.map +1 -1
- package/dist/state-resolver.js +35 -24
- package/dist/state-resolver.js.map +1 -1
- package/dist/tee/providers/crossmint.d.ts.map +1 -1
- package/dist/tee/providers/crossmint.js +15 -8
- package/dist/tee/providers/crossmint.js.map +1 -1
- package/dist/tee/providers/privy.d.ts.map +1 -1
- package/dist/tee/providers/privy.js +13 -8
- package/dist/tee/providers/privy.js.map +1 -1
- package/dist/tee/providers/turnkey.d.ts.map +1 -1
- package/dist/tee/providers/turnkey.js +19 -3
- package/dist/tee/providers/turnkey.js.map +1 -1
- package/dist/tee/types.d.ts +26 -1
- package/dist/tee/types.d.ts.map +1 -1
- package/dist/tee/verify.d.ts +15 -4
- package/dist/tee/verify.d.ts.map +1 -1
- package/dist/tee/verify.js +147 -38
- package/dist/tee/verify.js.map +1 -1
- package/dist/tee/wallet-types.d.ts +19 -4
- package/dist/tee/wallet-types.d.ts.map +1 -1
- package/dist/tee/wallet-types.js +21 -6
- package/dist/tee/wallet-types.js.map +1 -1
- package/dist/vault-analytics.d.ts.map +1 -1
- package/dist/vault-analytics.js +10 -1
- package/dist/vault-analytics.js.map +1 -1
- package/dist/x402/facilitator-verify.d.ts.map +1 -1
- package/dist/x402/facilitator-verify.js +6 -2
- package/dist/x402/facilitator-verify.js.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
// ─── Generated Client ─────────────────────────────────────────────────────────
|
|
4
4
|
export * from "./generated/index.js";
|
|
5
5
|
// ─── Type Constants + Permissions ─────────────────────────────────────────────
|
|
6
|
+
//
|
|
7
|
+
// The legacy 21-bit permission bitmasks (`SWAP_ONLY`, `PERPS_ONLY`,
|
|
8
|
+
// `TRANSFER_ONLY`, `ESCROW_ONLY`, `PERPS_FULL`), the `ACTION_PERMISSION_MAP`
|
|
9
|
+
// table, and the permission helpers built on top of them (`hasPermission`,
|
|
10
|
+
// `permissionsToStrings`, `stringsToPermissions`, `PermissionBuilder`) are no
|
|
11
|
+
// longer re-exported here. They encode a pre-v6 permission model that the
|
|
12
|
+
// on-chain program replaced with a 2-bit capability enum (`0 = Disabled`,
|
|
13
|
+
// `1 = Observer`, `2 = Operator`), and the presets that previously used those
|
|
14
|
+
// bitmasks now register agents with invalid capability values (either
|
|
15
|
+
// silently Observer or rejected with `InvalidArgument`). Use
|
|
16
|
+
// {@link FULL_CAPABILITY} / {@link FULL_PERMISSIONS} (both equal `2n`) for
|
|
17
|
+
// any preset or vault-creation flow that needs spending authority.
|
|
6
18
|
export {
|
|
7
19
|
// Program
|
|
8
20
|
SIGIL_PROGRAM_ADDRESS,
|
|
@@ -11,7 +23,7 @@ FEE_RATE_DENOMINATOR, PROTOCOL_FEE_RATE, MAX_DEVELOPER_FEE_RATE, PROTOCOL_TREASU
|
|
|
11
23
|
// USD
|
|
12
24
|
USD_DECIMALS,
|
|
13
25
|
// Multi-agent
|
|
14
|
-
MAX_AGENTS_PER_VAULT, MAX_ALLOWED_PROTOCOLS, FULL_CAPABILITY, FULL_PERMISSIONS,
|
|
26
|
+
MAX_AGENTS_PER_VAULT, MAX_ALLOWED_PROTOCOLS, FULL_CAPABILITY, FULL_PERMISSIONS,
|
|
15
27
|
// Escrow
|
|
16
28
|
MAX_ESCROW_DURATION,
|
|
17
29
|
// Slippage
|
|
@@ -23,11 +35,7 @@ PROTOCOL_MODE_ALL, PROTOCOL_MODE_ALLOWLIST, PROTOCOL_MODE_DENYLIST,
|
|
|
23
35
|
// Stablecoin mints
|
|
24
36
|
USDC_MINT_DEVNET, USDC_MINT_MAINNET, USDT_MINT_DEVNET, USDT_MINT_MAINNET, JUPITER_PROGRAM_ADDRESS, RECOGNIZED_DEFI_PROGRAMS,
|
|
25
37
|
// Functions
|
|
26
|
-
isStablecoinMint,
|
|
27
|
-
// Permission builder
|
|
28
|
-
PermissionBuilder,
|
|
29
|
-
// Types
|
|
30
|
-
ACTION_PERMISSION_MAP,
|
|
38
|
+
isStablecoinMint, parseActionType, isSpendingAction, getPositionEffect, validateNetwork, normalizeNetwork, toInstruction,
|
|
31
39
|
// Overlay constants
|
|
32
40
|
OVERLAY_EPOCH_DURATION, OVERLAY_NUM_EPOCHS, ROLLING_WINDOW_SECONDS,
|
|
33
41
|
// u64 boundary
|
|
@@ -98,7 +106,14 @@ export { mapPoliciesToVaultParams, findNextVaultId, inscribe, withVault, } from
|
|
|
98
106
|
// ─── Transaction Executor ──────────────────────────────────────────────────
|
|
99
107
|
export { TransactionExecutor } from "./transaction-executor.js";
|
|
100
108
|
// ─── RPC Helpers ───────────────────────────────────────────────────────────
|
|
101
|
-
export { BlockhashCache, signAndEncode, sendAndConfirmTransaction, } from "./rpc-helpers.js";
|
|
109
|
+
export { BlockhashCache, getBlockhashCache, signAndEncode, sendAndConfirmTransaction, } from "./rpc-helpers.js";
|
|
110
|
+
// ─── Error Classification (typed predicates + transport classifier) ─────────
|
|
111
|
+
//
|
|
112
|
+
// Shared helpers used across `seal`, `shielded-fetch`, `facilitator-verify`,
|
|
113
|
+
// and the dashboard reads. Consumers building their own retry/backoff or
|
|
114
|
+
// observability layers should reach for these before rolling their own.
|
|
115
|
+
export { isAccountNotFoundError } from "./dashboard/errors.js";
|
|
116
|
+
export { isTransportError, redactCause, PROVIDER_DENIAL_NAMES, TRANSPORT_CODES, } from "./network-errors.js";
|
|
102
117
|
// ─── VelocityTracker ──────────────────────────────────────────────────────
|
|
103
118
|
export { VelocityTracker } from "./velocity-tracker.js";
|
|
104
119
|
// ─── Core Policy Engine ──────────────────────────────────────────────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oCAAoC;AAEpC,iFAAiF;AACjF,cAAc,sBAAsB,CAAC;AAErC,iFAAiF;AACjF,OAAO;AACL,UAAU;AACV,qBAAqB;AACrB,gBAAgB;AAChB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB;AACjB,MAAM;AACN,YAAY;AACZ,cAAc;AACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oCAAoC;AAEpC,iFAAiF;AACjF,cAAc,sBAAsB,CAAC;AAErC,iFAAiF;AACjF,EAAE;AACF,oEAAoE;AACpE,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,0EAA0E;AAC1E,0EAA0E;AAC1E,8EAA8E;AAC9E,sEAAsE;AACtE,6DAA6D;AAC7D,2EAA2E;AAC3E,mEAAmE;AACnE,OAAO;AACL,UAAU;AACV,qBAAqB;AACrB,gBAAgB;AAChB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB;AACjB,MAAM;AACN,YAAY;AACZ,cAAc;AACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB;AAChB,SAAS;AACT,mBAAmB;AACnB,WAAW;AACX,gBAAgB;AAChB,eAAe;AACf,cAAc,EACd,UAAU;AACV,gBAAgB;AAChB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB;AACtB,mBAAmB;AACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB;AACxB,YAAY;AACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,aAAa;AACb,oBAAoB;AACpB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB;AACtB,eAAe;AACf,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,gFAAgF;AAChF,OAAO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AwB,CAAC;AAM/D,iFAAiF;AACjF,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAC;AAQvB,8EAA8E;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAOhE,8EAA8E;AAC9E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAG1B,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,wEAAwE;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,6EAA6E;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,gFAAgF;AAChF,qEAAqE;AACrE,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AACxE,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,+EAA+E;AAC/E,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural transport-error classification and safe error redaction.
|
|
3
|
+
*
|
|
4
|
+
* {@link isTransportError} inspects structural signals only (error class,
|
|
5
|
+
* `.name`, `.cause.code`) — never message regex — to distinguish transport
|
|
6
|
+
* failures (ECONNREFUSED, timeouts, TLS errors, HTTP/2 resets, 5xx upstream
|
|
7
|
+
* responses) from provider denials or logic errors. Intended for SDK call
|
|
8
|
+
* sites that want to surface "this was a network problem, retry may help"
|
|
9
|
+
* in a redacted, diagnosable form without leaking secrets from the raw
|
|
10
|
+
* error to downstream logs.
|
|
11
|
+
*
|
|
12
|
+
* {@link redactCause} returns a small, log-safe projection of any thrown
|
|
13
|
+
* value. Never returns raw `err` — message is sliced, `.stack` is dropped,
|
|
14
|
+
* cycles are broken via WeakSet, and every property access is try-guarded
|
|
15
|
+
* so a hostile error (Proxy traps, throwing getters, null-prototype
|
|
16
|
+
* objects) cannot re-introduce a silent failure by throwing through the
|
|
17
|
+
* redactor itself.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Provider-denial class names. Errors whose `.name` matches one of these are
|
|
21
|
+
* NEVER classified as transport, even if other signals look transport-shaped.
|
|
22
|
+
* A provider that throws a `TimeoutError` for business reasons (e.g., policy
|
|
23
|
+
* lockout after N failed attempts) shouldn't be mis-classified as a network
|
|
24
|
+
* retry candidate. Extend this denylist when wiring a new custody adapter.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PROVIDER_DENIAL_NAMES: ReadonlySet<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Error codes that indicate a transport-layer failure (network, TLS,
|
|
29
|
+
* HTTP/2, upstream gateway). `.cause.code` is inspected by
|
|
30
|
+
* {@link isTransportError}.
|
|
31
|
+
*
|
|
32
|
+
* Scope:
|
|
33
|
+
* - Classic POSIX: ECONNREFUSED, ECONNRESET, ETIMEDOUT, ENOTFOUND,
|
|
34
|
+
* EAI_AGAIN, ENETUNREACH, EPIPE.
|
|
35
|
+
* - Undici (Node 18/20/22 fetch): UND_ERR_CONNECT_TIMEOUT,
|
|
36
|
+
* UND_ERR_HEADERS_TIMEOUT, UND_ERR_BODY_TIMEOUT, UND_ERR_SOCKET,
|
|
37
|
+
* UND_ERR_ABORTED.
|
|
38
|
+
* - TLS: CERT_HAS_EXPIRED, UNABLE_TO_VERIFY_LEAF_SIGNATURE,
|
|
39
|
+
* DEPTH_ZERO_SELF_SIGNED_CERT, ERR_TLS_CERT_ALTNAME_INVALID.
|
|
40
|
+
* - HTTP/2: ERR_HTTP2_STREAM_ERROR, ERR_HTTP2_SESSION_ERROR,
|
|
41
|
+
* ERR_HTTP2_GOAWAY_SESSION.
|
|
42
|
+
* - Sigil custody adapters: HTTP_5XX (set on tagged upstream 5xx errors).
|
|
43
|
+
*/
|
|
44
|
+
export declare const TRANSPORT_CODES: ReadonlySet<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Classify an error as transport-layer (retry-worthy network/TLS/upstream
|
|
47
|
+
* failure) or not. Structural checks only — no message regex.
|
|
48
|
+
*
|
|
49
|
+
* Recognized transport signals (in order of evaluation):
|
|
50
|
+
* 1. `DOMException` with name `AbortError` or `TimeoutError` — undici
|
|
51
|
+
* surfaces `AbortSignal.timeout()` as DOMException, NOT plain Error.
|
|
52
|
+
* 2. `Error` with name `AbortError` or `TimeoutError` — non-undici runtimes.
|
|
53
|
+
* 3. `err.cause.name` ∈ {ConnectTimeoutError, HeadersTimeoutError,
|
|
54
|
+
* BodyTimeoutError, SocketError} — undici class names.
|
|
55
|
+
* 4. `err.cause.code` ∈ {@link TRANSPORT_CODES} — POSIX / undici / TLS /
|
|
56
|
+
* HTTP/2 / HTTP_5XX-tagged codes.
|
|
57
|
+
* 5. `AggregateError` — recurses into `.errors` (Node's Happy Eyeballs
|
|
58
|
+
* fetch surfaces multi-IP failures this way).
|
|
59
|
+
* 6. `err.statusCode` ≥ 500 — for custody adapters that throw Error
|
|
60
|
+
* with a numeric `statusCode` on upstream 5xx without setting a cause.
|
|
61
|
+
* 7. `TypeError("fetch failed")` with no cause — Node undici's bare
|
|
62
|
+
* shape when cause attachment failed.
|
|
63
|
+
*
|
|
64
|
+
* Provider-denial short-circuit: if `err.name` is in
|
|
65
|
+
* {@link PROVIDER_DENIAL_NAMES}, returns false immediately — a provider
|
|
66
|
+
* that throws a `TimeoutError` for business reasons shouldn't be
|
|
67
|
+
* retry-classified.
|
|
68
|
+
*
|
|
69
|
+
* Non-Error inputs (`null`, `undefined`, strings, numbers, plain objects
|
|
70
|
+
* without the expected shape) return false.
|
|
71
|
+
*/
|
|
72
|
+
export declare function isTransportError(err: unknown): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Safe, log-friendly projection of an error's identifying fields.
|
|
75
|
+
*
|
|
76
|
+
* Returned shape:
|
|
77
|
+
* - `name?` — string, from `err.name`, if accessible and a string.
|
|
78
|
+
* - `message?` — string, from `err.message`, sliced to at most 200
|
|
79
|
+
* chars. If `.message` is present but not a string (Symbol, BigInt,
|
|
80
|
+
* object), returns `"<non-string <typeof>>"` so the diagnostic
|
|
81
|
+
* distinguishes "we couldn't read" from "there was no message." This
|
|
82
|
+
* matters at every consumer site that does
|
|
83
|
+
* `cause.message ?? cause.name ?? cause.code ?? "unknown"` — without
|
|
84
|
+
* the non-string projection, `"unknown"` collapses across real gaps
|
|
85
|
+
* and hostile shapes.
|
|
86
|
+
* - `code?` — string, from `err.code` OR `err.cause.code` (walked),
|
|
87
|
+
* coerced from number/bigint if needed.
|
|
88
|
+
*
|
|
89
|
+
* Guarantees:
|
|
90
|
+
* - Never throws. Every property access is `try`-guarded. A hostile
|
|
91
|
+
* error with a throwing getter, Proxy `get` trap, or null-prototype
|
|
92
|
+
* object yields `{}` rather than re-introducing a silent failure.
|
|
93
|
+
* - Never reads `.stack` (may embed API keys, auth headers, or request
|
|
94
|
+
* bodies from upstream SDK wrappers).
|
|
95
|
+
* - Cycles in the cause chain are broken via {@link WeakSet}, and a
|
|
96
|
+
* soft depth cap of {@link MAX_CAUSE_WALK_DEPTH} protects against
|
|
97
|
+
* hostile causes that allocate a fresh wrapper per access (identity-
|
|
98
|
+
* based cycle detection alone cannot catch that pattern).
|
|
99
|
+
* - Non-Error inputs (null, undefined, string, number, Symbol, BigInt,
|
|
100
|
+
* Proxy, null-prototype) return a sensible projection or `{}`.
|
|
101
|
+
*/
|
|
102
|
+
export declare function redactCause(err: unknown): {
|
|
103
|
+
name?: string;
|
|
104
|
+
message?: string;
|
|
105
|
+
code?: string;
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=network-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-errors.d.ts","sourceRoot":"","sources":["../src/network-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAKpD,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CA0B9C,CAAC;AAsFH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAyEtD;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CA0DA"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural transport-error classification and safe error redaction.
|
|
3
|
+
*
|
|
4
|
+
* {@link isTransportError} inspects structural signals only (error class,
|
|
5
|
+
* `.name`, `.cause.code`) — never message regex — to distinguish transport
|
|
6
|
+
* failures (ECONNREFUSED, timeouts, TLS errors, HTTP/2 resets, 5xx upstream
|
|
7
|
+
* responses) from provider denials or logic errors. Intended for SDK call
|
|
8
|
+
* sites that want to surface "this was a network problem, retry may help"
|
|
9
|
+
* in a redacted, diagnosable form without leaking secrets from the raw
|
|
10
|
+
* error to downstream logs.
|
|
11
|
+
*
|
|
12
|
+
* {@link redactCause} returns a small, log-safe projection of any thrown
|
|
13
|
+
* value. Never returns raw `err` — message is sliced, `.stack` is dropped,
|
|
14
|
+
* cycles are broken via WeakSet, and every property access is try-guarded
|
|
15
|
+
* so a hostile error (Proxy traps, throwing getters, null-prototype
|
|
16
|
+
* objects) cannot re-introduce a silent failure by throwing through the
|
|
17
|
+
* redactor itself.
|
|
18
|
+
*/
|
|
19
|
+
// ─── Transport error codes ─────────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* Provider-denial class names. Errors whose `.name` matches one of these are
|
|
22
|
+
* NEVER classified as transport, even if other signals look transport-shaped.
|
|
23
|
+
* A provider that throws a `TimeoutError` for business reasons (e.g., policy
|
|
24
|
+
* lockout after N failed attempts) shouldn't be mis-classified as a network
|
|
25
|
+
* retry candidate. Extend this denylist when wiring a new custody adapter.
|
|
26
|
+
*/
|
|
27
|
+
export const PROVIDER_DENIAL_NAMES = new Set([
|
|
28
|
+
"ProviderDeniedError",
|
|
29
|
+
"CustodyDeniedError",
|
|
30
|
+
"UnauthorizedError",
|
|
31
|
+
"ForbiddenError",
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* Error codes that indicate a transport-layer failure (network, TLS,
|
|
35
|
+
* HTTP/2, upstream gateway). `.cause.code` is inspected by
|
|
36
|
+
* {@link isTransportError}.
|
|
37
|
+
*
|
|
38
|
+
* Scope:
|
|
39
|
+
* - Classic POSIX: ECONNREFUSED, ECONNRESET, ETIMEDOUT, ENOTFOUND,
|
|
40
|
+
* EAI_AGAIN, ENETUNREACH, EPIPE.
|
|
41
|
+
* - Undici (Node 18/20/22 fetch): UND_ERR_CONNECT_TIMEOUT,
|
|
42
|
+
* UND_ERR_HEADERS_TIMEOUT, UND_ERR_BODY_TIMEOUT, UND_ERR_SOCKET,
|
|
43
|
+
* UND_ERR_ABORTED.
|
|
44
|
+
* - TLS: CERT_HAS_EXPIRED, UNABLE_TO_VERIFY_LEAF_SIGNATURE,
|
|
45
|
+
* DEPTH_ZERO_SELF_SIGNED_CERT, ERR_TLS_CERT_ALTNAME_INVALID.
|
|
46
|
+
* - HTTP/2: ERR_HTTP2_STREAM_ERROR, ERR_HTTP2_SESSION_ERROR,
|
|
47
|
+
* ERR_HTTP2_GOAWAY_SESSION.
|
|
48
|
+
* - Sigil custody adapters: HTTP_5XX (set on tagged upstream 5xx errors).
|
|
49
|
+
*/
|
|
50
|
+
export const TRANSPORT_CODES = new Set([
|
|
51
|
+
// POSIX
|
|
52
|
+
"ECONNREFUSED",
|
|
53
|
+
"ECONNRESET",
|
|
54
|
+
"ETIMEDOUT",
|
|
55
|
+
"ENOTFOUND",
|
|
56
|
+
"EAI_AGAIN",
|
|
57
|
+
"ENETUNREACH",
|
|
58
|
+
"EPIPE",
|
|
59
|
+
// Undici
|
|
60
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
61
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
62
|
+
"UND_ERR_BODY_TIMEOUT",
|
|
63
|
+
"UND_ERR_SOCKET",
|
|
64
|
+
"UND_ERR_ABORTED",
|
|
65
|
+
// TLS
|
|
66
|
+
"CERT_HAS_EXPIRED",
|
|
67
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
68
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
69
|
+
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
70
|
+
// HTTP/2
|
|
71
|
+
"ERR_HTTP2_STREAM_ERROR",
|
|
72
|
+
"ERR_HTTP2_SESSION_ERROR",
|
|
73
|
+
"ERR_HTTP2_GOAWAY_SESSION",
|
|
74
|
+
// Custody adapter tag (set by sdk/custody adapters on 5xx upstream)
|
|
75
|
+
"HTTP_5XX",
|
|
76
|
+
]);
|
|
77
|
+
/**
|
|
78
|
+
* Undici's causal ConnectTimeoutError class-name signal. Checked separately
|
|
79
|
+
* from `TRANSPORT_CODES` because some undici paths populate `.name` but not
|
|
80
|
+
* `.code` on the cause.
|
|
81
|
+
*/
|
|
82
|
+
const TRANSPORT_CAUSE_NAMES = new Set([
|
|
83
|
+
"ConnectTimeoutError",
|
|
84
|
+
"HeadersTimeoutError",
|
|
85
|
+
"BodyTimeoutError",
|
|
86
|
+
"SocketError",
|
|
87
|
+
]);
|
|
88
|
+
// ─── isTransportError ──────────────────────────────────────────────────────
|
|
89
|
+
/**
|
|
90
|
+
* `instanceof` that survives hostile proxies. `x instanceof C` internally
|
|
91
|
+
* walks the prototype chain and can invoke `get` traps; a throwing trap
|
|
92
|
+
* would propagate out of the predicate and re-introduce a silent-failure
|
|
93
|
+
* vector. Wrapping the check lets the classifier fall through to `false`
|
|
94
|
+
* instead of crashing.
|
|
95
|
+
*/
|
|
96
|
+
function safeInstanceOf(value, ctor) {
|
|
97
|
+
try {
|
|
98
|
+
return value instanceof ctor;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function safeGetName(value) {
|
|
105
|
+
try {
|
|
106
|
+
if (value && typeof value === "object" && "name" in value) {
|
|
107
|
+
const n = value.name;
|
|
108
|
+
return typeof n === "string" ? n : undefined;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Throwing getter / Proxy trap — treat as unnameable.
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
function safeGetCause(value) {
|
|
117
|
+
try {
|
|
118
|
+
if (value && typeof value === "object" && "cause" in value) {
|
|
119
|
+
return value.cause;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Throwing getter / Proxy trap.
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
function safeGetCode(value) {
|
|
128
|
+
try {
|
|
129
|
+
if (value && typeof value === "object" && "code" in value) {
|
|
130
|
+
const c = value.code;
|
|
131
|
+
if (typeof c === "string")
|
|
132
|
+
return c;
|
|
133
|
+
if (typeof c === "number" || typeof c === "bigint")
|
|
134
|
+
return String(c);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// Throwing getter / Proxy trap.
|
|
139
|
+
}
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
function safeGetStatusCode(value) {
|
|
143
|
+
try {
|
|
144
|
+
if (value && typeof value === "object") {
|
|
145
|
+
for (const key of ["statusCode", "status"]) {
|
|
146
|
+
if (key in value) {
|
|
147
|
+
const v = value[key];
|
|
148
|
+
if (typeof v === "number" && Number.isFinite(v))
|
|
149
|
+
return v;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// Throwing getter / Proxy trap.
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Classify an error as transport-layer (retry-worthy network/TLS/upstream
|
|
161
|
+
* failure) or not. Structural checks only — no message regex.
|
|
162
|
+
*
|
|
163
|
+
* Recognized transport signals (in order of evaluation):
|
|
164
|
+
* 1. `DOMException` with name `AbortError` or `TimeoutError` — undici
|
|
165
|
+
* surfaces `AbortSignal.timeout()` as DOMException, NOT plain Error.
|
|
166
|
+
* 2. `Error` with name `AbortError` or `TimeoutError` — non-undici runtimes.
|
|
167
|
+
* 3. `err.cause.name` ∈ {ConnectTimeoutError, HeadersTimeoutError,
|
|
168
|
+
* BodyTimeoutError, SocketError} — undici class names.
|
|
169
|
+
* 4. `err.cause.code` ∈ {@link TRANSPORT_CODES} — POSIX / undici / TLS /
|
|
170
|
+
* HTTP/2 / HTTP_5XX-tagged codes.
|
|
171
|
+
* 5. `AggregateError` — recurses into `.errors` (Node's Happy Eyeballs
|
|
172
|
+
* fetch surfaces multi-IP failures this way).
|
|
173
|
+
* 6. `err.statusCode` ≥ 500 — for custody adapters that throw Error
|
|
174
|
+
* with a numeric `statusCode` on upstream 5xx without setting a cause.
|
|
175
|
+
* 7. `TypeError("fetch failed")` with no cause — Node undici's bare
|
|
176
|
+
* shape when cause attachment failed.
|
|
177
|
+
*
|
|
178
|
+
* Provider-denial short-circuit: if `err.name` is in
|
|
179
|
+
* {@link PROVIDER_DENIAL_NAMES}, returns false immediately — a provider
|
|
180
|
+
* that throws a `TimeoutError` for business reasons shouldn't be
|
|
181
|
+
* retry-classified.
|
|
182
|
+
*
|
|
183
|
+
* Non-Error inputs (`null`, `undefined`, strings, numbers, plain objects
|
|
184
|
+
* without the expected shape) return false.
|
|
185
|
+
*/
|
|
186
|
+
export function isTransportError(err) {
|
|
187
|
+
if (err === null || err === undefined)
|
|
188
|
+
return false;
|
|
189
|
+
// Provider denial denylist wins over everything.
|
|
190
|
+
const name = safeGetName(err);
|
|
191
|
+
if (name !== undefined && PROVIDER_DENIAL_NAMES.has(name))
|
|
192
|
+
return false;
|
|
193
|
+
// DOMException (undici fetch timeout/abort shape). `safeInstanceOf` is
|
|
194
|
+
// required because a Proxy with a throwing `get` trap would propagate
|
|
195
|
+
// out of a raw `instanceof` check and reintroduce silent failure.
|
|
196
|
+
if (typeof DOMException !== "undefined" &&
|
|
197
|
+
safeInstanceOf(err, DOMException)) {
|
|
198
|
+
return name === "AbortError" || name === "TimeoutError";
|
|
199
|
+
}
|
|
200
|
+
// AggregateError — recurse into wrapped errors.
|
|
201
|
+
if (typeof AggregateError !== "undefined" &&
|
|
202
|
+
safeInstanceOf(err, AggregateError)) {
|
|
203
|
+
try {
|
|
204
|
+
const wrapped = err.errors;
|
|
205
|
+
if (Array.isArray(wrapped))
|
|
206
|
+
return wrapped.some(isTransportError);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
// Throwing getter on .errors — treat as non-transport.
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
if (!safeInstanceOf(err, Error))
|
|
214
|
+
return false;
|
|
215
|
+
// Plain Error with transport-shaped name (non-undici runtimes).
|
|
216
|
+
if (name === "AbortError" || name === "TimeoutError")
|
|
217
|
+
return true;
|
|
218
|
+
// cause-chain signals — undici typically wraps the real error in `.cause`.
|
|
219
|
+
const cause = safeGetCause(err);
|
|
220
|
+
if (cause !== undefined && cause !== null) {
|
|
221
|
+
const causeName = safeGetName(cause);
|
|
222
|
+
if (causeName !== undefined && TRANSPORT_CAUSE_NAMES.has(causeName)) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
const causeCode = safeGetCode(cause);
|
|
226
|
+
if (causeCode !== undefined && TRANSPORT_CODES.has(causeCode)) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Direct `.code` on the error (some legacy undici paths set this on Error,
|
|
231
|
+
// not cause).
|
|
232
|
+
const directCode = safeGetCode(err);
|
|
233
|
+
if (directCode !== undefined && TRANSPORT_CODES.has(directCode))
|
|
234
|
+
return true;
|
|
235
|
+
// Upstream HTTP 5xx tagged on the error itself.
|
|
236
|
+
const statusCode = safeGetStatusCode(err);
|
|
237
|
+
if (statusCode !== undefined && statusCode >= 500 && statusCode < 600) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
// Bare `TypeError("fetch failed")` with no cause — fall-through undici
|
|
241
|
+
// shape when cause attachment failed. Recognized only if nothing else
|
|
242
|
+
// matched.
|
|
243
|
+
if (safeInstanceOf(err, TypeError) && cause === undefined) {
|
|
244
|
+
try {
|
|
245
|
+
const msg = err.message;
|
|
246
|
+
if (typeof msg === "string" && msg === "fetch failed")
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// Throwing getter on message — fall through.
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
// ─── redactCause ───────────────────────────────────────────────────────────
|
|
256
|
+
/**
|
|
257
|
+
* Soft cap on cause-chain walks. Pure defense-in-depth against a hostile
|
|
258
|
+
* error whose `.cause` getter returns a freshly-allocated wrapper on every
|
|
259
|
+
* access — the WeakSet cycle-detection sees a new object each time and
|
|
260
|
+
* would otherwise loop until the runtime's memory/stack limit. 16 is
|
|
261
|
+
* deeper than any realistic middleware error-wrapper chain (4–6 is
|
|
262
|
+
* typical for serverless + framework + SDK combinations).
|
|
263
|
+
*/
|
|
264
|
+
const MAX_CAUSE_WALK_DEPTH = 16;
|
|
265
|
+
/**
|
|
266
|
+
* Safe, log-friendly projection of an error's identifying fields.
|
|
267
|
+
*
|
|
268
|
+
* Returned shape:
|
|
269
|
+
* - `name?` — string, from `err.name`, if accessible and a string.
|
|
270
|
+
* - `message?` — string, from `err.message`, sliced to at most 200
|
|
271
|
+
* chars. If `.message` is present but not a string (Symbol, BigInt,
|
|
272
|
+
* object), returns `"<non-string <typeof>>"` so the diagnostic
|
|
273
|
+
* distinguishes "we couldn't read" from "there was no message." This
|
|
274
|
+
* matters at every consumer site that does
|
|
275
|
+
* `cause.message ?? cause.name ?? cause.code ?? "unknown"` — without
|
|
276
|
+
* the non-string projection, `"unknown"` collapses across real gaps
|
|
277
|
+
* and hostile shapes.
|
|
278
|
+
* - `code?` — string, from `err.code` OR `err.cause.code` (walked),
|
|
279
|
+
* coerced from number/bigint if needed.
|
|
280
|
+
*
|
|
281
|
+
* Guarantees:
|
|
282
|
+
* - Never throws. Every property access is `try`-guarded. A hostile
|
|
283
|
+
* error with a throwing getter, Proxy `get` trap, or null-prototype
|
|
284
|
+
* object yields `{}` rather than re-introducing a silent failure.
|
|
285
|
+
* - Never reads `.stack` (may embed API keys, auth headers, or request
|
|
286
|
+
* bodies from upstream SDK wrappers).
|
|
287
|
+
* - Cycles in the cause chain are broken via {@link WeakSet}, and a
|
|
288
|
+
* soft depth cap of {@link MAX_CAUSE_WALK_DEPTH} protects against
|
|
289
|
+
* hostile causes that allocate a fresh wrapper per access (identity-
|
|
290
|
+
* based cycle detection alone cannot catch that pattern).
|
|
291
|
+
* - Non-Error inputs (null, undefined, string, number, Symbol, BigInt,
|
|
292
|
+
* Proxy, null-prototype) return a sensible projection or `{}`.
|
|
293
|
+
*/
|
|
294
|
+
export function redactCause(err) {
|
|
295
|
+
// Handle primitives up-front.
|
|
296
|
+
if (err === null || err === undefined)
|
|
297
|
+
return {};
|
|
298
|
+
if (typeof err === "string") {
|
|
299
|
+
return { message: err.slice(0, 200) };
|
|
300
|
+
}
|
|
301
|
+
if (typeof err === "number" || typeof err === "bigint") {
|
|
302
|
+
return { code: String(err) };
|
|
303
|
+
}
|
|
304
|
+
if (typeof err !== "object")
|
|
305
|
+
return {};
|
|
306
|
+
const out = {};
|
|
307
|
+
const name = safeGetName(err);
|
|
308
|
+
if (name !== undefined)
|
|
309
|
+
out.name = name;
|
|
310
|
+
try {
|
|
311
|
+
if ("message" in err) {
|
|
312
|
+
const m = err.message;
|
|
313
|
+
if (typeof m === "string") {
|
|
314
|
+
out.message = m.slice(0, 200);
|
|
315
|
+
}
|
|
316
|
+
else if (m !== undefined && m !== null) {
|
|
317
|
+
// Present but non-string — preserve the distinguishability
|
|
318
|
+
// signal at consumer sites (see doc-comment rationale).
|
|
319
|
+
out.message = `<non-string ${typeof m}>`;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// Throwing getter / Proxy trap — skip.
|
|
325
|
+
}
|
|
326
|
+
const directCode = safeGetCode(err);
|
|
327
|
+
if (directCode !== undefined) {
|
|
328
|
+
out.code = directCode;
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
// Walk the cause chain for a code, breaking cycles via WeakSet AND
|
|
332
|
+
// capping depth so a hostile getter that allocates fresh objects on
|
|
333
|
+
// every access can't drive the loop into a memory wall.
|
|
334
|
+
const visited = new WeakSet();
|
|
335
|
+
let current = err;
|
|
336
|
+
for (let depth = 0; depth < MAX_CAUSE_WALK_DEPTH; depth++) {
|
|
337
|
+
if (current === null || current === undefined)
|
|
338
|
+
break;
|
|
339
|
+
if (typeof current !== "object")
|
|
340
|
+
break;
|
|
341
|
+
if (visited.has(current))
|
|
342
|
+
break;
|
|
343
|
+
visited.add(current);
|
|
344
|
+
const nextCause = safeGetCause(current);
|
|
345
|
+
if (nextCause === undefined || nextCause === null)
|
|
346
|
+
break;
|
|
347
|
+
const causeCode = safeGetCode(nextCause);
|
|
348
|
+
if (causeCode !== undefined) {
|
|
349
|
+
out.code = causeCode;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
current = nextCause;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return out;
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=network-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-errors.js","sourceRoot":"","sources":["../src/network-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IAChE,qBAAqB;IACrB,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;CACjB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IAC1D,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,OAAO;IACP,SAAS;IACT,yBAAyB;IACzB,yBAAyB;IACzB,sBAAsB;IACtB,gBAAgB;IAChB,iBAAiB;IACjB,MAAM;IACN,kBAAkB;IAClB,iCAAiC;IACjC,6BAA6B;IAC7B,8BAA8B;IAC9B,SAAS;IACT,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,oEAAoE;IACpE,UAAU;CACX,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IACzD,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,aAAa;CACd,CAAC,CAAC;AAEH,8EAA8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M,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;gBACrB,MAAM;YACR,CAAC;YACD,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner-transaction.d.ts","sourceRoot":"","sources":["../src/owner-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAEV,WAAW,EACX,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAOL,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAMrB,OAAO,
|
|
1
|
+
{"version":3,"file":"owner-transaction.d.ts","sourceRoot":"","sources":["../src/owner-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAEV,WAAW,EACX,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAOL,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQrE,MAAM,WAAW,2BAA2B;IAC1C,iDAAiD;IACjD,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,gCAAgC;IAChC,KAAK,EAAE,iBAAiB,CAAC;IACzB,4CAA4C;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,kCAAkC;IAClC,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,6BAA6B,CAAC;IACpD,0DAA0D;IAC1D,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,WAAW,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACnD,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAgFjC"}
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
import { pipe, createTransactionMessage, setTransactionMessageFeePayer, appendTransactionMessageInstructions, setTransactionMessageLifetimeUsingBlockhash, compressTransactionMessageUsingAddressLookupTables, compileTransaction, } from "@solana/kit";
|
|
13
13
|
import { getSetComputeUnitLimitInstruction, getSetComputeUnitPriceInstruction, } from "@solana-program/compute-budget";
|
|
14
14
|
import { measureTransactionSize, MAX_TX_SIZE } from "./composer.js";
|
|
15
|
-
import {
|
|
15
|
+
import { getBlockhashCache } from "./rpc-helpers.js";
|
|
16
16
|
import { AltCache } from "./alt-loader.js";
|
|
17
17
|
import { getSigilAltAddress } from "./alt-config.js";
|
|
18
18
|
import { CU_OWNER_ACTION } from "./priority-fees.js";
|
|
19
19
|
import { normalizeNetwork } from "./types.js";
|
|
20
|
-
// ─── Module-level caches
|
|
21
|
-
|
|
20
|
+
// ─── Module-level caches ────────────────────────────────────────────────────
|
|
21
|
+
// Per-RPC blockhash cache lives in `rpc-helpers.getBlockhashCache(rpc)`; see
|
|
22
|
+
// its JSDoc for why we no longer hold a module-level singleton. `AltCache`
|
|
23
|
+
// stays module-level — ALTs are address-keyed and safe to share.
|
|
22
24
|
const altCache = new AltCache();
|
|
23
25
|
// ─── buildOwnerTransaction ──────────────────────────────────────────────────
|
|
24
26
|
export async function buildOwnerTransaction(params) {
|
|
@@ -31,7 +33,7 @@ export async function buildOwnerTransaction(params) {
|
|
|
31
33
|
const [blockhash, addressLookupTables] = await Promise.all([
|
|
32
34
|
params.blockhash
|
|
33
35
|
? Promise.resolve(params.blockhash)
|
|
34
|
-
:
|
|
36
|
+
: getBlockhashCache(params.rpc).get(params.rpc),
|
|
35
37
|
params.addressLookupTables
|
|
36
38
|
? Promise.resolve(params.addressLookupTables)
|
|
37
39
|
: altCache.resolve(params.rpc, [getSigilAltAddress(net)]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner-transaction.js","sourceRoot":"","sources":["../src/owner-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,6BAA6B,EAC7B,oCAAoC,EACpC,2CAA2C,EAC3C,kDAAkD,EAClD,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"owner-transaction.js","sourceRoot":"","sources":["../src/owner-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,6BAA6B,EAC7B,oCAAoC,EACpC,2CAA2C,EAC3C,kDAAkD,EAClD,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB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