@helium/blockchain-api 0.1.2 → 0.1.3

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.
Files changed (52) hide show
  1. package/README.md +24 -2
  2. package/package.json +31 -31
  3. package/types/README.md +24 -2
  4. package/types/generated/index.d.mts +2481 -0
  5. package/types/generated/index.d.ts +2481 -0
  6. package/types/generated/index.js +723 -0
  7. package/types/generated/index.mjs +614 -0
  8. package/types/index.ts +11 -8
  9. package/src/server/api/errors.ts +0 -152
  10. package/src/server/api/index.ts +0 -40
  11. package/src/server/api/procedures.ts +0 -144
  12. package/src/server/api/routers/fiat/router.ts +0 -709
  13. package/src/server/api/routers/fiat/schemas.ts +0 -169
  14. package/src/server/api/routers/health/router.ts +0 -41
  15. package/src/server/api/routers/hotspots/procedures/claimRewards.ts +0 -258
  16. package/src/server/api/routers/hotspots/procedures/createSplit.ts +0 -253
  17. package/src/server/api/routers/hotspots/procedures/deleteSplit.ts +0 -156
  18. package/src/server/api/routers/hotspots/procedures/getHotspots.ts +0 -31
  19. package/src/server/api/routers/hotspots/procedures/getPendingRewards.ts +0 -44
  20. package/src/server/api/routers/hotspots/procedures/getSplit.ts +0 -88
  21. package/src/server/api/routers/hotspots/procedures/transferHotspot.ts +0 -204
  22. package/src/server/api/routers/hotspots/procedures/updateRewardsDestination.ts +0 -201
  23. package/src/server/api/routers/hotspots/router.ts +0 -30
  24. package/src/server/api/routers/hotspots/schemas.ts +0 -182
  25. package/src/server/api/routers/swap/procedures/getInstructions.ts +0 -152
  26. package/src/server/api/routers/swap/procedures/getQuote.ts +0 -53
  27. package/src/server/api/routers/swap/procedures/getTokens.ts +0 -88
  28. package/src/server/api/routers/swap/router.ts +0 -15
  29. package/src/server/api/routers/swap/schemas.ts +0 -96
  30. package/src/server/api/routers/tokens/procedures/createHntAccount.ts +0 -87
  31. package/src/server/api/routers/tokens/procedures/getBalances.ts +0 -27
  32. package/src/server/api/routers/tokens/procedures/transfer.ts +0 -159
  33. package/src/server/api/routers/tokens/router.ts +0 -15
  34. package/src/server/api/routers/tokens/schemas.ts +0 -80
  35. package/src/server/api/routers/transactions/procedures/get.ts +0 -46
  36. package/src/server/api/routers/transactions/procedures/getByPayer.ts +0 -111
  37. package/src/server/api/routers/transactions/procedures/getByPayerAndTag.ts +0 -119
  38. package/src/server/api/routers/transactions/procedures/resubmit.ts +0 -68
  39. package/src/server/api/routers/transactions/procedures/submit.ts +0 -216
  40. package/src/server/api/routers/transactions/router.ts +0 -21
  41. package/src/server/api/routers/transactions/schemas.ts +0 -119
  42. package/src/server/api/routers/webhooks/router.ts +0 -75
  43. package/src/server/api/routers/welcomePacks/procedures/claim.ts +0 -157
  44. package/src/server/api/routers/welcomePacks/procedures/create.ts +0 -247
  45. package/src/server/api/routers/welcomePacks/procedures/deletePack.ts +0 -118
  46. package/src/server/api/routers/welcomePacks/procedures/get.ts +0 -36
  47. package/src/server/api/routers/welcomePacks/procedures/getByAddress.ts +0 -26
  48. package/src/server/api/routers/welcomePacks/procedures/invite.ts +0 -44
  49. package/src/server/api/routers/welcomePacks/procedures/list.ts +0 -27
  50. package/src/server/api/routers/welcomePacks/router.ts +0 -27
  51. package/src/server/api/routers/welcomePacks/schemas.ts +0 -135
  52. package/src/server/api/schemas.ts +0 -281
