@human-protocol/sdk 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.d.ts +1 -10
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +0 -21
- package/dist/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -16
- package/dist/enums.d.ts +0 -1
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +0 -1
- package/dist/error.d.ts +4 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +5 -1
- package/dist/escrow.d.ts +14 -17
- package/dist/escrow.d.ts.map +1 -1
- package/dist/escrow.js +34 -33
- package/dist/interfaces.d.ts +9 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/kvstore.d.ts +9 -5
- package/dist/kvstore.d.ts.map +1 -1
- package/dist/kvstore.js +15 -15
- package/dist/operator.d.ts +9 -5
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +16 -16
- package/dist/staking.d.ts +6 -3
- package/dist/staking.d.ts.map +1 -1
- package/dist/staking.js +13 -14
- package/dist/statistics.d.ts +13 -7
- package/dist/statistics.d.ts.map +1 -1
- package/dist/statistics.js +24 -22
- package/dist/transaction.d.ts +5 -3
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +8 -10
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +51 -1
- package/dist/worker.d.ts +5 -3
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +8 -10
- package/package.json +2 -1
- package/src/base.ts +1 -23
- package/src/constants.ts +0 -18
- package/src/enums.ts +0 -1
- package/src/error.ts +7 -0
- package/src/escrow.ts +69 -64
- package/src/interfaces.ts +10 -0
- package/src/kvstore.ts +26 -24
- package/src/operator.ts +54 -26
- package/src/staking.ts +27 -26
- package/src/statistics.ts +87 -47
- package/src/transaction.ts +39 -25
- package/src/utils.ts +64 -0
- package/src/worker.ts +32 -17
package/dist/statistics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDailyHMT, IEscrowStatistics, IHMTHolder, IHMTHoldersParams, IHMTStatistics, IPaymentStatistics, IStatisticsFilter, IWorkerStatistics } from './interfaces';
|
|
1
|
+
import { IDailyHMT, IEscrowStatistics, IHMTHolder, IHMTHoldersParams, IHMTStatistics, IPaymentStatistics, IStatisticsFilter, IWorkerStatistics, SubgraphOptions } from './interfaces';
|
|
2
2
|
import { NetworkData } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* ## Introduction
|
|
@@ -73,6 +73,7 @@ export declare class StatisticsClient {
|
|
|
73
73
|
* ```
|
|
74
74
|
*
|
|
75
75
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
76
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
76
77
|
* @returns {Promise<IEscrowStatistics>} Escrow statistics data.
|
|
77
78
|
*
|
|
78
79
|
* **Code example**
|
|
@@ -89,7 +90,7 @@ export declare class StatisticsClient {
|
|
|
89
90
|
* });
|
|
90
91
|
* ```
|
|
91
92
|
*/
|
|
92
|
-
getEscrowStatistics(filter?: IStatisticsFilter): Promise<IEscrowStatistics>;
|
|
93
|
+
getEscrowStatistics(filter?: IStatisticsFilter, options?: SubgraphOptions): Promise<IEscrowStatistics>;
|
|
93
94
|
/**
|
|
94
95
|
* This function returns the statistical data of workers.
|
|
95
96
|
*
|
|
@@ -117,6 +118,7 @@ export declare class StatisticsClient {
|
|
|
117
118
|
* ```
|
|
118
119
|
*
|
|
119
120
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
121
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
120
122
|
* @returns {Promise<IWorkerStatistics>} Worker statistics data.
|
|
121
123
|
*
|
|
122
124
|
* **Code example**
|
|
@@ -133,7 +135,7 @@ export declare class StatisticsClient {
|
|
|
133
135
|
* });
|
|
134
136
|
* ```
|
|
135
137
|
*/
|
|
136
|
-
getWorkerStatistics(filter?: IStatisticsFilter): Promise<IWorkerStatistics>;
|
|
138
|
+
getWorkerStatistics(filter?: IStatisticsFilter, options?: SubgraphOptions): Promise<IWorkerStatistics>;
|
|
137
139
|
/**
|
|
138
140
|
* This function returns the statistical data of payments.
|
|
139
141
|
*
|
|
@@ -163,6 +165,7 @@ export declare class StatisticsClient {
|
|
|
163
165
|
* ```
|
|
164
166
|
*
|
|
165
167
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
168
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
166
169
|
* @returns {Promise<IPaymentStatistics>} Payment statistics data.
|
|
167
170
|
*
|
|
168
171
|
* **Code example**
|
|
@@ -200,7 +203,7 @@ export declare class StatisticsClient {
|
|
|
200
203
|
* );
|
|
201
204
|
* ```
|
|
202
205
|
*/
|
|
203
|
-
getPaymentStatistics(filter?: IStatisticsFilter): Promise<IPaymentStatistics>;
|
|
206
|
+
getPaymentStatistics(filter?: IStatisticsFilter, options?: SubgraphOptions): Promise<IPaymentStatistics>;
|
|
204
207
|
/**
|
|
205
208
|
* This function returns the statistical data of HMToken.
|
|
206
209
|
*
|
|
@@ -212,6 +215,7 @@ export declare class StatisticsClient {
|
|
|
212
215
|
* };
|
|
213
216
|
* ```
|
|
214
217
|
*
|
|
218
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
215
219
|
* @returns {Promise<IHMTStatistics>} HMToken statistics data.
|
|
216
220
|
*
|
|
217
221
|
* **Code example**
|
|
@@ -229,13 +233,14 @@ export declare class StatisticsClient {
|
|
|
229
233
|
* });
|
|
230
234
|
* ```
|
|
231
235
|
*/
|
|
232
|
-
getHMTStatistics(): Promise<IHMTStatistics>;
|
|
236
|
+
getHMTStatistics(options?: SubgraphOptions): Promise<IHMTStatistics>;
|
|
233
237
|
/**
|
|
234
238
|
* This function returns the holders of the HMToken with optional filters and ordering.
|
|
235
239
|
*
|
|
236
240
|
* **Input parameters**
|
|
237
241
|
*
|
|
238
242
|
* @param {IHMTHoldersParams} params HMT Holders params with filters and ordering
|
|
243
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
239
244
|
* @returns {Promise<IHMTHolder[]>} List of HMToken holders.
|
|
240
245
|
*
|
|
241
246
|
* **Code example**
|
|
@@ -255,7 +260,7 @@ export declare class StatisticsClient {
|
|
|
255
260
|
* })));
|
|
256
261
|
* ```
|
|
257
262
|
*/
|
|
258
|
-
getHMTHolders(params?: IHMTHoldersParams): Promise<IHMTHolder[]>;
|
|
263
|
+
getHMTHolders(params?: IHMTHoldersParams, options?: SubgraphOptions): Promise<IHMTHolder[]>;
|
|
259
264
|
/**
|
|
260
265
|
* This function returns the statistical data of HMToken day by day.
|
|
261
266
|
*
|
|
@@ -282,6 +287,7 @@ export declare class StatisticsClient {
|
|
|
282
287
|
* ```
|
|
283
288
|
*
|
|
284
289
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
290
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
285
291
|
* @returns {Promise<IDailyHMT[]>} Daily HMToken statistics data.
|
|
286
292
|
*
|
|
287
293
|
* **Code example**
|
|
@@ -303,6 +309,6 @@ export declare class StatisticsClient {
|
|
|
303
309
|
* console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange);
|
|
304
310
|
* ```
|
|
305
311
|
*/
|
|
306
|
-
getHMTDailyData(filter?: IStatisticsFilter): Promise<IDailyHMT[]>;
|
|
312
|
+
getHMTDailyData(filter?: IStatisticsFilter, options?: SubgraphOptions): Promise<IDailyHMT[]>;
|
|
307
313
|
}
|
|
308
314
|
//# sourceMappingURL=statistics.d.ts.map
|
package/dist/statistics.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../src/statistics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../src/statistics.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,gBAAgB;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;gBACS,WAAW,EAAE,WAAW;IAKpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACG,mBAAmB,CACvB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,iBAAiB,CAAC;IA4C7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACG,mBAAmB,CACvB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,iBAAiB,CAAC;IAiC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkEG;IACG,oBAAoB,CACxB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,kBAAkB,CAAC;IAuC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,gBAAgB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB1E;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,aAAa,CACjB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC;IAyBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACG,eAAe,CACnB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,SAAS,EAAE,CAAC;CAiCxB"}
|
package/dist/statistics.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.StatisticsClient = void 0;
|
|
7
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
-
const graphql_request_1 = __importDefault(require("graphql-request"));
|
|
9
5
|
const enums_1 = require("./enums");
|
|
10
6
|
const graphql_1 = require("./graphql");
|
|
11
7
|
const utils_1 = require("./utils");
|
|
@@ -83,6 +79,7 @@ class StatisticsClient {
|
|
|
83
79
|
* ```
|
|
84
80
|
*
|
|
85
81
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
82
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
86
83
|
* @returns {Promise<IEscrowStatistics>} Escrow statistics data.
|
|
87
84
|
*
|
|
88
85
|
* **Code example**
|
|
@@ -99,19 +96,19 @@ class StatisticsClient {
|
|
|
99
96
|
* });
|
|
100
97
|
* ```
|
|
101
98
|
*/
|
|
102
|
-
async getEscrowStatistics(filter = {}) {
|
|
99
|
+
async getEscrowStatistics(filter = {}, options) {
|
|
103
100
|
try {
|
|
104
101
|
const first = filter.first !== undefined ? Math.min(filter.first, 1000) : 10;
|
|
105
102
|
const skip = filter.skip || 0;
|
|
106
103
|
const orderDirection = filter.orderDirection || enums_1.OrderDirection.ASC;
|
|
107
|
-
const { escrowStatistics } = await (0,
|
|
108
|
-
const { eventDayDatas } = await (0,
|
|
104
|
+
const { escrowStatistics } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, graphql_1.GET_ESCROW_STATISTICS_QUERY, options);
|
|
105
|
+
const { eventDayDatas } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, (0, graphql_1.GET_EVENT_DAY_DATA_QUERY)(filter), {
|
|
109
106
|
from: filter.from ? (0, utils_1.getUnixTimestamp)(filter.from) : undefined,
|
|
110
107
|
to: filter.to ? (0, utils_1.getUnixTimestamp)(filter.to) : undefined,
|
|
111
108
|
orderDirection: orderDirection,
|
|
112
109
|
first: first,
|
|
113
110
|
skip: skip,
|
|
114
|
-
});
|
|
111
|
+
}, options);
|
|
115
112
|
return {
|
|
116
113
|
totalEscrows: escrowStatistics?.totalEscrowCount
|
|
117
114
|
? +escrowStatistics.totalEscrowCount
|
|
@@ -157,6 +154,7 @@ class StatisticsClient {
|
|
|
157
154
|
* ```
|
|
158
155
|
*
|
|
159
156
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
157
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
160
158
|
* @returns {Promise<IWorkerStatistics>} Worker statistics data.
|
|
161
159
|
*
|
|
162
160
|
* **Code example**
|
|
@@ -173,18 +171,18 @@ class StatisticsClient {
|
|
|
173
171
|
* });
|
|
174
172
|
* ```
|
|
175
173
|
*/
|
|
176
|
-
async getWorkerStatistics(filter = {}) {
|
|
174
|
+
async getWorkerStatistics(filter = {}, options) {
|
|
177
175
|
try {
|
|
178
176
|
const first = filter.first !== undefined ? Math.min(filter.first, 1000) : 10;
|
|
179
177
|
const skip = filter.skip || 0;
|
|
180
178
|
const orderDirection = filter.orderDirection || enums_1.OrderDirection.ASC;
|
|
181
|
-
const { eventDayDatas } = await (0,
|
|
179
|
+
const { eventDayDatas } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, (0, graphql_1.GET_EVENT_DAY_DATA_QUERY)(filter), {
|
|
182
180
|
from: filter.from ? (0, utils_1.getUnixTimestamp)(filter.from) : undefined,
|
|
183
181
|
to: filter.to ? (0, utils_1.getUnixTimestamp)(filter.to) : undefined,
|
|
184
182
|
orderDirection: orderDirection,
|
|
185
183
|
first: first,
|
|
186
184
|
skip: skip,
|
|
187
|
-
});
|
|
185
|
+
}, options);
|
|
188
186
|
return {
|
|
189
187
|
dailyWorkersData: eventDayDatas.map((eventDayData) => ({
|
|
190
188
|
timestamp: +eventDayData.timestamp * 1000,
|
|
@@ -225,6 +223,7 @@ class StatisticsClient {
|
|
|
225
223
|
* ```
|
|
226
224
|
*
|
|
227
225
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
226
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
228
227
|
* @returns {Promise<IPaymentStatistics>} Payment statistics data.
|
|
229
228
|
*
|
|
230
229
|
* **Code example**
|
|
@@ -262,18 +261,18 @@ class StatisticsClient {
|
|
|
262
261
|
* );
|
|
263
262
|
* ```
|
|
264
263
|
*/
|
|
265
|
-
async getPaymentStatistics(filter = {}) {
|
|
264
|
+
async getPaymentStatistics(filter = {}, options) {
|
|
266
265
|
try {
|
|
267
266
|
const first = filter.first !== undefined ? Math.min(filter.first, 1000) : 10;
|
|
268
267
|
const skip = filter.skip || 0;
|
|
269
268
|
const orderDirection = filter.orderDirection || enums_1.OrderDirection.ASC;
|
|
270
|
-
const { eventDayDatas } = await (0,
|
|
269
|
+
const { eventDayDatas } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, (0, graphql_1.GET_EVENT_DAY_DATA_QUERY)(filter), {
|
|
271
270
|
from: filter.from ? (0, utils_1.getUnixTimestamp)(filter.from) : undefined,
|
|
272
271
|
to: filter.to ? (0, utils_1.getUnixTimestamp)(filter.to) : undefined,
|
|
273
272
|
orderDirection: orderDirection,
|
|
274
273
|
first: first,
|
|
275
274
|
skip: skip,
|
|
276
|
-
});
|
|
275
|
+
}, options);
|
|
277
276
|
return {
|
|
278
277
|
dailyPaymentsData: eventDayDatas.map((eventDayData) => ({
|
|
279
278
|
timestamp: +eventDayData.timestamp * 1000,
|
|
@@ -301,6 +300,7 @@ class StatisticsClient {
|
|
|
301
300
|
* };
|
|
302
301
|
* ```
|
|
303
302
|
*
|
|
303
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
304
304
|
* @returns {Promise<IHMTStatistics>} HMToken statistics data.
|
|
305
305
|
*
|
|
306
306
|
* **Code example**
|
|
@@ -318,9 +318,9 @@ class StatisticsClient {
|
|
|
318
318
|
* });
|
|
319
319
|
* ```
|
|
320
320
|
*/
|
|
321
|
-
async getHMTStatistics() {
|
|
321
|
+
async getHMTStatistics(options) {
|
|
322
322
|
try {
|
|
323
|
-
const { hmtokenStatistics } = await (0,
|
|
323
|
+
const { hmtokenStatistics } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, graphql_1.GET_HMTOKEN_STATISTICS_QUERY, options);
|
|
324
324
|
return {
|
|
325
325
|
totalTransferAmount: BigInt(hmtokenStatistics.totalValueTransfered),
|
|
326
326
|
totalTransferCount: +hmtokenStatistics.totalTransferEventCount,
|
|
@@ -337,6 +337,7 @@ class StatisticsClient {
|
|
|
337
337
|
* **Input parameters**
|
|
338
338
|
*
|
|
339
339
|
* @param {IHMTHoldersParams} params HMT Holders params with filters and ordering
|
|
340
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
340
341
|
* @returns {Promise<IHMTHolder[]>} List of HMToken holders.
|
|
341
342
|
*
|
|
342
343
|
* **Code example**
|
|
@@ -356,15 +357,15 @@ class StatisticsClient {
|
|
|
356
357
|
* })));
|
|
357
358
|
* ```
|
|
358
359
|
*/
|
|
359
|
-
async getHMTHolders(params = {}) {
|
|
360
|
+
async getHMTHolders(params = {}, options) {
|
|
360
361
|
try {
|
|
361
362
|
const { address, orderDirection } = params;
|
|
362
363
|
const query = (0, graphql_1.GET_HOLDERS_QUERY)(address);
|
|
363
|
-
const { holders } = await (0,
|
|
364
|
+
const { holders } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, query, {
|
|
364
365
|
address,
|
|
365
366
|
orderBy: 'balance',
|
|
366
367
|
orderDirection,
|
|
367
|
-
});
|
|
368
|
+
}, options);
|
|
368
369
|
return holders.map((holder) => ({
|
|
369
370
|
address: holder.address,
|
|
370
371
|
balance: BigInt(holder.balance),
|
|
@@ -400,6 +401,7 @@ class StatisticsClient {
|
|
|
400
401
|
* ```
|
|
401
402
|
*
|
|
402
403
|
* @param {IStatisticsFilter} filter Statistics params with duration data
|
|
404
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
403
405
|
* @returns {Promise<IDailyHMT[]>} Daily HMToken statistics data.
|
|
404
406
|
*
|
|
405
407
|
* **Code example**
|
|
@@ -421,18 +423,18 @@ class StatisticsClient {
|
|
|
421
423
|
* console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange);
|
|
422
424
|
* ```
|
|
423
425
|
*/
|
|
424
|
-
async getHMTDailyData(filter = {}) {
|
|
426
|
+
async getHMTDailyData(filter = {}, options) {
|
|
425
427
|
try {
|
|
426
428
|
const first = filter.first !== undefined ? Math.min(filter.first, 1000) : 10;
|
|
427
429
|
const skip = filter.skip || 0;
|
|
428
430
|
const orderDirection = filter.orderDirection || enums_1.OrderDirection.ASC;
|
|
429
|
-
const { eventDayDatas } = await (0,
|
|
431
|
+
const { eventDayDatas } = await (0, utils_1.customGqlFetch)(this.subgraphUrl, (0, graphql_1.GET_EVENT_DAY_DATA_QUERY)(filter), {
|
|
430
432
|
from: filter.from ? (0, utils_1.getUnixTimestamp)(filter.from) : undefined,
|
|
431
433
|
to: filter.to ? (0, utils_1.getUnixTimestamp)(filter.to) : undefined,
|
|
432
434
|
orderDirection: orderDirection,
|
|
433
435
|
first: first,
|
|
434
436
|
skip: skip,
|
|
435
|
-
});
|
|
437
|
+
}, options);
|
|
436
438
|
return eventDayDatas.map((eventDayData) => ({
|
|
437
439
|
timestamp: +eventDayData.timestamp * 1000,
|
|
438
440
|
totalTransactionAmount: BigInt(eventDayData.dailyHMTTransferAmount),
|
package/dist/transaction.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChainId } from './enums';
|
|
2
|
-
import { ITransaction, ITransactionsFilter } from './interfaces';
|
|
2
|
+
import { ITransaction, ITransactionsFilter, SubgraphOptions } from './interfaces';
|
|
3
3
|
export declare class TransactionUtils {
|
|
4
4
|
/**
|
|
5
5
|
* This function returns the transaction data for the given hash.
|
|
@@ -34,6 +34,7 @@ export declare class TransactionUtils {
|
|
|
34
34
|
*
|
|
35
35
|
* @param {ChainId} chainId The chain ID.
|
|
36
36
|
* @param {string} hash The transaction hash.
|
|
37
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
37
38
|
* @returns {Promise<ITransaction | null>} - Returns the transaction details or null if not found.
|
|
38
39
|
*
|
|
39
40
|
* **Code example**
|
|
@@ -44,7 +45,7 @@ export declare class TransactionUtils {
|
|
|
44
45
|
* const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62dD51230A30401C455c8398d06F85e4EaB6309f');
|
|
45
46
|
* ```
|
|
46
47
|
*/
|
|
47
|
-
static getTransaction(chainId: ChainId, hash: string): Promise<ITransaction | null>;
|
|
48
|
+
static getTransaction(chainId: ChainId, hash: string, options?: SubgraphOptions): Promise<ITransaction | null>;
|
|
48
49
|
/**
|
|
49
50
|
* This function returns all transaction details based on the provided filter.
|
|
50
51
|
*
|
|
@@ -99,6 +100,7 @@ export declare class TransactionUtils {
|
|
|
99
100
|
* ```
|
|
100
101
|
*
|
|
101
102
|
* @param {ITransactionsFilter} filter Filter for the transactions.
|
|
103
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
102
104
|
* @returns {Promise<ITransaction[]>} Returns an array with all the transaction details.
|
|
103
105
|
*
|
|
104
106
|
* **Code example**
|
|
@@ -117,6 +119,6 @@ export declare class TransactionUtils {
|
|
|
117
119
|
* const transactions = await TransactionUtils.getTransactions(filter);
|
|
118
120
|
* ```
|
|
119
121
|
*/
|
|
120
|
-
static getTransactions(filter: ITransactionsFilter): Promise<ITransaction[]>;
|
|
122
|
+
static getTransactions(filter: ITransactionsFilter, options?: SubgraphOptions): Promise<ITransaction[]>;
|
|
121
123
|
}
|
|
122
124
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAWlD,OAAO,EAEL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;WACiB,cAAc,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAyB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwEG;WACiB,eAAe,CACjC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,EAAE,CAAC;CAgD3B"}
|
package/dist/transaction.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.TransactionUtils = void 0;
|
|
7
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
5
|
const ethers_1 = require("ethers");
|
|
9
|
-
const graphql_request_1 = __importDefault(require("graphql-request"));
|
|
10
6
|
const constants_1 = require("./constants");
|
|
11
7
|
const enums_1 = require("./enums");
|
|
12
8
|
const error_1 = require("./error");
|
|
@@ -46,6 +42,7 @@ class TransactionUtils {
|
|
|
46
42
|
*
|
|
47
43
|
* @param {ChainId} chainId The chain ID.
|
|
48
44
|
* @param {string} hash The transaction hash.
|
|
45
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
49
46
|
* @returns {Promise<ITransaction | null>} - Returns the transaction details or null if not found.
|
|
50
47
|
*
|
|
51
48
|
* **Code example**
|
|
@@ -56,7 +53,7 @@ class TransactionUtils {
|
|
|
56
53
|
* const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62dD51230A30401C455c8398d06F85e4EaB6309f');
|
|
57
54
|
* ```
|
|
58
55
|
*/
|
|
59
|
-
static async getTransaction(chainId, hash) {
|
|
56
|
+
static async getTransaction(chainId, hash, options) {
|
|
60
57
|
if (!ethers_1.ethers.isHexString(hash)) {
|
|
61
58
|
throw error_1.ErrorInvalidHashProvided;
|
|
62
59
|
}
|
|
@@ -64,9 +61,9 @@ class TransactionUtils {
|
|
|
64
61
|
if (!networkData) {
|
|
65
62
|
throw error_1.ErrorUnsupportedChainID;
|
|
66
63
|
}
|
|
67
|
-
const { transaction } = await (0,
|
|
64
|
+
const { transaction } = await (0, utils_1.customGqlFetch)((0, utils_1.getSubgraphUrl)(networkData), transaction_1.GET_TRANSACTION_QUERY, {
|
|
68
65
|
hash: hash.toLowerCase(),
|
|
69
|
-
});
|
|
66
|
+
}, options);
|
|
70
67
|
if (!transaction)
|
|
71
68
|
return null;
|
|
72
69
|
return mapTransaction(transaction);
|
|
@@ -125,6 +122,7 @@ class TransactionUtils {
|
|
|
125
122
|
* ```
|
|
126
123
|
*
|
|
127
124
|
* @param {ITransactionsFilter} filter Filter for the transactions.
|
|
125
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
128
126
|
* @returns {Promise<ITransaction[]>} Returns an array with all the transaction details.
|
|
129
127
|
*
|
|
130
128
|
* **Code example**
|
|
@@ -143,7 +141,7 @@ class TransactionUtils {
|
|
|
143
141
|
* const transactions = await TransactionUtils.getTransactions(filter);
|
|
144
142
|
* ```
|
|
145
143
|
*/
|
|
146
|
-
static async getTransactions(filter) {
|
|
144
|
+
static async getTransactions(filter, options) {
|
|
147
145
|
if ((!!filter.startDate || !!filter.endDate) &&
|
|
148
146
|
(!!filter.startBlock || !!filter.endBlock)) {
|
|
149
147
|
throw error_1.ErrorCannotUseDateAndBlockSimultaneously;
|
|
@@ -155,7 +153,7 @@ class TransactionUtils {
|
|
|
155
153
|
if (!networkData) {
|
|
156
154
|
throw error_1.ErrorUnsupportedChainID;
|
|
157
155
|
}
|
|
158
|
-
const { transactions } = await (0,
|
|
156
|
+
const { transactions } = await (0, utils_1.customGqlFetch)((0, utils_1.getSubgraphUrl)(networkData), (0, transaction_1.GET_TRANSACTIONS_QUERY)(filter), {
|
|
159
157
|
fromAddress: filter?.fromAddress,
|
|
160
158
|
toAddress: filter?.toAddress,
|
|
161
159
|
startDate: filter?.startDate
|
|
@@ -170,7 +168,7 @@ class TransactionUtils {
|
|
|
170
168
|
orderDirection: orderDirection,
|
|
171
169
|
first: first,
|
|
172
170
|
skip: skip,
|
|
173
|
-
});
|
|
171
|
+
}, options);
|
|
174
172
|
if (!transactions) {
|
|
175
173
|
return [];
|
|
176
174
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NetworkData } from './types';
|
|
2
|
+
import { SubgraphOptions } from './interfaces';
|
|
2
3
|
/**
|
|
3
4
|
* **Handle and throw the error.*
|
|
4
5
|
*
|
|
@@ -34,4 +35,10 @@ export declare const getSubgraphUrl: (networkData: NetworkData) => string;
|
|
|
34
35
|
* @returns {number}
|
|
35
36
|
*/
|
|
36
37
|
export declare const getUnixTimestamp: (date: Date) => number;
|
|
38
|
+
export declare const isIndexerError: (error: any) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Execute a GraphQL request with automatic retry logic for bad indexer errors.
|
|
41
|
+
* Only retries if options is provided.
|
|
42
|
+
*/
|
|
43
|
+
export declare const customGqlFetch: <T = any>(url: string, query: any, variables?: any, options?: SubgraphOptions) => Promise<T>;
|
|
37
44
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,GAAG,UAgBhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAMxC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,OAO3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa,WAAW,WAatD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,KAAG,MAE7C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,KAAG,OAS3C,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,GAAG,GAAG,EAC1C,KAAK,MAAM,EACX,OAAO,GAAG,EACV,YAAY,GAAG,EACf,UAAU,eAAe,KACxB,OAAO,CAAC,CAAC,CAmCX,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUnixTimestamp = exports.getSubgraphUrl = exports.isValidJson = exports.isValidUrl = exports.throwError = void 0;
|
|
6
|
+
exports.customGqlFetch = exports.isIndexerError = exports.getUnixTimestamp = exports.getSubgraphUrl = exports.isValidJson = exports.isValidUrl = exports.throwError = void 0;
|
|
4
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
8
|
const ethers_1 = require("ethers");
|
|
9
|
+
const graphql_request_1 = __importDefault(require("graphql-request"));
|
|
6
10
|
const validator_1 = require("validator");
|
|
7
11
|
const constants_1 = require("./constants");
|
|
8
12
|
const enums_1 = require("./enums");
|
|
@@ -95,3 +99,49 @@ const getUnixTimestamp = (date) => {
|
|
|
95
99
|
return Math.floor(date.getTime() / 1000);
|
|
96
100
|
};
|
|
97
101
|
exports.getUnixTimestamp = getUnixTimestamp;
|
|
102
|
+
const isIndexerError = (error) => {
|
|
103
|
+
if (!error)
|
|
104
|
+
return false;
|
|
105
|
+
const errorMessage = error.response?.errors?.[0]?.message ||
|
|
106
|
+
error.message ||
|
|
107
|
+
error.toString() ||
|
|
108
|
+
'';
|
|
109
|
+
return errorMessage.toLowerCase().includes('bad indexers');
|
|
110
|
+
};
|
|
111
|
+
exports.isIndexerError = isIndexerError;
|
|
112
|
+
const sleep = (ms) => {
|
|
113
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Execute a GraphQL request with automatic retry logic for bad indexer errors.
|
|
117
|
+
* Only retries if options is provided.
|
|
118
|
+
*/
|
|
119
|
+
const customGqlFetch = async (url, query, variables, options) => {
|
|
120
|
+
if (!options) {
|
|
121
|
+
return await (0, graphql_request_1.default)(url, query, variables);
|
|
122
|
+
}
|
|
123
|
+
if ((options.maxRetries && options.baseDelay === undefined) ||
|
|
124
|
+
(options.baseDelay && options.maxRetries === undefined)) {
|
|
125
|
+
throw error_1.ErrorRetryParametersMissing;
|
|
126
|
+
}
|
|
127
|
+
let lastError;
|
|
128
|
+
for (let attempt = 0; attempt <= options.maxRetries; attempt++) {
|
|
129
|
+
try {
|
|
130
|
+
const result = await (0, graphql_request_1.default)(url, query, variables);
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
lastError = error;
|
|
135
|
+
if (attempt === options.maxRetries) {
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
if (!(0, exports.isIndexerError)(error)) {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
const delay = options.baseDelay * attempt;
|
|
142
|
+
await sleep(delay);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
throw lastError;
|
|
146
|
+
};
|
|
147
|
+
exports.customGqlFetch = customGqlFetch;
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ChainId } from './enums';
|
|
2
|
-
import { IWorker, IWorkersFilter } from './interfaces';
|
|
2
|
+
import { IWorker, IWorkersFilter, SubgraphOptions } from './interfaces';
|
|
3
3
|
export declare class WorkerUtils {
|
|
4
4
|
/**
|
|
5
5
|
* This function returns the worker data for the given address.
|
|
6
6
|
*
|
|
7
7
|
* @param {ChainId} chainId The chain ID.
|
|
8
8
|
* @param {string} address The worker address.
|
|
9
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
9
10
|
* @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
|
|
10
11
|
*
|
|
11
12
|
* **Code example**
|
|
@@ -16,7 +17,7 @@ export declare class WorkerUtils {
|
|
|
16
17
|
* const worker = await WorkerUtils.getWorker(ChainId.POLYGON, '0x1234567890abcdef1234567890abcdef12345678');
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
static getWorker(chainId: ChainId, address: string): Promise<IWorker | null>;
|
|
20
|
+
static getWorker(chainId: ChainId, address: string, options?: SubgraphOptions): Promise<IWorker | null>;
|
|
20
21
|
/**
|
|
21
22
|
* This function returns all worker details based on the provided filter.
|
|
22
23
|
*
|
|
@@ -43,6 +44,7 @@ export declare class WorkerUtils {
|
|
|
43
44
|
* ```
|
|
44
45
|
*
|
|
45
46
|
* @param {IWorkersFilter} filter Filter for the workers.
|
|
47
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
46
48
|
* @returns {Promise<IWorker[]>} Returns an array with all the worker details.
|
|
47
49
|
*
|
|
48
50
|
* **Code example**
|
|
@@ -58,6 +60,6 @@ export declare class WorkerUtils {
|
|
|
58
60
|
* const workers = await WorkerUtils.getWorkers(filter);
|
|
59
61
|
* ```
|
|
60
62
|
*/
|
|
61
|
-
static getWorkers(filter: IWorkersFilter): Promise<IWorker[]>;
|
|
63
|
+
static getWorkers(filter: IWorkersFilter, options?: SubgraphOptions): Promise<IWorker[]>;
|
|
62
64
|
}
|
|
63
65
|
//# sourceMappingURL=worker.d.ts.map
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGxE,qBAAa,WAAW;IACtB;;;;;;;;;;;;;;;OAeG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA0B1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;WACiB,UAAU,CAC5B,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC;CAoCtB"}
|
package/dist/worker.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.WorkerUtils = void 0;
|
|
7
4
|
const ethers_1 = require("ethers");
|
|
8
|
-
const graphql_request_1 = __importDefault(require("graphql-request"));
|
|
9
5
|
const constants_1 = require("./constants");
|
|
10
6
|
const enums_1 = require("./enums");
|
|
11
7
|
const error_1 = require("./error");
|
|
@@ -17,6 +13,7 @@ class WorkerUtils {
|
|
|
17
13
|
*
|
|
18
14
|
* @param {ChainId} chainId The chain ID.
|
|
19
15
|
* @param {string} address The worker address.
|
|
16
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
20
17
|
* @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
|
|
21
18
|
*
|
|
22
19
|
* **Code example**
|
|
@@ -27,7 +24,7 @@ class WorkerUtils {
|
|
|
27
24
|
* const worker = await WorkerUtils.getWorker(ChainId.POLYGON, '0x1234567890abcdef1234567890abcdef12345678');
|
|
28
25
|
* ```
|
|
29
26
|
*/
|
|
30
|
-
static async getWorker(chainId, address) {
|
|
27
|
+
static async getWorker(chainId, address, options) {
|
|
31
28
|
const networkData = constants_1.NETWORKS[chainId];
|
|
32
29
|
if (!networkData) {
|
|
33
30
|
throw error_1.ErrorUnsupportedChainID;
|
|
@@ -35,9 +32,9 @@ class WorkerUtils {
|
|
|
35
32
|
if (!ethers_1.ethers.isAddress(address)) {
|
|
36
33
|
throw error_1.ErrorInvalidAddress;
|
|
37
34
|
}
|
|
38
|
-
const { worker } = await (0,
|
|
35
|
+
const { worker } = await (0, utils_1.customGqlFetch)((0, utils_1.getSubgraphUrl)(networkData), worker_1.GET_WORKER_QUERY, {
|
|
39
36
|
address: address.toLowerCase(),
|
|
40
|
-
});
|
|
37
|
+
}, options);
|
|
41
38
|
if (!worker)
|
|
42
39
|
return null;
|
|
43
40
|
return mapWorker(worker);
|
|
@@ -68,6 +65,7 @@ class WorkerUtils {
|
|
|
68
65
|
* ```
|
|
69
66
|
*
|
|
70
67
|
* @param {IWorkersFilter} filter Filter for the workers.
|
|
68
|
+
* @param {SubgraphOptions} options Optional configuration for subgraph requests.
|
|
71
69
|
* @returns {Promise<IWorker[]>} Returns an array with all the worker details.
|
|
72
70
|
*
|
|
73
71
|
* **Code example**
|
|
@@ -83,7 +81,7 @@ class WorkerUtils {
|
|
|
83
81
|
* const workers = await WorkerUtils.getWorkers(filter);
|
|
84
82
|
* ```
|
|
85
83
|
*/
|
|
86
|
-
static async getWorkers(filter) {
|
|
84
|
+
static async getWorkers(filter, options) {
|
|
87
85
|
const first = filter.first !== undefined ? Math.min(filter.first, 1000) : 10;
|
|
88
86
|
const skip = filter.skip || 0;
|
|
89
87
|
const orderBy = filter.orderBy || 'payoutCount';
|
|
@@ -95,13 +93,13 @@ class WorkerUtils {
|
|
|
95
93
|
if (filter.address && !ethers_1.ethers.isAddress(filter.address)) {
|
|
96
94
|
throw error_1.ErrorInvalidAddress;
|
|
97
95
|
}
|
|
98
|
-
const { workers } = await (0,
|
|
96
|
+
const { workers } = await (0, utils_1.customGqlFetch)((0, utils_1.getSubgraphUrl)(networkData), (0, worker_1.GET_WORKERS_QUERY)(filter), {
|
|
99
97
|
address: filter?.address?.toLowerCase(),
|
|
100
98
|
first: first,
|
|
101
99
|
skip: skip,
|
|
102
100
|
orderBy: orderBy,
|
|
103
101
|
orderDirection: orderDirection,
|
|
104
|
-
});
|
|
102
|
+
}, options);
|
|
105
103
|
if (!workers) {
|
|
106
104
|
return [];
|
|
107
105
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@human-protocol/sdk",
|
|
3
3
|
"description": "Human Protocol SDK",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.1.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
7
7
|
"dist"
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"vitest": "^3.0.9"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
+
"@types/validator": "^13.15.4",
|
|
54
55
|
"eslint": "^8.55.0",
|
|
55
56
|
"prettier": "^3.4.2",
|
|
56
57
|
"ts-node": "^10.9.2",
|