@layer-drone/protocol 0.0.13 → 0.0.15
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.d.mts +65 -101
- package/dist/index.d.ts +65 -101
- package/dist/index.js +23 -53
- package/dist/index.mjs +23 -51
- package/package.json +2 -2
- package/src/client/sdk.gen.ts +11 -67
- package/src/client/types.gen.ts +26 -89
- package/src/event/types.gen.ts +9 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layer-drone/protocol",
|
|
3
3
|
"description": "Layer Drone protocol SDK with typed API client and event parsing",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@layer-drone/typescript-config": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"zod": "^3.
|
|
33
|
+
"zod": "^3.x.x"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
package/src/client/sdk.gen.ts
CHANGED
|
@@ -54,12 +54,6 @@ import type {
|
|
|
54
54
|
QuotesControllerGetQuoteData,
|
|
55
55
|
QuotesControllerGetQuoteErrors,
|
|
56
56
|
QuotesControllerGetQuoteResponses,
|
|
57
|
-
RewardsControllerDepositRewardsData,
|
|
58
|
-
RewardsControllerDepositRewardsErrors,
|
|
59
|
-
RewardsControllerDepositRewardsResponses,
|
|
60
|
-
RewardsControllerDistributeRewardsData,
|
|
61
|
-
RewardsControllerDistributeRewardsErrors,
|
|
62
|
-
RewardsControllerDistributeRewardsResponses,
|
|
63
57
|
SchemaControllerGetEventSchemaData,
|
|
64
58
|
SchemaControllerGetEventSchemaResponses,
|
|
65
59
|
WebhooksControllerCreateData,
|
|
@@ -133,14 +127,14 @@ export const keysControllerGetProvenanceCryptoKey = <
|
|
|
133
127
|
});
|
|
134
128
|
};
|
|
135
129
|
|
|
136
|
-
export const
|
|
130
|
+
export const quotesControllerCreateQuote = <
|
|
137
131
|
ThrowOnError extends boolean = false,
|
|
138
132
|
>(
|
|
139
|
-
options: Options<
|
|
133
|
+
options: Options<QuotesControllerCreateQuoteData, ThrowOnError>,
|
|
140
134
|
) => {
|
|
141
135
|
return (options.client ?? _heyApiClient).post<
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
QuotesControllerCreateQuoteResponses,
|
|
137
|
+
QuotesControllerCreateQuoteErrors,
|
|
144
138
|
ThrowOnError
|
|
145
139
|
>({
|
|
146
140
|
security: [
|
|
@@ -149,7 +143,7 @@ export const rewardsControllerDepositRewards = <
|
|
|
149
143
|
type: "apiKey",
|
|
150
144
|
},
|
|
151
145
|
],
|
|
152
|
-
url: "/
|
|
146
|
+
url: "/quotes",
|
|
153
147
|
...options,
|
|
154
148
|
headers: {
|
|
155
149
|
"Content-Type": "application/json",
|
|
@@ -158,14 +152,12 @@ export const rewardsControllerDepositRewards = <
|
|
|
158
152
|
});
|
|
159
153
|
};
|
|
160
154
|
|
|
161
|
-
export const
|
|
162
|
-
|
|
163
|
-
>(
|
|
164
|
-
options: Options<RewardsControllerDistributeRewardsData, ThrowOnError>,
|
|
155
|
+
export const quotesControllerGetQuote = <ThrowOnError extends boolean = false>(
|
|
156
|
+
options: Options<QuotesControllerGetQuoteData, ThrowOnError>,
|
|
165
157
|
) => {
|
|
166
|
-
return (options.client ?? _heyApiClient).
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
return (options.client ?? _heyApiClient).get<
|
|
159
|
+
QuotesControllerGetQuoteResponses,
|
|
160
|
+
QuotesControllerGetQuoteErrors,
|
|
169
161
|
ThrowOnError
|
|
170
162
|
>({
|
|
171
163
|
security: [
|
|
@@ -174,12 +166,8 @@ export const rewardsControllerDistributeRewards = <
|
|
|
174
166
|
type: "apiKey",
|
|
175
167
|
},
|
|
176
168
|
],
|
|
177
|
-
url: "/
|
|
169
|
+
url: "/quotes/{id}",
|
|
178
170
|
...options,
|
|
179
|
-
headers: {
|
|
180
|
-
"Content-Type": "application/json",
|
|
181
|
-
...options.headers,
|
|
182
|
-
},
|
|
183
171
|
});
|
|
184
172
|
};
|
|
185
173
|
|
|
@@ -276,50 +264,6 @@ export const apiTokenControllerUpdateToken = <
|
|
|
276
264
|
});
|
|
277
265
|
};
|
|
278
266
|
|
|
279
|
-
export const quotesControllerCreateQuote = <
|
|
280
|
-
ThrowOnError extends boolean = false,
|
|
281
|
-
>(
|
|
282
|
-
options: Options<QuotesControllerCreateQuoteData, ThrowOnError>,
|
|
283
|
-
) => {
|
|
284
|
-
return (options.client ?? _heyApiClient).post<
|
|
285
|
-
QuotesControllerCreateQuoteResponses,
|
|
286
|
-
QuotesControllerCreateQuoteErrors,
|
|
287
|
-
ThrowOnError
|
|
288
|
-
>({
|
|
289
|
-
security: [
|
|
290
|
-
{
|
|
291
|
-
name: "x-api-token",
|
|
292
|
-
type: "apiKey",
|
|
293
|
-
},
|
|
294
|
-
],
|
|
295
|
-
url: "/quotes",
|
|
296
|
-
...options,
|
|
297
|
-
headers: {
|
|
298
|
-
"Content-Type": "application/json",
|
|
299
|
-
...options.headers,
|
|
300
|
-
},
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
export const quotesControllerGetQuote = <ThrowOnError extends boolean = false>(
|
|
305
|
-
options: Options<QuotesControllerGetQuoteData, ThrowOnError>,
|
|
306
|
-
) => {
|
|
307
|
-
return (options.client ?? _heyApiClient).get<
|
|
308
|
-
QuotesControllerGetQuoteResponses,
|
|
309
|
-
QuotesControllerGetQuoteErrors,
|
|
310
|
-
ThrowOnError
|
|
311
|
-
>({
|
|
312
|
-
security: [
|
|
313
|
-
{
|
|
314
|
-
name: "x-api-token",
|
|
315
|
-
type: "apiKey",
|
|
316
|
-
},
|
|
317
|
-
],
|
|
318
|
-
url: "/quotes/{id}",
|
|
319
|
-
...options,
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
|
|
323
267
|
/**
|
|
324
268
|
* Create new missions
|
|
325
269
|
* Create missions for specified zones and mission types.
|
package/src/client/types.gen.ts
CHANGED
|
@@ -27,28 +27,11 @@ export type GetProvenanceCryptoKeyResponse = {
|
|
|
27
27
|
>;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
amount: bigint;
|
|
36
|
-
vaultId: number;
|
|
37
|
-
vaultManagerAddress?: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type DepositRewardsResponseDto = {
|
|
41
|
-
MessageId: string;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type DistributeRewardsRequestDto = {
|
|
45
|
-
amounts: {
|
|
46
|
-
[key: string]: number;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type DistributeRewardsResponseDto = {
|
|
51
|
-
MessageId: string;
|
|
30
|
+
export type CreateQuoteRequestDto = {
|
|
31
|
+
missionIds: Array<number>;
|
|
32
|
+
entitlementType: string;
|
|
33
|
+
buyer: string;
|
|
34
|
+
mintOnChain: boolean;
|
|
52
35
|
};
|
|
53
36
|
|
|
54
37
|
export type CreateApiTokenResponseDto = {
|
|
@@ -80,18 +63,11 @@ export type UpdateApiTokenResponseDto = {
|
|
|
80
63
|
scopes: Array<"manageTokens" | "manageFlights" | "manageWebhooks" | "all">;
|
|
81
64
|
};
|
|
82
65
|
|
|
83
|
-
export type CreateQuoteRequestDto = {
|
|
84
|
-
missionIds: Array<number>;
|
|
85
|
-
entitlementType: string;
|
|
86
|
-
buyer: string;
|
|
87
|
-
mintOnChain: boolean;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
66
|
export type CreateMissionRequestDto = {
|
|
91
67
|
missions: Array<{
|
|
92
68
|
zoneId: string;
|
|
93
69
|
flightPlanId: number;
|
|
94
|
-
amount:
|
|
70
|
+
amount: bigint;
|
|
95
71
|
startTime: Date;
|
|
96
72
|
endTime: Date;
|
|
97
73
|
}>;
|
|
@@ -105,16 +81,15 @@ export type CreateMissionResponseDto = {
|
|
|
105
81
|
data:
|
|
106
82
|
| {
|
|
107
83
|
missions: Array<{
|
|
108
|
-
|
|
84
|
+
id: string;
|
|
109
85
|
vaultId: string;
|
|
110
|
-
amount:
|
|
86
|
+
amount: string;
|
|
111
87
|
zoneId: string;
|
|
112
88
|
flightPlanId: number;
|
|
113
89
|
captureStartTime: Date;
|
|
114
90
|
captureEndTime: Date;
|
|
115
91
|
requestor: string;
|
|
116
92
|
}>;
|
|
117
|
-
totalAmount: number;
|
|
118
93
|
}
|
|
119
94
|
| string;
|
|
120
95
|
};
|
|
@@ -122,11 +97,11 @@ export type CreateMissionResponseDto = {
|
|
|
122
97
|
export type UpdateMissionsRequestDto = {
|
|
123
98
|
missions: Array<
|
|
124
99
|
| {
|
|
125
|
-
id:
|
|
126
|
-
amount:
|
|
100
|
+
id: bigint;
|
|
101
|
+
amount: bigint;
|
|
127
102
|
}
|
|
128
103
|
| {
|
|
129
|
-
id:
|
|
104
|
+
id: bigint;
|
|
130
105
|
isOpen: false;
|
|
131
106
|
}
|
|
132
107
|
>;
|
|
@@ -339,44 +314,40 @@ export type KeysControllerGetProvenanceCryptoKeyResponses = {
|
|
|
339
314
|
export type KeysControllerGetProvenanceCryptoKeyResponse =
|
|
340
315
|
KeysControllerGetProvenanceCryptoKeyResponses[keyof KeysControllerGetProvenanceCryptoKeyResponses];
|
|
341
316
|
|
|
342
|
-
export type
|
|
343
|
-
body:
|
|
317
|
+
export type QuotesControllerCreateQuoteData = {
|
|
318
|
+
body: CreateQuoteRequestDto;
|
|
344
319
|
path?: never;
|
|
345
320
|
query?: never;
|
|
346
|
-
url: "/
|
|
321
|
+
url: "/quotes";
|
|
347
322
|
};
|
|
348
323
|
|
|
349
|
-
export type
|
|
324
|
+
export type QuotesControllerCreateQuoteErrors = {
|
|
350
325
|
401: unknown;
|
|
351
326
|
403: unknown;
|
|
352
327
|
};
|
|
353
328
|
|
|
354
|
-
export type
|
|
355
|
-
|
|
329
|
+
export type QuotesControllerCreateQuoteResponses = {
|
|
330
|
+
201: unknown;
|
|
356
331
|
};
|
|
357
332
|
|
|
358
|
-
export type
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
path?: never;
|
|
333
|
+
export type QuotesControllerGetQuoteData = {
|
|
334
|
+
body?: never;
|
|
335
|
+
path: {
|
|
336
|
+
id: string;
|
|
337
|
+
};
|
|
364
338
|
query?: never;
|
|
365
|
-
url: "/
|
|
339
|
+
url: "/quotes/{id}";
|
|
366
340
|
};
|
|
367
341
|
|
|
368
|
-
export type
|
|
342
|
+
export type QuotesControllerGetQuoteErrors = {
|
|
369
343
|
401: unknown;
|
|
370
344
|
403: unknown;
|
|
371
345
|
};
|
|
372
346
|
|
|
373
|
-
export type
|
|
374
|
-
200:
|
|
347
|
+
export type QuotesControllerGetQuoteResponses = {
|
|
348
|
+
200: unknown;
|
|
375
349
|
};
|
|
376
350
|
|
|
377
|
-
export type RewardsControllerDistributeRewardsResponse =
|
|
378
|
-
RewardsControllerDistributeRewardsResponses[keyof RewardsControllerDistributeRewardsResponses];
|
|
379
|
-
|
|
380
351
|
export type ApiTokenControllerCreateTokenData = {
|
|
381
352
|
body: CreateApiTokenRequestDto;
|
|
382
353
|
path?: never;
|
|
@@ -454,40 +425,6 @@ export type ApiTokenControllerUpdateTokenResponses = {
|
|
|
454
425
|
export type ApiTokenControllerUpdateTokenResponse =
|
|
455
426
|
ApiTokenControllerUpdateTokenResponses[keyof ApiTokenControllerUpdateTokenResponses];
|
|
456
427
|
|
|
457
|
-
export type QuotesControllerCreateQuoteData = {
|
|
458
|
-
body: CreateQuoteRequestDto;
|
|
459
|
-
path?: never;
|
|
460
|
-
query?: never;
|
|
461
|
-
url: "/quotes";
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
export type QuotesControllerCreateQuoteErrors = {
|
|
465
|
-
401: unknown;
|
|
466
|
-
403: unknown;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
export type QuotesControllerCreateQuoteResponses = {
|
|
470
|
-
201: unknown;
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
export type QuotesControllerGetQuoteData = {
|
|
474
|
-
body?: never;
|
|
475
|
-
path: {
|
|
476
|
-
id: string;
|
|
477
|
-
};
|
|
478
|
-
query?: never;
|
|
479
|
-
url: "/quotes/{id}";
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
export type QuotesControllerGetQuoteErrors = {
|
|
483
|
-
401: unknown;
|
|
484
|
-
403: unknown;
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
export type QuotesControllerGetQuoteResponses = {
|
|
488
|
-
200: unknown;
|
|
489
|
-
};
|
|
490
|
-
|
|
491
428
|
export type MissionsControllerCreateMissionsData = {
|
|
492
429
|
body: CreateMissionRequestDto;
|
|
493
430
|
path?: never;
|
package/src/event/types.gen.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const Event = z.union([
|
|
|
20
20
|
flightId: z.number(),
|
|
21
21
|
pilotAddress: z.string(),
|
|
22
22
|
flightManifestUri: z.string(),
|
|
23
|
+
missionId: z.number(),
|
|
23
24
|
})
|
|
24
25
|
.strict(),
|
|
25
26
|
})
|
|
@@ -31,14 +32,15 @@ export const Event = z.union([
|
|
|
31
32
|
timestamp: z.any(),
|
|
32
33
|
data: z
|
|
33
34
|
.object({
|
|
34
|
-
|
|
35
|
-
vaultId: z.
|
|
36
|
-
amount: z.
|
|
35
|
+
id: z.number().int(),
|
|
36
|
+
vaultId: z.number().int(),
|
|
37
|
+
amount: z.number().int(),
|
|
37
38
|
zoneId: z.string(),
|
|
38
39
|
flightPlanId: z.number(),
|
|
39
|
-
captureStartTime: z.string(),
|
|
40
|
-
captureEndTime: z.string(),
|
|
40
|
+
captureStartTime: z.string().datetime({ offset: true }),
|
|
41
|
+
captureEndTime: z.string().datetime({ offset: true }),
|
|
41
42
|
detailsHash: z.string(),
|
|
43
|
+
requestor: z.string().regex(new RegExp("^0x[a-fA-F0-9]{40}$")),
|
|
42
44
|
})
|
|
43
45
|
.strict(),
|
|
44
46
|
})
|
|
@@ -50,8 +52,8 @@ export const Event = z.union([
|
|
|
50
52
|
timestamp: z.any(),
|
|
51
53
|
data: z
|
|
52
54
|
.object({
|
|
53
|
-
id: z.
|
|
54
|
-
amount: z.number().optional(),
|
|
55
|
+
id: z.number().int(),
|
|
56
|
+
amount: z.number().int().optional(),
|
|
55
57
|
isOpen: z.boolean().optional(),
|
|
56
58
|
})
|
|
57
59
|
.strict(),
|