@human-protocol/sdk 5.2.0 → 6.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.
Files changed (63) hide show
  1. package/dist/base.d.ts +4 -5
  2. package/dist/base.d.ts.map +1 -1
  3. package/dist/base.js +4 -5
  4. package/dist/constants.js +6 -6
  5. package/dist/encryption.d.ts +68 -203
  6. package/dist/encryption.d.ts.map +1 -1
  7. package/dist/encryption.js +66 -202
  8. package/dist/error.d.ts +0 -24
  9. package/dist/error.d.ts.map +1 -1
  10. package/dist/error.js +2 -26
  11. package/dist/escrow.d.ts +427 -780
  12. package/dist/escrow.d.ts.map +1 -1
  13. package/dist/escrow.js +314 -684
  14. package/dist/graphql/queries/operator.d.ts.map +1 -1
  15. package/dist/graphql/queries/operator.js +3 -1
  16. package/dist/graphql/types.d.ts.map +1 -1
  17. package/dist/index.d.ts +3 -4
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -4
  20. package/dist/kvstore.d.ts +119 -181
  21. package/dist/kvstore.d.ts.map +1 -1
  22. package/dist/kvstore.js +119 -182
  23. package/dist/operator.d.ts +59 -30
  24. package/dist/operator.d.ts.map +1 -1
  25. package/dist/operator.js +59 -30
  26. package/dist/staking.d.ts +135 -134
  27. package/dist/staking.d.ts.map +1 -1
  28. package/dist/staking.js +135 -134
  29. package/dist/statistics.d.ts +104 -134
  30. package/dist/statistics.d.ts.map +1 -1
  31. package/dist/statistics.js +119 -144
  32. package/dist/transaction.d.ts +36 -15
  33. package/dist/transaction.d.ts.map +1 -1
  34. package/dist/transaction.js +36 -15
  35. package/dist/types.d.ts +0 -54
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/utils.d.ts +31 -17
  38. package/dist/utils.d.ts.map +1 -1
  39. package/dist/utils.js +31 -17
  40. package/dist/worker.d.ts +35 -14
  41. package/dist/worker.d.ts.map +1 -1
  42. package/dist/worker.js +35 -14
  43. package/package.json +7 -24
  44. package/src/base.ts +4 -5
  45. package/src/constants.ts +6 -6
  46. package/src/encryption.ts +69 -203
  47. package/src/error.ts +0 -36
  48. package/src/escrow.ts +425 -780
  49. package/src/graphql/queries/operator.ts +3 -1
  50. package/src/graphql/types.ts +4 -2
  51. package/src/index.ts +4 -5
  52. package/src/kvstore.ts +120 -183
  53. package/src/operator.ts +59 -30
  54. package/src/staking.ts +135 -134
  55. package/src/statistics.ts +125 -146
  56. package/src/transaction.ts +36 -15
  57. package/src/types.ts +0 -57
  58. package/src/utils.ts +31 -17
  59. package/src/worker.ts +35 -14
  60. package/dist/storage.d.ts +0 -186
  61. package/dist/storage.d.ts.map +0 -1
  62. package/dist/storage.js +0 -319
  63. package/src/storage.ts +0 -313
package/dist/utils.d.ts CHANGED
@@ -1,44 +1,58 @@
1
1
  import { NetworkData } from './types';
2
2
  import { SubgraphOptions } from './interfaces';
3
3
  /**
4
- * **Handle and throw the error.*
4
+ * Handles and throws appropriate error types based on the Ethereum error.
5
5
  *
6
- * @param {any} e
7
- * @returns
6
+ * @param e - The error to handle
7
+ * @throws {InvalidArgumentError} If the error is an invalid argument error
8
+ * @throws {ContractExecutionError} If the error is a contract execution error
9
+ * @throws {TransactionReplaced} If the transaction was replaced
10
+ * @throws {ReplacementUnderpriced} If the replacement transaction was underpriced
11
+ * @throws {NumericFault} If there's a numeric fault
12
+ * @throws {NonceExpired} If the nonce has expired
13
+ * @throws {EthereumError} For any other Ethereum-related error
8
14
  */
9
15
  export declare const throwError: (e: any) => never;
10
16
  /**
11
- * **URL validation.*
17
+ * Validates if a string is a valid URL.
12
18
  *
13
- * @param {string} url
14
- * @returns
19
+ * @param url - The URL string to validate
20
+ * @returns True if the URL is valid, false otherwise
15
21
  */
