@sigrex/client 2.1.6 → 3.0.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/README.md +46 -2
- package/dist/index.d.mts +1227 -111
- package/dist/index.d.ts +1227 -111
- package/dist/index.js +227 -14
- package/dist/index.mjs +222 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,12 +30,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
AccountService: () => AccountService,
|
|
33
34
|
BotWebhooksService: () => BotWebhooksService,
|
|
34
35
|
CexBotsService: () => CexBotsService,
|
|
35
36
|
CodeReactionsService: () => CodeReactionsService,
|
|
36
37
|
CodeStrategiesService: () => CodeStrategiesService,
|
|
38
|
+
DataLogsService: () => DataLogsService,
|
|
37
39
|
DataWebhooksService: () => DataWebhooksService,
|
|
38
40
|
DexBotsService: () => DexBotsService,
|
|
41
|
+
ErrorLogsService: () => ErrorLogsService,
|
|
39
42
|
ExchangeApiKeysService: () => ExchangeApiKeysService,
|
|
40
43
|
ExchangesService: () => ExchangesService,
|
|
41
44
|
LlmApiKeysService: () => LlmApiKeysService,
|
|
@@ -43,9 +46,11 @@ __export(index_exports, {
|
|
|
43
46
|
LlmSessionsService: () => LlmSessionsService,
|
|
44
47
|
PredictionApiKeysService: () => PredictionApiKeysService,
|
|
45
48
|
PredictionBotsService: () => PredictionBotsService,
|
|
49
|
+
SignalLogsService: () => SignalLogsService,
|
|
46
50
|
SigrexBaseClient: () => SigrexBaseClient,
|
|
47
51
|
SigrexClient: () => SigrexClient,
|
|
48
52
|
SigrexError: () => SigrexError,
|
|
53
|
+
TransactionLogsService: () => TransactionLogsService,
|
|
49
54
|
generateHmacSignature: () => generateHmacSignature
|
|
50
55
|
});
|
|
51
56
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -88,7 +93,7 @@ var ExchangesService = class {
|
|
|
88
93
|
/**
|
|
89
94
|
* Get all DEX exchanges by chain ID
|
|
90
95
|
*/
|
|
91
|
-
async
|
|
96
|
+
async listDex(chain) {
|
|
92
97
|
return this.client.request({
|
|
93
98
|
method: "GET",
|
|
94
99
|
path: `/api/v2/exchange/dex/${chain}`
|
|
@@ -1265,7 +1270,7 @@ var BotWebhooksService = class {
|
|
|
1265
1270
|
/**
|
|
1266
1271
|
* Get webhook shares
|
|
1267
1272
|
*/
|
|
1268
|
-
async
|
|
1273
|
+
async listShares(id) {
|
|
1269
1274
|
return this.client.request({
|
|
1270
1275
|
method: "GET",
|
|
1271
1276
|
path: `/api/v2/webhook/bot/${id}/shares`
|
|
@@ -1274,7 +1279,7 @@ var BotWebhooksService = class {
|
|
|
1274
1279
|
/**
|
|
1275
1280
|
* Share webhook with user
|
|
1276
1281
|
*/
|
|
1277
|
-
async(id, body) {
|
|
1282
|
+
async createShare(id, body) {
|
|
1278
1283
|
return this.client.request({
|
|
1279
1284
|
method: "POST",
|
|
1280
1285
|
path: `/api/v2/webhook/bot/share/${id}`,
|
|
@@ -1343,7 +1348,7 @@ var BotWebhooksService = class {
|
|
|
1343
1348
|
/**
|
|
1344
1349
|
* Get webhooks shared with specific user
|
|
1345
1350
|
*/
|
|
1346
|
-
async
|
|
1351
|
+
async listWithShared(id) {
|
|
1347
1352
|
return this.client.request({
|
|
1348
1353
|
method: "GET",
|
|
1349
1354
|
path: `/api/v2/webhook/bot/shared/with/${id}`
|
|
@@ -1352,7 +1357,7 @@ var BotWebhooksService = class {
|
|
|
1352
1357
|
/**
|
|
1353
1358
|
* Get webhooks shared by specific user
|
|
1354
1359
|
*/
|
|
1355
|
-
async
|
|
1360
|
+
async listByShared(id) {
|
|
1356
1361
|
return this.client.request({
|
|
1357
1362
|
method: "GET",
|
|
1358
1363
|
path: `/api/v2/webhook/bot/shared/by/${id}`
|
|
@@ -1416,7 +1421,7 @@ var DataWebhooksService = class {
|
|
|
1416
1421
|
/**
|
|
1417
1422
|
* Get webhook shares
|
|
1418
1423
|
*/
|
|
1419
|
-
async
|
|
1424
|
+
async listShares(id) {
|
|
1420
1425
|
return this.client.request({
|
|
1421
1426
|
method: "GET",
|
|
1422
1427
|
path: `/api/v2/webhook/data/${id}/shares`
|
|
@@ -1425,7 +1430,7 @@ var DataWebhooksService = class {
|
|
|
1425
1430
|
/**
|
|
1426
1431
|
* Get LLM reactions for webhook
|
|
1427
1432
|
*/
|
|
1428
|
-
async
|
|
1433
|
+
async listLlmReactions(id, queryParams) {
|
|
1429
1434
|
return this.client.request({
|
|
1430
1435
|
method: "GET",
|
|
1431
1436
|
path: `/api/v2/webhook/data/${id}/llm-reactions`,
|
|
@@ -1435,7 +1440,7 @@ var DataWebhooksService = class {
|
|
|
1435
1440
|
/**
|
|
1436
1441
|
* Get code reactions for webhook
|
|
1437
1442
|
*/
|
|
1438
|
-
async
|
|
1443
|
+
async listCodeReactions(id, queryParams) {
|
|
1439
1444
|
return this.client.request({
|
|
1440
1445
|
method: "GET",
|
|
1441
1446
|
path: `/api/v2/webhook/data/${id}/code-reactions`,
|
|
@@ -1445,7 +1450,7 @@ var DataWebhooksService = class {
|
|
|
1445
1450
|
/**
|
|
1446
1451
|
* Share webhook with user
|
|
1447
1452
|
*/
|
|
1448
|
-
async(id, body) {
|
|
1453
|
+
async createShare(id, body) {
|
|
1449
1454
|
return this.client.request({
|
|
1450
1455
|
method: "POST",
|
|
1451
1456
|
path: `/api/v2/webhook/data/share/${id}`,
|
|
@@ -1484,7 +1489,7 @@ var DataWebhooksService = class {
|
|
|
1484
1489
|
/**
|
|
1485
1490
|
* Get data webhooks shared with specific user
|
|
1486
1491
|
*/
|
|
1487
|
-
async
|
|
1492
|
+
async listWithShared(id) {
|
|
1488
1493
|
return this.client.request({
|
|
1489
1494
|
method: "GET",
|
|
1490
1495
|
path: `/api/v2/webhook/data/shared/with/${id}`
|
|
@@ -1493,7 +1498,7 @@ var DataWebhooksService = class {
|
|
|
1493
1498
|
/**
|
|
1494
1499
|
* Get data webhooks shared by specific user
|
|
1495
1500
|
*/
|
|
1496
|
-
async
|
|
1501
|
+
async listByShared(id) {
|
|
1497
1502
|
return this.client.request({
|
|
1498
1503
|
method: "GET",
|
|
1499
1504
|
path: `/api/v2/webhook/data/shared/by/${id}`
|
|
@@ -1529,7 +1534,7 @@ var ExchangeApiKeysService = class {
|
|
|
1529
1534
|
/**
|
|
1530
1535
|
* Get signal bots that use an API key
|
|
1531
1536
|
*/
|
|
1532
|
-
async
|
|
1537
|
+
async listSignalBot(id, queryParams) {
|
|
1533
1538
|
return this.client.request({
|
|
1534
1539
|
method: "GET",
|
|
1535
1540
|
path: `/api/v2/api/exchange/bot/signal/${id}`,
|
|
@@ -1585,7 +1590,7 @@ var LlmApiKeysService = class {
|
|
|
1585
1590
|
/**
|
|
1586
1591
|
* Get models for a specific service
|
|
1587
1592
|
*/
|
|
1588
|
-
async
|
|
1593
|
+
async listModels(serviceId) {
|
|
1589
1594
|
return this.client.request({
|
|
1590
1595
|
method: "GET",
|
|
1591
1596
|
path: `/api/v2/api/llm/models/${serviceId}`
|
|
@@ -1659,7 +1664,7 @@ var PredictionApiKeysService = class {
|
|
|
1659
1664
|
/**
|
|
1660
1665
|
* Get prediction signal bots by API ID
|
|
1661
1666
|
*/
|
|
1662
|
-
async
|
|
1667
|
+
async listSignalBot(id, queryParams) {
|
|
1663
1668
|
return this.client.request({
|
|
1664
1669
|
method: "GET",
|
|
1665
1670
|
path: `/api/v2/api/prediction/bot/signal/${id}`,
|
|
@@ -1697,6 +1702,202 @@ var PredictionApiKeysService = class {
|
|
|
1697
1702
|
}
|
|
1698
1703
|
};
|
|
1699
1704
|
|
|
1705
|
+
// src/services/account.ts
|
|
1706
|
+
var AccountService = class {
|
|
1707
|
+
constructor(client) {
|
|
1708
|
+
this.client = client;
|
|
1709
|
+
}
|
|
1710
|
+
client;
|
|
1711
|
+
/**
|
|
1712
|
+
* Get the authenticated user's account
|
|
1713
|
+
*/
|
|
1714
|
+
async getMe() {
|
|
1715
|
+
return this.client.request({
|
|
1716
|
+
method: "GET",
|
|
1717
|
+
path: `/api/v2/account/me`
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* Get all friendships by status
|
|
1722
|
+
*/
|
|
1723
|
+
async listAllFriend(status) {
|
|
1724
|
+
return this.client.request({
|
|
1725
|
+
method: "GET",
|
|
1726
|
+
path: `/api/v2/account/friend/all/${status}`
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Get paginated friendships by status and side
|
|
1731
|
+
*/
|
|
1732
|
+
async listFriend(status, side, queryParams) {
|
|
1733
|
+
return this.client.request({
|
|
1734
|
+
method: "GET",
|
|
1735
|
+
path: `/api/v2/account/friend/${status}/${side}`,
|
|
1736
|
+
queryParams
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* Get paginated rejected friend requests
|
|
1741
|
+
*/
|
|
1742
|
+
async listFriendRejected(queryParams) {
|
|
1743
|
+
return this.client.request({
|
|
1744
|
+
method: "GET",
|
|
1745
|
+
path: `/api/v2/account/friend/rejected`,
|
|
1746
|
+
queryParams
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
// src/services/signalLogs.ts
|
|
1752
|
+
var SignalLogsService = class {
|
|
1753
|
+
constructor(client) {
|
|
1754
|
+
this.client = client;
|
|
1755
|
+
}
|
|
1756
|
+
client;
|
|
1757
|
+
/**
|
|
1758
|
+
* Get paginated signal logs
|
|
1759
|
+
*/
|
|
1760
|
+
async list(queryParams) {
|
|
1761
|
+
return this.client.request({
|
|
1762
|
+
method: "GET",
|
|
1763
|
+
path: `/api/v2/log/signal/paginated`,
|
|
1764
|
+
queryParams
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Get paginated signal logs of a bot hook
|
|
1769
|
+
*/
|
|
1770
|
+
async listHook(hookId, queryParams) {
|
|
1771
|
+
return this.client.request({
|
|
1772
|
+
method: "GET",
|
|
1773
|
+
path: `/api/v2/log/signal/hook/${hookId}/paginated`,
|
|
1774
|
+
queryParams
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Get paginated signal logs by source
|
|
1779
|
+
*/
|
|
1780
|
+
async listBySource(source, queryParams) {
|
|
1781
|
+
return this.client.request({
|
|
1782
|
+
method: "GET",
|
|
1783
|
+
path: `/api/v2/log/signal/${source}/paginated`,
|
|
1784
|
+
queryParams
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Get paginated signal logs by source and source id
|
|
1789
|
+
*/
|
|
1790
|
+
async listBySourceAndId(source, id, queryParams) {
|
|
1791
|
+
return this.client.request({
|
|
1792
|
+
method: "GET",
|
|
1793
|
+
path: `/api/v2/log/signal/${source}/${id}/paginated`,
|
|
1794
|
+
queryParams
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
// src/services/transactionLogs.ts
|
|
1800
|
+
var TransactionLogsService = class {
|
|
1801
|
+
constructor(client) {
|
|
1802
|
+
this.client = client;
|
|
1803
|
+
}
|
|
1804
|
+
client;
|
|
1805
|
+
/**
|
|
1806
|
+
* Get paginated transaction logs
|
|
1807
|
+
*/
|
|
1808
|
+
async list(queryParams) {
|
|
1809
|
+
return this.client.request({
|
|
1810
|
+
method: "GET",
|
|
1811
|
+
path: `/api/v2/log/transaction`,
|
|
1812
|
+
queryParams
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Get paginated transaction logs of a signal bot
|
|
1817
|
+
*/
|
|
1818
|
+
async listSignalBot(type, service, id, queryParams) {
|
|
1819
|
+
return this.client.request({
|
|
1820
|
+
method: "GET",
|
|
1821
|
+
path: `/api/v2/log/transaction/bot/signal/${type}/${service}/${id}`,
|
|
1822
|
+
queryParams
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Get a transaction log by id
|
|
1827
|
+
*/
|
|
1828
|
+
async get(id) {
|
|
1829
|
+
return this.client.request({
|
|
1830
|
+
method: "GET",
|
|
1831
|
+
path: `/api/v2/log/transaction/${id}`
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1836
|
+
// src/services/dataLogs.ts
|
|
1837
|
+
var DataLogsService = class {
|
|
1838
|
+
constructor(client) {
|
|
1839
|
+
this.client = client;
|
|
1840
|
+
}
|
|
1841
|
+
client;
|
|
1842
|
+
/**
|
|
1843
|
+
* Get paginated data logs
|
|
1844
|
+
*/
|
|
1845
|
+
async list(queryParams) {
|
|
1846
|
+
return this.client.request({
|
|
1847
|
+
method: "GET",
|
|
1848
|
+
path: `/api/v2/log/data/paginated`,
|
|
1849
|
+
queryParams
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Get paginated data logs of a data hook
|
|
1854
|
+
*/
|
|
1855
|
+
async listHook(hookId, queryParams) {
|
|
1856
|
+
return this.client.request({
|
|
1857
|
+
method: "GET",
|
|
1858
|
+
path: `/api/v2/log/data/hook/${hookId}/paginated`,
|
|
1859
|
+
queryParams
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1864
|
+
// src/services/errorLogs.ts
|
|
1865
|
+
var ErrorLogsService = class {
|
|
1866
|
+
constructor(client) {
|
|
1867
|
+
this.client = client;
|
|
1868
|
+
}
|
|
1869
|
+
client;
|
|
1870
|
+
/**
|
|
1871
|
+
* Get paginated error logs
|
|
1872
|
+
*/
|
|
1873
|
+
async list(queryParams) {
|
|
1874
|
+
return this.client.request({
|
|
1875
|
+
method: "GET",
|
|
1876
|
+
path: `/api/v2/log/error/paginated`,
|
|
1877
|
+
queryParams
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Get paginated error logs by source and source id
|
|
1882
|
+
*/
|
|
1883
|
+
async listBySourceAndId(source, id, queryParams) {
|
|
1884
|
+
return this.client.request({
|
|
1885
|
+
method: "GET",
|
|
1886
|
+
path: `/api/v2/log/error/${source}/${id}`,
|
|
1887
|
+
queryParams
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Get an error log by id
|
|
1892
|
+
*/
|
|
1893
|
+
async get(id) {
|
|
1894
|
+
return this.client.request({
|
|
1895
|
+
method: "GET",
|
|
1896
|
+
path: `/api/v2/log/error/${id}`
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1700
1901
|
// src/client.ts
|
|
1701
1902
|
var SigrexError = class extends Error {
|
|
1702
1903
|
status;
|
|
@@ -1817,15 +2018,25 @@ var SigrexClient = class extends SigrexBaseClient {
|
|
|
1817
2018
|
llm: new LlmApiKeysService(this),
|
|
1818
2019
|
prediction: new PredictionApiKeysService(this)
|
|
1819
2020
|
};
|
|
2021
|
+
account = new AccountService(this);
|
|
2022
|
+
logs = {
|
|
2023
|
+
signal: new SignalLogsService(this),
|
|
2024
|
+
transaction: new TransactionLogsService(this),
|
|
2025
|
+
data: new DataLogsService(this),
|
|
2026
|
+
error: new ErrorLogsService(this)
|
|
2027
|
+
};
|
|
1820
2028
|
};
|
|
1821
2029
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1822
2030
|
0 && (module.exports = {
|
|
2031
|
+
AccountService,
|
|
1823
2032
|
BotWebhooksService,
|
|
1824
2033
|
CexBotsService,
|
|
1825
2034
|
CodeReactionsService,
|
|
1826
2035
|
CodeStrategiesService,
|
|
2036
|
+
DataLogsService,
|
|
1827
2037
|
DataWebhooksService,
|
|
1828
2038
|
DexBotsService,
|
|
2039
|
+
ErrorLogsService,
|
|
1829
2040
|
ExchangeApiKeysService,
|
|
1830
2041
|
ExchangesService,
|
|
1831
2042
|
LlmApiKeysService,
|
|
@@ -1833,8 +2044,10 @@ var SigrexClient = class extends SigrexBaseClient {
|
|
|
1833
2044
|
LlmSessionsService,
|
|
1834
2045
|
PredictionApiKeysService,
|
|
1835
2046
|
PredictionBotsService,
|
|
2047
|
+
SignalLogsService,
|
|
1836
2048
|
SigrexBaseClient,
|
|
1837
2049
|
SigrexClient,
|
|
1838
2050
|
SigrexError,
|
|
2051
|
+
TransactionLogsService,
|
|
1839
2052
|
generateHmacSignature
|
|
1840
2053
|
});
|