@bananapus/nana-sdk-core 1.7.0 → 1.9.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.
@@ -0,0 +1,105 @@
1
+ export declare const BENDYSTRAW_TIMEOUT_MS = 15000;
2
+ export declare const MAX_BENDYSTRAW_RESPONSE_BYTES: number;
3
+ export declare const BENDYSTRAW_PROJECT_REF_BATCH_SIZE = 200;
4
+ export declare const BENDYSTRAW_CACHE_TTL_MS: {
5
+ readonly live: 15000;
6
+ readonly standard: 30000;
7
+ readonly stable: 60000;
8
+ };
9
+ export type BendystrawFilter = Record<string, unknown>;
10
+ export type BendystrawNetwork = "mainnet" | "testnet";
11
+ export type BendystrawCachePolicy = keyof typeof BENDYSTRAW_CACHE_TTL_MS;
12
+ export type BendystrawValidator<T> = (value: unknown) => value is T;
13
+ export type BendystrawNetworkSelection = {
14
+ chainId?: number;
15
+ defaultNetwork?: BendystrawNetwork;
16
+ network?: BendystrawNetwork;
17
+ variables?: unknown;
18
+ };
19
+ export type BendystrawEndpoints = {
20
+ mainnet: string;
21
+ testnet: string;
22
+ };
23
+ export type BendystrawProjectRef = {
24
+ chainId: number;
25
+ projectId: number;
26
+ version?: number;
27
+ };
28
+ export type BendystrawProjectRow = {
29
+ chainId?: unknown;
30
+ projectId?: unknown;
31
+ version?: unknown;
32
+ };
33
+ export declare class BendystrawRequestError extends Error {
34
+ readonly status?: number | undefined;
35
+ constructor(message: string, status?: number | undefined);
36
+ }
37
+ export type BendystrawRequestOptions<TResult = unknown, TVariables extends object = Record<string, never>> = {
38
+ fetch?: typeof fetch;
39
+ maxResponseBytes?: number;
40
+ operationName?: string;
41
+ retryDelaysMs?: readonly number[];
42
+ signal?: AbortSignal;
43
+ timeoutMs?: number;
44
+ validateData?: BendystrawValidator<TResult>;
45
+ validateVariables?: BendystrawValidator<TVariables>;
46
+ };
47
+ /**
48
+ * Resolve the Bendystraw network for an operation from every chain selector in
49
+ * its variables. Unknown chains, mixed networks, and explicit contradictions
50
+ * fail closed instead of silently querying the wrong index.
51
+ */
52
+ export declare function resolveBendystrawNetwork(selection?: BendystrawNetworkSelection): BendystrawNetwork;
53
+ /** Normalize a Bendystraw origin or endpoint to one canonical GraphQL URL. */
54
+ export declare function normalizeBendystrawEndpoint(endpoint: string): string;
55
+ /** Select and normalize the endpoint for the operation's resolved network. */
56
+ export declare function selectBendystrawEndpoint(endpoints: BendystrawEndpoints, selection?: BendystrawNetworkSelection): string;
57
+ export declare function isBendystrawRecord(value: unknown): value is Record<string, unknown>;
58
+ /** Build a lightweight guard for the required root fields of an operation. */
59
+ export declare function bendystrawDataHasFields<const TKey extends string>(...fields: readonly TKey[]): BendystrawValidator<Record<TKey, unknown>>;
60
+ export declare function assertBendystrawData<T>(value: unknown, validator: BendystrawValidator<T>, operationName?: string): T;
61
+ export declare function assertBendystrawVariables<T extends object>(value: unknown, validator: BendystrawValidator<T>, operationName?: string): T;
62
+ /**
63
+ * Shared freshness vocabulary for clients. The transport does not cache.
64
+ *
65
+ * - `live`: balances, activity, and mutable project state.
66
+ * - `standard`: lists, search, and aggregate charts.
67
+ * - `stable`: metadata and historical records.
68
+ *
69
+ * Writes should invalidate affected reads. An indexer failure may fall back to
70
+ * an authoritative RPC read only when the fallback preserves the same scoped
71
+ * identity; failures must never be converted into zero or empty data.
72
+ */
73
+ export declare function bendystrawCacheTtl(policy: BendystrawCachePolicy): number;
74
+ /**
75
+ * Build an explicit conjunction for one versioned deployment. Keeping each
76
+ * identity field in its own `AND` member prevents accidental project/chain
77
+ * cross-products when multiple deployments are combined with `OR`.
78
+ */
79
+ export declare function bendystrawProjectRefFilter(ref: BendystrawProjectRef): BendystrawFilter;
80
+ /**
81
+ * Build an exact filter for one or more deployments. An empty list throws
82
+ * instead of silently producing a broad, unscoped indexer query.
83
+ */
84
+ export declare function bendystrawProjectRefsFilter(refs: readonly BendystrawProjectRef[]): BendystrawFilter;
85
+ /**
86
+ * Build independently queryable exact-deployment filters without handing an
87
+ * indexer one unbounded `OR`. Empty input produces no queries; malformed refs
88
+ * still fail closed.
89
+ */
90
+ export declare function bendystrawProjectRefsFilters(refs: readonly BendystrawProjectRef[], batchSize?: number): BendystrawFilter[];
91
+ /**
92
+ * Verify that an indexer row belongs to one of the requested deployments.
93
+ * Use this at the response boundary as defense in depth against stale schemas,
94
+ * permissive filters, and indexer regressions.
95
+ */
96
+ export declare function matchesBendystrawProjectRef(row: BendystrawProjectRow, refs: readonly BendystrawProjectRef[]): boolean;
97
+ /**
98
+ * Execute a bounded, timeout-protected Bendystraw GraphQL request.
99
+ *
100
+ * The helper retries only transient transport failures. GraphQL errors,
101
+ * invalid envelopes, invalid content types, oversized bodies, and caller
102
+ * cancellation fail closed without being retried.
103
+ */
104
+ export declare function requestBendystraw<TResult, TVariables extends object = Record<string, never>>(endpoint: string, query: string, variables: TVariables, options?: BendystrawRequestOptions<TResult, TVariables>): Promise<TResult>;
105
+ //# sourceMappingURL=bendystraw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bendystraw.d.ts","sourceRoot":"","sources":["../../../src/utils/bendystraw.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,6BAA6B,QAAkB,CAAC;AAC7D,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAKX,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AACtD,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AACzE,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC;AAEpE,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC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,oBAAoB,EACzB,IAAI,EAAE,SAAS,oBAAoB,EAAE,GACpC,OAAO,CAmBT;AA6DD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EACP,UAAU,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAEjD,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,OAAO,GAAE,wBAAwB,CAAC,OAAO,EAAE,UAAU,CAAM,GAC1D,OAAO,CAAC,OAAO,CAAC,CAmHlB"}
@@ -0,0 +1,379 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BendystrawRequestError = exports.BENDYSTRAW_CACHE_TTL_MS = exports.BENDYSTRAW_PROJECT_REF_BATCH_SIZE = exports.MAX_BENDYSTRAW_RESPONSE_BYTES = exports.BENDYSTRAW_TIMEOUT_MS = void 0;
4
+ exports.resolveBendystrawNetwork = resolveBendystrawNetwork;
5
+ exports.normalizeBendystrawEndpoint = normalizeBendystrawEndpoint;
6
+ exports.selectBendystrawEndpoint = selectBendystrawEndpoint;
7
+ exports.isBendystrawRecord = isBendystrawRecord;
8
+ exports.bendystrawDataHasFields = bendystrawDataHasFields;
9
+ exports.assertBendystrawData = assertBendystrawData;
10
+ exports.assertBendystrawVariables = assertBendystrawVariables;
11
+ exports.bendystrawCacheTtl = bendystrawCacheTtl;
12
+ exports.bendystrawProjectRefFilter = bendystrawProjectRefFilter;
13
+ exports.bendystrawProjectRefsFilter = bendystrawProjectRefsFilter;
14
+ exports.bendystrawProjectRefsFilters = bendystrawProjectRefsFilters;
15
+ exports.matchesBendystrawProjectRef = matchesBendystrawProjectRef;
16
+ exports.requestBendystraw = requestBendystraw;
17
+ const constants_js_1 = require("../constants.js");
18
+ exports.BENDYSTRAW_TIMEOUT_MS = 15_000;
19
+ exports.MAX_BENDYSTRAW_RESPONSE_BYTES = 5 * 1024 * 1024;
20
+ exports.BENDYSTRAW_PROJECT_REF_BATCH_SIZE = 200;
21
+ exports.BENDYSTRAW_CACHE_TTL_MS = {
22
+ live: 15_000,
23
+ standard: 30_000,
24
+ stable: 60_000,
25
+ };
26
+ const RETRY_DELAYS_MS = [250, 750];
27
+ const RETRYABLE_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
28
+ class BendystrawRequestError extends Error {
29
+ constructor(message, status) {
30
+ super(message);
31
+ this.status = status;
32
+ this.name = "BendystrawRequestError";
33
+ }
34
+ }
35
+ exports.BendystrawRequestError = BendystrawRequestError;
36
+ function collectBendystrawChainIds(value, chainIds, depth = 0) {
37
+ if (value === null || typeof value !== "object")
38
+ return;
39
+ if (depth > 12) {
40
+ throw new TypeError("Bendystraw variables exceed the nesting limit");
41
+ }
42
+ if (Array.isArray(value)) {
43
+ for (const item of value) {
44
+ collectBendystrawChainIds(item, chainIds, depth + 1);
45
+ }
46
+ return;
47
+ }
48
+ for (const [key, item] of Object.entries(value)) {
49
+ if (key === "chainId" || key === "chainId_in") {
50
+ const candidates = Array.isArray(item) ? item : [item];
51
+ for (const candidate of candidates) {
52
+ const chainId = typeof candidate === "string" && candidate.trim()
53
+ ? Number(candidate)
54
+ : candidate;
55
+ if (!Number.isSafeInteger(chainId) || Number(chainId) <= 0) {
56
+ throw new TypeError(`Invalid Bendystraw ${key}`);
57
+ }
58
+ chainIds.add(Number(chainId));
59
+ }
60
+ }
61
+ else {
62
+ collectBendystrawChainIds(item, chainIds, depth + 1);
63
+ }
64
+ }
65
+ }
66
+ function networkForChainId(chainId) {
67
+ const metadata = constants_js_1.JB_CHAINS[chainId];
68
+ if (!metadata) {
69
+ throw new TypeError(`Unsupported Bendystraw chain ID: ${chainId}`);
70
+ }
71
+ return metadata.chain.testnet ? "testnet" : "mainnet";
72
+ }
73
+ /**
74
+ * Resolve the Bendystraw network for an operation from every chain selector in
75
+ * its variables. Unknown chains, mixed networks, and explicit contradictions
76
+ * fail closed instead of silently querying the wrong index.
77
+ */
78
+ function resolveBendystrawNetwork(selection = {}) {
79
+ const chainIds = new Set();
80
+ if (selection.chainId !== undefined) {
81
+ if (!Number.isSafeInteger(selection.chainId) || selection.chainId <= 0) {
82
+ throw new TypeError("Invalid Bendystraw chainId");
83
+ }
84
+ chainIds.add(selection.chainId);
85
+ }
86
+ collectBendystrawChainIds(selection.variables, chainIds);
87
+ const inferred = new Set([...chainIds].map((chainId) => networkForChainId(chainId)));
88
+ if (inferred.size > 1) {
89
+ throw new TypeError("A Bendystraw request cannot mix mainnet and testnet chains");
90
+ }
91
+ const inferredNetwork = [...inferred][0];
92
+ if (selection.network &&
93
+ inferredNetwork &&
94
+ selection.network !== inferredNetwork) {
95
+ throw new TypeError(`Bendystraw network ${selection.network} conflicts with ${inferredNetwork} chain variables`);
96
+ }
97
+ return (selection.network ??
98
+ inferredNetwork ??
99
+ selection.defaultNetwork ??
100
+ "mainnet");
101
+ }
102
+ /** Normalize a Bendystraw origin or endpoint to one canonical GraphQL URL. */
103
+ function normalizeBendystrawEndpoint(endpoint) {
104
+ const url = new URL(endpoint);
105
+ if (url.protocol !== "https:" && url.protocol !== "http:") {
106
+ throw new TypeError("Bendystraw endpoint must use HTTP or HTTPS");
107
+ }
108
+ url.pathname = `${url.pathname
109
+ .replace(/\/graphql\/?$/u, "")
110
+ .replace(/\/$/u, "")}/graphql`;
111
+ url.search = "";
112
+ url.hash = "";
113
+ return url.toString();
114
+ }
115
+ /** Select and normalize the endpoint for the operation's resolved network. */
116
+ function selectBendystrawEndpoint(endpoints, selection = {}) {
117
+ return normalizeBendystrawEndpoint(endpoints[resolveBendystrawNetwork(selection)]);
118
+ }
119
+ function isBendystrawRecord(value) {
120
+ return value !== null && typeof value === "object" && !Array.isArray(value);
121
+ }
122
+ /** Build a lightweight guard for the required root fields of an operation. */
123
+ function bendystrawDataHasFields(...fields) {
124
+ return (value) => isBendystrawRecord(value) &&
125
+ fields.every((field) => Object.prototype.hasOwnProperty.call(value, field));
126
+ }
127
+ function assertBendystrawData(value, validator, operationName = "Bendystraw operation") {
128
+ if (!validator(value)) {
129
+ throw new BendystrawRequestError(`${operationName} returned invalid data`, 502);
130
+ }
131
+ return value;
132
+ }
133
+ function assertBendystrawVariables(value, validator, operationName = "Bendystraw operation") {
134
+ if (!validator(value)) {
135
+ throw new BendystrawRequestError(`${operationName} received invalid variables`, 400);
136
+ }
137
+ return value;
138
+ }
139
+ /**
140
+ * Shared freshness vocabulary for clients. The transport does not cache.
141
+ *
142
+ * - `live`: balances, activity, and mutable project state.
143
+ * - `standard`: lists, search, and aggregate charts.
144
+ * - `stable`: metadata and historical records.
145
+ *
146
+ * Writes should invalidate affected reads. An indexer failure may fall back to
147
+ * an authoritative RPC read only when the fallback preserves the same scoped
148
+ * identity; failures must never be converted into zero or empty data.
149
+ */
150
+ function bendystrawCacheTtl(policy) {
151
+ return exports.BENDYSTRAW_CACHE_TTL_MS[policy];
152
+ }
153
+ function normalizeProjectRef(ref) {
154
+ const version = ref.version ?? 6;
155
+ if (!Number.isSafeInteger(ref.chainId) ||
156
+ ref.chainId <= 0 ||
157
+ !Number.isSafeInteger(ref.projectId) ||
158
+ ref.projectId <= 0 ||
159
+ !Number.isSafeInteger(version) ||
160
+ version <= 0) {
161
+ throw new TypeError("Invalid Bendystraw project reference");
162
+ }
163
+ return { chainId: ref.chainId, projectId: ref.projectId, version };
164
+ }
165
+ /**
166
+ * Build an explicit conjunction for one versioned deployment. Keeping each
167
+ * identity field in its own `AND` member prevents accidental project/chain
168
+ * cross-products when multiple deployments are combined with `OR`.
169
+ */
170
+ function bendystrawProjectRefFilter(ref) {
171
+ const normalized = normalizeProjectRef(ref);
172
+ return {
173
+ AND: [
174
+ { chainId: normalized.chainId },
175
+ { projectId: normalized.projectId },
176
+ { version: normalized.version },
177
+ ],
178
+ };
179
+ }
180
+ /**
181
+ * Build an exact filter for one or more deployments. An empty list throws
182
+ * instead of silently producing a broad, unscoped indexer query.
183
+ */
184
+ function bendystrawProjectRefsFilter(refs) {
185
+ const unique = new Map();
186
+ for (const ref of refs) {
187
+ const normalized = normalizeProjectRef(ref);
188
+ unique.set(`${normalized.chainId}:${normalized.projectId}:${normalized.version}`, normalized);
189
+ }
190
+ const filters = [...unique.values()].map(bendystrawProjectRefFilter);
191
+ if (filters.length === 0) {
192
+ throw new TypeError("At least one Bendystraw project reference is required");
193
+ }
194
+ return filters.length === 1 ? filters[0] : { OR: filters };
195
+ }
196
+ /**
197
+ * Build independently queryable exact-deployment filters without handing an
198
+ * indexer one unbounded `OR`. Empty input produces no queries; malformed refs
199
+ * still fail closed.
200
+ */
201
+ function bendystrawProjectRefsFilters(refs, batchSize = exports.BENDYSTRAW_PROJECT_REF_BATCH_SIZE) {
202
+ if (!Number.isSafeInteger(batchSize) || batchSize <= 0) {
203
+ throw new TypeError("batchSize must be a positive safe integer");
204
+ }
205
+ const unique = new Map();
206
+ for (const ref of refs) {
207
+ const normalized = normalizeProjectRef(ref);
208
+ unique.set(`${normalized.chainId}:${normalized.projectId}:${normalized.version}`, normalized);
209
+ }
210
+ const normalized = [...unique.values()];
211
+ const batches = [];
212
+ for (let index = 0; index < normalized.length; index += batchSize) {
213
+ batches.push({
214
+ OR: normalized
215
+ .slice(index, index + batchSize)
216
+ .map(bendystrawProjectRefFilter),
217
+ });
218
+ }
219
+ return batches;
220
+ }
221
+ /**
222
+ * Verify that an indexer row belongs to one of the requested deployments.
223
+ * Use this at the response boundary as defense in depth against stale schemas,
224
+ * permissive filters, and indexer regressions.
225
+ */
226
+ function matchesBendystrawProjectRef(row, refs) {
227
+ const chainId = Number(row.chainId);
228
+ const projectId = Number(row.projectId);
229
+ const version = Number(row.version);
230
+ if (!Number.isSafeInteger(chainId) ||
231
+ !Number.isSafeInteger(projectId) ||
232
+ !Number.isSafeInteger(version)) {
233
+ return false;
234
+ }
235
+ return refs.some((ref) => {
236
+ const normalized = normalizeProjectRef(ref);
237
+ return (chainId === normalized.chainId &&
238
+ projectId === normalized.projectId &&
239
+ version === normalized.version);
240
+ });
241
+ }
242
+ async function readBoundedBody(response, maxResponseBytes) {
243
+ const declaredSize = Number(response.headers.get("content-length") ?? 0);
244
+ if (Number.isFinite(declaredSize) && declaredSize > maxResponseBytes) {
245
+ await response.body?.cancel();
246
+ throw new BendystrawRequestError("Bendystraw response exceeds the size limit", 502);
247
+ }
248
+ if (!response.headers.get("content-type")?.toLowerCase().includes("json")) {
249
+ await response.body?.cancel();
250
+ throw new BendystrawRequestError("Bendystraw returned an invalid content type", 502);
251
+ }
252
+ if (!response.body)
253
+ return new Uint8Array();
254
+ const reader = response.body.getReader();
255
+ const chunks = [];
256
+ let total = 0;
257
+ try {
258
+ for (;;) {
259
+ const { done, value } = await reader.read();
260
+ if (done)
261
+ break;
262
+ total += value.byteLength;
263
+ if (total > maxResponseBytes) {
264
+ await reader.cancel("Bendystraw response exceeds the size limit");
265
+ throw new BendystrawRequestError("Bendystraw response exceeds the size limit", 502);
266
+ }
267
+ chunks.push(value);
268
+ }
269
+ }
270
+ finally {
271
+ reader.releaseLock();
272
+ }
273
+ const body = new Uint8Array(total);
274
+ let offset = 0;
275
+ for (const chunk of chunks) {
276
+ body.set(chunk, offset);
277
+ offset += chunk.byteLength;
278
+ }
279
+ return body;
280
+ }
281
+ function abortName(error) {
282
+ return error instanceof Error ? error.name : undefined;
283
+ }
284
+ function delay(milliseconds) {
285
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
286
+ }
287
+ /**
288
+ * Execute a bounded, timeout-protected Bendystraw GraphQL request.
289
+ *
290
+ * The helper retries only transient transport failures. GraphQL errors,
291
+ * invalid envelopes, invalid content types, oversized bodies, and caller
292
+ * cancellation fail closed without being retried.
293
+ */
294
+ async function requestBendystraw(endpoint, query, variables, options = {}) {
295
+ const fetchImpl = options.fetch ?? fetch;
296
+ const maxResponseBytes = options.maxResponseBytes ?? exports.MAX_BENDYSTRAW_RESPONSE_BYTES;
297
+ const retryDelaysMs = options.retryDelaysMs ?? RETRY_DELAYS_MS;
298
+ const timeoutMs = options.timeoutMs ?? exports.BENDYSTRAW_TIMEOUT_MS;
299
+ if (!Number.isSafeInteger(maxResponseBytes) || maxResponseBytes <= 0) {
300
+ throw new TypeError("maxResponseBytes must be a positive safe integer");
301
+ }
302
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
303
+ throw new TypeError("timeoutMs must be positive");
304
+ }
305
+ if (options.validateVariables) {
306
+ assertBendystrawVariables(variables, options.validateVariables, options.operationName);
307
+ }
308
+ for (let attempt = 0;; attempt += 1) {
309
+ const controller = new AbortController();
310
+ const abort = () => controller.abort(options.signal?.reason);
311
+ options.signal?.addEventListener("abort", abort, { once: true });
312
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
313
+ try {
314
+ if (options.signal?.aborted)
315
+ abort();
316
+ const response = await fetchImpl(endpoint, {
317
+ method: "POST",
318
+ headers: {
319
+ Accept: "application/graphql-response+json, application/json",
320
+ "Content-Type": "application/json",
321
+ },
322
+ body: JSON.stringify({
323
+ query,
324
+ variables,
325
+ ...(options.operationName
326
+ ? { operationName: options.operationName }
327
+ : {}),
328
+ }),
329
+ signal: controller.signal,
330
+ });
331
+ if (RETRYABLE_STATUSES.has(response.status) &&
332
+ attempt < retryDelaysMs.length) {
333
+ await response.body?.cancel();
334
+ }
335
+ else {
336
+ const bytes = await readBoundedBody(response, maxResponseBytes);
337
+ let envelope;
338
+ try {
339
+ envelope = JSON.parse(new TextDecoder().decode(bytes));
340
+ }
341
+ catch {
342
+ throw new BendystrawRequestError("Bendystraw returned invalid JSON", 502);
343
+ }
344
+ if (!response.ok) {
345
+ throw new BendystrawRequestError(`Bendystraw request failed (${response.status})`, response.status);
346
+ }
347
+ const message = envelope.errors?.find((error) => typeof error?.message === "string")?.message;
348
+ if (envelope.errors?.length) {
349
+ throw new BendystrawRequestError(typeof message === "string"
350
+ ? message.slice(0, 500)
351
+ : "Bendystraw query failed", 502);
352
+ }
353
+ if (!Object.prototype.hasOwnProperty.call(envelope, "data")) {
354
+ throw new BendystrawRequestError("Bendystraw response is missing data", 502);
355
+ }
356
+ const data = envelope.data;
357
+ return options.validateData
358
+ ? assertBendystrawData(data, options.validateData, options.operationName)
359
+ : data;
360
+ }
361
+ }
362
+ catch (error) {
363
+ const aborted = options.signal?.aborted ||
364
+ abortName(error) === "AbortError" ||
365
+ abortName(error) === "TimeoutError";
366
+ if (aborted ||
367
+ error instanceof BendystrawRequestError ||
368
+ attempt >= retryDelaysMs.length) {
369
+ throw error;
370
+ }
371
+ }
372
+ finally {
373
+ clearTimeout(timeout);
374
+ options.signal?.removeEventListener("abort", abort);
375
+ }
376
+ await delay(retryDelaysMs[attempt]);
377
+ }
378
+ }
379
+ //# sourceMappingURL=bendystraw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bendystraw.js","sourceRoot":"","sources":["../../../src/utils/bendystraw.ts"],"names":[],"mappings":";;;AAkHA,4DAoCC;AAGD,kEAWC;AAGD,4DAOC;AAED,gDAIC;AAGD,0DAMC;AAED,oDAYC;AAED,8DAYC;AAaD,gDAEC;AAwBD,gEAWC;AAMD,kEAkBC;AAOD,oEA2BC;AAOD,kEAsBC;AAoED,8CA2HC;AAjiBD,kDAA4C;AAE/B,QAAA,qBAAqB,GAAG,MAAM,CAAC;AAC/B,QAAA,6BAA6B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,QAAA,iCAAiC,GAAG,GAAG,CAAC;AACxC,QAAA,uBAAuB,GAAG;IACrC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;CACN,CAAC;AAEX,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,CAAU,CAAC;AAC5C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AA+BnE,MAAa,sBAAuB,SAAQ,KAAK;IAC/C,YACE,OAAe,EACN,MAAe;QAExB,KAA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AC,OAAO,CAAC,CAAC;YACtB,OAAO,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./contracts.js";
2
+ export * from "./bendystraw.js";
2
3
  export * from "./data.js";
