@human-protocol/sdk 3.0.8 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/constants.d.ts +4 -1
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +11 -151
  4. package/dist/decorators.js +1 -1
  5. package/dist/encryption.d.ts +21 -29
  6. package/dist/encryption.d.ts.map +1 -1
  7. package/dist/encryption.js +17 -29
  8. package/dist/enums.d.ts +5 -12
  9. package/dist/enums.d.ts.map +1 -1
  10. package/dist/enums.js +6 -12
  11. package/dist/error.d.ts +31 -28
  12. package/dist/error.d.ts.map +1 -1
  13. package/dist/error.js +36 -33
  14. package/dist/escrow.d.ts +104 -88
  15. package/dist/escrow.d.ts.map +1 -1
  16. package/dist/escrow.js +192 -131
  17. package/dist/graphql/queries/operator.d.ts.map +1 -1
  18. package/dist/graphql/queries/operator.js +15 -5
  19. package/dist/interfaces.d.ts +12 -2
  20. package/dist/interfaces.d.ts.map +1 -1
  21. package/dist/kvstore.d.ts +15 -15
  22. package/dist/kvstore.d.ts.map +1 -1
  23. package/dist/kvstore.js +15 -15
  24. package/dist/operator.d.ts +11 -10
  25. package/dist/operator.d.ts.map +1 -1
  26. package/dist/operator.js +23 -11
  27. package/dist/staking.d.ts +38 -21
  28. package/dist/staking.d.ts.map +1 -1
  29. package/dist/staking.js +62 -21
  30. package/dist/statistics.d.ts +10 -29
  31. package/dist/statistics.d.ts.map +1 -1
  32. package/dist/statistics.js +18 -37
  33. package/dist/storage.d.ts +13 -18
  34. package/dist/storage.d.ts.map +1 -1
  35. package/dist/storage.js +13 -18
  36. package/dist/transaction.d.ts.map +1 -1
  37. package/dist/transaction.js +3 -5
  38. package/dist/types.d.ts +6 -2
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/types.js +1 -1
  41. package/dist/utils.d.ts +7 -1
  42. package/dist/utils.d.ts.map +1 -1
  43. package/dist/utils.js +11 -2
  44. package/package.json +1 -1
  45. package/src/constants.ts +11 -174
  46. package/src/decorators.ts +1 -1
  47. package/src/encryption.ts +21 -29
  48. package/src/enums.ts +5 -11
  49. package/src/error.ts +39 -37
  50. package/src/escrow.ts +257 -151
  51. package/src/graphql/queries/operator.ts +15 -5
  52. package/src/interfaces.ts +13 -2
  53. package/src/kvstore.ts +16 -16
  54. package/src/operator.ts +26 -12
  55. package/src/staking.ts +71 -22
  56. package/src/statistics.ts +19 -38
  57. package/src/storage.ts +13 -18
  58. package/src/transaction.ts +5 -7
  59. package/src/types.ts +6 -2
  60. package/src/utils.ts +10 -1
package/dist/enums.js CHANGED
@@ -1,30 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrderDirection = exports.ChainId = void 0;
3
+ exports.LeaderCategory = exports.OrderDirection = exports.ChainId = void 0;
4
4
  var ChainId;
