@human-protocol/sdk 4.3.0 → 4.4.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/escrow.d.ts +2 -2
- package/dist/escrow.d.ts.map +1 -1
- package/dist/escrow.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/operator.d.ts +2 -2
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +2 -2
- package/dist/transaction.d.ts +2 -2
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +7 -8
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +2 -1
- package/src/escrow.ts +3 -2
- package/src/index.ts +12 -0
- package/src/operator.ts +3 -3
- package/src/transaction.ts +2 -2
- package/src/utils.ts +8 -8
- package/src/worker.ts +1 -1
package/dist/escrow.d.ts
CHANGED
|
@@ -849,7 +849,7 @@ export declare class EscrowUtils {
|
|
|
849
849
|
*
|
|
850
850
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
851
851
|
* @param {string} escrowAddress Address of the escrow
|
|
852
|
-
* @returns {IEscrow} Escrow data
|
|
852
|
+
* @returns {Promise<IEscrow | null>} - Escrow data or null if not found.
|
|
853
853
|
*
|
|
854
854
|
* **Code example**
|
|
855
855
|
*
|
|
@@ -859,7 +859,7 @@ export declare class EscrowUtils {
|
|
|
859
859
|
* const escrow = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890");
|
|
860
860
|
* ```
|
|
861
861
|
*/
|
|
862
|
-
static getEscrow(chainId: ChainId, escrowAddress: string): Promise<IEscrow>;
|
|
862
|
+
static getEscrow(chainId: ChainId, escrowAddress: string): Promise<IEscrow | null>;
|
|
863
863
|
/**
|
|
864
864
|
* This function returns the status events for a given set of networks within an optional date range.
|
|
865
865
|
*
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IACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+FG;WACiB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA2D1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAqB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;WACiB,eAAe,CACjC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,WAAW,EAAE,CAAC;IA+DzB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;WACiB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAiCzE"}
|
package/dist/escrow.js
CHANGED
|
@@ -1482,7 +1482,7 @@ class EscrowUtils {
|
|
|
1482
1482
|
*
|
|
1483
1483
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
1484
1484
|
* @param {string} escrowAddress Address of the escrow
|
|
1485
|
-
* @returns {IEscrow} Escrow data
|
|
1485
|
+
* @returns {Promise<IEscrow | null>} - Escrow data or null if not found.
|
|
1486
1486
|
*
|
|
1487
1487
|
* **Code example**
|
|
1488
1488
|
*
|
|
@@ -1501,6 +1501,7 @@ class EscrowUtils {
|
|
|
1501
1501
|
throw error_1.ErrorInvalidAddress;
|
|
1502
1502
|
}
|
|
1503
1503
|
const { escrow } = await (0, graphql_request_1.default)((0, utils_1.getSubgraphUrl)(networkData), (0, graphql_1.GET_ESCROW_BY_ADDRESS_QUERY)(), { escrowAddress: escrowAddress.toLowerCase() });
|
|
1504
|
+
escrow.chainId = networkData.chainId;
|
|
1504
1505
|
return escrow || null;
|
|
1505
1506
|
}
|
|
1506
1507
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export * from './constants';
|
|
|
11
11
|
export * from './types';
|
|
12
12
|
export * from './enums';
|
|
13
13
|
export * from './interfaces';
|
|
14
|
+
export { EthereumError, InvalidArgumentError, ReplacementUnderpriced, NumericFault, NonceExpired, TransactionReplaced, ContractExecutionError, InvalidEthereumAddressError, InvalidKeyError, } from './error';
|
|
14
15
|
export { StakingClient, StorageClient, KVStoreClient, KVStoreUtils, EscrowClient, EscrowUtils, StatisticsClient, Encryption, EncryptionUtils, OperatorUtils, TransactionUtils, WorkerUtils, };
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WorkerUtils = exports.TransactionUtils = exports.OperatorUtils = exports.EncryptionUtils = exports.Encryption = exports.StatisticsClient = exports.EscrowUtils = exports.EscrowClient = exports.KVStoreUtils = exports.KVStoreClient = exports.StorageClient = exports.StakingClient = void 0;
|
|
17
|
+
exports.WorkerUtils = exports.TransactionUtils = exports.OperatorUtils = exports.EncryptionUtils = exports.Encryption = exports.StatisticsClient = exports.EscrowUtils = exports.EscrowClient = exports.KVStoreUtils = exports.KVStoreClient = exports.StorageClient = exports.StakingClient = exports.InvalidKeyError = exports.InvalidEthereumAddressError = exports.ContractExecutionError = exports.TransactionReplaced = exports.NonceExpired = exports.NumericFault = exports.ReplacementUnderpriced = exports.InvalidArgumentError = exports.EthereumError = void 0;
|
|
18
18
|
const staking_1 = require("./staking");
|
|
19
19
|
Object.defineProperty(exports, "StakingClient", { enumerable: true, get: function () { return staking_1.StakingClient; } });
|
|
20
20
|
const storage_1 = require("./storage");
|
|
@@ -40,3 +40,13 @@ __exportStar(require("./constants"), exports);
|
|
|
40
40
|
__exportStar(require("./types"), exports);
|
|
41
41
|
__exportStar(require("./enums"), exports);
|
|
42
42
|
__exportStar(require("./interfaces"), exports);
|
|
43
|
+
var error_1 = require("./error");
|
|
44
|
+
Object.defineProperty(exports, "EthereumError", { enumerable: true, get: function () { return error_1.EthereumError; } });
|
|
45
|
+
Object.defineProperty(exports, "InvalidArgumentError", { enumerable: true, get: function () { return error_1.InvalidArgumentError; } });
|
|
46
|
+
Object.defineProperty(exports, "ReplacementUnderpriced", { enumerable: true, get: function () { return error_1.ReplacementUnderpriced; } });
|
|
47
|
+
Object.defineProperty(exports, "NumericFault", { enumerable: true, get: function () { return error_1.NumericFault; } });
|
|
48
|
+
Object.defineProperty(exports, "NonceExpired", { enumerable: true, get: function () { return error_1.NonceExpired; } });
|
|
49
|
+
Object.defineProperty(exports, "TransactionReplaced", { enumerable: true, get: function () { return error_1.TransactionReplaced; } });
|
|
50
|
+
Object.defineProperty(exports, "ContractExecutionError", { enumerable: true, get: function () { return error_1.ContractExecutionError; } });
|
|
51
|
+
Object.defineProperty(exports, "InvalidEthereumAddressError", { enumerable: true, get: function () { return error_1.InvalidEthereumAddressError; } });
|
|
52
|
+
Object.defineProperty(exports, "InvalidKeyError", { enumerable: true, get: function () { return error_1.InvalidKeyError; } });
|
package/dist/operator.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class OperatorUtils {
|
|
|
6
6
|
*
|
|
7
7
|
* @param {ChainId} chainId Network in which the operator is deployed
|
|
8
8
|
* @param {string} address Operator address.
|
|
9
|
-
* @returns {Promise<IOperator>} Returns the operator details.
|
|
9
|
+
* @returns {Promise<IOperator | null>} - Returns the operator details or null if not found.
|
|
10
10
|
*
|
|
11
11
|
* **Code example**
|
|
12
12
|
*
|
|
@@ -16,7 +16,7 @@ export declare class OperatorUtils {
|
|
|
16
16
|
* const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f');
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
static getOperator(chainId: ChainId, address: string): Promise<IOperator>;
|
|
19
|
+
static getOperator(chainId: ChainId, address: string): Promise<IOperator | null>;
|
|
20
20
|
/**
|
|
21
21
|
* This function returns all the operator details of the protocol.
|
|
22
22
|
*
|
package/dist/operator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAET,gBAAgB,EAEhB,OAAO,EACR,MAAM,cAAc,CAAC;AAetB,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAGlD,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;WACiB,WAAW,CAC7B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAET,gBAAgB,EAEhB,OAAO,EACR,MAAM,cAAc,CAAC;AAetB,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAGlD,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;WACiB,WAAW,CAC7B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA8C5B;;;;;;;;;;;;;;;;OAgBG;WACiB,YAAY,CAC9B,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,SAAS,EAAE,CAAC;IA+DvB;;;;;;;;;;;;;;;OAeG;WACiB,6BAA6B,CAC/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,EAAE,CAAC;IAmCvB;;;;;;;;;;;;;;OAcG;WACiB,UAAU,CAC5B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC;CAyBtB"}
|
package/dist/operator.js
CHANGED
|
@@ -19,7 +19,7 @@ class OperatorUtils {
|
|
|
19
19
|
*
|
|
20
20
|
* @param {ChainId} chainId Network in which the operator is deployed
|
|
21
21
|
* @param {string} address Operator address.
|
|
22
|
-
* @returns {Promise<IOperator>} Returns the operator details.
|
|
22
|
+
* @returns {Promise<IOperator | null>} - Returns the operator details or null if not found.
|
|
23
23
|
*
|
|
24
24
|
* **Code example**
|
|
25
25
|
*
|
|
@@ -41,7 +41,7 @@ class OperatorUtils {
|
|
|
41
41
|
address: address.toLowerCase(),
|
|
42
42
|
});
|
|
43
43
|
if (!operator) {
|
|
44
|
-
return
|
|
44
|
+
return null;
|
|
45
45
|
}
|
|
46
46
|
let jobTypes = [];
|
|
47
47
|
let reputationNetworks = [];
|
package/dist/transaction.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class TransactionUtils {
|
|
|
22
22
|
*
|
|
23
23
|
* @param {ChainId} chainId The chain ID.
|
|
24
24
|
* @param {string} hash The transaction hash.
|
|
25
|
-
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
25
|
+
* @returns {Promise<ITransaction | null>} - Returns the transaction details or null if not found.
|
|
26
26
|
*
|
|
27
27
|
* **Code example**
|
|
28
28
|
*
|
|
@@ -32,7 +32,7 @@ export declare class TransactionUtils {
|
|
|
32
32
|
* const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62dD51230A30401C455c8398d06F85e4EaB6309f');
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
static getTransaction(chainId: ChainId, hash: string): Promise<ITransaction>;
|
|
35
|
+
static getTransaction(chainId: ChainId, hash: string): Promise<ITransaction | null>;
|
|
36
36
|
/**
|
|
37
37
|
* This function returns all transaction details based on the provided filter.
|
|
38
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAUlD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGjE,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,cAAc,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAUlD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGjE,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,cAAc,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAmB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2DG;WACiB,eAAe,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,YAAY,EAAE,CAAC;CA2C3B"}
|
package/dist/transaction.js
CHANGED
|
@@ -34,7 +34,7 @@ class TransactionUtils {
|
|
|
34
34
|
*
|
|
35
35
|
* @param {ChainId} chainId The chain ID.
|
|
36
36
|
* @param {string} hash The transaction hash.
|
|
37
|
-
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
37
|
+
* @returns {Promise<ITransaction | null>} - Returns the transaction details or null if not found.
|
|
38
38
|
*
|
|
39
39
|
* **Code example**
|
|
40
40
|
*
|
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":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;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"}
|
package/dist/utils.js
CHANGED
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getUnixTimestamp = exports.getSubgraphUrl = exports.isValidJson = exports.isValidUrl = exports.throwError = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const ethers_1 = require("ethers");
|
|
6
|
+
const validator_1 = require("validator");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
6
8
|
const enums_1 = require("./enums");
|
|
7
9
|
const error_1 = require("./error");
|
|
8
|
-
const constants_1 = require("./constants");
|
|
9
10
|
/**
|
|
10
11
|
* **Handle and throw the error.*
|
|
11
12
|
*
|
|
@@ -43,13 +44,11 @@ exports.throwError = throwError;
|
|
|
43
44
|
* @returns
|
|
44
45
|
*/
|
|
45
46
|
const isValidUrl = (url) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
47
|
+
return (0, validator_1.isURL)(url, {
|
|
48
|
+
require_protocol: true,
|
|
49
|
+
protocols: ['http', 'https'],
|
|
50
|
+
require_tld: false,
|
|
51
|
+
});
|
|
53
52
|
};
|
|
54
53
|
exports.isValidUrl = isValidUrl;
|
|
55
54
|
/**
|
package/dist/worker.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class WorkerUtils {
|
|
|
6
6
|
*
|
|
7
7
|
* @param {ChainId} chainId The chain ID.
|
|
8
8
|
* @param {string} address The worker address.
|
|
9
|
-
* @returns {Promise<IWorker>} Returns the worker details.
|
|
9
|
+
* @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
|
|
10
10
|
*
|
|
11
11
|
* **Code example**
|
|
12
12
|
*
|
package/dist/worker.js
CHANGED
|
@@ -17,7 +17,7 @@ class WorkerUtils {
|
|
|
17
17
|
*
|
|
18
18
|
* @param {ChainId} chainId The chain ID.
|
|
19
19
|
* @param {string} address The worker address.
|
|
20
|
-
* @returns {Promise<IWorker>} Returns the worker details.
|
|
20
|
+
* @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
|
|
21
21
|
*
|
|
22
22
|
* **Code example**
|
|
23
23
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@human-protocol/sdk",
|
|
3
3
|
"description": "Human Protocol SDK",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
7
7
|
"dist"
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"minio": "7.1.3",
|
|
48
48
|
"openpgp": "^5.11.2",
|
|
49
49
|
"secp256k1": "^5.0.1",
|
|
50
|
+
"validator": "^13.12.0",
|
|
50
51
|
"vitest": "^3.0.9"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
package/src/escrow.ts
CHANGED
|
@@ -1783,7 +1783,7 @@ export class EscrowUtils {
|
|
|
1783
1783
|
*
|
|
1784
1784
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
1785
1785
|
* @param {string} escrowAddress Address of the escrow
|
|
1786
|
-
* @returns {IEscrow} Escrow data
|
|
1786
|
+
* @returns {Promise<IEscrow | null>} - Escrow data or null if not found.
|
|
1787
1787
|
*
|
|
1788
1788
|
* **Code example**
|
|
1789
1789
|
*
|
|
@@ -1796,7 +1796,7 @@ export class EscrowUtils {
|
|
|
1796
1796
|
public static async getEscrow(
|
|
1797
1797
|
chainId: ChainId,
|
|
1798
1798
|
escrowAddress: string
|
|
1799
|
-
): Promise<IEscrow> {
|
|
1799
|
+
): Promise<IEscrow | null> {
|
|
1800
1800
|
const networkData = NETWORKS[chainId];
|
|
1801
1801
|
|
|
1802
1802
|
if (!networkData) {
|
|
@@ -1812,6 +1812,7 @@ export class EscrowUtils {
|
|
|
1812
1812
|
GET_ESCROW_BY_ADDRESS_QUERY(),
|
|
1813
1813
|
{ escrowAddress: escrowAddress.toLowerCase() }
|
|
1814
1814
|
);
|
|
1815
|
+
escrow.chainId = networkData.chainId;
|
|
1815
1816
|
|
|
1816
1817
|
return escrow || null;
|
|
1817
1818
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,18 @@ export * from './types';
|
|
|
13
13
|
export * from './enums';
|
|
14
14
|
export * from './interfaces';
|
|
15
15
|
|
|
16
|
+
export {
|
|
17
|
+
EthereumError,
|
|
18
|
+
InvalidArgumentError,
|
|
19
|
+
ReplacementUnderpriced,
|
|
20
|
+
NumericFault,
|
|
21
|
+
NonceExpired,
|
|
22
|
+
TransactionReplaced,
|
|
23
|
+
ContractExecutionError,
|
|
24
|
+
InvalidEthereumAddressError,
|
|
25
|
+
InvalidKeyError,
|
|
26
|
+
} from './error';
|
|
27
|
+
|
|
16
28
|
export {
|
|
17
29
|
StakingClient,
|
|
18
30
|
StorageClient,
|
package/src/operator.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class OperatorUtils {
|
|
|
30
30
|
*
|
|
31
31
|
* @param {ChainId} chainId Network in which the operator is deployed
|
|
32
32
|
* @param {string} address Operator address.
|
|
33
|
-
* @returns {Promise<IOperator>} Returns the operator details.
|
|
33
|
+
* @returns {Promise<IOperator | null>} - Returns the operator details or null if not found.
|
|
34
34
|
*
|
|
35
35
|
* **Code example**
|
|
36
36
|
*
|
|
@@ -43,7 +43,7 @@ export class OperatorUtils {
|
|
|
43
43
|
public static async getOperator(
|
|
44
44
|
chainId: ChainId,
|
|
45
45
|
address: string
|
|
46
|
-
): Promise<IOperator> {
|
|
46
|
+
): Promise<IOperator | null> {
|
|
47
47
|
if (!ethers.isAddress(address)) {
|
|
48
48
|
throw ErrorInvalidStakerAddressProvided;
|
|
49
49
|
}
|
|
@@ -60,7 +60,7 @@ export class OperatorUtils {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
if (!operator) {
|
|
63
|
-
return
|
|
63
|
+
return null;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
let jobTypes: string[] = [];
|
package/src/transaction.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class TransactionUtils {
|
|
|
37
37
|
*
|
|
38
38
|
* @param {ChainId} chainId The chain ID.
|
|
39
39
|
* @param {string} hash The transaction hash.
|
|
40
|
-
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
40
|
+
* @returns {Promise<ITransaction | null>} - Returns the transaction details or null if not found.
|
|
41
41
|
*
|
|
42
42
|
* **Code example**
|
|
43
43
|
*
|
|
@@ -50,7 +50,7 @@ export class TransactionUtils {
|
|
|
50
50
|
public static async getTransaction(
|
|
51
51
|
chainId: ChainId,
|
|
52
52
|
hash: string
|
|
53
|
-
): Promise<ITransaction> {
|
|
53
|
+
): Promise<ITransaction | null> {
|
|
54
54
|
if (!ethers.isHexString(hash)) {
|
|
55
55
|
throw ErrorInvalidHashProvided;
|
|
56
56
|
}
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
+
import { isURL } from 'validator';
|
|
5
|
+
import { SUBGRAPH_API_KEY_PLACEHOLDER } from './constants';
|
|
4
6
|
import { ChainId } from './enums';
|
|
5
7
|
import {
|
|
6
8
|
ContractExecutionError,
|
|
@@ -13,7 +15,6 @@ import {
|
|
|
13
15
|
WarnSubgraphApiKeyNotProvided,
|
|
14
16
|
} from './error';
|
|
15
17
|
import { NetworkData } from './types';
|
|
16
|
-
import { SUBGRAPH_API_KEY_PLACEHOLDER } from './constants';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* **Handle and throw the error.*
|
|
@@ -45,13 +46,12 @@ export const throwError = (e: any) => {
|
|
|
45
46
|
* @param {string} url
|
|
46
47
|
* @returns
|
|
47
48
|
*/
|
|
48
|
-
export const isValidUrl = (url: string) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
49
|
+
export const isValidUrl = (url: string): boolean => {
|
|
50
|
+
return isURL(url, {
|
|
51
|
+
require_protocol: true,
|
|
52
|
+
protocols: ['http', 'https'],
|
|
53
|
+
require_tld: false,
|
|
54
|
+
});
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/**
|
package/src/worker.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class WorkerUtils {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {ChainId} chainId The chain ID.
|
|
15
15
|
* @param {string} address The worker address.
|
|
16
|
-
* @returns {Promise<IWorker>} Returns the worker details.
|
|
16
|
+
* @returns {Promise<IWorker | null>} - Returns the worker details or null if not found.
|
|
17
17
|
*
|
|
18
18
|
* **Code example**
|
|
19
19
|
*
|