@sigrex/client 2.1.1

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,1840 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ BotWebhooksService: () => BotWebhooksService,
34
+ CexBotsService: () => CexBotsService,
35
+ CodeReactionsService: () => CodeReactionsService,
36
+ CodeStrategiesService: () => CodeStrategiesService,
37
+ DataWebhooksService: () => DataWebhooksService,
38
+ DexBotsService: () => DexBotsService,
39
+ ExchangeApiKeysService: () => ExchangeApiKeysService,
40
+ ExchangesService: () => ExchangesService,
41
+ LlmApiKeysService: () => LlmApiKeysService,
42
+ LlmReactionsService: () => LlmReactionsService,
43
+ LlmSessionsService: () => LlmSessionsService,
44
+ PredictionApiKeysService: () => PredictionApiKeysService,
45
+ PredictionBotsService: () => PredictionBotsService,
46
+ SigrexBaseClient: () => SigrexBaseClient,
47
+ SigrexClient: () => SigrexClient,
48
+ SigrexError: () => SigrexError,
49
+ generateHmacSignature: () => generateHmacSignature
50
+ });
51
+ module.exports = __toCommonJS(index_exports);
52
+
53
+ // src/crypto.ts
54
+ var import_crypto = __toESM(require("crypto"));
55
+ function generateHmacSignature(secret, method, path, timestamp, body) {
56
+ const methodUpper = method.toUpperCase();
57
+ const hasBody = (methodUpper === "POST" || methodUpper === "PUT") && body !== void 0 && body !== null;
58
+ const bodyStr = hasBody ? JSON.stringify(body) : "";
59
+ const message = methodUpper + path + bodyStr + timestamp;
60
+ return import_crypto.default.createHmac("sha256", secret).update(message).digest("hex");
61
+ }
62
+
63
+ // src/services/exchanges.ts
64
+ var ExchangesService = class {
65
+ constructor(client) {
66
+ this.client = client;
67
+ }
68
+ client;
69
+ /**
70
+ * Get all exchanges with optional filtering
71
+ */
72
+ async list(queryParams) {
73
+ return this.client.request({
74
+ method: "GET",
75
+ path: `/api/v2/exchange`,
76
+ queryParams
77
+ });
78
+ }
79
+ /**
80
+ * Get all CEX exchanges
81
+ */
82
+ async listCex() {
83
+ return this.client.request({
84
+ method: "GET",
85
+ path: `/api/v2/exchange/cex`
86
+ });
87
+ }
88
+ /**
89
+ * Get all DEX exchanges by chain ID
90
+ */
91
+ async getDex(chain) {
92
+ return this.client.request({
93
+ method: "GET",
94
+ path: `/api/v2/exchange/dex/${chain}`
95
+ });
96
+ }
97
+ /**
98
+ * Get all Prediction exchanges
99
+ */
100
+ async listPrediction() {
101
+ return this.client.request({
102
+ method: "GET",
103
+ path: `/api/v2/exchange/prediction`
104
+ });
105
+ }
106
+ /**
107
+ * Get all exchanges with exchange rates
108
+ */
109
+ async listWithExchangeRate() {
110
+ return this.client.request({
111
+ method: "GET",
112
+ path: `/api/v2/exchange/with-exchange-rate`
113
+ });
114
+ }
115
+ };
116
+
117
+ // src/services/llmSessions.ts
118
+ var LlmSessionsService = class {
119
+ constructor(client) {
120
+ this.client = client;
121
+ }
122
+ client;
123
+ /**
124
+ * Get all LLM sessions
125
+ */
126
+ async list() {
127
+ return this.client.request({
128
+ method: "GET",
129
+ path: `/api/v2/strategy/llm-session`
130
+ });
131
+ }
132
+ /**
133
+ * Create a new LLM session
134
+ */
135
+ async create(body) {
136
+ return this.client.request({
137
+ method: "POST",
138
+ path: `/api/v2/strategy/llm-session`,
139
+ body
140
+ });
141
+ }
142
+ /**
143
+ * Get the total number of LLM sessions
144
+ */
145
+ async getTotal() {
146
+ return this.client.request({
147
+ method: "GET",
148
+ path: `/api/v2/strategy/llm-session/total`
149
+ });
150
+ }
151
+ /**
152
+ * Get LLM session by ID
153
+ */
154
+ async get(id) {
155
+ return this.client.request({
156
+ method: "GET",
157
+ path: `/api/v2/strategy/llm-session/${id}`
158
+ });
159
+ }
160
+ /**
161
+ * Update LLM session
162
+ */
163
+ async update(id, body) {
164
+ return this.client.request({
165
+ method: "PUT",
166
+ path: `/api/v2/strategy/llm-session/${id}`,
167
+ body
168
+ });
169
+ }
170
+ /**
171
+ * Delete LLM session
172
+ */
173
+ async delete(id) {
174
+ return this.client.request({
175
+ method: "DELETE",
176
+ path: `/api/v2/strategy/llm-session/${id}`
177
+ });
178
+ }
179
+ /**
180
+ * Duplicate an LLM session
181
+ */
182
+ async duplicate(body) {
183
+ return this.client.request({
184
+ method: "POST",
185
+ path: `/api/v2/strategy/llm-session/duplicate`,
186
+ body
187
+ });
188
+ }
189
+ /**
190
+ * Reset LLM session triggers, history or responses
191
+ */
192
+ async reset(id, body) {
193
+ return this.client.request({
194
+ method: "PUT",
195
+ path: `/api/v2/strategy/llm-session/${id}/reset`,
196
+ body
197
+ });
198
+ }
199
+ /**
200
+ * Update LLM session status
201
+ */
202
+ async status(id, body) {
203
+ return this.client.request({
204
+ method: "PUT",
205
+ path: `/api/v2/strategy/llm-session/${id}/status`,
206
+ body
207
+ });
208
+ }
209
+ /**
210
+ * Update LLM session public visibility
211
+ */
212
+ async public(id, body) {
213
+ return this.client.request({
214
+ method: "PUT",
215
+ path: `/api/v2/strategy/llm-session/${id}/public`,
216
+ body
217
+ });
218
+ }
219
+ /**
220
+ * Get all LLM session folders
221
+ */
222
+ async listFolder() {
223
+ return this.client.request({
224
+ method: "GET",
225
+ path: `/api/v2/strategy/llm-session/folder`
226
+ });
227
+ }
228
+ /**
229
+ * Create a new LLM session folder
230
+ */
231
+ async postFolder(body) {
232
+ return this.client.request({
233
+ method: "POST",
234
+ path: `/api/v2/strategy/llm-session/folder`,
235
+ body
236
+ });
237
+ }
238
+ /**
239
+ * Get LLM Sessions from root folder
240
+ */
241
+ async listFolderRoot() {
242
+ return this.client.request({
243
+ method: "GET",
244
+ path: `/api/v2/strategy/llm-session/folder/root`
245
+ });
246
+ }
247
+ /**
248
+ * Get LLM session folder by ID
249
+ */
250
+ async getFolder(id) {
251
+ return this.client.request({
252
+ method: "GET",
253
+ path: `/api/v2/strategy/llm-session/folder/${id}`
254
+ });
255
+ }
256
+ /**
257
+ * Update LLM session folder
258
+ */
259
+ async updateFolder(id, body) {
260
+ return this.client.request({
261
+ method: "PUT",
262
+ path: `/api/v2/strategy/llm-session/folder/${id}`,
263
+ body
264
+ });
265
+ }
266
+ /**
267
+ * Delete LLM session folder
268
+ */
269
+ async deleteFolder(id) {
270
+ return this.client.request({
271
+ method: "DELETE",
272
+ path: `/api/v2/strategy/llm-session/folder/${id}`
273
+ });
274
+ }
275
+ };
276
+
277
+ // src/services/llmReactions.ts
278
+ var LlmReactionsService = class {
279
+ constructor(client) {
280
+ this.client = client;
281
+ }
282
+ client;
283
+ /**
284
+ * Get all LLM reactions
285
+ */
286
+ async list() {
287
+ return this.client.request({
288
+ method: "GET",
289
+ path: `/api/v2/strategy/reaction/llm`
290
+ });
291
+ }
292
+ /**
293
+ * Create a new LLM reaction
294
+ */
295
+ async create(body) {
296
+ return this.client.request({
297
+ method: "POST",
298
+ path: `/api/v2/strategy/reaction/llm`,
299
+ body
300
+ });
301
+ }
302
+ /**
303
+ * Get LLM reaction by ID
304
+ */
305
+ async get(id) {
306
+ return this.client.request({
307
+ method: "GET",
308
+ path: `/api/v2/strategy/reaction/llm/${id}`
309
+ });
310
+ }
311
+ /**
312
+ * Update LLM reaction
313
+ */
314
+ async update(id, body) {
315
+ return this.client.request({
316
+ method: "PUT",
317
+ path: `/api/v2/strategy/reaction/llm/${id}`,
318
+ body
319
+ });
320
+ }
321
+ /**
322
+ * Delete LLM reaction
323
+ */
324
+ async delete(id) {
325
+ return this.client.request({
326
+ method: "DELETE",
327
+ path: `/api/v2/strategy/reaction/llm/${id}`
328
+ });
329
+ }
330
+ /**
331
+ * Get the total number of LLM Reaction
332
+ */
333
+ async getTotal() {
334
+ return this.client.request({
335
+ method: "GET",
336
+ path: `/api/v2/strategy/reaction/llm/total`
337
+ });
338
+ }
339
+ /**
340
+ * Duplicate an LLM reaction
341
+ */
342
+ async duplicate(body) {
343
+ return this.client.request({
344
+ method: "POST",
345
+ path: `/api/v2/strategy/reaction/llm/duplicate`,
346
+ body
347
+ });
348
+ }
349
+ /**
350
+ * Reset LLM reaction triggers, history or responses
351
+ */
352
+ async reset(id, body) {
353
+ return this.client.request({
354
+ method: "PUT",
355
+ path: `/api/v2/strategy/reaction/llm/${id}/reset`,
356
+ body
357
+ });
358
+ }
359
+ /**
360
+ * Update LLM reaction status
361
+ */
362
+ async status(id, body) {
363
+ return this.client.request({
364
+ method: "PUT",
365
+ path: `/api/v2/strategy/reaction/llm/${id}/status`,
366
+ body
367
+ });
368
+ }
369
+ /**
370
+ * Update LLM reaction public visibility
371
+ */
372
+ async public(id, body) {
373
+ return this.client.request({
374
+ method: "PUT",
375
+ path: `/api/v2/strategy/reaction/llm/${id}/public`,
376
+ body
377
+ });
378
+ }
379
+ /**
380
+ * Get all LLM reaction folders
381
+ */
382
+ async listFolder() {
383
+ return this.client.request({
384
+ method: "GET",
385
+ path: `/api/v2/strategy/reaction/llm/folder`
386
+ });
387
+ }
388
+ /**
389
+ * Create a new LLM reaction folder
390
+ */
391
+ async postFolder(body) {
392
+ return this.client.request({
393
+ method: "POST",
394
+ path: `/api/v2/strategy/reaction/llm/folder`,
395
+ body
396
+ });
397
+ }
398
+ /**
399
+ * Get LLM reactions from root folder
400
+ */
401
+ async listFolderRoot() {
402
+ return this.client.request({
403
+ method: "GET",
404
+ path: `/api/v2/strategy/reaction/llm/folder/root`
405
+ });
406
+ }
407
+ /**
408
+ * Get LLM reaction folder by ID
409
+ */
410
+ async getFolder(id) {
411
+ return this.client.request({
412
+ method: "GET",
413
+ path: `/api/v2/strategy/reaction/llm/folder/${id}`
414
+ });
415
+ }
416
+ /**
417
+ * Update LLM reaction folder
418
+ */
419
+ async updateFolder(id, body) {
420
+ return this.client.request({
421
+ method: "PUT",
422
+ path: `/api/v2/strategy/reaction/llm/folder/${id}`,
423
+ body
424
+ });
425
+ }
426
+ /**
427
+ * Delete LLM reaction folder
428
+ */
429
+ async deleteFolder(id) {
430
+ return this.client.request({
431
+ method: "DELETE",
432
+ path: `/api/v2/strategy/reaction/llm/folder/${id}`
433
+ });
434
+ }
435
+ };
436
+
437
+ // src/services/codeReactions.ts
438
+ var CodeReactionsService = class {
439
+ constructor(client) {
440
+ this.client = client;
441
+ }
442
+ client;
443
+ /**
444
+ * Get all code reactions
445
+ */
446
+ async list() {
447
+ return this.client.request({
448
+ method: "GET",
449
+ path: `/api/v2/strategy/reaction/code`
450
+ });
451
+ }
452
+ /**
453
+ * Create a new code reaction
454
+ */
455
+ async create(body) {
456
+ return this.client.request({
457
+ method: "POST",
458
+ path: `/api/v2/strategy/reaction/code`,
459
+ body
460
+ });
461
+ }
462
+ /**
463
+ * Get the total number of Code Reactions
464
+ */
465
+ async getTotal() {
466
+ return this.client.request({
467
+ method: "GET",
468
+ path: `/api/v2/strategy/reaction/code/total`
469
+ });
470
+ }
471
+ /**
472
+ * Get code reaction by ID
473
+ */
474
+ async get(id) {
475
+ return this.client.request({
476
+ method: "GET",
477
+ path: `/api/v2/strategy/reaction/code/${id}`
478
+ });
479
+ }
480
+ /**
481
+ * Update code reaction
482
+ */
483
+ async update(id, body) {
484
+ return this.client.request({
485
+ method: "PUT",
486
+ path: `/api/v2/strategy/reaction/code/${id}`,
487
+ body
488
+ });
489
+ }
490
+ /**
491
+ * Delete code reaction
492
+ */
493
+ async delete(id) {
494
+ return this.client.request({
495
+ method: "DELETE",
496
+ path: `/api/v2/strategy/reaction/code/${id}`
497
+ });
498
+ }
499
+ /**
500
+ * Duplicate a code reaction
501
+ */
502
+ async duplicate(body) {
503
+ return this.client.request({
504
+ method: "POST",
505
+ path: `/api/v2/strategy/reaction/code/duplicate`,
506
+ body
507
+ });
508
+ }
509
+ /**
510
+ * Reset code reaction triggers and/or storage
511
+ */
512
+ async reset(id, body) {
513
+ return this.client.request({
514
+ method: "PUT",
515
+ path: `/api/v2/strategy/reaction/code/${id}/reset`,
516
+ body
517
+ });
518
+ }
519
+ /**
520
+ * Update code reaction status
521
+ */
522
+ async status(id, body) {
523
+ return this.client.request({
524
+ method: "PUT",
525
+ path: `/api/v2/strategy/reaction/code/${id}/status`,
526
+ body
527
+ });
528
+ }
529
+ /**
530
+ * Update code reaction public visibility
531
+ */
532
+ async public(id, body) {
533
+ return this.client.request({
534
+ method: "PUT",
535
+ path: `/api/v2/strategy/reaction/code/${id}/public`,
536
+ body
537
+ });
538
+ }
539
+ /**
540
+ * Delete code reaction storage
541
+ */
542
+ async store(id) {
543
+ return this.client.request({
544
+ method: "DELETE",
545
+ path: `/api/v2/strategy/reaction/code/${id}/store`
546
+ });
547
+ }
548
+ /**
549
+ * Get all code reaction folders
550
+ */
551
+ async listFolder() {
552
+ return this.client.request({
553
+ method: "GET",
554
+ path: `/api/v2/strategy/reaction/code/folder`
555
+ });
556
+ }
557
+ /**
558
+ * Create a new code reaction folder
559
+ */
560
+ async postFolder(body) {
561
+ return this.client.request({
562
+ method: "POST",
563
+ path: `/api/v2/strategy/reaction/code/folder`,
564
+ body
565
+ });
566
+ }
567
+ /**
568
+ * Get code reactions from root folder
569
+ */
570
+ async listFolderRoot() {
571
+ return this.client.request({
572
+ method: "GET",
573
+ path: `/api/v2/strategy/reaction/code/folder/root`
574
+ });
575
+ }
576
+ /**
577
+ * Get code reaction folder by ID
578
+ */
579
+ async getFolder(id) {
580
+ return this.client.request({
581
+ method: "GET",
582
+ path: `/api/v2/strategy/reaction/code/folder/${id}`
583
+ });
584
+ }
585
+ /**
586
+ * Update code reaction folder
587
+ */
588
+ async updateFolder(id, body) {
589
+ return this.client.request({
590
+ method: "PUT",
591
+ path: `/api/v2/strategy/reaction/code/folder/${id}`,
592
+ body
593
+ });
594
+ }
595
+ /**
596
+ * Delete code reaction folder
597
+ */
598
+ async deleteFolder(id) {
599
+ return this.client.request({
600
+ method: "DELETE",
601
+ path: `/api/v2/strategy/reaction/code/folder/${id}`
602
+ });
603
+ }
604
+ };
605
+
606
+ // src/services/codeStrategies.ts
607
+ var CodeStrategiesService = class {
608
+ constructor(client) {
609
+ this.client = client;
610
+ }
611
+ client;
612
+ /**
613
+ * Get all code strategies
614
+ */
615
+ async list() {
616
+ return this.client.request({
617
+ method: "GET",
618
+ path: `/api/v2/strategy/code`
619
+ });
620
+ }
621
+ /**
622
+ * Create a new code strategy
623
+ */
624
+ async create(body) {
625
+ return this.client.request({
626
+ method: "POST",
627
+ path: `/api/v2/strategy/code`,
628
+ body
629
+ });
630
+ }
631
+ /**
632
+ * Get the total number of Code Strategies
633
+ */
634
+ async getTotal() {
635
+ return this.client.request({
636
+ method: "GET",
637
+ path: `/api/v2/strategy/code/total`
638
+ });
639
+ }
640
+ /**
641
+ * Get code strategy by ID
642
+ */
643
+ async get(id) {
644
+ return this.client.request({
645
+ method: "GET",
646
+ path: `/api/v2/strategy/code/${id}`
647
+ });
648
+ }
649
+ /**
650
+ * Update code strategy
651
+ */
652
+ async update(id, body) {
653
+ return this.client.request({
654
+ method: "PUT",
655
+ path: `/api/v2/strategy/code/${id}`,
656
+ body
657
+ });
658
+ }
659
+ /**
660
+ * Delete code strategy
661
+ */
662
+ async delete(id) {
663
+ return this.client.request({
664
+ method: "DELETE",
665
+ path: `/api/v2/strategy/code/${id}`
666
+ });
667
+ }
668
+ /**
669
+ * Duplicate a code strategy
670
+ */
671
+ async duplicate(body) {
672
+ return this.client.request({
673
+ method: "POST",
674
+ path: `/api/v2/strategy/code/duplicate`,
675
+ body
676
+ });
677
+ }
678
+ /**
679
+ * Reset code strategy triggers and/or storage
680
+ */
681
+ async reset(id, body) {
682
+ return this.client.request({
683
+ method: "PUT",
684
+ path: `/api/v2/strategy/code/${id}/reset`,
685
+ body
686
+ });
687
+ }
688
+ /**
689
+ * Update code strategy status
690
+ */
691
+ async status(id, body) {
692
+ return this.client.request({
693
+ method: "PUT",
694
+ path: `/api/v2/strategy/code/${id}/status`,
695
+ body
696
+ });
697
+ }
698
+ /**
699
+ * Update code strategy public visibility
700
+ */
701
+ async public(id, body) {
702
+ return this.client.request({
703
+ method: "PUT",
704
+ path: `/api/v2/strategy/code/${id}/public`,
705
+ body
706
+ });
707
+ }
708
+ /**
709
+ * Delete code strategy storage
710
+ */
711
+ async store(id) {
712
+ return this.client.request({
713
+ method: "DELETE",
714
+ path: `/api/v2/strategy/code/${id}/store`
715
+ });
716
+ }
717
+ /**
718
+ * Get all code strategy folders
719
+ */
720
+ async listFolder() {
721
+ return this.client.request({
722
+ method: "GET",
723
+ path: `/api/v2/strategy/code/folder`
724
+ });
725
+ }
726
+ /**
727
+ * Create a new code strategy folder
728
+ */
729
+ async postFolder(body) {
730
+ return this.client.request({
731
+ method: "POST",
732
+ path: `/api/v2/strategy/code/folder`,
733
+ body
734
+ });
735
+ }
736
+ /**
737
+ * Get code strategies from root folder
738
+ */
739
+ async listFolderRoot() {
740
+ return this.client.request({
741
+ method: "GET",
742
+ path: `/api/v2/strategy/code/folder/root`
743
+ });
744
+ }
745
+ /**
746
+ * Get code strategy folder by ID
747
+ */
748
+ async getFolder(id) {
749
+ return this.client.request({
750
+ method: "GET",
751
+ path: `/api/v2/strategy/code/folder/${id}`
752
+ });
753
+ }
754
+ /**
755
+ * Update code strategy folder
756
+ */
757
+ async updateFolder(id, body) {
758
+ return this.client.request({
759
+ method: "PUT",
760
+ path: `/api/v2/strategy/code/folder/${id}`,
761
+ body
762
+ });
763
+ }
764
+ /**
765
+ * Delete code strategy folder
766
+ */
767
+ async deleteFolder(id) {
768
+ return this.client.request({
769
+ method: "DELETE",
770
+ path: `/api/v2/strategy/code/folder/${id}`
771
+ });
772
+ }
773
+ };
774
+
775
+ // src/services/cexBots.ts
776
+ var CexBotsService = class {
777
+ constructor(client) {
778
+ this.client = client;
779
+ }
780
+ client;
781
+ /**
782
+ * Get all CEX signal bots
783
+ */
784
+ async list() {
785
+ return this.client.request({
786
+ method: "GET",
787
+ path: `/api/v2/bot/signal/cex`
788
+ });
789
+ }
790
+ /**
791
+ * Create a new CEX signal bot
792
+ */
793
+ async create(body) {
794
+ return this.client.request({
795
+ method: "POST",
796
+ path: `/api/v2/bot/signal/cex`,
797
+ body
798
+ });
799
+ }
800
+ /**
801
+ * Get the total number of CEX signal bots
802
+ */
803
+ async getTotal() {
804
+ return this.client.request({
805
+ method: "GET",
806
+ path: `/api/v2/bot/signal/cex/total`
807
+ });
808
+ }
809
+ /**
810
+ * Get CEX signal bot by ID
811
+ */
812
+ async get(id) {
813
+ return this.client.request({
814
+ method: "GET",
815
+ path: `/api/v2/bot/signal/cex/${id}`
816
+ });
817
+ }
818
+ /**
819
+ * Update CEX signal bot
820
+ */
821
+ async update(id, body) {
822
+ return this.client.request({
823
+ method: "PUT",
824
+ path: `/api/v2/bot/signal/cex/${id}`,
825
+ body
826
+ });
827
+ }
828
+ /**
829
+ * Delete CEX signal bot
830
+ */
831
+ async delete(id) {
832
+ return this.client.request({
833
+ method: "DELETE",
834
+ path: `/api/v2/bot/signal/cex/${id}`
835
+ });
836
+ }
837
+ /**
838
+ * Update CEX signal bot status
839
+ */
840
+ async status(id, body) {
841
+ return this.client.request({
842
+ method: "PUT",
843
+ path: `/api/v2/bot/signal/cex/${id}/status`,
844
+ body
845
+ });
846
+ }
847
+ /**
848
+ * Duplicate a CEX signal bot
849
+ */
850
+ async duplicate(body) {
851
+ return this.client.request({
852
+ method: "POST",
853
+ path: `/api/v2/bot/signal/cex/duplicate`,
854
+ body
855
+ });
856
+ }
857
+ /**
858
+ * Get all CEX signal bot folders
859
+ */
860
+ async listFolder() {
861
+ return this.client.request({
862
+ method: "GET",
863
+ path: `/api/v2/bot/signal/cex/folder`
864
+ });
865
+ }
866
+ /**
867
+ * Create a new CEX signal bot folder
868
+ */
869
+ async postFolder(body) {
870
+ return this.client.request({
871
+ method: "POST",
872
+ path: `/api/v2/bot/signal/cex/folder`,
873
+ body
874
+ });
875
+ }
876
+ /**
877
+ * Get CEX signal bots from root folder
878
+ */
879
+ async listFolderRoot() {
880
+ return this.client.request({
881
+ method: "GET",
882
+ path: `/api/v2/bot/signal/cex/folder/root`
883
+ });
884
+ }
885
+ /**
886
+ * Get CEX signal bot folder by ID
887
+ */
888
+ async getFolder(id) {
889
+ return this.client.request({
890
+ method: "GET",
891
+ path: `/api/v2/bot/signal/cex/folder/${id}`
892
+ });
893
+ }
894
+ /**
895
+ * Update CEX signal bot folder
896
+ */
897
+ async updateFolder(id, body) {
898
+ return this.client.request({
899
+ method: "PUT",
900
+ path: `/api/v2/bot/signal/cex/folder/${id}`,
901
+ body
902
+ });
903
+ }
904
+ /**
905
+ * Delete CEX signal bot folder
906
+ */
907
+ async deleteFolder(id) {
908
+ return this.client.request({
909
+ method: "DELETE",
910
+ path: `/api/v2/bot/signal/cex/folder/${id}`
911
+ });
912
+ }
913
+ };
914
+
915
+ // src/services/predictionBots.ts
916
+ var PredictionBotsService = class {
917
+ constructor(client) {
918
+ this.client = client;
919
+ }
920
+ client;
921
+ /**
922
+ * Get prediction market by slug
923
+ */
924
+ async getMarket(slug) {
925
+ return this.client.request({
926
+ method: "GET",
927
+ path: `/api/v2/bot/signal/prediction/market/${slug}`
928
+ });
929
+ }
930
+ /**
931
+ * Get all prediction signal bots
932
+ */
933
+ async list() {
934
+ return this.client.request({
935
+ method: "GET",
936
+ path: `/api/v2/bot/signal/prediction`
937
+ });
938
+ }
939
+ /**
940
+ * Create a new prediction signal bot
941
+ */
942
+ async create(body) {
943
+ return this.client.request({
944
+ method: "POST",
945
+ path: `/api/v2/bot/signal/prediction`,
946
+ body
947
+ });
948
+ }
949
+ /**
950
+ * Get the total number of Prediction signal bots
951
+ */
952
+ async getTotal() {
953
+ return this.client.request({
954
+ method: "GET",
955
+ path: `/api/v2/bot/signal/prediction/total`
956
+ });
957
+ }
958
+ /**
959
+ * Get prediction signal bot by ID
960
+ */
961
+ async get(id) {
962
+ return this.client.request({
963
+ method: "GET",
964
+ path: `/api/v2/bot/signal/prediction/${id}`
965
+ });
966
+ }
967
+ /**
968
+ * Update prediction signal bot
969
+ */
970
+ async update(id, body) {
971
+ return this.client.request({
972
+ method: "PUT",
973
+ path: `/api/v2/bot/signal/prediction/${id}`,
974
+ body
975
+ });
976
+ }
977
+ /**
978
+ * Delete prediction signal bot
979
+ */
980
+ async delete(id) {
981
+ return this.client.request({
982
+ method: "DELETE",
983
+ path: `/api/v2/bot/signal/prediction/${id}`
984
+ });
985
+ }
986
+ /**
987
+ * Update prediction signal bot status
988
+ */
989
+ async status(id, body) {
990
+ return this.client.request({
991
+ method: "PUT",
992
+ path: `/api/v2/bot/signal/prediction/${id}/status`,
993
+ body
994
+ });
995
+ }
996
+ /**
997
+ * Duplicate a prediction signal bot
998
+ */
999
+ async duplicate(body) {
1000
+ return this.client.request({
1001
+ method: "POST",
1002
+ path: `/api/v2/bot/signal/prediction/duplicate`,
1003
+ body
1004
+ });
1005
+ }
1006
+ /**
1007
+ * Get all prediction signal bot folders
1008
+ */
1009
+ async listFolder() {
1010
+ return this.client.request({
1011
+ method: "GET",
1012
+ path: `/api/v2/bot/signal/prediction/folder`
1013
+ });
1014
+ }
1015
+ /**
1016
+ * Create a new prediction signal bot folder
1017
+ */
1018
+ async postFolder(body) {
1019
+ return this.client.request({
1020
+ method: "POST",
1021
+ path: `/api/v2/bot/signal/prediction/folder`,
1022
+ body
1023
+ });
1024
+ }
1025
+ /**
1026
+ * Get prediction signal bots from root folder
1027
+ */
1028
+ async listFolderRoot() {
1029
+ return this.client.request({
1030
+ method: "GET",
1031
+ path: `/api/v2/bot/signal/prediction/folder/root`
1032
+ });
1033
+ }
1034
+ /**
1035
+ * Get prediction signal bot folder by ID
1036
+ */
1037
+ async getFolder(id) {
1038
+ return this.client.request({
1039
+ method: "GET",
1040
+ path: `/api/v2/bot/signal/prediction/folder/${id}`
1041
+ });
1042
+ }
1043
+ /**
1044
+ * Update prediction signal bot folder
1045
+ */
1046
+ async updateFolder(id, body) {
1047
+ return this.client.request({
1048
+ method: "PUT",
1049
+ path: `/api/v2/bot/signal/prediction/folder/${id}`,
1050
+ body
1051
+ });
1052
+ }
1053
+ /**
1054
+ * Delete prediction signal bot folder
1055
+ */
1056
+ async deleteFolder(id) {
1057
+ return this.client.request({
1058
+ method: "DELETE",
1059
+ path: `/api/v2/bot/signal/prediction/folder/${id}`
1060
+ });
1061
+ }
1062
+ };
1063
+
1064
+ // src/services/dexBots.ts
1065
+ var DexBotsService = class {
1066
+ constructor(client) {
1067
+ this.client = client;
1068
+ }
1069
+ client;
1070
+ /**
1071
+ * Get all DEX signal bots
1072
+ */
1073
+ async list() {
1074
+ return this.client.request({
1075
+ method: "GET",
1076
+ path: `/api/v2/bot/signal/dex`
1077
+ });
1078
+ }
1079
+ /**
1080
+ * Create a new DEX signal bot
1081
+ */
1082
+ async create(body) {
1083
+ return this.client.request({
1084
+ method: "POST",
1085
+ path: `/api/v2/bot/signal/dex`,
1086
+ body
1087
+ });
1088
+ }
1089
+ /**
1090
+ * Get the total number of DEX signal bots
1091
+ */
1092
+ async getTotal() {
1093
+ return this.client.request({
1094
+ method: "GET",
1095
+ path: `/api/v2/bot/signal/dex/total`
1096
+ });
1097
+ }
1098
+ /**
1099
+ * Get DEX signal bot by ID
1100
+ */
1101
+ async get(id) {
1102
+ return this.client.request({
1103
+ method: "GET",
1104
+ path: `/api/v2/bot/signal/dex/${id}`
1105
+ });
1106
+ }
1107
+ /**
1108
+ * Update DEX signal bot
1109
+ */
1110
+ async update(id, body) {
1111
+ return this.client.request({
1112
+ method: "PUT",
1113
+ path: `/api/v2/bot/signal/dex/${id}`,
1114
+ body
1115
+ });
1116
+ }
1117
+ /**
1118
+ * Delete DEX signal bot
1119
+ */
1120
+ async delete(id) {
1121
+ return this.client.request({
1122
+ method: "DELETE",
1123
+ path: `/api/v2/bot/signal/dex/${id}`
1124
+ });
1125
+ }
1126
+ /**
1127
+ * Get DEX signal bot by chain and address
1128
+ */
1129
+ async getByChainAndAddress(chainId, address) {
1130
+ return this.client.request({
1131
+ method: "GET",
1132
+ path: `/api/v2/bot/signal/dex/${chainId}/${address}`
1133
+ });
1134
+ }
1135
+ /**
1136
+ * Get bot factory by chain and exchange
1137
+ */
1138
+ async getFactory(chainId, exchangeId) {
1139
+ return this.client.request({
1140
+ method: "GET",
1141
+ path: `/api/v2/bot/signal/dex/factory/${chainId}/${exchangeId}`
1142
+ });
1143
+ }
1144
+ /**
1145
+ * Update DEX signal bot status
1146
+ */
1147
+ async status(id, body) {
1148
+ return this.client.request({
1149
+ method: "PUT",
1150
+ path: `/api/v2/bot/signal/dex/${id}/status`,
1151
+ body
1152
+ });
1153
+ }
1154
+ /**
1155
+ * Get all DEX signal bot folders
1156
+ */
1157
+ async listFolder() {
1158
+ return this.client.request({
1159
+ method: "GET",
1160
+ path: `/api/v2/bot/signal/dex/folder`
1161
+ });
1162
+ }
1163
+ /**
1164
+ * Create a new DEX signal bot folder
1165
+ */
1166
+ async postFolder(body) {
1167
+ return this.client.request({
1168
+ method: "POST",
1169
+ path: `/api/v2/bot/signal/dex/folder`,
1170
+ body
1171
+ });
1172
+ }
1173
+ /**
1174
+ * Get DEX signal bots from root folder
1175
+ */
1176
+ async listFolderRoot() {
1177
+ return this.client.request({
1178
+ method: "GET",
1179
+ path: `/api/v2/bot/signal/dex/folder/root`
1180
+ });
1181
+ }
1182
+ /**
1183
+ * Get DEX signal bot folder by ID
1184
+ */
1185
+ async getFolder(id) {
1186
+ return this.client.request({
1187
+ method: "GET",
1188
+ path: `/api/v2/bot/signal/dex/folder/${id}`
1189
+ });
1190
+ }
1191
+ /**
1192
+ * Update DEX signal bot folder
1193
+ */
1194
+ async updateFolder(id, body) {
1195
+ return this.client.request({
1196
+ method: "PUT",
1197
+ path: `/api/v2/bot/signal/dex/folder/${id}`,
1198
+ body
1199
+ });
1200
+ }
1201
+ /**
1202
+ * Delete DEX signal bot folder
1203
+ */
1204
+ async deleteFolder(id) {
1205
+ return this.client.request({
1206
+ method: "DELETE",
1207
+ path: `/api/v2/bot/signal/dex/folder/${id}`
1208
+ });
1209
+ }
1210
+ };
1211
+
1212
+ // src/services/botWebhooks.ts
1213
+ var BotWebhooksService = class {
1214
+ constructor(client) {
1215
+ this.client = client;
1216
+ }
1217
+ client;
1218
+ /**
1219
+ * Get all bot webhooks
1220
+ */
1221
+ async list() {
1222
+ return this.client.request({
1223
+ method: "GET",
1224
+ path: `/api/v2/webhook/bot`
1225
+ });
1226
+ }
1227
+ /**
1228
+ * Create a new bot webhook
1229
+ */
1230
+ async create(body) {
1231
+ return this.client.request({
1232
+ method: "POST",
1233
+ path: `/api/v2/webhook/bot`,
1234
+ body
1235
+ });
1236
+ }
1237
+ /**
1238
+ * Get bot webhook by ID
1239
+ */
1240
+ async get(id) {
1241
+ return this.client.request({
1242
+ method: "GET",
1243
+ path: `/api/v2/webhook/bot/${id}`
1244
+ });
1245
+ }
1246
+ /**
1247
+ * Update bot webhook
1248
+ */
1249
+ async update(id, body) {
1250
+ return this.client.request({
1251
+ method: "PUT",
1252
+ path: `/api/v2/webhook/bot/${id}`,
1253
+ body
1254
+ });
1255
+ }
1256
+ /**
1257
+ * Delete bot webhook
1258
+ */
1259
+ async delete(id) {
1260
+ return this.client.request({
1261
+ method: "DELETE",
1262
+ path: `/api/v2/webhook/bot/${id}`
1263
+ });
1264
+ }
1265
+ /**
1266
+ * Get webhook shares
1267
+ */
1268
+ async shares(id) {
1269
+ return this.client.request({
1270
+ method: "GET",
1271
+ path: `/api/v2/webhook/bot/${id}/shares`
1272
+ });
1273
+ }
1274
+ /**
1275
+ * Share webhook with user
1276
+ */
1277
+ async(id, body) {
1278
+ return this.client.request({
1279
+ method: "POST",
1280
+ path: `/api/v2/webhook/bot/share/${id}`,
1281
+ body
1282
+ });
1283
+ }
1284
+ /**
1285
+ * Remove webhook share
1286
+ */
1287
+ async deleteShare(id, body) {
1288
+ return this.client.request({
1289
+ method: "DELETE",
1290
+ path: `/api/v2/webhook/bot/share/${id}`,
1291
+ body
1292
+ });
1293
+ }
1294
+ /**
1295
+ * Get CEX signal bots for webhook
1296
+ */
1297
+ async listBotSignalCex(id, queryParams) {
1298
+ return this.client.request({
1299
+ method: "GET",
1300
+ path: `/api/v2/webhook/bot/bot/signal/${id}/cex`,
1301
+ queryParams
1302
+ });
1303
+ }
1304
+ /**
1305
+ * Get DEX signal bots for webhook
1306
+ */
1307
+ async listBotSignalDex(id, queryParams) {
1308
+ return this.client.request({
1309
+ method: "GET",
1310
+ path: `/api/v2/webhook/bot/bot/signal/${id}/dex`,
1311
+ queryParams
1312
+ });
1313
+ }
1314
+ /**
1315
+ * Get prediction signal bots by webhook ID
1316
+ */
1317
+ async listBotSignalPrediction(id, queryParams) {
1318
+ return this.client.request({
1319
+ method: "GET",
1320
+ path: `/api/v2/webhook/bot/bot/signal/${id}/prediction`,
1321
+ queryParams
1322
+ });
1323
+ }
1324
+ /**
1325
+ * Update webhook status
1326
+ */
1327
+ async status(id, body) {
1328
+ return this.client.request({
1329
+ method: "PUT",
1330
+ path: `/api/v2/webhook/bot/${id}/status`,
1331
+ body
1332
+ });
1333
+ }
1334
+ /**
1335
+ * Get all shared webhooks for user
1336
+ */
1337
+ async listShared() {
1338
+ return this.client.request({
1339
+ method: "GET",
1340
+ path: `/api/v2/webhook/bot/shared`
1341
+ });
1342
+ }
1343
+ /**
1344
+ * Get webhooks shared with specific user
1345
+ */
1346
+ async getWithShared(id) {
1347
+ return this.client.request({
1348
+ method: "GET",
1349
+ path: `/api/v2/webhook/bot/shared/with/${id}`
1350
+ });
1351
+ }
1352
+ /**
1353
+ * Get webhooks shared by specific user
1354
+ */
1355
+ async getByShared(id) {
1356
+ return this.client.request({
1357
+ method: "GET",
1358
+ path: `/api/v2/webhook/bot/shared/by/${id}`
1359
+ });
1360
+ }
1361
+ };
1362
+
1363
+ // src/services/dataWebhooks.ts
1364
+ var DataWebhooksService = class {
1365
+ constructor(client) {
1366
+ this.client = client;
1367
+ }
1368
+ client;
1369
+ /**
1370
+ * Get all data webhooks
1371
+ */
1372
+ async list() {
1373
+ return this.client.request({
1374
+ method: "GET",
1375
+ path: `/api/v2/webhook/data`
1376
+ });
1377
+ }
1378
+ /**
1379
+ * Create a new data webhook
1380
+ */
1381
+ async create(body) {
1382
+ return this.client.request({
1383
+ method: "POST",
1384
+ path: `/api/v2/webhook/data`,
1385
+ body
1386
+ });
1387
+ }
1388
+ /**
1389
+ * Get data webhook by ID
1390
+ */
1391
+ async get(id) {
1392
+ return this.client.request({
1393
+ method: "GET",
1394
+ path: `/api/v2/webhook/data/${id}`
1395
+ });
1396
+ }
1397
+ /**
1398
+ * Update data webhook
1399
+ */
1400
+ async update(id, body) {
1401
+ return this.client.request({
1402
+ method: "PUT",
1403
+ path: `/api/v2/webhook/data/${id}`,
1404
+ body
1405
+ });
1406
+ }
1407
+ /**
1408
+ * Delete data webhook
1409
+ */
1410
+ async delete(id) {
1411
+ return this.client.request({
1412
+ method: "DELETE",
1413
+ path: `/api/v2/webhook/data/${id}`
1414
+ });
1415
+ }
1416
+ /**
1417
+ * Get webhook shares
1418
+ */
1419
+ async shares(id) {
1420
+ return this.client.request({
1421
+ method: "GET",
1422
+ path: `/api/v2/webhook/data/${id}/shares`
1423
+ });
1424
+ }
1425
+ /**
1426
+ * Get LLM reactions for webhook
1427
+ */
1428
+ async llmReactions(id, queryParams) {
1429
+ return this.client.request({
1430
+ method: "GET",
1431
+ path: `/api/v2/webhook/data/${id}/llm-reactions`,
1432
+ queryParams
1433
+ });
1434
+ }
1435
+ /**
1436
+ * Get code reactions for webhook
1437
+ */
1438
+ async codeReactions(id, queryParams) {
1439
+ return this.client.request({
1440
+ method: "GET",
1441
+ path: `/api/v2/webhook/data/${id}/code-reactions`,
1442
+ queryParams
1443
+ });
1444
+ }
1445
+ /**
1446
+ * Share webhook with user
1447
+ */
1448
+ async(id, body) {
1449
+ return this.client.request({
1450
+ method: "POST",
1451
+ path: `/api/v2/webhook/data/share/${id}`,
1452
+ body
1453
+ });
1454
+ }
1455
+ /**
1456
+ * Remove webhook share
1457
+ */
1458
+ async deleteShare(id, body) {
1459
+ return this.client.request({
1460
+ method: "DELETE",
1461
+ path: `/api/v2/webhook/data/share/${id}`,
1462
+ body
1463
+ });
1464
+ }
1465
+ /**
1466
+ * Update webhook status
1467
+ */
1468
+ async status(id, body) {
1469
+ return this.client.request({
1470
+ method: "PUT",
1471
+ path: `/api/v2/webhook/data/${id}/status`,
1472
+ body
1473
+ });
1474
+ }
1475
+ /**
1476
+ * Get all shared data webhooks for user
1477
+ */
1478
+ async listShared() {
1479
+ return this.client.request({
1480
+ method: "GET",
1481
+ path: `/api/v2/webhook/data/shared`
1482
+ });
1483
+ }
1484
+ /**
1485
+ * Get data webhooks shared with specific user
1486
+ */
1487
+ async getWithShared(id) {
1488
+ return this.client.request({
1489
+ method: "GET",
1490
+ path: `/api/v2/webhook/data/shared/with/${id}`
1491
+ });
1492
+ }
1493
+ /**
1494
+ * Get data webhooks shared by specific user
1495
+ */
1496
+ async getByShared(id) {
1497
+ return this.client.request({
1498
+ method: "GET",
1499
+ path: `/api/v2/webhook/data/shared/by/${id}`
1500
+ });
1501
+ }
1502
+ };
1503
+
1504
+ // src/services/exchangeApiKeys.ts
1505
+ var ExchangeApiKeysService = class {
1506
+ constructor(client) {
1507
+ this.client = client;
1508
+ }
1509
+ client;
1510
+ /**
1511
+ * Get all exchange API keys for user
1512
+ */
1513
+ async list() {
1514
+ return this.client.request({
1515
+ method: "GET",
1516
+ path: `/api/v2/api/exchange`
1517
+ });
1518
+ }
1519
+ /**
1520
+ * Create a new exchange API key
1521
+ */
1522
+ async create(body) {
1523
+ return this.client.request({
1524
+ method: "POST",
1525
+ path: `/api/v2/api/exchange`,
1526
+ body
1527
+ });
1528
+ }
1529
+ /**
1530
+ * Get signal bots that use an API key
1531
+ */
1532
+ async getSignalBot(id, queryParams) {
1533
+ return this.client.request({
1534
+ method: "GET",
1535
+ path: `/api/v2/api/exchange/bot/signal/${id}`,
1536
+ queryParams
1537
+ });
1538
+ }
1539
+ /**
1540
+ * Update API key status
1541
+ */
1542
+ async status(id, body) {
1543
+ return this.client.request({
1544
+ method: "PUT",
1545
+ path: `/api/v2/api/exchange/${id}/status`,
1546
+ body
1547
+ });
1548
+ }
1549
+ /**
1550
+ * Delete an exchange API key
1551
+ */
1552
+ async delete(id) {
1553
+ return this.client.request({
1554
+ method: "DELETE",
1555
+ path: `/api/v2/api/exchange/${id}`
1556
+ });
1557
+ }
1558
+ /**
1559
+ * Test exchange API key credentials
1560
+ */
1561
+ async postTest(body) {
1562
+ return this.client.request({
1563
+ method: "POST",
1564
+ path: `/api/v2/api/exchange/test`,
1565
+ body
1566
+ });
1567
+ }
1568
+ };
1569
+
1570
+ // src/services/llmApiKeys.ts
1571
+ var LlmApiKeysService = class {
1572
+ constructor(client) {
1573
+ this.client = client;
1574
+ }
1575
+ client;
1576
+ /**
1577
+ * Get all enabled LLM services
1578
+ */
1579
+ async listServices() {
1580
+ return this.client.request({
1581
+ method: "GET",
1582
+ path: `/api/v2/api/llm/services`
1583
+ });
1584
+ }
1585
+ /**
1586
+ * Get models for a specific service
1587
+ */
1588
+ async getModels(serviceId) {
1589
+ return this.client.request({
1590
+ method: "GET",
1591
+ path: `/api/v2/api/llm/models/${serviceId}`
1592
+ });
1593
+ }
1594
+ /**
1595
+ * Update model for an API key
1596
+ */
1597
+ async model(id, body) {
1598
+ return this.client.request({
1599
+ method: "PUT",
1600
+ path: `/api/v2/api/llm/${id}/model`,
1601
+ body
1602
+ });
1603
+ }
1604
+ /**
1605
+ * Get all LLM API keys for user
1606
+ */
1607
+ async list() {
1608
+ return this.client.request({
1609
+ method: "GET",
1610
+ path: `/api/v2/api/llm`
1611
+ });
1612
+ }
1613
+ /**
1614
+ * Create a new LLM API key
1615
+ */
1616
+ async create(body) {
1617
+ return this.client.request({
1618
+ method: "POST",
1619
+ path: `/api/v2/api/llm`,
1620
+ body
1621
+ });
1622
+ }
1623
+ /**
1624
+ * Delete an LLM API key
1625
+ */
1626
+ async delete(id) {
1627
+ return this.client.request({
1628
+ method: "DELETE",
1629
+ path: `/api/v2/api/llm/${id}`
1630
+ });
1631
+ }
1632
+ };
1633
+
1634
+ // src/services/predictionApiKeys.ts
1635
+ var PredictionApiKeysService = class {
1636
+ constructor(client) {
1637
+ this.client = client;
1638
+ }
1639
+ client;
1640
+ /**
1641
+ * Get all prediction API keys
1642
+ */
1643
+ async list() {
1644
+ return this.client.request({
1645
+ method: "GET",
1646
+ path: `/api/v2/api/prediction`
1647
+ });
1648
+ }
1649
+ /**
1650
+ * Create a new prediction API key
1651
+ */
1652
+ async create(body) {
1653
+ return this.client.request({
1654
+ method: "POST",
1655
+ path: `/api/v2/api/prediction`,
1656
+ body
1657
+ });
1658
+ }
1659
+ /**
1660
+ * Get prediction signal bots by API ID
1661
+ */
1662
+ async getSignalBot(id, queryParams) {
1663
+ return this.client.request({
1664
+ method: "GET",
1665
+ path: `/api/v2/api/prediction/bot/signal/${id}`,
1666
+ queryParams
1667
+ });
1668
+ }
1669
+ /**
1670
+ * Update prediction API key status
1671
+ */
1672
+ async status(id, body) {
1673
+ return this.client.request({
1674
+ method: "PUT",
1675
+ path: `/api/v2/api/prediction/${id}/status`,
1676
+ body
1677
+ });
1678
+ }
1679
+ /**
1680
+ * Delete prediction API key
1681
+ */
1682
+ async delete(id) {
1683
+ return this.client.request({
1684
+ method: "DELETE",
1685
+ path: `/api/v2/api/prediction/${id}`
1686
+ });
1687
+ }
1688
+ /**
1689
+ * Test prediction API credentials
1690
+ */
1691
+ async postTest(body) {
1692
+ return this.client.request({
1693
+ method: "POST",
1694
+ path: `/api/v2/api/prediction/test`,
1695
+ body
1696
+ });
1697
+ }
1698
+ };
1699
+
1700
+ // src/client.ts
1701
+ var SigrexError = class extends Error {
1702
+ status;
1703
+ statusText;
1704
+ body;
1705
+ constructor(status, statusText, body) {
1706
+ const message = body?.error || body?.message || `${status} ${statusText}`;
1707
+ super(message);
1708
+ this.name = "SigrexError";
1709
+ this.status = status;
1710
+ this.statusText = statusText;
1711
+ this.body = body;
1712
+ }
1713
+ };
1714
+ var SigrexBaseClient = class {
1715
+ options;
1716
+ constructor(options) {
1717
+ if (!options.apiKey) {
1718
+ throw new Error("API key is required.");
1719
+ }
1720
+ if (!options.apiSecret && !options.signer) {
1721
+ throw new Error("Either apiSecret or a custom signer function must be provided.");
1722
+ }
1723
+ const localFetch = options.fetch || typeof globalThis !== "undefined" && globalThis.fetch || typeof window !== "undefined" && window.fetch;
1724
+ if (!localFetch) {
1725
+ throw new Error("Fetch API is not available. Please provide a custom fetch implementation or upgrade your environment.");
1726
+ }
1727
+ this.options = {
1728
+ apiKey: options.apiKey,
1729
+ apiSecret: options.apiSecret,
1730
+ signer: options.signer,
1731
+ baseUrl: options.baseUrl || "https://api.sigrex.io",
1732
+ fetch: localFetch
1733
+ };
1734
+ }
1735
+ /**
1736
+ * Sends a signed HTTP request to the Sigrex API.
1737
+ */
1738
+ async request(req) {
1739
+ const methodUpper = req.method.toUpperCase();
1740
+ const timestamp = Math.floor(Date.now() / 1e3).toString();
1741
+ const url = new URL(req.path.startsWith("/") ? req.path : `/${req.path}`, this.options.baseUrl);
1742
+ if (req.queryParams) {
1743
+ for (const [key, val] of Object.entries(req.queryParams)) {
1744
+ if (val !== void 0 && val !== null) {
1745
+ url.searchParams.append(key, String(val));
1746
+ }
1747
+ }
1748
+ }
1749
+ const signaturePath = url.pathname + url.search;
1750
+ let signature;
1751
+ if (this.options.signer) {
1752
+ const hasBody = (methodUpper === "POST" || methodUpper === "PUT") && req.body !== void 0 && req.body !== null;
1753
+ const bodyStr = hasBody ? JSON.stringify(req.body) : "";
1754
+ const message = methodUpper + signaturePath + bodyStr + timestamp;
1755
+ signature = await this.options.signer(message);
1756
+ } else if (this.options.apiSecret) {
1757
+ signature = generateHmacSignature(
1758
+ this.options.apiSecret,
1759
+ methodUpper,
1760
+ signaturePath,
1761
+ timestamp,
1762
+ req.body
1763
+ );
1764
+ } else {
1765
+ throw new Error("Either apiSecret or a custom signer function must be provided.");
1766
+ }
1767
+ const headers = {
1768
+ "api-key": this.options.apiKey,
1769
+ "timestamp": timestamp,
1770
+ "signature": signature
1771
+ };
1772
+ if (req.body !== void 0 && req.body !== null) {
1773
+ headers["Content-Type"] = "application/json";
1774
+ }
1775
+ const fetchOptions = {
1776
+ method: methodUpper,
1777
+ headers
1778
+ };
1779
+ if (req.body !== void 0 && req.body !== null) {
1780
+ fetchOptions.body = JSON.stringify(req.body);
1781
+ }
1782
+ const response = await this.options.fetch(url.toString(), fetchOptions);
1783
+ let responseData;
1784
+ const contentType = response.headers.get("content-type");
1785
+ if (contentType && contentType.includes("application/json")) {
1786
+ responseData = await response.json();
1787
+ } else {
1788
+ responseData = await response.text();
1789
+ }
1790
+ if (!response.ok) {
1791
+ throw new SigrexError(response.status, response.statusText, responseData);
1792
+ }
1793
+ return responseData;
1794
+ }
1795
+ };
1796
+ var SigrexClient = class extends SigrexBaseClient {
1797
+ exchanges = new ExchangesService(this);
1798
+ strategies = {
1799
+ llmSessions: new LlmSessionsService(this),
1800
+ reactions: {
1801
+ llm: new LlmReactionsService(this),
1802
+ code: new CodeReactionsService(this)
1803
+ },
1804
+ code: new CodeStrategiesService(this)
1805
+ };
1806
+ bots = {
1807
+ cex: new CexBotsService(this),
1808
+ prediction: new PredictionBotsService(this),
1809
+ dex: new DexBotsService(this)
1810
+ };
1811
+ webhooks = {
1812
+ bot: new BotWebhooksService(this),
1813
+ data: new DataWebhooksService(this)
1814
+ };
1815
+ apiKeys = {
1816
+ exchange: new ExchangeApiKeysService(this),
1817
+ llm: new LlmApiKeysService(this),
1818
+ prediction: new PredictionApiKeysService(this)
1819
+ };
1820
+ };
1821
+ // Annotate the CommonJS export names for ESM import in node:
1822
+ 0 && (module.exports = {
1823
+ BotWebhooksService,
1824
+ CexBotsService,
1825
+ CodeReactionsService,
1826
+ CodeStrategiesService,
1827
+ DataWebhooksService,
1828
+ DexBotsService,
1829
+ ExchangeApiKeysService,
1830
+ ExchangesService,
1831
+ LlmApiKeysService,
1832
+ LlmReactionsService,
1833
+ LlmSessionsService,
1834
+ PredictionApiKeysService,
1835
+ PredictionBotsService,
1836
+ SigrexBaseClient,
1837
+ SigrexClient,
1838
+ SigrexError,
1839
+ generateHmacSignature
1840
+ });