@tixprotocol/tdp-sdk 0.2.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/index.js ADDED
@@ -0,0 +1,503 @@
1
+ import {
2
+ AcceptClaimOffersRequestBodySchema,
3
+ AcceptClaimOffersResponseSchema,
4
+ ApiKeyHeadersSchema,
5
+ EventPathParametersSchema,
6
+ GetAddressResponseSchema,
7
+ IdempotencyKeyAndApiKeyHeadersSchema,
8
+ NoPathParametersSchema,
9
+ PostIntegratorMetadataRequestBodySchema,
10
+ PostTixIndexerIntegratorMetadataResultSchema,
11
+ SignTenantTransactionRequestBodySchema,
12
+ SignTransactionResponseSchema,
13
+ SubmitTenantTransactionRequestBodySchema,
14
+ SubmitTenantTransactionResponseSchema,
15
+ WalletPathParametersSchema,
16
+ defineClientRoute,
17
+ solanaDataApiClientRoutes,
18
+ tixIndexerReadApiClientRoutes
19
+ } from "./chunk-3SJAQTJ4.js";
20
+ import {
21
+ WalletCustodyApiError
22
+ } from "./chunk-RLIW34CX.js";
23
+
24
+ // src/solana-data-api/create-solana-client.ts
25
+ function createSolanaClient(tixApi) {
26
+ return {
27
+ getEvent(pathParams, options) {
28
+ return tixApi(
29
+ {
30
+ route: "get-event-account",
31
+ pathParams
32
+ },
33
+ options
34
+ );
35
+ },
36
+ getListing(pathParams, options) {
37
+ return tixApi(
38
+ {
39
+ route: "get-listing-account",
40
+ pathParams
41
+ },
42
+ options
43
+ );
44
+ },
45
+ getPermit(pathParams, options) {
46
+ return tixApi(
47
+ {
48
+ route: "get-permit",
49
+ pathParams
50
+ },
51
+ options
52
+ );
53
+ },
54
+ getProtocolConfig(options) {
55
+ return tixApi(
56
+ {
57
+ route: "get-protocol-config-account"
58
+ },
59
+ options
60
+ );
61
+ },
62
+ getIntegrator(pathParams, options) {
63
+ return tixApi(
64
+ {
65
+ route: "get-integrator-account",
66
+ pathParams
67
+ },
68
+ options
69
+ );
70
+ }
71
+ };
72
+ }
73
+
74
+ // ../tdp-schemas/src/tix-indexer-api/routes.ts
75
+ var POST_INTEGRATOR_METADATA_ROUTE_KEY = "POST /events/{eventId}/metadata";
76
+ var tixIndexerApiClientRoutes = {
77
+ ...tixIndexerReadApiClientRoutes,
78
+ "post-integrator-metadata": defineClientRoute({
79
+ name: "post-integrator-metadata",
80
+ method: "POST",
81
+ routeKey: POST_INTEGRATOR_METADATA_ROUTE_KEY,
82
+ pathParamsSchema: EventPathParametersSchema,
83
+ buildPath: ({ baseApiUrl = "", eventId }) => `${baseApiUrl}/events/${eventId}/metadata`,
84
+ headersSchema: ApiKeyHeadersSchema,
85
+ requestBodySchema: PostIntegratorMetadataRequestBodySchema,
86
+ responseBodySchema: PostTixIndexerIntegratorMetadataResultSchema
87
+ })
88
+ };
89
+ var responseBodySchemaByRouteKey2 = Object.fromEntries(
90
+ Object.values(tixIndexerApiClientRoutes).map(
91
+ (route) => [route.routeKey, route.responseBodySchema]
92
+ )
93
+ );
94
+
95
+ // src/utils/join-url-segments.ts
96
+ function joinUrlSegments(baseUrl, path) {
97
+ return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
98
+ }
99
+
100
+ // src/utils/read-response-payload.ts
101
+ async function readResponsePayload(response) {
102
+ const rawBody = await response.text();
103
+ if (rawBody.length === 0) return void 0;
104
+ try {
105
+ return JSON.parse(rawBody);
106
+ } catch {
107
+ return rawBody;
108
+ }
109
+ }
110
+
111
+ // src/routes/execute-client-route.ts
112
+ async function executeClientRoute({
113
+ baseApiUrl,
114
+ fetchImpl,
115
+ headers,
116
+ signal,
117
+ routeName,
118
+ route,
119
+ pathParams,
120
+ queryParams,
121
+ body,
122
+ routeHeadersInput,
123
+ createError
124
+ }) {
125
+ const path = route.buildPath(pathParams);
126
+ const routeHeaders = route.buildHeaders(routeHeadersInput);
127
+ const url = joinUrlSegments(baseApiUrl, path) + (queryParams === void 0 ? "" : route.buildQueryString(queryParams));
128
+ const requestHeaders = new Headers(headers);
129
+ requestHeaders.set("content-type", "application/json");
130
+ new Headers(routeHeaders).forEach((value, name) => {
131
+ requestHeaders.set(name, value);
132
+ });
133
+ const response = await fetchImpl(url, {
134
+ method: route.method,
135
+ ...signal === void 0 ? {} : { signal },
136
+ headers: Object.fromEntries(requestHeaders),
137
+ body: body === void 0 ? void 0 : route.buildJsonPayload(body)
138
+ });
139
+ const payload = await readResponsePayload(response);
140
+ const failure = {
141
+ route: routeName,
142
+ method: route.method,
143
+ path,
144
+ status: response.status,
145
+ statusText: response.statusText,
146
+ payload
147
+ };
148
+ if (!response.ok) throw createError({ kind: "http-status", ...failure });
149
+ const parsed = route.responseBodySchema.safeParse(payload);
150
+ if (!parsed.success) {
151
+ throw createError({
152
+ kind: "response-validation",
153
+ ...failure,
154
+ validationError: parsed.error
155
+ });
156
+ }
157
+ return parsed.data;
158
+ }
159
+
160
+ // src/tix-api/create-tix-api-client.ts
161
+ var SOLANA_DATA_API_PATH_PREFIX = "solana";
162
+ var TIX_INDEXER_API_PATH_PREFIX = "tix-indexer";
163
+ function createTixApiClientForRoutes({
164
+ routes,
165
+ baseApiUrl,
166
+ apiKey,
167
+ fetchImpl = fetch,
168
+ headers,
169
+ additionalHeaders
170
+ }) {
171
+ return async function fetchTixApi({
172
+ route,
173
+ pathParams,
174
+ queryParams,
175
+ body
176
+ }, { signal } = {}) {
177
+ const prefix = route in solanaDataApiClientRoutes ? SOLANA_DATA_API_PATH_PREFIX : TIX_INDEXER_API_PATH_PREFIX;
178
+ return executeClientRoute({
179
+ baseApiUrl: `${baseApiUrl}/${prefix}`,
180
+ fetchImpl,
181
+ headers,
182
+ signal,
183
+ routeName: route,
184
+ route: routes[route],
185
+ pathParams,
186
+ queryParams,
187
+ body,
188
+ routeHeadersInput: {
189
+ "x-api-key": typeof apiKey === "string" ? apiKey : await apiKey(),
190
+ ...additionalHeaders
191
+ },
192
+ createError: (failure) => new WalletCustodyApiError(failure)
193
+ });
194
+ };
195
+ }
196
+
197
+ // src/tix-api/api-client.ts
198
+ var tixApiClientRoutes = {
199
+ ...solanaDataApiClientRoutes,
200
+ ...tixIndexerApiClientRoutes
201
+ };
202
+ function createTixApiClient({
203
+ baseApiUrl,
204
+ apiKey,
205
+ fetchImpl = fetch,
206
+ headers
207
+ }) {
208
+ return createTixApiClientForRoutes({
209
+ routes: tixApiClientRoutes,
210
+ baseApiUrl,
211
+ apiKey,
212
+ fetchImpl,
213
+ headers
214
+ });
215
+ }
216
+
217
+ // src/tix-indexer-api/create-indexer-client.ts
218
+ function createIndexerClient(tixApi) {
219
+ return {
220
+ listActiveListings(queryParams = {}, options) {
221
+ return tixApi(
222
+ {
223
+ route: "get-active-listings",
224
+ queryParams
225
+ },
226
+ options
227
+ );
228
+ },
229
+ listUpcomingEvents(queryParams = {}, options) {
230
+ return tixApi(
231
+ {
232
+ route: "get-upcoming-events",
233
+ queryParams
234
+ },
235
+ options
236
+ );
237
+ },
238
+ updateEventMetadata({
239
+ eventId,
240
+ body
241
+ }, options) {
242
+ return tixApi(
243
+ {
244
+ route: "post-integrator-metadata",
245
+ pathParams: { eventId },
246
+ body
247
+ },
248
+ options
249
+ );
250
+ }
251
+ };
252
+ }
253
+
254
+ // ../tdp-schemas/src/wallet-custody/api-key-route-keys.ts
255
+ var GET_USER_ADDRESS_ROUTE_KEY = "GET /wallets/users/{subject}/address";
256
+ var GET_INTEGRATOR_ADDRESS_ROUTE_KEY = "GET /wallets/integrators/{subject}/address";
257
+ var SIGN_USER_TRANSACTION_ROUTE_KEY = "POST /wallets/users/{subject}/signatures";
258
+ var SIGN_INTEGRATOR_TRANSACTION_ROUTE_KEY = "POST /wallets/integrators/{subject}/signatures";
259
+ var SUBMIT_TENANT_TRANSACTION_ROUTE_KEY = "POST /transactions/submissions";
260
+ var ACCEPT_CLAIM_OFFERS_ROUTE_KEY = "POST /claim_wallets";
261
+ var GET_FEE_PAYER_ADDRESS_ROUTE_KEY = "GET /wallets/fee-payer/address";
262
+ var GET_PROTOCOL_AUTHORITY_ADDRESS_ROUTE_KEY = "GET /wallets/protocol-authority/address";
263
+
264
+ // ../tdp-schemas/src/wallet-custody/api-key-routes.ts
265
+ var apiKeyWalletCustodyApiClientRoutes = {
266
+ "get-user-address": defineClientRoute({
267
+ name: "get-user-address",
268
+ method: "GET",
269
+ routeKey: GET_USER_ADDRESS_ROUTE_KEY,
270
+ pathParamsSchema: WalletPathParametersSchema,
271
+ buildPath: ({ baseApiUrl = "", subject }) => `${baseApiUrl}/wallets/users/${subject}/address`,
272
+ headersSchema: ApiKeyHeadersSchema,
273
+ responseBodySchema: GetAddressResponseSchema
274
+ }),
275
+ "get-integrator-address": defineClientRoute({
276
+ name: "get-integrator-address",
277
+ method: "GET",
278
+ routeKey: GET_INTEGRATOR_ADDRESS_ROUTE_KEY,
279
+ pathParamsSchema: WalletPathParametersSchema,
280
+ buildPath: ({ baseApiUrl = "", subject }) => `${baseApiUrl}/wallets/integrators/${subject}/address`,
281
+ headersSchema: ApiKeyHeadersSchema,
282
+ responseBodySchema: GetAddressResponseSchema
283
+ }),
284
+ "sign-user-transaction": defineClientRoute({
285
+ name: "sign-user-transaction",
286
+ method: "POST",
287
+ routeKey: SIGN_USER_TRANSACTION_ROUTE_KEY,
288
+ pathParamsSchema: WalletPathParametersSchema,
289
+ buildPath: ({ baseApiUrl = "", subject }) => `${baseApiUrl}/wallets/users/${subject}/signatures`,
290
+ headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,
291
+ requestBodySchema: SignTenantTransactionRequestBodySchema,
292
+ responseBodySchema: SignTransactionResponseSchema
293
+ }),
294
+ "sign-integrator-transaction": defineClientRoute({
295
+ name: "sign-integrator-transaction",
296
+ method: "POST",
297
+ routeKey: SIGN_INTEGRATOR_TRANSACTION_ROUTE_KEY,
298
+ pathParamsSchema: WalletPathParametersSchema,
299
+ buildPath: ({ baseApiUrl = "", subject }) => `${baseApiUrl}/wallets/integrators/${subject}/signatures`,
300
+ headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,
301
+ requestBodySchema: SignTenantTransactionRequestBodySchema,
302
+ responseBodySchema: SignTransactionResponseSchema
303
+ }),
304
+ "submit-tenant-transaction": defineClientRoute({
305
+ name: "submit-tenant-transaction",
306
+ method: "POST",
307
+ routeKey: SUBMIT_TENANT_TRANSACTION_ROUTE_KEY,
308
+ pathParamsSchema: NoPathParametersSchema,
309
+ buildPath: ({ baseApiUrl = "" }) => `${baseApiUrl}/transactions/submissions`,
310
+ headersSchema: ApiKeyHeadersSchema,
311
+ requestBodySchema: SubmitTenantTransactionRequestBodySchema,
312
+ responseBodySchema: SubmitTenantTransactionResponseSchema
313
+ }),
314
+ "accept-claim-offers": defineClientRoute({
315
+ name: "accept-claim-offers",
316
+ method: "POST",
317
+ routeKey: ACCEPT_CLAIM_OFFERS_ROUTE_KEY,
318
+ pathParamsSchema: NoPathParametersSchema,
319
+ buildPath: ({ baseApiUrl = "" }) => `${baseApiUrl}/claim_wallets`,
320
+ headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,
321
+ requestBodySchema: AcceptClaimOffersRequestBodySchema,
322
+ responseBodySchema: AcceptClaimOffersResponseSchema
323
+ }),
324
+ "get-fee-payer-address": defineClientRoute({
325
+ name: "get-fee-payer-address",
326
+ method: "GET",
327
+ routeKey: GET_FEE_PAYER_ADDRESS_ROUTE_KEY,
328
+ pathParamsSchema: NoPathParametersSchema,
329
+ buildPath: ({ baseApiUrl = "" }) => `${baseApiUrl}/wallets/fee-payer/address`,
330
+ headersSchema: ApiKeyHeadersSchema,
331
+ responseBodySchema: GetAddressResponseSchema
332
+ }),
333
+ "get-protocol-authority-address": defineClientRoute({
334
+ name: "get-protocol-authority-address",
335
+ method: "GET",
336
+ routeKey: GET_PROTOCOL_AUTHORITY_ADDRESS_ROUTE_KEY,
337
+ pathParamsSchema: NoPathParametersSchema,
338
+ buildPath: ({ baseApiUrl = "" }) => `${baseApiUrl}/wallets/protocol-authority/address`,
339
+ headersSchema: ApiKeyHeadersSchema,
340
+ responseBodySchema: GetAddressResponseSchema
341
+ })
342
+ };
343
+
344
+ // src/wallet-custody/execute-wallet-custody-route.ts
345
+ function executeWalletCustodyRoute(request) {
346
+ return executeClientRoute({
347
+ ...request,
348
+ createError: (failure) => new WalletCustodyApiError(failure)
349
+ });
350
+ }
351
+
352
+ // src/wallet-custody/api-client.ts
353
+ function createWalletCustodyApiClient({
354
+ baseApiUrl,
355
+ apiKey,
356
+ fetchImpl = fetch,
357
+ headers
358
+ }) {
359
+ return async function fetchWalletCustodyApi({
360
+ route,
361
+ pathParams,
362
+ body,
363
+ idempotencyKey
364
+ }, { signal } = {}) {
365
+ return executeWalletCustodyRoute({
366
+ baseApiUrl,
367
+ fetchImpl,
368
+ headers,
369
+ signal,
370
+ routeName: route,
371
+ route: apiKeyWalletCustodyApiClientRoutes[route],
372
+ pathParams,
373
+ body,
374
+ routeHeadersInput: {
375
+ "x-api-key": typeof apiKey === "string" ? apiKey : await apiKey(),
376
+ "idempotency-key": idempotencyKey
377
+ }
378
+ });
379
+ };
380
+ }
381
+
382
+ // src/wallet-custody/create-claim-wallets-client.ts
383
+ function createClaimWalletsClient(walletCustodyApi) {
384
+ return {
385
+ acceptOffers({
386
+ idempotencyKey,
387
+ body
388
+ }, options) {
389
+ return walletCustodyApi(
390
+ {
391
+ route: "accept-claim-offers",
392
+ body,
393
+ idempotencyKey
394
+ },
395
+ options
396
+ );
397
+ }
398
+ };
399
+ }
400
+
401
+ // src/wallet-custody/create-transactions-client.ts
402
+ function createTransactionsClient(walletCustodyApi) {
403
+ return {
404
+ signUser({
405
+ subject,
406
+ idempotencyKey,
407
+ body
408
+ }, options) {
409
+ return walletCustodyApi(
410
+ {
411
+ route: "sign-user-transaction",
412
+ pathParams: { subject },
413
+ body,
414
+ idempotencyKey
415
+ },
416
+ options
417
+ );
418
+ },
419
+ signIntegrator({
420
+ subject,
421
+ idempotencyKey,
422
+ body
423
+ }, options) {
424
+ return walletCustodyApi(
425
+ {
426
+ route: "sign-integrator-transaction",
427
+ pathParams: { subject },
428
+ body,
429
+ idempotencyKey
430
+ },
431
+ options
432
+ );
433
+ },
434
+ submit({
435
+ body
436
+ }, options) {
437
+ return walletCustodyApi(
438
+ {
439
+ route: "submit-tenant-transaction",
440
+ body
441
+ },
442
+ options
443
+ );
444
+ }
445
+ };
446
+ }
447
+
448
+ // src/wallet-custody/create-wallet-client.ts
449
+ function createWalletClient(walletCustodyApi) {
450
+ return {
451
+ getUserAddress(pathParams, options) {
452
+ return walletCustodyApi(
453
+ {
454
+ route: "get-user-address",
455
+ pathParams
456
+ },
457
+ options
458
+ );
459
+ },
460
+ getIntegratorAddress(pathParams, options) {
461
+ return walletCustodyApi(
462
+ {
463
+ route: "get-integrator-address",
464
+ pathParams
465
+ },
466
+ options
467
+ );
468
+ },
469
+ getFeePayerAddress(options) {
470
+ return walletCustodyApi(
471
+ {
472
+ route: "get-fee-payer-address"
473
+ },
474
+ options
475
+ );
476
+ },
477
+ getProtocolAuthorityAddress(options) {
478
+ return walletCustodyApi(
479
+ {
480
+ route: "get-protocol-authority-address"
481
+ },
482
+ options
483
+ );
484
+ }
485
+ };
486
+ }
487
+
488
+ // src/index.ts
489
+ function createTdpClient(options) {
490
+ const tixApi = createTixApiClient(options);
491
+ const walletCustodyApi = createWalletCustodyApiClient(options);
492
+ return {
493
+ solana: createSolanaClient(tixApi),
494
+ indexer: createIndexerClient(tixApi),
495
+ wallets: createWalletClient(walletCustodyApi),
496
+ transactions: createTransactionsClient(walletCustodyApi),
497
+ claimWallets: createClaimWalletsClient(walletCustodyApi)
498
+ };
499
+ }
500
+ export {
501
+ createTdpClient
502
+ };
503
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/solana-data-api/create-solana-client.ts","../../tdp-schemas/src/tix-indexer-api/routes.ts","../src/utils/join-url-segments.ts","../src/utils/read-response-payload.ts","../src/routes/execute-client-route.ts","../src/tix-api/create-tix-api-client.ts","../src/tix-api/api-client.ts","../src/tix-indexer-api/create-indexer-client.ts","../../tdp-schemas/src/wallet-custody/api-key-route-keys.ts","../../tdp-schemas/src/wallet-custody/api-key-routes.ts","../src/wallet-custody/execute-wallet-custody-route.ts","../src/wallet-custody/api-client.ts","../src/wallet-custody/create-claim-wallets-client.ts","../src/wallet-custody/create-transactions-client.ts","../src/wallet-custody/create-wallet-client.ts","../src/index.ts"],"sourcesContent":["import type { RoutePathParams } from \"../routes/client-request-types\";\nimport type { TixApiClient, TixApiRoutes } from \"../tix-api/api-client\";\n\nexport function createSolanaClient(tixApi: TixApiClient) {\n return {\n getEvent(\n pathParams: RoutePathParams<TixApiRoutes[\"get-event-account\"]>,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-event-account\",\n pathParams,\n },\n options,\n );\n },\n getListing(\n pathParams: RoutePathParams<TixApiRoutes[\"get-listing-account\"]>,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-listing-account\",\n pathParams,\n },\n options,\n );\n },\n getPermit(\n pathParams: RoutePathParams<TixApiRoutes[\"get-permit\"]>,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-permit\",\n pathParams,\n },\n options,\n );\n },\n getProtocolConfig(options?: Pick<RequestInit, \"signal\">) {\n return tixApi(\n {\n route: \"get-protocol-config-account\",\n },\n options,\n );\n },\n getIntegrator(\n pathParams: RoutePathParams<TixApiRoutes[\"get-integrator-account\"]>,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-integrator-account\",\n pathParams,\n },\n options,\n );\n },\n };\n}\n","import type { z } from \"zod\";\nimport { defineClientRoute } from \"../routes/define-client-route\";\nimport { ApiKeyHeadersSchema } from \"../routes/request-schemas\";\nimport { EventPathParametersSchema } from \"../tix-api/path-params\";\nimport {\n PostIntegratorMetadataRequestBodySchema,\n PostTixIndexerIntegratorMetadataResultSchema,\n} from \"./metadata\";\nimport { tixIndexerReadApiClientRoutes } from \"./read-routes\";\n\nexport { PostIntegratorMetadataRequestBodySchema } from \"./metadata\";\nexport {\n GET_ACTIVE_LISTINGS_ROUTE_KEY,\n GET_UPCOMING_EVENTS_ROUTE_KEY,\n LimitCursorQuerySchema,\n} from \"./read-routes\";\nexport const POST_INTEGRATOR_METADATA_ROUTE_KEY =\n \"POST /events/{eventId}/metadata\";\n\nexport const tixIndexerApiClientRoutes = {\n ...tixIndexerReadApiClientRoutes,\n \"post-integrator-metadata\": defineClientRoute({\n name: \"post-integrator-metadata\",\n method: \"POST\" as const,\n routeKey: POST_INTEGRATOR_METADATA_ROUTE_KEY,\n pathParamsSchema: EventPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\", eventId }) =>\n `${baseApiUrl}/events/${eventId}/metadata`,\n headersSchema: ApiKeyHeadersSchema,\n requestBodySchema: PostIntegratorMetadataRequestBodySchema,\n responseBodySchema: PostTixIndexerIntegratorMetadataResultSchema,\n }),\n} as const satisfies Record<string, unknown>;\n\nexport const responseBodySchemaByRouteKey = Object.fromEntries(\n Object.values(tixIndexerApiClientRoutes).map(\n (route) => [route.routeKey, route.responseBodySchema] as const,\n ),\n) as Record<string, z.ZodType<Record<string, unknown>>>;\n","/**\n * Joins URL segments with one slash; i.e., remove repeated slashes.\n */\nexport function joinUrlSegments(baseUrl: string, path: string): string {\n return `${baseUrl.replace(/\\/+$/, \"\")}/${path.replace(/^\\/+/, \"\")}`;\n}\n","/**\n * Reads the body without letting an empty or non-JSON payload mask the HTTP status.\n **/\nexport async function readResponsePayload(\n response: Response,\n): Promise<unknown> {\n const rawBody = await response.text();\n if (rawBody.length === 0) return undefined;\n try {\n return JSON.parse(rawBody);\n } catch {\n return rawBody;\n }\n}\n","import type { z } from \"zod\";\nimport { joinUrlSegments } from \"../utils/join-url-segments\";\nimport { readResponsePayload } from \"../utils/read-response-payload\";\nimport type { AnyClientRoute } from \"./define-client-route\";\n\nexport type ClientRouteFailure = {\n kind: \"http-status\" | \"response-validation\";\n route: string;\n method: string;\n path: string;\n status: number;\n statusText: string;\n payload: unknown;\n validationError?: z.ZodError;\n};\n\n/** Builds the URL, headers, and body for a route, sends it, and parses the response through the route's schema. */\nexport async function executeClientRoute<TRoute extends AnyClientRoute>({\n baseApiUrl,\n fetchImpl,\n headers,\n signal,\n routeName,\n route,\n pathParams,\n queryParams,\n body,\n routeHeadersInput,\n createError,\n}: {\n baseApiUrl: string;\n fetchImpl: typeof fetch;\n headers?: HeadersInit;\n signal?: RequestInit[\"signal\"];\n routeName: string;\n route: TRoute;\n pathParams: unknown;\n queryParams?: unknown;\n body: unknown;\n routeHeadersInput: Record<string, string | undefined>;\n createError: (failure: ClientRouteFailure) => Error;\n}): Promise<z.output<TRoute[\"responseBodySchema\"]>> {\n // TS can't reconcile the route's output types with input types, hence the `as never` clauses.\n const path = route.buildPath(pathParams as never);\n const routeHeaders = route.buildHeaders(routeHeadersInput as never);\n const url =\n joinUrlSegments(baseApiUrl, path) +\n (queryParams === undefined\n ? \"\"\n : route.buildQueryString(queryParams as never));\n\n const requestHeaders = new Headers(headers);\n requestHeaders.set(\"content-type\", \"application/json\");\n new Headers(routeHeaders as HeadersInit).forEach((value, name) => {\n requestHeaders.set(name, value);\n });\n const response = await fetchImpl(url, {\n method: route.method,\n ...(signal === undefined ? {} : { signal }),\n headers: Object.fromEntries(requestHeaders),\n body:\n body === undefined ? undefined : route.buildJsonPayload(body as never),\n });\n const payload = await readResponsePayload(response);\n const failure = {\n route: routeName,\n method: route.method,\n path,\n status: response.status,\n statusText: response.statusText,\n payload,\n };\n if (!response.ok) throw createError({ kind: \"http-status\", ...failure });\n\n const parsed = route.responseBodySchema.safeParse(payload);\n if (!parsed.success) {\n throw createError({\n kind: \"response-validation\",\n ...failure,\n validationError: parsed.error,\n });\n }\n return parsed.data as z.output<TRoute[\"responseBodySchema\"]>;\n}\n","import type {\n ClientRouteMap,\n ClientRouteRequest,\n RouteQueryParams,\n RouteRequestField,\n RouteResponseBody,\n} from \"../routes/client-request-types\";\nimport { executeClientRoute } from \"../routes/execute-client-route\";\nimport { solanaDataApiClientRoutes } from \"../solana-data-api/routes\";\nimport { WalletCustodyApiError } from \"../wallet-custody/http-error\";\n\n/** Both APIs are mapped onto one domain under these keys. */\nexport const SOLANA_DATA_API_PATH_PREFIX = \"solana\";\nexport const TIX_INDEXER_API_PATH_PREFIX = \"tix-indexer\";\n\n/** The request for a route. No caller-settable `headers`: the client injects them itself. */\ntype FetchTixApiRequest<\n TRoutes extends ClientRouteMap,\n TRouteName extends keyof TRoutes,\n> = ClientRouteRequest<TRoutes, TRouteName> &\n RouteRequestField<\"queryParams\", RouteQueryParams<TRoutes[TRouteName]>>;\n\nexport function createTixApiClientForRoutes<TRoutes extends ClientRouteMap>({\n routes,\n baseApiUrl,\n apiKey,\n fetchImpl = fetch,\n headers,\n additionalHeaders,\n}: {\n routes: TRoutes;\n baseApiUrl: string;\n apiKey: string | (() => Promise<string>);\n fetchImpl?: typeof fetch;\n headers?: HeadersInit;\n additionalHeaders?: Parameters<\n typeof executeClientRoute\n >[0][\"routeHeadersInput\"];\n}) {\n return async function fetchTixApi<TRouteName extends keyof TRoutes & string>(\n {\n route,\n pathParams,\n queryParams,\n body,\n }: FetchTixApiRequest<TRoutes, TRouteName>,\n { signal }: Pick<RequestInit, \"signal\"> = {},\n ): Promise<RouteResponseBody<TRoutes[TRouteName]>> {\n const prefix =\n route in solanaDataApiClientRoutes\n ? SOLANA_DATA_API_PATH_PREFIX\n : TIX_INDEXER_API_PATH_PREFIX;\n return executeClientRoute({\n baseApiUrl: `${baseApiUrl}/${prefix}`,\n fetchImpl,\n headers,\n signal,\n routeName: route,\n route: routes[route],\n pathParams,\n queryParams,\n body,\n routeHeadersInput: {\n \"x-api-key\": typeof apiKey === \"string\" ? apiKey : await apiKey(),\n ...additionalHeaders,\n },\n createError: (failure) => new WalletCustodyApiError(failure),\n }) as Promise<RouteResponseBody<TRoutes[TRouteName]>>;\n };\n}\n","import { solanaDataApiClientRoutes } from \"../solana-data-api/routes\";\nimport { tixIndexerApiClientRoutes } from \"../tix-indexer-api/routes\";\nimport { createTixApiClientForRoutes } from \"./create-tix-api-client\";\n\nexport {\n SOLANA_DATA_API_PATH_PREFIX,\n TIX_INDEXER_API_PATH_PREFIX,\n} from \"./create-tix-api-client\";\n\nexport const tixApiClientRoutes = {\n ...solanaDataApiClientRoutes,\n ...tixIndexerApiClientRoutes,\n} as const;\n\nexport type TixApiRoutes = typeof tixApiClientRoutes;\nexport type TixApiClient = ReturnType<typeof createTixApiClient>;\n\nexport function createTixApiClient({\n baseApiUrl,\n apiKey,\n fetchImpl = fetch,\n headers,\n}: {\n baseApiUrl: string;\n apiKey: string | (() => Promise<string>);\n fetchImpl?: typeof fetch;\n /**\n * Additional request headers. SDK-managed headers take precedence.\n * Cross-origin browser requests require server CORS support for custom headers.\n */\n headers?: HeadersInit;\n}) {\n return createTixApiClientForRoutes({\n routes: tixApiClientRoutes,\n baseApiUrl,\n apiKey,\n fetchImpl,\n headers,\n });\n}\n","import type {\n ClientRouteRequest,\n RouteQueryParams,\n} from \"../routes/client-request-types\";\nimport type { TixApiClient, TixApiRoutes } from \"../tix-api/api-client\";\n\ntype MetadataRequest = ClientRouteRequest<\n TixApiRoutes,\n \"post-integrator-metadata\"\n>;\ntype ActiveListingsQuery = RouteQueryParams<\n TixApiRoutes[\"get-active-listings\"]\n>;\ntype UpcomingEventsQuery = RouteQueryParams<\n TixApiRoutes[\"get-upcoming-events\"]\n>;\n\nexport function createIndexerClient(tixApi: TixApiClient) {\n return {\n listActiveListings(\n queryParams: ActiveListingsQuery = {},\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-active-listings\",\n queryParams,\n },\n options,\n );\n },\n listUpcomingEvents(\n queryParams: UpcomingEventsQuery = {},\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"get-upcoming-events\",\n queryParams,\n },\n options,\n );\n },\n updateEventMetadata(\n {\n eventId,\n body,\n }: MetadataRequest[\"pathParams\"] & Pick<MetadataRequest, \"body\">,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return tixApi(\n {\n route: \"post-integrator-metadata\",\n pathParams: { eventId },\n body,\n },\n options,\n );\n },\n };\n}\n","export const GET_USER_ADDRESS_ROUTE_KEY =\n \"GET /wallets/users/{subject}/address\";\nexport const GET_INTEGRATOR_ADDRESS_ROUTE_KEY =\n \"GET /wallets/integrators/{subject}/address\";\nexport const SIGN_USER_TRANSACTION_ROUTE_KEY =\n \"POST /wallets/users/{subject}/signatures\";\nexport const SIGN_INTEGRATOR_TRANSACTION_ROUTE_KEY =\n \"POST /wallets/integrators/{subject}/signatures\";\nexport const SUBMIT_TENANT_TRANSACTION_ROUTE_KEY =\n \"POST /transactions/submissions\";\nexport const ACCEPT_CLAIM_OFFERS_ROUTE_KEY = \"POST /claim_wallets\";\nexport const GET_FEE_PAYER_ADDRESS_ROUTE_KEY = \"GET /wallets/fee-payer/address\";\nexport const GET_PROTOCOL_AUTHORITY_ADDRESS_ROUTE_KEY =\n \"GET /wallets/protocol-authority/address\";\n","import { defineClientRoute } from \"../routes/define-client-route\";\nimport {\n ApiKeyHeadersSchema,\n IdempotencyKeyAndApiKeyHeadersSchema,\n NoPathParametersSchema,\n} from \"../routes/request-schemas\";\nimport {\n GetAddressResponseSchema,\n WalletPathParametersSchema,\n} from \"./addresses\";\nimport {\n ACCEPT_CLAIM_OFFERS_ROUTE_KEY,\n GET_FEE_PAYER_ADDRESS_ROUTE_KEY,\n GET_INTEGRATOR_ADDRESS_ROUTE_KEY,\n GET_PROTOCOL_AUTHORITY_ADDRESS_ROUTE_KEY,\n GET_USER_ADDRESS_ROUTE_KEY,\n SIGN_INTEGRATOR_TRANSACTION_ROUTE_KEY,\n SIGN_USER_TRANSACTION_ROUTE_KEY,\n SUBMIT_TENANT_TRANSACTION_ROUTE_KEY,\n} from \"./api-key-route-keys\";\nimport {\n AcceptClaimOffersRequestBodySchema,\n AcceptClaimOffersResponseSchema,\n} from \"./claim-offers\";\nimport { SignTransactionResponseSchema } from \"./signing-responses\";\nimport { SubmitTenantTransactionResponseSchema } from \"./submission-responses\";\nimport {\n SignTenantTransactionRequestBodySchema,\n SubmitTenantTransactionRequestBodySchema,\n} from \"./transaction-inputs\";\n\nexport const apiKeyWalletCustodyApiClientRoutes = {\n \"get-user-address\": defineClientRoute({\n name: \"get-user-address\",\n method: \"GET\",\n routeKey: GET_USER_ADDRESS_ROUTE_KEY,\n pathParamsSchema: WalletPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\", subject }) =>\n `${baseApiUrl}/wallets/users/${subject}/address`,\n headersSchema: ApiKeyHeadersSchema,\n responseBodySchema: GetAddressResponseSchema,\n }),\n \"get-integrator-address\": defineClientRoute({\n name: \"get-integrator-address\",\n method: \"GET\",\n routeKey: GET_INTEGRATOR_ADDRESS_ROUTE_KEY,\n pathParamsSchema: WalletPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\", subject }) =>\n `${baseApiUrl}/wallets/integrators/${subject}/address`,\n headersSchema: ApiKeyHeadersSchema,\n responseBodySchema: GetAddressResponseSchema,\n }),\n \"sign-user-transaction\": defineClientRoute({\n name: \"sign-user-transaction\",\n method: \"POST\",\n routeKey: SIGN_USER_TRANSACTION_ROUTE_KEY,\n pathParamsSchema: WalletPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\", subject }) =>\n `${baseApiUrl}/wallets/users/${subject}/signatures`,\n headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,\n requestBodySchema: SignTenantTransactionRequestBodySchema,\n responseBodySchema: SignTransactionResponseSchema,\n }),\n \"sign-integrator-transaction\": defineClientRoute({\n name: \"sign-integrator-transaction\",\n method: \"POST\",\n routeKey: SIGN_INTEGRATOR_TRANSACTION_ROUTE_KEY,\n pathParamsSchema: WalletPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\", subject }) =>\n `${baseApiUrl}/wallets/integrators/${subject}/signatures`,\n headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,\n requestBodySchema: SignTenantTransactionRequestBodySchema,\n responseBodySchema: SignTransactionResponseSchema,\n }),\n \"submit-tenant-transaction\": defineClientRoute({\n name: \"submit-tenant-transaction\",\n method: \"POST\",\n routeKey: SUBMIT_TENANT_TRANSACTION_ROUTE_KEY,\n pathParamsSchema: NoPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\" }) =>\n `${baseApiUrl}/transactions/submissions`,\n headersSchema: ApiKeyHeadersSchema,\n requestBodySchema: SubmitTenantTransactionRequestBodySchema,\n responseBodySchema: SubmitTenantTransactionResponseSchema,\n }),\n \"accept-claim-offers\": defineClientRoute({\n name: \"accept-claim-offers\",\n method: \"POST\",\n routeKey: ACCEPT_CLAIM_OFFERS_ROUTE_KEY,\n pathParamsSchema: NoPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\" }) => `${baseApiUrl}/claim_wallets`,\n headersSchema: IdempotencyKeyAndApiKeyHeadersSchema,\n requestBodySchema: AcceptClaimOffersRequestBodySchema,\n responseBodySchema: AcceptClaimOffersResponseSchema,\n }),\n \"get-fee-payer-address\": defineClientRoute({\n name: \"get-fee-payer-address\",\n method: \"GET\",\n routeKey: GET_FEE_PAYER_ADDRESS_ROUTE_KEY,\n pathParamsSchema: NoPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\" }) =>\n `${baseApiUrl}/wallets/fee-payer/address`,\n headersSchema: ApiKeyHeadersSchema,\n responseBodySchema: GetAddressResponseSchema,\n }),\n \"get-protocol-authority-address\": defineClientRoute({\n name: \"get-protocol-authority-address\",\n method: \"GET\",\n routeKey: GET_PROTOCOL_AUTHORITY_ADDRESS_ROUTE_KEY,\n pathParamsSchema: NoPathParametersSchema,\n buildPath: ({ baseApiUrl = \"\" }) =>\n `${baseApiUrl}/wallets/protocol-authority/address`,\n headersSchema: ApiKeyHeadersSchema,\n responseBodySchema: GetAddressResponseSchema,\n }),\n};\n","import type {\n ClientRouteMap,\n ClientRouteRequest,\n RouteRequestField,\n RouteRequestHeader,\n} from \"../routes/client-request-types\";\nimport type { AnyClientRoute } from \"../routes/define-client-route\";\nimport { executeClientRoute } from \"../routes/execute-client-route\";\nimport { WalletCustodyApiError } from \"./http-error\";\n\nexport type FetchWalletCustodyApiRequest<\n TRoutes extends ClientRouteMap,\n TRouteName extends keyof TRoutes,\n> = ClientRouteRequest<TRoutes, TRouteName> &\n RouteRequestField<\n \"idempotencyKey\",\n RouteRequestHeader<TRoutes[TRouteName], \"idempotency-key\">\n >;\n\nexport function executeWalletCustodyRoute<TRoute extends AnyClientRoute>(\n request: Omit<\n Parameters<typeof executeClientRoute<TRoute>>[0],\n \"createError\"\n >,\n) {\n return executeClientRoute({\n ...request,\n createError: (failure) => new WalletCustodyApiError(failure),\n } satisfies Parameters<typeof executeClientRoute<TRoute>>[0]);\n}\n","import { apiKeyWalletCustodyApiClientRoutes } from \"@kyd-labs/tdp-schemas/wallet-custody/api-key-routes\";\nimport type {\n RouteNamesRequiringHeader,\n RouteResponseBody,\n} from \"../routes/client-request-types\";\nimport {\n executeWalletCustodyRoute,\n type FetchWalletCustodyApiRequest,\n} from \"./execute-wallet-custody-route\";\nimport type { walletCustodyApiClientRoutes } from \"./routes\";\n\nexport type WalletCustodyApiClient = ReturnType<\n typeof createWalletCustodyApiClient\n>;\n\n/** Client for claim routes authorized by an API key. */\nexport function createWalletCustodyApiClient({\n baseApiUrl,\n apiKey,\n fetchImpl = fetch,\n headers,\n}: {\n baseApiUrl: string;\n apiKey: string | (() => Promise<string>);\n fetchImpl?: typeof fetch;\n headers?: HeadersInit;\n}) {\n return async function fetchWalletCustodyApi<\n TRouteName extends ApiKeyWalletCustodyApiRouteName,\n >(\n {\n route,\n pathParams,\n body,\n idempotencyKey,\n }: FetchWalletCustodyApiRequest<ApiKeyWalletCustodyApiRoutes, TRouteName>,\n { signal }: Pick<RequestInit, \"signal\"> = {},\n ): Promise<RouteResponseBody<RouteForName<TRouteName>>> {\n return executeWalletCustodyRoute({\n baseApiUrl,\n fetchImpl,\n headers,\n signal,\n routeName: route,\n route: apiKeyWalletCustodyApiClientRoutes[route],\n pathParams,\n body,\n routeHeadersInput: {\n \"x-api-key\": typeof apiKey === \"string\" ? apiKey : await apiKey(),\n \"idempotency-key\": idempotencyKey,\n },\n }) as Promise<RouteResponseBody<RouteForName<TRouteName>>>;\n };\n}\n\n// -------------------------------------- Route helper types ---------------------------------------\nexport type WalletCustodyApiRoutes = typeof walletCustodyApiClientRoutes;\nexport type ApiKeyWalletCustodyApiRoutes =\n typeof apiKeyWalletCustodyApiClientRoutes;\ntype ApiKeyWalletCustodyApiRouteName = RouteNamesRequiringHeader<\n ApiKeyWalletCustodyApiRoutes,\n \"x-api-key\"\n>;\ntype RouteForName<TRouteName extends ApiKeyWalletCustodyApiRouteName> =\n ApiKeyWalletCustodyApiRoutes[TRouteName];\n","import type {\n RouteRequestBody,\n RouteRequestField,\n RouteRequestHeader,\n} from \"../routes/client-request-types\";\nimport type {\n ApiKeyWalletCustodyApiRoutes,\n WalletCustodyApiClient,\n} from \"./api-client\";\n\ntype AcceptOffersRoute = ApiKeyWalletCustodyApiRoutes[\"accept-claim-offers\"];\n\nexport function createClaimWalletsClient(\n walletCustodyApi: WalletCustodyApiClient,\n) {\n return {\n acceptOffers(\n {\n idempotencyKey,\n body,\n }: RouteRequestField<\"body\", RouteRequestBody<AcceptOffersRoute>> &\n RouteRequestField<\n \"idempotencyKey\",\n RouteRequestHeader<AcceptOffersRoute, \"idempotency-key\">\n >,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"accept-claim-offers\",\n body,\n idempotencyKey,\n },\n options,\n );\n },\n };\n}\n","import type {\n RoutePathParams,\n RouteRequestBody,\n RouteRequestField,\n RouteRequestHeader,\n} from \"../routes/client-request-types\";\nimport type {\n ApiKeyWalletCustodyApiRoutes,\n WalletCustodyApiClient,\n} from \"./api-client\";\n\ntype SignTransactionInput<\n TRoute extends \"sign-user-transaction\" | \"sign-integrator-transaction\",\n> = RoutePathParams<ApiKeyWalletCustodyApiRoutes[TRoute]> &\n RouteRequestField<\n \"body\",\n RouteRequestBody<ApiKeyWalletCustodyApiRoutes[TRoute]>\n > &\n RouteRequestField<\n \"idempotencyKey\",\n RouteRequestHeader<ApiKeyWalletCustodyApiRoutes[TRoute], \"idempotency-key\">\n >;\n\nexport function createTransactionsClient(\n walletCustodyApi: WalletCustodyApiClient,\n) {\n return {\n signUser(\n {\n subject,\n idempotencyKey,\n body,\n }: SignTransactionInput<\"sign-user-transaction\">,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"sign-user-transaction\",\n pathParams: { subject },\n body,\n idempotencyKey,\n },\n options,\n );\n },\n signIntegrator(\n {\n subject,\n idempotencyKey,\n body,\n }: SignTransactionInput<\"sign-integrator-transaction\">,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"sign-integrator-transaction\",\n pathParams: { subject },\n body,\n idempotencyKey,\n },\n options,\n );\n },\n submit(\n {\n body,\n }: RouteRequestField<\n \"body\",\n RouteRequestBody<\n ApiKeyWalletCustodyApiRoutes[\"submit-tenant-transaction\"]\n >\n >,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"submit-tenant-transaction\",\n body,\n },\n options,\n );\n },\n };\n}\n","import type { RoutePathParams } from \"../routes/client-request-types\";\nimport type {\n ApiKeyWalletCustodyApiRoutes,\n WalletCustodyApiClient,\n} from \"./api-client\";\n\nexport function createWalletClient(walletCustodyApi: WalletCustodyApiClient) {\n return {\n getUserAddress(\n pathParams: RoutePathParams<\n ApiKeyWalletCustodyApiRoutes[\"get-user-address\"]\n >,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"get-user-address\",\n pathParams,\n },\n options,\n );\n },\n getIntegratorAddress(\n pathParams: RoutePathParams<\n ApiKeyWalletCustodyApiRoutes[\"get-integrator-address\"]\n >,\n options?: Pick<RequestInit, \"signal\">,\n ) {\n return walletCustodyApi(\n {\n route: \"get-integrator-address\",\n pathParams,\n },\n options,\n );\n },\n getFeePayerAddress(options?: Pick<RequestInit, \"signal\">) {\n return walletCustodyApi(\n {\n route: \"get-fee-payer-address\",\n },\n options,\n );\n },\n getProtocolAuthorityAddress(options?: Pick<RequestInit, \"signal\">) {\n return walletCustodyApi(\n {\n route: \"get-protocol-authority-address\",\n },\n options,\n );\n },\n };\n}\n","import { createSolanaClient } from \"./solana-data-api/create-solana-client\";\nimport { createTixApiClient } from \"./tix-api/api-client\";\nimport { createIndexerClient } from \"./tix-indexer-api/create-indexer-client\";\nimport { createWalletCustodyApiClient } from \"./wallet-custody/api-client\";\nimport { createClaimWalletsClient } from \"./wallet-custody/create-claim-wallets-client\";\nimport { createTransactionsClient } from \"./wallet-custody/create-transactions-client\";\nimport { createWalletClient } from \"./wallet-custody/create-wallet-client\";\n\nexport type * from \"./types/index\";\n\nexport type TdpClientOptions = Parameters<typeof createTixApiClient>[0];\nexport type TdpClient = ReturnType<typeof createTdpClient>;\n\nexport function createTdpClient(options: TdpClientOptions) {\n const tixApi = createTixApiClient(options);\n const walletCustodyApi = createWalletCustodyApiClient(options);\n return {\n solana: createSolanaClient(tixApi),\n indexer: createIndexerClient(tixApi),\n wallets: createWalletClient(walletCustodyApi),\n transactions: createTransactionsClient(walletCustodyApi),\n claimWallets: createClaimWalletsClient(walletCustodyApi),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,mBAAmB,QAAsB;AACvD,SAAO;AAAA,IACL,SACE,YACA,SACA;AACA,aAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,UACP;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA,WACE,YACA,SACA;AACA,aAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,UACP;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA,UACE,YACA,SACA;AACA,aAAO;AAAA,QACL;AAAA,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YAGA,SACA;AACA,aAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,UACP;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA,mBAAmB,SAAuC;AACxD,aAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA,4BAA4B,SAAuC;AACjE,aAAO;AAAA,QACL;AAAA,UACE,OAAO;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACxCO,SAAS,gBAAgB,SAA2B;AACzD,QAAM,SAAS,mBAAmB,OAAO;AACzC,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,SAAO;AAAA,IACL,QAAQ,mBAAmB,MAAM;AAAA,IACjC,SAAS,oBAAoB,MAAM;AAAA,IACnC,SAAS,mBAAmB,gBAAgB;AAAA,IAC5C,cAAc,yBAAyB,gBAAgB;AAAA,IACvD,cAAc,yBAAyB,gBAAgB;AAAA,EACzD;AACF;","names":["responseBodySchemaByRouteKey"]}