16
22
  export declare const isValidUrl: (url: string) => boolean;
17
23
  /**
18
- * **Check if a string is a valid JSON.*
24
+ * Checks if a string is valid JSON.
19
25
  *
20
- * @param {string} input
21
- * @returns {boolean}
26
+ * @param input - The string to check
27
+ * @returns True if the string is valid JSON, false otherwise
22
28
  */
23
29
  export declare const isValidJson: (input: string) => boolean;
24
30
  /**
25
- * **Get the subgraph URL.*
31
+ * Gets the subgraph URL for the given network, using API key if available.
26
32
  *
27
- * @param {NetworkData} networkData
28
- * @returns
33
+ * @param networkData - The network data containing subgraph URLs
34
+ * @returns The subgraph URL with API key if available
29
35
  */
30
36
  export declare const getSubgraphUrl: (networkData: NetworkData) => string;
31
37
  /**
32
- * **Convert a date to Unix timestamp (seconds since epoch).*
38
+ * Converts a Date object to Unix timestamp (seconds since epoch).
33
39
  *
34
- * @param {Date} date
35
- * @returns {number}
40
+ * @param date - The date to convert
41
+ * @returns Unix timestamp in seconds
36
42
  */
37
43
  export declare const getUnixTimestamp: (date: Date) => number;
38
44
  export declare const isIndexerError: (error: any) => boolean;
39
45
  /**
40
- * Execute a GraphQL request with automatic retry logic for bad indexer errors.
41
- * Only retries if options is provided.
46
+ * Executes a GraphQL request with automatic retry logic for bad indexer errors.
47
+ * Only retries if options is provided with maxRetries and baseDelay.
48
+ *
49
+ * @param url - The GraphQL endpoint URL
50
+ * @param query - The GraphQL query to execute
51
+ * @param variables - Variables for the GraphQL query (optional)
52
+ * @param options - Optional configuration for subgraph requests including retry logic
53
+ * @returns The response data from the GraphQL query
54
+ * @throws ErrorRetryParametersMissing If only one of maxRetries or baseDelay is provided
55
+ * @throws ErrorRoutingRequestsToIndexerRequiresApiKey If indexerId is provided without API key
42
56
  */
43
57
  export declare const customGqlFetch: <T = any>(url: string, query: any, variables?: any, options?: SubgraphOptions) => Promise<T>;
44
58
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAmBA,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;AAaF;;;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,CA4CX,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;GAWG;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;AAaF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,GAAG,GAAG,EAC1C,KAAK,MAAM,EACX,OAAO,GAAG,EACV,YAAY,GAAG,EACf,UAAU,eAAe,KACxB,OAAO,CAAC,CAAC,CA4CX,CAAC"}
package/dist/utils.js CHANGED
@@ -12,10 +12,16 @@ const constants_1 = require("./constants");
12
12
  const enums_1 = require("./enums");
13
13
  const error_1 = require("./error");
14
14
  /**
15
- * **Handle and throw the error.*
15
+ * Handles and throws appropriate error types based on the Ethereum error.
16
16
  *
17
- * @param {any} e
18
- * @returns
17
+ * @param e - The error to handle
18
+ * @throws {InvalidArgumentError} If the error is an invalid argument error
19
+ * @throws {ContractExecutionError} If the error is a contract execution error
20
+ * @throws {TransactionReplaced} If the transaction was replaced
21
+ * @throws {ReplacementUnderpriced} If the replacement transaction was underpriced
22
+ * @throws {NumericFault} If there's a numeric fault
23
+ * @throws {NonceExpired} If the nonce has expired
24
+ * @throws {EthereumError} For any other Ethereum-related error
19
25
  */