@@ -0,0 +1,614 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/shared/schemas/common.ts
4
+ var WalletAddressSchema = z.string().min(32).max(44);
5
+ var PublicKeySchema = z.string().min(32).max(44);
6
+ var PaginationInputSchema = z.object({
7
+ page: z.coerce.number().int().min(1).default(1),
8
+ limit: z.coerce.number().int().min(1).max(100).default(10)
9
+ });
10
+ var PaginationOutputSchema = z.object({
11
+ total: z.number(),
12
+ page: z.number(),
13
+ totalPages: z.number()
14
+ });
15
+ var TransactionMetadataSchema = z.object({
16
+ type: z.string(),
17
+ description: z.string()
18
+ }).catchall(z.unknown());
19
+ var TransactionItemSchema = z.object({
20
+ serializedTransaction: z.string(),
21
+ metadata: TransactionMetadataSchema.optional()
22
+ });
23
+ var TransactionDataSchema = z.object({
24
+ transactions: z.array(TransactionItemSchema),
25
+ parallel: z.boolean(),
26
+ tag: z.string().optional()
27
+ });
28
+ var TransactionBatchRequestSchema = z.object({
29
+ transactions: z.array(TransactionItemSchema),
30
+ parallel: z.boolean(),
31
+ tag: z.string().optional()
32
+ });
33
+ var TransactionBatchResponseSchema = z.object({
34
+ batchId: z.string(),
35
+ message: z.string().optional()
36
+ });
37
+ var ErrorResponseSchema = z.object({
38
+ error: z.string(),
39
+ details: z.array(z.string()).optional()
40
+ });
41
+ var HotspotTypeSchema = z.enum(["iot", "mobile", "all"]);
42
+ var DeviceTypeSchema = z.enum([
43
+ "iot-gateway",
44
+ "wifiIndoor",
45
+ "wifiOutdoor",
46
+ "wifiDataOnly",
47
+ "cbrs"
48
+ ]);
49
+ var OwnershipTypeSchema = z.enum(["owner", "direct", "fanout", "all"]);
50
+ var HotspotSharesSchema = z.object({
51
+ fixed: z.string().optional(),
52
+ percentage: z.number().optional()
53
+ });
54
+ var HotspotSchema = z.object({
55
+ address: z.string(),
56
+ entityKey: z.string(),
57
+ name: z.string(),
58
+ type: HotspotTypeSchema,
59
+ deviceType: DeviceTypeSchema,
60
+ city: z.string().optional(),
61
+ state: z.string().optional(),
62
+ country: z.string().optional(),
63
+ asset: z.string(),
64
+ isOnline: z.boolean().optional(),
65
+ owner: z.string().optional(),
66
+ shares: HotspotSharesSchema.optional(),
67
+ ownershipType: z.string()
68
+ });
69
+ var HotspotsDataSchema = z.object({
70
+ hotspots: z.array(HotspotSchema),
71
+ total: z.number(),
72
+ page: z.number(),
73
+ totalPages: z.number()
74
+ });
75
+ var GetHotspotsInputSchema = z.object({
76
+ walletAddress: z.string().min(32),
77
+ type: HotspotTypeSchema.optional(),
78
+ page: z.coerce.number().int().min(1).default(1),
79
+ limit: z.coerce.number().int().min(1).max(100).default(10)
80
+ });
81
+ var ClaimRewardsInputSchema = z.object({
82
+ walletAddress: z.string().min(32)
83
+ });
84
+ var GetPendingRewardsInputSchema = z.object({
85
+ walletAddress: z.string().min(32)
86
+ });
87
+ var TransferHotspotInputSchema = z.object({
88
+ walletAddress: z.string().min(32),
89
+ hotspotPubkey: z.string().min(1),
90
+ recipient: z.string().min(32)
91
+ });
92
+ var UpdateRewardsDestinationInputSchema = z.object({
93
+ walletAddress: z.string().min(32),
94
+ hotspotPubkey: z.string().min(1),
95
+ destination: z.string().min(32),
96
+ lazyDistributors: z.array(z.string().min(32)).min(1)
97
+ });
98
+ var GetSplitInputSchema = z.object({
99
+ walletAddress: z.string().min(32),
100
+ hotspotPubkey: z.string().min(1)
101
+ });
102
+ var SplitShareSchema = z.object({
103
+ wallet: z.string(),
104
+ delegate: z.string(),
105
+ fixed: z.number(),
106
+ shares: z.number()
107
+ });
108
+ var SplitResponseSchema = z.object({
109
+ walletAddress: z.string(),
110
+ hotspotPubkey: z.string(),
111
+ splitAddress: z.string(),
112
+ shares: z.array(SplitShareSchema)
113
+ });
114
+ var RewardSplitInputSchema = z.object({
115
+ address: z.string().min(32),
116
+ type: z.enum(["percentage", "fixed"]),
117
+ amount: z.number()
118
+ });
119
+ var ScheduleInputSchema = z.object({
120
+ frequency: z.enum(["daily", "weekly", "monthly"]),
121
+ time: z.string(),
122
+ timezone: z.string(),
123
+ dayOfWeek: z.string().optional(),
124
+ dayOfMonth: z.string().optional()
125
+ });
126
+ var CreateSplitInputSchema = z.object({
127
+ walletAddress: z.string().min(32),
128
+ hotspotPubkey: z.string().min(1),
129
+ rewardsSplit: z.array(RewardSplitInputSchema),
130
+ schedule: ScheduleInputSchema,
131
+ lazyDistributor: z.string().min(32)
132
+ });
133
+ var DeleteSplitInputSchema = z.object({
134
+ walletAddress: z.string().min(32),
135
+ hotspotPubkey: z.string().min(1)
136
+ });
137
+ var ClaimRewardsOutputSchema = z.object({
138
+ transactionData: TransactionDataSchema
139
+ });
140
+ var TransferHotspotOutputSchema = z.object({
141
+ transactionData: TransactionDataSchema
142
+ });
143
+ var UpdateRewardsDestinationOutputSchema = z.object({
144
+ transactionData: TransactionDataSchema
145
+ });
146
+ var CreateSplitOutputSchema = z.object({
147
+ transactionData: TransactionDataSchema
148
+ });
149
+ var DeleteSplitOutputSchema = z.object({
150
+ transactionData: TransactionDataSchema
151
+ });
152
+ var PendingRewardsOutputSchema = z.any();
153
+ var TokenAccountSchema = z.object({
154
+ mint: z.string(),
155
+ address: z.string(),
156
+ balance: z.string(),
157
+ decimals: z.number(),
158
+ uiAmount: z.number(),
159
+ symbol: z.string().optional(),
160
+ name: z.string().optional(),
161
+ logoURI: z.string().optional(),
162
+ priceUsd: z.number().optional(),
163
+ balanceUsd: z.number().optional()
164
+ });
165
+ var TokenBalanceDataSchema = z.object({
166
+ totalBalanceUsd: z.number(),
167
+ solBalance: z.number(),
168
+ solBalanceUsd: z.number(),
169
+ tokens: z.array(TokenAccountSchema)
170
+ });
171
+ var GetBalancesInputSchema = z.object({
172
+ walletAddress: z.string().min(32)
173
+ });
174
+ var TransferInputSchema = z.object({
175
+ walletAddress: z.string().min(32),
176
+ mint: z.string().nullable().optional(),
177
+ destination: z.string().min(32),
178
+ amount: z.string(),
179
+ decimals: z.number().optional()
180
+ });
181
+ var CreateHntAccountInputSchema = z.object({
182
+ walletAddress: z.string().min(32)
183
+ });
184
+ var TransferOutputSchema = z.object({
185
+ transactionData: TransactionDataSchema
186
+ });
187
+ var CreateHntAccountOutputSchema = z.object({
188
+ transactionData: TransactionDataSchema
189
+ });
190
+ var GetSwapTokensInputSchema = z.object({
191
+ limit: z.coerce.number().int().min(1).max(100).default(50)
192
+ });
193
+ var GetQuoteInputSchema = z.object({
194
+ inputMint: z.string().min(1),
195
+ outputMint: z.string().min(1),
196
+ amount: z.string().min(1),
197
+ swapMode: z.enum(["ExactIn", "ExactOut"]).default("ExactIn"),
198
+ slippageBps: z.coerce.number().min(0).max(1e4).default(50)
199
+ });
200
+ var QuoteResponseSchema = z.object({
201
+ inputMint: z.string(),
202
+ inAmount: z.string(),
203
+ outputMint: z.string(),
204
+ outAmount: z.string(),
205
+ otherAmountThreshold: z.string(),
206
+ swapMode: z.string(),
207
+ slippageBps: z.number(),
208
+ platformFee: z.unknown().optional(),
209
+ priceImpactPct: z.string(),
210
+ routePlan: z.array(z.unknown()),
211
+ contextSlot: z.number().optional(),
212
+ timeTaken: z.number().optional()
213
+ }).passthrough();
214
+ var GetInstructionsInputSchema = z.object({
215
+ quoteResponse: QuoteResponseSchema,
216
+ userPublicKey: z.string().min(1),
217
+ destinationTokenAccount: z.string().optional(),
218
+ dynamicComputeUnitLimit: z.boolean().default(true),
219
+ prioritizationFeeLamports: z.object({
220
+ priorityLevelWithMaxLamports: z.object({
221
+ maxLamports: z.number().default(1e6),
222
+ priorityLevel: z.enum(["low", "medium", "high"]).default("medium")
223
+ })
224
+ }).optional()
225
+ });
226
+ var SwapTokenSchema = z.object({
227
+ address: z.string(),
228
+ symbol: z.string(),
229
+ name: z.string(),
230
+ decimals: z.number(),
231
+ logoURI: z.string().optional(),
232
+ tags: z.array(z.string()).optional()
233
+ });
234
+ var SwapTokenListOutputSchema = z.object({
235
+ tokens: z.array(SwapTokenSchema)
236
+ });
237
+ var SubmitInputSchema = z.object({
238
+ transactions: z.array(TransactionItemSchema),
239
+ parallel: z.boolean(),
240
+ tag: z.string().optional()
241
+ });
242
+ var GetBatchInputSchema = z.object({
243
+ id: z.string(),
244
+ commitment: z.enum(["confirmed", "finalized"])
245
+ });
246
+ var ResubmitInputSchema = z.object({
247
+ id: z.string()
248
+ });
249
+ var GetByPayerInputSchema = z.object({
250
+ payer: z.string().min(32),
251
+ page: z.coerce.number().int().min(1).default(1),
252
+ limit: z.coerce.number().int().min(1).max(100).default(20),
253
+ status: z.string().optional().default("pending")
254
+ });
255
+ var GetByPayerAndTagInputSchema = z.object({
256
+ payer: z.string().min(32),
257
+ tag: z.string(),
258
+ page: z.coerce.number().int().min(1).default(1),
259
+ limit: z.coerce.number().int().min(1).max(100).default(20),
260
+ status: z.string().optional().default("pending")
261
+ });
262
+ var SubmitOutputSchema = z.object({
263
+ batchId: z.string(),
264
+ message: z.string().optional()
265
+ });
266
+ var TransactionStatusSchema = z.object({
267
+ signature: z.string(),
268
+ status: z.string(),
269
+ transaction: z.unknown().optional()
270
+ });
271
+ var BatchStatusOutputSchema = z.object({
272
+ batchId: z.string(),
273
+ status: z.string(),
274
+ submissionType: z.string(),
275
+ parallel: z.boolean(),
276
+ transactions: z.array(TransactionStatusSchema),
277
+ jitoBundleId: z.string().optional(),
278
+ jitoBundleStatus: z.unknown().optional()
279
+ });
280
+ var ResubmitOutputSchema = z.object({
281
+ success: z.boolean(),
282
+ message: z.string(),
283
+ error: z.string().optional(),
284
+ newSignatures: z.array(z.string()).optional()
285
+ });
286
+ var PayerBatchSummarySchema = z.object({
287
+ batchId: z.string(),
288
+ tag: z.string().optional(),
289
+ status: z.string(),
290
+ submissionType: z.string(),
291
+ parallel: z.boolean(),
292
+ createdAt: z.string(),
293
+ updatedAt: z.string(),
294
+ transactions: z.array(
295
+ z.object({
296
+ metadata: TransactionMetadataSchema.optional()
297
+ })
298
+ )
299
+ });
300
+ var PayerBatchesOutputSchema = z.object({
301
+ payer: z.string(),
302
+ batches: z.array(PayerBatchSummarySchema),
303
+ pagination: z.object({
304
+ page: z.number(),
305
+ limit: z.number(),
306
+ total: z.number(),
307
+ totalPages: z.number()
308
+ })
309
+ });
310
+ var RewardSplitSchema = z.object({
311
+ address: z.string(),
312
+ type: z.enum(["percentage", "fixed"]),
313
+ amount: z.number()
314
+ });
315
+ var ScheduleSchema = z.object({
316
+ frequency: z.enum(["daily", "weekly", "monthly"]),
317
+ time: z.string(),
318
+ timezone: z.string(),
319
+ dayOfWeek: z.string().optional(),
320
+ dayOfMonth: z.string().optional()
321
+ });
322
+ var WelcomePackWithStatusSchema = z.object({
323
+ address: z.string(),
324
+ id: z.number(),
325
+ owner: z.string(),
326
+ asset: z.string(),
327
+ lazyDistributor: z.string(),
328
+ rewardsMint: z.string(),
329
+ rentRefund: z.string(),
330
+ solAmount: z.string(),
331
+ rewardsSplit: z.array(RewardSplitSchema),
332
+ rewardsSchedule: z.string(),
333
+ assetReturnAddress: z.string(),
334
+ bumpSeed: z.number(),
335
+ uniqueId: z.string(),
336
+ loading: z.boolean().optional()
337
+ });
338
+ var WelcomePackSchema = z.object({
339
+ address: z.string(),
340
+ id: z.number(),
341
+ owner: z.string(),
342
+ asset: z.string(),
343
+ lazyDistributor: z.string(),
344
+ rewardsMint: z.string(),
345
+ rentRefund: z.string(),
346
+ solAmount: z.string(),
347
+ rewardsSplit: z.array(RewardSplitInputSchema),
348
+ rewardsSchedule: z.string(),
349
+ assetReturnAddress: z.string(),
350
+ bumpSeed: z.number(),
351
+ uniqueId: z.string(),
352
+ loading: z.boolean().optional(),
353
+ hotspot: HotspotSchema.nullable()
354
+ });
355
+ var WelcomePackListInputSchema = z.object({
356
+ walletAddress: z.string().min(32)
357
+ });
358
+ var WelcomePackCreateInputSchema = z.object({
359
+ walletAddress: z.string().min(32),
360
+ assetId: z.string(),
361
+ solAmount: z.number(),
362
+ rentRefund: z.string(),
363
+ assetReturnAddress: z.string(),
364
+ rewardsSplit: z.array(RewardSplitInputSchema),
365
+ schedule: ScheduleInputSchema,
366
+ lazyDistributor: z.string()
367
+ });
368
+ var WelcomePackGetInputSchema = z.object({
369
+ walletAddress: z.string().min(32),
370
+ packId: z.number()
371
+ });
372
+ var WelcomePackDeleteInputSchema = z.object({
373
+ walletAddress: z.string().min(32),
374
+ packId: z.number()
375
+ });
376
+ var WelcomePackGetByAddressInputSchema = z.object({
377
+ packAddress: z.string().min(32)
378
+ });
379
+ var WelcomePackClaimInputSchema = z.object({
380
+ packAddress: z.string().min(32),
381
+ walletAddress: z.string().min(32),
382
+ signature: z.string(),
383
+ expirationTs: z.string()
384
+ });
385
+ var WelcomePackInviteInputSchema = z.object({
386
+ packAddress: z.string().min(32),
387
+ walletAddress: z.string().min(32),
388
+ expirationDays: z.number().int().positive().max(365).default(7)
389
+ });
390
+ var WelcomePackListOutputSchema = z.array(WelcomePackSchema);
391
+ var WelcomePackCreateOutputSchema = z.object({
392
+ welcomePack: WelcomePackSchema,
393
+ transactionData: TransactionDataSchema
394
+ });
395
+ var WelcomePackDeleteOutputSchema = z.object({
396
+ transactionData: TransactionDataSchema
397
+ });
398
+ var WelcomePackClaimOutputSchema = z.object({
399
+ transactionData: TransactionDataSchema
400
+ });
401
+ var WelcomePackInviteOutputSchema = z.object({
402
+ message: z.string(),
403
+ expirationTs: z.number()
404
+ });
405
+ var InitKycInputSchema = z.object({
406
+ type: z.enum(["individual", "business"]).optional()
407
+ });
408
+ var CreateBankAccountInputSchema = z.object({
409
+ currency: z.string(),
410
+ account_type: z.string(),
411
+ bank_name: z.string(),
412
+ account_name: z.string(),
413
+ first_name: z.string().optional(),
414
+ last_name: z.string().optional(),
415
+ account_owner_name: z.string().optional(),
416
+ business_name: z.string().optional(),
417
+ account: z.object({
418
+ account_number: z.string(),
419
+ routing_number: z.string(),
420
+ checking_or_savings: z.string()
421
+ }),
422
+ address: z.object({
423
+ street_line_1: z.string(),
424
+ line2: z.string().optional(),
425
+ city: z.string(),
426
+ state: z.string(),
427
+ postal_code: z.string(),
428
+ country: z.string()
429
+ })
430
+ });
431
+ var GetBankAccountInputSchema = z.object({
432
+ id: z.string()
433
+ });
434
+ var DeleteBankAccountInputSchema = z.object({
435
+ id: z.number()
436
+ });
437
+ var GetSendQuoteInputSchema = z.object({
438
+ id: z.string(),
439
+ usdAmount: z.string()
440
+ });
441
+ var SendFundsInputSchema = z.object({
442
+ id: z.string(),
443
+ userAddress: z.string(),
444
+ quoteResponse: z.object({
445
+ inputMint: z.string(),
446
+ inAmount: z.string(),
447
+ outputMint: z.string(),
448
+ outAmount: z.string(),
449
+ otherAmountThreshold: z.string(),
450
+ swapMode: z.string(),
451
+ slippageBps: z.number(),
452
+ platformFee: z.unknown().optional(),
453
+ priceImpactPct: z.string(),
454
+ routePlan: z.array(z.unknown()),
455
+ contextSlot: z.number().optional(),
456
+ timeTaken: z.number().optional()
457
+ }).passthrough()
458
+ });
459
+ var GetTransferInputSchema = z.object({
460
+ id: z.string()
461
+ });
462
+ var UpdateTransferInputSchema = z.object({
463
+ id: z.string(),
464
+ solanaSignature: z.string()
465
+ });
466
+ var KycStatusOutputSchema = z.object({
467
+ kycStatus: z.string(),
468
+ tosStatus: z.string(),
469
+ tosLink: z.string().nullable(),
470
+ kycLink: z.string().nullable(),
471
+ kycLinkId: z.string().nullable(),
472
+ accountType: z.string().optional(),
473
+ rejectionReasons: z.array(z.string()).optional()
474
+ });
475
+ var FeesOutputSchema = z.object({
476
+ developer_fee: z.string(),
477
+ developer_fee_percent: z.number()
478
+ });
479
+ var BankAccountSchema = z.object({
480
+ id: z.number().optional(),
481
+ bridgeUserId: z.number().optional(),
482
+ bridgeExternalAccountId: z.string().optional(),
483
+ accountName: z.string().optional(),
484
+ bankName: z.string().optional(),
485
+ lastFourDigits: z.string().optional(),
486
+ routingNumber: z.string().optional(),
487
+ accountType: z.string().optional(),
488
+ createdAt: z.union([z.string(), z.date()]).optional(),
489
+ updatedAt: z.union([z.string(), z.date()]).optional()
490
+ }).passthrough();
491
+ var BankAccountListOutputSchema = z.array(BankAccountSchema);
492
+ var DeleteBankAccountOutputSchema = z.object({
493
+ success: z.boolean()
494
+ });
495
+ var BridgeTransferSchema = z.object({
496
+ id: z.string(),
497
+ state: z.string(),
498
+ source_deposit_instructions: z.object({
499
+ to_address: z.string()
500
+ })
501
+ }).passthrough();
502
+ var SendFundsOutputSchema = z.object({
503
+ bridgeTransfer: BridgeTransferSchema,
504
+ transactionData: TransactionDataSchema
505
+ });
506
+ var UpdateTransferOutputSchema = z.object({
507
+ success: z.boolean()
508
+ });
509
+ var FiatQuoteOutputSchema = QuoteResponseSchema;
510
+ var UNAUTHORIZED = {
511
+ status: 401,
512
+ message: "Authentication required. Please sign in to continue."
513
+ };
514
+ var FORBIDDEN = {
515
+ status: 403,
516
+ message: "You do not have permission to access this resource."
517
+ };
518
+ var NOT_FOUND = {
519
+ status: 404,
520
+ message: "The requested resource was not found."
521
+ };
522
+ var VALIDATION_ERROR = {
523
+ status: 400,
524
+ message: "Invalid input data provided.",
525
+ data: z.object({
526
+ fields: z.array(z.string()).optional()
527
+ })
528
+ };
529
+ var INSUFFICIENT_FUNDS = {
530
+ status: 400,
531
+ message: "Insufficient SOL balance to complete this transaction.",
532
+ data: z.object({
533
+ required: z.number(),
534
+ available: z.number()
535
+ })
536
+ };
537
+ var TRANSACTION_FAILED = {
538
+ status: 500,
539
+ message: "Transaction failed to execute.",
540
+ data: z.object({
541
+ logs: z.array(z.string()).optional(),
542
+ signature: z.string().optional()
543
+ })
544
+ };
545
+ var SIMULATION_FAILED = {
546
+ status: 400,
547
+ message: "Transaction simulation failed.",
548
+ data: z.object({
549
+ logs: z.array(z.string()).optional(),
550
+ link: z.string().optional()
551
+ })
552
+ };
553
+ var EXTERNAL_API_ERROR = {
554
+ status: 502,
555
+ message: "External service request failed.",
556
+ data: z.object({
557
+ service: z.string(),
558
+ statusCode: z.number().optional(),
559
+ details: z.string().optional()
560
+ })
561
+ };
562
+ var RATE_LIMITED = {
563
+ status: 429,
564
+ message: "Too many requests. Please try again later."
565
+ };
566
+ var CONFLICT = {
567
+ status: 409,
568
+ message: "A resource with this identifier already exists.",
569
+ data: z.object({
570
+ existingId: z.string().optional()
571
+ })
572
+ };
573
+ var NOT_OWNER = {
574
+ status: 403,
575
+ message: "You do not own this asset.",
576
+ data: z.object({
577
+ owner: z.string(),
578
+ wallet: z.string()
579
+ })
580
+ };
581
+ var INVALID_HOTSPOT = {
582
+ status: 400,
583
+ message: "The specified asset is not a valid Helium hotspot."
584
+ };
585
+ var KYC_REQUIRED = {
586
+ status: 403,
587
+ message: "KYC verification is required to perform this action.",
588
+ data: z.object({
589
+ kycStatus: z.string(),
590
+ kycLink: z.string().optional()
591
+ })
592
+ };
593
+ var commonErrors = {
594
+ UNAUTHORIZED,
595
+ FORBIDDEN,
596
+ NOT_FOUND,
597
+ VALIDATION_ERROR
598
+ };
599
+ var solanaErrors = {
600
+ INSUFFICIENT_FUNDS,
601
+ TRANSACTION_FAILED,
602
+ SIMULATION_FAILED
603
+ };
604
+ var hotspotErrors = {
605
+ NOT_OWNER,
606
+ INVALID_HOTSPOT,
607
+ NOT_FOUND
608
+ };
609
+ var fiatErrors = {
610
+ KYC_REQUIRED,
611
+ EXTERNAL_API_ERROR
612
+ };
613
+
614
+ export { BankAccountListOutputSchema, BankAccountSchema, BatchStatusOutputSchema, BridgeTransferSchema, CONFLICT, ClaimRewardsInputSchema, ClaimRewardsOutputSchema, CreateBankAccountInputSchema, CreateHntAccountInputSchema, CreateHntAccountOutputSchema, CreateSplitInputSchema, CreateSplitOutputSchema, DeleteBankAccountInputSchema, DeleteBankAccountOutputSchema, DeleteSplitInputSchema, DeleteSplitOutputSchema, DeviceTypeSchema, EXTERNAL_API_ERROR, ErrorResponseSchema, FORBIDDEN, FeesOutputSchema, FiatQuoteOutputSchema, GetBalancesInputSchema, GetBankAccountInputSchema, GetBatchInputSchema, GetByPayerAndTagInputSchema, GetByPayerInputSchema, GetHotspotsInputSchema, GetInstructionsInputSchema, GetPendingRewardsInputSchema, GetQuoteInputSchema, GetSendQuoteInputSchema, GetSplitInputSchema, GetSwapTokensInputSchema, GetTransferInputSchema, HotspotSchema, HotspotSharesSchema, HotspotTypeSchema, HotspotsDataSchema, INSUFFICIENT_FUNDS, INVALID_HOTSPOT, InitKycInputSchema, KYC_REQUIRED, KycStatusOutputSchema, NOT_FOUND, NOT_OWNER, OwnershipTypeSchema, PaginationInputSchema, PaginationOutputSchema, PayerBatchSummarySchema, PayerBatchesOutputSchema, PendingRewardsOutputSchema, PublicKeySchema, QuoteResponseSchema, RATE_LIMITED, ResubmitInputSchema, ResubmitOutputSchema, RewardSplitInputSchema, RewardSplitSchema, SIMULATION_FAILED, ScheduleInputSchema, ScheduleSchema, SendFundsInputSchema, SendFundsOutputSchema, SplitResponseSchema, SplitShareSchema, SubmitInputSchema, SubmitOutputSchema, SwapTokenListOutputSchema, SwapTokenSchema, TRANSACTION_FAILED, TokenAccountSchema, TokenBalanceDataSchema, TransactionBatchRequestSchema, TransactionBatchResponseSchema, TransactionDataSchema, TransactionItemSchema, TransactionMetadataSchema, TransactionStatusSchema, TransferHotspotInputSchema, TransferHotspotOutputSchema, TransferInputSchema, TransferOutputSchema, UNAUTHORIZED, UpdateRewardsDestinationInputSchema, UpdateRewardsDestinationOutputSchema, UpdateTransferInputSchema, UpdateTransferOutputSchema, VALIDATION_ERROR, WalletAddressSchema, WelcomePackClaimInputSchema, WelcomePackClaimOutputSchema, WelcomePackCreateInputSchema, WelcomePackCreateOutputSchema, WelcomePackDeleteInputSchema, WelcomePackDeleteOutputSchema, WelcomePackGetByAddressInputSchema, WelcomePackGetInputSchema, WelcomePackInviteInputSchema, WelcomePackInviteOutputSchema, WelcomePackListInputSchema, WelcomePackListOutputSchema, WelcomePackSchema, WelcomePackWithStatusSchema, commonErrors, fiatErrors, hotspotErrors, solanaErrors };
package/types/index.ts CHANGED
@@ -1,27 +1,30 @@
1
1
  /**
2
2
  * Type exports for @helium/blockchain-api
3
3
  *
4
- * This module exports the ORPC router types that can be used by external packages
5
- * to get full type safety when working with the blockchain API.
4
+ * This module exports:
5
+ * - ORPC router types for full type safety with API clients
6
+ * - Zod schemas for client-side validation
6
7
  *
7
8
  * @example
8
9
  * ```typescript
9
- * import type { BlockchainAPIClient, ORPCRouter } from "@helium/blockchain-api"
10
+ * import type { BlockchainAPIClient } from "@helium/blockchain-api"
10
11
  * import { createORPCClient } from "@orpc/client"
12
+ * import { HotspotSchema } from "@helium/blockchain-api"
11
13
  *
12
14
  * const client: BlockchainAPIClient = createORPCClient(link)
15
+ * const hotspot = HotspotSchema.parse(data)
13
16
  * ```
14
17
  */
15
18
 
16
- import { RouterClient } from "@orpc/server";
19
+ import type { RouterClient } from "@orpc/server";
17
20
 
18
- // Re-export the router type
19
- export type { ORPCRouter } from "../src/server/api";
21
+ // Re-export everything from generated
22
+ export * from "./generated/index";
20
23
 
21
24
  // Re-export RouterClient type for convenience
22
25
  export type { RouterClient } from "@orpc/server";
23
26
 
24
- // Export a helper type for creating typed clients
27
+ // Helper type for creating typed clients
25
28
  export type BlockchainAPIClient = RouterClient<
26
- import("../src/server/api").ORPCRouter
29
+ import("./generated/index").ORPCRouter
27
30
  >;