5
5
  (function (ChainId) {
6
6
  ChainId[ChainId["ALL"] = -1] = "ALL";
7
7
  ChainId[ChainId["MAINNET"] = 1] = "MAINNET";
8
- ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY";
9
- ChainId[ChainId["GOERLI"] = 5] = "GOERLI";
10
8
  ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
11
9
  ChainId[ChainId["BSC_MAINNET"] = 56] = "BSC_MAINNET";
12
10
  ChainId[ChainId["BSC_TESTNET"] = 97] = "BSC_TESTNET";
13
11
  ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
14
- ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI";
15
12
  ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY";
16
- ChainId[ChainId["MOONBEAM"] = 1284] = "MOONBEAM";
17
- ChainId[ChainId["MOONBASE_ALPHA"] = 1287] = "MOONBASE_ALPHA";
18
- ChainId[ChainId["AVALANCHE_TESTNET"] = 43113] = "AVALANCHE_TESTNET";
19
- ChainId[ChainId["AVALANCHE"] = 43114] = "AVALANCHE";
20
- ChainId[ChainId["CELO"] = 42220] = "CELO";
21
- ChainId[ChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES";
22
- ChainId[ChainId["XLAYER_TESTNET"] = 195] = "XLAYER_TESTNET";
23
13
  ChainId[ChainId["LOCALHOST"] = 1338] = "LOCALHOST";
24
- ChainId[ChainId["XLAYER"] = 196] = "XLAYER";
25
14
  })(ChainId || (exports.ChainId = ChainId = {}));
26
15
  var OrderDirection;
27
16
  (function (OrderDirection) {
28
17
  OrderDirection["ASC"] = "asc";
29
18
  OrderDirection["DESC"] = "desc";
30
19
  })(OrderDirection || (exports.OrderDirection = OrderDirection = {}));
20
+ var LeaderCategory;
21
+ (function (LeaderCategory) {
22
+ LeaderCategory["MACHINE_LEARNING"] = "machine_learning";
23
+ LeaderCategory["MARKET_MAKING"] = "market_making";
24
+ })(LeaderCategory || (exports.LeaderCategory = LeaderCategory = {}));
package/dist/error.d.ts CHANGED
@@ -3,15 +3,15 @@
3
3
  */
4
4
  export declare const ErrorStakingMissing: Error;
5
5
  /**
6
- * @constant {Error} - The Storage client not initialised.
6
+ * @constant {Error} - The Storage client not initialized.
7
7
  */
8
8
  export declare const ErrorStorageClientNotInitialized: Error;
9
9
  /**
10
- * @constant {Error} - The Storage does not exists.
10
+ * @constant {Error} - The Storage client does not exist.
11
11
  */
12
12
  export declare const ErrorStorageClientNotExists: Error;
13
13
  /**
14
- * @constant {Error} - The Storage credentials is missing.
14
+ * @constant {Error} - The Storage credentials are missing.
15
15
  */
16
16
  export declare const ErrorStorageCredentialsMissing: Error;
17
17
  /**
@@ -27,7 +27,7 @@ export declare const ErrorStorageFileNotFound: Error;
27
27
  */
28
28
  export declare const ErrorStorageFileNotUploaded: Error;
29
29
  /**
30
- * @constant {Error} - The KVStore key can not be empty.
30
+ * @constant {Error} - The KVStore key cannot be empty.
31
31
  */
32
32
  export declare const ErrorKVStoreEmptyKey: Error;
33
33
  /**
@@ -35,11 +35,11 @@ export declare const ErrorKVStoreEmptyKey: Error;
35
35
  */
36
36
  export declare const ErrorKVStoreArrayLength: Error;
37
37
  /**
38
- * @constant {Error} - The Address sent is invalid.
38
+ * @constant {Error} - The address provided is invalid.
39
39
  */
40
40
  export declare const ErrorInvalidAddress: Error;
41
41
  /**
42
- * @constant {Error} - The token address sent is invalid.
42
+ * @constant {Error} - The token address provided is invalid.
43
43
  */
44
44
  export declare const ErrorInvalidTokenAddress: Error;
45
45
  /**
@@ -51,11 +51,11 @@ export declare const ErrorInvalidRecordingOracleAddressProvided: Error;
51
51
  */
52
52
  export declare const ErrorInvalidReputationOracleAddressProvided: Error;
53
53
  /**
54
- * @constant {Error} - Invalid reputation oracle address provided.
54
+ * @constant {Error} - Invalid exchange oracle address provided.
55
55
  */
56
56
  export declare const ErrorInvalidExchangeOracleAddressProvided: Error;
57
57
  /**
58
- * @constant {Error} - The Staking value must be positive.
58
+ * @constant {Error} - The staking value must be positive.
59
59
  */
60
60
  export declare const ErrorStakingValueMustBePositive: Error;
61
61
  /**
@@ -77,7 +77,7 @@ export declare const ErrorInvalidStakerAddressProvided: Error;
77
77
  /**
78
78
  * @constant {Error} - Invalid hash provided.
79
79
  */
80
- export declare const ErrorInvalidHahsProvided: Error;
80
+ export declare const ErrorInvalidHashProvided: Error;
81
81
  /**
82
82
  * @constant {Error} - Cannot use both date and block filters simultaneously.
83
83
  */
@@ -94,17 +94,20 @@ export declare const ErrorStakingGetStakers: Error;
94
94
  * @constant {Error} - Failed to approve staking amount: signerOrProvider is not a Signer instance.
95
95
  */
96
96
  export declare const ErrorFailedToApproveStakingAmountSignerDoesNotExist: Error;
97
+ /**
98
+ * @constant {Error} - Failed to check allowance.
99
+ */
97
100
  export declare const ErrorFailedToCheckAllowance: Error;
98
101
  /**
99
102
  * @constant {Error} - The HMToken amount not approved.
100
103
  */
101
104
  export declare const ErrorHMTokenAmountNotApproved: Error;
102
105
  /**
103
- * @constant {Error} - Init provider does not exists.
106
+ * @constant {Error} - Provider does not exist.
104
107
  */
105
108
  export declare const ErrorProviderDoesNotExist: Error;
106
109
  /**
107
- * @constant {Error} - Init with unsupported chain ID.
110
+ * @constant {Error} - Unsupported chain ID.
108
111
  */
109
112
  export declare const ErrorUnsupportedChainID: Error;
110
113
  /**
@@ -123,10 +126,6 @@ export declare const ErrorTransferEventNotFoundInTransactionLogs: Error;
123
126
  * @constant {Error} - Manifest file does not exist.
124
127
  */
125
128
  export declare const ErrorManifestFileDoesNotExist: Error;
126
- /**
127
- * @constant {Error} - Storage client does not exist.
128
- */
129
- export declare const ErrorStorageClientDoesNotExist: Error;
130
129
  /**
131
130
  * @constant {Error} - Invalid URL string.
132
131
  */
@@ -156,7 +155,11 @@ export declare const ErrorTotalFeeMustBeLessThanHundred: Error;
156
155
  */
157
156
  export declare const ErrorRecipientCannotBeEmptyArray: Error;
158
157
  /**
159
- * @constant {Error} - Amount must be greater than zero..
158
+ * @constant {Error} - Too many recipients.
159
+ */
160
+ export declare const ErrorTooManyRecipients: Error;
161
+ /**
162
+ * @constant {Error} - Amount must be greater than zero.
160
163
  */
161
164
  export declare const ErrorAmountMustBeGreaterThanZero: Error;
162
165
  /**
@@ -179,6 +182,18 @@ export declare const ErrorLaunchedEventIsNotEmitted: Error;
179
182
  * @constant {Error} - Hash is an empty string.
180
183
  */
181
184
  export declare const ErrorHashIsEmptyString: Error;
185
+ /**
186
+ * @constant {Error} - The hash does not match.
187
+ */
188
+ export declare const ErrorInvalidHash: Error;
189
+ /**
190
+ * @constant {Error} - The status is not supported.
191
+ */
192
+ export declare const ErrorUnsupportedStatus: Error;
193
+ /**
194
+ * @constant {Warning} - The SUBGRAPH_API_KEY is not being provided.
195
+ */
196
+ export declare const WarnSubgraphApiKeyNotProvided = "\"SUBGRAPH_API_KEY\" is not being provided. It might cause issues with the subgraph.";
182
197
  export declare class EthereumError extends Error {
183
198
  constructor(message: string);
184
199
  }
@@ -203,18 +218,6 @@ export declare class ContractExecutionError extends EthereumError {
203
218
  export declare class InvalidEthereumAddressError extends Error {
204
219
  constructor(address: string);
205
220
  }
206
- /**
207
- * @constant {Error} - The Hash does not match
208
- */
209
- export declare const ErrorInvalidHash: Error;
210
- /**
211
- * @constant {Error} - The Status is not supported
212
- */
213
- export declare const ErrorUnsupportedStatus: Error;
214
- /**
215
- * @constant {Error} - The SUBGRAPH_API_KEY is not being provided
216
- */
217
- export declare const WarnSubgraphApiKeyNotProvided = "\"SUBGRAPH_API_KEY\" is not being provided. It might cause issues with the subgraph.";
218
221
  export declare class InvalidKeyError extends Error {
219
222
  constructor(key: string, address: string);
220
223
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,OAA2C,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,gCAAgC,OAE5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,OAEvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,OAE1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,OAAgC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,wBAAwB,OAA8B,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,2BAA2B,OAAiC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,oBAAoB,OAAoC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,uBAAuB,OAEnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,OAA+B,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,wBAAwB,OAAqC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,0CAA0C,OAEtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2CAA2C,OAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yCAAyC,OAErD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,OAE3C,CAAC;AAEF;;G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EhF;;GAEG;AACH,eAAO,MAAM,6BAA6B,yFAC4C,CAAC;AAEvF,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,oBAAqB,SAAQ,aAAa;gBACzC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,mBAAoB,SAAQ,aAAa;gBACxC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGzC"}
package/dist/error.js CHANGED
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NumericFault = exports.ReplacementUnderpriced = exports.InvalidArgumentError = exports.EthereumError = exports.ErrorHashIsEmptyString = exports.ErrorLaunchedEventIsNotEmitted = exports.ErrorRecipientAndAmountsMustBeSameLength = exports.ErrorAmountsCannotBeEmptyArray = exports.ErrorEscrowDoesNotHaveEnoughBalance = exports.ErrorAmountMustBeGreaterThanZero = exports.ErrorRecipientCannotBeEmptyArray = exports.ErrorTotalFeeMustBeLessThanHundred = exports.ErrorFeeMustBeBetweenZeroAndHundred = exports.ErrorNoURLprovided = exports.ErrorListOfHandlersCannotBeEmpty = exports.ErrorUrlIsEmptyString = exports.ErrorInvalidUrl = exports.ErrorStorageClientDoesNotExist = exports.ErrorManifestFileDoesNotExist = exports.ErrorTransferEventNotFoundInTransactionLogs = exports.ErrorEscrowAddressIsNotProvidedByFactory = exports.ErrorSigner = exports.ErrorUnsupportedChainID = exports.ErrorProviderDoesNotExist = exports.ErrorHMTokenAmountNotApproved = exports.ErrorFailedToCheckAllowance = exports.ErrorFailedToApproveStakingAmountSignerDoesNotExist = exports.ErrorStakingGetStakers = exports.ErrorInvalidEscrowAddressProvided = exports.ErrorCannotUseDateAndBlockSimultaneously = exports.ErrorInvalidHahsProvided = exports.ErrorInvalidStakerAddressProvided = exports.ErrorInvalidSlasherAddressProvided = exports.ErrorInvalidStakingValueSign = exports.ErrorInvalidStakingValueType = exports.ErrorStakingValueMustBePositive = exports.ErrorInvalidExchangeOracleAddressProvided = exports.ErrorInvalidReputationOracleAddressProvided = exports.ErrorInvalidRecordingOracleAddressProvided = exports.ErrorInvalidTokenAddress = exports.ErrorInvalidAddress = exports.ErrorKVStoreArrayLength = exports.ErrorKVStoreEmptyKey = exports.ErrorStorageFileNotUploaded = exports.ErrorStorageFileNotFound = exports.ErrorStorageBucketNotFound = exports.ErrorStorageCredentialsMissing = exports.ErrorStorageClientNotExists = exports.ErrorStorageClientNotInitialized = exports.ErrorStakingMissing = void 0;
4
- exports.InvalidKeyError = exports.WarnSubgraphApiKeyNotProvided = exports.ErrorUnsupportedStatus = exports.ErrorInvalidHash = exports.InvalidEthereumAddressError = exports.ContractExecutionError = exports.TransactionReplaced = exports.NonceExpired = void 0;
3
+ exports.EthereumError = exports.WarnSubgraphApiKeyNotProvided = exports.ErrorUnsupportedStatus = exports.ErrorInvalidHash = exports.ErrorHashIsEmptyString = exports.ErrorLaunchedEventIsNotEmitted = exports.ErrorRecipientAndAmountsMustBeSameLength = exports.ErrorAmountsCannotBeEmptyArray = exports.ErrorEscrowDoesNotHaveEnoughBalance = exports.ErrorAmountMustBeGreaterThanZero = exports.ErrorTooManyRecipients = exports.ErrorRecipientCannotBeEmptyArray = exports.ErrorTotalFeeMustBeLessThanHundred = exports.ErrorFeeMustBeBetweenZeroAndHundred = exports.ErrorNoURLprovided = exports.ErrorListOfHandlersCannotBeEmpty = exports.ErrorUrlIsEmptyString = exports.ErrorInvalidUrl = exports.ErrorManifestFileDoesNotExist = exports.ErrorTransferEventNotFoundInTransactionLogs = exports.ErrorEscrowAddressIsNotProvidedByFactory = exports.ErrorSigner = exports.ErrorUnsupportedChainID = exports.ErrorProviderDoesNotExist = exports.ErrorHMTokenAmountNotApproved = exports.ErrorFailedToCheckAllowance = exports.ErrorFailedToApproveStakingAmountSignerDoesNotExist = exports.ErrorStakingGetStakers = exports.ErrorInvalidEscrowAddressProvided = exports.ErrorCannotUseDateAndBlockSimultaneously = exports.ErrorInvalidHashProvided = exports.ErrorInvalidStakerAddressProvided = exports.ErrorInvalidSlasherAddressProvided = exports.ErrorInvalidStakingValueSign = exports.ErrorInvalidStakingValueType = exports.ErrorStakingValueMustBePositive = exports.ErrorInvalidExchangeOracleAddressProvided = exports.ErrorInvalidReputationOracleAddressProvided = exports.ErrorInvalidRecordingOracleAddressProvided = exports.ErrorInvalidTokenAddress = exports.ErrorInvalidAddress = exports.ErrorKVStoreArrayLength = exports.ErrorKVStoreEmptyKey = exports.ErrorStorageFileNotUploaded = exports.ErrorStorageFileNotFound = exports.ErrorStorageBucketNotFound = exports.ErrorStorageCredentialsMissing = exports.ErrorStorageClientNotExists = exports.ErrorStorageClientNotInitialized = exports.ErrorStakingMissing = void 0;
4
+ exports.InvalidKeyError = exports.InvalidEthereumAddressError = exports.ContractExecutionError = exports.TransactionReplaced = exports.NonceExpired = exports.NumericFault = exports.ReplacementUnderpriced = exports.InvalidArgumentError = void 0;
5
5
  /**
6
6
  * @constant {Error} - The Staking contract is missing.
7
7
  */
8
8
  exports.ErrorStakingMissing = new Error('Staking contract is missing');
9
9
  /**
10
- * @constant {Error} - The Storage client not initialised.
10
+ * @constant {Error} - The Storage client not initialized.
11
11
  */
12
12
  exports.ErrorStorageClientNotInitialized = new Error('Storage client not initialized');
13
13
  /**
14
- * @constant {Error} - The Storage does not exists.
14
+ * @constant {Error} - The Storage client does not exist.
15
15
  */
16
- exports.ErrorStorageClientNotExists = new Error('Storage client does not exists');
16
+ exports.ErrorStorageClientNotExists = new Error('Storage client does not exist');
17
17
  /**
18
- * @constant {Error} - The Storage credentials is missing.
18
+ * @constant {Error} - The Storage credentials are missing.
19
19
  */
20
- exports.ErrorStorageCredentialsMissing = new Error('Storage credentials is missing');
20
+ exports.ErrorStorageCredentialsMissing = new Error('Storage credentials are missing');
21
21
  /**
22
22
  * @constant {Error} - The Storage bucket not found.
23
23
  */
@@ -31,19 +31,19 @@ exports.ErrorStorageFileNotFound = new Error('File not found');
31
31
  */
32
32
  exports.ErrorStorageFileNotUploaded = new Error('File not uploaded');
33
33
  /**
34
- * @constant {Error} - The KVStore key can not be empty.
34
+ * @constant {Error} - The KVStore key cannot be empty.
35
35
  */
36
- exports.ErrorKVStoreEmptyKey = new Error('Key can not be empty');
36
+ exports.ErrorKVStoreEmptyKey = new Error('Key cannot be empty');
37
37
  /**
38
38
  * @constant {Error} - The KVStore arrays must have the same length.
39
39
  */
40
40
  exports.ErrorKVStoreArrayLength = new Error('Arrays must have the same length');
41
41
  /**
42
- * @constant {Error} - The Address sent is invalid.
42
+ * @constant {Error} - The address provided is invalid.
43
43
  */
44
44
  exports.ErrorInvalidAddress = new Error('Invalid address');
45
45
  /**
46
- * @constant {Error} - The token address sent is invalid.
46
+ * @constant {Error} - The token address provided is invalid.
47
47
  */
48
48
  exports.ErrorInvalidTokenAddress = new Error('Invalid token address');
49
49
  /**
@@ -55,11 +55,11 @@ exports.ErrorInvalidRecordingOracleAddressProvided = new Error('Invalid recordin
55
55
  */
56
56
  exports.ErrorInvalidReputationOracleAddressProvided = new Error('Invalid reputation oracle address provided');
57
57
  /**
58
- * @constant {Error} - Invalid reputation oracle address provided.
58
+ * @constant {Error} - Invalid exchange oracle address provided.
59
59
  */
60
60
  exports.ErrorInvalidExchangeOracleAddressProvided = new Error('Invalid exchange oracle address provided');
61
61
  /**
62
- * @constant {Error} - The Staking value must be positive.
62
+ * @constant {Error} - The staking value must be positive.
63
63
  */
64
64
  exports.ErrorStakingValueMustBePositive = new Error('Value must be positive');
65
65
  /**
@@ -81,7 +81,7 @@ exports.ErrorInvalidStakerAddressProvided = new Error('Invalid staker address pr
81
81
  /**
82
82
  * @constant {Error} - Invalid hash provided.
83
83
  */
84
- exports.ErrorInvalidHahsProvided = new Error('Invalid hash provided');
84
+ exports.ErrorInvalidHashProvided = new Error('Invalid hash provided');
85
85
  /**
86
86
  * @constant {Error} - Cannot use both date and block filters simultaneously.
87
87
  */
@@ -98,17 +98,20 @@ exports.ErrorStakingGetStakers = new Error('Error getting stakers data');
98
98
  * @constant {Error} - Failed to approve staking amount: signerOrProvider is not a Signer instance.
99
99
  */
100
100
  exports.ErrorFailedToApproveStakingAmountSignerDoesNotExist = new Error('Failed to approve staking amount: signerOrProvider is not a Signer instance');
101
+ /**
102
+ * @constant {Error} - Failed to check allowance.
103
+ */
101
104
  exports.ErrorFailedToCheckAllowance = new Error('Failed to check allowance');
102
105
  /**
103
106
  * @constant {Error} - The HMToken amount not approved.
104
107
  */
105
108
  exports.ErrorHMTokenAmountNotApproved = new Error('Amount not approved');
106
109
  /**
107
- * @constant {Error} - Init provider does not exists.
110
+ * @constant {Error} - Provider does not exist.
108
111
  */
109
112
  exports.ErrorProviderDoesNotExist = new Error('Provider does not exist');
110
113
  /**
111
- * @constant {Error} - Init with unsupported chain ID.
114
+ * @constant {Error} - Unsupported chain ID.
112
115
  */
113
116
  exports.ErrorUnsupportedChainID = new Error('Unsupported chain ID');
114
117
  /**
@@ -127,10 +130,6 @@ exports.ErrorTransferEventNotFoundInTransactionLogs = new Error('Transfer event
127
130
  * @constant {Error} - Manifest file does not exist.
128
131
  */
129
132
  exports.ErrorManifestFileDoesNotExist = new Error('Manifest file does not exist');
130
- /**
131
- * @constant {Error} - Storage client does not exist.
132
- */
133
- exports.ErrorStorageClientDoesNotExist = new Error('Storage client does not exist');
134
133
  /**
135
134
  * @constant {Error} - Invalid URL string.
136
135
  */
@@ -160,7 +159,11 @@ exports.ErrorTotalFeeMustBeLessThanHundred = new Error('Total fee must be less t
160
159
  */
161
160
  exports.ErrorRecipientCannotBeEmptyArray = new Error('Recipient cannot be an empty array');
162
161
  /**
163
- * @constant {Error} - Amount must be greater than zero..
162
+ * @constant {Error} - Too many recipients.
163
+ */
164
+ exports.ErrorTooManyRecipients = new Error('Too many recipients');
165
+ /**
166
+ * @constant {Error} - Amount must be greater than zero.
164
167
  */
165
168
  exports.ErrorAmountMustBeGreaterThanZero = new Error('Amount must be greater than zero');
166
169
  /**
@@ -183,6 +186,18 @@ exports.ErrorLaunchedEventIsNotEmitted = new Error('Launched event is not emitte
183
186
  * @constant {Error} - Hash is an empty string.
184
187
  */
185
188
  exports.ErrorHashIsEmptyString = new Error('Hash is an empty string');
189
+ /**
190
+ * @constant {Error} - The hash does not match.
191
+ */
192
+ exports.ErrorInvalidHash = new Error('Invalid hash');
193
+ /**
194
+ * @constant {Error} - The status is not supported.
195
+ */
196
+ exports.ErrorUnsupportedStatus = new Error('Unsupported status for query');
197
+ /**
198
+ * @constant {Warning} - The SUBGRAPH_API_KEY is not being provided.
199
+ */
200
+ exports.WarnSubgraphApiKeyNotProvided = '"SUBGRAPH_API_KEY" is not being provided. It might cause issues with the subgraph.';
186
201
  class EthereumError extends Error {
187
202
  constructor(message) {
188
203
  super(`An error occurred while interacting with Ethereum: ${message}`);
@@ -231,18 +246,6 @@ class InvalidEthereumAddressError extends Error {
231
246
  }
232
247
  }
233
248
  exports.InvalidEthereumAddressError = InvalidEthereumAddressError;
234
- /**
235
- * @constant {Error} - The Hash does not match
236
- */
237
- exports.ErrorInvalidHash = new Error('Invalid hash');
238
- /**
239
- * @constant {Error} - The Status is not supported
240
- */
241
- exports.ErrorUnsupportedStatus = new Error('Unsupported status for query');
242
- /**
243
- * @constant {Error} - The SUBGRAPH_API_KEY is not being provided
244
- */
245
- exports.WarnSubgraphApiKeyNotProvided = '"SUBGRAPH_API_KEY" is not being provided. It might cause issues with the subgraph.';
246
249
  class InvalidKeyError extends Error {
247
250
  constructor(key, address) {
248
251
  super(`Key "${key}" not found for address ${address}`);