20
26
  const throwError = (e) => {
21
27
  if (ethers_1.ethers.isError(e, 'INVALID_ARGUMENT')) {
@@ -42,10 +48,10 @@ const throwError = (e) => {
42
48
  };
43
49
  exports.throwError = throwError;
44
50
  /**
45
- * **URL validation.*
51
+ * Validates if a string is a valid URL.
46
52
  *
47
- * @param {string} url
48
- * @returns
53
+ * @param url - The URL string to validate
54
+ * @returns True if the URL is valid, false otherwise
49
55
  */
50
56
  const isValidUrl = (url) => {
51
57
  return (0, validator_1.isURL)(url, {
@@ -56,10 +62,10 @@ const isValidUrl = (url) => {
56
62
  };
57
63
  exports.isValidUrl = isValidUrl;
58
64
  /**
59
- * **Check if a string is a valid JSON.*
65
+ * Checks if a string is valid JSON.
60
66
  *
61
- * @param {string} input
62
- * @returns {boolean}
67
+ * @param input - The string to check
68
+ * @returns True if the string is valid JSON, false otherwise
63
69
  */
64
70
  const isValidJson = (input) => {
65
71
  try {
@@ -72,10 +78,10 @@ const isValidJson = (input) => {
72
78
  };
73
79
  exports.isValidJson = isValidJson;
74
80
  /**
75
- * **Get the subgraph URL.*
81
+ * Gets the subgraph URL for the given network, using API key if available.
76
82
  *
77
- * @param {NetworkData} networkData
78
- * @returns
83
+ * @param networkData - The network data containing subgraph URLs
84
+ * @returns The subgraph URL with API key if available
79
85
  */
80
86
  const getSubgraphUrl = (networkData) => {
81
87
  let subgraphUrl = networkData.subgraphUrl;
@@ -90,10 +96,10 @@ const getSubgraphUrl = (networkData) => {
90
96
  };
91
97
  exports.getSubgraphUrl = getSubgraphUrl;
92
98
  /**
93
- * **Convert a date to Unix timestamp (seconds since epoch).*
99
+ * Converts a Date object to Unix timestamp (seconds since epoch).
94
100
  *
95
- * @param {Date} date
96
- * @returns {number}
101
+ * @param date - The date to convert
102
+ * @returns Unix timestamp in seconds
97
103
  */
98
104
  const getUnixTimestamp = (date) => {
99
105
  return Math.floor(date.getTime() / 1000);
@@ -119,8 +125,16 @@ const buildIndexerUrl = (baseUrl, indexerId) => {
119
125
  return `${baseUrl}/indexers/id/${indexerId}`;
120
126
  };
121
127
  /**
122
- * Execute a GraphQL request with automatic retry logic for bad indexer errors.
123
- * Only retries if options is provided.
128
+ * Executes a GraphQL request with automatic retry logic for bad indexer errors.
129
+ * Only retries if options is provided with maxRetries and baseDelay.
130
+ *
131
+ * @param url - The GraphQL endpoint URL
132
+ * @param query - The GraphQL query to execute
133
+ * @param variables - Variables for the GraphQL query (optional)
134
+ * @param options - Optional configuration for subgraph requests including retry logic
135
+ * @returns The response data from the GraphQL query
136
+ * @throws ErrorRetryParametersMissing If only one of maxRetries or baseDelay is provided
137
+ * @throws ErrorRoutingRequestsToIndexerRequiresApiKey If indexerId is provided without API key
124
138
  */
125
139
  const customGqlFetch = async (url, query, variables, options) => {
126
140
  const apiKey = process.env.SUBGRAPH_API_KEY;
package/dist/worker.d.ts CHANGED
@@ -1,20 +1,39 @@
1
1
  import { ChainId } from './enums';
2
2
  import { IWorker, IWorkersFilter, SubgraphOptions } from './interfaces';
3
+ /**
4
+ * Utility class for worker-related operations.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
9
+ *
10
+ * const worker = await WorkerUtils.getWorker(
11
+ * ChainId.POLYGON_AMOY,
12
+ * '0x1234567890abcdef1234567890abcdef12345678'
13
+ * );
14
+ * console.log('Worker:', worker);
15
+ * ```
16
+ */
3
17
  export declare class WorkerUtils {
4
18
  /**
5
19
  * This function returns the worker data for the given address.
6
20
  *
7
- * @param {ChainId} chainId The chain ID.
8
- * @param {string} address The worker address.
9
- * @param {SubgraphOptions} options Optional configuration for subgraph requests.
10
- * @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
11
- *
12
- * **Code example**
21
+ * @param chainId - The chain ID.
22
+ * @param address - The worker address.
23
+ * @param options - Optional configuration for subgraph requests.
24
+ * @returns Returns the worker details or null if not found.
25
+ * @throws ErrorUnsupportedChainID If the chain ID is not supported
26
+ * @throws ErrorInvalidAddress If the address is invalid
13
27
  *
28
+ * @example
14
29
  * ```ts
15
30
  * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
16
31
  *
17
- * const worker = await WorkerUtils.getWorker(ChainId.POLYGON, '0x1234567890abcdef1234567890abcdef12345678');
32
+ * const worker = await WorkerUtils.getWorker(
33
+ * ChainId.POLYGON_AMOY,
34
+ * '0x1234567890abcdef1234567890abcdef12345678'
35
+ * );
36
+ * console.log('Worker:', worker);
18
37
  * ```
19
38
  */
20
39
  static getWorker(chainId: ChainId, address: string, options?: SubgraphOptions): Promise<IWorker | null>;
@@ -43,21 +62,23 @@ export declare class WorkerUtils {
43
62
  * };
44
63
  * ```
45
64
  *
46
- * @param {IWorkersFilter} filter Filter for the workers.
47
- * @param {SubgraphOptions} options Optional configuration for subgraph requests.
48
- * @returns {Promise<IWorker[]>} Returns an array with all the worker details.
49
- *
50
- * **Code example**
65
+ * @param filter - Filter for the workers.
66
+ * @param options - Optional configuration for subgraph requests.
67
+ * @returns Returns an array with all the worker details.
68
+ * @throws ErrorUnsupportedChainID If the chain ID is not supported
69
+ * @throws ErrorInvalidAddress If the filter address is invalid
51
70
  *
71
+ * @example
52
72
  * ```ts
53
73
  * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
54
74
  *
55
- * const filter: IWorkersFilter = {
56
- * chainId: ChainId.POLYGON,
75
+ * const filter = {
76
+ * chainId: ChainId.POLYGON_AMOY,
57
77
  * first: 10,
58
78
  * skip: 0,
59
79
  * };
60
80
  * const workers = await WorkerUtils.getWorkers(filter);
81
+ * console.log('Workers:', workers.length);
61
82
  * ```
62
83
  */
63
84
  static getWorkers(filter: IWorkersFilter, options?: SubgraphOptions): Promise<IWorker[]>;
@@ -1 +1 @@
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"}
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;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW;IACtB;;;;;;;;;;;;;;;;;;;;OAoBG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA0B1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;WACiB,UAAU,CAC5B,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC;CAoCtB"}
package/dist/worker.js CHANGED
@@ -7,21 +7,40 @@ const enums_1 = require("./enums");
7
7
  const error_1 = require("./error");
8
8
  const worker_1 = require("./graphql/queries/worker");
9
9
  const utils_1 = require("./utils");
10
+ /**
11
+ * Utility class for worker-related operations.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
16
+ *
17
+ * const worker = await WorkerUtils.getWorker(
18
+ * ChainId.POLYGON_AMOY,
19
+ * '0x1234567890abcdef1234567890abcdef12345678'
20
+ * );
21
+ * console.log('Worker:', worker);
22
+ * ```
23
+ */
10
24
  class WorkerUtils {
11
25
  /**
12
26
  * This function returns the worker data for the given address.
13
27
  *
14
- * @param {ChainId} chainId The chain ID.
15
- * @param {string} address The worker address.
16
- * @param {SubgraphOptions} options Optional configuration for subgraph requests.
17
- * @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
18
- *
19
- * **Code example**
28
+ * @param chainId - The chain ID.
29
+ * @param address - The worker address.
30
+ * @param options - Optional configuration for subgraph requests.
31
+ * @returns Returns the worker details or null if not found.
32
+ * @throws ErrorUnsupportedChainID If the chain ID is not supported
33
+ * @throws ErrorInvalidAddress If the address is invalid
20
34
  *
35
+ * @example
21
36
  * ```ts
22
37
  * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
23
38
  *
24
- * const worker = await WorkerUtils.getWorker(ChainId.POLYGON, '0x1234567890abcdef1234567890abcdef12345678');
39
+ * const worker = await WorkerUtils.getWorker(
40
+ * ChainId.POLYGON_AMOY,
41
+ * '0x1234567890abcdef1234567890abcdef12345678'
42
+ * );
43
+ * console.log('Worker:', worker);
25
44
  * ```
26
45
  */
27
46
  static async getWorker(chainId, address, options) {
@@ -64,21 +83,23 @@ class WorkerUtils {
64
83
  * };
65
84
  * ```
66
85
  *
67
- * @param {IWorkersFilter} filter Filter for the workers.
68
- * @param {SubgraphOptions} options Optional configuration for subgraph requests.
69
- * @returns {Promise<IWorker[]>} Returns an array with all the worker details.
70
- *
71
- * **Code example**
86
+ * @param filter - Filter for the workers.
87
+ * @param options - Optional configuration for subgraph requests.
88
+ * @returns Returns an array with all the worker details.
89
+ * @throws ErrorUnsupportedChainID If the chain ID is not supported
90
+ * @throws ErrorInvalidAddress If the filter address is invalid
72
91
  *
92
+ * @example
73
93
  * ```ts
74
94
  * import { WorkerUtils, ChainId } from '@human-protocol/sdk';
75
95
  *
76
- * const filter: IWorkersFilter = {
77
- * chainId: ChainId.POLYGON,
96
+ * const filter = {
97
+ * chainId: ChainId.POLYGON_AMOY,
78
98
  * first: 10,
79
99
  * skip: 0,
80
100
  * };
81
101
  * const workers = await WorkerUtils.getWorkers(filter);
102
+ * console.log('Workers:', workers.length);
82
103
  * ```
83
104
  */
84
105
  static async getWorkers(filter, options) {
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.2.0",
4
+ "version": "6.0.0",
5
5
  "files": [
6
6
  "src",
7
7
  "dist"
@@ -10,9 +10,9 @@
10
10
  "types": "dist/index.d.ts",
11
11
  "scripts": {
12
12
  "clean": "tsc --build --clean && rm -rf ./dist",
13
- "clean:doc": "rm -rf ../../../../docs/sdk/typescript/",
14
13
  "build": "yarn clean && tsc --build",
15
- "build:doc": "yarn clean:doc && typedoc --plugin typedoc-plugin-markdown --out ../../../../docs/sdk/typescript/",
14
+ "docs:post": "ts-node scripts/postprocess-docs.ts",
15
+ "build:doc": "typedoc && yarn docs:post",
16
16
  "test": "vitest -u",
17
17
  "lint": "eslint .",
18
18
  "lint:fix": "eslint . --fix",
@@ -44,7 +44,6 @@
44
44
  "graphql": "^16.8.1",
45
45
  "graphql-request": "^7.3.4",
46
46
  "graphql-tag": "^2.12.6",
47
- "minio": "7.1.3",
48
47
  "openpgp": "^6.2.2",
49
48
  "secp256k1": "^5.0.1",
50
49
  "validator": "^13.12.0",
@@ -55,27 +54,11 @@
55
54
  "eslint": "^9.39.1",
56
55
  "eslint-plugin-jest": "^28.9.0",
57
56
  "eslint-plugin-prettier": "^5.2.1",
58
- "prettier": "^3.4.2",
57
+ "glob": "^13.0.0",
58
+ "prettier": "^3.7.4",
59
59
  "ts-node": "^10.9.2",
60
- "typedoc": "^0.28.7",
61
- "typedoc-plugin-markdown": "^4.2.3",
60
+ "typedoc": "^0.28.15",
61
+ "typedoc-plugin-markdown": "^4.9.0",
62
62
  "typescript": "^5.8.3"
63
- },
64
- "typedocOptions": {
65
- "entryPoints": [
66
- "./src/base.ts",
67
- "./src/encryption.ts",
68
- "./src/escrow.ts",
69
- "./src/kvstore.ts",
70
- "./src/operator.ts",
71
- "./src/staking.ts",
72
- "./src/storage.ts",
73
- "./src/statistics.ts",
74
- "./src/transaction.ts",
75
- "./src/enums.ts",
76
- "./src/graphql/types.ts",
77
- "./src/interfaces.ts",
78
- "./src/types.ts"
79
- ]
80
63
  }
81
64
  }
package/src/base.ts CHANGED
@@ -2,10 +2,9 @@ import { ContractRunner } from 'ethers';
2
2
  import { NetworkData } from './types';
3
3
 
4
4
  /**
5
- * ## Introduction
6
- *
7
- * This class is used as a base class for other clients making on-chain calls.
5
+ * Base class for clients making on-chain calls.
8
6
  *
7
+ * This class provides common functionality for interacting with Ethereum contracts.
9
8
  */
10
9
  export abstract class BaseEthersClient {
11
10
  protected runner: ContractRunner;
@@ -14,8 +13,8 @@ export abstract class BaseEthersClient {
14
13
  /**
15
14
  * **BaseClient constructor**
16
15
  *
17
- * @param {ContractRunner} runner The Signer or Provider object to interact with the Ethereum network
18
- * @param {NetworkData} networkData The network information required to connect to the contracts
16
+ * @param runner - The Signer or Provider object to interact with the Ethereum network
17
+ * @param networkData - The network information required to connect to the contracts
19
18
  */
20
19
  constructor(runner: ContractRunner, networkData: NetworkData) {
21
20
  this.networkData = networkData;
package/src/constants.ts CHANGED
@@ -36,7 +36,7 @@ export const NETWORKS: {
36
36
  subgraphUrl:
37
37
  'https://api.studio.thegraph.com/query/74256/ethereum/version/latest',
38
38
  subgraphUrlApiKey:
39
- 'https://gateway.thegraph.com/api/deployments/id/QmXGmcjEtwwEgB83KE2ECjjYY38kLMqzaq4ip8GWY7A6zz',
39
+ 'https://gateway.thegraph.com/api/deployments/id/QmeCB3KX49nRAkzgqancc3yL3VMJvt65YtL1zrLCFgr2n5',
40
40
  oldSubgraphUrl: '',
41
41
  oldFactoryAddress: '',
42
42
  },
@@ -51,7 +51,7 @@ export const NETWORKS: {
51
51
  subgraphUrl:
52
52
  'https://api.studio.thegraph.com/query/74256/sepolia/version/latest',
53
53
  subgraphUrlApiKey:
54
- 'https://gateway.thegraph.com/api/deployments/id/QmT4xNvZh8ymarrk1zdytjLhCW59iuTavsd4JgHS4LbCVB',
54
+ 'https://gateway.thegraph.com/api/deployments/id/QmcMntqZSTh8wJddxgp2hYcdw78wZFU86LHTHzJ1bTVUDc',
55
55
  oldSubgraphUrl: '',
56
56
  oldFactoryAddress: '',
57
57
  },
@@ -66,7 +66,7 @@ export const NETWORKS: {
66
66
  subgraphUrl:
67
67
  'https://api.studio.thegraph.com/query/74256/bsc/version/latest',
68
68
  subgraphUrlApiKey:
69
- 'https://gateway.thegraph.com/api/deployments/id/QmdVdpm9NnFz5B8QyzhW1bW1nNfRWemTiFn2MrhYZGTSQD',
69
+ 'https://gateway.thegraph.com/api/deployments/id/QmRexbu8eLZ1iE7ZLMtKxAr9GJnQ1JVrXhybKq6JkJ9XLE',
70
70
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc',
71
71
  oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4',
72
72
  },
@@ -81,7 +81,7 @@ export const NETWORKS: {
81
81
  subgraphUrl:
82
82
  'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest',
83
83
  subgraphUrlApiKey:
84
- 'https://gateway.thegraph.com/api/deployments/id/QmZjYMktZe8RAz7W7qL33VZBV6AC57xsLyE1cEfv6NABdZ',
84
+ 'https://gateway.thegraph.com/api/deployments/id/QmfFBXsAP7nbckFx34XYcNq2hRnfoVNrfqCvuk7hmAtYJT',
85
85
  oldSubgraphUrl:
86
86
  'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest',
87
87
  oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f',
@@ -97,7 +97,7 @@ export const NETWORKS: {
97
97
  subgraphUrl:
98
98
  'https://api.studio.thegraph.com/query/74256/polygon/version/latest',
99
99
  subgraphUrlApiKey:
100
- 'https://gateway.thegraph.com/api/deployments/id/QmUt9mmfNjtC5ZnQNiWHRbFG3k5zfngMuoTyky9jhXYqG2',
100
+ 'https://gateway.thegraph.com/api/deployments/id/QmUwHMDjnDHDB5cowGqd96SRJ1sZegoAPanjxBWUyLZghv',
101
101
  oldSubgraphUrl:
102
102
  'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon',
103
103
  oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794',
@@ -113,7 +113,7 @@ export const NETWORKS: {
113
113
  subgraphUrl:
114
114
  'https://api.studio.thegraph.com/query/74256/amoy/version/latest',
115
115
  subgraphUrlApiKey:
116
- 'https://gateway.thegraph.com/api/deployments/id/QmWRUFWpWoRRUh7Ec1HUJEwxc84DkP4iFTfLLsoVngJAPa',
116
+ 'https://gateway.thegraph.com/api/deployments/id/QmTJfcvVVmw8fe5CwRP6tZD5FzE2ESrm3ryygS1YZMYhM7',
117
117
  oldSubgraphUrl: '',
118
118
  oldFactoryAddress: '',
119
119
  },