3
4
  export * from "./debug.js";
4
5
  export * from "./deploy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./contracts.js"), exports);
18
+ __exportStar(require("./bendystraw.js"), exports);
18
19
  __exportStar(require("./data.js"), exports);
19
20
  __exportStar(require("./debug.js"), exports);
20
21
  __exportStar(require("./deploy.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,kDAAgC;AAChC,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC;AAChC,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,kDAAgC;AAChC,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
@@ -0,0 +1,105 @@
1
+ export declare const BENDYSTRAW_TIMEOUT_MS = 15000;
2
+ export declare const MAX_BENDYSTRAW_RESPONSE_BYTES: number;
3
+ export declare const BENDYSTRAW_PROJECT_REF_BATCH_SIZE = 200;
4
+ export declare const BENDYSTRAW_CACHE_TTL_MS: {
5
+ readonly live: 15000;
6
+ readonly standard: 30000;
7
+ readonly stable: 60000;
8
+ };
9
+ export type BendystrawFilter = Record<string, unknown>;
10
+ export type BendystrawNetwork = "mainnet" | "testnet";
11
+ export type BendystrawCachePolicy = keyof typeof BENDYSTRAW_CACHE_TTL_MS;
12
+ export type BendystrawValidator<T> = (value: unknown) => value is T;
13
+ export type BendystrawNetworkSelection = {
14
+ chainId?: number;
15
+ defaultNetwork?: BendystrawNetwork;
16
+ network?: BendystrawNetwork;
17
+ variables?: unknown;
18
+ };
19
+ export type BendystrawEndpoints = {
20
+ mainnet: string;
21
+ testnet: string;
22
+ };
23
+ export type BendystrawProjectRef = {
24
+ chainId: number;
25
+ projectId: number;
26
+ version?: number;
27
+ };
28
+ export type BendystrawProjectRow = {
29
+ chainId?: unknown;
30
+ projectId?: unknown;
31
+ version?: unknown;
32
+ };
33
+ export declare class BendystrawRequestError extends Error {
34
+ readonly status?: number | undefined;
35
+ constructor(message: string, status?: number | undefined);
36
+ }
37
+ export type BendystrawRequestOptions<TResult = unknown, TVariables extends object = Record<string, never>> = {
38
+ fetch?: typeof fetch;
39
+ maxResponseBytes?: number;
40
+ operationName?: string;
41
+ retryDelaysMs?: readonly number[];
42
+ signal?: AbortSignal;
43
+ timeoutMs?: number;
44
+ validateData?: BendystrawValidator<TResult>;
45
+ validateVariables?: BendystrawValidator<TVariables>;
46
+ };
47
+ /**
48
+ * Resolve the Bendystraw network for an operation from every chain selector in
49
+ * its variables. Unknown chains, mixed networks, and explicit contradictions
50
+ * fail closed instead of silently querying the wrong index.
51
+ */
52
+ export declare function resolveBendystrawNetwork(selection?: BendystrawNetworkSelection): BendystrawNetwork;
53
+ /** Normalize a Bendystraw origin or endpoint to one canonical GraphQL URL. */
54
+ export declare function normalizeBendystrawEndpoint(endpoint: string): string;
55
+ /** Select and normalize the endpoint for the operation's resolved network. */
56
+ export declare function selectBendystrawEndpoint(endpoints: BendystrawEndpoints, selection?: BendystrawNetworkSelection): string;
57
+ export declare function isBendystrawRecord(value: unknown): value is Record<string, unknown>;
58
+ /** Build a lightweight guard for the required root fields of an operation. */
59
+ export declare function bendystrawDataHasFields<const TKey extends string>(...fields: readonly TKey[]): BendystrawValidator<Record<TKey, unknown>>;
60
+ export declare function assertBendystrawData<T>(value: unknown, validator: BendystrawValidator<T>, operationName?: string): T;
61
+ export declare function assertBendystrawVariables<T extends object>(value: unknown, validator: BendystrawValidator<T>, operationName?: string): T;
62
+ /**
63
+ * Shared freshness vocabulary for clients. The transport does not cache.
64
+ *
65
+ * - `live`: balances, activity, and mutable project state.
66
+ * - `standard`: lists, search, and aggregate charts.
67
+ * - `stable`: metadata and historical records.
68
+ *
69
+ * Writes should invalidate affected reads. An indexer failure may fall back to
70
+ * an authoritative RPC read only when the fallback preserves the same scoped
71
+ * identity; failures must never be converted into zero or empty data.
72
+ */
73
+ export declare function bendystrawCacheTtl(policy: BendystrawCachePolicy): number;
74
+ /**
75
+ * Build an explicit conjunction for one versioned deployment. Keeping each
76
+ * identity field in its own `AND` member prevents accidental project/chain
77
+ * cross-products when multiple deployments are combined with `OR`.
78
+ */
79
+ export declare function bendystrawProjectRefFilter(ref: BendystrawProjectRef): BendystrawFilter;
80
+ /**
81
+ * Build an exact filter for one or more deployments. An empty list throws
82
+ * instead of silently producing a broad, unscoped indexer query.
83
+ */
84
+ export declare function bendystrawProjectRefsFilter(refs: readonly BendystrawProjectRef[]): BendystrawFilter;
85
+ /**
86
+ * Build independently queryable exact-deployment filters without handing an
87
+ * indexer one unbounded `OR`. Empty input produces no queries; malformed refs
88
+ * still fail closed.
89
+ */
90
+ export declare function bendystrawProjectRefsFilters(refs: readonly BendystrawProjectRef[], batchSize?: number): BendystrawFilter[];
91
+ /**
92
+ * Verify that an indexer row belongs to one of the requested deployments.
93
+ * Use this at the response boundary as defense in depth against stale schemas,
94
+ * permissive filters, and indexer regressions.
95
+ */
96
+ export declare function matchesBendystrawProjectRef(row: BendystrawProjectRow, refs: readonly BendystrawProjectRef[]): boolean;
97
+ /**
98
+ * Execute a bounded, timeout-protected Bendystraw GraphQL request.
99
+ *
100
+ * The helper retries only transient transport failures. GraphQL errors,
101
+ * invalid envelopes, invalid content types, oversized bodies, and caller
102
+ * cancellation fail closed without being retried.
103
+ */
104
+ export declare function requestBendystraw<TResult, TVariables extends object = Record<string, never>>(endpoint: string, query: string, variables: TVariables, options?: BendystrawRequestOptions<TResult, TVariables>): Promise<TResult>;
105
+ //# sourceMappingURL=bendystraw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bendystraw.d.ts","sourceRoot":"","sources":["../../../src/utils/bendystraw.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,6BAA6B,QAAkB,CAAC;AAC7D,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAKX,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AACtD,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AACzE,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC;AAEpE,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OA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4
+ export const BENDYSTRAW_PROJECT_REF_BATCH_SIZE = 200;
5
+ export const BENDYSTRAW_CACHE_TTL_MS = {
6
+ live: 15_000,
7
+ standard: 30_000,
8
+ stable: 60_000,
9
+ };
10
+ const RETRY_DELAYS_MS = [250, 750];
11
+ const RETRYABLE_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
12
+ export class BendystrawRequestError extends Error {
13
+ constructor(message, status) {
14
+ super(message);
15
+ this.status = status;
16
+ this.name = "BendystrawRequestError";
17
+ }
18
+ }
19
+ function collectBendystrawChainIds(value, chainIds, depth = 0) {
20
+ if (value === null || typeof value !== "object")
21
+ return;
22
+ if (depth > 12) {
23
+ throw new TypeError("Bendystraw variables exceed the nesting limit");
24
+ }
25
+ if (Array.isArray(value)) {
26
+ for (const item of value) {
27
+ collectBendystrawChainIds(item, chainIds, depth + 1);
28
+ }
29
+ return;
30
+ }
31
+ for (const [key, item] of Object.entries(value)) {
32
+ if (key === "chainId" || key === "chainId_in") {
33
+ const candidates = Array.isArray(item) ? item : [item];
34
+ for (const candidate of candidates) {
35
+ const chainId = typeof candidate === "string" && candidate.trim()
36
+ ? Number(candidate)
37
+ : candidate;
38
+ if (!Number.isSafeInteger(chainId) || Number(chainId) <= 0) {
39
+ throw new TypeError(`Invalid Bendystraw ${key}`);
40
+ }
41
+ chainIds.add(Number(chainId));
42
+ }
43
+ }
44
+ else {
45
+ collectBendystrawChainIds(item, chainIds, depth + 1);
46
+ }
47
+ }
48
+ }
49
+ function networkForChainId(chainId) {
50
+ const metadata = JB_CHAINS[chainId];
51
+ if (!metadata) {
52
+ throw new TypeError(`Unsupported Bendystraw chain ID: ${chainId}`);
53
+ }
54
+ return metadata.chain.testnet ? "testnet" : "mainnet";
55
+ }
56
+ /**
57
+ * Resolve the Bendystraw network for an operation from every chain selector in
58
+ * its variables. Unknown chains, mixed networks, and explicit contradictions
59
+ * fail closed instead of silently querying the wrong index.
60
+ */
61
+ export function resolveBendystrawNetwork(selection = {}) {
62
+ const chainIds = new Set();
63
+ if (selection.chainId !== undefined) {
64
+ if (!Number.isSafeInteger(selection.chainId) || selection.chainId <= 0) {
65
+ throw new TypeError("Invalid Bendystraw chainId");
66
+ }
67
+ chainIds.add(selection.chainId);
68
+ }
69
+ collectBendystrawChainIds(selection.variables, chainIds);
70
+ const inferred = new Set([...chainIds].map((chainId) => networkForChainId(chainId)));
71
+ if (inferred.size > 1) {
72
+ throw new TypeError("A Bendystraw request cannot mix mainnet and testnet chains");
73
+ }
74
+ const inferredNetwork = [...inferred][0];
75
+ if (selection.network &&
76
+ inferredNetwork &&
77
+ selection.network !== inferredNetwork) {
78
+ throw new TypeError(`Bendystraw network ${selection.network} conflicts with ${inferredNetwork} chain variables`);
79
+ }
80
+ return (selection.network ??
81
+ inferredNetwork ??
82
+ selection.defaultNetwork ??
83
+ "mainnet");
84
+ }
85
+ /** Normalize a Bendystraw origin or endpoint to one canonical GraphQL URL. */
86
+ export function normalizeBendystrawEndpoint(endpoint) {
87
+ const url = new URL(endpoint);
88
+ if (url.protocol !== "https:" && url.protocol !== "http:") {
89
+ throw new TypeError("Bendystraw endpoint must use HTTP or HTTPS");
90
+ }
91
+ url.pathname = `${url.pathname
92
+ .replace(/\/graphql\/?$/u, "")
93
+ .replace(/\/$/u, "")}/graphql`;
94
+ url.search = "";
95
+ url.hash = "";
96
+ return url.toString();
97
+ }
98
+ /** Select and normalize the endpoint for the operation's resolved network. */
99
+ export function selectBendystrawEndpoint(endpoints, selection = {}) {
100
+ return normalizeBendystrawEndpoint(endpoints[resolveBendystrawNetwork(selection)]);
101
+ }
102
+ export function isBendystrawRecord(value) {
103
+ return value !== null && typeof value === "object" && !Array.isArray(value);
104
+ }
105
+ /** Build a lightweight guard for the required root fields of an operation. */
106
+ export function bendystrawDataHasFields(...fields) {
107
+ return (value) => isBendystrawRecord(value) &&
108
+ fields.every((field) => Object.prototype.hasOwnProperty.call(value, field));
109
+ }
110
+ export function assertBendystrawData(value, validator, operationName = "Bendystraw operation") {
111
+ if (!validator(value)) {
112
+ throw new BendystrawRequestError(`${operationName} returned invalid data`, 502);
113
+ }
114
+ return value;
115
+ }
116
+ export function assertBendystrawVariables(value, validator, operationName = "Bendystraw operation") {
117
+ if (!validator(value)) {
118
+ throw new BendystrawRequestError(`${operationName} received invalid variables`, 400);
119
+ }
120
+ return value;
121
+ }
122
+ /**
123
+ * Shared freshness vocabulary for clients. The transport does not cache.
124
+ *
125
+ * - `live`: balances, activity, and mutable project state.
126
+ * - `standard`: lists, search, and aggregate charts.
127
+ * - `stable`: metadata and historical records.
128
+ *
129
+ * Writes should invalidate affected reads. An indexer failure may fall back to
130
+ * an authoritative RPC read only when the fallback preserves the same scoped
131
+ * identity; failures must never be converted into zero or empty data.
132
+ */
133
+ export function bendystrawCacheTtl(policy) {
134
+ return BENDYSTRAW_CACHE_TTL_MS[policy];
135
+ }
136
+ function normalizeProjectRef(ref) {
137
+ const version = ref.version ?? 6;
138
+ if (!Number.isSafeInteger(ref.chainId) ||
139
+ ref.chainId <= 0 ||
140
+ !Number.isSafeInteger(ref.projectId) ||
141
+ ref.projectId <= 0 ||
142
+ !Number.isSafeInteger(version) ||
143
+ version <= 0) {
144
+ throw new TypeError("Invalid Bendystraw project reference");
145
+ }
146
+ return { chainId: ref.chainId, projectId: ref.projectId, version };
147
+ }
148
+ /**
149
+ * Build an explicit conjunction for one versioned deployment. Keeping each
150
+ * identity field in its own `AND` member prevents accidental project/chain
151
+ * cross-products when multiple deployments are combined with `OR`.
152
+ */
153
+ export function bendystrawProjectRefFilter(ref) {
154
+ const normalized = normalizeProjectRef(ref);
155
+ return {
156
+ AND: [
157
+ { chainId: normalized.chainId },
158
+ { projectId: normalized.projectId },
159
+ { version: normalized.version },
160
+ ],
161
+ };
162
+ }
163
+ /**
164
+ * Build an exact filter for one or more deployments. An empty list throws
165
+ * instead of silently producing a broad, unscoped indexer query.
166
+ */
167
+ export function bendystrawProjectRefsFilter(refs) {
168
+ const unique = new Map();
169
+ for (const ref of refs) {
170
+ const normalized = normalizeProjectRef(ref);
171
+ unique.set(`${normalized.chainId}:${normalized.projectId}:${normalized.version}`, normalized);
172
+ }
173
+ const filters = [...unique.values()].map(bendystrawProjectRefFilter);
174
+ if (filters.length === 0) {
175
+ throw new TypeError("At least one Bendystraw project reference is required");
176
+ }
177
+ return filters.length === 1 ? filters[0] : { OR: filters };
178
+ }
179
+ /**
180
+ * Build independently queryable exact-deployment filters without handing an
181
+ * indexer one unbounded `OR`. Empty input produces no queries; malformed refs
182
+ * still fail closed.
183
+ */
184
+ export function bendystrawProjectRefsFilters(refs, batchSize = BENDYSTRAW_PROJECT_REF_BATCH_SIZE) {
185
+ if (!Number.isSafeInteger(batchSize) || batchSize <= 0) {
186
+ throw new TypeError("batchSize must be a positive safe integer");
187
+ }
188
+ const unique = new Map();
189
+ for (const ref of refs) {
190
+ const normalized = normalizeProjectRef(ref);
191
+ unique.set(`${normalized.chainId}:${normalized.projectId}:${normalized.version}`, normalized);
192
+ }
193
+ const normalized = [...unique.values()];
194
+ const batches = [];
195
+ for (let index = 0; index < normalized.length; index += batchSize) {
196
+ batches.push({
197
+ OR: normalized
198
+ .slice(index, index + batchSize)
199
+ .map(bendystrawProjectRefFilter),
200
+ });
201
+ }
202
+ return batches;
203
+ }
204
+ /**
205
+ * Verify that an indexer row belongs to one of the requested deployments.
206
+ * Use this at the response boundary as defense in depth against stale schemas,
207
+ * permissive filters, and indexer regressions.
208
+ */
209
+ export function matchesBendystrawProjectRef(row, refs) {
210
+ const chainId = Number(row.chainId);
211
+ const projectId = Number(row.projectId);
212
+ const version = Number(row.version);
213
+ if (!Number.isSafeInteger(chainId) ||
214
+ !Number.isSafeInteger(projectId) ||
215
+ !Number.isSafeInteger(version)) {
216
+ return false;
217
+ }
218
+ return refs.some((ref) => {
219
+ const normalized = normalizeProjectRef(ref);
220
+ return (chainId === normalized.chainId &&
221
+ projectId === normalized.projectId &&
222
+ version === normalized.version);
223
+ });
224
+ }
225
+ async function readBoundedBody(response, maxResponseBytes) {
226
+ const declaredSize = Number(response.headers.get("content-length") ?? 0);
227
+ if (Number.isFinite(declaredSize) && declaredSize > maxResponseBytes) {
228
+ await response.body?.cancel();
229
+ throw new BendystrawRequestError("Bendystraw response exceeds the size limit", 502);
230
+ }
231
+ if (!response.headers.get("content-type")?.toLowerCase().includes("json")) {
232
+ await response.body?.cancel();
233
+ throw new BendystrawRequestError("Bendystraw returned an invalid content type", 502);
234
+ }
235
+ if (!response.body)
236
+ return new Uint8Array();
237
+ const reader = response.body.getReader();
238
+ const chunks = [];
239
+ let total = 0;
240
+ try {
241
+ for (;;) {
242
+ const { done, value } = await reader.read();
243
+ if (done)
244
+ break;
245
+ total += value.byteLength;
246
+ if (total > maxResponseBytes) {
247
+ await reader.cancel("Bendystraw response exceeds the size limit");
248
+ throw new BendystrawRequestError("Bendystraw response exceeds the size limit", 502);
249
+ }
250
+ chunks.push(value);
251
+ }
252
+ }
253
+ finally {
254
+ reader.releaseLock();
255
+ }
256
+ const body = new Uint8Array(total);
257
+ let offset = 0;
258
+ for (const chunk of chunks) {
259
+ body.set(chunk, offset);
260
+ offset += chunk.byteLength;
261
+ }
262
+ return body;
263
+ }
264
+ function abortName(error) {
265
+ return error instanceof Error ? error.name : undefined;
266
+ }
267
+ function delay(milliseconds) {
268
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
269
+ }
270
+ /**
271
+ * Execute a bounded, timeout-protected Bendystraw GraphQL request.
272
+ *
273
+ * The helper retries only transient transport failures. GraphQL errors,
274
+ * invalid envelopes, invalid content types, oversized bodies, and caller
275
+ * cancellation fail closed without being retried.
276
+ */
277
+ export async function requestBendystraw(endpoint, query, variables, options = {}) {
278
+ const fetchImpl = options.fetch ?? fetch;
279
+ const maxResponseBytes = options.maxResponseBytes ?? MAX_BENDYSTRAW_RESPONSE_BYTES;
280
+ const retryDelaysMs = options.retryDelaysMs ?? RETRY_DELAYS_MS;
281
+ const timeoutMs = options.timeoutMs ?? BENDYSTRAW_TIMEOUT_MS;
282
+ if (!Number.isSafeInteger(maxResponseBytes) || maxResponseBytes <= 0) {
283
+ throw new TypeError("maxResponseBytes must be a positive safe integer");
284
+ }
285
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
286
+ throw new TypeError("timeoutMs must be positive");
287
+ }
288
+ if (options.validateVariables) {
289
+ assertBendystrawVariables(variables, options.validateVariables, options.operationName);
290
+ }
291
+ for (let attempt = 0;; attempt += 1) {
292
+ const controller = new AbortController();
293
+ const abort = () => controller.abort(options.signal?.reason);
294
+ options.signal?.addEventListener("abort", abort, { once: true });
295
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
296
+ try {
297
+ if (options.signal?.aborted)
298
+ abort();
299
+ const response = await fetchImpl(endpoint, {
300
+ method: "POST",
301
+ headers: {
302
+ Accept: "application/graphql-response+json, application/json",
303
+ "Content-Type": "application/json",
304
+ },
305
+ body: JSON.stringify({
306
+ query,
307
+ variables,
308
+ ...(options.operationName
309
+ ? { operationName: options.operationName }
310
+ : {}),
311
+ }),
312
+ signal: controller.signal,
313
+ });
314
+ if (RETRYABLE_STATUSES.has(response.status) &&
315
+ attempt < retryDelaysMs.length) {
316
+ await response.body?.cancel();
317
+ }
318
+ else {
319
+ const bytes = await readBoundedBody(response, maxResponseBytes);
320
+ let envelope;
321
+ try {
322
+ envelope = JSON.parse(new TextDecoder().decode(bytes));
323
+ }
324
+ catch {
325
+ throw new BendystrawRequestError("Bendystraw returned invalid JSON", 502);
326
+ }
327
+ if (!response.ok) {
328
+ throw new BendystrawRequestError(`Bendystraw request failed (${response.status})`, response.status);
329
+ }
330
+ const message = envelope.errors?.find((error) => typeof error?.message === "string")?.message;
331
+ if (envelope.errors?.length) {
332
+ throw new BendystrawRequestError(typeof message === "string"
333
+ ? message.slice(0, 500)
334
+ : "Bendystraw query failed", 502);
335
+ }
336
+ if (!Object.prototype.hasOwnProperty.call(envelope, "data")) {
337
+ throw new BendystrawRequestError("Bendystraw response is missing data", 502);
338
+ }
339
+ const data = envelope.data;
340
+ return options.validateData
341
+ ? assertBendystrawData(data, options.validateData, options.operationName)
342
+ : data;
343
+ }
344
+ }
345
+ catch (error) {
346
+ const aborted = options.signal?.aborted ||
347
+ abortName(error) === "AbortError" ||
348
+ abortName(error) === "TimeoutError";
349
+ if (aborted ||
350
+ error instanceof BendystrawRequestError ||
351
+ attempt >= retryDelaysMs.length) {
352
+ throw error;
353
+ }
354
+ }
355
+ finally {
356
+ clearTimeout(timeout);
357
+ options.signal?.removeEventListener("abort", abort);
358
+ }
359
+ await delay(retryDelaysMs[attempt]);
360
+ }
361
+ }
362
+ //# sourceMappingURL=bendystraw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bendystraw.js","sourceRoot":"","sources":["../../../src/utils/bendystraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;CACN,CAAC;AAEX,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,CAAU,CAAC;AAC5C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AA+BnE,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YACE,OAAe,EACN,MAAe;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,WAAM,GAAN,MAAM,CAAS;QAGxB,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF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AAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./contracts.js";
2
+ export * from "./bendystraw.js";
2
3
  export * from "./data.js";
3
4
  export * from "./debug.js";
4
5
  export * from "./deploy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./contracts.js";
2
+ export * from "./bendystraw.js";
2
3
  export * from "./data.js";
3
4
  export * from "./debug.js";
4
5
  export * from "./deploy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/nana-sdk-core",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",